1 #ifndef ALIV0READER_H
\r
2 #define ALIV0READER_H
\r
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
\r
4 * See cxx source for full Copyright notice */
\r
6 ////////////////////////////////////////////////
\r
7 //---------------------------------------------
\r
8 // Class used to do analysis on conversion pairs
\r
9 //---------------------------------------------
\r
10 ////////////////////////////////////////////////
\r
12 // --- ROOT system ---
\r
13 #include "TObject.h"
\r
14 #include "AliESDv0.h"
\r
15 #include "AliESDEvent.h"
\r
16 #include "AliKFParticle.h"
\r
17 #include "TParticle.h"
\r
18 #include "AliGammaConversionHistograms.h"
\r
21 class TClonesArray;
\r
25 //--- AliRoot system ---
\r
29 class AliMCEventHandler;
\r
30 class AliESDInputHandler;
\r
38 class AliV0Reader : public TObject {
\r
42 AliV0Reader(); //constructor
\r
43 AliV0Reader(const AliV0Reader & g); //copy constructor
\r
44 AliV0Reader & operator = (const AliV0Reader & g); //assignment operator
\r
45 virtual ~AliV0Reader() {;} //virtual destructor
\r
47 *Initialize the reader
\r
52 * Returns AliESDEvent
\r
54 AliESDEvent* GetESDEvent() const{return fESDEvent;}
\r
57 *Returns the number of v0s in the event, no cuts applied.
\r
59 Int_t GetNumberOfV0s() const{return fESDEvent->GetNumberOfV0s();}
\r
62 * Check if there are any more good v0s left in the v0 stack
\r
63 * if so, fCurrent v0 is set to this v0 and can be retrieved
\r
64 * by GetCurrentV0 function.
\r
65 * returns kFALSE if there is no more good v0s in the v0 stack
\r
70 * Returns the v0 at the given index, no checks are done on the v0.
\r
72 AliESDv0* GetV0(Int_t index);
\r
75 * Returns the current v0
\r
77 AliESDv0* GetCurrentV0() const{return fCurrentV0;}
\r
80 * Returns the negative ESD track which belongs to fCurrentV0
\r
82 AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());}
\r
85 * Returns the positive ESD track which belongs to fCurrentV0
\r
87 AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());}
\r
90 * Returns the negative KF particle which belongs to fCurrentV0
\r
92 AliKFParticle* GetNegativeKFParticle() const{return fCurrentNegativeKFParticle;}
\r
95 * Returns the positive KF particle which belongs to fCurrentV0
\r
97 AliKFParticle* GetPositiveKFParticle() const{return fCurrentPositiveKFParticle;}
\r
100 * Returns the KFParticle object of the 2 tracks.
\r
102 AliKFParticle* GetMotherCandidateKFCombination() const{return fCurrentMotherKFCandidate;}
\r
105 * Checks the probablity that the PID of the particle is what we want it to be.
\r
107 Bool_t CheckPIDProbability(Double_t negProbCut, Double_t posProbCut);
\r
110 * Checks if the PID of the two particles are within our cuts.
\r
112 void GetPIDProbability(Double_t &negPIDProb, Double_t &posPIDProb);
\r
115 *Get the negative MC TParticle from the stack
\r
117 TParticle * GetNegativeMCParticle() const{return fNegativeMCParticle;}
\r
120 *Get the positive MC TParticle from the stack
\r
122 TParticle * GetPositiveMCParticle() const{return fPositiveMCParticle;}
\r
125 *Get the mother MC TParticle from the stack
\r
127 TParticle * GetMotherMCParticle() const{return fMotherMCParticle;}
\r
130 * Flag to see if the v0 particles share the same mother
\r
132 Bool_t HasSameMCMother();
\r
136 *Get the PID of the MC mother particle
\r
138 Int_t GetMotherMCParticlePDGCode() const{if(fMotherMCParticle != NULL){ cout<<"MCParticle exists"<<endl;} return fMotherMCParticle->GetPdgCode();}
\r
143 AliStack* GetMCStack() const{return fMCStack;}
\r
146 *Get the magnetic field from the ESD event
\r
148 Double_t GetMagneticField() const{return fESDEvent->GetMagneticField();}
\r
151 *Get the primary vertex from the esd event
\r
153 const AliESDVertex *GetPrimaryVertex() const {return fESDEvent->GetPrimaryVertex();}
\r
156 * Set the PID of the negative track
\r
158 void SetNegativeTrackPID(Int_t negTrackPID){fNegativeTrackPID=negTrackPID;}
\r
161 * Set the PID of the positive track
\r
163 void SetPositiveTrackPID(Int_t posTrackPID){fPositiveTrackPID=posTrackPID;}
\r
166 * Set the flag to use the kfparticle class. Will also disable the use of esd tracks
\r
168 void UseKFParticle(){fUseKFParticle = kTRUE; fUseESDTrack = kFALSE;}
\r
171 * Set the flag to use the esd track class. Will also disable the use of kf particles
\r
173 void UseESDTrack(){fUseESDTrack = kTRUE; fUseKFParticle = kFALSE;}
\r
176 * Set the flag to use improved vertex or not
\r
178 void SetUseImprovedVertex(Bool_t useImprovedVertex){fUseImprovedVertex=useImprovedVertex;}
\r
181 * Return the number in the species array belonging to the negative or positive track pid.
\r
183 Int_t GetSpeciesIndex(Int_t chargeOfTrack);
\r
186 * Return the x coordinate of the v0
\r
188 Double_t GetX() const{return fCurrentXValue;}
\r
191 * Return the y coordinate of the v0
\r
193 Double_t GetY() const{return fCurrentYValue;}
\r
196 * Return the Z coordinate of the v0
\r
198 Double_t GetZ() const{return fCurrentZValue;}
\r
201 * Return the radius of the v0
\r
203 Double_t GetXYRadius() const{return sqrt((Double_t)(fCurrentXValue*fCurrentXValue + fCurrentYValue*fCurrentYValue));}
\r
206 * Get the opening angle between the two tracks
\r
208 Double_t GetOpeningAngle(){return fNegativeTrackLorentzVector->Angle(fPositiveTrackLorentzVector->Vect());}
\r
211 * Gets the Energy of the negative track.
\r
213 Double_t GetNegativeTrackEnergy() const{return fCurrentNegativeKFParticle->E();}
\r
216 * Gets the Energy of the positive track.
\r
218 Double_t GetPositiveTrackEnergy() const{return fCurrentPositiveKFParticle->E();}
\r
221 * Gets the Energy of the mother candidate.
\r
223 Double_t GetMotherCandidateEnergy() const{return fCurrentMotherKFCandidate->E();}
\r
226 * Gets the Pt of the negative track.
\r
228 Double_t GetNegativeTrackPt() const{return fNegativeTrackLorentzVector->Pt();}
\r
231 * Gets the Pt of the positive track.
\r
233 Double_t GetPositiveTrackPt() const{return fPositiveTrackLorentzVector->Pt();}
\r
236 * Gets the Pt of the mother candidate.
\r
238 Double_t GetMotherCandidatePt() const{return fMotherCandidateLorentzVector->Pt();}
\r
241 * Gets the Eta of the negative track.
\r
243 Double_t GetNegativeTrackEta() const{return fNegativeTrackLorentzVector->Eta();}
\r
245 * Gets the Eta of the positive track.
\r
247 Double_t GetPositiveTrackEta() const{return fPositiveTrackLorentzVector->Eta();}
\r
249 * Gets the Eta of the mother candidate.
\r
251 Double_t GetMotherCandidateEta() const{return fMotherCandidateLorentzVector->Eta();}
\r
254 * Gets the NDF of the mother candidate.
\r
256 Double_t GetMotherCandidateNDF() const{return fCurrentMotherKFCandidate->GetNDF();}
\r
259 * Gets the Chi2 of the mother candidate.
\r
261 Double_t GetMotherCandidateChi2() const{return fCurrentMotherKFCandidate->GetChi2();}
\r
264 * Gets the Mass of the mother candidate.
\r
266 Double_t GetMotherCandidateMass() const{return fMotherCandidateKFMass;}
\r
269 * Gets the Width of the mother candidate.
\r
271 Double_t GetMotherCandidateWidth() const{return fMotherCandidateKFWidth;}
\r
274 * Gets the Phi of the negative track.
\r
276 Double_t GetNegativeTrackPhi() const;
\r
279 * Gets the Phi of the positive track.
\r
281 Double_t GetPositiveTrackPhi() const;
\r
284 * Gets the Phi of the mother candidate.
\r
286 Double_t GetMotherCandidatePhi() const;
\r
289 * Gets the Rapidity of the mother candidate.
\r
291 Double_t GetMotherCandidateRapidity() const;
\r
295 * Update data which need to be updated every event.
\r
297 void UpdateEventByEventData();
\r
300 * Gets the MaxRCut value.
\r
302 Double_t GetMaxRCut() const{return fMaxR;}
\r
305 * Gets the Eta cut value.
\r
307 Double_t GetEtaCut() const{return fEtaCut;}
\r
310 * Gets the Pt cut value.
\r
312 Double_t GetPtCut() const{return fPtCut;}
\r
315 * Gets the line cut values.
\r
317 Double_t GetLineCutZRSlope() const{return fLineCutZRSlope;}
\r
318 Double_t GetLineCutZValue() const{return fLineCutZValue;}
\r
321 * Gets the Chi2 cut value for the conversions.
\r
323 Double_t GetChi2CutConversion() const{return fChi2CutConversion;}
\r
326 * Gets the Chi2 cut value for the mesons.
\r
328 Double_t GetChi2CutMeson() const{return fChi2CutMeson;}
\r
330 Double_t GetPositiveTrackLength() const{return fCurrentPositiveESDTrack->GetIntegratedLength();}
\r
331 Double_t GetNegativeTrackLength() const{return fCurrentNegativeESDTrack->GetIntegratedLength();}
\r
333 Double_t GetPositiveNTPCClusters() const{return fCurrentPositiveESDTrack->GetTPCNcls();}
\r
334 Double_t GetNegativeNTPCClusters() const{return fCurrentNegativeESDTrack->GetTPCNcls();}
\r
337 * Sets the MaxRCut value.
\r
339 void SetMaxRCut(Double_t maxR){fMaxR=maxR;}
\r
342 * Sets the EtaCut value.
\r
344 void SetEtaCut(Double_t etaCut){fEtaCut=etaCut;}
\r
347 * Sets the PtCut value.
\r
349 void SetPtCut(Double_t ptCut){fPtCut=ptCut;}
\r
352 * Sets the LineCut values.
\r
354 void SetLineCutZRSlope(Double_t LineCutZRSlope){fLineCutZRSlope=LineCutZRSlope;}
\r
355 void SetLineCutZValue(Double_t LineCutZValue){fLineCutZValue=LineCutZValue;}
\r
358 * Sets the Chi2Cut value for conversions.
\r
360 void SetChi2CutConversion(Double_t chi2){fChi2CutConversion=chi2;}
\r
363 * Sets the Chi2Cut for the mesons.
\r
365 void SetChi2CutMeson(Double_t chi2){fChi2CutMeson=chi2;}
\r
368 * Sets the XVertexCut value.
\r
370 void SetXVertexCut(Double_t xVtx){fCurrentXValue=xVtx;}
\r
373 * Sets the YVertexCut value.
\r
375 void SetYVertexCut(Double_t yVtx){fCurrentYValue=yVtx;}
\r
378 * Sets the ZVertexCut value.
\r
380 void SetZVertexCut(Double_t zVtx){fCurrentZValue=zVtx;}
\r
383 * Sets the PIDProbabilityCut value for track particles.
\r
385 void SetPIDProbability(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb; fPIDProbabilityCutNegativeParticle=pidProb;}
\r
388 * Sets the PIDProbability cut value for the negative track.
\r
390 void SetPIDProbabilityNegativeParticle(Double_t pidProb){fPIDProbabilityCutNegativeParticle=pidProb;}
\r
393 * Sets the PIDProbability cut value for the positive track.
\r
395 void SetPIDProbabilityPositiveParticle(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb;}
\r
398 * Sets the SigmaMassCut value.
\r
400 void SetSigmaMass(Double_t sigmaMass){fNSigmaMass=sigmaMass;}
\r
403 * Sets the flag to enable/disable the usage of MC information.
\r
405 void SetDoMCTruth(Bool_t doMC){fDoMC = doMC;}
\r
408 * Updates the V0 information of the current V0.
\r
410 Bool_t UpdateV0Information();
\r
413 * Resets the V0 index.
\r
415 void ResetV0IndexNumber(){fCurrentV0IndexNumber=0;}
\r
418 * Sets the histograms.
\r
420 void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;}
\r
423 * Check for primary vertex.
\r
425 Bool_t CheckForPrimaryVertex();
\r
428 * Gets a vector of good v0s.
\r
430 vector<AliKFParticle> GetCurrentEventGoodV0s() const{return fCurrentEventGoodV0s;}
\r
433 * Gets the vector of previous events v0s (for bacground analysis)
\r
435 vector<AliKFParticle> GetPreviousEventGoodV0s() const{return fPreviousEventGoodV0s;}
\r
438 AliStack * fMCStack; // pointer to MonteCarlo particle stack
\r
439 AliMCEventHandler* fMCTruth; // pointer to the MC event handler
\r
440 TChain * fChain; // pointer to the TChain
\r
442 AliESDInputHandler* fESDHandler; //! pointer to esd object
\r
443 AliESDEvent *fESDEvent; //! pointer to esd object
\r
445 AliGammaConversionHistograms *fHistograms; //! pointer to histogram handling class
\r
447 Int_t fCurrentV0IndexNumber;
\r
448 AliESDv0 * fCurrentV0; //! pointer to the current v0
\r
449 AliKFParticle * fCurrentNegativeKFParticle; //! pointer to the negative KF particle
\r
450 AliKFParticle * fCurrentPositiveKFParticle; //! pointer to the positive KF particle
\r
451 AliKFParticle * fCurrentMotherKFCandidate; //! pointer to the positive KF particle
\r
453 AliESDtrack * fCurrentNegativeESDTrack; //! pointer to the negative ESD track
\r
454 AliESDtrack * fCurrentPositiveESDTrack; //! pointer to the positive ESD track
\r
456 TLorentzVector * fNegativeTrackLorentzVector; //! pointer to the negative Track Lorentz Vector
\r
457 TLorentzVector * fPositiveTrackLorentzVector; //! pointer to the positive Track Lorentz Vector
\r
458 TLorentzVector * fMotherCandidateLorentzVector; //! pointer to the mother candidate Track Lorentz Vector
\r
460 Double_t fCurrentXValue; // current x value
\r
461 Double_t fCurrentYValue; // current y value
\r
462 Double_t fCurrentZValue; // current z value
\r
464 Int_t fPositiveTrackPID; // positive track pid
\r
465 Int_t fNegativeTrackPID; // negative track pid
\r
467 TParticle *fNegativeMCParticle; //!
\r
468 TParticle *fPositiveMCParticle; //!
\r
469 TParticle *fMotherMCParticle; //!
\r
471 Double_t fMotherCandidateKFMass; // mass of mother candidate KF particle
\r
472 Double_t fMotherCandidateKFWidth; // width of mother candidate KF particle
\r
474 Bool_t fUseKFParticle; // flag
\r
475 Bool_t fUseESDTrack; // flag
\r
476 Bool_t fDoMC; // flag
\r
479 Double_t fMaxR; //r cut
\r
480 Double_t fEtaCut; //eta cut
\r
481 Double_t fPtCut; // pt cut
\r
482 Double_t fLineCutZRSlope; //linecut
\r
483 Double_t fLineCutZValue; //linecut
\r
484 Double_t fChi2CutConversion; //chi2cut
\r
485 Double_t fChi2CutMeson; //chi2cut
\r
486 Double_t fPIDProbabilityCutNegativeParticle; //pid cut
\r
487 Double_t fPIDProbabilityCutPositiveParticle; //pid cut
\r
488 Double_t fXVertexCut; //vertex cut
\r
489 Double_t fYVertexCut; //vertex cut
\r
490 Double_t fZVertexCut; // vertexcut
\r
492 Double_t fNSigmaMass; //nsigma cut
\r
494 Bool_t fUseImprovedVertex; //flag
\r
496 vector<AliKFParticle> fCurrentEventGoodV0s; //vector of good v0s
\r
497 vector<AliKFParticle> fPreviousEventGoodV0s; // vector of good v0s from prevous events
\r
499 ClassDef(AliV0Reader,2)
\r