AliPhysics  8bb951a (8bb951a)
 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  virtual void SetLocalRhoName(const char *ln) { fLocalRhoName = ln; }
167  virtual void SetTracksName(const char *tn) { fTracksName = tn; }
168  virtual void SetTracksNameME(const char *MEtn) { fTracksNameME = MEtn; }
169  virtual void SetJetsName(const char *jn) { fJetsName = jn; }
170  virtual void SetCaloClustersName(const char *cn) { fCaloClustersName=cn; }
171 
172  // bias and cuts - setters
173  virtual void SetAreaCut(Double_t a) { fAreacut = a; }
174  virtual void SetTrkBias(Double_t b) { fTrkBias = b; } //require a track with pt > b in jet
175  virtual void SetClusBias(Double_t b) { fClusBias = b; } //require a cluster with pt > b in jet
176  virtual void SetTrkEta(Double_t e) { fTrkEta = e; } //eta range of the associated tracks
177  virtual void SetJetPtcut(Double_t jpt) { fJetPtcut = jpt; } // jet pt cut
178  virtual void SetJetRad(Double_t jrad) { fJetRad = jrad; } // jet radius
179  virtual void SetConstituentCut(Double_t constCut) { fConstituentCut = constCut; } // constituent Cut
180 
181  // eta and phi limits of jets - setters
182  virtual void SetJetEta(Double_t emin, Double_t emax) { fEtamin = emin; fEtamax = emax; }
183  virtual void SetJetPhi(Double_t pmin, Double_t pmax) { fPhimin = pmin; fPhimax = pmax; }
184 
185  // event mixing - setters
186  virtual void SetEventMixing(Int_t yesno) { fDoEventMixing=yesno; }
187  virtual void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
188  virtual void SetNMixedTr(Int_t nmt) { fNMIXtracks = nmt; }
189  virtual void SetNMixedEvt(Int_t nme) { fNMIXevents = nme; }
190 
191  // event trigger/mixed selection - setters
192  virtual void SetTriggerEventType(UInt_t te) { fTriggerEventType = te; }
193  virtual void SetMixedEventType(UInt_t me) { fMixingEventType = me; }
194  virtual void SetCentBinSize(Int_t centbins) { fCentBinSize = centbins; }
195  virtual void SetReduceStatsCent(Int_t red) { fReduceStatsCent = red; }
196 
197  // efficiency correction setter
198  void SetDoEffCorr(Int_t effcorr) { fDoEffCorr = effcorr; }
199 
200  // use local rho to correct jet pt in correlation sparses
201  void SetCorrectJetPt(Bool_t cpt) { fcorrJetPt = cpt; }
202 
203  // jet container - setters
206 
207 protected:
208  // functions
209  void ExecOnce();
210  virtual Bool_t Notify();
211  Bool_t Run();
212  virtual void Terminate(Option_t *);
213  virtual Int_t AcceptMyJet(AliEmcalJet *jet); // applies basic jet tests/cuts before accepting
214  virtual Int_t GetCentBin(Double_t cent) const; // centrality bin of event
215  Double_t RelativePhi(Double_t mphi,Double_t vphi) const; // relative jet track angle
216  Double_t RelativeEPJET(Double_t jetAng, Double_t EPAng) const; // relative jet event plane angle
217  virtual Int_t GetEtaBin(Double_t eta) const; // eta bins
218  virtual Int_t GetpTjetBin(Double_t pt) const; // jet pt bins
219  virtual Int_t GetpTtrackBin(Double_t pt) const; // track pt bins
220  virtual Int_t GetzVertexBin(Double_t zVtx) const; // zVertex bin
221  void SetfHistPIDcounterLabels(TH1* fHistPID) const; // PID counter
222  void SetfHistQAcounterLabels(TH1* h) const; // QA counter
223  void SetfHistEvtSelQALabels(TH1* h) const; // Event Selection Counter
224  //virtual Int_t AcceptFlavourJet(AliEmcalJet *jet, Int_t NUM, Int_t NUM2, Int_t NUM3); // flavour jet acceptor
225  virtual Int_t AcceptFlavourJet(AliEmcalJet *jet, Int_t NUM); // flavour jet acceptor
226  Double_t EffCorrection(Double_t trkETA, Double_t trkPT, Int_t effswitch) const; // efficiency correction function
227  static Double_t CalculateEventPlaneChi(Double_t res);
228  void CalculateEventPlaneVZERO(Double_t vzero[2][2]) const;
229  void CalculateEventPlaneCombinedVZERO(Double_t* comb) const;
230  void CalculateEventPlaneTPC(Double_t* tpc);
231  void CalculateEventPlaneResolution(Double_t vzero[2][2], Double_t* vzeroComb, Double_t* tpc);
232  TH1* FillEventTriggerQA(TH1* h, UInt_t t); // filled event trigger QA plots
233 
234  // parameters of detector to cut on for event
235  Double_t fPhimin; // phi min
236  Double_t fPhimax; // phi max
237  Double_t fEtamin; // eta min
238  Double_t fEtamax; // eta max
239  Double_t fAreacut; // area cut
240  Double_t fTrkBias; // track bias
241  Double_t fClusBias; // cluster bias
242  Double_t fTrkEta; // eta min/max of tracks
243  Double_t fJetPtcut; // jet pt to cut on for correlations
244  Double_t fJetRad; // jet radius
245  Double_t fConstituentCut; // jet constituent cut
246 
247  // esd track cuts
248  AliESDtrackCuts *fesdTrackCuts; // esdTrackCuts
249 
250  // detector type
251  detectorType fDetectorType; // type of detector
252 
253  // used for event plane resolution calculation
254  Float_t fSoftTrackMinPt_ep; // min pt for soft tracks
255  Float_t fSoftTrackMaxPt_ep; // max pt for soft tracks
258  Float_t fExcludeLeadingJetsFromFit; // exclude n leading jets from fit
259  TArrayD* fCentralityClasses; //-> centrality classes (maximum 10)
261 
262  // event mixing
265  Int_t fNMIXtracks;
266  Int_t fNMIXevents;
267  Int_t fCentBinSize; // centrality bin size of mixed event pools
268  Int_t fReduceStatsCent; // bins to use for reduced statistics of sparse
269 
270  // event selection types
273 
274  // efficiency correction
275  Int_t fDoEffCorr;
276 
277  // correct jet pt
278  Bool_t fcorrJetPt;
279 
280  // switches for plots
284  Bool_t makeQAhistos;
288  Bool_t allpidAXIS;
289 
290  // Cut type (EMCAL/TPC acceptance)
291  TString fcutType;
292 
293  // switches for PID
294  Bool_t doPID;
297 
298  // do EP resolution switch
300 
301  // do comment switch
302  Bool_t doComments;
303 
304  // do flavour jet analysis switch, and set flavour jet tag
306  Int_t fJetFlavTag;
307 
308  // beam type
310 
311  // local rho value
312  Double_t fLocalRhoVal;
313 
314  // object names
315  TString fTracksName; // name of track collection (for signal events)
316  TString fTracksNameME; // name of mixed event track collection
317  TString fJetsName; // name of jet collection
318  TString fCaloClustersName; // name of Calo Cluster collection
319 
320  // event counter
321  Int_t event;
322 
323  // boolean functions for PID
327 
328  // event pool
329  TObjArray *CloneAndReduceTrackList(TObjArray* tracks);
330  AliEventPoolManager *fPoolMgr;
331 
332  // PID
333  AliPIDResponse *fPIDResponse; // PID response object
334  AliTPCPIDResponse *fTPCResponse; // TPC pid response object
335 
336  private:
337  // needed for PID, track objects
338  AliESDEvent *fESD;
339  AliAODEvent *fAOD;
340  AliVEvent *fVevent;
341 
345 
350 
353 // TH2F *fHistTOFsignal;//!
354 
358  TH1F *fHistTrackPt[6];
359  TH1F *fHistEP0[6];
360  TH1F *fHistEP0A[6];
361  TH1F *fHistEP0C[6];
362  TH2F *fHistEPAvsC[6];
364  TH2F *fHistJetPtvsdEP[6];
366  TH2F *fHistRhovsdEP[6];
369  TH2F *fHistJetPtArea[6];
371  TH2F *fHistJetPtNcon[6];
380 
381  TH1 *fHistMult;
392 
395 
397  TH2 *fHistTrackEtaPhi[4][7];
398 
404 
405  TH1 *fHistJetPt[6];
406  TH1 *fHistJetPtBias[6];
407  TH1 *fHistJetPtTT[6];
409  TH2 *fHistJetH[6][5][3];
410  TH2 *fHistJetHBias[6][5][3];
411  TH2 *fHistJetHTT[6][5][3];
415 
416  // more QA histos
423 
424  // PID status histo's
425  TH1 *fHistPID;
426 
427  // THn Sparse's
428  THnSparse *fhnPID;
429  THnSparse *fhnMixedEvents;
430  THnSparse *fhnJH;
431  THnSparse *fhnCorr;
432 
433  // EP resoltuion profiles and chi2 array
434  TProfile *fProfV2Resolution[10];
435  TProfile *fProfV3Resolution[10];
436  TProfile *fProfV4Resolution[10];
437  TProfile *fProfV5Resolution[10];
438  TArrayD* fChi2A; // chi vs cent for vzero A ep_2
439  TArrayD* fChi2C; // chi vs cent for vzero C ep_2
440  TArrayD* fChi3A; // chi vs cent for vzero A ep_3
441  TArrayD* fChi3C; // chi vs cent for vzero C ep_3
442  Bool_t fUseChiWeightForVZERO; // use chi weight for vzero
443 
444  // save containers in clones array (object)
445  TClonesArray *fTracksFromContainer;
446 
447  // container objects
451 
452  // container specifier
453  Int_t fContainerAllJets; // number of container with all full jets
454  Int_t fContainerPIDJets; // number of container with full jets meeting Pt cut (for PID)
455 
456  //TObjArray *fTrgJet; //!jets
457 // ***********************************************************
458 
459  //Declare it private to avoid compilation warning
461 
463  ClassDef(AliAnalysisTaskEmcalJetHadEPpid, 4); // Emcal jet hadron PID - Event plane dependence
464 };
465 #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
TH1 * fHistTrackPtallcent
// phi distrubtion of mixed events
virtual void SetCaloClustersName(const char *cn)
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)
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 THnSparse * NewTHnSparseFPID(const char *name, UInt_t entries)
AliClusterContainer * fCaloClustersCont
Tracks.
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
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
AliAnalysisTaskEmcalJetHadEPpid & operator=(const AliAnalysisTaskEmcalJetHadEPpid &)