Compatibility with ROOT trunk
[u/mrichter/AliRoot.git] / JETAN / DEV / AliAnalysisTaskJetCluster.h
CommitLineData
d89b8229 1#ifndef ALIANALYSISTASKJETCLUSTER_H
2#define ALIANALYSISTASKJETCLUSTER_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7// **************************************
8// task used for comparing different jets D parmaters from fastjet
9// *******************************************
10
11#include "AliAnalysisTaskSE.h"
12#include "THnSparse.h" // cannot forward declare ThnSparseF
13#include "fastjet/ClusterSequenceArea.hh"
14#include "fastjet/AreaDefinition.hh"
15#include "fastjet/JetDefinition.hh"
16#include "fastjet/PseudoJet.hh"
17
18////////////////
19class AliJetHeader;
20class AliESDEvent;
21class AliAODEvent;
22class AliAODExtension;
23class AliAODJet;
24class AliGenPythiaEventHeader;
25class AliCFManager;
26class AliAODJetEventBackground;
27class AliJetFinder;
28class TList;
29class TChain;
30class TH2F;
31class TH1F;
32class TH3F;
33class TProfile;
34class TRandom3;
35class TRefArray;
36class TClonesArray;
006b2a30 37class TF1;
d89b8229 38
39class AliAnalysisTaskJetCluster : public AliAnalysisTaskSE
40{
41 public:
42 AliAnalysisTaskJetCluster();
43 AliAnalysisTaskJetCluster(const char* name);
44 virtual ~AliAnalysisTaskJetCluster();
45 // Implementation of interface methods
46 virtual void UserCreateOutputObjects();
47 virtual void Init();
48 virtual void LocalInit() { Init(); }
49 virtual void UserExec(Option_t *option);
50 virtual void Terminate(Option_t *option);
51 virtual Bool_t Notify();
52
53
54
55 virtual void SetAODTrackInput(Bool_t b){fUseAODTrackInput = b;}
56 virtual void SetAODMCInput(Bool_t b){fUseAODMCInput = b;}
57 virtual void SetEventSelection(Bool_t b){fEventSelection = b;}
58 virtual void SetRecEtaWindow(Float_t f){fRecEtaWindow = f;}
59 virtual void SetTrackEtaWindow(Float_t f){fTrackEtaWindow = f;}
60 virtual void SetTrackTypeGen(Int_t i){fTrackTypeGen = i;}
61 virtual void SetTrackTypeRec(Int_t i){fTrackTypeRec = i;}
62 virtual void SetTrackPtCut(Float_t x){fTrackPtCut = x;}
63 virtual void SetCentralityCut(Float_t xLo,Float_t xUp){fCentCutLo = xLo; fCentCutUp = xUp;}
64 virtual void SetFilterMask(UInt_t i,Int_t iType = 0){fFilterMask = i;
65 fFilterType = iType;}
ac7e7ba5 66 virtual void SetFilterMaskBestPt(UInt_t i){fFilterMaskBestPt = i;}
67
d89b8229 68 virtual void SetJetTypes(UInt_t i){fJetTypes = i;}
69 virtual void SetJetTriggerPtCut(Float_t x){fJetTriggerPtCut = x;}
70 virtual void SetVtxCuts(Float_t z,Float_t r = 1){fVtxZCut = z; fVtxR2Cut = r *r;}
71 virtual void SetBackgroundBranch(const char* c){fBackgroundBranch = c;}
72 virtual const char* GetBackgroundBranch(){return fBackgroundBranch.Data();}
73 virtual void SetNSkipLeadingRan(Int_t x){fNSkipLeadingRan = x;}
74 virtual void SetNSkipLeadingCone(Int_t x){fNSkipLeadingCone = x;}
75 virtual void SetNRandomCones(Int_t x){fNRandomCones = x;}
76
77 virtual void SetJetOutputBranch(const char *c){fNonStdBranch = c;}
78 virtual const char* GetJetOutputBranch(){return fNonStdBranch.Data();}
79 virtual void SetJetOutputFile(const char *c){fNonStdFile = c;}
80 virtual const char* GetJetOutputFile(){return fNonStdFile.Data();}
81 virtual void SetMaxTrackPtInJet(Float_t x){fMaxTrackPtInJet = x;}
82 virtual void SetJetOutputMinPt(Float_t x){fJetOutputMinPt = x;}
83 virtual void SetBackgroundCalc(Bool_t b){fUseBackgroundCalc = b;}
84
006b2a30 85 //Setters for detector level effects
86 virtual void SetSmearResolution(Bool_t b){fUseTrMomentumSmearing = b;}
87 virtual void SetDiceEfficiency(Bool_t b){fUseDiceEfficiency = b;}
88 virtual void SetMomentumResolutionHybrid(TProfile *p1, TProfile *p2, TProfile *p3);
89 virtual void SetEfficiencyHybrid(TH1 *h1, TH1 *h2, TH1 *h3);
90
91 Double_t GetMomentumSmearing(Int_t cat, Double_t pt);
92 void FitMomentumResolution();
d89b8229 93
94
95 // for Fast Jet
96 fastjet::JetAlgorithm GetAlgorithm() const {return fAlgorithm;}
97 fastjet::Strategy GetStrategy() const {return fStrategy;}
98 fastjet::RecombinationScheme GetRecombScheme() const {return fRecombScheme;}
99 fastjet::AreaType GetAreaType() const {return fAreaType;}
100 // Setters
101 void SetRparam(Double_t f) {fRparam = f;}
102 void SetAlgorithm(fastjet::JetAlgorithm f) {fAlgorithm = f;}
103 void SetStrategy(fastjet::Strategy f) {fStrategy = f;}
104 void SetRecombScheme(fastjet::RecombinationScheme f) {fRecombScheme = f;}
105 void SetAreaType(fastjet::AreaType f) {fAreaType = f;}
106 void SetGhostArea(Double_t f) {fGhostArea = f;}
107 void SetActiveAreaRepeats(Int_t f) {fActiveAreaRepeats = f;}
108 void SetGhostEtamax(Double_t f) {fGhostEtamax = f;}
109
110
111
112 // Helper
113 //
114
115 // we have different cases
116 // AOD reading -> MC from AOD
117 // ESD reading -> MC from Kinematics
118 // this has to match with our selection of input events
119 enum {kTrackUndef = 0, kTrackAOD, kTrackKineAll,kTrackKineCharged, kTrackAODMCAll, kTrackAODMCCharged, kTrackAODMCChargedAcceptance, kTrackAODextra, kTrackAODextraonly};
120 enum {kMaxJets = 4};
121 enum {kMaxCorrelation = 3};
122 enum {kMaxRadius = 5};
123 enum {kMaxCent = 4};
124 enum {kJet = 1<<0,
125 kJetRan = 1<<1,
126 kRC = 1<<2,
127 kRCRan = 1<<3
128 };
129
130
131 private:
132
133 AliAnalysisTaskJetCluster(const AliAnalysisTaskJetCluster&);
134 AliAnalysisTaskJetCluster& operator=(const AliAnalysisTaskJetCluster&);
135
136 Int_t GetListOfTracks(TList *list,Int_t type);
137
138 AliAODEvent *fAOD; // ! where we take the jets from can be input or output AOD
139 AliAODExtension *fAODExtension; // ! AOD extension in case we write a non-sdt branch to a separate file and the aod is standard
140 TRefArray *fRef; // ! trefarray for track references within the jet
141 Bool_t fUseAODTrackInput; // take track from input AOD not from ouptu AOD
142 Bool_t fUseAODMCInput; // take MC from input AOD not from ouptu AOD
143 Bool_t fUseBackgroundCalc; // switches on background calculations
144 Bool_t fEventSelection; // use the event selection of this task, otherwise analyse all
145 UInt_t fFilterMask; // filter bit for slecected tracks
b01d3ab7 146 UInt_t fFilterMaskBestPt; // filter bit to mark jets with high quality leading tracks
d7396b04 147
d89b8229 148 UInt_t fFilterType; // filter type 0 = all, 1 = ITSTPC, 2 = TPC
006b2a30 149 UInt_t fJetTypes; // 1<<0 regular jets, 1<<1 << randomized event 1<<2 random cones 1<<3 random cones randomiuzed event
d89b8229 150 Int_t fTrackTypeRec; // type of tracks used for FF
151 Int_t fTrackTypeGen; // type of tracks used for FF
152 Int_t fNSkipLeadingRan; // number of leading tracks to be skipped in the randomized event
153 Int_t fNSkipLeadingCone; // number of leading jets to be for the random cones
154 Int_t fNRandomCones; // number of generated random cones
155 Float_t fAvgTrials; // Average nimber of trials
156 Float_t fExternalWeight; // external weight
157 Float_t fTrackEtaWindow; // eta window used for corraltion plots between rec and gen
158 Float_t fRecEtaWindow; // eta window used for corraltion plots between rec and gen
159 Float_t fTrackPtCut; // minimum track pt to be accepted
160 Float_t fJetOutputMinPt; // minimum p_t for jets to be written out
161 Float_t fMaxTrackPtInJet; // maximum track pt within a jet for flagging...
162 Float_t fJetTriggerPtCut; // minimum jwt pT for AOD to be written
163 Float_t fVtxZCut; // zvtx cut
164 Float_t fVtxR2Cut; // R vtx cut (squared)
165 Float_t fCentCutUp; // upper limit on centrality
166 Float_t fCentCutLo; // lower limit on centrality
167 // output configurartion
168 TString fNonStdBranch; // the name of the non-std branch name, if empty no branch is filled
169 TString fBackgroundBranch; // name of the branch used for background subtraction
006b2a30 170 TString fNonStdFile; // The optional name of the output file the non-std branch is written to
171
172 //Detector level effects
173 TProfile *fMomResH1; // Momentum resolution from TrackQA Hybrid Category 1
174 TProfile *fMomResH2; // Momentum resolution from TrackQA Hybrid Category 2
175 TProfile *fMomResH3; // Momentum resolution from TrackQA Hybrid Category 3
176 TF1 *fMomResH1Fit; //fit
177 TF1 *fMomResH2Fit; //fit
178 TF1 *fMomResH3Fit; //fit
179
180 TH1 *fhEffH1; // Efficiency for Spectra Hybrid Category 1
181 TH1 *fhEffH2; // Efficiency for Spectra Hybrid Category 2
182 TH1 *fhEffH3; // Efficiency for Spectra Hybrid Category 3
183 Bool_t fUseTrMomentumSmearing; // Apply momentum smearing on track level
184 Bool_t fUseDiceEfficiency; // Apply efficiency on track level by dicing
d89b8229 185
186 // Fast jet
f0659f11 187 Double_t fRparam; // fastjet distance parameter
d89b8229 188 fastjet::JetAlgorithm fAlgorithm; //fastjet::kt_algorithm
189 fastjet::Strategy fStrategy; //= fastjet::Best;
190 fastjet::RecombinationScheme fRecombScheme; // = fastjet::BIpt_scheme;
f0659f11 191 fastjet::AreaType fAreaType; // fastjet area type
192 Double_t fGhostArea; // fasjet ghost area
193 Int_t fActiveAreaRepeats; // fast jet active area repeats
194 Double_t fGhostEtamax; // fast jet ghost area
d89b8229 195
006b2a30 196 TClonesArray *fTCAJetsOut; //! TCA of output jets
197 TClonesArray *fTCAJetsOutRan; //! TCA of output jets in randomized event
198 TClonesArray *fTCARandomConesOut; //! TCA of output jets in randomized event
d89b8229 199 TClonesArray *fTCARandomConesOutRan; //! TCA of output jets in randomized event
200 AliAODJetEventBackground *fAODJetBackgroundOut; //! jet background to be written out
201
202 TRandom3* fRandom; //! random number generator
203 TProfile* fh1Xsec; //! pythia cross section and trials
204 TH1F* fh1Trials; //! trials are added
205 TH1F* fh1PtHard; //! Pt har of the event...
206 TH1F* fh1PtHardNoW; //! Pt har of the event without weigt
207 TH1F* fh1PtHardTrials; //! Number of trials
208
209 TH1F* fh1NJetsRec; //! number of reconstructed jets
210 TH1F* fh1NConstRec;//! number of constiutens in leading jet
211 TH1F* fh1NConstLeadingRec;//! number of constiutens in leading jet
212 TH1F* fh1PtJetsRecIn; //! Jet pt for all jets
213 TH1F* fh1PtJetsLeadingRecIn; //! Jet pt for all jets
214 TH1F* fh1PtJetConstRec;//! pt of constituents
215 TH1F* fh1PtJetConstLeadingRec;// pt of constituents
216 TH1F* fh1PtTracksRecIn; //! track pt for all tracks
217 TH1F* fh1PtTracksLeadingRecIn; //! track pt for all tracks
218
219 // Randomized track histos
220 TH1F* fh1NJetsRecRan; //! number of reconstructed jets from randomized
221 TH1F* fh1NConstRecRan;//! number of constiutens in leading jet
222 TH1F* fh1PtJetsLeadingRecInRan; //! Jet pt for all jets
223 TH1F* fh1NConstLeadingRecRan;//! number of constiutens in leading jet
224 TH1F* fh1PtJetsRecInRan; //! Jet pt for all jets
225
226 TH1F* fh1PtTracksGenIn; //! track pt for all tracks
227 TH1F* fh1Nch; //! charged particle mult
228 TH1F* fh1BiARandomCones[3]; //! Residual distribtion from reandom cones on real event
229 TH1F* fh1BiARandomConesRan[3]; //! Residual distribtion from reandom cones on random event
230 TH1F* fh1CentralityPhySel; // ! centrality of anaylsed events
231 TH1F* fh1Centrality; // ! centrality of anaylsed events
232 TH1F* fh1CentralitySelect; // ! centrality of selected events
233 TH1F* fh1ZPhySel; // ! centrality of anaylsed events
234 TH1F* fh1Z; // ! centrality of anaylsed events
235 TH1F* fh1ZSelect; // ! centrality of selected events
236
237
238 TH2F* fh2NRecJetsPt; //! Number of found jets above threshold
239 TH2F* fh2NRecTracksPt; //! Number of found tracks above threshold
240 TH2F* fh2NConstPt; //! number of constituents vs. pt
241 TH2F* fh2NConstLeadingPt; //! number of constituents vs. pt
242 TH2F* fh2JetPhiEta; //! jet phi eta
243 TH2F* fh2LeadingJetPhiEta; //! leading jet phi eta
244 TH2F* fh2JetEtaPt; //! leading jet eta
245 TH2F* fh2LeadingJetEtaPt; //! leading jet eta
246 TH2F* fh2TrackEtaPt; //! track eta
247 TH2F* fh2LeadingTrackEtaPt; //! leading track eta
248 TH2F* fh2JetsLeadingPhiEta; //! jet phi eta
249 TH2F* fh2JetsLeadingPhiPt; //! jet correlation with leading jet
250 TH2F* fh2TracksLeadingPhiEta; //! track correlation with leading track
251 TH2F* fh2TracksLeadingPhiPt; //! track correlation with leading track
252 TH2F* fh2TracksLeadingJetPhiPt; //! track correlation with leading Jet
253 TH2F* fh2JetsLeadingPhiPtW; //! jet correlation with leading jet
254 TH2F* fh2TracksLeadingPhiPtW; //! track correlation with leading track
255 TH2F* fh2TracksLeadingJetPhiPtW; //! track correlation with leading Jet
256 TH2F* fh2NRecJetsPtRan; //! Number of found jets above threshold
257 TH2F* fh2NConstPtRan; //! number of constituents vs. pt
258 TH2F* fh2NConstLeadingPtRan; //! number of constituents vs. pt
259 TH2F* fh2PtNch; //! p_T of cluster vs. multiplicity,
260 TH2F* fh2PtNchRan; //! p_T of cluster vs. multiplicity,random
261 TH2F* fh2PtNchN; //! p_T of cluster vs. multiplicity, weigthed with constituents
262 TH2F* fh2PtNchNRan; //! p_T of cluster vs. multiplicity, weigthed with constituents random
263 TH2F* fh2TracksLeadingJetPhiPtRan; //! track correlation with leading Jet
264 TH2F* fh2TracksLeadingJetPhiPtWRan; //! track correlation with leading Jet
265
266
267 TH2F* fh2JetsLeadingPhiPtC[kMaxCent]; //! jet correlation with leading jet
268 TH2F* fh2JetsLeadingPhiPtWC[kMaxCent]; //! jet correlation with leading jet
269 TH2F* fh2TracksLeadingJetPhiPtC[kMaxCent]; //! track correlation with leading Jet
270 TH2F* fh2TracksLeadingJetPhiPtWC[kMaxCent]; //! track correlation with leading Jet
271
006b2a30 272 //Histos for detector level effects from toy model
273 TH2F *fh2PtGenPtSmeared; //! Control histo smeared momentum
274 TProfile *fp1Efficiency; //! Control profile efficiency
275 TProfile *fp1PtResolution; //! Control profile for pT resolution
276
d89b8229 277 TList *fHistList; //!leading tracks to be skipped in the randomized event Output list
278
279
280 ClassDef(AliAnalysisTaskJetCluster, 20)
281};
282
283#endif