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: March 18, 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;
244 TH1F **fTPCnsigma_pt;
246 TH2F *fTPCnsigma_pt_2D;
247 TH2F *fShowerShapeCut;
248 TH2F *fShowerShapeM02_EoverP;
249 TH2F *fShowerShapeM20_EoverP;
250 TH2F *fShowerShape_ha;
251 TH2F *fShowerShape_ele;
252 TH2F *fTPCnsigma_eta;
253 TH2F *fTPCnsigma_phi;
255 TH1F *fECluster_pure;
256 TH1F *fECluster_not_exotic;
257 TH1F *fECluster_not_exotic1;
258 TH1F *fECluster_not_exotic2;
259 TH1F *fECluster_exotic;
260 TH1F *fNCluster_pure;
261 TH1F *fNCluster_pure_aod;
262 TH2F *fNCluster_ECluster;
263 TH2F *fNcells_energy;
264 TH2F *fNcells_energy_elec_selected;
265 TH2F *fNcells_energy_not_exotic;
270 TH2F *fpt_reco_pt_MC_num;
271 TH2F *fpt_reco_pt_MC_den;
280 TH1F *fSPD_track_vtx1;
281 TH1F *fSPD_track_vtx2;
290 TH2F **fTPCNcls_EoverP;
297 TH2F **fNcells_EoverP;
298 TH1F **fNcells_electrons;
299 TH1F **fNcells_hadrons;
300 TH1F **fECluster_ptbins;
301 TH1F **fEoverP_ptbins;
302 TH1F **fEoverP_wSSCut;
305 TH2F **fTPCnsigma_eta_electrons;
306 TH2F **fTPCnsigma_eta_hadrons;
307 TH2F *fEoverP_pt_pions;
308 TH2F *ftpc_p_EoverPcut;
309 TH2F *fnsigma_p_EoverPcut;
310 TH2F *fEoverP_pt_pions2;
312 TH2F *fEoverP_pt_hadrons;
313 //Electron-Hadron Correlation Histograms
317 TH2F **fCEtaPhi_ULS_NoP;
318 TH2F **fCEtaPhi_LS_NoP;
319 TH2F **fCEtaPhi_ULS_Weight;
320 TH2F **fCEtaPhi_LS_Weight;
321 TH2F **fCEtaPhi_ULS_NoP_Weight;
322 TH2F **fCEtaPhi_LS_NoP_Weight;
340 Double_t fEoverPCutMin;
341 Double_t fEoverPCutMax;
350 Bool_t fAngleCutFlag;
353 //Correlation Function
354 Double_t fAssHadronPtMin;
355 Double_t fAssHadronPtMax;
356 //Non-HFE reconstruction efficiency
357 TH1F *fPtBackgroundBeforeReco;
358 TH1F *fPtBackgroundBeforeReco2;
359 TH1F *fPtBackgroundBeforeReco_weight;
360 TH1F *fPtBackgroundBeforeReco2_weight;
361 TH2F *fpT_m_electron;
362 TH2F *fpT_gm_electron;
363 TH1F *fPtBackgroundAfterReco;
366 //Tracking Efficiency
367 TH1F *fPtMCparticleAll;
368 TH1F *fPtMCparticleAll_nonPrimary;
369 TH1F *fPtMCparticleAlle_nonPrimary;
370 TH1F *fPtMCparticleAlle_Primary;
371 TH1F *fPtMCparticleReco;
372 TH1F *fPtMCparticleReco_nonPrimary;
373 TH1F *fPtMCparticleAllHfe1;
374 TH1F *fPtMCparticleRecoHfe1;
375 TH1F *fPtMCparticleAllHfe2;
376 TH1F *fPtMCparticleRecoHfe2;
377 TH1F *fPtMCelectronAfterAll;
378 TH1F *fPtMCelectronAfterAll_unfolding;
379 TH1F *fPtMCelectronAfterAll_nonPrimary;
380 TH1F *fPtMCelectronAfterAll_Primary;
389 TH1F *fPtMC_EMCal_All;
390 TH1F *fPtMC_EMCal_Selected;
392 TH1F *fPtMC_TPC_Selected;
393 TH1F *fPt_track_match_den;
394 TH1F *fPt_track_match_num;
397 TH1F *fPtMCWithLabel;
398 TH1F *fPtMCWithoutLabel;
399 TH1F *fPtIsPhysicaPrimary;
401 //For the HFE package
402 AliHFEcuts *fCuts; // Cut Collection for HFE
404 //AliCaloTrackAODReader *reader;
405 AliCFManager *fCFM; // Correction Framework Manager
406 AliHFEpid *fPID; // PID
407 AliHFEpidQAmanager *fPIDqa; // PID QA manager
410 AliStack *fMCstack; //
411 Bool_t fRejectKinkMother; //
413 TParticle *fMCtrackMother;
414 TParticle *fMCtrackGMother;
415 TParticle *fMCtrackGGMother;
416 TParticle *fMCtrackGGGMother;
417 TClonesArray *fMCarray;
418 AliAODMCHeader *fMCheader;
419 AliAODMCParticle *fMCparticle;
420 AliAODMCParticle *fMCparticle2;
421 AliAODMCParticle *fMCparticleMother;
422 AliAODMCParticle *fMCparticleGMother;
423 AliAODMCParticle *fMCparticleGGMother;
424 AliAODMCParticle *fMCparticleGGGMother;
425 AliMCEventHandler *fEventHandler;
426 AliMCEvent *fMCevent;
428 //______________________________________________________________________
429 //Mixed event analysis
430 AliEventPoolManager *fPoolMgr;
432 TObjArray *fTracksClone;
435 TH2F **fCEtaPhi_Inc_EM;
437 TH2F **fCEtaPhi_ULS_EM;
438 TH2F **fCEtaPhi_LS_EM;
440 TH2F **fCEtaPhi_ULS_Weight_EM;
441 TH2F **fCEtaPhi_LS_Weight_EM;
445 Bool_t fEventMixingFlag;
446 //______________________________________________________________________
448 //______________________________________________________________________
449 //Di-hadron correlation
450 TH2F **fCEtaPhi_Inc_DiHadron;
451 TH1F *fPtTrigger_Inc;
453 //AliEMCALRecoUtils *fEMCALRecoUtils; // EMCAL Reco Utils //exotic
454 //AliEMCALGeometry *fEMCALGeo ; //! EMCAL geometry pointer
455 //AliCalorimeterUtils *fCaloUtils;
457 Int_t fBitEGA; // Trigger bit on VCaloTrigger for EGA
460 //______________________________________________________________________
462 AliAnalysisTaskEMCalHFEpA(const AliAnalysisTaskEMCalHFEpA&); // not implemented
463 AliAnalysisTaskEMCalHFEpA& operator=(const AliAnalysisTaskEMCalHFEpA&); // not implemented
465 ClassDef(AliAnalysisTaskEMCalHFEpA, 1); // example of analysis
466 //______________________________________________________________________
469 ///_________________________________________________________________________________________________
470 ///Class copied from : $ALICE_ROOT/PWGCF/Correlations/DPhi/AliAnalysisTaskLongRangeCorrelations.h
471 ///Author: Christoph Mayer
472 class AliEHCParticle : public TObject {
474 AliEHCParticle(Double_t eta=0, Double_t phi=0, Double_t pt=0)
475 : fEta(eta), fPhi(phi), fPt(pt) {}
476 virtual ~AliEHCParticle() {}
478 Double_t Eta() const { return fEta; }
479 Double_t Phi() const { return fPhi; }
480 Double_t Pt() const { return fPt; }
484 AliEHCParticle(const AliEHCParticle&);
485 AliEHCParticle& operator=(const AliEHCParticle&);
491 ClassDef(AliEHCParticle, 1);
493 ///_________________________________________________________________________________________________