1 #include "AliAODPairBaseCut.h"
3 #include "AliTrackPoints.h"
4 #include "AliClusterMap.h"
7 ClassImp(AliAODPairBaseCut)
8 ClassImp(AliAODQInvCut)
10 ClassImp(AliAODQSideLCMSCut)
11 ClassImp(AliAODQOutLCMSCut)
12 ClassImp(AliAODQLongLCMSCut)
14 /******************************************************************/
15 ClassImp(AliAODAvSeparationCut)
17 Double_t AliAODAvSeparationCut::GetValue(AliAODPair* pair) const
19 //chacks if avarage distance of two tracks is in given range
20 AliTrackPoints* tpts1 = pair->Particle1()->GetTPCTrackPoints();
22 {//it could be simulated pair
23 // Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
27 AliTrackPoints* tpts2 = pair->Particle2()->GetTPCTrackPoints();
30 // Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
34 return tpts1->AvarageDistance(*tpts2);
36 /******************************************************************/
37 ClassImp(AliAODSeparationCut)
39 Double_t AliAODSeparationCut::GetValue(AliAODPair* pair) const
41 //chacks if avarage distance of two tracks is in given range
42 AliTrackPoints* tpts1 = pair->Particle1()->GetTPCTrackPoints();
44 {//it could be simulated pair
45 // Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
49 AliTrackPoints* tpts2 = pair->Particle2()->GetTPCTrackPoints();
52 // Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
55 Float_t x1=0,y1=0,z1=0;
56 Float_t x2=0,y2=0,z2=0;
58 tpts1->PositionAt(fPoint,x1,y1,z1);
59 tpts2->PositionAt(fPoint,x2,y2,z2);
60 Double_t dx1 = x1 - x2;
61 Double_t dy1 = y1 - y2;
62 Double_t dz1 = z1 - z2;
63 Double_t d = TMath::Sqrt(dx1*dx1 + dy1*dy1 + dz1*dz1);
66 /******************************************************************/
68 ClassImp(AliAODITSSeparationCut)
70 Bool_t AliAODITSSeparationCut::Rejected(AliAODPair* pair) const
72 //Checks if two tracks do not cross first pixels too close to each other
73 //If two tracks use the same cluster in pixels they are given
74 //the same position what skews theta angles (both are the same)
75 //These guys create artificial correlation in non-id analyses
76 //which is positive for identical polar angles (Qlong=0)
77 //and negative for a little bit different theta angle (Qlong=epsilon)
78 //Such tracks "attracks" each other.
80 AliTrackPoints* tpts1 = pair->Particle1()->GetITSTrackPoints();
82 {//it could be simulated pair
83 Warning("Pass","Track 1 does not have ITS Track Points. Pair NOT Passed.");
87 AliTrackPoints* tpts2 = pair->Particle2()->GetITSTrackPoints();
90 Warning("Pass","Track 2 does not have ITS Track Points. Pair NOT Passed.");
93 Float_t x1=0.0,y1=0.0,z1=0.0,x2=0.0,y2=0.0,z2=0.0;
94 tpts1->PositionAt(fLayer,x1,y1,z1);
95 tpts2->PositionAt(fLayer,x2,y2,z2);
97 // Info("Pass","rphi %f z %f",fMin,fMax);
98 // Info("Pass","P1: %f %f %f", x1,y1,z1);
99 // Info("Pass","P2: %f %f %f", x2,y2,z2);
101 Double_t dz = TMath::Abs(z1-z2);
103 //fMax encodes treshold valaue of distance in Z
104 if (dz > fMax) return kFALSE;//pair accepted
106 Double_t drphi = TMath::Hypot(x1-x2,y1-y2);
108 //fMin encodes treshold valaue of distance in r-phi
109 if (drphi > fMin) return kFALSE;
111 return kTRUE;//they are too close, rejected
113 /******************************************************************/
115 ClassImp(AliAODCluterOverlapCut)
117 Double_t AliAODCluterOverlapCut::GetValue(AliAODPair* pair) const
119 //Returns Cluter Overlap Factor
120 //It ranges between -0.5 (in all padrows both tracks have cluters)
121 // and 1 (in all padrows one track has cluter and second has not)
122 // When Overlap Factor is 1 this pair of tracks in highly probable to be
123 // splitted track: one particle that is recontructed twise
125 AliClusterMap* cm1 = pair->Particle1()->GetClusterMap();
128 Warning("GetValue","Track 1 does not have Cluster Map. Returning -0.5.");
132 AliClusterMap* cm2 = pair->Particle2()->GetClusterMap();
135 Warning("GetValue","Track 2 does not have Cluster Map. Returning -0.5.");
138 return cm1->GetOverlapFactor(*cm2);
140 /******************************************************************/
141 ClassImp(AliAODOutSideSameSignCut)
143 Bool_t AliAODOutSideSameSignCut::Rejected(AliAODPair *p) const
145 //returns kTRUE if pair DO NOT meet cut criteria
147 if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 )
149 return kFALSE;//accpeted
152 return kTRUE ;//rejected
154 /******************************************************************/
155 ClassImp(AliAODOutSideDiffSignCut)
157 Bool_t AliAODOutSideDiffSignCut::Rejected(AliAODPair *p) const
159 //returns kTRUE if pair DO NOT meet cut criteria
161 if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 )
163 return kTRUE;//rejected
166 return kFALSE;//accepted
168 /******************************************************************/
169 ClassImp( AliAODLogicalOperPairCut )
171 AliAODLogicalOperPairCut::AliAODLogicalOperPairCut():
172 AliAODPairBaseCut(-10e10,10e10,kHbtPairCutPropNone),
173 fFirst(new AliAODDummyBasePairCut),
174 fSecond(new AliAODDummyBasePairCut)
178 /******************************************************************/
180 AliAODLogicalOperPairCut::AliAODLogicalOperPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second):
181 AliAODPairBaseCut(-10e10,10e10,kHbtPairCutPropNone),
182 fFirst((first)?(AliAODPairBaseCut*)first->Clone():0x0),
183 fSecond((second)?(AliAODPairBaseCut*)second->Clone():0x0)
186 //note that base cuts are copied, not just pointers assigned
187 if ( (fFirst && fSecond) == kFALSE)
189 Fatal("AliAODLogicalOperPairCut","One of parameters is NULL!");
192 /******************************************************************/
194 AliAODLogicalOperPairCut::~AliAODLogicalOperPairCut()
200 /******************************************************************/
202 Bool_t AliAODLogicalOperPairCut::AliAODDummyBasePairCut::Rejected(AliAODPair* /*pair*/) const
204 //checks if particles passes properties defined by this cut
205 Warning("Pass","You are using dummy base cut! Probobly some logical cut is not set up properly");
206 return kFALSE;//accept
208 /******************************************************************/
210 void AliAODLogicalOperPairCut::Streamer(TBuffer &b)
212 // Stream all objects in the array to or from the I/O buffer.
221 b.ReadVersion(&R__s, &R__c);
222 TObject::Streamer(b);
225 b.CheckByteCount(R__s, R__c,AliAODLogicalOperPairCut::IsA());
229 R__c = b.WriteVersion(AliAODLogicalOperPairCut::IsA(), kTRUE);
230 TObject::Streamer(b);
233 b.SetByteCount(R__c, kTRUE);
237 /******************************************************************/
238 ClassImp(AliAODOrPairCut)
240 Bool_t AliAODOrPairCut::Rejected(AliAODPair * p) const
242 //returns true when rejected
243 //AND operation is a little bit misleading but is correct
244 //User wants to build logical cuts with natural (positive) logic
245 //while ALIAN use inernally reverse (returns true when rejected)
246 if (fFirst->Rejected(p) && fSecond->Rejected(p) ) return kTRUE;//rejected (both rejected, returned kTRUE)
247 return kFALSE;//accepted, at least one accepted (returned kFALSE)
249 /******************************************************************/
251 ClassImp(AliAODAndPairCut)
253 Bool_t AliAODAndPairCut::Rejected(AliAODPair * p) const
255 //returns true when rejected
256 //OR operation is a little bit misleading but is correct
257 //User wants to build logical cuts with natural (positive) logic
258 //while ALIAN use inernally reverse (returns true when rejected)
259 if (fFirst->Rejected(p) || fSecond->Rejected(p)) return kTRUE;//rejected (any of two rejected(returned kTRUE) )
260 return kFALSE;//accepted (both accepted (returned kFALSE))
262 /******************************************************************/