1 #include "AliAODParticleBaseCut.h"
2 //__________________________________________________________________________
3 ////////////////////////////////////////////////////////////////////////////
5 // class AliAODParticleBaseCut //
7 // Set of classes for performing cuts on particle properties of //
8 // AliAODParticleBaseCut is a base class for "base //
9 // particle cuts". Further, there are implemented classes that performs //
10 // cuts on the most common particle properties like pt, pseudo rapidity, //
11 // angles, anergy, etc. //
13 // There are also implemeted base cuts that perform logical operations //
14 // on results of base particle cuts: AliAODOrCut and AliAODAndCut. //
16 // Each base cut has a property, thet allows to distinguish them. //
17 // This functionality is used by the interface methods of Particle Cut //
18 // that allows easy update ranges. //
20 // more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html //
21 // responsible: Piotr Skowronski@cern.ch //
23 ////////////////////////////////////////////////////////////////////////////
26 #include <Riostream.h>
28 ClassImp(AliAODParticleBaseCut)
29 void AliAODParticleBaseCut::Print(const Option_t * /*opt*/) const
31 // prints the information anout the base cut to stdout
32 cout<<"fMin="<<fMin <<", fMax=" <<fMax<<" ";
35 /******************************************************************/
37 void AliAODParticleBaseCut::PrintProperty(void) const
39 //prints the property name
45 cout<<"kAODPt"; break;
49 cout<<"kAODRapidity"; break;
50 case kAODPseudoRapidity:
51 cout<<"kAODPseudoRapidity"; break;
53 cout<<"kAODPx"; break;
55 cout<<"kAODPy"; break;
57 cout<<"kAODPz"; break;
59 cout<<"kAODPhi"; break;
61 cout<<"kAODTheta"; break;
63 cout<<"kAODVx"; break;
65 cout<<"kAODVy"; break;
67 cout<<"kAODVz"; break;
69 cout<<"kAODPid"; break;
71 cout<<"kAODNone"; break;
73 cout<<"Property Not Found";
77 ClassImp( AliAODMomentumCut )
79 ClassImp( AliAODPtCut )
80 ClassImp( AliAODEnergyCut )
81 ClassImp( AliAODRapidityCut )
82 ClassImp( AliAODPseudoRapidityCut )
83 ClassImp( AliAODPxCut )
84 ClassImp( AliAODPyCut )
85 ClassImp( AliAODPzCut )
86 ClassImp( AliAODPhiCut )
87 ClassImp( AliAODThetaCut )
88 ClassImp( AliAODVxCut )
89 ClassImp( AliAODVyCut )
90 ClassImp( AliAODVzCut )
92 ClassImp( AliAODPIDCut )
94 void AliAODPIDCut::Print(const Option_t * /*opt*/) const
96 cout<<"PID "<<fPID<<" ";
97 AliAODParticleBaseCut::Print();
100 ClassImp( AliAODLogicalOperCut )
102 AliAODLogicalOperCut::AliAODLogicalOperCut():
103 AliAODParticleBaseCut(-10e10,10e10,kAODNone),
104 fFirst(new AliAODDummyBaseCut),
105 fSecond(new AliAODDummyBaseCut)
109 /******************************************************************/
111 AliAODLogicalOperCut::AliAODLogicalOperCut(AliAODParticleBaseCut* first, AliAODParticleBaseCut* second):
112 AliAODParticleBaseCut(-10e10,10e10,kAODNone),
113 fFirst((first)?(AliAODParticleBaseCut*)first->Clone():0x0),
114 fSecond((second)?(AliAODParticleBaseCut*)second->Clone():0x0)
117 if ( (fFirst && fSecond) == kFALSE)
119 Fatal("AliAODLogicalOperCut","One of parameters is NULL!");
122 /******************************************************************/
124 AliAODLogicalOperCut::~AliAODLogicalOperCut()
130 /******************************************************************/
132 Bool_t AliAODLogicalOperCut::AliAODDummyBaseCut::Rejected(AliVAODParticle* /*part*/) const
134 //checks if particles passes properties defined by this cut
135 Warning("Pass","You are using dummy base cut! Probobly some logical cut is not set up properly");
136 return kFALSE;//accept
138 /******************************************************************/
140 void AliAODLogicalOperCut::Streamer(TBuffer &b)
142 // Stream all objects in the array to or from the I/O buffer.
151 b.ReadVersion(&R__s, &R__c);
152 TObject::Streamer(b);
155 b.CheckByteCount(R__s, R__c,AliAODLogicalOperCut::IsA());
159 R__c = b.WriteVersion(AliAODLogicalOperCut::IsA(), kTRUE);
160 TObject::Streamer(b);
163 b.SetByteCount(R__c, kTRUE);
167 /******************************************************************/
168 ClassImp(AliAODOrCut)
170 Bool_t AliAODOrCut::Rejected(AliVAODParticle * p) const
172 //returns true when rejected
173 //AND operation is a little bit misleading but is correct
174 //User wants to build logical cuts with natural (positive) logic
175 //while AODAN use inernally reverse (returns true when rejected)
176 if (fFirst->Rejected(p) && fSecond->Rejected(p)) return kTRUE;//rejected (both rejected, returned kTRUE)
177 return kFALSE;//accepted, at least one accepted (returned kFALSE)
179 /******************************************************************/
181 ClassImp(AliAODAndCut)
183 Bool_t AliAODAndCut::Rejected(AliVAODParticle * p) const
185 //returns true when rejected
186 //OR operation is a little bit misleading but is correct
187 //User wants to build logical cuts with natural (positive) logic
188 //while AODAN use inernally reverse (returns true when rejected)
189 if (fFirst->Rejected(p) || fSecond->Rejected(p)) return kTRUE;//rejected (any of two rejected(returned kTRUE) )
190 return kFALSE;//accepted (both accepted (returned kFALSE))
192 /******************************************************************/