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)
13 ClassImp(AliAODDeltaECut)
14 ClassImp(AliAODDeltaPCut)
15 ClassImp(AliAODDeltaPvectorCut)
16 ClassImp(AliAODDeltaPhiCut)
17 ClassImp(AliAODDeltaThetaCut)
19 /******************************************************************/
20 ClassImp(AliAODAvSeparationCut)
22 Double_t AliAODAvSeparationCut::GetValue(AliAODPair* pair) const
24 //chacks if avarage distance of two tracks is in given range
25 AliTrackPoints* tpts1 = pair->Particle1()->GetTPCTrackPoints();
27 {//it could be simulated pair
28 // Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
32 AliTrackPoints* tpts2 = pair->Particle2()->GetTPCTrackPoints();
35 // Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
39 return tpts1->AvarageDistance(*tpts2);
41 /******************************************************************/
42 ClassImp(AliAODSeparationCut)
44 Double_t AliAODSeparationCut::GetValue(AliAODPair* pair) const
46 //chacks if avarage distance of two tracks is in given range
47 AliTrackPoints* tpts1 = pair->Particle1()->GetTPCTrackPoints();
49 {//it could be simulated pair
50 // Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
54 AliTrackPoints* tpts2 = pair->Particle2()->GetTPCTrackPoints();
57 // Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
60 Float_t x1=0,y1=0,z1=0;
61 Float_t x2=0,y2=0,z2=0;
63 tpts1->PositionAt(fPoint,x1,y1,z1);
64 tpts2->PositionAt(fPoint,x2,y2,z2);
65 Double_t dx1 = x1 - x2;
66 Double_t dy1 = y1 - y2;
67 Double_t dz1 = z1 - z2;
68 Double_t d = TMath::Sqrt(dx1*dx1 + dy1*dy1 + dz1*dz1);
71 /******************************************************************/
73 ClassImp(AliAODITSSeparationCut)
75 Bool_t AliAODITSSeparationCut::Rejected(AliAODPair* pair) const
77 //Checks if two tracks do not cross first pixels too close to each other
78 //If two tracks use the same cluster in pixels they are given
79 //the same position what skews theta angles (both are the same)
80 //These guys create artificial correlation in non-id analyses
81 //which is positive for identical polar angles (Qlong=0)
82 //and negative for a little bit different theta angle (Qlong=epsilon)
83 //Such tracks "attracks" each other.
85 AliTrackPoints* tpts1 = pair->Particle1()->GetITSTrackPoints();
87 {//it could be simulated pair
88 Warning("Pass","Track 1 does not have ITS Track Points. Pair NOT Passed.");
92 AliTrackPoints* tpts2 = pair->Particle2()->GetITSTrackPoints();
95 Warning("Pass","Track 2 does not have ITS Track Points. Pair NOT Passed.");
98 Float_t x1=0.0,y1=0.0,z1=0.0,x2=0.0,y2=0.0,z2=0.0;
99 tpts1->PositionAt(fLayer,x1,y1,z1);
100 tpts2->PositionAt(fLayer,x2,y2,z2);
102 // Info("Pass","rphi %f z %f",fMin,fMax);
103 // Info("Pass","P1: %f %f %f", x1,y1,z1);
104 // Info("Pass","P2: %f %f %f", x2,y2,z2);
106 Double_t dz = TMath::Abs(z1-z2);
108 //fMax encodes treshold valaue of distance in Z
109 if (dz > fMax) return kFALSE;//pair accepted
111 Double_t drphi = TMath::Hypot(x1-x2,y1-y2);
113 //fMin encodes treshold valaue of distance in r-phi
114 if (drphi > fMin) return kFALSE;
116 return kTRUE;//they are too close, rejected
118 /******************************************************************/
120 ClassImp(AliAODCluterOverlapCut)
122 Double_t AliAODCluterOverlapCut::GetValue(AliAODPair* pair) const
124 //Returns Cluter Overlap Factor
125 //It ranges between -0.5 (in all padrows both tracks have cluters)
126 // and 1 (in all padrows one track has cluter and second has not)
127 // When Overlap Factor is 1 this pair of tracks in highly probable to be
128 // splitted track: one particle that is recontructed twise
130 AliClusterMap* cm1 = pair->Particle1()->GetClusterMap();
133 Warning("GetValue","Track 1 does not have Cluster Map. Returning -0.5.");
137 AliClusterMap* cm2 = pair->Particle2()->GetClusterMap();
140 Warning("GetValue","Track 2 does not have Cluster Map. Returning -0.5.");
143 return cm1->GetOverlapFactor(*cm2);
145 /******************************************************************/
146 ClassImp(AliAODOutSideSameSignCut)
148 Bool_t AliAODOutSideSameSignCut::Rejected(AliAODPair *p) const
150 //returns kTRUE if pair DO NOT meet cut criteria
152 if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 )
154 return kFALSE;//accpeted
157 return kTRUE ;//rejected
159 /******************************************************************/
160 ClassImp(AliAODOutSideDiffSignCut)
162 Bool_t AliAODOutSideDiffSignCut::Rejected(AliAODPair *p) const
164 //returns kTRUE if pair DO NOT meet cut criteria
166 if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 )
168 return kTRUE;//rejected
171 return kFALSE;//accepted
173 /******************************************************************/
174 ClassImp( AliAODLogicalOperPairCut )
176 AliAODLogicalOperPairCut::AliAODLogicalOperPairCut():
177 AliAODPairBaseCut(-10e10,10e10,kHbtPairCutPropNone),
178 fFirst(new AliAODDummyBasePairCut),
179 fSecond(new AliAODDummyBasePairCut)
183 /******************************************************************/
185 AliAODLogicalOperPairCut::AliAODLogicalOperPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second):
186 AliAODPairBaseCut(-10e10,10e10,kHbtPairCutPropNone),
187 fFirst((first)?(AliAODPairBaseCut*)first->Clone():0x0),
188 fSecond((second)?(AliAODPairBaseCut*)second->Clone():0x0)
191 //note that base cuts are copied, not just pointers assigned
192 if ( (fFirst && fSecond) == kFALSE)
194 Fatal("AliAODLogicalOperPairCut","One of parameters is NULL!");
197 /******************************************************************/
199 AliAODLogicalOperPairCut::~AliAODLogicalOperPairCut()
205 /******************************************************************/
207 Bool_t AliAODLogicalOperPairCut::AliAODDummyBasePairCut::Rejected(AliAODPair* /*pair*/) const
209 //checks if particles passes properties defined by this cut
210 Warning("Pass","You are using dummy base cut! Probobly some logical cut is not set up properly");
211 return kFALSE;//accept
213 /******************************************************************/
215 void AliAODLogicalOperPairCut::Streamer(TBuffer &b)
217 // Stream all objects in the array to or from the I/O buffer.
226 b.ReadVersion(&R__s, &R__c);
227 TObject::Streamer(b);
230 b.CheckByteCount(R__s, R__c,AliAODLogicalOperPairCut::IsA());
234 R__c = b.WriteVersion(AliAODLogicalOperPairCut::IsA(), kTRUE);
235 TObject::Streamer(b);
238 b.SetByteCount(R__c, kTRUE);
242 /******************************************************************/
243 ClassImp(AliAODOrPairCut)
245 Bool_t AliAODOrPairCut::Rejected(AliAODPair * p) const
247 //returns true when rejected
248 //AND operation is a little bit misleading but is correct
249 //User wants to build logical cuts with natural (positive) logic
250 //while ALIAN use inernally reverse (returns true when rejected)
251 if (fFirst->Rejected(p) && fSecond->Rejected(p) ) return kTRUE;//rejected (both rejected, returned kTRUE)
252 return kFALSE;//accepted, at least one accepted (returned kFALSE)
254 /******************************************************************/
256 ClassImp(AliAODAndPairCut)
258 Bool_t AliAODAndPairCut::Rejected(AliAODPair * p) const
260 //returns true when rejected
261 //OR operation is a little bit misleading but is correct
262 //User wants to build logical cuts with natural (positive) logic
263 //while ALIAN use inernally reverse (returns true when rejected)
264 if (fFirst->Rejected(p))
265 {//first rejected - we reject
270 if (fSecond->Rejected(p))
271 {//second rejected - we reject
275 // if (fFirst->Rejected(p) || fSecond->Rejected(p)) return kTRUE;//rejected (any of two rejected(returned kTRUE) )
277 return kFALSE;//accepted (both accepted (returned kFALSE))
279 /******************************************************************/