add setters
[u/mrichter/AliRoot.git] / JETAN / AliAnalysisTaskJetCluster.h
CommitLineData
dbf053f0 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// **************************************
f840d64c 8// task used for comparing different jets D parmaters from fastjet
dbf053f0 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;
54424110 22class AliAODExtension;
dbf053f0 23class AliAODJet;
24class AliGenPythiaEventHeader;
25class AliCFManager;
d6e66a82 26class AliAODJetEventBackground;
27class AliJetFinder;
dbf053f0 28class TList;
29class TChain;
30class TH2F;
31class TH1F;
32class TH3F;
33class TProfile;
d7ca0e14 34class TRandom3;
54424110 35class TRefArray;
8f85b773 36class TClonesArray;
006b2a30 37class TF1;
dbf053f0 38
39class AliAnalysisTaskJetCluster : public AliAnalysisTaskSE
40{
41 public:
42 AliAnalysisTaskJetCluster();
43 AliAnalysisTaskJetCluster(const char* name);
54424110 44 virtual ~AliAnalysisTaskJetCluster();
dbf053f0 45 // Implementation of interface methods
46 virtual void UserCreateOutputObjects();
fa7c34ba 47 virtual void LocalInit();
dbf053f0 48 virtual void UserExec(Option_t *option);
49 virtual void Terminate(Option_t *option);
50 virtual Bool_t Notify();
51
d6e66a82 52
dbf053f0 53 virtual void SetAODTrackInput(Bool_t b){fUseAODTrackInput = b;}
54 virtual void SetAODMCInput(Bool_t b){fUseAODMCInput = b;}
ca6d12f9 55 virtual void SetEventSelection(Bool_t b){fEventSelection = b;}
dbf053f0 56 virtual void SetRecEtaWindow(Float_t f){fRecEtaWindow = f;}
8a320ab9 57 virtual void SetTrackEtaWindow(Float_t f){fTrackEtaWindow = f;}
dbf053f0 58 virtual void SetTrackTypeGen(Int_t i){fTrackTypeGen = i;}
59 virtual void SetTrackTypeRec(Int_t i){fTrackTypeRec = i;}
54424110 60 virtual void SetTrackPtCut(Float_t x){fTrackPtCut = x;}
aae7993b 61 virtual void SetCentralityCut(Float_t xLo,Float_t xUp){fCentCutLo = xLo; fCentCutUp = xUp;}
b2c1e955 62 virtual void SetFilterMask(UInt_t i,Int_t iType = 0){fFilterMask = i;
63 fFilterType = iType;}
2d8b837d 64 virtual void SetFilterMaskBestPt(UInt_t i){fFilterMaskBestPt = i;}
65
bea24d2d 66 virtual void SetJetTypes(UInt_t i){fJetTypes = i;}
0341d0d8 67 virtual void SetJetTriggerPtCut(Float_t x){fJetTriggerPtCut = x;}
ca6d12f9 68 virtual void SetVtxCuts(Float_t z,Float_t r = 1){fVtxZCut = z; fVtxR2Cut = r *r;}
b5b166c5 69 virtual void SetBackgroundBranch(const char* c){fBackgroundBranch = c;}
70 virtual const char* GetBackgroundBranch(){return fBackgroundBranch.Data();}
bd80a748 71 virtual void SetNSkipLeadingRan(Int_t x){fNSkipLeadingRan = x;}
af399bc2 72 virtual void SetNSkipLeadingCone(Int_t x){fNSkipLeadingCone = x;}
d7ca0e14 73 virtual void SetNRandomCones(Int_t x){fNRandomCones = x;}
bd80a748 74
54424110 75 virtual void SetJetOutputBranch(const char *c){fNonStdBranch = c;}
b5b166c5 76 virtual const char* GetJetOutputBranch(){return fNonStdBranch.Data();}
54424110 77 virtual void SetJetOutputFile(const char *c){fNonStdFile = c;}
b5b166c5 78 virtual const char* GetJetOutputFile(){return fNonStdFile.Data();}
65c43de8 79 virtual void SetMaxTrackPtInJet(Float_t x){fMaxTrackPtInJet = x;}
54424110 80 virtual void SetJetOutputMinPt(Float_t x){fJetOutputMinPt = x;}
21ead515 81 virtual void SetBackgroundCalc(Bool_t b){fUseBackgroundCalc = b;}
7bedcd31 82 virtual void SetStoreRhoLeadingTrackCorr(Bool_t b) {fStoreRhoLeadingTrackCorr=b;}
54424110 83
006b2a30 84 //Setters for detector level effects
fa7c34ba 85 virtual void SetUseTrResolutionFromOADB(Bool_t b=kTRUE, TString path="$ALICE_ROOT/OADB/PWGJE/Resolution/PtResol_LHCh_Cent0-10_v1.root") {fUseTrPtResolutionFromOADB = b; fPathTrPtResolution=path;}
86 virtual void SetUseTrEfficiencyFromOADB(Bool_t b=kTRUE, TString path="$ALICE_ROOT/OADB/PWGJE/Efficiency/Efficiency_LHC11a2aj_Cent0_v1.root") {fUseTrEfficiencyFromOADB = b; fPathTrEfficiency=path;}
87 virtual void LoadTrEfficiencyRootFileFromOADB();
88 virtual void LoadTrPtResolutionRootFileFromOADB();
89 virtual void SetChangeEfficiencyFraction(Double_t p) {fChangeEfficiencyFraction = p;}
90 virtual void SetSmearResolution(Bool_t b){fUseTrPtResolutionSmearing = b;}
006b2a30 91 virtual void SetDiceEfficiency(Bool_t b){fUseDiceEfficiency = b;}
4bd66a92 92 virtual void SetDiceEfficiencyMinPt(Double_t pt) {fDiceEfficiencyMinPt = pt;}
006b2a30 93 virtual void SetMomentumResolutionHybrid(TProfile *p1, TProfile *p2, TProfile *p3);
94 virtual void SetEfficiencyHybrid(TH1 *h1, TH1 *h2, TH1 *h3);
da8f7918 95 virtual void SetFixedEfficiency(Double_t eff) {fEfficiencyFixed = eff;}
9dcbfbd8 96 virtual void SetRequireT0vtx(Bool_t b = true){fRequireTZEROvtx = b;}
97 virtual void SetRequireV0AC(Bool_t b = true){fRequireVZEROAC = b;}
006b2a30 98
99 Double_t GetMomentumSmearing(Int_t cat, Double_t pt);
100 void FitMomentumResolution();
65c43de8 101
102
dbf053f0 103 // for Fast Jet
104 fastjet::JetAlgorithm GetAlgorithm() const {return fAlgorithm;}
105 fastjet::Strategy GetStrategy() const {return fStrategy;}
106 fastjet::RecombinationScheme GetRecombScheme() const {return fRecombScheme;}
107 fastjet::AreaType GetAreaType() const {return fAreaType;}
108 // Setters
109 void SetRparam(Double_t f) {fRparam = f;}
110 void SetAlgorithm(fastjet::JetAlgorithm f) {fAlgorithm = f;}
111 void SetStrategy(fastjet::Strategy f) {fStrategy = f;}
112 void SetRecombScheme(fastjet::RecombinationScheme f) {fRecombScheme = f;}
113 void SetAreaType(fastjet::AreaType f) {fAreaType = f;}
d6e66a82 114 void SetGhostArea(Double_t f) {fGhostArea = f;}
115 void SetActiveAreaRepeats(Int_t f) {fActiveAreaRepeats = f;}
116 void SetGhostEtamax(Double_t f) {fGhostEtamax = f;}
117
118
dbf053f0 119
120 // Helper
121 //
122
123 // we have different cases
124 // AOD reading -> MC from AOD
125 // ESD reading -> MC from Kinematics
126 // this has to match with our selection of input events
f840d64c 127 enum {kTrackUndef = 0, kTrackAOD, kTrackKineAll,kTrackKineCharged, kTrackAODMCAll, kTrackAODMCCharged, kTrackAODMCChargedAcceptance, kTrackAODextra, kTrackAODextraonly};
dbf053f0 128 enum {kMaxJets = 4};
129 enum {kMaxCorrelation = 3};
130 enum {kMaxRadius = 5};
aae7993b 131 enum {kMaxCent = 4};
bea24d2d 132 enum {kJet = 1<<0,
133 kJetRan = 1<<1,
134 kRC = 1<<2,
135 kRCRan = 1<<3
136 };
dbf053f0 137
138
139 private:
140
141 AliAnalysisTaskJetCluster(const AliAnalysisTaskJetCluster&);
142 AliAnalysisTaskJetCluster& operator=(const AliAnalysisTaskJetCluster&);
143
144 Int_t GetListOfTracks(TList *list,Int_t type);
145
54424110 146 AliAODEvent *fAOD; // ! where we take the jets from can be input or output AOD
147 AliAODExtension *fAODExtension; // ! AOD extension in case we write a non-sdt branch to a separate file and the aod is standard
148 TRefArray *fRef; // ! trefarray for track references within the jet
dbf053f0 149 Bool_t fUseAODTrackInput; // take track from input AOD not from ouptu AOD
150 Bool_t fUseAODMCInput; // take MC from input AOD not from ouptu AOD
21ead515 151 Bool_t fUseBackgroundCalc; // switches on background calculations
ca6d12f9 152 Bool_t fEventSelection; // use the event selection of this task, otherwise analyse all
d66558be 153 Bool_t fRequireVZEROAC; // switch to require V0 AC
154 Bool_t fRequireTZEROvtx; // switch to require T0 vtx
54424110 155 UInt_t fFilterMask; // filter bit for slecected tracks
b01d3ab7 156 UInt_t fFilterMaskBestPt; // filter bit to mark jets with high quality leading tracks
d7396b04 157
b2c1e955 158 UInt_t fFilterType; // filter type 0 = all, 1 = ITSTPC, 2 = TPC
006b2a30 159 UInt_t fJetTypes; // 1<<0 regular jets, 1<<1 << randomized event 1<<2 random cones 1<<3 random cones randomiuzed event
dbf053f0 160 Int_t fTrackTypeRec; // type of tracks used for FF
161 Int_t fTrackTypeGen; // type of tracks used for FF
af399bc2 162 Int_t fNSkipLeadingRan; // number of leading tracks to be skipped in the randomized event
163 Int_t fNSkipLeadingCone; // number of leading jets to be for the random cones
d7ca0e14 164 Int_t fNRandomCones; // number of generated random cones
dbf053f0 165 Float_t fAvgTrials; // Average nimber of trials
166 Float_t fExternalWeight; // external weight
ca6d12f9 167 Float_t fTrackEtaWindow; // eta window used for corraltion plots between rec and gen
dbf053f0 168 Float_t fRecEtaWindow; // eta window used for corraltion plots between rec and gen
54424110 169 Float_t fTrackPtCut; // minimum track pt to be accepted
170 Float_t fJetOutputMinPt; // minimum p_t for jets to be written out
65c43de8 171 Float_t fMaxTrackPtInJet; // maximum track pt within a jet for flagging...
0341d0d8 172 Float_t fJetTriggerPtCut; // minimum jwt pT for AOD to be written
ca6d12f9 173 Float_t fVtxZCut; // zvtx cut
174 Float_t fVtxR2Cut; // R vtx cut (squared)
aae7993b 175 Float_t fCentCutUp; // upper limit on centrality
176 Float_t fCentCutLo; // lower limit on centrality
7bedcd31 177
178 Bool_t fStoreRhoLeadingTrackCorr; //store histos with rho correlation to leading track in event
179
54424110 180 // output configurartion
181 TString fNonStdBranch; // the name of the non-std branch name, if empty no branch is filled
0341d0d8 182 TString fBackgroundBranch; // name of the branch used for background subtraction
006b2a30 183 TString fNonStdFile; // The optional name of the output file the non-std branch is written to
184
185 //Detector level effects
186 TProfile *fMomResH1; // Momentum resolution from TrackQA Hybrid Category 1
187 TProfile *fMomResH2; // Momentum resolution from TrackQA Hybrid Category 2
188 TProfile *fMomResH3; // Momentum resolution from TrackQA Hybrid Category 3
575dee18 189 TF1 *fMomResH1Fit; //fit
190 TF1 *fMomResH2Fit; //fit
191 TF1 *fMomResH3Fit; //fit
006b2a30 192
193 TH1 *fhEffH1; // Efficiency for Spectra Hybrid Category 1
194 TH1 *fhEffH2; // Efficiency for Spectra Hybrid Category 2
195 TH1 *fhEffH3; // Efficiency for Spectra Hybrid Category 3
fa7c34ba 196 Bool_t fUseTrPtResolutionSmearing; // Apply momentum smearing on track level
197 Bool_t fUseDiceEfficiency; // Apply efficiency on track level by dicing
4bd66a92 198 Double_t fDiceEfficiencyMinPt; // Only do efficiency dicing for tracks above this pt
fa7c34ba 199 Bool_t fUseTrPtResolutionFromOADB; // Load track pt resolution root file from OADB path
200 Bool_t fUseTrEfficiencyFromOADB; // Load tracking efficiency root file from OADB path
201 TString fPathTrPtResolution; // OADB path to root file
202 TString fPathTrEfficiency; // OADB path to root file
da8f7918 203 Double_t fChangeEfficiencyFraction; // change efficiency by fraction
204 Double_t fEfficiencyFixed; // fixed efficiency for all pT and all types of tracks
fa7c34ba 205
54424110 206
dbf053f0 207 // Fast jet
f0659f11 208 Double_t fRparam; // fastjet distance parameter
dbf053f0 209 fastjet::JetAlgorithm fAlgorithm; //fastjet::kt_algorithm
210 fastjet::Strategy fStrategy; //= fastjet::Best;
211 fastjet::RecombinationScheme fRecombScheme; // = fastjet::BIpt_scheme;
f0659f11 212 fastjet::AreaType fAreaType; // fastjet area type
213 Double_t fGhostArea; // fasjet ghost area
214 Int_t fActiveAreaRepeats; // fast jet active area repeats
215 Double_t fGhostEtamax; // fast jet ghost area
8f85b773 216
006b2a30 217 TClonesArray *fTCAJetsOut; //! TCA of output jets
218 TClonesArray *fTCAJetsOutRan; //! TCA of output jets in randomized event
219 TClonesArray *fTCARandomConesOut; //! TCA of output jets in randomized event
8f85b773 220 TClonesArray *fTCARandomConesOutRan; //! TCA of output jets in randomized event
221 AliAODJetEventBackground *fAODJetBackgroundOut; //! jet background to be written out
222
d7ca0e14 223 TRandom3* fRandom; //! random number generator
d6e66a82 224 TProfile* fh1Xsec; //! pythia cross section and trials
225 TH1F* fh1Trials; //! trials are added
226 TH1F* fh1PtHard; //! Pt har of the event...
227 TH1F* fh1PtHardNoW; //! Pt har of the event without weigt
228 TH1F* fh1PtHardTrials; //! Number of trials
229
230 TH1F* fh1NJetsRec; //! number of reconstructed jets
231 TH1F* fh1NConstRec;//! number of constiutens in leading jet
232 TH1F* fh1NConstLeadingRec;//! number of constiutens in leading jet
233 TH1F* fh1PtJetsRecIn; //! Jet pt for all jets
234 TH1F* fh1PtJetsLeadingRecIn; //! Jet pt for all jets
235 TH1F* fh1PtJetConstRec;//! pt of constituents
dbf053f0 236 TH1F* fh1PtJetConstLeadingRec;// pt of constituents
d6e66a82 237 TH1F* fh1PtTracksRecIn; //! track pt for all tracks
238 TH1F* fh1PtTracksLeadingRecIn; //! track pt for all tracks
dbf053f0 239
240 // Randomized track histos
d6e66a82 241 TH1F* fh1NJetsRecRan; //! number of reconstructed jets from randomized
242 TH1F* fh1NConstRecRan;//! number of constiutens in leading jet
243 TH1F* fh1PtJetsLeadingRecInRan; //! Jet pt for all jets
244 TH1F* fh1NConstLeadingRecRan;//! number of constiutens in leading jet
245 TH1F* fh1PtJetsRecInRan; //! Jet pt for all jets
246
247 TH1F* fh1PtTracksGenIn; //! track pt for all tracks
248 TH1F* fh1Nch; //! charged particle mult
82a35b1a 249 TH1F* fh1BiARandomCones[3]; //! Residual distribtion from reandom cones on real event
250 TH1F* fh1BiARandomConesRan[3]; //! Residual distribtion from reandom cones on random event
aae7993b 251 TH1F* fh1CentralityPhySel; // ! centrality of anaylsed events
e2ca7519 252 TH1F* fh1Centrality; // ! centrality of anaylsed events
aae7993b 253 TH1F* fh1CentralitySelect; // ! centrality of selected events
e2ca7519 254 TH1F* fh1ZPhySel; // ! centrality of anaylsed events
255 TH1F* fh1Z; // ! centrality of anaylsed events
256 TH1F* fh1ZSelect; // ! centrality of selected events
257
d6e66a82 258
259 TH2F* fh2NRecJetsPt; //! Number of found jets above threshold
260 TH2F* fh2NRecTracksPt; //! Number of found tracks above threshold
261 TH2F* fh2NConstPt; //! number of constituents vs. pt
262 TH2F* fh2NConstLeadingPt; //! number of constituents vs. pt
263 TH2F* fh2JetPhiEta; //! jet phi eta
264 TH2F* fh2LeadingJetPhiEta; //! leading jet phi eta
265 TH2F* fh2JetEtaPt; //! leading jet eta
266 TH2F* fh2LeadingJetEtaPt; //! leading jet eta
267 TH2F* fh2TrackEtaPt; //! track eta
268 TH2F* fh2LeadingTrackEtaPt; //! leading track eta
269 TH2F* fh2JetsLeadingPhiEta; //! jet phi eta
270 TH2F* fh2JetsLeadingPhiPt; //! jet correlation with leading jet
271 TH2F* fh2TracksLeadingPhiEta; //! track correlation with leading track
272 TH2F* fh2TracksLeadingPhiPt; //! track correlation with leading track
273 TH2F* fh2TracksLeadingJetPhiPt; //! track correlation with leading Jet
274 TH2F* fh2JetsLeadingPhiPtW; //! jet correlation with leading jet
275 TH2F* fh2TracksLeadingPhiPtW; //! track correlation with leading track
276 TH2F* fh2TracksLeadingJetPhiPtW; //! track correlation with leading Jet
277 TH2F* fh2NRecJetsPtRan; //! Number of found jets above threshold
278 TH2F* fh2NConstPtRan; //! number of constituents vs. pt
279 TH2F* fh2NConstLeadingPtRan; //! number of constituents vs. pt
280 TH2F* fh2PtNch; //! p_T of cluster vs. multiplicity,
281 TH2F* fh2PtNchRan; //! p_T of cluster vs. multiplicity,random
282 TH2F* fh2PtNchN; //! p_T of cluster vs. multiplicity, weigthed with constituents
283 TH2F* fh2PtNchNRan; //! p_T of cluster vs. multiplicity, weigthed with constituents random
284 TH2F* fh2TracksLeadingJetPhiPtRan; //! track correlation with leading Jet
285 TH2F* fh2TracksLeadingJetPhiPtWRan; //! track correlation with leading Jet
82a35b1a 286
aae7993b 287
288 TH2F* fh2JetsLeadingPhiPtC[kMaxCent]; //! jet correlation with leading jet
289 TH2F* fh2JetsLeadingPhiPtWC[kMaxCent]; //! jet correlation with leading jet
290 TH2F* fh2TracksLeadingJetPhiPtC[kMaxCent]; //! track correlation with leading Jet
291 TH2F* fh2TracksLeadingJetPhiPtWC[kMaxCent]; //! track correlation with leading Jet
292
cbfccad4 293 TH3F* fh3CentvsRhoLeadingTrackPt; //! centrality vs background density full event
294 TH3F* fh3CentvsSigmaLeadingTrackPt; //! centrality vs sigma full event
295 TH3F* fh3MultvsRhoLeadingTrackPt; //! multiplicity vs background density full event
296 TH3F* fh3MultvsSigmaLeadingTrackPt; //! multiplicity vs sigma full event
7bedcd31 297
298 TH3F* fh3CentvsRhoLeadingTrackPtQ1; //! centrality vs background density vs pt leading track near side
299 TH3F* fh3CentvsRhoLeadingTrackPtQ2; //! centrality vs background density vs pt leading track perpendicular (+0.5*\pi)
300 TH3F* fh3CentvsRhoLeadingTrackPtQ3; //! centrality vs background density vs pt leading track away side
301 TH3F* fh3CentvsRhoLeadingTrackPtQ4; //! centrality vs background density vs pt leading track perpendicular (-0.5*\pi)
302
303 TH3F* fh3CentvsSigmaLeadingTrackPtQ1; //! centrality vs sigma vs pt leading track near side
304 TH3F* fh3CentvsSigmaLeadingTrackPtQ2; //! centrality vs sigma vs pt leading track perpendicular (+0.5*\pi)
305 TH3F* fh3CentvsSigmaLeadingTrackPtQ3; //! centrality vs sigma vs pt leading track away side
306 TH3F* fh3CentvsSigmaLeadingTrackPtQ4; //! centrality vs sigma vs pt leading track perpendicular (-0.5*\pi)
307
308 TH3F* fh3MultvsRhoLeadingTrackPtQ1; //! multiplicity vs background density vs pt leading track near side
309 TH3F* fh3MultvsRhoLeadingTrackPtQ2; //! multiplicity vs background density vs pt leading track perpendicular (+0.5*\pi)
310 TH3F* fh3MultvsRhoLeadingTrackPtQ3; //! multiplicity vs background density vs pt leading track away side
311 TH3F* fh3MultvsRhoLeadingTrackPtQ4; //! multiplicity vs background density vs pt leading track perpendicular (-0.5*\pi)
312
313 TH3F* fh3MultvsSigmaLeadingTrackPtQ1; //! multiplicity vs sigma vs pt leading track near side
314 TH3F* fh3MultvsSigmaLeadingTrackPtQ2; //! multiplicity vs sigma vs pt leading track perpendicular (+0.5*\pi)
315 TH3F* fh3MultvsSigmaLeadingTrackPtQ3; //! multiplicity vs sigma vs pt leading track away side
316 TH3F* fh3MultvsSigmaLeadingTrackPtQ4; //! multiplicity vs sigma vs pt leading track perpendicular (-0.5*\pi)
c0fdfe53 317
cbfccad4 318 TH3F* fh3CentvsDeltaRhoLeadingTrackPtQ1; //! centrality vs delta background density vs pt leading track near side
319 TH3F* fh3CentvsDeltaRhoLeadingTrackPtQ2; //! centrality vs delta background density vs pt leading track perpendicular (+0.5*\pi)
320 TH3F* fh3CentvsDeltaRhoLeadingTrackPtQ3; //! centrality vs delta background density vs pt leading track away side
321 TH3F* fh3CentvsDeltaRhoLeadingTrackPtQ4; //! centrality vs delta background density vs pt leading track perpendicular (-0.5*\pi)
322
006b2a30 323 //Histos for detector level effects from toy model
324 TH2F *fh2PtGenPtSmeared; //! Control histo smeared momentum
325 TProfile *fp1Efficiency; //! Control profile efficiency
326 TProfile *fp1PtResolution; //! Control profile for pT resolution
327
d7ca0e14 328 TList *fHistList; //!leading tracks to be skipped in the randomized event Output list
dbf053f0 329
330
d66558be 331 ClassDef(AliAnalysisTaskJetCluster, 22)
dbf053f0 332};
333
334#endif