]> git.uio.no Git - u/mrichter/AliRoot.git/blob - CORRFW/AliCFPairIsPrimaryCuts.cxx
corrected bad default constructor (A. Gheata)
[u/mrichter/AliRoot.git] / CORRFW / AliCFPairIsPrimaryCuts.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16
17 ///////////////////////////////////////////////////////
18 // Class to handle primariness criteria in track pairs
19 // The track pair object to use is AliCFPair
20 // author : renaud.vernet@cern.ch
21 ///////////////////////////////////////////////////////
22
23
24 #include "AliCFPairIsPrimaryCuts.h"
25 #include "AliCFPair.h"
26
27 ClassImp(AliCFPairIsPrimaryCuts)
28
29 //__________________________________________________________________________________
30 AliCFPairIsPrimaryCuts::AliCFPairIsPrimaryCuts() :
31   AliCFCutBase(),
32   fCutNeg(new AliCFTrackIsPrimaryCuts()),
33   fCutPos(new AliCFTrackIsPrimaryCuts())
34 {
35   //
36   // Default constructor
37   //
38 }
39 //__________________________________________________________________________________
40 AliCFPairIsPrimaryCuts::AliCFPairIsPrimaryCuts(Char_t* name, Char_t* title) :
41   AliCFCutBase(name,title),
42   fCutNeg(new AliCFTrackIsPrimaryCuts(name,title)),
43   fCutPos(new AliCFTrackIsPrimaryCuts(name,title))
44 {
45   //
46   // Named Constructor
47   //
48 }
49 //__________________________________________________________________________________
50 AliCFPairIsPrimaryCuts::AliCFPairIsPrimaryCuts(const AliCFPairIsPrimaryCuts& c) :
51   AliCFCutBase(c),
52   fCutNeg(c.fCutNeg),
53   fCutPos(c.fCutPos)
54 {
55   //
56   // copy constructor
57   //
58 }
59 //__________________________________________________________________________________
60 AliCFPairIsPrimaryCuts& AliCFPairIsPrimaryCuts::operator=(const AliCFPairIsPrimaryCuts& c)
61 {
62   //
63   // Assignment operator
64   //
65   if (this != &c) {
66     AliCFCutBase::operator=(c) ;
67     fCutNeg = c.fCutNeg ;
68     fCutPos = c.fCutPos ;
69   }
70   return *this;
71 }
72
73 //__________________________________________________________________________________
74 Bool_t AliCFPairIsPrimaryCuts::IsSelected(TObject* obj) {
75   //
76   // loops over decisions of single cuts and returns if the track is accepted
77   //
78
79   if (!obj) return kFALSE ;
80   TString className(obj->ClassName());
81   if (className.CompareTo("AliCFPair") != 0) {
82     Error("IsSelected","obj must point to a AliCFPair !");
83     return kFALSE ;
84   }
85
86   AliCFPair* pair = dynamic_cast<AliCFPair*>(obj);
87
88   AliVParticle* tneg = pair->GetNeg();
89   AliVParticle* tpos = pair->GetPos();
90   if (!tneg || !tpos) return kFALSE ;
91
92   if ( ! fCutNeg->IsSelected((TObject*)tneg) || ! fCutPos->IsSelected((TObject*)tpos) ) return kFALSE ;
93
94   return kTRUE ;
95 }