1 #ifndef AliAnalysisTaskEMCalHFEpA_cxx
2 #define AliAnalysisTaskEMCalHFEpA_cxx
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 ////////////////////////////////////////////////////////////////////////
9 // Task for Heavy-flavour electron analysis in pPb collisions //
10 // (+ Electron-Hadron Jetlike Azimuthal Correlation) //
12 // version: June 04, 2014. //
15 // Elienos Pereira de Oliveira Filho (epereira@cern.ch) //
16 // Cristiane Jahnke (cristiane.jahnke@cern.ch) //
18 ////////////////////////////////////////////////////////////////////////
23 class AliESDtrackCuts;
25 class AliHFEcontainer;
28 class AliHFEpidQAmanager;
35 class AliSelectNonHFE;
36 class AliEventPoolManager;
40 class AliCaloTrackAODReader;
41 class AliCaloTrackReader;
43 class AliEMCALRecoUtils;
45 class AliCalorimeterUtils;
47 // --- ROOT system ---
50 #include <TObjArray.h>
53 #include <TGeoMatrix.h>
55 //--- ANALYSIS system ---
58 class AliAODPWG4Particle;
59 class AliAODCaloCluster;
61 class AliPHOSGeoUtils;
62 class AliEMCALGeometry;
63 #include "AliEMCALRecoUtils.h"
66 //______________________________________________________________________
68 #include "AliAnalysisTaskSE.h"
69 #include "AliHFEpid.h"
71 //______________________________________________________________________
73 //______________________________________________________________________
74 class AliAnalysisTaskEMCalHFEpA : public AliAnalysisTaskSE
76 //______________________________________________________________________
78 AliAnalysisTaskEMCalHFEpA();
79 AliAnalysisTaskEMCalHFEpA(const char *name);
80 virtual ~AliAnalysisTaskEMCalHFEpA();
82 virtual void UserCreateOutputObjects();
83 virtual void UserExec(Option_t *option);
84 virtual void Terminate(Option_t *);
87 void SetAssHadronPtRange(Double_t AssHadronPtMin, Double_t AssHadronPtMax) {fAssHadronPtMin = AssHadronPtMin; fAssHadronPtMax = AssHadronPtMax; };
88 void SetHFECuts(AliHFEcuts * const cuts) {fCuts = cuts;};
89 void SetRejectKinkMother(Bool_t rejectKinkMother = kFALSE) {fRejectKinkMother = rejectKinkMother;};
90 void SetCorrelationAnalysis(Bool_t CorrelationFlag=kTRUE) {fCorrelationFlag = CorrelationFlag;};
91 void SetMCanalysis() {fIsMC = kTRUE;};
92 void SetCentrality(Double_t CentralityMin, Double_t CentralityMax) { fCentralityMin = CentralityMin; fCentralityMax = CentralityMax; fHasCentralitySelection = kTRUE; };
93 void SetAODanalysis(Bool_t IsAOD) {fIsAOD = IsAOD;};
94 void SetEventMixing(Bool_t EventMixingFlag) { fEventMixingFlag = EventMixingFlag;};
95 void SetNonHFEmassCut(Double_t MassCut) { fMassCut = MassCut; fMassCutFlag = kTRUE;};
96 void SetEtaCut(Double_t EtaCutMin,Double_t EtaCutMax ) { fEtaCutMin = EtaCutMin; fEtaCutMax = EtaCutMax; };
98 void SetdPhidEtaCut(Double_t dPhiCut, Double_t dEtaCut ) { fdPhiCut = dPhiCut;fdEtaCut = dEtaCut ;};
100 void SetEoverPCut(Double_t EoverPCutMin,Double_t EoverPCutMax ) { fEoverPCutMin = EoverPCutMin; fEoverPCutMax = EoverPCutMax; };
102 void SetM02Cut(Double_t M02CutMin,Double_t M02CutMax ) { fM02CutMin = M02CutMin; fM02CutMax = M02CutMax; };
103 void SetM20Cut(Double_t M20CutMin,Double_t M20CutMax ) { fM20CutMin = M20CutMin; fM20CutMax = M20CutMax; };
106 void SetNonHFEangleCut(Double_t AngleCut) { fAngleCut = AngleCut; fAngleCutFlag = kTRUE;};
107 void SetNonHFEchi2Cut(Double_t Chi2Cut) { fChi2Cut = Chi2Cut; fChi2CutFlag = kTRUE;};
108 void SetNonHFEdcaCut(Double_t DCAcut) { fDCAcut = DCAcut; fDCAcutFlag = kTRUE;};
109 void SetUseEMCal() { fUseEMCal=kTRUE;};
110 void SetUseTrigger() { fUseTrigger=kTRUE;};
111 void SetUseShowerShapeCut(Bool_t UseShowerShapeCut=kFALSE) { fUseShowerShapeCut=UseShowerShapeCut;};
112 void SetBackground(Bool_t FillBackground=kFALSE) { fFillBackground=FillBackground;};
113 void SetEMCalTriggerEG1() { fEMCEG1=kTRUE; };
114 void SetEMCalTriggerEG2() { fEMCEG2=kTRUE; };
115 void SetCentralityEstimator(Int_t Estimator) { fEstimator=Estimator; }; //0 = V0A, 1 = Other
116 void SetAdditionalCuts(Double_t PtMinAsso, Int_t TpcNclsAsso) {fPtMinAsso = PtMinAsso; fTpcNclsAsso = TpcNclsAsso;};
117 void SetSPDCutForHadrons() {fAssocWithSPD = kTRUE;};
120 AliHFEpid *GetPID() const {return fPID;};
122 //AliEMCALGeometry * GetEMCALGeometry() const { return fEMCALGeo; }
123 //AliCalorimeterUtils * GetCaloUtils() const { return fCaloUtils; }
124 /*AliCalorimeterUtils * GetCaloUtils() { if(!fCaloUtils) fCaloUtils = new AliCalorimeterUtils();
125 return fCaloUtils ; }*/
127 //______________________________________________________________________
129 //______________________________________________________________________
132 //Function to process track cuts
133 Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track);
134 //Function to process eh analysis
135 void ElectronHadronCorrelation(AliVTrack *track, Int_t trackIndex, AliVParticle *vtrack);
136 //Function to find non-HFE and fill histos
137 void Background(AliVTrack *track, Int_t trackIndex, AliVParticle *vtrack, Bool_t IsTPConly);
138 //Selected Hadrons, for mixed event analysis
139 TObjArray* SelectedHadrons();
140 //DiHadron Correlation Background
141 void DiHadronCorrelation(AliVTrack *track, Int_t trackIndex);
142 //Find Mothers (Finde HFE and NonHFE from MC information)
143 Bool_t FindMother(Int_t mcIndex);
144 Bool_t ContainsBadChannel(TString calorimeter,UShort_t* cellList, Int_t nCells);
145 TArrayI GetTriggerPatches(Bool_t IsEventEMCALL0, Bool_t IsEventEMCALL1);
146 Double_t CalculateWeight(Int_t pdg_particle, Double_t x);
148 //Flags for specifics analysis
149 Bool_t fCorrelationFlag;
153 Bool_t fUseShowerShapeCut;
154 Bool_t fFillBackground;
155 Bool_t fAssocWithSPD;
161 //Used in the function FindMother
173 AliAODEvent *fAOD; /// new
174 AliVEvent *fVevent; /// new
175 AliESDtrackCuts *fPartnerCuts;
177 AliPIDResponse *fPidResponse;
178 AliSelectNonHFE *fNonHFE;
180 //For the case of AOD analysis
181 Bool_t fIsAOD; //flag for AOD analysis
183 //For Centrality Selection
184 AliCentrality *fCentrality;
185 Double_t fCentralityMin;
186 Double_t fCentralityMax;
187 Bool_t fHasCentralitySelection;
188 TH1F *fCentralityHist;
189 TH1F *fCentralityHistPass;
196 //AliESDCaloCluster *fClusESD;
220 TH1F *fPtElec_ULS_NoPid;
221 TH1F *fPtElec_LS_NoPid;
223 TH1F *fPtElec_ULS_MC;
224 TH1F *fPtElec_ULS_MC_weight;
229 TH1F *fPtElec_ULS_weight;
230 TH1F *fPtElec_LS_weight;
231 TH1F *fPtElec_ULS2_weight;
232 TH1F *fPtElec_LS2_weight;
242 TH2F **fEoverP_tpc_p_trigger;
243 TH2F **fEoverP_tpc_pt_trigger;
246 TH1F **fTPCnsigma_pt;
248 TH2F *fTPCnsigma_pt_2D;
249 TH2F *fShowerShapeCut;
250 TH2F *fShowerShapeM02_EoverP;
251 TH2F *fShowerShapeM20_EoverP;
252 TH2F *fShowerShape_ha;
253 TH2F *fShowerShape_ele;
254 TH2F *fTPCnsigma_eta;
255 TH2F *fTPCnsigma_phi;
257 TH1F *fECluster_pure;
258 TH1F *fECluster_not_exotic;
259 TH1F *fECluster_not_exotic1;
260 TH1F *fECluster_not_exotic2;
261 TH1F *fECluster_exotic;
262 TH1F *fNCluster_pure;
263 TH1F *fNCluster_pure_aod;
264 TH2F *fNCluster_ECluster;
265 TH2F *fNcells_energy;
266 TH2F *fNcells_energy_elec_selected;
267 TH2F *fNcells_energy_not_exotic;
272 TH2F *fpt_reco_pt_MC_num;
273 TH2F *fpt_reco_pt_MC_den;
282 TH1F *fSPD_track_vtx1;
283 TH1F *fSPD_track_vtx2;
292 TH2F **fTPCNcls_EoverP;
299 TH2F **fNcells_EoverP;
300 TH1F **fNcells_electrons;
301 TH1F **fNcells_hadrons;
302 TH1F **fECluster_ptbins;
303 TH1F **fEoverP_ptbins;
304 TH1F **fEoverP_wSSCut;
307 TH2F **fTPCnsigma_eta_electrons;
308 TH2F **fTPCnsigma_eta_hadrons;
309 TH2F *fEoverP_pt_pions;
310 TH2F *ftpc_p_EoverPcut;
311 TH2F *fnsigma_p_EoverPcut;
312 TH2F *fEoverP_pt_pions2;
314 TH2F *fEoverP_pt_hadrons;
315 //Electron-Hadron Correlation Histograms
319 TH2F **fCEtaPhi_ULS_NoP;
320 TH2F **fCEtaPhi_LS_NoP;
321 TH2F **fCEtaPhi_ULS_Weight;
322 TH2F **fCEtaPhi_LS_Weight;
323 TH2F **fCEtaPhi_ULS_NoP_Weight;
324 TH2F **fCEtaPhi_LS_NoP_Weight;
342 Double_t fEoverPCutMin;
343 Double_t fEoverPCutMax;
352 Bool_t fAngleCutFlag;
355 //Correlation Function
356 Double_t fAssHadronPtMin;
357 Double_t fAssHadronPtMax;
358 //Non-HFE reconstruction efficiency
359 TH1F *fPtBackgroundBeforeReco;
360 TH1F *fPtBackgroundBeforeReco2;
361 TH1F *fPtBackgroundBeforeReco_weight;
362 TH1F *fPtBackgroundBeforeReco2_weight;
363 TH2F *fpT_m_electron;
364 TH2F *fpT_gm_electron;
365 TH1F *fPtBackgroundAfterReco;
368 //Tracking Efficiency
369 TH1F *fPtMCparticleAll;
370 TH1F *fPtMCparticleAll_nonPrimary;
371 TH1F *fPtMCparticleAlle_nonPrimary;
372 TH1F *fPtMCparticleAlle_Primary;
373 TH1F *fPtMCparticleReco;
374 TH1F *fPtMCparticleReco_nonPrimary;
375 TH1F *fPtMCparticleAllHfe1;
376 TH1F *fPtMCparticleRecoHfe1;
377 TH1F *fPtMCparticleAllHfe2;
378 TH1F *fPtMCparticleRecoHfe2;
379 TH1F *fPtMCelectronAfterAll;
380 TH1F *fPtMCelectronAfterAll_unfolding;
381 TH1F *fPtMCelectronAfterAll_nonPrimary;
382 TH1F *fPtMCelectronAfterAll_Primary;
391 TH1F *fPtMC_EMCal_All;
392 TH1F *fPtMC_EMCal_Selected;
394 TH1F *fPtMC_TPC_Selected;
395 TH1F *fPt_track_match_den;
396 TH1F *fPt_track_match_num;
399 TH1F *fPtMCWithLabel;
400 TH1F *fPtMCWithoutLabel;
401 TH1F *fPtIsPhysicaPrimary;
403 //For the HFE package
404 AliHFEcuts *fCuts; // Cut Collection for HFE
406 //AliCaloTrackAODReader *reader;
407 AliCFManager *fCFM; // Correction Framework Manager
408 AliHFEpid *fPID; // PID
409 AliHFEpidQAmanager *fPIDqa; // PID QA manager
412 AliStack *fMCstack; //
413 Bool_t fRejectKinkMother; //
415 TParticle *fMCtrackMother;
416 TParticle *fMCtrackGMother;
417 TParticle *fMCtrackGGMother;
418 TParticle *fMCtrackGGGMother;
419 TClonesArray *fMCarray;
420 AliAODMCHeader *fMCheader;
421 AliAODMCParticle *fMCparticle;
422 AliAODMCParticle *fMCparticle2;
423 AliAODMCParticle *fMCparticleMother;
424 AliAODMCParticle *fMCparticleGMother;
425 AliAODMCParticle *fMCparticleGGMother;
426 AliAODMCParticle *fMCparticleGGGMother;
427 AliMCEventHandler *fEventHandler;
428 AliMCEvent *fMCevent;
430 //______________________________________________________________________
431 //Mixed event analysis
432 AliEventPoolManager *fPoolMgr;
434 TObjArray *fTracksClone;
437 TH2F **fCEtaPhi_Inc_EM;
439 TH2F **fCEtaPhi_ULS_EM;
440 TH2F **fCEtaPhi_LS_EM;
442 TH2F **fCEtaPhi_ULS_Weight_EM;
443 TH2F **fCEtaPhi_LS_Weight_EM;
447 Bool_t fEventMixingFlag;
448 //______________________________________________________________________
450 //______________________________________________________________________
451 //Di-hadron correlation
452 TH2F **fCEtaPhi_Inc_DiHadron;
453 TH1F *fPtTrigger_Inc;
455 //AliEMCALRecoUtils *fEMCALRecoUtils; // EMCAL Reco Utils //exotic
456 //AliEMCALGeometry *fEMCALGeo ; //! EMCAL geometry pointer
457 //AliCalorimeterUtils *fCaloUtils;
459 Int_t fBitEGA; // Trigger bit on VCaloTrigger for EGA
462 //______________________________________________________________________
464 AliAnalysisTaskEMCalHFEpA(const AliAnalysisTaskEMCalHFEpA&); // not implemented
465 AliAnalysisTaskEMCalHFEpA& operator=(const AliAnalysisTaskEMCalHFEpA&); // not implemented
467 ClassDef(AliAnalysisTaskEMCalHFEpA, 1); // example of analysis
468 //______________________________________________________________________
471 ///_________________________________________________________________________________________________
472 ///Class copied from : $ALICE_ROOT/PWGCF/Correlations/DPhi/AliAnalysisTaskLongRangeCorrelations.h
473 ///Author: Christoph Mayer
474 class AliEHCParticle : public TObject {
476 AliEHCParticle(Double_t eta=0, Double_t phi=0, Double_t pt=0)
477 : fEta(eta), fPhi(phi), fPt(pt) {}
478 virtual ~AliEHCParticle() {}
480 Double_t Eta() const { return fEta; }
481 Double_t Phi() const { return fPhi; }
482 Double_t Pt() const { return fPt; }
486 AliEHCParticle(const AliEHCParticle&);
487 AliEHCParticle& operator=(const AliEHCParticle&);
493 ClassDef(AliEHCParticle, 1);
495 ///_________________________________________________________________________________________________