added more efficiency parameters
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / UserTasks / AliAnalysisTaskEmcalJetHadEPpid.h
CommitLineData
fc392675 1#ifndef AliAnalysisTaskEmcalJetHadEPpid_h
2#define AliAnalysisTaskEmcalJetHadEPpid_h
3
4// root classes
5class TClonesArray;
6class TH1F;
7class TH2F;
8class TH3F;
9class THnSparse;
10class TList;
11class TLorentzVector;
12class TGraph;
13
14// AliROOT classes
15class AliEventPoolManager;
16class AliLocalRhoParameter;
fc392675 17class AliEMCALTrack;
18class AliMagF;
19class AliESDEvent;
20class AliAODEvent;
21class AliEMCALGeometry;
22class AliEMCALRecoUtils;
23class AliESDtrack;
3263f852 24class AliESDtrackCuts;
fc392675 25
8ee2d316 26// container classes
27class AliJetContainer;
28class AliParticleContainer;
29class AliClusterContainer;
30
31// includes
fc392675 32#include <AliAnalysisTaskEmcalJet.h>
33#include <AliEmcalJet.h>
34#include <AliVEvent.h>
35#include <AliVTrack.h>
36#include <AliVCluster.h>
37#include <TClonesArray.h>
38#include <TMath.h>
39#include <TRandom3.h>
40#include <AliLog.h>
3263f852 41#include "AliESDtrackCuts.h"
fc392675 42
8ee2d316 43// Local Rho includes
fc392675 44#include "AliAnalysisTaskLocalRho.h"
45#include "AliLocalRhoParameter.h"
46
8ee2d316 47// PID includes
fc392675 48#include "AliPIDResponse.h"
49
50#include "AliAnalysisFilter.h"
51
52class AliAnalysisTaskEmcalJetHadEPpid : public AliAnalysisTaskEmcalJet {
53 public:
54 AliAnalysisTaskEmcalJetHadEPpid();
55 AliAnalysisTaskEmcalJetHadEPpid(const char *name);
56 //virtual ~AliAnalysisTaskEmcalJetHadEPpid() {}
57 virtual ~AliAnalysisTaskEmcalJetHadEPpid();
58
59 virtual void UserCreateOutputObjects();
daa728b0 60 // THnSparse Setup
e56c3f6e 61 virtual THnSparse* NewTHnSparseF(const char* name, UInt_t entries);
fc392675 62 virtual void GetDimParams(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
e56c3f6e 63 virtual THnSparse* NewTHnSparseFPID(const char* name, UInt_t entries);
fc392675 64 virtual void GetDimParamsPID(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
e56c3f6e 65 virtual THnSparse* NewTHnSparseFCorr(const char* name, UInt_t entries);
daa728b0 66 virtual void GetDimParamsCorr(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
67
f1ce4cc3 68 // set a bun of histogram switches up
fc392675 69 void SetPlotGlobalRho(Bool_t g) { doPlotGlobalRho = g; } // plot global rho switch
70 void SetVariableBinning(Bool_t v) { doVariableBinning = v; } // do variable binning switch
8ee2d316 71 void SetvarbinTHnSparse(Bool_t vb) { dovarbinTHnSparse = vb; } // variable THnSparse bin switch
139e13f4 72 void SetallpidAXIS(Bool_t allAXIS) { allpidAXIS = allAXIS; } // fill all PID sparse axis's
8ee2d316 73 void SetmakeQAhistos(Bool_t QAhist) { makeQAhistos = QAhist; } // make QA histos
74 void SetmakeBIAShistos(Bool_t BIAShist) { makeBIAShistos = BIAShist; } // make bias histos
75 void SetmakeextraCORRhistos(Bool_t Xhist) { makeextraCORRhistos = Xhist; } // make extra correlations histos
daa728b0 76 void SetoldJEThadhistos(Bool_t oldJH) { makeoldJEThadhistos = oldJH; } // make older JH histos for comparison
f1ce4cc3 77
78 // set data, detectors type, and PID and PID w bias switches
8ee2d316 79 void SetcutType(TString cut) { fcutType = cut; } // EMCAL / TPC acceptance cut
fc392675 80 void SetdoPID(Bool_t p) { doPID = p; } // do PID switch
8ee2d316 81 void SetdoPIDtrackBIAS(Bool_t PIDbias) { doPIDtrackBIAS = PIDbias; } // do PID track bias switch
fc392675 82
3263f852 83 // esd track cuts setters
84 void SetTrackCuts(AliESDtrackCuts *cuts) { fesdTrackCuts = cuts; }
85
f1ce4cc3 86 // give comments setter
87 void SetdoComments(Bool_t comm) { doComments = comm; } // give comment switch
88
56523939 89 // setter switch for flavour jet analysis
90 void SetFlavourJetAnalysis(Bool_t flj) { doFlavourJetAnalysis = flj; } // set on flavour jet analysis
91 virtual void SetJETFlavourTag(Int_t fltag) { fJetFlavTag = fltag; } // set manual tag #
92
93 // setter for beamtype (needed for UserCreateObjects section)
94 virtual void SetCollType(BeamType bm) { fBeam = bm; } // set beamtype
ac1be2ef 95
fc392675 96 // getters
3badfe33 97 TString GetLocalRhoName() const {return fLocalRhoName; }
fc392675 98
99 // set names of some objects
8ee2d316 100 virtual void SetLocalRhoName(const char *ln) { fLocalRhoName = ln; }
101 virtual void SetTracksName(const char *tn) { fTracksName = tn; }
3badfe33 102 virtual void SetTracksNameME(const char *MEtn) { fTracksNameME = MEtn; }
8ee2d316 103 virtual void SetJetsName(const char *jn) { fJetsName = jn; }
fc392675 104
8ee2d316 105 // bias and cuts - setters
fc392675 106 virtual void SetAreaCut(Double_t a) { fAreacut = a; }
107 virtual void SetTrkBias(Double_t b) { fTrkBias = b; } //require a track with pt > b in jet
108 virtual void SetClusBias(Double_t b) { fClusBias = b; } //require a cluster with pt > b in jet
109 virtual void SetTrkEta(Double_t e) { fTrkEta = e; } //eta range of the associated tracks
110 virtual void SetJetPtcut(Double_t jpt) { fJetPtcut = jpt; } // jet pt cut
8ee2d316 111 virtual void SetJetRad(Double_t jrad) { fJetRad = jrad; } // jet radius
daa728b0 112 virtual void SetConstituentCut(Double_t constCut) { fConstituentCut = constCut; } // constituent Cut
8ee2d316 113
114 // eta and phi limits of jets - setters
fc392675 115 virtual void SetJetEta(Double_t emin, Double_t emax) { fEtamin = emin; fEtamax = emax; }
116 virtual void SetJetPhi(Double_t pmin, Double_t pmax) { fPhimin = pmin; fPhimax = pmax; }
117
8ee2d316 118 // event mixing - setters
fc392675 119 virtual void SetEventMixing(Int_t yesno) { fDoEventMixing=yesno; }
120 virtual void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
a409c5ba 121 virtual void SetNMixedTr(Int_t nmt) { fNMIXtracks = nmt; }
d60e724e 122 virtual void SetNMixedEvt(Int_t nme) { fNMIXevents = nme; }
123
124 // event trigger/mixed selection - setters
125 virtual void SetTriggerEventType(UInt_t te) { fTriggerEventType = te; }
126 virtual void SetMixedEventType(UInt_t me) { fMixingEventType = me; }
bd67d847 127 virtual void SetCentBinSize(Int_t centbins) { fCentBinSize = centbins; }
a4248490 128
129 // set efficiency correction
130 void SetDoEffCorr(Int_t effcorr) { fDoEffCorr = effcorr; }
131 virtual void SetEffCorrFunc(Double_t efffunc) { fEffFunctionCorr = efffunc; }
fc392675 132
8ee2d316 133 // jet container - setters
134 void SetContainerAllJets(Int_t c) { fContainerAllJets = c;}
135 void SetContainerPIDJets(Int_t c) { fContainerPIDJets = c;}
136
fc392675 137protected:
138 // functions
8ee2d316 139 void ExecOnce();
140 Bool_t Run();
fc392675 141 virtual void Terminate(Option_t *);
f1ce4cc3 142 virtual Int_t AcceptMyJet(AliEmcalJet *jet); // applies basic jet tests/cuts before accepting
fc392675 143 virtual Int_t GetCentBin(Double_t cent) const; // centrality bin of event
daa728b0 144 Double_t RelativePhi(Double_t mphi,Double_t vphi) const; // relative jet track angle
145 Double_t RelativeEPJET(Double_t jetAng, Double_t EPAng) const; // relative jet event plane angle
fc392675 146 virtual Int_t GetEtaBin(Double_t eta) const; // eta bins
147 virtual Int_t GetpTjetBin(Double_t pt) const; // jet pt bins
148 virtual Int_t GetpTtrackBin(Double_t pt) const; // track pt bins
149 virtual Int_t GetzVertexBin(Double_t zVtx) const; // zVertex bin
150 void SetfHistPIDcounterLabels(TH1* fHistPID) const; // PID counter
f9b4eee4 151 void SetfHistQAcounterLabels(TH1* h) const; // QA counter
d60e724e 152 void SetfHistEvtSelQALabels(TH1* h) const; // Event Selection Counter
56523939 153 //virtual Int_t AcceptFlavourJet(AliEmcalJet *jet, Int_t NUM, Int_t NUM2, Int_t NUM3); // flavour jet acceptor
154 virtual Int_t AcceptFlavourJet(AliEmcalJet *jet, Int_t NUM); // flavour jet acceptor
a4248490 155 Double_t EffCorrection(Double_t trkETA, Double_t trkPT, Int_t effswitch) const; // efficiency correction function
fc392675 156
157 // parameters of detector to cut on for event
158 Double_t fPhimin; // phi min
159 Double_t fPhimax; // phi max
160 Double_t fEtamin; // eta min
161 Double_t fEtamax; // eta max
162 Double_t fAreacut; // area cut
163 Double_t fTrkBias; // track bias
164 Double_t fClusBias; // cluster bias
165 Double_t fTrkEta; // eta min/max of tracks
8ee2d316 166 Double_t fJetPtcut; // jet pt to cut on for correlations
167 Double_t fJetRad; // jet radius
f1ce4cc3 168 Double_t fConstituentCut; // jet constituent cut
fc392675 169
3263f852 170 // esd track cuts
171 AliESDtrackCuts *fesdTrackCuts; // esdTrackCuts
172
fc392675 173 // event mixing
174 Int_t fDoEventMixing;
175 Int_t fMixingTracks;
a409c5ba 176 Int_t fNMIXtracks;
d60e724e 177 Int_t fNMIXevents;
bd67d847 178 Int_t fCentBinSize; // centrality bin size of mixed event pools
d60e724e 179
180 // event selection types
181 UInt_t fTriggerEventType;
182 UInt_t fMixingEventType;
fc392675 183
a4248490 184 // efficiency correction
185 Int_t fDoEffCorr;
186 Double_t fEffFunctionCorr;
187
fc392675 188 // switches for plots
189 Bool_t doPlotGlobalRho;
190 Bool_t doVariableBinning;
8ee2d316 191 Bool_t dovarbinTHnSparse;
192 Bool_t makeQAhistos;
193 Bool_t makeBIAShistos;
194 Bool_t makeextraCORRhistos;
daa728b0 195 Bool_t makeoldJEThadhistos;
139e13f4 196 Bool_t allpidAXIS;
8ee2d316 197
198 // Cut type (EMCAL/TPC acceptance)
199 TString fcutType;
fc392675 200
201 // switches for PID
202 Bool_t doPID;
8ee2d316 203 Bool_t doPIDtrackBIAS;
fc392675 204
f1ce4cc3 205 // do comment switch
206 Bool_t doComments;
207
56523939 208 // do flavour jet analysis switch, and set flavour jet tag
209 Bool_t doFlavourJetAnalysis;
210 Int_t fJetFlavTag;
211
212 // beam type
213 BeamType fBeam;
ac1be2ef 214
fc392675 215 // local rho value
216 Double_t fLocalRhoVal;
217
218 // object names
219 TString fTracksName;
3badfe33 220 TString fTracksNameME;
fc392675 221 TString fJetsName;
222
223 // event counter
224 Int_t event;
225
226 // boolean functions for PID
227 Bool_t isPItpc, isKtpc, isPtpc;
fc392675 228 Bool_t isPIits, isKits, isPits;
fc392675 229 Bool_t isPItof, isKtof, isPtof;
fc392675 230
231 // event pool
ac1be2ef 232 TObjArray *CloneAndReduceTrackList(TObjArray* tracks);
233 AliEventPoolManager *fPoolMgr;//! // event pool Manager object
fc392675 234
235 // PID
236 AliPIDResponse *fPIDResponse; // PID response object
237 AliTPCPIDResponse *fTPCResponse; // TPC pid response object
238
239 private:
8ee2d316 240 // needed for PID, track objects
ac1be2ef 241 AliESDEvent *fESD;//! // ESD object
242 AliAODEvent *fAOD;//! // AOD object
3badfe33 243 AliVEvent *fVevent;//! // Vevent object
fc392675 244
f9b4eee4 245 TH1F *fHistEventQA;//!
d60e724e 246 TH1F *fHistEventSelectionQA;//!
f9b4eee4 247
a409c5ba 248 TH2F *fHistCentZvertGA;//!
249 TH2F *fHistCentZvertJE;//!
250 TH2F *fHistCentZvertMB;//!
251 TH2F *fHistCentZvertAny;//!
252
37d10286 253 TH2F *fHistTPCdEdX;//!
254 TH2F *fHistITSsignal;//!
255// TH2F *fHistTOFsignal;//!
fc392675 256
37d10286 257 TH2F *fHistRhovsCent;//!
fc392675 258 TH2F *fHistNjetvsCent;//! number of jets versus Centrality
259 TH2F *fHistJetPtvsTrackPt[6];//!
260 TH2F *fHistRawJetPtvsTrackPt[6];//!
261 TH1F *fHistTrackPt[6];//!
262 TH1F *fHistEP0[6];//!
263 TH1F *fHistEP0A[6];//!
264 TH1F *fHistEP0C[6];//!
265 TH2F *fHistEPAvsC[6];//!
8ee2d316 266 TH1F *fHistJetPtcorrGlRho[6];//!
fc392675 267 TH2F *fHistJetPtvsdEP[6];//!
268 TH2F *fHistJetPtvsdEPBias[6];//!
37d10286 269 TH2F *fHistRhovsdEP[6];//!
fc392675 270 TH3F *fHistJetEtaPhiPt[6];//!
271 TH3F *fHistJetEtaPhiPtBias[6];//!
272 TH2F *fHistJetPtArea[6];//!
273 TH2F *fHistJetPtAreaBias[6];//!
37d10286 274 TH2F *fHistJetPtNcon[6];//!
275 TH2F *fHistJetPtNconBias[6];//!
276 TH2F *fHistJetPtNconCh[6];//!
277 TH2F *fHistJetPtNconBiasCh[6];//!
278 TH2F *fHistJetPtNconEm[6];//!
279 TH2F *fHistJetPtNconBiasEm[6];//!
280 TH1F *fHistJetHaddPhiINcent[6];//!
281 TH1F *fHistJetHaddPhiOUTcent[6];//!
282 TH1F *fHistJetHaddPhiMIDcent[6];//!
283
284 TH1 *fHistCentrality;//!
285 TH1 *fHistZvtx;//!
286 TH1 *fHistMult;//!
287 TH1 *fHistJetPhi;//!
288 TH1 *fHistTrackPhi;//!
d60e724e 289 TH1 *fHistLocalRhoJetpt;//!
37d10286 290 TH1 *fHistJetHaddPhiIN;//!
291 TH1 *fHistJetHaddPhiOUT;//!
292 TH1 *fHistJetHaddPhiMID;//!
293 TH1 *fHistJetHaddPhiBias;//!
294 TH1 *fHistJetHaddPhiINBias;//!
295 TH1 *fHistJetHaddPhiOUTBias;//!
296 TH1 *fHistJetHaddPhiMIDBias;//!
297
298 TH1 *fHistMEdPHI;//! // phi distrubtion of mixed events
299 TH1 *fHistTrackPtallcent;//!
300
301 TH2 *fHistJetEtaPhi;//!
302 TH2 *fHistTrackEtaPhi[4][7];//!
303 TH1 *fHistJetHadbindPhi[9];//!
304 TH1 *fHistJetHadbindPhiIN[9];//!
305 TH1 *fHistJetHadbindPhiMID[9];//!
306 TH1 *fHistJetHadbindPhiOUT[9];//!
307 TH2 *fHistJetHEtaPhi;//!
308
309 TH1 *fHistJetPt[6];//!
310 TH1 *fHistJetPtBias[6];//!
311 TH1 *fHistJetPtTT[6];//!
312 TH2 *fHistAreavsRawPt[6];//!
313 TH2 *fHistJetH[6][5][3];//!
314 TH2 *fHistJetHBias[6][5][3];//!
315 TH2 *fHistJetHTT[6][5][3];//!
316 TH1F *fHistJetHdPHI[11];//!
317 TH2F *fHistJetHdETAdPHI[11];//!
318 TH2F *fHistSEphieta;//! // single events phi-eta distributions
319 TH2F *fHistMEphieta;//! // mixed events phi-eta distributions
320 TH1F *fHistJetHaddPHI;//!
fc392675 321
322 // PID status histo's
37d10286 323 TH1 *fHistPID;//!
fc392675 324
325 // THn Sparse's
37d10286 326 THnSparse *fhnPID;//! // PID sparse
327 THnSparse *fhnMixedEvents;//! // mixed events matrix
328 THnSparse *fhnJH;//! // jet hadron events matrix
329 THnSparse *fhnCorr;//! // sparse to get # jet triggers
fc392675 330
8ee2d316 331 // container objects
332 AliJetContainer *fJetsCont; //!Jets
333 AliParticleContainer *fTracksCont; //!Tracks
334 AliClusterContainer *fCaloClustersCont; //!Clusters
335
336 // container specifier
337 Int_t fContainerAllJets; // number of container with all full jets
338 Int_t fContainerPIDJets; // number of container with full jets meeting Pt cut (for PID)
339
fc392675 340// ***********************************************************
341
342 //Declare it private to avoid compilation warning
343 AliAnalysisTaskEmcalJetHadEPpid(const AliAnalysisTaskEmcalJetHadEPpid & g) ; // cpy ctor
344
345 AliAnalysisTaskEmcalJetHadEPpid& operator=(const AliAnalysisTaskEmcalJetHadEPpid&); // not implemented
346 ClassDef(AliAnalysisTaskEmcalJetHadEPpid, 4); // Emcal jet hadron PID - Event plane dependence
347};
348#endif