]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/FlavourJetTasks/AliPicoV0Base.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGJE / FlavourJetTasks / AliPicoV0Base.cxx
1 #include <TH2D.h>
2 #include <TMath.h>
3 #include <TLorentzVector.h>
4
5 #include "AliPicoV0Base.h"
6
7 ClassImp(AliPicoV0Base)
8
9 //_____________________________________________________________________________
10 const Double_t AliPicoV0Base::fgkMassPion   = 0.13957;
11 const Double_t AliPicoV0Base::fgkMassKshort = 0.497614;
12 const Double_t AliPicoV0Base::fgkMassProton = 0.938272;
13 const Double_t AliPicoV0Base::fgkMassLambda = 1.11568;
14
15 //_____________________________________________________________________________
16 AliPicoV0Base::AliPicoV0Base() :
17 TObject(),
18 fMask(0),
19 fV0Radius(0.),
20 fV0CosPA(0.),
21 fV0DistToPVoverP(0.),
22 fDausDCA(0.),
23 fPosDCAtoPV(0.),
24 fNegDCAtoPV(0.),
25 fDauXrowsTPC(0.),
26 fDauXrowsOverFindableClusTPC(0.),
27 fP3Pos(),
28 fP3Neg(),
29 fIsPosInJC(kFALSE),
30 fIsNegInJC(kFALSE)
31 {
32 //
33 //  AliPicoV0Base::AliPicoV0Base
34 //
35 }
36
37 //_____________________________________________________________________________
38 AliPicoV0Base::AliPicoV0Base(UInt_t   wMask,
39                              Double_t dV0Radius,
40                              Double_t dV0CosPA,
41                              Double_t dV0DistToPVoverP,
42                              Double_t dDausDCA,
43                              Double_t dPosDCAtoPV,
44                              Double_t dNegDCAtoPV,
45                              Float_t  dDauXrowsTPC,
46                              Double_t dDauXrowsOverFindableClusTPC,
47                              Double_t dPosPx, Double_t dPosPy, Double_t dPosPz,
48                              Double_t dNegPx, Double_t dNegPy, Double_t dNegPz,
49                              Bool_t bPosInJC,
50                              Bool_t bNegInJC) :
51 TObject(),
52 fMask(wMask),
53 fV0Radius(dV0Radius),
54 fV0CosPA(dV0CosPA),
55 fV0DistToPVoverP(dV0DistToPVoverP),
56 fDausDCA(dDausDCA),
57 fPosDCAtoPV(dPosDCAtoPV),
58 fNegDCAtoPV(dNegDCAtoPV),
59 fDauXrowsTPC(dDauXrowsTPC),
60 fDauXrowsOverFindableClusTPC(dDauXrowsOverFindableClusTPC),
61 fP3Pos(dPosPx, dPosPy, dPosPz),
62 fP3Neg(dNegPx, dNegPy, dNegPz),
63 fIsPosInJC(bPosInJC),
64 fIsNegInJC(bNegInJC)
65 {
66 //
67 //  AliPicoV0Base::AliPicoV0Base
68 //
69 }
70
71 //_____________________________________________________________________________
72 AliPicoV0Base::AliPicoV0Base(const AliPicoV0Base &src) :
73 TObject(src),
74 fMask(src.fMask),
75 fV0Radius(src.fV0Radius),
76 fV0CosPA(src.fV0CosPA),
77 fV0DistToPVoverP(src.fV0DistToPVoverP),
78 fDausDCA(src.fDausDCA),
79 fPosDCAtoPV(src.fPosDCAtoPV),
80 fNegDCAtoPV(src.fNegDCAtoPV),
81 fDauXrowsTPC(src.fDauXrowsTPC),
82 fDauXrowsOverFindableClusTPC(src.fDauXrowsOverFindableClusTPC),
83 fP3Pos(src.fP3Pos),
84 fP3Neg(src.fP3Neg),
85 fIsPosInJC(src.fIsPosInJC),
86 fIsNegInJC(src.fIsNegInJC)
87 {
88 //
89 //  AliPicoV0Base::AliPicoV0Base
90 //
91 }
92
93 //_____________________________________________________________________________
94 AliPicoV0Base& AliPicoV0Base::operator=(const AliPicoV0Base &src)
95 {
96 //
97 //  AliPicoV0Base::operator=
98 //
99
100   if (&src==this) return *this;
101
102   TObject::operator=(src);
103
104   fMask                        = src.fMask;
105   fV0Radius                    = src.fV0Radius;
106   fV0CosPA                     = src.fV0CosPA;
107   fV0DistToPVoverP             = src.fV0DistToPVoverP;
108   fDausDCA                     = src.fDausDCA;
109   fPosDCAtoPV                  = src.fPosDCAtoPV;
110   fNegDCAtoPV                  = src.fNegDCAtoPV;
111   fDauXrowsTPC                 = src.fDauXrowsTPC;
112   fDauXrowsOverFindableClusTPC = src.fDauXrowsOverFindableClusTPC;
113   fP3Pos                       = src.fP3Pos;
114   fP3Neg                       = src.fP3Neg;
115   fIsPosInJC                   = src.fIsPosInJC;
116   fIsNegInJC                   = src.fIsNegInJC;
117
118   return *this;
119 }
120
121 //_____________________________________________________________________________
122 AliPicoV0Base::~AliPicoV0Base()
123 {
124 //
125 //  AliPicoV0Base::~AliPicoV0Base
126 //
127 }
128
129 //_____________________________________________________________________________
130 Bool_t AliPicoV0Base::IsKa(Double_t dCutMinV0Radius,
131                            Double_t dCutMinV0CosPA,
132                            Double_t dCutMaxV0Ctau,
133                            Double_t dCutMaxDausDCA,
134                            Double_t dCutMinPosDCAtoPV,
135                            Double_t dCutMinNegDCAtoPV,
136                            Float_t  dCutMinDauXrowsTPC,
137                            Double_t dCutMinDauXrowsOverFindableClusTPC,
138                            Double_t dCutMinDauDeltaM)
139 {
140 //
141 //  AliPicoV0Base::IsKa
142 //
143
144   if (!IsCandidateSelected(dCutMinV0Radius,
145                            dCutMinV0CosPA,
146                            dCutMaxDausDCA,
147                            dCutMinPosDCAtoPV,
148                            dCutMinNegDCAtoPV,
149                            dCutMinDauXrowsTPC,
150                            dCutMinDauXrowsOverFindableClusTPC)) return kFALSE;
151
152   if (!IsKaSelected(dCutMaxV0Ctau, dCutMinDauDeltaM)) return kFALSE;
153
154   return kTRUE;
155 }
156
157 //_____________________________________________________________________________
158 Bool_t AliPicoV0Base::IsLa(Double_t dCutMinV0Radius,
159                            Double_t dCutMinV0CosPA,
160                            Double_t dCutMaxV0Ctau,
161                            Double_t dCutMaxDausDCA,
162                            Double_t dCutMinPosDCAtoPV,
163                            Double_t dCutMinNegDCAtoPV,
164                            Float_t  dCutMinDauXrowsTPC,
165                            Double_t dCutMinDauXrowsOverFindableClusTPC,
166                            Double_t dCutMinDauDeltaM)
167 {
168 //
169 //  AliPicoV0Base::IsLa
170 //
171
172   if (!IsCandidateSelected(dCutMinV0Radius,
173                            dCutMinV0CosPA,
174                            dCutMaxDausDCA,
175                            dCutMinPosDCAtoPV,
176                            dCutMinNegDCAtoPV,
177                            dCutMinDauXrowsTPC,
178                            dCutMinDauXrowsOverFindableClusTPC)) return kFALSE;
179
180   if (!IsLaSelected(dCutMaxV0Ctau, dCutMinDauDeltaM)) return kFALSE;
181
182   return kTRUE;
183 }
184
185 //_____________________________________________________________________________
186 Bool_t AliPicoV0Base::IsKaSelected(Double_t dCutMaxV0Ctau, Double_t dCutMinDauDeltaM)
187 {
188 //
189 //  AliPicoV0Base::IsKaSelected
190 //
191
192   if ((fV0DistToPVoverP*fgkMassKshort)>dCutMaxV0Ctau) return kFALSE;
193
194   if (dCutMinDauDeltaM>0.) {
195     Double_t dMassLambda = KineLambda().M();
196     Double_t dMassAntiLa = KineAntiLa().M();
197     if ((TMath::Abs(dMassLambda-fgkMassLambda)<dCutMinDauDeltaM) ||
198         (TMath::Abs(dMassAntiLa-fgkMassLambda)<dCutMinDauDeltaM)) return kFALSE;
199   }
200
201   return kTRUE;
202 }
203
204 //_____________________________________________________________________________
205 Bool_t AliPicoV0Base::IsLaSelected(Double_t dCutMaxV0Ctau, Double_t dCutMinDauDeltaM)
206 {
207 //
208 //  AliPicoV0Base::IsLaSelected
209 //
210
211   if ((fV0DistToPVoverP*fgkMassLambda)>dCutMaxV0Ctau) return kFALSE;
212
213   if (dCutMinDauDeltaM>0.) {
214     Double_t dMassKshort = KineKshort().M();
215     if (TMath::Abs(dMassKshort-fgkMassKshort)<dCutMinDauDeltaM) return kFALSE;
216   }
217
218   return kTRUE;
219 }
220
221 //_____________________________________________________________________________
222 Bool_t AliPicoV0Base::IsCandidateSelected(Double_t dCutMinV0Radius,
223                                           Double_t dCutMinV0CosPA,
224                                           Double_t dCutMaxDausDCA,
225                                           Double_t dCutMinPosDCAtoPV,
226                                           Double_t dCutMinNegDCAtoPV,
227                                           Float_t  dCutMinDauXrowsTPC,
228                                           Double_t dCutMinDauXrowsOverFindableClusTPC)
229 {
230 //
231 //  AliPicoV0Base::IsCandidateSelected
232 //
233
234   if (fV0Radius<dCutMinV0Radius) return kFALSE;
235   if (fV0CosPA <dCutMinV0CosPA)  return kFALSE;
236
237   if (fDausDCA>dCutMaxDausDCA) return kFALSE;
238   if (fPosDCAtoPV<dCutMinPosDCAtoPV) return kFALSE;
239   if (fNegDCAtoPV<dCutMinNegDCAtoPV) return kFALSE;
240
241   if (fDauXrowsTPC<dCutMinDauXrowsTPC) return kFALSE;
242   if (fDauXrowsOverFindableClusTPC<dCutMinDauXrowsOverFindableClusTPC) return kFALSE;
243
244   return kTRUE;
245 }
246
247 //_____________________________________________________________________________
248 void AliPicoV0Base::FillKshortPtInvM(TH2D *h)
249 {
250 //
251 //  AliPicoV0Base::FillKshortPtInvM
252 //
253
254   if (!h) return;
255   if (!IsKshort()) return;
256 //=============================================================================
257
258   TLorentzVector v = KineKshort();
259   Double_t dPt = v.Pt(); if (dPt<h->GetXaxis()->GetBinLowEdge(1)) return;
260
261   h->Fill(dPt, v.M());
262   return;
263 }
264
265 //_____________________________________________________________________________
266 void AliPicoV0Base::FillLambdaPtInvM(TH2D *h)
267 {
268 //
269 //  AliPicoV0Base::FillLambdaPtInvM
270 //
271
272   if (!h) return;
273   if (!IsLambda()) return;
274 //=============================================================================
275
276   TLorentzVector v = KineLambda();
277   Double_t dPt = v.Pt(); if (dPt<h->GetXaxis()->GetBinLowEdge(1)) return;
278
279   h->Fill(dPt, v.M());
280   return;
281 }
282
283 //_____________________________________________________________________________
284 void AliPicoV0Base::FillAntiLaPtInvM(TH2D *h)
285 {
286 //
287 //  AliPicoV0Base::FillAntiLaPtInvM
288 //
289
290   if (!h) return;
291   if (!IsAntiLa()) return;
292 //=============================================================================
293
294   TLorentzVector v = KineAntiLa();
295   Double_t dPt = v.Pt(); if (dPt<h->GetXaxis()->GetBinLowEdge(1)) return;
296
297   h->Fill(dPt, v.M());
298   return;
299 }
300
301 //_____________________________________________________________________________
302 Bool_t AliPicoV0Base::IsKaInRapAcc(Double_t dMin, Double_t dMax)
303 {
304 //
305 //  AliPicoV0Base::IsKaInRapAcc
306 //
307
308   if (!IsKshort()) return kFALSE;
309   Double_t dRap = RapidityKa(); return ((dRap>=dMin) && (dRap<dMax));
310 }
311
312 //_____________________________________________________________________________
313 Bool_t AliPicoV0Base::IsLaInRapAcc(Double_t dMin, Double_t dMax)
314 {
315 //
316 //  AliPicoV0Base::IsLaInRapAcc
317 //
318
319   if (!(IsLambda() || IsAntiLa())) return kFALSE;
320   Double_t dRap = RapidityLa(); return ((dRap>=dMin) && (dRap<dMax));
321 }
322
323 //_____________________________________________________________________________
324 Bool_t AliPicoV0Base::IsV0InEtaAcc(Double_t dMin, Double_t dMax)
325 {
326 //
327 //  AliPicoV0Base::IsV0InEtaAcc
328 //
329
330   Double_t dEta = KineRD().Eta();
331   if ((dEta<dMin) || (dEta>=dMax)) return kFALSE;
332
333   return kTRUE;
334 }
335
336 //_____________________________________________________________________________
337 Bool_t AliPicoV0Base::IsDausInEtaAcc(Double_t dMin, Double_t dMax)
338 {
339 //
340 //  AliPicoV0Base::IsDausInEtaAcc
341 //
342
343   Double_t dPosEta = fP3Pos.Eta(); if ((dPosEta<dMin) || (dPosEta>=dMax)) return kFALSE;
344   Double_t dNegEta = fP3Neg.Eta(); if ((dNegEta<dMin) || (dNegEta>=dMax)) return kFALSE;
345
346   return kTRUE;
347 }
348
349 //_____________________________________________________________________________
350 Double_t AliPicoV0Base::RapidityKa()
351 {
352 //
353 //  AliPicoV0Base::RapidityKa
354 //
355
356   TLorentzVector v; v.SetVectM(KineRD(), fgkMassKshort);
357   return v.Rapidity();
358 }
359
360 //_____________________________________________________________________________
361 Double_t AliPicoV0Base::RapidityLa()
362 {
363 //
364 //  AliPicoV0Base::RapidityLa
365 //
366
367   TLorentzVector v; v.SetVectM(KineRD(), fgkMassLambda);
368   return v.Rapidity();
369 }
370
371 //_____________________________________________________________________________
372 TLorentzVector AliPicoV0Base::KineKshort()
373 {
374 //
375 //  AliPicoV0Base::KineKshort
376 //
377
378   TLorentzVector vPos; vPos.SetVectM(fP3Pos, fgkMassPion);
379   TLorentzVector vNeg; vNeg.SetVectM(fP3Neg, fgkMassPion);
380
381   return (vPos + vNeg);
382 }
383
384 //_____________________________________________________________________________
385 TLorentzVector AliPicoV0Base::KineLambda()
386 {
387 //
388 //  AliPicoV0Base::KineLambda
389 //
390
391   TLorentzVector vPos; vPos.SetVectM(fP3Pos, fgkMassProton);
392   TLorentzVector vNeg; vNeg.SetVectM(fP3Neg, fgkMassPion);
393
394   return (vPos + vNeg);
395 }
396
397 //_____________________________________________________________________________
398 TLorentzVector AliPicoV0Base::KineAntiLa()
399 {
400 //
401 //  AliPicoV0Base::KineAntiLa
402 //
403
404   TLorentzVector vPos; vPos.SetVectM(fP3Pos, fgkMassPion);
405   TLorentzVector vNeg; vNeg.SetVectM(fP3Neg, fgkMassProton);
406
407   return (vPos + vNeg);
408 }