speedup of cluster decoding by ~60%: more efficient access to data stream and avoidin...
[u/mrichter/AliRoot.git] / PWGJE / AliAnalysisTaskJetCore.h
CommitLineData
75bf77e3 1#ifndef ALIANALYSISTASKJETCORE_H
2#define ALIANALYSISTASKJETCORE_H
3
568f8fa2 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7// **************************************
8// This task computes several jet observables like
9// the fraction of energy in inner and outer coronnas,
10// the distance from track to jet axis and a
11// correlation strength distribution of particles inside jets.
12// Author: lcunquei@cern.ch
13// *******************************************
14
75bf77e3 15class TH1F;
8c483a6b 16class TH1I;
75bf77e3 17class TH2F;
18class TH3F;
19class THnSparse;
20class AliESDEvent;
ea693273 21class AliAODExtension;
75bf77e3 22class AliAODEvent;
23
24#include "AliAnalysisTaskSE.h"
25#include "AliVEvent.h"
26
27class AliAnalysisTaskJetCore : public AliAnalysisTaskSE {
28public:
29 AliAnalysisTaskJetCore();
30 AliAnalysisTaskJetCore(const char *name);
31 virtual ~AliAnalysisTaskJetCore();
75bf77e3 32 virtual void LocalInit() {Init();}
33 virtual void Init();
34 virtual void UserCreateOutputObjects();
35 virtual void UserExec(Option_t *option);
36 virtual void Terminate(const Option_t*);
37
38 virtual Int_t GetNInputTracks();
4f6d1cc1 39 // Rongrong
40 virtual void SetRunAzimuthalCorrelation(Bool_t run) {fRunAnaAzimuthalCorrelation=run;}
ea693273 41 Double_t RelativePhi(Double_t angle1,Double_t angle2);
d5e7475c 42 Int_t GetPhiBin(Double_t phi);
43 virtual THnSparse* NewTHnSparseF(const char* name, UInt_t entries);
da93bb11 44 virtual void GetDimParams(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
75bf77e3 45 virtual AliVEvent::EOfflineTriggerTypes GetOfflineTrgMask() const { return fOfflineTrgMask; }
46 virtual void GetBranchNames(TString &branch1, TString &branch2) const { branch1 = fJetBranchName[0]; branch2 = fJetBranchName[1]; }
47 virtual Bool_t GetIsPbPb() const { return fIsPbPb; }
48 virtual Int_t GetMinContribVtx() const { return fMinContribVtx; };
49 virtual Float_t GetVtxZMin() const { return fVtxZMin; }
50 virtual Float_t GetVtxZMax() const { return fVtxZMax; }
51 virtual Int_t GetEvtClassMin() const { return fEvtClassMin; }
52 virtual Int_t GetEvtClassMax() const { return fEvtClassMax; }
53 virtual Float_t GetCentMin() const { return fCentMin; }
54 virtual Float_t GetCentMax() const { return fCentMax; }
55 virtual Int_t GetNInputTracksMin() const { return fNInputTracksMin; }
56 virtual Int_t GetNInputTracksMax() const { return fNInputTracksMax; }
57 virtual Float_t GetJetEtaMin() const { return fJetEtaMin; }
58 virtual Float_t GetJetEtaMax() const { return fJetEtaMax; }
59 virtual Float_t GetJetPtMin() const { return fJetPtMin; }
60 virtual Float_t GetJetPtFractionMin() const { return fJetPtFractionMin; }
61 virtual Int_t GetNMatchJets() const { return fNMatchJets; }
62 virtual void SetBranchNames(const TString &branch1, const TString &branch2);
63 virtual void SetBackgroundBranch(TString &branch) { fBackgroundBranch = branch;}
64 virtual void SetIsPbPb(Bool_t b=kTRUE) { fIsPbPb = b; }
65 virtual void SetOfflineTrgMask(AliVEvent::EOfflineTriggerTypes mask) { fOfflineTrgMask = mask; }
66 virtual void SetMinContribVtx(Int_t n) { fMinContribVtx = n; }
67 virtual void SetVtxZMin(Float_t z) { fVtxZMin = z; }
68 virtual void SetVtxZMax(Float_t z) { fVtxZMax = z; }
69 virtual void SetEvtClassMin(Int_t evtClass) { fEvtClassMin = evtClass; }
70 virtual void SetEvtClassMax(Int_t evtClass) { fEvtClassMax = evtClass; }
8b47ec90 71 virtual void SetFilterMask(UInt_t i){fFilterMask = i;}
873306cf 72 virtual void SetFilterMaskBestPt(UInt_t i){fFilterMaskBestPt = i;}
ae73f4c9 73 virtual void SetFilterType(Int_t iType){fFilterType=iType;}
ea693273 74 virtual void SetRadioFrac(Float_t radiofrac) { fRadioFrac = radiofrac; }
75 virtual void SetMinDist(Float_t minDist) { fMinDist = minDist; }
75bf77e3 76 virtual void SetCentMin(Float_t cent) { fCentMin = cent; }
77 virtual void SetCentMax(Float_t cent) { fCentMax = cent; }
78 virtual void SetNInputTracksMin(Int_t nTr) { fNInputTracksMin = nTr; }
79 virtual void SetNInputTracksMax(Int_t nTr) { fNInputTracksMax = nTr; }
ea693273 80 virtual void SetAngStructCloseTracks(Int_t yesno){fAngStructCloseTracks=yesno;}
da93bb11 81 virtual void SetCheckMethods(Int_t yesno){fCheckMethods=yesno;}
529e2916 82 virtual void SetEventMixing(Int_t yesno){fDoEventMixing=yesno;}
447d2a5b 83 virtual void SetFlagPhiBkg(Int_t yesno){fFlagPhiBkg=yesno;}
ca1009f1 84 virtual void SetFlagEtaBkg(Int_t yesno){fFlagEtaBkg=yesno;}
16a4c8e8 85 virtual void SetFlagJetHadron(Int_t yesno){fFlagJetHadron=yesno;}
d5e7475c 86 virtual void SetFlagRandom(Int_t yesno){fFlagRandom=yesno;}
85b5b73e 87 virtual void SetFlagOnlyRecoil(Int_t yesno){fFlagOnlyRecoil=yesno;}
e22029ea 88 virtual void SetFlagOnlyHardest(Int_t yesno){fFlagOnlyHardest=yesno;}
85b5b73e 89 virtual void SetNRPBins(Int_t bins){fNRPBins=bins;}
90 virtual void SetTrackTypeRec(Int_t i){fTrackTypeRec = i;}
75bf77e3 91 virtual void SetJetEtaMin(Float_t eta) { fJetEtaMin = eta; }
92 virtual void SetJetEtaMax(Float_t eta) { fJetEtaMax = eta; }
93 virtual void SetJetPtMin(Float_t pt) { fJetPtMin = pt; }
94 virtual void SetJetTriggerExclude(UChar_t i) { fJetTriggerExcludeMask = i; }
95 virtual void SetJetPtFractionMin(Float_t frac) { fJetPtFractionMin = frac; }
96 virtual void SetNMatchJets(Int_t n) { fNMatchJets = n; }
97 virtual void SetFillEvent(Bool_t b) { fbEvent = b; }
98 virtual void SetKeepJets(Bool_t b = kTRUE) { fKeepJets = b; }
529e2916 99 virtual void SetNonStdFile(char* c){fNonStdFile = c;}
85b5b73e 100 enum {kTrackUndef = 0, kTrackAOD, kTrackKineAll,kTrackKineCharged, kTrackAODMCAll, kTrackAODMCCharged, kTrackAODMCChargedAcceptance};
75bf77e3 101
102private:
103 // ESD/AOD events
104 AliESDEvent *fESD; //! ESD object
5bd732d4 105 AliAODEvent *fAODIn; //! AOD event for AOD input tracks
106 AliAODEvent *fAODOut; //! AOD event
ea693273 107 AliAODExtension *fAODExtension; //! where we take the jets from can be input or output AOD
85b5b73e 108 Int_t GetListOfTracks(TList *list);
da93bb11 109 Int_t GetHardestTrackBackToJet(AliAODJet *jet);
ea693273 110 Int_t GetListOfTracksCloseToJet(TList *list,AliAODJet *jet);
75bf77e3 111 // jets to compare
112 TString fJetBranchName[2]; // name of jet branches to compare
113 TList *fListJets[2]; //! jet lists
114
115 TString fBackgroundBranch;
ea693273 116 TString fNonStdFile; // name of delta aod file to catch the extension
75bf77e3 117 // event selection
118 Bool_t fIsPbPb; // is Pb-Pb (fast embedding) or p-p (detector response)
119 AliVEvent::EOfflineTriggerTypes fOfflineTrgMask; // mask of offline triggers to accept
120 Int_t fMinContribVtx; // minimum number of track contributors for primary vertex
121 Float_t fVtxZMin; // lower bound on vertex z
122 Float_t fVtxZMax; // upper bound on vertex z
123 Int_t fEvtClassMin; // lower bound on event class
124 Int_t fEvtClassMax; // upper bound on event class
8b47ec90 125 UInt_t fFilterMask; // filter bit for slecected tracks
873306cf 126 UInt_t fFilterMaskBestPt; // filter bit for selected hig pt tracks (best quality)
127 UInt_t fFilterType; // type of slected tracks parrallel to filtermask
ea693273 128 Float_t fRadioFrac; //!size of the concentric cone
129 Float_t fMinDist;
75bf77e3 130 Float_t fCentMin; // lower bound on centrality
131 Float_t fCentMax; // upper bound on centrality
132 Int_t fNInputTracksMin; // lower bound of nb. of input tracks
133 Int_t fNInputTracksMax; // upper bound of nb. of input tracks
ea693273 134 Int_t fAngStructCloseTracks;//only constituents or all tracks with R<0.8 for the angular structure
529e2916 135 Int_t fCheckMethods; //to look into more detail into the core
136 Int_t fDoEventMixing;
447d2a5b 137 Int_t fFlagPhiBkg;
ca1009f1 138 Int_t fFlagEtaBkg;
16a4c8e8 139 Int_t fFlagJetHadron;
d5e7475c 140 Int_t fFlagRandom;
ae1e07c1 141 Int_t fFlagOnlyRecoil;
e22029ea 142 Int_t fFlagOnlyHardest;
85b5b73e 143 Int_t fTrackTypeRec;
d5e7475c 144 Int_t fRPAngle;
145 Int_t fNRPBins;
529e2916 146 Float_t fJetEtaMin; // lower bound on eta for found jets
147 Float_t fJetEtaMax; // upper bound on eta for found jets
148 Int_t fNevents; // number of events
149 Int_t fTindex; // index reference
150 Int_t fTrigBufferIndex; //index for the buffering
447d2a5b 151 Int_t fCountAgain; //index for the buffering
529e2916 152 Float_t fJetPtMin; // minimum jet pT
75bf77e3 153 UChar_t fJetTriggerExcludeMask; // mask for jet triggeres to exclude
154 Float_t fJetPtFractionMin; // minimum fraction for positiv match of jets
155 Int_t fNMatchJets; // maximal nb. of jets taken for matching
156 Double_t fMatchMaxDist; // maximal distance of matching jets
157 Bool_t fKeepJets; // keep jets with negative pt after background subtraction
4f6d1cc1 158 Bool_t fRunAnaAzimuthalCorrelation; // Flag to run azimuthal correlation between trigger track and recoil jets (Rongrong)
75bf77e3 159
160 // output objects
161 const Int_t fkNbranches; //! number of branches to be read
162 const Int_t fkEvtClasses; //! number of event classes
163
164 TList *fOutputList; //! output data container
165 Bool_t fbEvent; // fill fhnEvent
166 TH1I *fHistEvtSelection; //! event selection statistic
da93bb11 167 THnSparse *fhnDeltaR; //! variables per jet
529e2916 168 THnSparse *fhnMixedEvents; //!mixed events matrix
169
ea693273 170
568f8fa2 171 TH2F *fh2JetCoreMethod1C10; //Energy fraction in the core C10 method 1
172 TH2F *fh2JetCoreMethod2C10; //Energy fraction in the core C10 method 2
568f8fa2 173 TH2F *fh2JetCoreMethod1C20; //Energy fraction in the core C20 method 1
174 TH2F *fh2JetCoreMethod2C20; //Energy fraction in the core C20 method 2
568f8fa2 175 TH2F *fh2JetCoreMethod1C30; //Energy fraction in the core C30 method 1
176 TH2F *fh2JetCoreMethod2C30; //Energy fraction in the core C30 method 2
568f8fa2 177 TH2F *fh2JetCoreMethod1C60; //Energy fraction in the core C60 method 1
178 TH2F *fh2JetCoreMethod2C60; //Energy fraction in the core C60 method 2
d5e7475c 179 TH3F* fh3JetTrackC3060; //C3060 pt2
180 TH3F* fh3JetTrackC20; //C10 pt2
4e90d948 181 TH2F* fh2AngStructpt1C10; //Average
568f8fa2 182 TH2F* fh2AngStructpt2C10; //C10 pt2
183 TH2F* fh2AngStructpt3C10; //C10 pt3
184 TH2F* fh2AngStructpt4C10; //C10 pt4
185 TH2F* fh2AngStructpt1C20; //C20 pt1
186 TH2F* fh2AngStructpt2C20; //C20 pt2
187 TH2F* fh2AngStructpt3C20; //C20 pt3
188 TH2F* fh2AngStructpt4C20; //C20 pt4
189 TH2F* fh2AngStructpt1C30; //C30 pt1
190 TH2F* fh2AngStructpt2C30; //C30 pt2
191 TH2F* fh2AngStructpt3C30; //C30 pt3
192 TH2F* fh2AngStructpt4C30; //C30 pt4
193 TH2F* fh2AngStructpt1C60; //C60 pt1
194 TH2F* fh2AngStructpt2C60; //C60 pt2
195 TH2F* fh2AngStructpt3C60; //C60 pt3
196 TH2F* fh2AngStructpt4C60; //C60 pt4
ba143e7f 197
16a4c8e8 198 TH2F* fh2Ntriggers; //triggers
d90d5d75 199 TH2F* fh2Ntriggers2C10; //centrality bias of triggers
200 TH2F* fh2Ntriggers2C20; //centrality bias of triggers
ae1e07c1 201 TH3F* fh3JetDensity; //jet density
202 TH3F* fh3JetDensityA4; //jet density
d90d5d75 203 TH2F* fh2RPJetsC10; //reaction plane Jets
204 TH2F* fh2RPJetsC20;
205 TH2F* fh2RPTC10; //reaction plane TT
206 TH2F* fh2RPTC20;
4f6d1cc1 207 THnSparse *fHJetSpec; //Recoil jet spectrum
d5e7475c 208
529e2916 209 Double_t fTrigBuffer[10][7]; //!buffer for triggers
4f6d1cc1 210 TH2F *fhTTPt; //! Trigger track pt for normalization (Rongrong)
211 THnSparse *fHJetPhiCorr; //! Azimuthal correlation between trigger track and recoil jets (Rongrong)
75bf77e3 212 AliAnalysisTaskJetCore(const AliAnalysisTaskJetCore&); // not implemented
213 AliAnalysisTaskJetCore& operator=(const AliAnalysisTaskJetCore&); // not implemented
214
e22029ea 215 ClassDef(AliAnalysisTaskJetCore, 6);
75bf77e3 216};
217
218#endif
219