]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/AliAODPairBaseCut.cxx
Base Pair Cuts moved to the separate file. Property eneum defined within namespace...
[u/mrichter/AliRoot.git] / ANALYSIS / AliAODPairBaseCut.cxx
CommitLineData
073745bc 1#include "AliAODPairBaseCut.h"
2
3#include "AliTrackPoints.h"
4#include "AliClusterMap.h"
5
6
7ClassImp(AliAODPairBaseCut)
8ClassImp(AliAODQInvCut)
9ClassImp(AliAODKtCut)
10ClassImp(AliAODQSideLCMSCut)
11ClassImp(AliAODQOutLCMSCut)
12ClassImp(AliAODQLongLCMSCut)
13
14/******************************************************************/
15ClassImp(AliAODAvSeparationCut)
16
17Double_t AliAODAvSeparationCut::GetValue(AliAODPair* pair) const
18{
19 //chacks if avarage distance of two tracks is in given range
20 AliTrackPoints* tpts1 = pair->Particle1()->GetTPCTrackPoints();
21 if ( tpts1 == 0x0)
22 {//it could be simulated pair
23// Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
24 return -1.0;
25 }
26
27 AliTrackPoints* tpts2 = pair->Particle2()->GetTPCTrackPoints();
28 if ( tpts2 == 0x0)
29 {
30// Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
31 return -1.0;
32 }
33
34 return tpts1->AvarageDistance(*tpts2);
35}
36/******************************************************************/
37ClassImp(AliAODSeparationCut)
38
39Double_t AliAODSeparationCut::GetValue(AliAODPair* pair) const
40{
41 //chacks if avarage distance of two tracks is in given range
42 AliTrackPoints* tpts1 = pair->Particle1()->GetTPCTrackPoints();
43 if ( tpts1 == 0x0)
44 {//it could be simulated pair
45// Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
46 return -1.0;
47 }
48
49 AliTrackPoints* tpts2 = pair->Particle2()->GetTPCTrackPoints();
50 if ( tpts2 == 0x0)
51 {
52// Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
53 return -1.0;
54 }
55 Float_t x1=0,y1=0,z1=0;
56 Float_t x2=0,y2=0,z2=0;
57
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);
64 return d;
65}
66/******************************************************************/
67
68ClassImp(AliAODITSSeparationCut)
69
70Bool_t AliAODITSSeparationCut::Rejected(AliAODPair* pair) const
71{
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.
79
80 AliTrackPoints* tpts1 = pair->Particle1()->GetITSTrackPoints();
81 if ( tpts1 == 0x0)
82 {//it could be simulated pair
83 Warning("Pass","Track 1 does not have ITS Track Points. Pair NOT Passed.");
84 return kTRUE;//reject
85 }
86
87 AliTrackPoints* tpts2 = pair->Particle2()->GetITSTrackPoints();
88 if ( tpts2 == 0x0)
89 {
90 Warning("Pass","Track 2 does not have ITS Track Points. Pair NOT Passed.");
91 return kTRUE;//reject
92 }
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);
96
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);
100
101 Double_t dz = TMath::Abs(z1-z2);
102
103 //fMax encodes treshold valaue of distance in Z
104 if (dz > fMax) return kFALSE;//pair accepted
105
106 Double_t drphi = TMath::Hypot(x1-x2,y1-y2);
107
108 //fMin encodes treshold valaue of distance in r-phi
109 if (drphi > fMin) return kFALSE;
110
111 return kTRUE;//they are too close, rejected
112}
113/******************************************************************/
114
115ClassImp(AliAODCluterOverlapCut)
116
117Double_t AliAODCluterOverlapCut::GetValue(AliAODPair* pair) const
118{
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
124
125 AliClusterMap* cm1 = pair->Particle1()->GetClusterMap();
126 if ( cm1 == 0x0)
127 {
128 Warning("GetValue","Track 1 does not have Cluster Map. Returning -0.5.");
129 return -.5;
130 }
131
132 AliClusterMap* cm2 = pair->Particle2()->GetClusterMap();
133 if ( cm2 == 0x0)
134 {
135 Warning("GetValue","Track 2 does not have Cluster Map. Returning -0.5.");
136 return -.5;
137 }
138 return cm1->GetOverlapFactor(*cm2);
139}
140/******************************************************************/
141ClassImp(AliAODOutSideSameSignCut)
142
143Bool_t AliAODOutSideSameSignCut::Rejected(AliAODPair *p) const
144{
145 //returns kTRUE if pair DO NOT meet cut criteria
146
147 if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 )
148 {
149 return kFALSE;//accpeted
150 }
151
152 return kTRUE ;//rejected
153}
154/******************************************************************/
155ClassImp(AliAODOutSideDiffSignCut)
156
157Bool_t AliAODOutSideDiffSignCut::Rejected(AliAODPair *p) const
158{
159 //returns kTRUE if pair DO NOT meet cut criteria
160
161 if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 )
162 {
163 return kTRUE;//rejected
164 }
165
166 return kFALSE;//accepted
167}
168/******************************************************************/
169ClassImp( AliAODLogicalOperPairCut )
170
171AliAODLogicalOperPairCut::AliAODLogicalOperPairCut():
172 AliAODPairBaseCut(-10e10,10e10,kHbtPairCutPropNone),
173 fFirst(new AliAODDummyBasePairCut),
174 fSecond(new AliAODDummyBasePairCut)
175{
176 //ctor
177}
178/******************************************************************/
179
180AliAODLogicalOperPairCut::AliAODLogicalOperPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second):
181 AliAODPairBaseCut(-10e10,10e10,kHbtPairCutPropNone),
182 fFirst((first)?(AliAODPairBaseCut*)first->Clone():0x0),
183 fSecond((second)?(AliAODPairBaseCut*)second->Clone():0x0)
184{
185 //ctor
186 //note that base cuts are copied, not just pointers assigned
187 if ( (fFirst && fSecond) == kFALSE)
188 {
189 Fatal("AliAODLogicalOperPairCut","One of parameters is NULL!");
190 }
191}
192/******************************************************************/
193
194AliAODLogicalOperPairCut::~AliAODLogicalOperPairCut()
195{
196 //destructor
197 delete fFirst;
198 delete fSecond;
199}
200/******************************************************************/
201
202Bool_t AliAODLogicalOperPairCut::AliAODDummyBasePairCut::Rejected(AliAODPair* /*pair*/) const
203{
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
207}
208/******************************************************************/
209
210void AliAODLogicalOperPairCut::Streamer(TBuffer &b)
211{
212 // Stream all objects in the array to or from the I/O buffer.
213 UInt_t R__s, R__c;
214 if (b.IsReading())
215 {
216 delete fFirst;
217 delete fSecond;
218 fFirst = 0x0;
219 fSecond = 0x0;
220
221 b.ReadVersion(&R__s, &R__c);
222 TObject::Streamer(b);
223 b >> fFirst;
224 b >> fSecond;
225 b.CheckByteCount(R__s, R__c,AliAODLogicalOperPairCut::IsA());
226 }
227 else
228 {
229 R__c = b.WriteVersion(AliAODLogicalOperPairCut::IsA(), kTRUE);
230 TObject::Streamer(b);
231 b << fFirst;
232 b << fSecond;
233 b.SetByteCount(R__c, kTRUE);
234 }
235}
236
237/******************************************************************/
238ClassImp(AliAODOrPairCut)
239
240Bool_t AliAODOrPairCut::Rejected(AliAODPair * p) const
241{
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)
248}
249/******************************************************************/
250
251ClassImp(AliAODAndPairCut)
252
253Bool_t AliAODAndPairCut::Rejected(AliAODPair * p) const
254{
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))
261}
262/******************************************************************/