1 // Base class AliAODPairBaseCut:
2 // This class defines the range of some property - pure virtual
3 // Property is coded by AliAODCutTypes type
16 // AliAODDeltaPvectorCut
18 // AliAODDeltaThetaCut
19 // AliAODCluterOverlapCut
20 // AliAODAvSeparationCut
21 // AliAODSeparationCut
22 // AliAODITSSeparationCut
23 // AliAODOutSideSameSignCut
24 // AliAODOutSideDiffSignCut
25 // AliAODLogicalOperPairCut
28 // Author: Piotr.Skowronski@cern.ch
29 #include "AliAODPairBaseCut.h"
31 #include "AliTrackPoints.h"
32 #include "AliClusterMap.h"
35 ClassImp(AliAODPairBaseCut)
36 ClassImp(AliAODQInvCut)
38 ClassImp(AliAODQSideLCMSCut)
39 ClassImp(AliAODQOutLCMSCut)
40 ClassImp(AliAODQLongLCMSCut)
41 ClassImp(AliAODDeltaECut)
42 ClassImp(AliAODDeltaPCut)
43 ClassImp(AliAODDeltaPvectorCut)
44 ClassImp(AliAODDeltaPhiCut)
45 ClassImp(AliAODDeltaThetaCut)
47 /******************************************************************/
48 ClassImp(AliAODAvSeparationCut)
50 Double_t AliAODAvSeparationCut::GetValue(AliAODPair* pair) const
52 //chacks if avarage distance of two tracks is in given range
53 AliTrackPoints* tpts1 = pair->Particle1()->GetTPCTrackPoints();
55 {//it could be simulated pair
56 // Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
60 AliTrackPoints* tpts2 = pair->Particle2()->GetTPCTrackPoints();
63 // Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
67 return tpts1->AvarageDistance(*tpts2);
69 /******************************************************************/
70 ClassImp(AliAODSeparationCut)
72 Double_t AliAODSeparationCut::GetValue(AliAODPair* pair) const
74 //chacks if avarage distance of two tracks is in given range
75 AliTrackPoints* tpts1 = pair->Particle1()->GetTPCTrackPoints();
77 {//it could be simulated pair
78 // Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
82 AliTrackPoints* tpts2 = pair->Particle2()->GetTPCTrackPoints();
85 // Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
88 Float_t x1=0,y1=0,z1=0;
89 Float_t x2=0,y2=0,z2=0;
91 tpts1->PositionAt(fPoint,x1,y1,z1);
92 tpts2->PositionAt(fPoint,x2,y2,z2);
93 Double_t dx1 = x1 - x2;
94 Double_t dy1 = y1 - y2;
95 Double_t dz1 = z1 - z2;
96 Double_t d = TMath::Sqrt(dx1*dx1 + dy1*dy1 + dz1*dz1);
99 /******************************************************************/
101 ClassImp(AliAODITSSeparationCut)
103 Bool_t AliAODITSSeparationCut::Rejected(AliAODPair* pair) const
105 //Checks if two tracks do not cross first pixels too close to each other
106 //If two tracks use the same cluster in pixels they are given
107 //the same position what skews theta angles (both are the same)
108 //These guys create artificial correlation in non-id analyses
109 //which is positive for identical polar angles (Qlong=0)
110 //and negative for a little bit different theta angle (Qlong=epsilon)
111 //Such tracks "attracks" each other.
113 AliTrackPoints* tpts1 = pair->Particle1()->GetITSTrackPoints();
115 {//it could be simulated pair
116 Warning("Pass","Track 1 does not have ITS Track Points. Pair NOT Passed.");
117 return kTRUE;//reject
120 AliTrackPoints* tpts2 = pair->Particle2()->GetITSTrackPoints();
123 Warning("Pass","Track 2 does not have ITS Track Points. Pair NOT Passed.");
124 return kTRUE;//reject
126 Float_t x1=0.0,y1=0.0,z1=0.0,x2=0.0,y2=0.0,z2=0.0;
127 tpts1->PositionAt(fLayer,x1,y1,z1);
128 tpts2->PositionAt(fLayer,x2,y2,z2);
130 // Info("Pass","rphi %f z %f",fMin,fMax);
131 // Info("Pass","P1: %f %f %f", x1,y1,z1);
132 // Info("Pass","P2: %f %f %f", x2,y2,z2);
134 Double_t dz = TMath::Abs(z1-z2);
136 //fMax encodes treshold valaue of distance in Z
137 if (dz > fMax) return kFALSE;//pair accepted
139 Double_t drphi = TMath::Hypot(x1-x2,y1-y2);
141 //fMin encodes treshold valaue of distance in r-phi
142 if (drphi > fMin) return kFALSE;
144 return kTRUE;//they are too close, rejected
146 /******************************************************************/
148 ClassImp(AliAODCluterOverlapCut)
150 Double_t AliAODCluterOverlapCut::GetValue(AliAODPair* pair) const
152 //Returns Cluter Overlap Factor
153 //It ranges between -0.5 (in all padrows both tracks have cluters)
154 // and 1 (in all padrows one track has cluter and second has not)
155 // When Overlap Factor is 1 this pair of tracks in highly probable to be
156 // splitted track: one particle that is recontructed twise
158 AliClusterMap* cm1 = pair->Particle1()->GetClusterMap();
161 Warning("GetValue","Track 1 does not have Cluster Map. Returning -0.5.");
165 AliClusterMap* cm2 = pair->Particle2()->GetClusterMap();
168 Warning("GetValue","Track 2 does not have Cluster Map. Returning -0.5.");
171 return cm1->GetOverlapFactor(*cm2);
173 /******************************************************************/
174 ClassImp(AliAODOutSideSameSignCut)
176 Bool_t AliAODOutSideSameSignCut::Rejected(AliAODPair *p) const
178 //returns kTRUE if pair DO NOT meet cut criteria
180 if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 )
182 return kFALSE;//accpeted
185 return kTRUE ;//rejected
187 /******************************************************************/
188 ClassImp(AliAODOutSideDiffSignCut)
190 Bool_t AliAODOutSideDiffSignCut::Rejected(AliAODPair *p) const
192 //returns kTRUE if pair DO NOT meet cut criteria
194 if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 )
196 return kTRUE;//rejected
199 return kFALSE;//accepted
201 /******************************************************************/
202 ClassImp( AliAODLogicalOperPairCut )
204 AliAODLogicalOperPairCut::AliAODLogicalOperPairCut():
205 AliAODPairBaseCut(-10e10,10e10,kHbtPairCutPropNone),
206 fFirst(new AliAODDummyBasePairCut),
207 fSecond(new AliAODDummyBasePairCut)
211 /******************************************************************/
213 AliAODLogicalOperPairCut::AliAODLogicalOperPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second):
214 AliAODPairBaseCut(-10e10,10e10,kHbtPairCutPropNone),
215 fFirst((first)?(AliAODPairBaseCut*)first->Clone():0x0),
216 fSecond((second)?(AliAODPairBaseCut*)second->Clone():0x0)
219 //note that base cuts are copied, not just pointers assigned
220 if ( (fFirst && fSecond) == kFALSE)
222 Fatal("AliAODLogicalOperPairCut","One of parameters is NULL!");
225 /******************************************************************/
227 AliAODLogicalOperPairCut::~AliAODLogicalOperPairCut()
233 /******************************************************************/
235 Bool_t AliAODLogicalOperPairCut::AliAODDummyBasePairCut::Rejected(AliAODPair* /*pair*/) const
237 //checks if particles passes properties defined by this cut
238 Warning("Pass","You are using dummy base cut! Probobly some logical cut is not set up properly");
239 return kFALSE;//accept
241 /******************************************************************/
243 void AliAODLogicalOperPairCut::Streamer(TBuffer &b)
245 // Stream all objects in the array to or from the I/O buffer.
254 b.ReadVersion(&R__s, &R__c);
255 TObject::Streamer(b);
258 b.CheckByteCount(R__s, R__c,AliAODLogicalOperPairCut::IsA());
262 R__c = b.WriteVersion(AliAODLogicalOperPairCut::IsA(), kTRUE);
263 TObject::Streamer(b);
266 b.SetByteCount(R__c, kTRUE);
270 /******************************************************************/
271 ClassImp(AliAODOrPairCut)
273 Bool_t AliAODOrPairCut::Rejected(AliAODPair * p) const
275 //returns true when rejected
276 //AND operation is a little bit misleading but is correct
277 //User wants to build logical cuts with natural (positive) logic
278 //while ALIAN use inernally reverse (returns true when rejected)
279 if (fFirst->Rejected(p) && fSecond->Rejected(p) ) return kTRUE;//rejected (both rejected, returned kTRUE)
280 return kFALSE;//accepted, at least one accepted (returned kFALSE)
282 /******************************************************************/
284 ClassImp(AliAODAndPairCut)
286 Bool_t AliAODAndPairCut::Rejected(AliAODPair * p) const
288 //returns true when rejected
289 //OR operation is a little bit misleading but is correct
290 //User wants to build logical cuts with natural (positive) logic
291 //while ALIAN use inernally reverse (returns true when rejected)
292 if (fFirst->Rejected(p))
293 {//first rejected - we reject
298 if (fSecond->Rejected(p))
299 {//second rejected - we reject
303 // if (fFirst->Rejected(p) || fSecond->Rejected(p)) return kTRUE;//rejected (any of two rejected(returned kTRUE) )
305 return kFALSE;//accepted (both accepted (returned kFALSE))
307 /******************************************************************/