AliPhysics  a9863a5 (a9863a5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetHadEPpid.h
Go to the documentation of this file.
1 #ifndef AliAnalysisTaskEmcalJetHadEPpid_h
2 #define AliAnalysisTaskEmcalJetHadEPpid_h
3 
4 /**************************************************************************
5  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * *
7  * Author: The ALICE Off-line Project. *
8  * Contributors are mentioned in the code where appropriate. *
9  * *
10  * Permission to use, copy, modify and distribute this software and its *
11  * documentation strictly for non-commercial purposes is hereby granted *
12  * without fee, provided that the above copyright notice appears in all *
13  * copies and that both the copyright notice and this permission notice *
14  * appear in the supporting documentation. The authors make no claims *
15  * about the suitability of this software for any purpose. It is *
16  * provided "as is" without express or implied warranty. *
17  **************************************************************************/
18 
19 //-------------------------------------------------------------------------
20 // 1) Analysis Task to perform Jet-Hadron Correlations
21 // 2) Event plane dependence task.
22 // 3) performs event plane resolution calculation
23 // 4) does PID of the associated pi/k/p hadrons
24 //
25 // Author: Joel Mazer (joel.mazer@cern.ch)
26 //-------------------------------------------------------------------------
27 
28 // root classes
29 class TClonesArray;
30 class TF1;
31 class TH1;
32 class TH2;
33 class TH3;
34 class THnSparse;
35 class TProfile;
36 class TList;
37 class TLorentzVector;
38 class TGraph;
39 
40 // AliROOT classes
41 class AliEventPoolManager;
43 class AliEMCALTrack;
44 class AliMagF;
45 class AliESDEvent;
46 class AliAODEvent;
47 class AliEMCALGeometry;
48 class AliEMCALRecoUtils;
49 class AliESDtrack;
50 class AliESDtrackCuts;
51 
52 // container classes
53 class AliJetContainer;
56 
57 // includes
59 #include <AliEmcalJet.h>
60 #include <AliVEvent.h>
61 #include <AliVTrack.h>
62 #include <AliVCluster.h>
63 #include <TClonesArray.h>
64 #include <TMath.h>
65 #include <TRandom3.h>
66 #include <AliLog.h>
67 #include <TArrayD.h>
68 #include "AliESDtrackCuts.h"
69 
70 // Local Rho includes
72 #include "AliLocalRhoParameter.h"
73 
74 // PID includes
75 #include "AliPIDResponse.h"
76 
77 #include "AliAnalysisFilter.h"
78 
80  public:
81  enum detectorType { kTPC, kVZEROA, kVZEROC, kVZEROComb, kFixedEP}; // detector that was used for event plane
83  AliAnalysisTaskEmcalJetHadEPpid(const char *name);
84  //virtual ~AliAnalysisTaskEmcalJetHadEPpid() {}
86 
87  virtual void UserCreateOutputObjects();
88  // THnSparse Setup
89  virtual THnSparse* NewTHnSparseF(const char* name, UInt_t entries);
90  virtual void GetDimParams(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
91  virtual THnSparse* NewTHnSparseFPID(const char* name, UInt_t entries);
92  virtual void GetDimParamsPID(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
93  virtual THnSparse* NewTHnSparseFCorr(const char* name, UInt_t entries);
94  virtual void GetDimParamsCorr(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
95 
96  // note that the cdf of the chisquare distribution is the normalized lower incomplete gamma function
97 // /* inline */ static Double_t ChiSquareCDF(Int_t ndf, Double_t x) { return TMath::Gamma(ndf/2., x/2.); }
98 // /* inline */ static Double_t ChiSquare(TH1& histo, TF1* func) {
99  // evaluate the chi2 using a poissonian error estimate on bins
100 // Double_t chi2(0.);
101 /*
102  for(Int_t i(0); i < histo.GetXaxis()->GetNbins(); i++) {
103  if(histo.GetBinContent(i+1) <= 0.) continue;
104  chi2 += TMath::Power((histo.GetBinContent(i+1)-func->Eval(histo.GetXaxis()->GetBinCenter(1+i))), 2)/histo.GetBinContent(i+1);
105  }
106  return chi2;
107  }
108 */
109 
110  // set a bunch of histogram switches up
111  void SetPlotGlobalRho(Bool_t g) { doPlotGlobalRho = g; } // plot global rho switch
112  void SetVariableBinning(Bool_t v) { doVariableBinning = v; } // do variable binning switch
113  void SetvarbinTHnSparse(Bool_t vb) { dovarbinTHnSparse = vb; } // variable THnSparse bin switch
114  void SetallpidAXIS(Bool_t allAXIS) { allpidAXIS = allAXIS; } // fill all PID sparse axis's
115  void SetmakeQAhistos(Bool_t QAhist) { makeQAhistos = QAhist; } // make QA histos
116  void SetmakeBIAShistos(Bool_t BIAShist) { makeBIAShistos = BIAShist; } // make bias histos
117  void SetmakeextraCORRhistos(Bool_t Xhist) { makeextraCORRhistos = Xhist; } // make extra correlations histos
118  void SetoldJEThadhistos(Bool_t oldJH) { makeoldJEThadhistos = oldJH; } // make older JH histos for comparison
119 
120  // set data, detectors type, and PID and PID w bias switches
121  void SetcutType(TString cut) { fcutType = cut; } // EMCAL / TPC acceptance cut
122  void SetdoPID(Bool_t p) { doPID = p; } // do PID switch
123  void SetdoPIDtrackBIAS(Bool_t PIDbias) { doPIDtrackBIAS = PIDbias; } // do PID track bias switch
124  void SetdoaltPIDbinning(Bool_t altPIDbin) { doaltPIDbinning = altPIDbin; } // alternate PID binning (fewer bins - TOF focus)
125 
126  // esd track cuts setters
127  void SetTrackCuts(AliESDtrackCuts *cuts) { fesdTrackCuts = cuts; }
128 
129  // reference of detector for event plane resolution
131 
132  // set soft track min/max
133  void SetSoftTrackMinMaxPt_ep(Float_t min, Float_t max) {fSoftTrackMinPt_ep = min; fSoftTrackMaxPt_ep = max;}
135 
136  // set centrality classes up
137  void SetCentralityClasses(TArrayD* c) {fCentralityClasses = c;}
138 
139  // set Chi2 for VZERO A and C
140  void SetChi2VZEROA(TArrayD* a) { fChi2A = a;}
141  void SetChi2VZEROC(TArrayD* a) { fChi2C = a;}
142  void SetChi3VZEROA(TArrayD* a) { fChi3A = a;}
143  void SetChi3VZEROC(TArrayD* a) { fChi3C = a;}
146  Int_t GetVZEROCentralityBin() const;
148 
149  // switch for Event Plane Resolution analysis
150  void SetdoEventPlaneRes(Bool_t depr) { doEventPlaneRes = depr; } // do EP res switch
151 
152  // give comments setter
153  void SetdoComments(Bool_t comm) { doComments = comm; } // give comment switch
154 
155  // setter switch for flavour jet analysis
156  void SetFlavourJetAnalysis(Bool_t flj) { doFlavourJetAnalysis = flj; } // set on flavour jet analysis
157  virtual void SetJETFlavourTag(Int_t fltag) { fJetFlavTag = fltag; } // set manual tag #
158 
159  // setter for beamtype (needed for UserCreateObjects section)
160  virtual void SetCollType(BeamType bm) { fBeam = bm; } // set beamtype
161 
162  // getters
163  TString GetLocalRhoName() const {return fLocalRhoName; }
164 
165  // set names of some objects
166  // appended "MYTASK" to end until EMCal / Jet framework changes/deletes function from base class..
167  virtual void SetLocalRhoName(const char *ln) { fLocalRhoName = ln; }
168  virtual void SetTracksNameMYTASK(const char *tn) { fTracksName = tn; }
169  virtual void SetTracksNameME(const char *MEtn) { fTracksNameME = MEtn; }
170  //virtual void SetJetsNameMYTASK(const char *jn) { fJetsName2 = jn; }
171  virtual void SetJetsName(const char *jn) { fJetsName = jn; }
172  virtual void SetCaloClustersNameMYTASK(const char *cn) { fCaloClustersName=cn; }
173 
174  // bias and cuts - setters
175  virtual void SetAreaCut(Double_t a) { fAreacut = a; }
176  virtual void SetTrkBias(Double_t b) { fTrkBias = b; } //require a track with pt > b in jet
177  virtual void SetClusBias(Double_t b) { fClusBias = b; } //require a cluster with pt > b in jet
178  virtual void SetTrkEta(Double_t e) { fTrkEta = e; } //eta range of the associated tracks
179  virtual void SetJetPtcut(Double_t jpt) { fJetPtcut = jpt; } // jet pt cut
180  virtual void SetJetRad(Double_t jrad) { fJetRad = jrad; } // jet radius
181  virtual void SetConstituentCut(Double_t constCut) { fConstituentCut = constCut; } // constituent Cut
182 
183  // eta and phi limits of jets - setters
184  virtual void SetJetEta(Double_t emin, Double_t emax) { fEtamin = emin; fEtamax = emax; }
185  virtual void SetJetPhi(Double_t pmin, Double_t pmax) { fPhimin = pmin; fPhimax = pmax; }
186 
187  // event mixing - setters
188  virtual void SetEventMixing(Int_t yesno) { fDoEventMixing=yesno; }
189  virtual void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
190  virtual void SetNMixedTr(Int_t nmt) { fNMIXtracks = nmt; }
191  virtual void SetNMixedEvt(Int_t nme) { fNMIXevents = nme; }
192 
193  // event trigger/mixed selection - setters
194  virtual void SetTriggerEventType(UInt_t te) { fTriggerEventType = te; }
195  virtual void SetMixedEventType(UInt_t me) { fMixingEventType = me; }
196  virtual void SetCentBinSize(Int_t centbins) { fCentBinSize = centbins; }
197  virtual void SetReduceStatsCent(Int_t red) { fReduceStatsCent = red; }
198 
199  // efficiency correction setter
200  void SetDoEffCorr(Int_t effcorr) { fDoEffCorr = effcorr; }
201 
202  // use local rho to correct jet pt in correlation sparses
203  void SetCorrectJetPt(Bool_t cpt) { fcorrJetPt = cpt; }
204 
205  // framework setters NEW/OLD
207 
208  // jet container - setters
211 
212 protected:
213  // functions
214  void ExecOnce();
215  virtual Bool_t Notify();
216  Bool_t Run();
217  virtual void Terminate(Option_t *);
218  virtual Int_t AcceptMyJet(AliEmcalJet *jet); // applies basic jet tests/cuts before accepting
219  virtual Int_t GetCentBin(Double_t cent) const; // centrality bin of event
220  Double_t RelativePhi(Double_t mphi,Double_t vphi) const; // relative jet track angle
221  Double_t RelativeEPJET(Double_t jetAng, Double_t EPAng) const; // relative jet event plane angle
222  virtual Int_t GetEtaBin(Double_t eta) const; // eta bins
223  virtual Int_t GetpTjetBin(Double_t pt) const; // jet pt bins
224  virtual Int_t GetpTtrackBin(Double_t pt) const; // track pt bins
225  virtual Int_t GetzVertexBin(Double_t zVtx) const; // zVertex bin
226  void SetfHistPIDcounterLabels(TH1* fHistPID) const; // PID counter
227  void SetfHistQAcounterLabels(TH1* h) const; // QA counter
228  void SetfHistEvtSelQALabels(TH1* h) const; // Event Selection Counter
229  //virtual Int_t AcceptFlavourJet(AliEmcalJet *jet, Int_t NUM, Int_t NUM2, Int_t NUM3); // flavour jet acceptor
230  virtual Int_t AcceptFlavourJet(AliEmcalJet *jet, Int_t NUM); // flavour jet acceptor
231  Double_t EffCorrection(Double_t trkETA, Double_t trkPT, Int_t effswitch) const; // efficiency correction function
232  static Double_t CalculateEventPlaneChi(Double_t res);
233  void CalculateEventPlaneVZERO(Double_t vzero[2][2]) const;
234  void CalculateEventPlaneCombinedVZERO(Double_t* comb) const;
235  void CalculateEventPlaneTPC(Double_t* tpc);
236  void CalculateEventPlaneResolution(Double_t vzero[2][2], Double_t* vzeroComb, Double_t* tpc);
237  TH1* FillEventTriggerQA(TH1* h, UInt_t t); // filled event trigger QA plots
238 
239  // parameters of detector to cut on for event
240  Double_t fPhimin; // phi min
241  Double_t fPhimax; // phi max
242  Double_t fEtamin; // eta min
243  Double_t fEtamax; // eta max
244  Double_t fAreacut; // area cut
245  Double_t fTrkBias; // track bias
246  Double_t fClusBias; // cluster bias
247  Double_t fTrkEta; // eta min/max of tracks
248  Double_t fJetPtcut; // jet pt to cut on for correlations
249  Double_t fJetRad; // jet radius
250  Double_t fConstituentCut; // jet constituent cut
251 
252  // esd track cuts
253  AliESDtrackCuts *fesdTrackCuts; // esdTrackCuts
254 
255  // detector type
256  detectorType fDetectorType; // type of detector
257 
258  // used for event plane resolution calculation
259  Float_t fSoftTrackMinPt_ep; // min pt for soft tracks
260  Float_t fSoftTrackMaxPt_ep; // max pt for soft tracks
263  Float_t fExcludeLeadingJetsFromFit; // exclude n leading jets from fit
264  TArrayD* fCentralityClasses; //-> centrality classes (maximum 10)
266 
267  // event mixing
270  Int_t fNMIXtracks;
271  Int_t fNMIXevents;
272  Int_t fCentBinSize; // centrality bin size of mixed event pools
273  Int_t fReduceStatsCent; // bins to use for reduced statistics of sparse
274 
275  // event selection types
278 
279  // efficiency correction
280  Int_t fDoEffCorr;
281 
282  // correct jet pt
283  Bool_t fcorrJetPt;
284 
285  // switches for plots
289  Bool_t makeQAhistos;
293  Bool_t allpidAXIS;
294 
295  // Cut type (EMCAL/TPC acceptance)
296  TString fcutType;
297 
298  // switches for PID
299  Bool_t doPID;
302 
303  // do EP resolution switch
305 
306  // do comment switch
307  Bool_t doComments;
308 
309  // do flavour jet analysis switch, and set flavour jet tag
311  Int_t fJetFlavTag;
312 
313  // do setup for OLD/NEW track framework
315 
316  // beam type
318 
319  // local rho value
320  Double_t fLocalRhoVal;
321 
322  // object names
323  TString fTracksName; // name of track collection (for signal events)
324  TString fTracksNameME; // name of mixed event track collection
325  TString fJetsName; // name of jet collection
326  TString fCaloClustersName; // name of Calo Cluster collection
327 
328  // event counter
329  Int_t event;
330 
331  // boolean functions for PID
335 
336  // event pool
337  TObjArray *CloneAndReduceTrackList(TObjArray* tracks);
338  AliEventPoolManager *fPoolMgr;
339 
340  // PID
341  AliPIDResponse *fPIDResponse; // PID response object
342  AliTPCPIDResponse *fTPCResponse; // TPC pid response object
343 
344  private:
345  // needed for PID, track objects
346  AliESDEvent *fESD;
347  AliAODEvent *fAOD;
348  AliVEvent *fVevent;
349 
353 
358 
361 // TH2F *fHistTOFsignal;//!
362 
366  TH1F *fHistTrackPt[6];
367  TH1F *fHistEP0[6];
368  TH1F *fHistEP0A[6];
369  TH1F *fHistEP0C[6];
370  TH2F *fHistEPAvsC[6];
372  TH2F *fHistJetPtvsdEP[6];
374  TH2F *fHistRhovsdEP[6];
377  TH2F *fHistJetPtArea[6];
379  TH2F *fHistJetPtNcon[6];
388 
401 
402  TH1 *fHistMult;
413 
416 
418  TH2 *fHistTrackEtaPhi[4][7];
419 
425 
426  TH1 *fHistJetPt[6];
427  TH1 *fHistJetPtBias[6];
428  TH1 *fHistJetPtTT[6];
430  TH2 *fHistJetH[6][5][3];
431  TH2 *fHistJetHBias[6][5][3];
432  TH2 *fHistJetHTT[6][5][3];
436 
437  // more QA histos
444 
445  // PID status histo's
446  TH1 *fHistPID;
447 
448  // THn Sparse's
449  THnSparse *fhnPID;
450  THnSparse *fhnMixedEvents;
451  THnSparse *fhnJH;
452  THnSparse *fhnCorr;
453 
454  // EP resoltuion profiles and chi2 array
455  TProfile *fProfV2Resolution[10];
456  TProfile *fProfV3Resolution[10];
457  TProfile *fProfV4Resolution[10];
458  TProfile *fProfV5Resolution[10];
459  TArrayD* fChi2A; // chi vs cent for vzero A ep_2
460  TArrayD* fChi2C; // chi vs cent for vzero C ep_2
461  TArrayD* fChi3A; // chi vs cent for vzero A ep_3
462  TArrayD* fChi3C; // chi vs cent for vzero C ep_3
463  Bool_t fUseChiWeightForVZERO; // use chi weight for vzero
464 
465  // save containers in clones array (object)
466  TClonesArray *fTracksFromContainer;
467 
468  // container objects
470 // AliParticleContainer *fTracksCont; //!Tracks - not quality cuts applied to this container
473 
474  // container specifier
475  Int_t fContainerAllJets; // number of container with all full jets
476  Int_t fContainerPIDJets; // number of container with full jets meeting Pt cut (for PID)
477 
478  //TObjArray *fTrgJet; //!jets
479 // ***********************************************************
480 
481  //Declare it private to avoid compilation warning
483 
485  ClassDef(AliAnalysisTaskEmcalJetHadEPpid, 4); // Emcal jet hadron PID - Event plane dependence
486 };
487 #endif
TObjArray * CloneAndReduceTrackList(TObjArray *tracks)
virtual Int_t GetpTtrackBin(Double_t pt) const
Double_t RelativeEPJET(Double_t jetAng, Double_t EPAng) const
TProfile * fProfV5Resolution[10]
resolution parameters for v4
AliEmcalJet * GetLeadingJet(AliLocalRhoParameter *localRho=0x0)
THnSparse * fhnJH
// mixed events matrix
AliEmcalJet * fLeadingJet
number of accepted tracks
virtual void SetConstituentCut(Double_t constCut)
void SetSoftTrackMinMaxPt_ep(Float_t min, Float_t max)
static Double_t CalculateEventPlaneChi(Double_t res)
TArrayD * fChi2A
resolution parameters for v5
Container with name, TClonesArray and cuts for particles.
TH1 * fHistTrackPtallcent
// phi distrubtion of mixed events
AliJetContainer * fJetsCont
tracks from AliTrackContainer
virtual Int_t GetEtaBin(Double_t eta) const
virtual void SetJetPhi(Double_t pmin, Double_t pmax)
TProfile * fProfV4Resolution[10]
resolution parameters for v3
void CalculateEventPlaneResolution(Double_t vzero[2][2], Double_t *vzeroComb, Double_t *tpc)
virtual void GetDimParams(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
virtual Int_t GetpTjetBin(Double_t pt) const
Container for particles within the EMCAL framework.
BeamType
Switch for the beam type.
virtual void GetDimParamsPID(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
TString fLocalRhoName
name for local rho
virtual THnSparse * NewTHnSparseFCorr(const char *name, UInt_t entries)
TH1F * fHistJetHaddPHI
// mixed events phi-eta distributions
TProfile * fProfV3Resolution[10]
resolution parameters for v2
virtual void GetDimParamsCorr(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
TH2F * fHistJetPtvsTrackPt[6]
number of jets versus Centrality
virtual THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
AliPIDResponse * fPIDResponse
// event pool Manager object
virtual void SetJetEta(Double_t emin, Double_t emax)
virtual void SetCaloClustersNameMYTASK(const char *cn)
virtual THnSparse * NewTHnSparseFPID(const char *name, UInt_t entries)
virtual void SetTracksNameMYTASK(const char *tn)
AliClusterContainer * fCaloClustersCont
Tracks - Need this for applying track quality cuts.
Double_t RelativePhi(Double_t mphi, Double_t vphi) const
virtual Int_t GetzVertexBin(Double_t zVtx) const
Double_t EffCorrection(Double_t trkETA, Double_t trkPT, Int_t effswitch) const
virtual void SetTracksNameME(const char *MEtn)
virtual Int_t AcceptFlavourJet(AliEmcalJet *jet, Int_t NUM)
TProfile * fProfV2Resolution[10]
// sparse to get # jet triggers
void CalculateEventPlaneCombinedVZERO(Double_t *comb) const
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
const Int_t nbins
THnSparse * fhnCorr
// jet hadron events matrix
ClassDef(AliAnalysisTaskEmcalJetHadEPpid, 4)
TH2F * fHistMEphieta
// single events phi-eta distributions
Container structure for EMCAL clusters.
virtual Int_t GetCentBin(Double_t cent) const
void CalculateEventPlaneVZERO(Double_t vzero[2][2]) const
Container for jet within the EMCAL jet framework.
AliAnalysisTaskEmcalJetHadEPpid & operator=(const AliAnalysisTaskEmcalJetHadEPpid &)