]>
Commit | Line | Data |
---|---|---|
2da09763 | 1 | #ifndef ALIANALYSISTASKEMCAL_H |
2 | #define ALIANALYSISTASKEMCAL_H | |
3 | ||
d569177d | 4 | // $Id: AliAnalysisTaskEmcal.h 64518 2013-10-14 12:44:52Z loizides $ |
2da09763 | 5 | |
6 | class TClonesArray; | |
7 | class TString; | |
8 | class TList; | |
09ca054b | 9 | class AliEmcalParticle; |
2da09763 | 10 | class AliMCParticle; |
2da09763 | 11 | class AliVCluster; |
09ca054b | 12 | class AliVTrack; |
8afc7c8d | 13 | class AliVParticle; |
f660c2d6 | 14 | class AliVCaloCells; |
ed0243d8 | 15 | class TH1; |
16 | class TProfile; | |
159802e2 | 17 | class AliEMCALGeometry; |
9239b066 | 18 | class AliParticleContainer; |
19 | class AliClusterContainer; | |
ed0243d8 | 20 | class AliGenPythiaEventHeader; |
00c77045 | 21 | class AliVCaloTrigger; |
9239b066 | 22 | class AliAnalysisUtils; |
37a63fdf | 23 | class AliEmcalTriggerPatchInfo; |
9239b066 | 24 | |
25 | #include "Rtypes.h" | |
2da09763 | 26 | |
27 | #include "AliAnalysisTaskSE.h" | |
28 | ||
29 | class AliAnalysisTaskEmcal : public AliAnalysisTaskSE { | |
30 | public: | |
2da09763 | 31 | |
32 | enum BeamType { | |
33 | kNA = -1, | |
34 | kpp = 0, | |
35 | kAA = 1, | |
36 | kpA = 2 | |
37 | }; | |
38 | ||
8e49a788 | 39 | enum TriggerType { |
e9424980 | 40 | kND = -1, |
41 | kJ1 = 0, | |
42 | kJ2 = 1, | |
43 | kG1 = 2, | |
44 | kG2 = 3, | |
45 | kL0 = 4 | |
53948904 | 46 | }; |
e9424980 | 47 | |
48 | enum TriggerCategory { | |
eb3c9439 | 49 | kTriggerLevel0 = 0, // Online trigger categories |
e9424980 | 50 | kTriggerLevel1Jet = 1, |
eb3c9439 | 51 | kTriggerLevel1Gamma=2, |
52 | kTriggerRecalcJet = 3, // Recalculated max trigger patch; does not need to be above trigger threshold | |
53 | kTriggerRecalcGamma = 4 | |
8e49a788 | 54 | }; |
55 | ||
2da09763 | 56 | AliAnalysisTaskEmcal(); |
f5c26534 | 57 | AliAnalysisTaskEmcal(const char *name, Bool_t histo=kFALSE); |
2da09763 | 58 | virtual ~AliAnalysisTaskEmcal(); |
59 | ||
b8aeed95 | 60 | AliParticleContainer *AddParticleContainer(const char *n); |
61 | AliClusterContainer *AddClusterContainer(const char *n); | |
62 | AliParticleContainer *GetParticleContainer(Int_t i=0) const; | |
63 | AliClusterContainer *GetClusterContainer(Int_t i=0) const; | |
64 | AliParticleContainer *GetParticleContainer(const char* name) const; | |
65 | AliClusterContainer *GetClusterContainer(const char* name) const; | |
66 | void RemoveParticleContainer(Int_t i=0) { fParticleCollArray.RemoveAt(i) ; } | |
67 | void RemoveClusterContainer(Int_t i=0) { fClusterCollArray.RemoveAt(i) ; } | |
9239b066 | 68 | void SetCaloCellsName(const char *n) { fCaloCellsName = n ; } |
37a63fdf | 69 | void SetCaloTriggerPatchInfoName(const char *n) { fCaloTriggerPatchInfoName = n ; } |
b8aeed95 | 70 | void SetCaloTriggersName(const char *n) { fCaloTriggersName = n ; } |
71 | void SetCentRange(Double_t min, Double_t max) { fMinCent = min ; fMaxCent = max ; } | |
72 | void SetCentralityEstimator(const char *c) { fCentEst = c ; } | |
9239b066 | 73 | void SetClusName(const char *n) { AddClusterContainer(n) ; } |
9239b066 | 74 | void SetClusPtCut(Double_t cut, Int_t c=0); |
75 | void SetClusTimeCut(Double_t min, Double_t max, Int_t c=0); | |
b8aeed95 | 76 | void SetEventPlaneVsEmcal(Double_t ep) { fEventPlaneVsEmcal = ep ; } |
77 | void SetForceBeamType(BeamType f) { fForceBeamType = f ; } | |
78 | void SetHistoBins(Int_t nbins, Double_t min, Double_t max) { fNbins = nbins; fMinBinPt = min; fMaxBinPt = max ; } | |
79 | void SetIsEmbedded(Bool_t i) { fIsEmbedded = i ; } | |
80 | void SetIsPythia(Bool_t i) { fIsPythia = i ; } | |
81 | void SetMCLabelShift(Int_t s) { fMCLabelShift = s ; } | |
b8aeed95 | 82 | void SetMinMCLabel(Int_t s) { fMinMCLabel = s ; } |
83 | void SetMinNTrack(Int_t min) { fMinNTrack = min ; } | |
84 | void SetMinPtTrackInEmcal(Double_t min) { fMinPtTrackInEmcal = min ; } | |
78a69392 | 85 | void SetNCentBins(Int_t n) { fNcentBins = n ; } |
86 | void SetNeedEmcalGeom(Bool_t n) { fNeedEmcalGeom = n ; } | |
b8aeed95 | 87 | void SetOffTrigger(UInt_t t) { fOffTrigger = t ; } |
9239b066 | 88 | void SetTrackEtaLimits(Double_t min, Double_t max, Int_t c=0); |
89 | void SetTrackPhiLimits(Double_t min, Double_t max, Int_t c=0); | |
b8aeed95 | 90 | void SetTrackPtCut(Double_t cut, Int_t c=0); |
91 | void SetTracksName(const char *n) { AddParticleContainer(n) ; } | |
92 | void SetTrigClass(const char *n) { fTrigClass = n ; } | |
93 | void SetTriggerTypeSel(TriggerType t) { fTriggerTypeSel = t ; } | |
667f8d76 | 94 | void SetUseAliAnaUtils(Bool_t b, Bool_t bRejPilup = kTRUE) { fUseAliAnaUtils = b ; fRejectPileup = bRejPilup ; } |
b8aeed95 | 95 | void SetVzRange(Double_t min, Double_t max) { fMinVz = min ; fMaxVz = max ; } |
d6ea3a48 | 96 | void SetUseSPDTrackletVsClusterBG(Bool_t b) { fTklVsClusSPDCut = b ; } |
37a63fdf | 97 | |
2da09763 | 98 | protected: |
68e03fc3 | 99 | void SetRejectionReasonLabels(TAxis* axis); |
9dc6ae4b | 100 | Double_t* GenerateFixedBinArray(Int_t n, Double_t min, Double_t max) const; |
101 | void GenerateFixedBinArray(Int_t n, Double_t min, Double_t max, Double_t* array) const; | |
545659ac | 102 | void SetMakeGeneralHistograms(Bool_t g) { fGeneralHistograms = g ; } |
b8aeed95 | 103 | Bool_t AcceptCluster(AliVCluster *clus, Int_t c = 0) const; |
104 | Bool_t AcceptTrack(AliVParticle *track, Int_t c = 0) const; | |
105 | void AddObjectToEvent(TObject *obj); | |
9239b066 | 106 | AliVParticle *GetAcceptParticleFromArray(Int_t p, Int_t c=0) const; |
107 | AliVCluster *GetAcceptClusterFromArray(Int_t cl, Int_t c=0) const; | |
b8aeed95 | 108 | TClonesArray *GetArrayFromEvent(const char *name, const char *clname=0); |
109 | BeamType GetBeamType(); | |
110 | TClonesArray *GetParticleArray(Int_t i=0) const; | |
111 | TClonesArray *GetClusterArray(Int_t i=0) const; | |
9239b066 | 112 | Int_t GetNParticles(Int_t i=0) const; |
113 | Int_t GetNClusters(Int_t i=0) const; | |
e9424980 | 114 | AliEmcalTriggerPatchInfo *GetMainTriggerPatch(TriggerCategory triggersel = kTriggerLevel1Jet, Bool_t doOfflinSimple = kFALSE); |
115 | Bool_t HasTriggerType(TriggerType triggersel); | |
53948904 | 116 | ULong_t GetTriggerList(); |
b8aeed95 | 117 | Bool_t PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard); |
118 | void UserCreateOutputObjects(); | |
119 | void UserExec(Option_t *option); | |
120 | Bool_t UserNotify(); | |
9239b066 | 121 | |
122 | // Virtual functions, to be overloaded in derived classes | |
123 | virtual void ExecOnce(); | |
124 | virtual Bool_t FillGeneralHistograms(); | |
d29ed625 | 125 | virtual Bool_t IsEventSelected(); |
2da09763 | 126 | virtual Bool_t RetrieveEventObjects(); |
9239b066 | 127 | virtual Bool_t FillHistograms() { return kTRUE ; } |
8a28ded1 | 128 | virtual Bool_t Run() { return kTRUE ; } |
2da09763 | 129 | |
159802e2 | 130 | BeamType fForceBeamType; // forced beam type |
131 | Bool_t fGeneralHistograms; // whether or not it should fill some general histograms | |
2da09763 | 132 | Bool_t fInitialized; // whether or not the task has been already initialized |
133 | Bool_t fCreateHisto; // whether or not create histograms | |
f660c2d6 | 134 | TString fCaloCellsName; // name of calo cell collection |
00c77045 | 135 | TString fCaloTriggersName; // name of calo triggers collection |
37a63fdf | 136 | TString fCaloTriggerPatchInfoName; // trigger patch info array name |
2ac8ca4f | 137 | Double_t fMinCent; // min centrality for event selection |
138 | Double_t fMaxCent; // max centrality for event selection | |
139 | Double_t fMinVz; // min vertex for event selection | |
140 | Double_t fMaxVz; // max vertex for event selection | |
9239b066 | 141 | Double_t fTrackPtCut; // cut on track pt in event selection |
142 | Int_t fMinNTrack; // minimum nr of tracks in event with pT>fTrackPtCut | |
667f8d76 | 143 | Bool_t fUseAliAnaUtils; // used for LHC13* data: z-vtx, Ncontributors, z-vtx resolution cuts |
144 | Bool_t fRejectPileup; // Reject pilup using function AliAnalysisUtils::IsPileUpEvent() | |
d6ea3a48 | 145 | Bool_t fTklVsClusSPDCut; // Apply tracklet-vs-cluster SPD cut to reject background events in pp |
9239b066 | 146 | AliAnalysisUtils *fAliAnalysisUtils; //! vertex selection (optional) |
2ac8ca4f | 147 | UInt_t fOffTrigger; // offline trigger for event selection |
b4339010 | 148 | TString fTrigClass; // trigger class name for event selection |
e9424980 | 149 | TriggerType fTriggerTypeSel; // trigger type to select based on trigger patches |
2da09763 | 150 | Int_t fNbins; // no. of pt bins |
2ac8ca4f | 151 | Double_t fMinBinPt; // min pt in histograms |
152 | Double_t fMaxBinPt; // max pt in histograms | |
6c41fc8c | 153 | Double_t fMinPtTrackInEmcal; // min pt track in emcal |
6f6dc2ba | 154 | Double_t fEventPlaneVsEmcal; // select events which have a certain event plane wrt the emcal |
155 | Double_t fMinEventPlane; // minimum event plane value | |
156 | Double_t fMaxEventPlane; // maximum event plane value | |
a52de945 | 157 | TString fCentEst; // name of V0 centrality estimator |
8c0d179d | 158 | Bool_t fIsEmbedded; // trigger, embedded signal |
ed0243d8 | 159 | Bool_t fIsPythia; // trigger, if it is a PYTHIA production |
160 | Int_t fSelectPtHardBin; // select one pt hard bin for analysis | |
161 | Int_t fMinMCLabel; // minimum MC label value for the tracks/clusters being considered MC particles | |
162 | Int_t fMCLabelShift; // if MC label > fMCLabelShift, MC label -= fMCLabelShift | |
6cb302d0 | 163 | Int_t fNcentBins; // how many centrality bins |
667f8d76 | 164 | Bool_t fNeedEmcalGeom; // whether or not the task needs the emcal geometry |
1876c758 | 165 | Bool_t fIsEsd; //!whether it's an ESD analysis |
159802e2 | 166 | AliEMCALGeometry *fGeom; //!emcal geometry |
2da09763 | 167 | TClonesArray *fTracks; //!tracks |
168 | TClonesArray *fCaloClusters; //!clusters | |
f660c2d6 | 169 | AliVCaloCells *fCaloCells; //!cells |
00c77045 | 170 | AliVCaloTrigger *fCaloTriggers; //!calo triggers |
37a63fdf | 171 | TClonesArray *fTriggerPatchInfo; //!trigger patch info array |
2ac8ca4f | 172 | Double_t fCent; //!event centrality |
2da09763 | 173 | Int_t fCentBin; //!event centrality bin |
2ac8ca4f | 174 | Double_t fEPV0; //!event plane V0 |
175 | Double_t fEPV0A; //!event plane V0A | |
176 | Double_t fEPV0C; //!event plane V0C | |
2da09763 | 177 | Double_t fVertex[3]; //!event vertex |
b4339010 | 178 | Int_t fNVertCont; //!event vertex number of contributors |
1f6fff78 | 179 | BeamType fBeamType; //!event beam type |
ed0243d8 | 180 | AliGenPythiaEventHeader *fPythiaHeader; //!event Pythia header |
181 | Double_t fPtHard; //!event pt hard | |
182 | Int_t fPtHardBin; //!event pt hard bin | |
183 | Int_t fNTrials; //!event trials | |
8c34a1cc | 184 | Float_t fXsection; //!x-section from pythia header |
9239b066 | 185 | TObjArray fParticleCollArray; // particle/track collection array |
186 | TObjArray fClusterCollArray; // cluster collection array | |
219799d0 | 187 | ULong_t fTriggers; // list of fired triggers |
6da81bde | 188 | |
2da09763 | 189 | TList *fOutput; //!output list |
219799d0 | 190 | TH1 *fHistEventCount; //!incoming and selected events |
ed0243d8 | 191 | TH1 *fHistTrialsAfterSel; //!total number of trials per pt hard bin after selection |
192 | TH1 *fHistEventsAfterSel; //!total number of events per pt hard bin after selection | |
6da81bde | 193 | TProfile *fHistXsectionAfterSel; //!x section from pythia header |
ed0243d8 | 194 | TH1 *fHistTrials; //!trials from pyxsec.root |
ed0243d8 | 195 | TH1 *fHistEvents; //!total number of events per pt hard bin |
6da81bde | 196 | TProfile *fHistXsection; //!x section from pyxsec.root |
ed0243d8 | 197 | TH1 *fHistPtHard; //!pt hard distribution |
9239b066 | 198 | TH1 *fHistCentrality; //!event centrality distribution |
199 | TH1 *fHistZVertex; //!z vertex position | |
200 | TH1 *fHistEventPlane; //!event plane distribution | |
8e49a788 | 201 | TH1 *fHistEventRejection; //!book keep reasons for rejecting event |
159802e2 | 202 | |
2da09763 | 203 | private: |
204 | AliAnalysisTaskEmcal(const AliAnalysisTaskEmcal&); // not implemented | |
205 | AliAnalysisTaskEmcal &operator=(const AliAnalysisTaskEmcal&); // not implemented | |
206 | ||
667f8d76 | 207 | ClassDef(AliAnalysisTaskEmcal, 11) // EMCAL base analysis task |
2da09763 | 208 | }; |
209 | #endif |