some more updates
[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
66 void SetEventCuts(AliFilteredTreeEventCuts* const cuts) { fFilteredTreeEventCuts = cuts; }
67 void SetAcceptanceCuts(AliFilteredTreeAcceptanceCuts* const cuts) { fFilteredTreeAcceptanceCuts = cuts; }
68 void SetRecAcceptanceCuts(AliFilteredTreeAcceptanceCuts* const cuts) { fFilteredTreeRecAcceptanceCuts = cuts; }
69 void SetTrackCuts(AliESDtrackCuts* const cuts) { fEsdTrackCuts = cuts; }
70 void SetTrigger(const AliTriggerAnalysis::Trigger trigger) { fTrigger = trigger; }
34e8fe1d 71 void SetAnalysisMode(EAnalysisMode mode) { fAnalysisMode = mode; }
1059f583 72
73 AliFilteredTreeEventCuts* GetEventCuts() const { return fFilteredTreeEventCuts; }
74 AliFilteredTreeAcceptanceCuts* GetAcceptanceCuts() const { return fFilteredTreeAcceptanceCuts; }
75 AliFilteredTreeAcceptanceCuts* GetRecAcceptanceCuts() const { return fFilteredTreeRecAcceptanceCuts; }
76 AliESDtrackCuts* GetTrackCuts() const { return fEsdTrackCuts; }
77 AliTriggerAnalysis::Trigger GetTrigger() const { return fTrigger; }
78 EAnalysisMode GetAnalysisMode() const { return fAnalysisMode; }
79
80 TString GetCentralityEstimator() const {return fCentralityEstimator; }
81 void SetCentralityEstimator(TString centEst="V0M") { fCentralityEstimator = centEst; }
82
34e8fe1d 83 Bool_t IsFromConversion(Int_t label, AliStack *const stack);
84 Bool_t IsFromMaterial(Int_t label, AliStack *const stack);
85 Bool_t IsFromStrangeness(Int_t label, AliStack *const stack);
1059f583 86 TParticle *GetMother(TParticle *const particle, AliStack *const stack);
87
88 Bool_t ConstrainTPCInner(AliExternalTrackParam *const tpcInnerC, const AliESDVertex* vtx, Double_t b[3]);
89 Bool_t ConstrainTrackInner(AliExternalTrackParam *const trackInnerC, const AliESDVertex* vtx, Double_t mass, Double_t b[3]);
90
91 // v0s selection
92 Int_t GetKFParticle(AliESDv0 *const v0, AliESDEvent * const event, AliKFParticle & kfparticle);
93 Bool_t IsV0Downscaled(AliESDv0 *const v0);
94 Bool_t IsHighDeDxParticle(AliESDtrack * const track);
95
96 void SetLowPtTrackDownscaligF(Double_t fact) { fLowPtTrackDownscaligF = fact; }
97 void SetLowPtV0DownscaligF(Double_t fact) { fLowPtV0DownscaligF = fact; }
98
99 void SetProcessCosmics(Bool_t flag) { fProcessCosmics = flag; }
100 Bool_t GetProcessCosmics() { return fProcessCosmics; }
101
102 void SetProcessAll(Bool_t proc) { fProcessAll = proc; }
103 static Int_t GetMCTrueTrackMult(AliMCEvent *const mcEvent, AliFilteredTreeEventCuts *const evtCuts, AliFilteredTreeAcceptanceCuts *const accCuts);
104
30530964 105 void SetFillTrees(Bool_t filltree) { fFillTree = filltree ;}
106 Bool_t GetFillTrees() { return fFillTree ;}
107
34e8fe1d 108 void FillHistograms(AliESDtrack* const ptrack, AliExternalTrackParam* const ptpcInnerC, Double_t centralityF, Double_t chi2TPCInnerC);
30530964 109
1059f583 110 private:
111
112 AliESDEvent *fESD; //! ESD event
113 AliMCEvent *fMC; //! MC event
114 AliESDfriend *fESDfriend; //! ESDfriend event
115 TList* fOutput; //! list send on output slot 0
116 TIterator *fPitList; //! iterator over the output objetcs
117
118 Bool_t fUseMCInfo; // use MC information
30530964 119 Bool_t fUseESDfriends; // use esd friends
120 Bool_t fReducePileUp; // downscale the information for the pile-up TPC tracks
121 Bool_t fFillTree; // do not fill trees
1059f583 122
123 AliFilteredTreeEventCuts *fFilteredTreeEventCuts; // event cuts
124 AliFilteredTreeAcceptanceCuts *fFilteredTreeAcceptanceCuts; // acceptance cuts
125 AliFilteredTreeAcceptanceCuts *fFilteredTreeRecAcceptanceCuts; // additional recontruction acceptance cuts (not used for MC truth)
126 AliESDtrackCuts *fEsdTrackCuts; // esd track cuts
127 AliTriggerAnalysis::Trigger fTrigger; // trigger settings
128 EAnalysisMode fAnalysisMode; // analysis mode TPC only, TPC + ITS
129
130 TTreeSRedirector* fTreeSRedirector; //! temp tree to dump output
131
132 TString fCentralityEstimator; // use centrality can be "VOM" (default), "FMD", "TRK", "TKL", "CL0", "CL1", "V0MvsFMD", "TKLvsV0M", "ZEMvsZDC"
133
134 Double_t fLowPtTrackDownscaligF; // low pT track downscaling factor
135 Double_t fLowPtV0DownscaligF; // low pT V0 downscaling factor
136 Double_t fProcessAll; // Calculate all track properties including MC
137
138 Bool_t fProcessCosmics; // look for cosmic pairs from random trigger
139
140 TTree* fHighPtTree; //! list send on output slot 0
141 TTree* fV0Tree; //! list send on output slot 0
142 TTree* fdEdxTree; //! list send on output slot 0
143 TTree* fLaserTree; //! list send on output slot 0
144 TTree* fMCEffTree; //! list send on output slot 0
145 TTree* fCosmicPairsTree; //! list send on output slot 0
146
30530964 147 TH3D* fPtResPhiPtTPC; //! sigma(pt)/pt vs Phi vs Pt for prim. TPC tracks
148 TH3D* fPtResPhiPtTPCc; //! sigma(pt)/pt vs Phi vs Pt for prim. TPC contrained to vertex tracks
149 TH3D* fPtResPhiPtTPCITS; //! sigma(pt)/pt vs Phi vs Pt for prim. TPC+ITS tracks
150
151 TH3D* fPtResEtaPtTPC; //! sigma(pt)/pt vs Eta vs Pt for prim. TPC tracks
152 TH3D* fPtResEtaPtTPCc; //! sigma(pt)/pt vs Eta vs Pt for prim. TPC contrained to vertex tracks
153 TH3D* fPtResEtaPtTPCITS; //! sigma(pt)/pt vs Eta vs Pt for prim. TPC+ITS tracks
154
155 TH3D* fPtResCentPtTPC; //! sigma(pt)/pt vs Cent vs Pt for prim. TPC tracks
156 TH3D* fPtResCentPtTPCc; //! sigma(pt)/pt vs Cent vs Pt for prim. TPC contrained to vertex tracks
157 TH3D* fPtResCentPtTPCITS; //! sigma(pt)/pt vs Cent vs Pt for prim. TPC+ITS tracks
158
1059f583 159 AliAnalysisTaskFilteredTree(const AliAnalysisTaskFilteredTree&); // not implemented
160 AliAnalysisTaskFilteredTree& operator=(const AliAnalysisTaskFilteredTree&); // not implemented
161
2e16763c 162 AliESDfriendTrack* fDummyFriendTrack; //! needed for proper init of the output tree
163 AliESDtrack* fDummyTrack; //! dummy track for tree init
164
1059f583 165 ClassDef(AliAnalysisTaskFilteredTree, 1); // example of analysis
166};
167
168#endif