Correcly handle centrality bins (Diego)
[u/mrichter/AliRoot.git] / PWGPP / AliAnalysisTaskFilteredTree.h
CommitLineData
1059f583 1#ifndef ALIDNDPTTRACKDUMPTASK_H
2#define ALIDNDPTTRACKDUMPTASK_H
3
4//------------------------------------------------------------------------------
5// Task to dump track information
6// TPC constrained and TPC+ITS combined
7// for outliers analysis.
8//
9// Author: J.Otwinowski 19/06/2011
10//------------------------------------------------------------------------------
11
12class AliESDEvent;
13class AliMCEvent;
14class AliFilteredTreeEventCuts;
15class AliFilteredTreeAcceptanceCuts;
16class AliESDtrackCuts;
17class AliMagFMaps;
18class AliESDEvent;
19class AliMCEvent;
20class AliKFParticle;
21class AliESDv0;
08c5e656 22class AliExternalTrackParam;
23class AliESDtrack;
2e16763c 24class AliESDfriendTrack;
08c5e656 25class AliESDVertex;
26class AliStack;
1059f583 27class TList;
28class TObjArray;
29class TTree;
30class TTreeSRedirector;
08c5e656 31class TParticle;
73442c55 32class TH3D;
1059f583 33
34#include "AliTriggerAnalysis.h"
35#include "AliAnalysisTaskSE.h"
36
37class AliAnalysisTaskFilteredTree : public AliAnalysisTaskSE {
38 public:
39
40 enum EAnalysisMode { kInvalidAnalysisMode=-1,
41 kTPCITSAnalysisMode=0,
42 kTPCAnalysisMode=1 };
43
44 AliAnalysisTaskFilteredTree(const char *name = "AliAnalysisTaskFilteredTree");
45 virtual ~AliAnalysisTaskFilteredTree();
46
47 virtual void UserCreateOutputObjects();
48 virtual void UserExec(Option_t *option);
49 virtual void Terminate(Option_t *);
50 virtual Bool_t Notify();
51 virtual void FinishTaskOutput();
52 void SetUseMCInfo(Bool_t info) { fUseMCInfo = info; }
b4c82bc9 53 Bool_t IsUseMCInfo() const { return (fMC)?kTRUE:kFALSE; }
1059f583 54 void SetUseESDfriends(Bool_t friends) { fUseESDfriends = friends; }
55 Bool_t IsUseESDfriends() const { return fUseESDfriends; }
56
57 // Process events
58 void ProcessAll(AliESDEvent *const esdEvent=0, AliMCEvent *const mcEvent=0, AliESDfriend *const esdFriend=0);
59 void Process(AliESDEvent *const esdEvent=0, AliMCEvent *const mcEvent=0, AliESDfriend *const esdFriend=0);
60 void ProcessV0(AliESDEvent *const esdEvent=0, AliMCEvent *const mcEvent=0, AliESDfriend *const esdFriend=0);
61 void ProcessdEdx(AliESDEvent *const esdEvent=0, AliMCEvent *const mcEvent=0, AliESDfriend *const esdFriend=0);
62 void ProcessLaser(AliESDEvent *const esdEvent=0, AliMCEvent *const mcEvent=0, AliESDfriend *const esdFriend=0);
63 void ProcessMCEff(AliESDEvent *const esdEvent=0, AliMCEvent *const mcEvent=0, AliESDfriend *const esdFriend=0);
234cae2f 64 void ProcessCosmics(AliESDEvent *const esdEvent=0, AliESDfriend* esdFriend=0);
1059f583 65
4a00e62d 66 void ProcessITSTPCmatchOut(AliESDEvent *const esdEvent=0, AliESDfriend *const esdFriend=0);
b4990577 67 void ProcessTrackMatch(AliESDEvent *const esdEvent=0, AliESDfriend *const esdFriend=0);
4a00e62d 68
1059f583 69 void SetEventCuts(AliFilteredTreeEventCuts* const cuts) { fFilteredTreeEventCuts = cuts; }
70 void SetAcceptanceCuts(AliFilteredTreeAcceptanceCuts* const cuts) { fFilteredTreeAcceptanceCuts = cuts; }
71 void SetRecAcceptanceCuts(AliFilteredTreeAcceptanceCuts* const cuts) { fFilteredTreeRecAcceptanceCuts = cuts; }
72 void SetTrackCuts(AliESDtrackCuts* const cuts) { fEsdTrackCuts = cuts; }
73 void SetTrigger(const AliTriggerAnalysis::Trigger trigger) { fTrigger = trigger; }
34e8fe1d 74 void SetAnalysisMode(EAnalysisMode mode) { fAnalysisMode = mode; }
1059f583 75
76 AliFilteredTreeEventCuts* GetEventCuts() const { return fFilteredTreeEventCuts; }
77 AliFilteredTreeAcceptanceCuts* GetAcceptanceCuts() const { return fFilteredTreeAcceptanceCuts; }
78 AliFilteredTreeAcceptanceCuts* GetRecAcceptanceCuts() const { return fFilteredTreeRecAcceptanceCuts; }
79 AliESDtrackCuts* GetTrackCuts() const { return fEsdTrackCuts; }
80 AliTriggerAnalysis::Trigger GetTrigger() const { return fTrigger; }
81 EAnalysisMode GetAnalysisMode() const { return fAnalysisMode; }
82
83 TString GetCentralityEstimator() const {return fCentralityEstimator; }
84 void SetCentralityEstimator(TString centEst="V0M") { fCentralityEstimator = centEst; }
85
34e8fe1d 86 Bool_t IsFromConversion(Int_t label, AliStack *const stack);
87 Bool_t IsFromMaterial(Int_t label, AliStack *const stack);
88 Bool_t IsFromStrangeness(Int_t label, AliStack *const stack);
1059f583 89 TParticle *GetMother(TParticle *const particle, AliStack *const stack);
90
91 Bool_t ConstrainTPCInner(AliExternalTrackParam *const tpcInnerC, const AliESDVertex* vtx, Double_t b[3]);
92 Bool_t ConstrainTrackInner(AliExternalTrackParam *const trackInnerC, const AliESDVertex* vtx, Double_t mass, Double_t b[3]);
93
94 // v0s selection
95 Int_t GetKFParticle(AliESDv0 *const v0, AliESDEvent * const event, AliKFParticle & kfparticle);
96 Bool_t IsV0Downscaled(AliESDv0 *const v0);
97 Bool_t IsHighDeDxParticle(AliESDtrack * const track);
98
99 void SetLowPtTrackDownscaligF(Double_t fact) { fLowPtTrackDownscaligF = fact; }
100 void SetLowPtV0DownscaligF(Double_t fact) { fLowPtV0DownscaligF = fact; }
b4990577 101 void SetFriendDownscaling(Double_t fact) { fFriendDownscaling = fact; }
1059f583 102
103 void SetProcessCosmics(Bool_t flag) { fProcessCosmics = flag; }
104 Bool_t GetProcessCosmics() { return fProcessCosmics; }
4a00e62d 105 //
106 void SetProcessProcessITSTPCmatchOut(Bool_t flag) { fProcessITSTPCmatchOut = flag; }
107 Bool_t GetProcessProcessITSTPCmatchOut() { return fProcessITSTPCmatchOut; }
1059f583 108
4a00e62d 109
1059f583 110 void SetProcessAll(Bool_t proc) { fProcessAll = proc; }
111 static Int_t GetMCTrueTrackMult(AliMCEvent *const mcEvent, AliFilteredTreeEventCuts *const evtCuts, AliFilteredTreeAcceptanceCuts *const accCuts);
112
30530964 113 void SetFillTrees(Bool_t filltree) { fFillTree = filltree ;}
114 Bool_t GetFillTrees() { return fFillTree ;}
115
34e8fe1d 116 void FillHistograms(AliESDtrack* const ptrack, AliExternalTrackParam* const ptpcInnerC, Double_t centralityF, Double_t chi2TPCInnerC);
30530964 117
1059f583 118 private:
119
120 AliESDEvent *fESD; //! ESD event
121 AliMCEvent *fMC; //! MC event
122 AliESDfriend *fESDfriend; //! ESDfriend event
123 TList* fOutput; //! list send on output slot 0
124 TIterator *fPitList; //! iterator over the output objetcs
125
126 Bool_t fUseMCInfo; // use MC information
30530964 127 Bool_t fUseESDfriends; // use esd friends
128 Bool_t fReducePileUp; // downscale the information for the pile-up TPC tracks
129 Bool_t fFillTree; // do not fill trees
1059f583 130
131 AliFilteredTreeEventCuts *fFilteredTreeEventCuts; // event cuts
132 AliFilteredTreeAcceptanceCuts *fFilteredTreeAcceptanceCuts; // acceptance cuts
133 AliFilteredTreeAcceptanceCuts *fFilteredTreeRecAcceptanceCuts; // additional recontruction acceptance cuts (not used for MC truth)
134 AliESDtrackCuts *fEsdTrackCuts; // esd track cuts
135 AliTriggerAnalysis::Trigger fTrigger; // trigger settings
136 EAnalysisMode fAnalysisMode; // analysis mode TPC only, TPC + ITS
137
138 TTreeSRedirector* fTreeSRedirector; //! temp tree to dump output
139
140 TString fCentralityEstimator; // use centrality can be "VOM" (default), "FMD", "TRK", "TKL", "CL0", "CL1", "V0MvsFMD", "TKLvsV0M", "ZEMvsZDC"
141
142 Double_t fLowPtTrackDownscaligF; // low pT track downscaling factor
b4990577 143 Double_t fLowPtV0DownscaligF; // low pT V0 downscaling factor
144 Double_t fFriendDownscaling; // friend info downscaling )absolute value used), Modes>=1 downscaling in respect to the amount of tracks, Mode<=-1 (downscaling in respect to the data volume)
1059f583 145 Double_t fProcessAll; // Calculate all track properties including MC
146
147 Bool_t fProcessCosmics; // look for cosmic pairs from random trigger
4a00e62d 148 Bool_t fProcessITSTPCmatchOut; // swittch to process ITS/TPC standalone tracks
149
1059f583 150 TTree* fHighPtTree; //! list send on output slot 0
151 TTree* fV0Tree; //! list send on output slot 0
152 TTree* fdEdxTree; //! list send on output slot 0
153 TTree* fLaserTree; //! list send on output slot 0
154 TTree* fMCEffTree; //! list send on output slot 0
155 TTree* fCosmicPairsTree; //! list send on output slot 0
156
30530964 157 TH3D* fPtResPhiPtTPC; //! sigma(pt)/pt vs Phi vs Pt for prim. TPC tracks
158 TH3D* fPtResPhiPtTPCc; //! sigma(pt)/pt vs Phi vs Pt for prim. TPC contrained to vertex tracks
159 TH3D* fPtResPhiPtTPCITS; //! sigma(pt)/pt vs Phi vs Pt for prim. TPC+ITS tracks
160
161 TH3D* fPtResEtaPtTPC; //! sigma(pt)/pt vs Eta vs Pt for prim. TPC tracks
162 TH3D* fPtResEtaPtTPCc; //! sigma(pt)/pt vs Eta vs Pt for prim. TPC contrained to vertex tracks
163 TH3D* fPtResEtaPtTPCITS; //! sigma(pt)/pt vs Eta vs Pt for prim. TPC+ITS tracks
164
165 TH3D* fPtResCentPtTPC; //! sigma(pt)/pt vs Cent vs Pt for prim. TPC tracks
166 TH3D* fPtResCentPtTPCc; //! sigma(pt)/pt vs Cent vs Pt for prim. TPC contrained to vertex tracks
167 TH3D* fPtResCentPtTPCITS; //! sigma(pt)/pt vs Cent vs Pt for prim. TPC+ITS tracks
1a30582a 168 TObjString fCurrentFileName; // cached value of current file name
169 AliESDtrack* fDummyTrack; //! dummy track for tree init
30530964 170
1059f583 171 AliAnalysisTaskFilteredTree(const AliAnalysisTaskFilteredTree&); // not implemented
172 AliAnalysisTaskFilteredTree& operator=(const AliAnalysisTaskFilteredTree&); // not implemented
1059f583 173 ClassDef(AliAnalysisTaskFilteredTree, 1); // example of analysis
174};
175
176#endif