AliPhysics  9fe175b (9fe175b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskMultiparticleFemtoscopy.h
Go to the documentation of this file.
1 /*
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved.
3  * See cxx source for full Copyright notice
4  * $Id$
5  */
6 
7  /********************************
8  * femtoscopy with multiparticle *
9  * technology *
10  * *
11  * author: Ante Bilandzic *
12  * (abilandzic@gmail.com) *
13  ********************************/
14 
15 #ifndef ALIANALYSISTASKMULTIPARTICLEFEMTOSCOPY_H
16 #define ALIANALYSISTASKMULTIPARTICLEFEMTOSCOPY_H
17 
18 #include "AliAnalysisTaskSE.h"
19 #include "AliPIDResponse.h"
20 #include "AliAODTrack.h"
21 #include "AliAODEvent.h"
22 #include "AliVEvent.h"
23 #include "AliESDEvent.h"
24 #include "AliMCEvent.h"
25 #include "AliAODMCParticle.h"
26 #include "TExMap.h"
27 #include "TProfile.h"
28 #include "TH1F.h"
29 #include "TH1I.h"
30 
31 
32 //================================================================================================================
33 
34 class AliAnalysisTaskMultiparticleFemtoscopy : public AliAnalysisTaskSE{
35  public:
37  AliAnalysisTaskMultiparticleFemtoscopy(const char *name, Bool_t useParticleWeights=kFALSE);
39  virtual void UserCreateOutputObjects();
40  virtual void UserExec(Option_t *);
41  virtual void Terminate(Option_t *);
42 
43  // 0.) Methods called in the constructor:
44  virtual void InitializeArrays(); // use this method temporarily for all objects not classified yet
46  virtual void InitializeArraysForEBEObjects();
48  virtual void InitializeArraysForBackground();
49 
50  // 1.) Methods called in UserCreateOutputObjects():
52  virtual void BookAndNestAllLists();
53  virtual void BookEverything(); // use this to book all un-classified objects
55  virtual void BookEverythingForEBEObjects();
57  virtual void BookEverythingForBackground();
58 
59  // 2.) Methods called in UserExec(Option_t *):
60  // 2a) Directly:
61  virtual void InsanityChecksUserExec();
62  virtual void MC(AliMCEvent *aMC);
63  virtual void ESD(AliESDEvent *aESD);
64  virtual void AOD(AliAODEvent *aAOD);
65  virtual void OnlineMonitoring();
66  // 2b) Indirectly:
67  virtual void EstimateBackground(AliVEvent *ave);
68  virtual void FillControlHistogramsEvent(AliVEvent *ave);
69  virtual void FillControlHistogramsParticle(AliVEvent *ave);
70  virtual void FillControlHistogramsNonIdentifiedParticles(AliAODTrack *atrack);
71  virtual void FillControlHistogramsNonIdentifiedParticles(AliAODMCParticle *amcparticle);
72  virtual void FillControlHistogramsIdentifiedParticles(AliAODTrack *atrack, AliAODTrack *gtrack);
73  virtual void FillControlHistogramsIdentifiedParticles(AliAODMCParticle *amcparticle);
74  virtual void V0s(AliVEvent *ave);
75  Bool_t Pion(AliAODTrack *atrack, Int_t charge = 1, Bool_t bPrimary = kTRUE);
76  Bool_t Kaon(AliAODTrack *atrack, Int_t charge = 1, Bool_t bPrimary = kTRUE);
77  Bool_t Proton(AliAODTrack *atrack, Int_t charge = 1, Bool_t bPrimary = kTRUE);
78  Bool_t PassesCommonEventCuts(AliVEvent *ave);
79  Bool_t PassesMixedEventCuts(AliVEvent *ave);
80  Bool_t PassesCommonGlobalTrackCuts(AliAODTrack *gtrack); // common cuts for global tracks TBI make it uniform with MC
81  Bool_t PassesCommonTrackCuts(AliAODTrack *atrack); // common cuts for analysis specific tracks (e.g. TPC-only) TBI make it uniform with MC
82  Bool_t PassesCommonTrackCuts(AliAODMCParticle *amcparticle); // common cuts for analysis specific tracks TBI see above two lines
83  virtual void GlobalTracksAOD(AliAODEvent *aAOD, Int_t index); // fill fGlobalTracksAOD in e-b-e . For the meaning of 'index', see declaration of fGlobalTracksAOD
84  Double_t RelativeMomenta(AliAODTrack *agtrack1, AliAODTrack *agtrack2);
85  Double_t RelativeMomenta(AliAODMCParticle *amcparticle1, AliAODMCParticle *amcparticle2);
86 
87  virtual void ResetEBEObjects();
88  Bool_t SpecifiedEvent(UInt_t run, UShort_t bunchCross, UInt_t orbit, UInt_t period);
89  Int_t CurrentEventNumber();
90  virtual void DoSomeDebugging(AliVEvent *ave);
91  virtual void CalculateCorrelationFunctions(AliAODEvent *aAOD);
92  virtual void CalculateCorrelationFunctions(AliMCEvent *aMC);
93  virtual void CalculateBackground(TClonesArray *ca1, TClonesArray *ca2);
94  virtual void CalculateBackground(TClonesArray *ca1, TClonesArray *ca2, Bool_t bMC); // TBI unify with the previous function
95  // 3.) Methods called in Terminate(Option_t *):
96  virtual void GetOutputHistograms(TList *histList);
97  // TBI implement the rest as well
99  virtual void GetPointersForBackground();
100  virtual void NormalizeCorrelationFunctions();
101 
102  // Setters and getters:
103  // 0.) Not classified yet;
104  // 1.) Control histograms;
105  // 2.) Event-by-event histograms;
106  // 3.) ...
107  // *.) Debugging
108 
109  // 0.) Not classified yet:
110  void SetMaxNoGlobalTracksAOD(Int_t mngta) {this->fMaxNoGlobalTracksAOD = mngta;};
111  Int_t GetMaxNoGlobalTracksAOD() const {return this->fMaxNoGlobalTracksAOD;};
112  void SetProcessBothKineAndReco(Bool_t pbkar) {this->fProcessBothKineAndReco = pbkar;};
113  Bool_t GetProcessBothKineAndReco() const {return this->fProcessBothKineAndReco;};
114  void SetProcessOnlyKine(Bool_t pok) {this->fProcessOnlyKine = pok;};
115  Bool_t GetProcessOnlyKine() const {return this->fProcessOnlyKine;};
116  void SetRejectFakeTracks(Bool_t rft) {this->fRejectFakeTracks = rft;};
117  Bool_t GetRejectFakeTracks() const {return this->fRejectFakeTracks;};
118 
119  // 1.) Control histograms:
120  void SetControlHistogramsList(TList* const chl) {this->fControlHistogramsList = chl;};
121  TList* GetControlHistogramsList() const {return this->fControlHistogramsList;}
122  void SetControlHistogramsFlagsPro(TProfile* const chfp) {this->fControlHistogramsFlagsPro = chfp;};
123  TProfile* GetControlHistogramsFlagsPro() const {return this->fControlHistogramsFlagsPro;};
124  void SetFillControlHistograms(Bool_t fch) {this->fFillControlHistograms = fch;};
125  Bool_t GetFillControlHistograms() const {return this->fFillControlHistograms;};
132  void SetFillControlHistogramsV0s(Bool_t fchv) {this->fFillControlHistogramsV0s = fchv;};
134  // 2.) Event-by-event histograms:
135  void SetEBEHistogramsList(TList* const ehl) {this->fEBEHistogramsList = ehl;};
136  TList* GetEBEHistogramsList() const {return this->fEBEHistogramsList;}
137  void SetEBEObjectsFlagsPro(TProfile* const ehfp) {this->fEBEObjectsFlagsPro = ehfp;};
138  TProfile* GetEBEObjectsFlagsPro() const {return this->fEBEObjectsFlagsPro;};
139  //void SetFillEBEHistograms(Bool_t feh) {this->fFillEBEHistograms = feh;}; // TBI rethink
140  //Bool_t GetFillEBEHistograms() const {return this->fFillEBEHistograms;};
141  // 3.) Correlation functions:
142  void SetCorrelationFunctionsList(TList* const cfl) {this->fCorrelationFunctionsList = cfl;};
144  void SetCorrelationFunctionsFlagsPro(TProfile* const cffp) {this->fCorrelationFunctionsFlagsPro = cffp;};
150 
151  // 4.) Background:
152  void SetBackgroundList(TList* const bl) {this->fBackgroundList = bl;};
153  TList* GetBackgroundList() const {return this->fBackgroundList;}
154  void SetBackgroundFlagsPro(TProfile* const bfp) {this->fBackgroundFlagsPro = bfp;};
155  TProfile* GetBackgroundFlagsPro() const {return this->fBackgroundFlagsPro;};
156  void SetEstimateBackground(Bool_t feb) {this->fEstimateBackground = feb;};
157  Bool_t GetEstimateBackground() const {return this->fEstimateBackground;};
158 
159  // *.) Online monitoring:
160  void SetUpdateOutputFile(const Int_t uf, const char *uqof)
161  {
162  // Example usage: taskMPF->SetUpdateOutputFile(44,"AnalysisResults.root");
163  this->fOnlineMonitoring = kTRUE;
164  this->fUpdateOutputFile = kTRUE;
165  this->fUpdateFrequency = uf;
166  this->fUpdateWhichOutputFile = new TString(uqof);
167  };
168  void SetMaxNumberOfEvents(const Int_t mnof, const char *uqof)
169  {
170  // Example usage: taskMPF->SetMaxNumberOfEvents(44,"AnalysisResults.root");
171  this->fOnlineMonitoring = kTRUE;
172  this->fMaxNumberOfEvents = mnof;
173  this->fUpdateWhichOutputFile = new TString(uqof);
174  };
175 
176  // *.) Debugging:
177  void SetWaitForSpecifiedEvent(UInt_t run, UShort_t bunchCross, UInt_t orbit, UInt_t period)
178  {
179  this->fDoSomeDebugging = kTRUE;
180  this->fWaitForSpecifiedEvent = kTRUE;
181  this->fRun = run;
182  this->fBunchCross = bunchCross;
183  this->fOrbit = orbit;
184  this->fPeriod = period;
185  }; // void SetWaitForSpecifiedEvent(UInt_t run, UShort_t bunchCross, UInt_t orbit, UInt_t period)
186 
187  private:
190 
191  TList *fHistList; // base list to hold all output object (a.k.a. grandmother of all lists)
192  TString *fAnalysisType;
193 
194  AliPIDResponse *fPIDResponse;
195 
196  Int_t fMaxNoGlobalTracksAOD; // maximum # of TExMap *fGlobalTracksAOD objects to be booked. Default is 3, one for default analysis, and two for event mixing
197  TExMap *fGlobalTracksAOD[10];
198  Bool_t fProcessBothKineAndReco; // process both aMC and aAOD, typically to get purities (TBI: add support for ESD)
199  Bool_t fProcessOnlyKine; // process only aMC
200  Bool_t fRejectFakeTracks; // if set to kFALSE, and if fMC is available, get the corresponding MC particle by taking absolute value of label
201  AliMCEvent *fMC; // placeholder for MC info
202 
203  // 1.) Control histograms:
204  TList *fControlHistogramsList; // list to hold all 'control histograms' objects
205  TProfile *fControlHistogramsFlagsPro; // profile to hold all flags for control histograms
206  Bool_t fFillControlHistograms; // fill or not control histograms (by default they are all filled). Use this flag only to disable. TBI I am not really consistent...
207  // 1a) Event (a.k.a. global event observables):
208  TList *fControlHistogramsEventList; // list to hold all 'control histograms' for events TBI
209  TProfile *fControlHistogramsEventFlagsPro; // profile to hold all flags for control histograms for events TBI
210  Bool_t fFillControlHistogramsEvent; // fill or not control histograms for global event observables
211  TH1I *fGetNumberOfTracksHist; // a{AOD,MC}->GetNumberOfTracks()
212  TH1I *fGetNumberOfGlobalTracksHist; // fGlobalTracksAOD[0]->GetSize() this is then my multiplicity...
213  TH1I *fGetNumberOfV0sHist; // aAOD->GetNumberOfV0s()
214  TH1I *fGetNumberOfCascadesHist; // aAOD->GetNumberOfCascades()
215  TH1D *fGetMagneticFieldHist; // aAOD->GetMagneticField()
216  TH1I *fGetEventTypeHist; // aAOD->GetEventType()
217  TH1D *fGetCentralityHist; // aAOD->GetCentrality()
218 
219  TH1F *fVertexXYZ[3];
220  TH1I *fGetNContributorsHist; // avtx->GetNContributors()
221  TH1F *fGetChi2perNDFHist; // avtx->GetChi2perNDF();
222  TH1I *fGetNDaughtersHist; // avtx->GetNDaughters();
223 
224  // ...
225  // 1b) Non-identified particles (for AOD these are "normal global" tracks):
226  TList *fControlHistogramsNonIdentifiedParticlesList; // list to hold all 'control histograms' for non-identified particles
227  TProfile *fControlHistogramsNonIdentifiedParticlesFlagsPro; // profile to hold all flags for control histograms for non-identified particles
228  Bool_t fFillControlHistogramsNonIdentifiedParticles; // fill or not control histograms for non-identified particles
229  TH1I *fChargeHist; // atrack->Charge()
230  TH1I *fGetTPCNclsHist; // atrack->GetTPCNcls()
231  TH1I *fGetTPCsignalNHist; // atrack->GetTPCsignalN()
232  TH1I *fGetITSNclsHist; // atrack->GetITSNcls()
233  TH2F *fdEdxVsPtHist; // atrack->GetTPCmomentum(),atrack->GetTPCsignal()
234  TH1F *fPtHist; // atrack->Pt()
235  TH1F *fEtaHist; // atrack->Eta()
236  TH1F *fPhiHist; // atrack->Phi()
237  TH1F *fMassHist; // atrack->M()
238  TH1I *fGetFilterMap; // atrack->GetFilterMap()
239  TH1I *fGetPdgCode; // atrack->GetPdgCode()
240 
241  // 1c) Identified particles:
242  TList *fControlHistogramsIdentifiedParticlesList; // list to hold all 'control histograms' for identified particles
243  TProfile *fControlHistogramsIdentifiedParticlesFlagsPro; // profile to hold all flags for control histograms for identified particles
244  Bool_t fFillControlHistogramsIdentifiedParticles; // fill or not control histograms for identified particles (by default they are not filled)
245  TH1F *fMassPIDHist[5][2][2];
246  TH1F *fPtPIDHist[5][2][2];
247  TH1F *fEtaPIDHist[5][2][2];
248  TH1F *fPhiPIDHist[5][2][2];
249  Double_t fInclusiveSigmaCuts[5];
250  Double_t fExclusiveSigmaCuts[5][5];
251 
252  // ...
253  // 1c) V0s:
254  TList *fControlHistogramsV0sList; // list to hold all 'control histograms' for V0s
255  TProfile *fControlHistogramsV0sFlagsPro; // profile to hold all flags for control histograms for V0s
256  Bool_t fFillControlHistogramsV0s; // fill or not control histograms for V0s (by default they are not filled)
257  TH1I *fGetNProngsHist; // aAODv0->GetNProngs()
258  TH1F *fMassK0ShortHist; // aAODv0->MassK0Short()
259  TH1F *fMassLambdaHist; // aAODv0->MassLambda()
260  TH1F *fMassAntiLambdaHist; // aAODv0->MassAntiLambda()
261  TH1F *fOpenAngleV0Hist; // aAODv0->OpenAngleV0() // same as aAODv0->ProngsRelAngle()
262  TH1F *fRadiusV0Hist; // aAODv0->RadiusV0()
263  TH1F *fDcaV0ToPrimVertexHist; // aAODv0->DcaV0ToPrimVertex()
264  TH1F *fMomV0XHist; // aAODv0->MomV0X()
265  TH1F *fMomV0YHist; // aAODv0->MomV0Y()
266  TH1F *fMomV0ZHist; // aAODv0->MomV0Z()
267  TH1F *fPtV0Hist; // pow(aAODv0->Pt2V0(),0.5)
268  TH1F *fPseudoRapV0Hist; // aAODv0->PseudoRapV0()
269  TH2F *fPAHist; // Pod.-Arm.
270 
271  // ...
272  // 1d) Cascades:
273  // ...
274 
275 
276  // 2.) Event-by-event objects:
277  TList *fEBEHistogramsList; // list to hold all stuff from e-b-e histograms
278  TProfile *fEBEObjectsFlagsPro; // profile to hold all flags for e-b-e histograms for V0s
279  //Bool_t fFillEBEHistograms; // fill or not e-b-e histograms TBI do I really need this?
280  TH1I *fUniqueIDHistEBE; // filled with aAODv0->GetPosID() and aAODv0->GetNegID(). If the bin corresponding to that ID is already filled, two V0s share the same daughter
281  TClonesArray *fPIDCA[5][2][2];
282  TClonesArray *fPIDV0sCA[1];
283 
284  // 3.) Correlation functions:
285  TList *fCorrelationFunctionsList; // list to hold all correlation functions for primary particle
286  TProfile *fCorrelationFunctionsFlagsPro; // profile to hold all flags for correlation functions
287  Bool_t fFillCorrelationFunctions; // fill or not correlation functions (by default they are not filled)
288  Bool_t fNormalizeCorrelationFunctions; // normalize correlation functions woth the background
289  TExMap *fCorrelationFunctionsIndices; // associates pdg code to index of correlation function
290  TH1F *fCorrelationFunctions[10][10];
291 
292  // 4.) Background:
293  TList *fBackgroundList; // list to hold all correlation functions for primary particle
294  TProfile *fBackgroundFlagsPro; // profile to hold all flags for correlation functions
295  Bool_t fEstimateBackground; // enable or not background estimation. Can be set independenly to the status of fFillCorrelationFunctions flag
296  TH1F *fBackground[10][10];
297  TClonesArray *fMixedEvents[2];
298 
299  // *.) Online monitoring:
300  Bool_t fOnlineMonitoring; // enable online monitoring (not set excplicitly!), the flags below just refine it
301  Bool_t fUpdateOutputFile; // update the output file after certain number of analysed events
302  Int_t fUpdateFrequency; // after how many events the output file will be updated
303  TString *fUpdateWhichOutputFile; // which file will be regularly updated
304  Int_t fMaxNumberOfEvents; // if this number of events is reached, write to external file and bail out
305 
306  // *.) Debugging:
309  UInt_t fRun;
310  UShort_t fBunchCross;
311  UInt_t fOrbit;
312  UInt_t fPeriod;
313 
315 
316 };
317 
318 //================================================================================================================
319 
320 #endif
321 
322 
323 
324 
325 
326 
327 
328 
329 
330 
331 
Int_t charge
TList * fCorrelationFunctionsList
holds AliAODv0 candidates for each event [0=Lambda,1=...]
UInt_t fOrbit
do something only for the specified event
TH1F * fPtPIDHist[5][2][2]
[0=e,1=mu,2=pi,3=K,4=p][particle(+q)/antiparticle(-q)][kPrimary/kFromDecayVtx]
TH1F * fPhiPIDHist[5][2][2]
[0=e,1=mu,2=pi,3=K,4=p][particle(+q)/antiparticle(-q)][kPrimary/kFromDecayVtx]
AliAnalysisTaskMultiparticleFemtoscopy & operator=(const AliAnalysisTaskMultiparticleFemtoscopy &aatmpf)
TH1F * fEtaPIDHist[5][2][2]
[0=e,1=mu,2=pi,3=K,4=p][particle(+q)/antiparticle(-q)][kPrimary/kFromDecayVtx]
Bool_t SpecifiedEvent(UInt_t run, UShort_t bunchCross, UInt_t orbit, UInt_t period)
void SetWaitForSpecifiedEvent(UInt_t run, UShort_t bunchCross, UInt_t orbit, UInt_t period)
Bool_t Proton(AliAODTrack *atrack, Int_t charge=1, Bool_t bPrimary=kTRUE)
virtual void CalculateBackground(TClonesArray *ca1, TClonesArray *ca2)
UInt_t fRun
do something only for the specified event
void SetMaxNumberOfEvents(const Int_t mnof, const char *uqof)
void SetUpdateOutputFile(const Int_t uf, const char *uqof)
TClonesArray * fPIDV0sCA[1]
holds AliAODTrack candidates for each event [0=e,1=mu,2=pi,3=K,4=p][particle(+q)/antiparticle(-q)][kP...
Double_t RelativeMomenta(AliAODTrack *agtrack1, AliAODTrack *agtrack2)
TList * fBackgroundList
[particle(+q): 0=e,1=mu,2=pi,3=K,4=p, anti-particle(-q): 5=e,6=mu,7=pi,8=K,9=p] x [same]...
Bool_t Pion(AliAODTrack *atrack, Int_t charge=1, Bool_t bPrimary=kTRUE)
UShort_t fBunchCross
do something only for the specified event
Bool_t Kaon(AliAODTrack *atrack, Int_t charge=1, Bool_t bPrimary=kTRUE)
virtual void GlobalTracksAOD(AliAODEvent *aAOD, Int_t index)
virtual void FillControlHistogramsNonIdentifiedParticles(AliAODTrack *atrack)
Bool_t fProcessBothKineAndReco
global tracks in AOD. [0] is used in the default analysis, [1] and [2] for event mixing, etc.
UInt_t fPeriod
do something only for the specified event
Double_t fInclusiveSigmaCuts[5]
[0=e,1=mu,2=pi,3=K,4=p][particle(+q)/antiparticle(-q)][kPrimary/kFromDecayVtx]
virtual void FillControlHistogramsIdentifiedParticles(AliAODTrack *atrack, AliAODTrack *gtrack)
TList * fControlHistogramsV0sList
[PID function][PID exclusive] see .cxx for detailed documentation
ClassDef(AliAnalysisTaskMultiparticleFemtoscopy, 7)
do something only for the specified event
Bool_t fWaitForSpecifiedEvent
enable call to function within which debugging is done. Set indirectly.
TClonesArray * fMixedEvents[2]
[particle(+q): 0=e,1=mu,2=pi,3=K,4=p, anti-particle(-q): 0=e,1=mu,2=pi,3=K,4=p] x [same]...
TH1I * fGetNContributorsHist
[avtx->GetX(),avtx->GetY(),avtx->GetZ()]
Double_t fExclusiveSigmaCuts[5][5]
[PID function] see .cxx for detailed documentation