]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/GammaConv/AliV0Reader.h
Changed to new naming scheme for histograms, added functionality to the analysis...
[u/mrichter/AliRoot.git] / PWG4 / GammaConv / AliV0Reader.h
CommitLineData
3c538586 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
5\r
6////////////////////////////////////////////////\r
7//--------------------------------------------- \r
8// Class used to do analysis on conversion pairs\r
9//---------------------------------------------\r
10////////////////////////////////////////////////\r
11\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
19#include <vector>\r
20\r
21class TClonesArray; \r
22class TFormula;\r
23class Riostream;\r
24class TChain;\r
25//--- AliRoot system ---\r
26\r
27class AliStack;\r
28class AliESDEvent; \r
29class AliMCEventHandler;\r
30class AliESDInputHandler;\r
31class AliESDVertex;\r
32class AliLog;\r
33class TChain;\r
34class TChain;\r
35\r
36\r
37\r
38class AliV0Reader : public TObject {\r
39\r
40 public: \r
41\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
46 /*\r
47 *Initialize the reader\r
48 */\r
49 void Initialize();\r
50\r
51 /*\r
52 *Returns the number of v0s in the event, no cuts applied.\r
53 */\r
54 Int_t GetNumberOfV0s() const{return fESDEvent->GetNumberOfV0s();}\r
55\r
56 /*\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
61 */\r
62 Bool_t NextV0();\r
63 \r
64 /*\r
65 * Returns the v0 at the given index, no checks are done on the v0. \r
66 */\r
67 AliESDv0* GetV0(Int_t index);\r
68\r
69 /*\r
70 * Returns the current v0\r
71 */\r
72 AliESDv0* GetCurrentV0() const{return fCurrentV0;}\r
73\r
74 /*\r
75 * Returns the negative ESD track which belongs to fCurrentV0\r
76 */\r
77 AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());}\r
78\r
79 /*\r
80 * Returns the positive ESD track which belongs to fCurrentV0\r
81 */\r
82 AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());}\r
83\r
84 /*\r
85 * Returns the negative KF particle which belongs to fCurrentV0\r
86 */\r
87 AliKFParticle* GetNegativeKFParticle() const{return fCurrentNegativeKFParticle;}\r
88\r
89 /*\r
90 * Returns the positive KF particle which belongs to fCurrentV0\r
91 */\r
92 AliKFParticle* GetPositiveKFParticle() const{return fCurrentPositiveKFParticle;}\r
a19c3402 93\r
3c538586 94 /*\r
95 * Returns the KFParticle object of the 2 tracks.\r
96 */\r
97 AliKFParticle* GetMotherCandidateKFCombination() const{return fCurrentMotherKFCandidate;}\r
a19c3402 98\r
3c538586 99 /*\r
100 * Checks the probablity that the PID of the particle is what we want it to be.\r
101 */\r
102 Bool_t CheckPIDProbability(Double_t negProbCut, Double_t posProbCut);\r
a19c3402 103 \r
104 /*\r
105 * Checks if the PID of the two particles are within our cuts.\r
106 */\r
107 void GetPIDProbability(Double_t &negPIDProb, Double_t &posPIDProb);\r
3c538586 108\r
109 /*\r
110 *Get the negative MC TParticle from the stack \r
111 */\r
112 TParticle * GetNegativeMCParticle() const{return fNegativeMCParticle;}\r
113\r
114 /*\r
115 *Get the positive MC TParticle from the stack \r
116 */\r
117 TParticle * GetPositiveMCParticle() const{return fPositiveMCParticle;}\r
118\r
119 /*\r
120 *Get the mother MC TParticle from the stack \r
121 */\r
122 TParticle * GetMotherMCParticle() const{return fMotherMCParticle;}\r
123\r
a19c3402 124 /*\r
125 * Flag to see if the v0 particles share the same mother\r
126 */\r
3c538586 127 Bool_t HasSameMCMother();\r
128\r
a19c3402 129\r
130 /*\r
131 *Get the PID of the MC mother particle\r
132 */\r
133 Int_t GetMotherMCParticlePDGCode() const{if(fMotherMCParticle != NULL){ cout<<"MCParticle exists"<<endl;} return fMotherMCParticle->GetPdgCode();}\r
134\r
3c538586 135 /*\r
136 *Get the MC stack \r
137 */\r
138 AliStack* GetMCStack() const{return fMCStack;}\r
139\r
140 /*\r
141 *Get the magnetic field from the ESD event \r
142 */\r
143 Double_t GetMagneticField() const{return fESDEvent->GetMagneticField();}\r
144\r
145 /*\r
146 *Get the primary vertex from the esd event\r
147 */\r
148 const AliESDVertex *GetPrimaryVertex() const {return fESDEvent->GetPrimaryVertex();}\r
149\r
150 /*\r
151 * Set the PID of the negative track\r
152 */\r
153 void SetNegativeTrackPID(Int_t negTrackPID){fNegativeTrackPID=negTrackPID;}\r
154\r
155 /*\r
156 * Set the PID of the positive track\r
157 */\r
158 void SetPositiveTrackPID(Int_t posTrackPID){fPositiveTrackPID=posTrackPID;}\r
159\r
160 /*\r
161 * Set the flag to use the kfparticle class. Will also disable the use of esd tracks\r
162 */\r
163 void UseKFParticle(){fUseKFParticle = kTRUE; fUseESDTrack = kFALSE;}\r
164\r
165 /*\r
166 * Set the flag to use the esd track class. Will also disable the use of kf particles\r
167 */\r
168 void UseESDTrack(){fUseESDTrack = kTRUE; fUseKFParticle = kFALSE;}\r
169\r
170 /*\r
171 * Set the flag to use improved vertex or not\r
172 */\r
173 void SetUseImprovedVertex(Bool_t useImprovedVertex){fUseImprovedVertex=useImprovedVertex;}\r
174\r
175 /*\r
176 * Return the number in the species array belonging to the negative or positive track pid.\r
177 */\r
178 Int_t GetSpeciesIndex(Int_t chargeOfTrack);\r
179\r
180 /*\r
181 * Return the x coordinate of the v0\r
182 */\r
183 Double_t GetX() const{return fCurrentXValue;}\r
184\r
185 /*\r
186 * Return the y coordinate of the v0\r
187 */\r
188 Double_t GetY() const{return fCurrentYValue;}\r
189\r
190 /*\r
191 * Return the Z coordinate of the v0\r
192 */\r
193 Double_t GetZ() const{return fCurrentZValue;}\r
194\r
195 /*\r
196 * Return the radius of the v0\r
197 */\r
198 Double_t GetXYRadius() const{return sqrt((Double_t)(fCurrentXValue*fCurrentXValue + fCurrentYValue*fCurrentYValue));}\r
199\r
200 /*\r
201 * Get the opening angle between the two tracks\r
202 */\r
203 Double_t GetOpeningAngle(){return fNegativeTrackLorentzVector->Angle(fPositiveTrackLorentzVector->Vect());}\r
204\r
a19c3402 205 /*\r
206 * Gets the Energy of the negative track.\r
207 */\r
3c538586 208 Double_t GetNegativeTrackEnergy() const{return fCurrentNegativeKFParticle->E();}\r
a19c3402 209\r
210 /*\r
211 * Gets the Energy of the positive track.\r
212 */\r
3c538586 213 Double_t GetPositiveTrackEnergy() const{return fCurrentPositiveKFParticle->E();}\r
a19c3402 214\r
215 /*\r
216 * Gets the Energy of the mother candidate.\r
217 */\r
3c538586 218 Double_t GetMotherCandidateEnergy() const{return fCurrentMotherKFCandidate->E();}\r
219\r
a19c3402 220 /*\r
221 * Gets the Pt of the negative track.\r
222 */\r
3c538586 223 Double_t GetNegativeTrackPt() const{return fNegativeTrackLorentzVector->Pt();}\r
a19c3402 224\r
225 /*\r
226 * Gets the Pt of the positive track.\r
227 */\r
3c538586 228 Double_t GetPositiveTrackPt() const{return fPositiveTrackLorentzVector->Pt();}\r
a19c3402 229\r
230 /*\r
231 * Gets the Pt of the mother candidate.\r
232 */\r
3c538586 233 Double_t GetMotherCandidatePt() const{return fMotherCandidateLorentzVector->Pt();}\r
234\r
a19c3402 235 /*\r
236 * Gets the Eta of the negative track.\r
237 */\r
3c538586 238 Double_t GetNegativeTrackEta() const{return fNegativeTrackLorentzVector->Eta();}\r
a19c3402 239 /*\r
240 * Gets the Eta of the positive track.\r
241 */\r
3c538586 242 Double_t GetPositiveTrackEta() const{return fPositiveTrackLorentzVector->Eta();}\r
a19c3402 243 /*\r
244 * Gets the Eta of the mother candidate.\r
245 */\r
3c538586 246 Double_t GetMotherCandidateEta() const{return fMotherCandidateLorentzVector->Eta();}\r
247\r
a19c3402 248 /*\r
249 * Gets the NDF of the mother candidate.\r
250 */\r
3c538586 251 Double_t GetMotherCandidateNDF() const{return fCurrentMotherKFCandidate->GetNDF();}\r
a19c3402 252\r
253 /*\r
254 * Gets the Chi2 of the mother candidate.\r
255 */\r
3c538586 256 Double_t GetMotherCandidateChi2() const{return fCurrentMotherKFCandidate->GetChi2();}\r
a19c3402 257\r
258 /*\r
259 * Gets the Mass of the mother candidate.\r
260 */\r
3c538586 261 Double_t GetMotherCandidateMass() const{return fMotherCandidateKFMass;}\r
a19c3402 262\r
263 /*\r
264 * Gets the Width of the mother candidate.\r
265 */\r
3c538586 266 Double_t GetMotherCandidateWidth() const{return fMotherCandidateKFWidth;}\r
267\r
a19c3402 268 /*\r
269 * Gets the Phi of the negative track.\r
270 */\r
3c538586 271 Double_t GetNegativeTrackPhi() const;\r
a19c3402 272\r
273 /*\r
274 * Gets the Phi of the positive track.\r
275 */\r
3c538586 276 Double_t GetPositiveTrackPhi() const;\r
a19c3402 277\r
278 /*\r
279 * Gets the Phi of the mother candidate.\r
280 */\r
3c538586 281 Double_t GetMotherCandidatePhi() const;\r
282\r
32a6d407 283 /*\r
284 * Gets the Rapidity of the mother candidate.\r
285 */\r
286 Double_t GetMotherCandidateRapidity() const;\r
287\r
288\r
a19c3402 289 /*\r
290 * Update data which need to be updated every event.\r
291 */\r
3c538586 292 void UpdateEventByEventData();\r
293 \r
a19c3402 294 /*\r
295 * Gets the MaxRCut value.\r
296 */\r
3c538586 297 Double_t GetMaxRCut() const{return fMaxR;}\r
a19c3402 298\r
299 /*\r
300 * Gets the Eta cut value.\r
301 */\r
3c538586 302 Double_t GetEtaCut() const{return fEtaCut;}\r
a19c3402 303\r
304 /*\r
305 * Gets the Pt cut value.\r
306 */\r
3c538586 307 Double_t GetPtCut() const{return fPtCut;}\r
a19c3402 308\r
32a6d407 309 /*\r
310 * Gets the line cut values.\r
311 */\r
312 Double_t GetLineCutZRSlope() const{return fLineCutZRSlope;}\r
313 Double_t GetLineCutZValue() const{return fLineCutZValue;}\r
314 \r
a19c3402 315 /*\r
316 * Gets the Chi2 cut value for the conversions.\r
317 */\r
3c538586 318 Double_t GetChi2CutConversion() const{return fChi2CutConversion;}\r
a19c3402 319\r
320 /*\r
321 * Gets the Chi2 cut value for the mesons.\r
322 */\r
3c538586 323 Double_t GetChi2CutMeson() const{return fChi2CutMeson;}\r
324\r
32a6d407 325 Double_t GetPositiveTrackLength() const{return fCurrentPositiveESDTrack->GetIntegratedLength();}\r
326 Double_t GetNegativeTrackLength() const{return fCurrentNegativeESDTrack->GetIntegratedLength();}\r
327\r
328 Double_t GetPositiveNTPCClusters() const{return fCurrentPositiveESDTrack->GetTPCNcls();}\r
329 Double_t GetNegativeNTPCClusters() const{return fCurrentNegativeESDTrack->GetTPCNcls();}\r
330\r
a19c3402 331 /*\r
332 * Sets the MaxRCut value.\r
333 */\r
3c538586 334 void SetMaxRCut(Double_t maxR){fMaxR=maxR;}\r
a19c3402 335\r
336 /*\r
337 * Sets the EtaCut value.\r
338 */\r
3c538586 339 void SetEtaCut(Double_t etaCut){fEtaCut=etaCut;}\r
a19c3402 340\r
341 /*\r
342 * Sets the PtCut value.\r
343 */\r
3c538586 344 void SetPtCut(Double_t ptCut){fPtCut=ptCut;}\r
a19c3402 345\r
32a6d407 346 /*\r
347 * Sets the LineCut values.\r
348 */\r
349 void SetLineCutZRSlope(Double_t LineCutZRSlope){fLineCutZRSlope=LineCutZRSlope;}\r
350 void SetLineCutZValue(Double_t LineCutZValue){fLineCutZValue=LineCutZValue;}\r
351\r
a19c3402 352 /*\r
353 * Sets the Chi2Cut value for conversions.\r
354 */\r
3c538586 355 void SetChi2CutConversion(Double_t chi2){fChi2CutConversion=chi2;}\r
a19c3402 356\r
357 /*\r
358 * Sets the Chi2Cut for the mesons.\r
359 */\r
3c538586 360 void SetChi2CutMeson(Double_t chi2){fChi2CutMeson=chi2;}\r
361 \r
a19c3402 362 /*\r
363 * Sets the XVertexCut value.\r
364 */\r
3c538586 365 void SetXVertexCut(Double_t xVtx){fCurrentXValue=xVtx;}\r
a19c3402 366\r
367 /*\r
368 * Sets the YVertexCut value.\r
369 */\r
3c538586 370 void SetYVertexCut(Double_t yVtx){fCurrentYValue=yVtx;}\r
a19c3402 371\r
372 /*\r
373 * Sets the ZVertexCut value.\r
374 */\r
3c538586 375 void SetZVertexCut(Double_t zVtx){fCurrentZValue=zVtx;}\r
a19c3402 376\r
377 /*\r
378 * Sets the PIDProbabilityCut value for track particles.\r
379 */\r
3c538586 380 void SetPIDProbability(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb; fPIDProbabilityCutNegativeParticle=pidProb;}\r
a19c3402 381\r
382 /*\r
383 * Sets the PIDProbability cut value for the negative track.\r
384 */\r
3c538586 385 void SetPIDProbabilityNegativeParticle(Double_t pidProb){fPIDProbabilityCutNegativeParticle=pidProb;}\r
a19c3402 386\r
387 /*\r
388 * Sets the PIDProbability cut value for the positive track.\r
389 */\r
3c538586 390 void SetPIDProbabilityPositiveParticle(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb;}\r
a19c3402 391\r
392 /*\r
393 * Sets the SigmaMassCut value.\r
394 */\r
3c538586 395 void SetSigmaMass(Double_t sigmaMass){fNSigmaMass=sigmaMass;}\r
396\r
a19c3402 397 /*\r
398 * Sets the flag to enable/disable the usage of MC information. \r
399 */\r
3c538586 400 void SetDoMCTruth(Bool_t doMC){fDoMC = doMC;}\r
401\r
a19c3402 402 /*\r
403 * Updates the V0 information of the current V0.\r
404 */\r
32a6d407 405 Bool_t UpdateV0Information();\r
3c538586 406\r
a19c3402 407 /*\r
408 * Resets the V0 index.\r
409 */\r
410 void ResetV0IndexNumber(){fCurrentV0IndexNumber=0;}\r
411\r
412 /*\r
413 * Sets the histograms.\r
414 */\r
3c538586 415 void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;}\r
416\r
a19c3402 417 /*\r
418 * Check for primary vertex.\r
419 */\r
420 Bool_t CheckForPrimaryVertex();\r
421\r
422 /*\r
423 * Gets a vector of good v0s.\r
424 */\r
3c538586 425 vector<AliKFParticle> GetCurrentEventGoodV0s() const{return fCurrentEventGoodV0s;}\r
a19c3402 426\r
427 /*\r
428 * Gets the vector of previous events v0s (for bacground analysis)\r
429 */\r
3c538586 430 vector<AliKFParticle> GetPreviousEventGoodV0s() const{return fPreviousEventGoodV0s;}\r
431\r
432 private:\r
433 AliStack * fMCStack; // pointer to MonteCarlo particle stack \r
434 AliMCEventHandler* fMCTruth; // pointer to the MC event handler\r
435 TChain * fChain; // pointer to the TChain\r
436 \r
437 AliESDInputHandler* fESDHandler; //! pointer to esd object\r
438 AliESDEvent *fESDEvent; //! pointer to esd object\r
439\r
440 AliGammaConversionHistograms *fHistograms;\r
441 \r
442 Int_t fCurrentV0IndexNumber;\r
443 AliESDv0 * fCurrentV0; //! pointer to the current v0\r
444 AliKFParticle * fCurrentNegativeKFParticle; //! pointer to the negative KF particle\r
445 AliKFParticle * fCurrentPositiveKFParticle; //! pointer to the positive KF particle\r
446 AliKFParticle * fCurrentMotherKFCandidate; //! pointer to the positive KF particle\r
447\r
448 AliESDtrack * fCurrentNegativeESDTrack; //! pointer to the negative ESD track\r
449 AliESDtrack * fCurrentPositiveESDTrack; //! pointer to the positive ESD track\r
450 \r
451 TLorentzVector * fNegativeTrackLorentzVector; //! pointer to the negative Track Lorentz Vector\r
452 TLorentzVector * fPositiveTrackLorentzVector; //! pointer to the positive Track Lorentz Vector\r
453 TLorentzVector * fMotherCandidateLorentzVector; //! pointer to the mother candidate Track Lorentz Vector\r
454\r
455 Double_t fCurrentXValue;\r
456 Double_t fCurrentYValue;\r
457 Double_t fCurrentZValue;\r
458\r
459 Int_t fPositiveTrackPID;\r
460 Int_t fNegativeTrackPID;\r
461\r
462 TParticle *fNegativeMCParticle; //!\r
463 TParticle *fPositiveMCParticle; //!\r
464 TParticle *fMotherMCParticle; //!\r
465\r
466 Double_t fMotherCandidateKFMass;\r
467 Double_t fMotherCandidateKFWidth;\r
468\r
469 Bool_t fUseKFParticle;\r
470 Bool_t fUseESDTrack;\r
471 Bool_t fDoMC;\r
472\r
473 //cuts\r
474 Double_t fMaxR;\r
475 Double_t fEtaCut;\r
476 Double_t fPtCut;\r
32a6d407 477 Double_t fLineCutZRSlope;\r
478 Double_t fLineCutZValue;\r
3c538586 479 Double_t fChi2CutConversion;\r
480 Double_t fChi2CutMeson;\r
481 Double_t fPIDProbabilityCutNegativeParticle;\r
482 Double_t fPIDProbabilityCutPositiveParticle;\r
483 Double_t fXVertexCut;\r
484 Double_t fYVertexCut;\r
485 Double_t fZVertexCut;\r
486 \r
487 Double_t fNSigmaMass;\r
488 \r
489 Bool_t fUseImprovedVertex;\r
490 \r
491 vector<AliKFParticle> fCurrentEventGoodV0s;\r
492 vector<AliKFParticle> fPreviousEventGoodV0s;\r
493\r
32a6d407 494 ClassDef(AliV0Reader,1)\r
3c538586 495};\r
496\r
497\r
498#endif\r
499\r
500\r
501\r