1 #ifndef ALIANALYSISTASKEMCAL_H
2 #define ALIANALYSISTASKEMCAL_H
4 // $Id: AliAnalysisTaskEmcalDev.h 64518 2013-10-14 12:44:52Z loizides $
9 class AliEmcalParticle;
17 class AliEMCALGeometry;
18 class AliParticleContainer;
19 class AliClusterContainer;
20 class AliGenPythiaEventHeader;
21 class AliVCaloTrigger;
22 class AliAnalysisUtils;
23 class AliEmcalTriggerPatchInfo;
27 #include "AliAnalysisTaskSE.h"
29 class AliAnalysisTaskEmcal : public AliAnalysisTaskSE {
40 kND = -1, //not defined
45 AliAnalysisTaskEmcal();
46 AliAnalysisTaskEmcal(const char *name, Bool_t histo=kFALSE);
47 virtual ~AliAnalysisTaskEmcal();
49 AliParticleContainer *AddParticleContainer(const char *n);
50 AliClusterContainer *AddClusterContainer(const char *n);
51 AliParticleContainer *GetParticleContainer(Int_t i=0) const;
52 AliClusterContainer *GetClusterContainer(Int_t i=0) const;
53 AliParticleContainer *GetParticleContainer(const char* name) const;
54 AliClusterContainer *GetClusterContainer(const char* name) const;
55 void RemoveParticleContainer(Int_t i=0) { fParticleCollArray.RemoveAt(i) ; }
56 void RemoveClusterContainer(Int_t i=0) { fClusterCollArray.RemoveAt(i) ; }
57 void SetCaloCellsName(const char *n) { fCaloCellsName = n ; }
58 void SetCaloTriggerPatchInfoName(const char *n) { fCaloTriggerPatchInfoName = n ; }
59 void SetCaloTriggersName(const char *n) { fCaloTriggersName = n ; }
60 void SetCentRange(Double_t min, Double_t max) { fMinCent = min ; fMaxCent = max ; }
61 void SetCentralityEstimator(const char *c) { fCentEst = c ; }
62 void SetClusName(const char *n) { AddClusterContainer(n) ; }
63 void SetClusPtCut(Double_t cut, Int_t c=0);
64 void SetClusTimeCut(Double_t min, Double_t max, Int_t c=0);
65 void SetEventPlaneVsEmcal(Double_t ep) { fEventPlaneVsEmcal = ep ; }
66 void SetForceBeamType(BeamType f) { fForceBeamType = f ; }
67 void SetHistoBins(Int_t nbins, Double_t min, Double_t max) { fNbins = nbins; fMinBinPt = min; fMaxBinPt = max ; }
68 void SetIsEmbedded(Bool_t i) { fIsEmbedded = i ; }
69 void SetIsPythia(Bool_t i) { fIsPythia = i ; }
70 void SetMCLabelShift(Int_t s) { fMCLabelShift = s ; }
71 void SetMinMCLabel(Int_t s) { fMinMCLabel = s ; }
72 void SetMinNTrack(Int_t min) { fMinNTrack = min ; }
73 void SetMinPtTrackInEmcal(Double_t min) { fMinPtTrackInEmcal = min ; }
74 void SetNCentBins(Int_t n) { fNcentBins = n ; }
75 void SetOffTrigger(UInt_t t) { fOffTrigger = t ; }
76 void SetTrackEtaLimits(Double_t min, Double_t max, Int_t c=0);
77 void SetTrackPhiLimits(Double_t min, Double_t max, Int_t c=0);
78 void SetTrackPtCut(Double_t cut, Int_t c=0);
79 void SetTracksName(const char *n) { AddParticleContainer(n) ; }
80 void SetTrigClass(const char *n) { fTrigClass = n ; }
81 void SetTriggerTypeSel(TriggerType t) { fTriggerTypeSel = t ; }
82 void SetUseAliAnaUtils(Bool_t b) { fUseAliAnaUtils = b ; }
83 void SetVzRange(Double_t min, Double_t max) { fMinVz = min ; fMaxVz = max ; }
86 void SetMakeGeneralHistograms(Bool_t g) { fGeneralHistograms = g ; }
87 Bool_t AcceptCluster(AliVCluster *clus, Int_t c = 0) const;
88 Bool_t AcceptTrack(AliVParticle *track, Int_t c = 0) const;
89 void AddObjectToEvent(TObject *obj);
90 AliVParticle *GetAcceptParticleFromArray(Int_t p, Int_t c=0) const;
91 AliVCluster *GetAcceptClusterFromArray(Int_t cl, Int_t c=0) const;
92 TClonesArray *GetArrayFromEvent(const char *name, const char *clname=0);
93 BeamType GetBeamType();
94 TClonesArray *GetParticleArray(Int_t i=0) const;
95 TClonesArray *GetClusterArray(Int_t i=0) const;
96 Int_t GetNParticles(Int_t i=0) const;
97 Int_t GetNClusters(Int_t i=0) const;
98 AliEmcalTriggerPatchInfo *GetMainTriggerPatch();
99 TriggerType GetTriggerType();
100 Bool_t PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard);
101 void UserCreateOutputObjects();
102 void UserExec(Option_t *option);
105 // Virtual functions, to be overloaded in derived classes
106 virtual void ExecOnce();
107 virtual Bool_t FillGeneralHistograms();
108 virtual Bool_t IsEventSelected();
109 virtual Bool_t RetrieveEventObjects();
110 virtual Bool_t FillHistograms() { return kTRUE ; }
111 virtual Bool_t Run() { return kTRUE ; }
113 BeamType fForceBeamType; // forced beam type
114 Bool_t fGeneralHistograms; // whether or not it should fill some general histograms
115 Bool_t fInitialized; // whether or not the task has been already initialized
116 Bool_t fCreateHisto; // whether or not create histograms
117 TString fCaloCellsName; // name of calo cell collection
118 TString fCaloTriggersName; // name of calo triggers collection
119 TString fCaloTriggerPatchInfoName; // trigger patch info array name
120 Double_t fMinCent; // min centrality for event selection
121 Double_t fMaxCent; // max centrality for event selection
122 Double_t fMinVz; // min vertex for event selection
123 Double_t fMaxVz; // max vertex for event selection
124 Double_t fTrackPtCut; // cut on track pt in event selection
125 Int_t fMinNTrack; // minimum nr of tracks in event with pT>fTrackPtCut
126 Bool_t fUseAliAnaUtils; // used for LHC13* data
127 AliAnalysisUtils *fAliAnalysisUtils; //! vertex selection (optional)
128 UInt_t fOffTrigger; // offline trigger for event selection
129 TString fTrigClass; // trigger class name for event selection
130 TriggerType fTriggerTypeSel; // trigger type to select based on trigger patches
131 Int_t fNbins; // no. of pt bins
132 Double_t fMinBinPt; // min pt in histograms
133 Double_t fMaxBinPt; // max pt in histograms
134 Double_t fMinPtTrackInEmcal; // min pt track in emcal
135 Double_t fEventPlaneVsEmcal; // select events which have a certain event plane wrt the emcal
136 Double_t fMinEventPlane; // minimum event plane value
137 Double_t fMaxEventPlane; // maximum event plane value
138 TString fCentEst; // name of V0 centrality estimator
139 Bool_t fIsEmbedded; // trigger, embedded signal
140 Bool_t fIsPythia; // trigger, if it is a PYTHIA production
141 Int_t fSelectPtHardBin; // select one pt hard bin for analysis
142 Int_t fMinMCLabel; // minimum MC label value for the tracks/clusters being considered MC particles
143 Int_t fMCLabelShift; // if MC label > fMCLabelShift, MC label -= fMCLabelShift
144 Int_t fNcentBins; // how many centrality bins
145 AliEMCALGeometry *fGeom; //!emcal geometry
146 TClonesArray *fTracks; //!tracks
147 TClonesArray *fCaloClusters; //!clusters
148 AliVCaloCells *fCaloCells; //!cells
149 AliVCaloTrigger *fCaloTriggers; //!calo triggers
150 TClonesArray *fTriggerPatchInfo; //!trigger patch info array
151 Double_t fCent; //!event centrality
152 Int_t fCentBin; //!event centrality bin
153 Double_t fEPV0; //!event plane V0
154 Double_t fEPV0A; //!event plane V0A
155 Double_t fEPV0C; //!event plane V0C
156 Double_t fVertex[3]; //!event vertex
157 Int_t fNVertCont; //!event vertex number of contributors
158 BeamType fBeamType; //!event beam type
159 AliGenPythiaEventHeader *fPythiaHeader; //!event Pythia header
160 Double_t fPtHard; //!event pt hard
161 Int_t fPtHardBin; //!event pt hard bin
162 Int_t fNTrials; //!event trials
163 TObjArray fParticleCollArray; // particle/track collection array
164 TObjArray fClusterCollArray; // cluster collection array
165 AliEmcalTriggerPatchInfo *fMainTriggerPatch; // main trigger patch, will be cached after calling GetMainTriggerPatch() first time
166 TriggerType fTriggerType; // trigger type J1 or J2
167 TList *fOutput; //!output list
168 TH1 *fHistTrialsAfterSel; //!total number of trials per pt hard bin after selection
169 TH1 *fHistEventsAfterSel; //!total number of events per pt hard bin after selection
170 TH1 *fHistTrials; //!trials from pyxsec.root
171 TProfile *fHistXsection; //!x section from pyxsec.root
172 TH1 *fHistEvents; //!total number of events per pt hard bin
173 TH1 *fHistPtHard; //!pt hard distribution
174 TH1 *fHistCentrality; //!event centrality distribution
175 TH1 *fHistZVertex; //!z vertex position
176 TH1 *fHistEventPlane; //!event plane distribution
177 TH1 *fHistEventRejection; //!book keep reasons for rejecting event
180 AliAnalysisTaskEmcal(const AliAnalysisTaskEmcal&); // not implemented
181 AliAnalysisTaskEmcal &operator=(const AliAnalysisTaskEmcal&); // not implemented
183 ClassDef(AliAnalysisTaskEmcal, 7) // EMCAL base analysis task