]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/GammaConv/AliV0Reader.h
Be much less verbose when not needed...
[u/mrichter/AliRoot.git] / PWG4 / GammaConv / AliV0Reader.h
CommitLineData
a0b94e5c 1#ifndef ALIV0READER_H
2#define ALIV0READER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6////////////////////////////////////////////////
7//---------------------------------------------
8// Class used to do analysis on conversion pairs
9//---------------------------------------------
10////////////////////////////////////////////////
11
12// --- ROOT system ---
13#include "TObject.h"
14#include "AliMCEvent.h" // for CF
15#include "AliESDv0.h"
16#include "AliESDEvent.h"
17#include "AliKFParticle.h"
18#include "TParticle.h"
19#include "AliGammaConversionHistograms.h"
20#include <vector>
21#include "AliCFManager.h"
5e55d806 22#include "AliGammaConversionBGHandler.h"
9c1cb6f7 23#include "AliESDpid.h"
a0b94e5c 24
25class TClonesArray;
26class TFormula;
27class Riostream;
28class TChain;
29
30//--- AliRoot system ---
31
32class AliStack;
33class AliMCEvent; // for CF
34class AliESDEvent;
35class AliMCEventHandler;
36class AliESDInputHandler;
37class AliESDVertex;
38class AliLog;
39class TChain;
40class TChain;
41class AliCFManager; // for CF
42class AliCFContainer; // for CF
9c1cb6f7 43//class AliESDpid; // for dEdx cut based on nSigma to particle lines
037dc2db 44class AliESDtrackCuts;
a0b94e5c 45
46class AliV0Reader : public TObject {
47
48 public:
49
50
51 // for CF
52 enum{
53 kStepGenerated = 0,
54 kStepReconstructable = 1,
ebcfaa7e 55 kStepGetOnFly = 2,
56 kStepLikeSign = 3,
57 kStepTPCRefit = 4,
58 kStepKinks = 5,
f14266e7 59 kStepdEdxElectronselection = 6,
60 kStepdEdxPionrejection = 7,
ebcfaa7e 61 kStepNContributors = 8,
62 kStepTPCPID = 9,
63 kStepR = 10,
64 kStepLine = 11,
65 kStepZ = 12,
48682642 66 kStepMinClsTPC = 13,
67 kStepSinglePt= 14,
68 kStepNDF = 15,
69 kStepChi2 = 16,
70 kStepEta = 17,
71 kStepPt = 18,
72 kStepTrueGamma = 19
a0b94e5c 73 };
74
a0b94e5c 75 AliV0Reader(); //constructor
76 AliV0Reader(const AliV0Reader & g); //copy constructor
77 AliV0Reader & operator = (const AliV0Reader & g); //assignment operator
9640a3d1 78 // virtual ~AliV0Reader() {;} //virtual destructor
79 virtual ~AliV0Reader(); //virtual destructor
a0b94e5c 80 /*
81 *Initialize the reader
82 */
83 void Initialize();
48682642 84 void SetInputAndMCEvent(AliVEvent* esd, AliMCEvent* mc) ;
85
86
87 virtual void SetInputEvent(AliVEvent* const input) {fESDEvent = dynamic_cast<AliESDEvent*>(input);}
88 virtual void SetMC(AliMCEvent* const mc) {fMCEvent = mc;}
89
a0b94e5c 90
91 // for CF
4a6157dc 92 void SetCFManager(AliCFManager * const io){fCFManager = io;};
a0b94e5c 93 AliCFManager *GetCFManager() const {return fCFManager;}
94
95
96
97
98 /*
99 * Returns AliESDEvent
100 */
101 AliESDEvent* GetESDEvent() const{return fESDEvent;}
102
103 /*
104 *Returns the number of v0s in the event, no cuts applied.
105 */
106 Int_t GetNumberOfV0s() const{return fESDEvent->GetNumberOfV0s();}
107
b5832f95 108 /*
109 *Returns the number of contributors to the vertex
110 */
c8206114 111 // Int_t GetNumberOfContributorsVtx() const{return fESDEvent->GetPrimaryVertex()->GetNContributors();}
112 Int_t GetNumberOfContributorsVtx();
b5832f95 113
a0b94e5c 114 /*
115 * Check if there are any more good v0s left in the v0 stack
116 * if so, fCurrent v0 is set to this v0 and can be retrieved
117 * by GetCurrentV0 function.
118 * returns kFALSE if there is no more good v0s in the v0 stack
119 */
120 Bool_t NextV0();
121
122 /*
123 * Returns the v0 at the given index, no checks are done on the v0.
124 */
125 AliESDv0* GetV0(Int_t index);
126
127 /*
128 * Returns the current v0
129 */
130 AliESDv0* GetCurrentV0() const{return fCurrentV0;}
131
132 /*
133 * Returns the negative ESD track which belongs to fCurrentV0
134 */
9c1cb6f7 135 // AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());}
136 AliESDtrack* GetNegativeESDTrack(){return fCurrentNegativeESDTrack;}
a0b94e5c 137
138 /*
139 * Returns the positive ESD track which belongs to fCurrentV0
140 */
9c1cb6f7 141 // AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());}
142 AliESDtrack* GetPositiveESDTrack(){return fCurrentPositiveESDTrack;}
a0b94e5c 143
144 /*
145 * Returns the negative KF particle which belongs to fCurrentV0
146 */
147 AliKFParticle* GetNegativeKFParticle() const{return fCurrentNegativeKFParticle;}
148
149 /*
150 * Returns the positive KF particle which belongs to fCurrentV0
151 */
152 AliKFParticle* GetPositiveKFParticle() const{return fCurrentPositiveKFParticle;}
153
154 /*
155 * Returns the KFParticle object of the 2 tracks.
156 */
157 AliKFParticle* GetMotherCandidateKFCombination() const{return fCurrentMotherKFCandidate;}
158
159 /*
160 * Checks the probablity that the PID of the particle is what we want it to be.
161 */
162 Bool_t CheckPIDProbability(Double_t negProbCut, Double_t posProbCut);
163
164 /*
165 * Checks if the PID of the two particles are within our cuts.
166 */
167 void GetPIDProbability(Double_t &negPIDProb, Double_t &posPIDProb);
9c1cb6f7 168
169 /*
170 * Checks if the PID of the two particles are within our cuts.
171 */
172 void GetPIDProbabilityMuonPion(Double_t &negPIDProb, Double_t &posPIDProb);
a0b94e5c 173
174 /*
175 *Get the negative MC TParticle from the stack
176 */
177 TParticle * GetNegativeMCParticle() const{return fNegativeMCParticle;}
178
179 /*
180 *Get the positive MC TParticle from the stack
181 */
182 TParticle * GetPositiveMCParticle() const{return fPositiveMCParticle;}
183
184 /*
185 *Get the mother MC TParticle from the stack
186 */
187 TParticle * GetMotherMCParticle() const{return fMotherMCParticle;}
188
189 /*
190 * Flag to see if the v0 particles share the same mother
191 */
192 Bool_t HasSameMCMother();
193
194
195 /*
196 *Get the PID of the MC mother particle
197 */
198 Int_t GetMotherMCParticlePDGCode() const{if(fMotherMCParticle != NULL){ cout<<"MCParticle exists"<<endl;} return fMotherMCParticle->GetPdgCode();}
199
200 /*
201 *Get the MC stack
202 */
203 AliStack* GetMCStack() const{return fMCStack;}
204
205
206 /*
207 * Setup AliMCEventHandler
208 */
48682642 209 // AliMCEventHandler* GetMCTruth() const{return fMCTruth;} // for CF
a0b94e5c 210
211
212 /*
213 *Get the MC stack
214 */
215 AliMCEvent* GetMCEvent() const{return fMCEvent;} // for CF
216
217
218 /*
219 *Get the magnetic field from the ESD event
220 */
221 Double_t GetMagneticField() const{return fESDEvent->GetMagneticField();}
222
223 /*
224 *Get the primary vertex from the esd event
225 */
226 const AliESDVertex *GetPrimaryVertex() const {return fESDEvent->GetPrimaryVertex();}
227
228 /*
229 * Set the PID of the negative track
230 */
231 void SetNegativeTrackPID(Int_t negTrackPID){fNegativeTrackPID=negTrackPID;}
232
233 /*
234 * Set the PID of the positive track
235 */
236 void SetPositiveTrackPID(Int_t posTrackPID){fPositiveTrackPID=posTrackPID;}
237
238 /*
239 * Set the flag to use the kfparticle class. Will also disable the use of esd tracks
240 */
241 void UseKFParticle(){fUseKFParticle = kTRUE; fUseESDTrack = kFALSE;}
242
243 /*
244 * Set the flag to use the esd track class. Will also disable the use of kf particles
245 */
246 void UseESDTrack(){fUseESDTrack = kTRUE; fUseKFParticle = kFALSE;}
247
248 /*
249 * Set the flag to use improved vertex or not
250 */
251 void SetUseImprovedVertex(Bool_t useImprovedVertex){fUseImprovedVertex=useImprovedVertex;}
252
253 /*
254 * Return the number in the species array belonging to the negative or positive track pid.
255 */
256 Int_t GetSpeciesIndex(Int_t chargeOfTrack);
257
258 /*
259 * Return the x coordinate of the v0
260 */
261 Double_t GetX() const{return fCurrentXValue;}
262
263 /*
264 * Return the y coordinate of the v0
265 */
266 Double_t GetY() const{return fCurrentYValue;}
267
268 /*
269 * Return the Z coordinate of the v0
270 */
271 Double_t GetZ() const{return fCurrentZValue;}
272
273 /*
274 * Return the radius of the v0
275 */
276 Double_t GetXYRadius() const{return sqrt((Double_t)(fCurrentXValue*fCurrentXValue + fCurrentYValue*fCurrentYValue));}
277
278 /*
279 * Get the opening angle between the two tracks
280 */
281 Double_t GetOpeningAngle(){return fNegativeTrackLorentzVector->Angle(fPositiveTrackLorentzVector->Vect());}
9640a3d1 282
283 /*
284 * Get the Cos Pointing angle between the two tracks
285 */
286 Double_t GetCosPointingAngle(){return fCurrentV0->GetV0CosineOfPointingAngle();}
287
288 /*
289 * Get the DCA between the two tracks
290 */
291 Double_t GetDcaDaughters(){return fCurrentV0->GetDcaV0Daughters();}
292
293 /*
294 * Get the Normalized DCA between the two tracks
295 */
296 Double_t GetNormDcaDistDaughters(){return fCurrentV0->GetDcaV0Daughters()/fCurrentV0->GetDistSigma();}
297
298 /*
299 * Get the Likelihood for a Conversion
300 */
301 Double_t GetLikelihoodAP(){return fCurrentV0->GetLikelihoodAP(0,0);}
302
a0b94e5c 303 /*
304 * Gets the Energy of the negative track.
305 */
306 Double_t GetNegativeTrackEnergy() const{return fCurrentNegativeKFParticle->E();}
307
308 /*
309 * Gets the Energy of the positive track.
310 */
311 Double_t GetPositiveTrackEnergy() const{return fCurrentPositiveKFParticle->E();}
312
313 /*
314 * Gets the Energy of the mother candidate.
315 */
316 Double_t GetMotherCandidateEnergy() const{return fCurrentMotherKFCandidate->E();}
317
318 /*
319 * Gets the Pt of the negative track.
320 */
321 Double_t GetNegativeTrackPt() const{return fNegativeTrackLorentzVector->Pt();}
322
323 /*
324 * Gets the Pt of the positive track.
325 */
326 Double_t GetPositiveTrackPt() const{return fPositiveTrackLorentzVector->Pt();}
327
9640a3d1 328
a0b94e5c 329 /*
330 * Gets the Pt of the mother candidate.
331 */
332 Double_t GetMotherCandidatePt() const{return fMotherCandidateLorentzVector->Pt();}
9640a3d1 333
334
335 /*
336 * Gets the P of the mother candidate.
337 */
338 Double_t GetMotherCandidateP() const{return fMotherCandidateLorentzVector->P();}
a0b94e5c 339
9640a3d1 340
a0b94e5c 341 /*
342 * Gets the Eta of the negative track.
343 */
344 Double_t GetNegativeTrackEta() const{return fNegativeTrackLorentzVector->Eta();}
345 /*
346 * Gets the Eta of the positive track.
347 */
348 Double_t GetPositiveTrackEta() const{return fPositiveTrackLorentzVector->Eta();}
349 /*
350 * Gets the Eta of the mother candidate.
351 */
352 Double_t GetMotherCandidateEta() const{return fMotherCandidateLorentzVector->Eta();}
353
354 /*
355 * Gets the NDF of the mother candidate.
356 */
357 Double_t GetMotherCandidateNDF() const{return fCurrentMotherKFCandidate->GetNDF();}
358
359 /*
360 * Gets the Chi2 of the mother candidate.
361 */
362 Double_t GetMotherCandidateChi2() const{return fCurrentMotherKFCandidate->GetChi2();}
363
364 /*
365 * Gets the Mass of the mother candidate.
366 */
367 Double_t GetMotherCandidateMass() const{return fMotherCandidateKFMass;}
368
369 /*
370 * Gets the Width of the mother candidate.
371 */
372 Double_t GetMotherCandidateWidth() const{return fMotherCandidateKFWidth;}
373
374 /*
375 * Gets the Phi of the negative track.
376 */
377 Double_t GetNegativeTrackPhi() const;
378
379 /*
380 * Gets the Phi of the positive track.
381 */
382 Double_t GetPositiveTrackPhi() const;
383
384 /*
385 * Gets the Phi of the mother candidate.
386 */
387 Double_t GetMotherCandidatePhi() const;
388
389 /*
390 * Gets the Rapidity of the mother candidate.
391 */
392 Double_t GetMotherCandidateRapidity() const;
393
9640a3d1 394
395 /*
396 * Gets the P of the negative track.
397 */
398 Double_t GetNegativeTrackP() const{return fNegativeTrackLorentzVector->P();}
399
400 /*
401 * Gets the P of the positive track.
402 */
403 Double_t GetPositiveTrackP() const{return fPositiveTrackLorentzVector->P();}
404
405 /*
406 * Gets the dE/dx in the TPC of the negative track.
407 */
408 Double_t GetNegativeTrackTPCdEdx() const{return fCurrentNegativeESDTrack->GetTPCsignal();}
409
410 /*
411 * Gets the dE/dx in the TPC of the positive track.
412 */
413 Double_t GetPositiveTrackTPCdEdx() const{return fCurrentPositiveESDTrack->GetTPCsignal();}
ebcfaa7e 414
415 /*
416 * Gets the Number of the TPC clusters of the negative track.
417 */
6f40a6d2 418 Int_t GetNegativeTracknTPCClusters() const{return fCurrentNegativeESDTrack->GetNcls(1);}
ebcfaa7e 419
420 /*
421 * Gets the Number of the TPC clusters of the positive track.
422 */
6f40a6d2 423 Int_t GetPositiveTracknTPCClusters() const{return fCurrentPositiveESDTrack->GetNcls(1);}
ebcfaa7e 424
5ce758b0 425
426 /*
427 * Gets the Number of the TPC findable clusters of the negative track.
428 */
429 Int_t GetNegativeTracknTPCFClusters() const{return fCurrentNegativeESDTrack->GetTPCNclsF();}
430
431 /*
432 * Gets the Number of the TPC findable clusters of the positive track.
433 */
434 Int_t GetPositiveTracknTPCFClusters() const{return fCurrentPositiveESDTrack->GetTPCNclsF();}
435
ebcfaa7e 436 /*
437 * Gets the Number of the ITS clusters of the negative track.
438 */
6f40a6d2 439 Int_t GetNegativeTracknITSClusters() const{return fCurrentNegativeESDTrack->GetNcls(0);}
ebcfaa7e 440
441 /*
442 * Gets the Number of the ITS clusters of the positive track.
443 */
6f40a6d2 444 Int_t GetPositiveTracknITSClusters() const{return fCurrentPositiveESDTrack->GetNcls(0);}
5ce758b0 445
446 /*
447 * Gets the chi2 of the TPC negative track.
448 */
449 Double_t GetNegativeTrackTPCchi2() const{return fCurrentNegativeESDTrack->GetTPCchi2();}
450
451 /*
452 * Gets the chi2 of the TPC the positive track.
453 */
454 Double_t GetPositiveTrackTPCchi2() const{return fCurrentPositiveESDTrack->GetTPCchi2();}
a0b94e5c 455
456 /*
457 * Update data which need to be updated every event.
458 */
459 void UpdateEventByEventData();
10e3319b 460
461 /*
462 * Gets the MaxRCut value.
463 */
464 Double_t GetMaxVertexZ() const{return fMaxVertexZ;}
a0b94e5c 465
466 /*
467 * Gets the MaxRCut value.
468 */
469 Double_t GetMaxRCut() const{return fMaxR;}
bd6d9fa3 470
471 /*
472 * Gets the MinRCut value.
473 */
474 Double_t GetMinRCut() const{return fMinR;}
a0b94e5c 475
476 /*
477 * Gets the Eta cut value.
478 */
479 Double_t GetEtaCut() const{return fEtaCut;}
dc2883e4 480
481 /*
482 * Gets the Rapidity Meson cut value.
483 */
484 Double_t GetRapidityMesonCut() const{return fRapidityMesonCut;}
a0b94e5c 485
486 /*
487 * Gets the Pt cut value.
488 */
489 Double_t GetPtCut() const{return fPtCut;}
490
491
492 /*
493 * Gets the MaxZCut value.
494 */
495 Double_t GetMaxZCut() const{return fMaxZ;}
496
497
48682642 498 /*
499 * Gets the MinClsTPC value.
500 */
501 Double_t GetMinClsTPCCut() const{return fMinClsTPC;}
502
bd6d9fa3 503 /*
504 * Gets the MinClsTPC value.
505 */
506 Double_t GetMinClsTPCCutToF() const{return fMinClsTPCToF;}
507
508
48682642 509
a0b94e5c 510 /*
511 * Gets the line cut values.
512 */
513 Double_t GetLineCutZRSlope() const{return fLineCutZRSlope;}
514 Double_t GetLineCutZValue() const{return fLineCutZValue;}
515
516 /*
517 * Gets the Chi2 cut value for the conversions.
518 */
519 Double_t GetChi2CutConversion() const{return fChi2CutConversion;}
520
521 /*
522 * Gets the Chi2 cut value for the mesons.
523 */
524 Double_t GetChi2CutMeson() const{return fChi2CutMeson;}
525
9c1cb6f7 526 /*
527 * Gets the alpha cut value for the mesons.
528 */
529 Double_t GetAlphaCutMeson() const{return fAlphaCutMeson;}
530
67381a40 531 /*
532 * Gets the Minimum alpha cut value for the mesons.
533 */
534 Double_t GetAlphaMinCutMeson() const{return fAlphaMinCutMeson;}
9c1cb6f7 535
a0b94e5c 536 Double_t GetPositiveTrackLength() const{return fCurrentPositiveESDTrack->GetIntegratedLength();}
537 Double_t GetNegativeTrackLength() const{return fCurrentNegativeESDTrack->GetIntegratedLength();}
538
539 Double_t GetPositiveNTPCClusters() const{return fCurrentPositiveESDTrack->GetTPCNcls();}
540 Double_t GetNegativeNTPCClusters() const{return fCurrentNegativeESDTrack->GetTPCNcls();}
541
10e3319b 542 /*
543 * Sets the MaxVertexZ value.
544 */
545 void SetMaxVertexZ(Double_t maxVertexZ){fMaxVertexZ=maxVertexZ;}
546
a0b94e5c 547 /*
548 * Sets the MaxRCut value.
549 */
550 void SetMaxRCut(Double_t maxR){fMaxR=maxR;}
bd6d9fa3 551 /*
552 * Sets the MinRCut value.
553 */
554 void SetMinRCut(Double_t minR){fMinR=minR;}
555
a0b94e5c 556 /*
557 * Sets the EtaCut value.
558 */
559 void SetEtaCut(Double_t etaCut){fEtaCut=etaCut;}
dc2883e4 560
561 /*
562 * Sets the Rapidity Meson Cut value.
563 */
564 void SetRapidityMesonCut(Double_t RapidityMesonCut){fRapidityMesonCut=RapidityMesonCut;}
a0b94e5c 565
566 /*
567 * Sets the PtCut value.
568 */
569 void SetPtCut(Double_t ptCut){fPtCut=ptCut;}
570
48682642 571 /*
572 * Sets the PtCut value.
573 */
574 void SetSinglePtCut(Double_t singleptCut){fSinglePtCut=singleptCut;}
575
a0b94e5c 576
577 /*
578 * Sets the MaxZCut value.
579 */
580 void SetMaxZCut(Double_t maxZ){fMaxZ=maxZ;}
581
bd6d9fa3 582 /*
48682642 583 * Sets the MinClsTPC value.
584 */
585 void SetMinClsTPCCut(Double_t minClsTPC){fMinClsTPC=minClsTPC;}
bd6d9fa3 586
587 /*
588 * Sets the MinClsTPC value.
589 */
590 void SetMinClsTPCCutToF(Double_t minClsTPCToF){fMinClsTPCToF=minClsTPCToF;}
a0b94e5c 591
bd6d9fa3 592
a0b94e5c 593 /*
594 * Sets the LineCut values.
595 */
596 void SetLineCutZRSlope(Double_t LineCutZRSlope){fLineCutZRSlope=LineCutZRSlope;}
597 void SetLineCutZValue(Double_t LineCutZValue){fLineCutZValue=LineCutZValue;}
598
599 /*
600 * Sets the Chi2Cut value for conversions.
601 */
602 void SetChi2CutConversion(Double_t chi2){fChi2CutConversion=chi2;}
603
604 /*
605 * Sets the Chi2Cut for the mesons.
606 */
607 void SetChi2CutMeson(Double_t chi2){fChi2CutMeson=chi2;}
608
9c1cb6f7 609 /*
610 * Sets the AlphaCut for the mesons.
611 */
612 void SetAlphaCutMeson(Double_t alpha){fAlphaCutMeson=alpha;}
613
614
67381a40 615 /*
616 * Sets the AlphaCut for the mesons.
617 */
618 void SetAlphaMinCutMeson(Double_t alpha){fAlphaMinCutMeson=alpha;}
619
620
a0b94e5c 621 /*
622 * Sets the XVertexCut value.
623 */
624 void SetXVertexCut(Double_t xVtx){fCurrentXValue=xVtx;}
625
626 /*
627 * Sets the YVertexCut value.
628 */
629 void SetYVertexCut(Double_t yVtx){fCurrentYValue=yVtx;}
630
631 /*
632 * Sets the ZVertexCut value.
633 */
634 void SetZVertexCut(Double_t zVtx){fCurrentZValue=zVtx;}
635
636 /*
637 * Sets the PIDProbabilityCut value for track particles.
638 */
639 void SetPIDProbability(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb; fPIDProbabilityCutNegativeParticle=pidProb;}
640
641 /*
642 * Sets the PIDProbability cut value for the negative track.
643 */
644 void SetPIDProbabilityNegativeParticle(Double_t pidProb){fPIDProbabilityCutNegativeParticle=pidProb;}
645
646 /*
647 * Sets the PIDProbability cut value for the positive track.
648 */
649 void SetPIDProbabilityPositiveParticle(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb;}
9640a3d1 650
651 /*
652 * Sets the PIDnSigmaAboveElectron cut value for the tracks.
653 */
654 void SetPIDnSigmaAboveElectronLine(Double_t nSigmaAbove){fPIDnSigmaAboveElectronLine=nSigmaAbove;}
655
656 /*
657 * Sets the PIDnSigmaBelowElectron cut value for the tracks.
658 */
659 void SetPIDnSigmaBelowElectronLine(Double_t nSigmaBelow){fPIDnSigmaBelowElectronLine=nSigmaBelow;}
a0b94e5c 660
9640a3d1 661 /*
662 * Sets the PIDnSigmaAbovePion cut value for the tracks.
663 */
664 void SetPIDnSigmaAbovePionLine(Double_t nSigmaAbovePion){fPIDnSigmaAbovePionLine=nSigmaAbovePion;}
665
666 /*
667 * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
668 */
669 void SetPIDMinPnSigmaAbovePionLine(Double_t MinPnSigmaAbovePion){fPIDMinPnSigmaAbovePionLine=MinPnSigmaAbovePion;}
670
10e3319b 671 /*
672 * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
673 */
674 void SetPIDMaxPnSigmaAbovePionLine(Double_t MaxPnSigmaAbovePion){fPIDMaxPnSigmaAbovePionLine=MaxPnSigmaAbovePion;}
675
a0b94e5c 676 /*
677 * Sets the SigmaMassCut value.
678 */
679 void SetSigmaMass(Double_t sigmaMass){fNSigmaMass=sigmaMass;}
680
681 /*
682 * Sets the flag to enable/disable the usage of MC information.
683 */
684 void SetDoMCTruth(Bool_t doMC){fDoMC = doMC;}
61374d97 685
686 /*
687 * Sets the flag to enable/disable the usage of MC information.
688 */
037dc2db 689 Bool_t GetDoMCTruth() const {return fDoMC;}
a0b94e5c 690
9640a3d1 691 /*
692 * Sets the flag to enable/disable the cut dedx N sigma
693 */
694
695 void SetDodEdxSigmaCut( Bool_t dodEdxSigmaCut){fDodEdxSigmaCut=dodEdxSigmaCut;}
696
9c1cb6f7 697 /*
698 * Sets the flag to enable/disable the cut dedx N sigma for Kaon Rejection at low p
699 */
700 void SetDoKaonRejectionLowP( Bool_t doKaonRejectionLowP){fDoKaonRejectionLowP=doKaonRejectionLowP;}
701 /*
702 * Sets the flag to enable/disable the cut dedx N sigma for Proton Rejection at low p
703 */
704 void SetDoProtonRejectionLowP( Bool_t doProtonRejectionLowP){fDoProtonRejectionLowP=doProtonRejectionLowP;}
705
706 /*
707 * Sets the flag to enable/disable the cut dedx N sigma for Pion Rejection at low p
708 */
709 void SetDoPionRejectionLowP( Bool_t doPionRejectionLowP){fDoPionRejectionLowP=doPionRejectionLowP;}
710
711 /*
712 * Sets the PIDMinPnSigmaAroundKaon cut value for the tracks.
713 */
714 void SetPIDnSigmaAtLowPAroundKaonLine(Double_t nSigmaAtLowPAroundKaon){fPIDnSigmaAtLowPAroundKaonLine =nSigmaAtLowPAroundKaon;}
715
716 /*
717 * Sets the PIDMinPnSigmaAroundProton cut value for the tracks.
718 */
719 void SetPIDnSigmaAtLowPAroundProtonLine(Double_t nSigmaAtLowPAroundProton){fPIDnSigmaAtLowPAroundProtonLine =nSigmaAtLowPAroundProton;}
720
721 /*
722 * Sets the PIDMinPnSigmaAroundPion cut value for the tracks.
723 */
724 void SetPIDnSigmaAtLowPAroundPionLine(Double_t nSigmaAtLowPAroundPion){fPIDnSigmaAtLowPAroundPionLine =nSigmaAtLowPAroundPion;}
725
726 /*
727 * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
728 */
729 void SetPIDMinPKaonRejectionLowP(Double_t PIDMinPKaonRejectionLowP ){fPIDMinPKaonRejectionLowP=PIDMinPKaonRejectionLowP;}
730
731 /*
732 * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
733 */
734 void SetPIDMinPProtonRejectionLowP(Double_t PIDMinPProtonRejectionLowP ){fPIDMinPProtonRejectionLowP=PIDMinPProtonRejectionLowP;}
735 /*
736 * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
737 */
738 void SetPIDMinPPionRejectionLowP(Double_t PIDMinPPionRejectionLowP ){fPIDMinPPionRejectionLowP=PIDMinPPionRejectionLowP;}
9640a3d1 739
70ef88b5 740 /*
741 *Set if we want to use Gamma Selection based on Qt from Armenteros
742 */
743 void SetDoQtGammaSelection(Bool_t doQtGammaSelection){fDoQtGammaSelection=doQtGammaSelection;}
14d7f2f9 744 void SetDoHighPtQtGammaSelection(Bool_t doHighPtQtGammaSelection){fDoHighPtQtGammaSelection=doHighPtQtGammaSelection;} // RRnew
70ef88b5 745 /*
746 * Sets the MaxQtCut value.
747 */
748 void SetQtMax(Double_t qtMax){fQtMax=qtMax;}
14d7f2f9 749 void SetHighPtQtMax(Double_t qtMaxHighPt){fHighPtQtMax=qtMaxHighPt;} // RRnew
750 void SetPtBorderForQt(Double_t ptBorderForQt){fPtBorderForQt=ptBorderForQt;} // RRnew
70ef88b5 751
a0b94e5c 752 /*
753 * Updates the V0 information of the current V0.
754 */
755 Bool_t UpdateV0Information();
756
757 /*
758 * Resets the V0 index.
759 */
760 void ResetV0IndexNumber(){fCurrentV0IndexNumber=0;}
5ce758b0 761
762
763 /*
764 * Returns number of good v0s in the event
765 */
766 Int_t GetNGoodV0s() const {return fNumberOfGoodV0s;}
767
a0b94e5c 768 /*
769 * Sets the histograms.
770 */
4a6157dc 771 void SetHistograms(AliGammaConversionHistograms * const histograms){fHistograms=histograms;}
a0b94e5c 772
773 /*
774 * Check for primary vertex.
775 */
776 Bool_t CheckForPrimaryVertex();
777
10e3319b 778 /*
779 * Check for primary vertex Z.
780 */
781 Bool_t CheckForPrimaryVertexZ();
782
a0b94e5c 783 /*
784 * Gets a vector of good v0s.
785 */
5e55d806 786 TClonesArray* GetCurrentEventGoodV0s() const{return fCurrentEventGoodV0s;}
a0b94e5c 787
788 /*
789 * Gets the vector of previous events v0s (for bacground analysis)
790 */
f14266e7 791 AliGammaConversionKFVector* GetBGGoodV0s(Int_t event) const;
5e55d806 792 // vector<AliKFParticle> GetPreviousEventGoodV0s() const{return fPreviousEventGoodV0s;}
a0b94e5c 793
794 void SetUseOwnXYZCalculation(Bool_t flag){fUseOwnXYZCalculation=flag;}
795
5ce758b0 796 void SetUseConstructGamma(Bool_t flag){fUseConstructGamma=flag;}
797
a0b94e5c 798 Bool_t GetHelixCenter(AliESDtrack* track, Double_t b,Int_t charge, Double_t center[2]);
799
800 Bool_t GetConvPosXY(AliESDtrack* ptrack,AliESDtrack* ntrack, Double_t b, Double_t convpos[2]);
801
802 Double_t GetConvPosZ(AliESDtrack* ptrack,AliESDtrack* ntrack, Double_t b);
1e7846f4 803
f14266e7 804 Bool_t GetArmenterosQtAlfa(const AliKFParticle * posKFparticle, const AliKFParticle * negKFparticle, const AliKFParticle * gamKFparticle,Double_t armenterosQtAlfa[2]);
48682642 805
1e7846f4 806 void SetDoCF(Bool_t flag){fDoCF = flag;}
807
77880bd8 808 Bool_t CheckV0FinderStatus(Int_t index);
809
810 void SetOnFlyFlag(Bool_t flag){fUseOnFlyV0Finder = flag;}
87f6de3e 811
812 Int_t GetNBGEvents(){return fBGEventHandler->GetNBGEvents();}
77880bd8 813
87f6de3e 814 void SetCalculateBackground(Bool_t flag){fCalculateBackground=flag;}
77880bd8 815
037dc2db 816 AliGammaConversionBGHandler* GetBGHandler() const {return fBGEventHandler;}
817
818 Double_t GetVertexZ(){return fESDEvent->GetPrimaryVertex()->GetZ();}
819
820 Int_t GetMultiplicity(){return CountESDTracks();}
821
822 void SetESDtrackCuts(AliESDtrackCuts * const trackCuts){fEsdTrackCuts = trackCuts;}
823
f14266e7 824 void SetNEventsForBG(Int_t nev){fNEventsForBGCalculation = nev;}
70ef88b5 825
037dc2db 826 Int_t CountESDTracks();
827
828 Int_t GetCurrentV0IndexNumber() const {return fCurrentV0IndexNumber;}
829
830 Bool_t CheckIfPi0IsMother(Int_t label);
10e3319b 831 Bool_t CheckIfEtaIsMother(Int_t label);
037dc2db 832
9c1cb6f7 833 static void InitESDpid(Int_t type=0);
834 static void SetESDpid(AliESDpid * const pid) {fgESDpid=pid;}
835 static AliESDpid* GetESDpid() {return fgESDpid;}
7f3c7cc6 836
5ce758b0 837 void SetUseChargedTracksMultiplicityForBG(Bool_t flag){fUseChargedTrackMultiplicityForBG = flag;}
64f4118c 838 void SetIsHeavyIon(Int_t isHeavyIon) {fIsHeavyIon=isHeavyIon;}
839 Int_t GetIsHeavyIon() const { return fIsHeavyIon;}
840
7f3c7cc6 841 Int_t GetPindex(Int_t i) {return fV0Pindex.at(i);}
842 Int_t GetNindex(Int_t i) {return fV0Nindex.at(i);}
5ce758b0 843
844 void ResetNGoodV0s(){fNumberOfGoodV0s=0;}
40051a3e 845 Int_t GetFirstTPCRow(Double_t radius);
9c1cb6f7 846
40051a3e 847 void SetUseCorrectedTPCClsInfo(Bool_t flag){fUseCorrectedTPCClsInfo = flag;}
848 Bool_t GetUseCorrectedTPCClsInfo() const {return fUseCorrectedTPCClsInfo;}
9c1cb6f7 849
a0b94e5c 850 private:
851 AliStack * fMCStack; // pointer to MonteCarlo particle stack
48682642 852 // AliMCEventHandler* fMCTruth; // for CF pointer to the MC object
a0b94e5c 853 AliMCEvent *fMCEvent; // for CF pointer to MC event
854 TChain * fChain; // pointer to the TChain
855
48682642 856 // AliESDInputHandler* fESDHandler; //! pointer to esd object
a0b94e5c 857 AliESDEvent *fESDEvent; //! pointer to esd object
858
859
860 // for CF
4a6157dc 861 AliCFManager *fCFManager; // pointer to the cf manager
862 // AliCFContainer *container;
a0b94e5c 863
9640a3d1 864 // for dEdx cut based on nSigma to a particle line
9c1cb6f7 865 //AliESDpid * fESDpid; // esd pid
a0b94e5c 866
a81d2986 867 AliGammaConversionHistograms *fHistograms; // pointer to histogram handling class
a0b94e5c 868
4a6157dc 869 Int_t fCurrentV0IndexNumber; // the current v0 index number
a0b94e5c 870 AliESDv0 * fCurrentV0; //! pointer to the current v0
871 AliKFParticle * fCurrentNegativeKFParticle; //! pointer to the negative KF particle
872 AliKFParticle * fCurrentPositiveKFParticle; //! pointer to the positive KF particle
873 AliKFParticle * fCurrentMotherKFCandidate; //! pointer to the positive KF particle
874
875 AliESDtrack * fCurrentNegativeESDTrack; //! pointer to the negative ESD track
876 AliESDtrack * fCurrentPositiveESDTrack; //! pointer to the positive ESD track
877
878 TLorentzVector * fNegativeTrackLorentzVector; //! pointer to the negative Track Lorentz Vector
879 TLorentzVector * fPositiveTrackLorentzVector; //! pointer to the positive Track Lorentz Vector
880 TLorentzVector * fMotherCandidateLorentzVector; //! pointer to the mother candidate Track Lorentz Vector
881
882 Double_t fCurrentXValue; // current x value
883 Double_t fCurrentYValue; // current y value
884 Double_t fCurrentZValue; // current z value
885
886 Int_t fPositiveTrackPID; // positive track pid
887 Int_t fNegativeTrackPID; // negative track pid
888
889 TParticle *fNegativeMCParticle; //!
890 TParticle *fPositiveMCParticle; //!
891 TParticle *fMotherMCParticle; //!
892
893 Double_t fMotherCandidateKFMass; // mass of mother candidate KF particle
894 Double_t fMotherCandidateKFWidth; // width of mother candidate KF particle
895
896 Bool_t fUseKFParticle; // flag
897 Bool_t fUseESDTrack; // flag
898 Bool_t fDoMC; // flag
10e3319b 899
900 //Event Cuts
f14266e7 901 Double_t fMaxVertexZ; // max z vertex cut
a0b94e5c 902 //cuts
903 Double_t fMaxR; //r cut
bd6d9fa3 904 Double_t fMinR; //r cut
a0b94e5c 905 Double_t fEtaCut; //eta cut
dc2883e4 906 Double_t fRapidityMesonCut; //rapidity for meson cut
a0b94e5c 907 Double_t fPtCut; // pt cut
48682642 908 Double_t fSinglePtCut; // pt cut for electron/positron
909 Double_t fMaxZ; //z cut
f14266e7 910 Double_t fMinClsTPC; // minimum clusters in the TPC
911 Double_t fMinClsTPCToF; // minimum clusters to findable clusters
a0b94e5c 912 Double_t fLineCutZRSlope; //linecut
913 Double_t fLineCutZValue; //linecut
914 Double_t fChi2CutConversion; //chi2cut
915 Double_t fChi2CutMeson; //chi2cut
9c1cb6f7 916 Double_t fAlphaCutMeson; //alphacut
67381a40 917 Double_t fAlphaMinCutMeson; //alphacut
a0b94e5c 918 Double_t fPIDProbabilityCutNegativeParticle; //pid cut
919 Double_t fPIDProbabilityCutPositiveParticle; //pid cut
9640a3d1 920 Bool_t fDodEdxSigmaCut; // flag to use the dEdxCut based on sigmas
037dc2db 921 Double_t fPIDnSigmaAboveElectronLine; // sigma cut
922 Double_t fPIDnSigmaBelowElectronLine; // sigma cut
923 Double_t fPIDnSigmaAbovePionLine; // sigma cut
924 Double_t fPIDMinPnSigmaAbovePionLine; // sigma cut
10e3319b 925 Double_t fPIDMaxPnSigmaAbovePionLine; // sigma cut
9c1cb6f7 926 Double_t fDoKaonRejectionLowP; // Kaon rejection at low p
927 Double_t fDoProtonRejectionLowP; // Proton rejection at low p
928 Double_t fDoPionRejectionLowP; // Pion rejection at low p
929 Double_t fPIDnSigmaAtLowPAroundKaonLine; // sigma cut
930 Double_t fPIDnSigmaAtLowPAroundProtonLine; // sigma cut
931 Double_t fPIDnSigmaAtLowPAroundPionLine; // sigma cut
932 Double_t fPIDMinPKaonRejectionLowP; // Momentum limit to apply kaon rejection
933 Double_t fPIDMinPProtonRejectionLowP; // Momentum limit to apply proton rejection
934 Double_t fPIDMinPPionRejectionLowP; // Momentum limit to apply proton rejection
70ef88b5 935 Bool_t fDoQtGammaSelection; // Select gammas using qtMax
14d7f2f9 936 Bool_t fDoHighPtQtGammaSelection; // RRnew Select gammas using qtMax for high pT
70ef88b5 937 Double_t fQtMax; // Maximum Qt from Armenteros to select Gammas
14d7f2f9 938 Double_t fHighPtQtMax; // RRnew Maximum Qt for High pT from Armenteros to select Gammas
939 Double_t fPtBorderForQt; // RRnew
a0b94e5c 940 Double_t fXVertexCut; //vertex cut
941 Double_t fYVertexCut; //vertex cut
942 Double_t fZVertexCut; // vertexcut
943
944 Double_t fNSigmaMass; //nsigma cut
945
946 Bool_t fUseImprovedVertex; //flag
947
948 Bool_t fUseOwnXYZCalculation; //flag that determines if we use our own calculation of xyz (markus)
1e7846f4 949
5ce758b0 950 Bool_t fUseConstructGamma; //flag that determines if we use ConstructGamma method from AliKF
951
cb90a330 952 Bool_t fDoCF; //flag
953
037dc2db 954 Bool_t fUseOnFlyV0Finder; //flag
77880bd8 955
cb90a330 956 Bool_t fUpdateV0AlreadyCalled; //flag
a0b94e5c 957
5e55d806 958 TClonesArray* fCurrentEventGoodV0s; //vector of good v0s
7f3c7cc6 959
f14266e7 960 vector<Int_t> fV0Pindex; // index of positive track belonging to a V0
961 vector<Int_t> fV0Nindex; // index of positive track belonging to a V0
5e55d806 962 // vector<AliKFParticle> fPreviousEventGoodV0s; // vector of good v0s from prevous events
963
037dc2db 964 Bool_t fCalculateBackground; //flag
965 AliGammaConversionBGHandler *fBGEventHandler; // background handler
966 Bool_t fBGEventInitialized; //flag
a0b94e5c 967
037dc2db 968 AliESDtrackCuts *fEsdTrackCuts; // track cuts
969 Int_t fNumberOfESDTracks; //track counter
970
9c1cb6f7 971 static AliESDpid* fgESDpid; // ESD pid object
972
f14266e7 973 Int_t fNEventsForBGCalculation; // Number of events used for background calculation
5ce758b0 974
f14266e7 975 Bool_t fUseChargedTrackMultiplicityForBG; // flag
976 Int_t fNumberOfGoodV0s; // number of good V0s
977 Int_t fIsHeavyIon; // flag
40051a3e 978 Bool_t fUseCorrectedTPCClsInfo;
70ef88b5 979
14d7f2f9 980 ClassDef(AliV0Reader,19) // RRnew
a0b94e5c 981};
9c1cb6f7 982
983inline void AliV0Reader::InitESDpid(Int_t type)
984{
985 //
986 // initialize PID parameters
987 // type=0 is simulation
988 // type=1 is data
989
990 if (!fgESDpid) fgESDpid=new AliESDpid;
991 Double_t alephParameters[5];
992 // simulation
993 alephParameters[0] = 2.15898e+00/50.;
994 alephParameters[1] = 1.75295e+01;
995 alephParameters[2] = 3.40030e-09;
996 alephParameters[3] = 1.96178e+00;
997 alephParameters[4] = 3.91720e+00;
998 fgESDpid->GetTOFResponse().SetTimeResolution(80.);
999
1000 // data
1001 if (type==1){
c0d9051e 1002 alephParameters[0] = 0.0283086/0.97;
9c1cb6f7 1003 alephParameters[1] = 2.63394e+01;
1004 alephParameters[2] = 5.04114e-11;
1005 alephParameters[3] = 2.12543e+00;
1006 alephParameters[4] = 4.88663e+00;
1007 fgESDpid->GetTOFResponse().SetTimeResolution(130.);
c0d9051e 1008 fgESDpid->GetTPCResponse().SetMip(50.);
9c1cb6f7 1009 }
1010
1011 fgESDpid->GetTPCResponse().SetBetheBlochParameters(
1012 alephParameters[0],alephParameters[1],alephParameters[2],
1013 alephParameters[3],alephParameters[4]);
1014
1015 fgESDpid->GetTPCResponse().SetSigma(3.79301e-03, 2.21280e+04);
1016
1017}
1018
a0b94e5c 1019#endif
1020
1021
1022
9c1cb6f7 1023
1024