]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIANALYSISTASKJETSPECTRUM2_H | |
2 | #define ALIANALYSISTASKJETSPECTRUM2_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 the correction of determiantion of reconstructed jet spectra | |
9 | // Compares input (gen) and output (rec) jets | |
10 | // ******************************************* | |
11 | ||
12 | #include "AliAnalysisTaskSE.h" | |
13 | #include "THnSparse.h" // cannot forward declare ThnSparseF | |
14 | ||
15 | //////////////// | |
16 | class AliJetHeader; | |
17 | class AliESDEvent; | |
18 | class AliAODEvent; | |
19 | class AliAODExtension; | |
20 | class AliAODJet; | |
21 | class AliVParticle; | |
22 | class AliAODJetEventBackground; | |
23 | class AliGenPythiaEventHeader; | |
24 | class AliCFManager; | |
25 | class AliCFContainer; | |
26 | class AliTHn; | |
27 | ||
28 | class TList; | |
29 | class TChain; | |
30 | class TH1F; | |
31 | class TH2F; | |
32 | class TH3F; | |
33 | class TRandom3; | |
34 | class TProfile; | |
35 | class TProfile2D; | |
36 | class TSTring; | |
37 | ||
38 | ||
39 | class AliAnalysisTaskJetSpectrum2 : public AliAnalysisTaskSE | |
40 | { | |
41 | public: | |
42 | AliAnalysisTaskJetSpectrum2(); | |
43 | AliAnalysisTaskJetSpectrum2(const char* name); | |
44 | virtual ~AliAnalysisTaskJetSpectrum2(); | |
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 | virtual void SetUseGlobalSelection(Bool_t b){fUseGlobalSelection = b;} | |
54 | virtual void SetEventClass(Int_t i){fEventClass = i;} | |
55 | virtual void SetExternalWeight(Float_t f){fExternalWeight = f;} | |
56 | virtual void SetUseExternalWeightOnly(Bool_t b){fUseExternalWeightOnly = b;} | |
57 | virtual void SetAODJetInput(Bool_t b){fUseAODJetInput = b;} | |
58 | virtual void SetAODTrackInput(Bool_t b){fUseAODTrackInput = b;} | |
59 | virtual void SetAODMCInput(Bool_t b){fUseAODMCInput = b;} | |
60 | virtual void SetLimitGenJetEta(Bool_t b){fLimitGenJetEta = b;} | |
61 | virtual void SetJetEtaWindow(Float_t f){fJetRecEtaWindow = f;} | |
62 | virtual void SetTrackEtaWindow(Float_t f){fTrackRecEtaWindow = f;} | |
63 | virtual void SetNMatchJets(Short_t f){fNMatchJets = f;} | |
64 | virtual void SetMinJetPt(Float_t f){fMinJetPt = f;} | |
65 | virtual void SetNRPBins(Short_t i){fNRPBins = i;} | |
66 | virtual void SetTRP(Int_t i){fTRP=i;} | |
67 | virtual void SetDebug(Int_t i){fDebug=i;} | |
68 | virtual void SetNMultBins(Short_t i) {fNBinsMult=i;} | |
69 | virtual void SetNPtLeadingBins(Short_t i) {fNBinsLeadingTrackPt=i;} | |
70 | virtual void SetFlagJetType(Int_t iType,Int_t iF){fFlagJetType[iType] = iF;} | |
71 | virtual void SetMinTrackPt(Float_t f){fMinTrackPt = f;} | |
72 | virtual void SetDeltaPhiWindow(Float_t f){fDeltaPhiWindow = f;} | |
73 | virtual void SetAnalysisType(Int_t i){fAnalysisType = i;} | |
74 | virtual void SetBranchGen(const char* c){fBranchGen = c;} | |
75 | virtual void SetBranchRec(const char* c){fBranchRec = c;} | |
76 | virtual void SetBranchBkgRec(const char* c){fBranchBkgRec = c;} | |
77 | virtual void SetBranchBkgGen(const char* c){fBranchBkgGen = c;} | |
78 | virtual void SetTrackTypeGen(Int_t i){fTrackTypeGen = i;} | |
79 | virtual void SetTrackTypeRec(Int_t i){fTrackTypeRec = i;} | |
80 | virtual void SetFilterMask(UInt_t i){fFilterMask = i;} | |
81 | virtual void SetJetTriggerExclude(UInt_t i){fJetTriggerExcludeMask = i;} | |
82 | virtual void SetJetTriggerBest(UInt_t i){fJetTriggerBestMask = i;} | |
83 | virtual void SetMatching(Bool_t b = kTRUE){fDoMatching = b;} | |
84 | virtual void SetRPMethod(Int_t i){fRPMethod = i;} | |
85 | virtual void SetEventSelectionMask(UInt_t i){fEventSelectionMask = i;} | |
86 | ||
87 | virtual void SetNonStdFile(char* c){fNonStdFile = c;} | |
88 | ||
89 | virtual void SetNTrigger(Int_t n); | |
90 | virtual void SetTrigger(Int_t i,UInt_t it,const char* c = ""); | |
91 | ||
92 | ||
93 | virtual void SetNAcceptance(Int_t n); | |
94 | virtual void SetAcceptance(Int_t i,Float_t phiMin,Float_t phiMax,Float_t etaMin,Float_t etaMax);// non overlapping regions | |
95 | virtual Int_t CheckAcceptance(Float_t phi,Float_t eta); | |
96 | // Helper | |
97 | // | |
98 | ||
99 | // we have different cases | |
100 | // AOD reading -> MC from AOD | |
101 | // ESD reading -> MC from Kinematics | |
102 | // this has to match with our selection of input events | |
103 | enum {kTrackUndef = 0, kTrackAOD, kTrackKineAll,kTrackKineCharged, kTrackAODMCAll, kTrackAODMCCharged, kTrackAODMCChargedAcceptance}; | |
104 | enum {kAnaMC = 0x1, kAnaMCESD = 0x2}; | |
105 | enum {kMaxJets = 2}; | |
106 | enum {kJetRec = 0, kJetGen, kJetRecFull, kJetGenFull, kJetTypes}; // | |
107 | enum {kMaxCorrelation = 3}; | |
108 | ||
109 | // | |
110 | // Stored as function of generated values | |
111 | // 0 all gen jets | |
112 | // 1 all gen jets in eta window | |
113 | // 2 all gen jets with rec partner | |
114 | // 3 all gen jets in eta window with rec partner | |
115 | // 4 all gen jets in eta window with rec partner in eta window | |
116 | // 5 all gen jets in eta window with rec partner in eta window with leading track on reconstructed level | |
117 | // 6 all rec jets in eta window with gen partner | |
118 | ||
119 | // Stored as function of reconstructed values: | |
120 | // 7 all rec jets in eta window | |
121 | ||
122 | ||
123 | enum {kStep0 = 0, kStep1, kStep2, kStep3, kStep4, kStep5, kStep6, kStep7,kMaxStep}; | |
124 | ||
125 | ||
126 | private: | |
127 | ||
128 | AliAnalysisTaskJetSpectrum2(const AliAnalysisTaskJetSpectrum2&); | |
129 | AliAnalysisTaskJetSpectrum2& operator=(const AliAnalysisTaskJetSpectrum2&); | |
130 | ||
131 | void MakeJetContainer(); | |
132 | Int_t GetListOfTracks(TList *list,Int_t type); | |
133 | void FillTrackHistos(TList &particlesList,int iType); | |
134 | Float_t GetRho(TList &list); | |
135 | Float_t GetCentrality(); | |
136 | Bool_t CalculateReactionPlaneAngle(const TList *trackList); | |
137 | Double_t RelativePhi(Double_t phi1,Double_t phi2); | |
138 | ||
139 | ||
140 | Int_t GetPhiBin(Double_t phi); | |
141 | Double_t GetPhiWeight(Double_t phi,Double_t signedpt); | |
142 | Int_t GetListOfJets(TList *list,TClonesArray* jarray,Int_t type); | |
143 | void FillJetHistos(TList &jetsList,TList &particlesList,Int_t iType); | |
144 | ||
145 | void FillMatchHistos(TList &recJetsList,TList &genJetsList); | |
146 | ||
147 | Bool_t JetSelected(AliAODJet *jet); | |
148 | Int_t MultFromJetRefs(TClonesArray *jets); | |
149 | AliVParticle *LeadingTrackFromJetRefs(AliAODJet* jet); | |
150 | AliVParticle *LeadingTrackInCone(AliAODJet* jet,TList *list,Float_t r = 0.4); | |
151 | ||
152 | ||
153 | AliJetHeader *fJetHeaderRec;//! The jet header that can be fetched from the userinfo | |
154 | AliJetHeader *fJetHeaderGen;//! The jet header that can fetched from the userinfo | |
155 | AliAODEvent *fAODIn; //! where we take the jets from | |
156 | AliAODEvent *fAODOut; //! where we take the jets from | |
157 | AliAODExtension *fAODExtension; //! where we take the jets from can be input or output AOD | |
158 | ||
159 | AliCFContainer *fhnJetContainer; //! like particle container in corrfw with different steps need AliCFContainer with Scale(), and clone() to do the same | |
160 | THnSparse *fhnCorrelation; //! response matrix for unfolding | |
161 | THnSparseF *fhnEvent; //! event counts | |
162 | TF1 *f1PtScale; //! correction function to correct to the average true jet energy depending on p_T,rec | |
163 | ||
164 | TString fBranchRec; // AOD branch name for reconstructed | |
165 | TString fBranchGen; // AOD brnach for genereated | |
166 | TString fBranchBkgRec; //AOD branch for background | |
167 | TString fBranchBkgGen; //AOD branch for background | |
168 | TString fNonStdFile; // name of delta aod file to catch the extension | |
169 | ||
170 | TRandom3* fRandomizer; //! randomizer | |
171 | ||
172 | Bool_t fUseAODJetInput; // take jet from input AOD not from ouptu AOD | |
173 | Bool_t fUseAODTrackInput; // take track from input AOD not from ouptu AOD | |
174 | Bool_t fUseAODMCInput; // take MC from input AOD not from ouptu AOD | |
175 | Bool_t fUseGlobalSelection; // Limit the eta of the generated jets | |
176 | Bool_t fUseExternalWeightOnly; // use only external weight | |
177 | Bool_t fLimitGenJetEta; // Limit the eta of the generated jets | |
178 | Bool_t fDoMatching; // switch on the matching between rec and gen | |
179 | Short_t fNMatchJets; // number of leading jets considered from the list | |
180 | Short_t fNRPBins; // number of bins with respect to RP | |
181 | Int_t fTRP; //flag to bin the RC in |phi_RP-phi | |
182 | Int_t fDebug; | |
183 | UInt_t fJetTriggerExcludeMask; // mask for jet triggers to exclude | |
184 | UInt_t fJetTriggerBestMask; // mask for best jet triggers | |
185 | UInt_t fFilterMask; // filter bit for slecected tracks | |
186 | UInt_t fEventSelectionMask; // Selection information used to filter events | |
187 | Int_t fNTrigger; // number of triggers for selection | |
188 | UInt_t *fTriggerBit; //[fNTrigger] trigger bits | |
189 | Int_t fNAcceptance; // number of triggers for selection | |
190 | Short_t fNBinsLeadingTrackPt; // number of bins leading track pt in sparse. Two options: 1 or 10 | |
191 | Short_t fNBinsMult; // number of bins in multiplicity in sparse | |
192 | Int_t fAnalysisType; // Analysis type | |
193 | Int_t fTrackTypeRec; // type of tracks used for FF | |
194 | Int_t fTrackTypeGen; // type of tracks used for FF | |
195 | Int_t fFlagJetType[kJetTypes]; // disable the filling and booking of certain JetType histos | |
196 | Int_t fEventClass; // event class to be looked at for this instance of the task | |
197 | Int_t fRPMethod; // method for subevent calculation | |
198 | Float_t fAvgTrials; // Average nimber of trials | |
199 | Float_t fExternalWeight; // external weight | |
200 | Float_t fJetRecEtaWindow; // eta window for rec jets | |
201 | Float_t fTrackRecEtaWindow; // eta window for rec tracks | |
202 | Float_t fMinJetPt; // limits the jet p_T in addition to what already is done in the jet finder, this is important for jet matching for JF with lo threshold | |
203 | Float_t fMinTrackPt; // limits the track p_T | |
204 | Float_t fDeltaPhiWindow; // minium angle between dijets | |
205 | Float_t *fAcceptancePhiMin; //[fNAcceptance] minimum phi | |
206 | Float_t *fAcceptancePhiMax; //[fNAcceptance] maximum phi | |
207 | Float_t *fAcceptanceEtaMin; //[fNAcceptance] minimum eta | |
208 | Float_t *fAcceptanceEtaMax; //[fNAcceptance] maximum eta | |
209 | Float_t fCentrality; // ! centrality | |
210 | Float_t fRPAngle; // ! RP angle of the reaction plane | |
211 | Int_t fMultRec; // ! reconstructed track multiplicity | |
212 | Int_t fMultGen; // ! generated track multiplicity | |
213 | TString *fTriggerName; //[fNTrigger] array of trigger names | |
214 | ||
215 | TProfile* fh1Xsec; //! pythia cross section and trials | |
216 | TH1F* fh1Trials; //! trials are added | |
217 | TH1F* fh1AvgTrials; //! trials are added | |
218 | TH1F* fh1PtHard; //! Pt har of the event... | |
219 | TH1F* fh1PtHardNoW; //! Pt har of the event without weigt | |
220 | TH1F* fh1PtHardTrials; //! Number of trials | |
221 | TH1F* fh1ZVtx; //! z-vtx distribution | |
222 | TH1F* fh1RP; //! RP distribution | |
223 | TH1F* fh1Centrality; //! centrality distribution | |
224 | TH1F* fh1TmpRho; //! just temporary histo for calculation | |
225 | TH2F* fh2MultRec; //! reconstructed track multiplicity | |
226 | TH2F* fh2MultGen; //! generated track multiplicity | |
227 | TH2F* fh2RPCentrality; //! RP vs centrality | |
228 | ||
229 | TH2F* fh2PtFGen; //! found vs generated | |
230 | TH3F* fh2deltaPt1Pt2; //! ptjet1 - ptjet2 vs ptjet1 vs ptjet2 | |
231 | TH2F* fh2RelPtFGen; //! relative difference between generated and found | |
232 | TH3F* fh3RelPtFGenLeadTrkPt; //! relative difference between generated and found vs leading track pT | |
233 | ||
234 | ||
235 | ||
236 | // Jet histos second go | |
237 | ||
238 | TH1F* fh1NJets[kJetTypes]; //! nr of gen jets | |
239 | TH1F* fh1SumPtTrack[kJetTypes]; //! sum over all track pT | |
240 | ||
241 | TH1F* fh1PtIn[kJetTypes][kMaxJets+1]; //! Jet pt | |
242 | TH1F* fh1PtJetsIn[kJetTypes]; //! Jet pt for all jets | |
243 | TH1F* fh1PtJetsInRej[kJetTypes]; //! Jet pt for all rejected jets | |
244 | TH1F* fh1PtJetsInBest[kJetTypes]; //! Jet pt for all rejected jets | |
245 | TH1F* fh1PtTracksIn[kJetTypes]; //! track pt for all tracks | |
246 | TH1F* fh1PtTracksInLow[kJetTypes]; //! track pt for all tracks | |
247 | ||
248 | TH2F* fh2NJetsPt[kJetTypes]; //! Number of found jets above threshold | |
249 | TH2F* fh2NTracksPt[kJetTypes]; //! Number of tracks above threshold | |
250 | TProfile2D *fp2MultRPPhiTrackPt[kJetTypes]; //! for mean pT vs RP | |
251 | TProfile2D *fp2CentRPPhiTrackPt[kJetTypes]; //! for mean pT vs RP | |
252 | THnSparseF *fhnJetPt[kJetTypes]; //! jet pt information for analysis | |
253 | THnSparseF *fhnJetPtBest[kJetTypes]; //! best jet for analysis | |
254 | THnSparseF *fhnJetPtRej[kJetTypes]; //! Rej jet for analysis | |
255 | THnSparseF *fhnJetPtQA[kJetTypes]; //! jet pt information for QA | |
256 | THnSparseF *fhnTrackPt[kJetTypes]; //! track pt information for analysis | |
257 | THnSparseF *fhnTrackPtQA[kJetTypes]; //! track pt information for analysis | |
258 | ||
259 | TH2F* fh2LTrackPtJetPt[kJetTypes][kMaxJets+1]; //! leading track within the jet vs jet pt | |
260 | ||
261 | TH1F* fh1DijetMinv[kJetTypes]; //! dijet inv mass | |
262 | TH2F* fh2DijetDeltaPhiPt[kJetTypes]; //! dijet delta phi vs pt | |
263 | TH2F* fh2DijetAsymPt[kJetTypes]; //! dijet asym vs pt after delta phi cut | |
264 | TH2F* fh2DijetPt2vsPt1[kJetTypes]; //! dijet pt2 vs pt1 | |
265 | TH2F* fh2DijetDifvsSum[kJetTypes]; //! dijet dif vs sum | |
266 | ||
267 | ||
268 | TList *fHistList; //! Output list | |
269 | ||
270 | ||
271 | ClassDef(AliAnalysisTaskJetSpectrum2, 23); // Analysis task for standard jet analysis | |
272 | }; | |
273 | ||
274 | #endif |