]>
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 { |
53948904 | 40 | kND = BIT(31), //not defined := Sign bit of int |
41 | kJ1 = BIT(0), | |
42 | kJ2 = BIT(1), | |
43 | kG1 = BIT(2), | |
44 | kG2 = BIT(3), | |
45 | kL0 = BIT(4) | |
46 | }; | |
47 | enum MainTriggers{ | |
48 | kPosJ1 = 0, | |
49 | kPosJ2 = 1, | |
50 | kPosG1 = 2, | |
51 | kPosG2 = 3, | |
52 | kPosL0 = 4, | |
53 | kNType = 5 | |
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; | |
53948904 | 114 | AliEmcalTriggerPatchInfo *GetMainTriggerPatch(Int_t triggersel = kJ1 | kJ2); |
115 | AliEmcalTriggerPatchInfo *ApplyMainTriggerSelection(Int_t selectionBitmap) const; | |
116 | Bool_t HasTriggerType(Int_t triggersel); | |
117 | ULong_t GetTriggerList(); | |
b8aeed95 | 118 | Bool_t PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard); |
119 | void UserCreateOutputObjects(); | |
120 | void UserExec(Option_t *option); | |
121 | Bool_t UserNotify(); | |
9239b066 | 122 | |
123 | // Virtual functions, to be overloaded in derived classes | |
124 | virtual void ExecOnce(); | |
125 | virtual Bool_t FillGeneralHistograms(); | |
d29ed625 | 126 | virtual Bool_t IsEventSelected(); |
2da09763 | 127 | virtual Bool_t RetrieveEventObjects(); |
9239b066 | 128 | virtual Bool_t FillHistograms() { return kTRUE ; } |
8a28ded1 | 129 | virtual Bool_t Run() { return kTRUE ; } |
2da09763 | 130 | |
159802e2 | 131 | BeamType fForceBeamType; // forced beam type |
132 | Bool_t fGeneralHistograms; // whether or not it should fill some general histograms | |
2da09763 | 133 | Bool_t fInitialized; // whether or not the task has been already initialized |
134 | Bool_t fCreateHisto; // whether or not create histograms | |
53948904 | 135 | Bool_t fMainTriggerPatchSet; // Internal variable indicating whether the array of main trigger patches is initialised |
f660c2d6 | 136 | TString fCaloCellsName; // name of calo cell collection |
00c77045 | 137 | TString fCaloTriggersName; // name of calo triggers collection |
37a63fdf | 138 | TString fCaloTriggerPatchInfoName; // trigger patch info array name |
2ac8ca4f | 139 | Double_t fMinCent; // min centrality for event selection |
140 | Double_t fMaxCent; // max centrality for event selection | |
141 | Double_t fMinVz; // min vertex for event selection | |
142 | Double_t fMaxVz; // max vertex for event selection | |
9239b066 | 143 | Double_t fTrackPtCut; // cut on track pt in event selection |
144 | Int_t fMinNTrack; // minimum nr of tracks in event with pT>fTrackPtCut | |
667f8d76 | 145 | Bool_t fUseAliAnaUtils; // used for LHC13* data: z-vtx, Ncontributors, z-vtx resolution cuts |
146 | Bool_t fRejectPileup; // Reject pilup using function AliAnalysisUtils::IsPileUpEvent() | |
d6ea3a48 | 147 | Bool_t fTklVsClusSPDCut; // Apply tracklet-vs-cluster SPD cut to reject background events in pp |
9239b066 | 148 | AliAnalysisUtils *fAliAnalysisUtils; //! vertex selection (optional) |
2ac8ca4f | 149 | UInt_t fOffTrigger; // offline trigger for event selection |
b4339010 | 150 | TString fTrigClass; // trigger class name for event selection |
53948904 | 151 | Int_t fTriggerTypeSel; // trigger type to select based on trigger patches |
2da09763 | 152 | Int_t fNbins; // no. of pt bins |
2ac8ca4f | 153 | Double_t fMinBinPt; // min pt in histograms |
154 | Double_t fMaxBinPt; // max pt in histograms | |
6c41fc8c | 155 | Double_t fMinPtTrackInEmcal; // min pt track in emcal |
6f6dc2ba | 156 | Double_t fEventPlaneVsEmcal; // select events which have a certain event plane wrt the emcal |
157 | Double_t fMinEventPlane; // minimum event plane value | |
158 | Double_t fMaxEventPlane; // maximum event plane value | |
a52de945 | 159 | TString fCentEst; // name of V0 centrality estimator |
8c0d179d | 160 | Bool_t fIsEmbedded; // trigger, embedded signal |
ed0243d8 | 161 | Bool_t fIsPythia; // trigger, if it is a PYTHIA production |
162 | Int_t fSelectPtHardBin; // select one pt hard bin for analysis | |
163 | Int_t fMinMCLabel; // minimum MC label value for the tracks/clusters being considered MC particles | |
164 | Int_t fMCLabelShift; // if MC label > fMCLabelShift, MC label -= fMCLabelShift | |
6cb302d0 | 165 | Int_t fNcentBins; // how many centrality bins |
667f8d76 | 166 | Bool_t fNeedEmcalGeom; // whether or not the task needs the emcal geometry |
1876c758 | 167 | Bool_t fIsEsd; //!whether it's an ESD analysis |
159802e2 | 168 | AliEMCALGeometry *fGeom; //!emcal geometry |
2da09763 | 169 | TClonesArray *fTracks; //!tracks |
170 | TClonesArray *fCaloClusters; //!clusters | |
f660c2d6 | 171 | AliVCaloCells *fCaloCells; //!cells |
00c77045 | 172 | AliVCaloTrigger *fCaloTriggers; //!calo triggers |
37a63fdf | 173 | TClonesArray *fTriggerPatchInfo; //!trigger patch info array |
2ac8ca4f | 174 | Double_t fCent; //!event centrality |
2da09763 | 175 | Int_t fCentBin; //!event centrality bin |
2ac8ca4f | 176 | Double_t fEPV0; //!event plane V0 |
177 | Double_t fEPV0A; //!event plane V0A | |
178 | Double_t fEPV0C; //!event plane V0C | |
2da09763 | 179 | Double_t fVertex[3]; //!event vertex |
b4339010 | 180 | Int_t fNVertCont; //!event vertex number of contributors |
1f6fff78 | 181 | BeamType fBeamType; //!event beam type |
ed0243d8 | 182 | AliGenPythiaEventHeader *fPythiaHeader; //!event Pythia header |
183 | Double_t fPtHard; //!event pt hard | |
184 | Int_t fPtHardBin; //!event pt hard bin | |
185 | Int_t fNTrials; //!event trials | |
8c34a1cc | 186 | Float_t fXsection; //!x-section from pythia header |
9239b066 | 187 | TObjArray fParticleCollArray; // particle/track collection array |
188 | TObjArray fClusterCollArray; // cluster collection array | |
53948904 | 189 | AliEmcalTriggerPatchInfo *fMainTriggerPatch[kNType]; // main trigger patch, will be cached after calling GetMainTriggerPatch() first time |
219799d0 | 190 | ULong_t fTriggers; // list of fired triggers |
6da81bde | 191 | |
2da09763 | 192 | TList *fOutput; //!output list |
219799d0 | 193 | TH1 *fHistEventCount; //!incoming and selected events |
ed0243d8 | 194 | TH1 *fHistTrialsAfterSel; //!total number of trials per pt hard bin after selection |
195 | TH1 *fHistEventsAfterSel; //!total number of events per pt hard bin after selection | |
6da81bde | 196 | TProfile *fHistXsectionAfterSel; //!x section from pythia header |
ed0243d8 | 197 | TH1 *fHistTrials; //!trials from pyxsec.root |
ed0243d8 | 198 | TH1 *fHistEvents; //!total number of events per pt hard bin |
6da81bde | 199 | TProfile *fHistXsection; //!x section from pyxsec.root |
ed0243d8 | 200 | TH1 *fHistPtHard; //!pt hard distribution |
9239b066 | 201 | TH1 *fHistCentrality; //!event centrality distribution |
202 | TH1 *fHistZVertex; //!z vertex position | |
203 | TH1 *fHistEventPlane; //!event plane distribution | |
8e49a788 | 204 | TH1 *fHistEventRejection; //!book keep reasons for rejecting event |
159802e2 | 205 | |
2da09763 | 206 | private: |
207 | AliAnalysisTaskEmcal(const AliAnalysisTaskEmcal&); // not implemented | |
208 | AliAnalysisTaskEmcal &operator=(const AliAnalysisTaskEmcal&); // not implemented | |
209 | ||
667f8d76 | 210 | ClassDef(AliAnalysisTaskEmcal, 11) // EMCAL base analysis task |
2da09763 | 211 | }; |
212 | #endif |