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