AliPhysics  fde8a9f (fde8a9f)
 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
135 
136  // set centrality classes up
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;}
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
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  virtual void SetRhoName(const char *rn) { fRhoName = rn; }
174 
175  // bias and cuts - setters
176  virtual void SetAreaCut(Double_t a) { fAreacut = a; }
177  virtual void SetTrkBias(Double_t b) { fTrkBias = b; } //require a track with pt > b in jet
178  virtual void SetClusBias(Double_t b) { fClusBias = b; } //require a cluster with pt > b in jet
179  virtual void SetTrkEta(Double_t e) { fTrkEta = e; } //eta range of the associated tracks
180  virtual void SetJetPtcut(Double_t jpt) { fJetPtcut = jpt; } // jet pt cut
181  virtual void SetJetRad(Double_t jrad) { fJetRad = jrad; } // jet radius
182  virtual void SetConstituentCut(Double_t constCut) { fConstituentCut = constCut; } // constituent Cut
183 
184  // eta and phi limits of jets - setters
185  virtual void SetJetEta(Double_t emin, Double_t emax) { fEtamin = emin; fEtamax = emax; }
186  virtual void SetJetPhi(Double_t pmin, Double_t pmax) { fPhimin = pmin; fPhimax = pmax; }
187 
188  // event mixing - setters
189  virtual void SetEventMixing(Int_t yesno) { fDoEventMixing=yesno; }
190  virtual void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
191  virtual void SetNMixedTr(Int_t nmt) { fNMIXtracks = nmt; }
192  virtual void SetNMixedEvt(Int_t nme) { fNMIXevents = nme; }
193 
194  // event trigger/mixed selection - setters
195  virtual void SetTriggerEventType(UInt_t te) { fTriggerEventType = te; }
196  virtual void SetMixedEventType(UInt_t me) { fMixingEventType = me; }
197  virtual void SetCentBinSize(Int_t centbins) { fCentBinSize = centbins; }
198  virtual void SetReduceStatsCent(Int_t red) { fReduceStatsCent = red; }
199 
200  // efficiency correction setter
201  void SetDoEffCorr(Int_t effcorr) { fDoEffCorr = effcorr; }
202 
203  // use local rho to correct jet pt in correlation sparses
204  void SetCorrectJetPt(Bool_t cpt) { fcorrJetPt = cpt; }
205 
206  // framework setters NEW/OLD
208 
209  // jet container - setters
212 
213 protected:
214  // functions
215  void ExecOnce();
216  virtual Bool_t Notify();
217  Bool_t Run();
218  virtual void Terminate(Option_t *);
219  virtual Int_t AcceptMyJet(AliEmcalJet *jet); // applies basic jet tests/cuts before accepting
220  virtual Int_t GetCentBin(Double_t cent) const; // centrality bin of event
221  Double_t RelativePhi(Double_t mphi,Double_t vphi) const; // relative jet track angle
222  Double_t RelativeEPJET(Double_t jetAng, Double_t EPAng) const; // relative jet event plane angle
223  virtual Int_t GetEtaBin(Double_t eta) const; // eta bins
224  virtual Int_t GetpTjetBin(Double_t pt) const; // jet pt bins
225  virtual Int_t GetpTtrackBin(Double_t pt) const; // track pt bins
226  virtual Int_t GetzVertexBin(Double_t zVtx) const; // zVertex bin
227  void SetfHistPIDcounterLabels(TH1* fHistPID) const; // PID counter
228  void SetfHistQAcounterLabels(TH1* h) const; // QA counter
229  void SetfHistEvtSelQALabels(TH1* h) const; // Event Selection Counter
230  //virtual Int_t AcceptFlavourJet(AliEmcalJet *jet, Int_t NUM, Int_t NUM2, Int_t NUM3); // flavour jet acceptor
231  virtual Int_t AcceptFlavourJet(AliEmcalJet *jet, Int_t NUM); // flavour jet acceptor
232  Double_t EffCorrection(Double_t trkETA, Double_t trkPT, Int_t effswitch) const; // efficiency correction function
234  void CalculateEventPlaneVZERO(Double_t vzero[2][2]) const;
235  void CalculateEventPlaneCombinedVZERO(Double_t* comb) const;
236  void CalculateEventPlaneTPC(Double_t* tpc);
237  void CalculateEventPlaneResolution(Double_t vzero[2][2], Double_t* vzeroComb, Double_t* tpc);
238  TH1* FillEventTriggerQA(TH1* h, UInt_t t); // filled event trigger QA plots
239 
240  // parameters of detector to cut on for event
241  Double_t fPhimin; // phi min
242  Double_t fPhimax; // phi max
243  Double_t fEtamin; // eta min
244  Double_t fEtamax; // eta max
245  Double_t fAreacut; // area cut
246  Double_t fTrkBias; // track bias
247  Double_t fClusBias; // cluster bias
248  Double_t fTrkEta; // eta min/max of tracks
249  Double_t fJetPtcut; // jet pt to cut on for correlations
250  Double_t fJetRad; // jet radius
251  Double_t fConstituentCut; // jet constituent cut
252 
253  // esd track cuts
254  AliESDtrackCuts *fesdTrackCuts; // esdTrackCuts
255 
256  // detector type
257  detectorType fDetectorType; // type of detector
258 
259  // used for event plane resolution calculation
260  Double_t fSoftTrackMinPt_ep; // min pt for soft tracks
261  Double_t fSoftTrackMaxPt_ep; // max pt for soft tracks
264  Float_t fExcludeLeadingJetsFromFit; // exclude n leading jets from fit
265  TArrayD* fCentralityClasses; //-> centrality classes (maximum 10)
267 
268  // event mixing
273  Int_t fCentBinSize; // centrality bin size of mixed event pools
274  Int_t fReduceStatsCent; // bins to use for reduced statistics of sparse
275 
276  // event selection types
279 
280  // efficiency correction
282 
283  // correct jet pt
285 
286  // switches for plots
295 
296  // Cut type (EMCAL/TPC acceptance)
298 
299  // switches for PID
303 
304  // do EP resolution switch
306 
307  // do comment switch
309 
310  // do flavour jet analysis switch, and set flavour jet tag
313 
314  // do setup for OLD/NEW track framework
316 
317  // beam type
319 
320  // local rho value
322 
323  // object names
324  TString fTracksName; // name of track collection (for signal events)
325  TString fTracksNameME; // name of mixed event track collection
326  TString fJetsName; // name of jet collection
327  TString fCaloClustersName; // name of Calo Cluster collection
328  TString fRhoName; // name of Rho object
329 
330  // event counter
332 
333  // boolean functions for PID
337 
338  // event pool
340  AliEventPoolManager *fPoolMgr;
341 
342  // PID
343  AliPIDResponse *fPIDResponse; // PID response object
344  AliTPCPIDResponse *fTPCResponse; // TPC pid response object
345 
346  private:
347  // needed for PID, track objects
350  AliVEvent *fVevent;
351 
355 
360 
363 // TH2F *fHistTOFsignal;//!
364 
368  TH1F *fHistTrackPt[6];
369  TH1F *fHistEP0[6];
370  TH1F *fHistEP0A[6];
371  TH1F *fHistEP0C[6];
390 
403 
415 
418 
421 
427 
432  TH2 *fHistJetH[6][5][3];
433  TH2 *fHistJetHBias[6][5][3];
434  TH2 *fHistJetHTT[6][5][3];
438 
439  // more QA histos
446 
447  // PID status histo's
449 
450  // THn Sparse's
451  THnSparse *fhnPID;
452  THnSparse *fhnMixedEvents;
453  THnSparse *fhnJH;
454  THnSparse *fhnCorr;
455 
456  // EP resoltuion profiles and chi2 array
457  TProfile *fProfV2Resolution[10];
458  TProfile *fProfV3Resolution[10];
459  TProfile *fProfV4Resolution[10];
460  TProfile *fProfV5Resolution[10];
461  TArrayD* fChi2A; // chi vs cent for vzero A ep_2
462  TArrayD* fChi2C; // chi vs cent for vzero C ep_2
463  TArrayD* fChi3A; // chi vs cent for vzero A ep_3
464  TArrayD* fChi3C; // chi vs cent for vzero C ep_3
465  Bool_t fUseChiWeightForVZERO; // use chi weight for vzero
466 
467  // save containers in clones array (object)
468  TClonesArray *fTracksFromContainer;
469 
470  // container objects
472 // AliParticleContainer *fTracksCont; //!Tracks - not quality cuts applied to this container
475 
476  // container specifier
477  Int_t fContainerAllJets; // number of container with all full jets
478  Int_t fContainerPIDJets; // number of container with full jets meeting Pt cut (for PID)
479 
480  //TObjArray *fTrgJet; //!jets
481 // ***********************************************************
482 
483  //Declare it private to avoid compilation warning
485 
487  ClassDef(AliAnalysisTaskEmcalJetHadEPpid, 4); // Emcal jet hadron PID - Event plane dependence
488 };
489 #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)
double Double_t
Definition: External.C:58
THnSparse * fhnJH
// mixed events matrix
Definition: External.C:236
AliEmcalJet * fLeadingJet
number of accepted tracks
virtual void SetConstituentCut(Double_t constCut)
Definition: External.C:244
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)
TCanvas * c
Definition: TestFitELoss.C:172
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
int Int_t
Definition: External.C:63
virtual THnSparse * NewTHnSparseFCorr(const char *name, UInt_t entries)
TH1F * fHistJetHaddPHI
// mixed events phi-eta distributions
TProfile * fProfV3Resolution[10]
resolution parameters for v2
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
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)
void SetSoftTrackMinMaxPt_ep(Double_t min, Double_t max)
virtual Int_t AcceptFlavourJet(AliEmcalJet *jet, Int_t NUM)
Definition: External.C:220
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 char Option_t
Definition: External.C:48
const Int_t nbins
bool Bool_t
Definition: External.C:53
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.
Definition: External.C:196
AliAnalysisTaskEmcalJetHadEPpid & operator=(const AliAnalysisTaskEmcalJetHadEPpid &)