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 the number of v0s in the event, no cuts applied.
\r
54 Int_t GetNumberOfV0s() const{return fESDEvent->GetNumberOfV0s();}
\r
57 * Check if there are any more good v0s left in the v0 stack
\r
58 * if so, fCurrent v0 is set to this v0 and can be retrieved
\r
59 * by GetCurrentV0 function.
\r
60 * returns kFALSE if there is no more good v0s in the v0 stack
\r
65 * Returns the v0 at the given index, no checks are done on the v0.
\r
67 AliESDv0* GetV0(Int_t index);
\r
70 * Returns the current v0
\r
72 AliESDv0* GetCurrentV0() const{return fCurrentV0;}
\r
75 * Returns the negative ESD track which belongs to fCurrentV0
\r
77 AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());}
\r
80 * Returns the positive ESD track which belongs to fCurrentV0
\r
82 AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());}
\r
85 * Returns the negative KF particle which belongs to fCurrentV0
\r
87 AliKFParticle* GetNegativeKFParticle() const{return fCurrentNegativeKFParticle;}
\r
90 * Returns the positive KF particle which belongs to fCurrentV0
\r
92 AliKFParticle* GetPositiveKFParticle() const{return fCurrentPositiveKFParticle;}
\r
94 * Returns the KFParticle object of the 2 tracks.
\r
96 AliKFParticle* GetMotherCandidateKFCombination() const{return fCurrentMotherKFCandidate;}
\r
98 * Checks the probablity that the PID of the particle is what we want it to be.
\r
100 Bool_t CheckPIDProbability(Double_t negProbCut, Double_t posProbCut);
\r
103 *Get the negative MC TParticle from the stack
\r
105 TParticle * GetNegativeMCParticle() const{return fNegativeMCParticle;}
\r
108 *Get the positive MC TParticle from the stack
\r
110 TParticle * GetPositiveMCParticle() const{return fPositiveMCParticle;}
\r
113 *Get the mother MC TParticle from the stack
\r
115 TParticle * GetMotherMCParticle() const{return fMotherMCParticle;}
\r
117 Bool_t HasSameMCMother();
\r
122 AliStack* GetMCStack() const{return fMCStack;}
\r
125 *Get the magnetic field from the ESD event
\r
127 Double_t GetMagneticField() const{return fESDEvent->GetMagneticField();}
\r
130 *Get the primary vertex from the esd event
\r
132 const AliESDVertex *GetPrimaryVertex() const {return fESDEvent->GetPrimaryVertex();}
\r
135 * Set the PID of the negative track
\r
137 void SetNegativeTrackPID(Int_t negTrackPID){fNegativeTrackPID=negTrackPID;}
\r
140 * Set the PID of the positive track
\r
142 void SetPositiveTrackPID(Int_t posTrackPID){fPositiveTrackPID=posTrackPID;}
\r
145 * Set the flag to use the kfparticle class. Will also disable the use of esd tracks
\r
147 void UseKFParticle(){fUseKFParticle = kTRUE; fUseESDTrack = kFALSE;}
\r
150 * Set the flag to use the esd track class. Will also disable the use of kf particles
\r
152 void UseESDTrack(){fUseESDTrack = kTRUE; fUseKFParticle = kFALSE;}
\r
155 * Set the flag to use improved vertex or not
\r
157 void SetUseImprovedVertex(Bool_t useImprovedVertex){fUseImprovedVertex=useImprovedVertex;}
\r
160 * Return the number in the species array belonging to the negative or positive track pid.
\r
162 Int_t GetSpeciesIndex(Int_t chargeOfTrack);
\r
165 * Return the x coordinate of the v0
\r
167 Double_t GetX() const{return fCurrentXValue;}
\r
170 * Return the y coordinate of the v0
\r
172 Double_t GetY() const{return fCurrentYValue;}
\r
175 * Return the Z coordinate of the v0
\r
177 Double_t GetZ() const{return fCurrentZValue;}
\r
180 * Return the radius of the v0
\r
182 Double_t GetXYRadius() const{return sqrt((Double_t)(fCurrentXValue*fCurrentXValue + fCurrentYValue*fCurrentYValue));}
\r
185 * Get the opening angle between the two tracks
\r
187 Double_t GetOpeningAngle(){return fNegativeTrackLorentzVector->Angle(fPositiveTrackLorentzVector->Vect());}
\r
189 Double_t GetNegativeTrackEnergy() const{return fCurrentNegativeKFParticle->E();}
\r
190 Double_t GetPositiveTrackEnergy() const{return fCurrentPositiveKFParticle->E();}
\r
191 Double_t GetMotherCandidateEnergy() const{return fCurrentMotherKFCandidate->E();}
\r
193 Double_t GetNegativeTrackPt() const{return fNegativeTrackLorentzVector->Pt();}
\r
194 Double_t GetPositiveTrackPt() const{return fPositiveTrackLorentzVector->Pt();}
\r
195 Double_t GetMotherCandidatePt() const{return fMotherCandidateLorentzVector->Pt();}
\r
197 Double_t GetNegativeTrackEta() const{return fNegativeTrackLorentzVector->Eta();}
\r
198 Double_t GetPositiveTrackEta() const{return fPositiveTrackLorentzVector->Eta();}
\r
199 Double_t GetMotherCandidateEta() const{return fMotherCandidateLorentzVector->Eta();}
\r
201 Double_t GetMotherCandidateNDF() const{return fCurrentMotherKFCandidate->GetNDF();}
\r
202 Double_t GetMotherCandidateChi2() const{return fCurrentMotherKFCandidate->GetChi2();}
\r
203 Double_t GetMotherCandidateMass() const{return fMotherCandidateKFMass;}
\r
204 Double_t GetMotherCandidateWidth() const{return fMotherCandidateKFWidth;}
\r
206 Double_t GetNegativeTrackPhi() const;
\r
207 Double_t GetPositiveTrackPhi() const;
\r
208 Double_t GetMotherCandidatePhi() const;
\r
210 void UpdateEventByEventData();
\r
212 Double_t GetMaxRCut() const{return fMaxR;}
\r
213 Double_t GetEtaCut() const{return fEtaCut;}
\r
214 Double_t GetPtCut() const{return fPtCut;}
\r
215 Double_t GetChi2CutConversion() const{return fChi2CutConversion;}
\r
216 Double_t GetChi2CutMeson() const{return fChi2CutMeson;}
\r
218 void SetMaxRCut(Double_t maxR){fMaxR=maxR;}
\r
219 void SetEtaCut(Double_t etaCut){fEtaCut=etaCut;}
\r
220 void SetPtCut(Double_t ptCut){fPtCut=ptCut;}
\r
221 void SetChi2CutConversion(Double_t chi2){fChi2CutConversion=chi2;}
\r
222 void SetChi2CutMeson(Double_t chi2){fChi2CutMeson=chi2;}
\r
224 void SetXVertexCut(Double_t xVtx){fCurrentXValue=xVtx;}
\r
225 void SetYVertexCut(Double_t yVtx){fCurrentYValue=yVtx;}
\r
226 void SetZVertexCut(Double_t zVtx){fCurrentZValue=zVtx;}
\r
227 void SetPIDProbability(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb; fPIDProbabilityCutNegativeParticle=pidProb;}
\r
228 void SetPIDProbabilityNegativeParticle(Double_t pidProb){fPIDProbabilityCutNegativeParticle=pidProb;}
\r
229 void SetPIDProbabilityPositiveParticle(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb;}
\r
230 void SetSigmaMass(Double_t sigmaMass){fNSigmaMass=sigmaMass;}
\r
232 void SetDoMCTruth(Bool_t doMC){fDoMC = doMC;}
\r
234 void UpdateV0Information();
\r
236 void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;}
\r
238 vector<AliKFParticle> GetCurrentEventGoodV0s() const{return fCurrentEventGoodV0s;}
\r
239 vector<AliKFParticle> GetPreviousEventGoodV0s() const{return fPreviousEventGoodV0s;}
\r
242 AliStack * fMCStack; // pointer to MonteCarlo particle stack
\r
243 AliMCEventHandler* fMCTruth; // pointer to the MC event handler
\r
244 TChain * fChain; // pointer to the TChain
\r
246 AliESDInputHandler* fESDHandler; //! pointer to esd object
\r
247 AliESDEvent *fESDEvent; //! pointer to esd object
\r
249 AliGammaConversionHistograms *fHistograms;
\r
251 Int_t fCurrentV0IndexNumber;
\r
252 AliESDv0 * fCurrentV0; //! pointer to the current v0
\r
253 AliKFParticle * fCurrentNegativeKFParticle; //! pointer to the negative KF particle
\r
254 AliKFParticle * fCurrentPositiveKFParticle; //! pointer to the positive KF particle
\r
255 AliKFParticle * fCurrentMotherKFCandidate; //! pointer to the positive KF particle
\r
257 AliESDtrack * fCurrentNegativeESDTrack; //! pointer to the negative ESD track
\r
258 AliESDtrack * fCurrentPositiveESDTrack; //! pointer to the positive ESD track
\r
260 TLorentzVector * fNegativeTrackLorentzVector; //! pointer to the negative Track Lorentz Vector
\r
261 TLorentzVector * fPositiveTrackLorentzVector; //! pointer to the positive Track Lorentz Vector
\r
262 TLorentzVector * fMotherCandidateLorentzVector; //! pointer to the mother candidate Track Lorentz Vector
\r
264 Double_t fCurrentXValue;
\r
265 Double_t fCurrentYValue;
\r
266 Double_t fCurrentZValue;
\r
268 Int_t fPositiveTrackPID;
\r
269 Int_t fNegativeTrackPID;
\r
271 TParticle *fNegativeMCParticle; //!
\r
272 TParticle *fPositiveMCParticle; //!
\r
273 TParticle *fMotherMCParticle; //!
\r
275 Double_t fMotherCandidateKFMass;
\r
276 Double_t fMotherCandidateKFWidth;
\r
278 Bool_t fUseKFParticle;
\r
279 Bool_t fUseESDTrack;
\r
286 Double_t fChi2CutConversion;
\r
287 Double_t fChi2CutMeson;
\r
288 Double_t fPIDProbabilityCutNegativeParticle;
\r
289 Double_t fPIDProbabilityCutPositiveParticle;
\r
290 Double_t fXVertexCut;
\r
291 Double_t fYVertexCut;
\r
292 Double_t fZVertexCut;
\r
294 Double_t fNSigmaMass;
\r
296 Bool_t fUseImprovedVertex;
\r
298 vector<AliKFParticle> fCurrentEventGoodV0s;
\r
299 vector<AliKFParticle> fPreviousEventGoodV0s;
\r
301 ClassDef(AliV0Reader,0)
\r