Updated syst for D0 RAA vs. centrality (AndreaR, Davide)
[u/mrichter/AliRoot.git] / PWG / muon / AliAnalysisTaskSingleMu.h
CommitLineData
27de2dfb 1#ifndef ALIANALYSISTASKSINGLEMU_H
2#define ALIANALYSISTASKSINGLEMU_H
3
4/* $Id$ */
5
662e37fe 6/// \ingroup "PWG3muon"
7/// \class AliAnalysisTaskSingleMu
8/// \brief Analysis task for single muons in the spectrometer
9///
10// Author Diego Stocco
4ab8d5a6 11
12#include "AliAnalysisTaskSE.h"
aad6618e 13
9728bcfd 14class TList;
15class AliMCParticle;
b201705a 16class TTree;
589e3f71 17class TMap;
55065f3f 18class TObjArray;
589e3f71 19//class TAxis;
20class AliCFManager;
aad6618e 21
9728bcfd 22class AliAnalysisTaskSingleMu : public AliAnalysisTaskSE {
aad6618e 23 public:
589e3f71 24 AliAnalysisTaskSingleMu(const char *name = "AliAnalysisTaskSingleMu", Int_t fillTreeScaleDown = 0, Bool_t keepAll = kFALSE);
9728bcfd 25 virtual ~AliAnalysisTaskSingleMu();
9728bcfd 26
27 virtual void UserCreateOutputObjects();
28 virtual void UserExec(Option_t *option);
29 virtual void Terminate(Option_t *option);
b201705a 30 virtual void NotifyRun();
589e3f71 31 virtual void FinishTaskOutput();
32
55065f3f 33 void SetTriggerClasses(TString triggerClasses =
4ab8d5a6 34 "CINT1-B-NOPF CINT1-AC-NOPF CINT1-E-NOPF CMUS1-B-NOPF CMUS1-AC-NOPF CMUS1-E-NOPF CINT1B-ABCE-NOPF CINT1A-ABCE-NOPF CINT1C-ABCE-NOPF CMUS1B-ABCE-NOPF CMUS1A-ABCE-NOPF CMUS1C-ABCE-NOPF CINT5-B-NOPF CINT5-AC-NOPF CINT5-E-NOPF CMUS5-B-NOPF CMUS5-AC-NOPF CMUS5-E-NOPF CINT5B-ABCE-NOPF CINT5A-ABCE-NOPF CINT5C-ABCE-NOPF CMUS5B-ABCE-NOPF CMUS5A-ABCE-NOPF CMUS5C-ABCE-NOPF");
589e3f71 35
36 /// Get CORRFW manager
37 AliCFManager * GetCFManager() const { return fCFManager; }
38
39 enum {
40 kHvarPt, ///< Pt at vertex
4ab8d5a6 41 // kHvarY, ///< Rapidity
42 kHvarEta, ///< Pseudo-Rapidity
589e3f71 43 kHvarPhi, ///< Phi
44 kHvarDCA, ///< DCA
45 kHvarVz, ///< Z vertex position
46 kHvarThetaZones, ///< Theta at absorber end (4 zones)
47 kHvarCharge, ///< Particle charge
48 kHvarMatchTrig, ///< Matching trigger
49 kHvarTrigClass, ///< Trigger classes
50 kHvarIsGoodVtx, ///< IP vertex correctly reconstructed
51 kHvarMotherType, ///< Mother type (MC only)
93d6def1 52 kHvarCentrality, ///< Centrality class
55065f3f 53 kNvars ///< THnSparse dimensions
93d6def1 54 };
589e3f71 55
56 enum {
57 kStepReconstructed, ///< Reconstructed tracks
4ab8d5a6 58 //kStepAcceptance, ///< Track in acceptance
589e3f71 59 kStepGeneratedMC, ///< Generated tracks (MC)
4ab8d5a6 60 //kStepAcceptanceMC, ///< Track in acceptance (MC)
589e3f71 61 kNsteps ///< Number of steps
62 };
9728bcfd 63
64 private:
8b8b0b7a 65
b201705a 66 AliAnalysisTaskSingleMu(const AliAnalysisTaskSingleMu&);
67 AliAnalysisTaskSingleMu& operator=(const AliAnalysisTaskSingleMu&);
aad6618e 68
589e3f71 69
9728bcfd 70 enum {
589e3f71 71 kHistoNeventsPerTrig, ///< Number of events per trigger
72 kHistoMuonMultiplicity, ///< Number of muons per event
73 kHistoEventVz, ///< Vertex z distribution for all events
589e3f71 74 kHistoNeventsPerRun, ///< Number of triggers per run (for check)
75 kHistoNmuonsPerRun, ///< Number of muons per run (for check)
76 kNsummaryHistos ///< Number of summary histograms
9728bcfd 77 };
589e3f71 78
9728bcfd 79 enum {
589e3f71 80 kNoMatchTrig, ///< No match with trigger
81 kAllPtTrig, ///< Match All Pt
82 kLowPtTrig, ///< Match Low Pt
83 kHighPtTrig, ///< Match High Pt
84 kNtrigCuts ///< Total number of trigger types
b201705a 85 };
86
589e3f71 87
88 // Histograms for MC
b201705a 89 enum {
93d6def1 90 kHistoCheckVzMC, ///< Check vertex distribution for all vertex
91 kHistoCheckVzHasVtxMC, ///< Check vertex distribution for reco vertex
92 kHistoCheckVzNoPileupMC, ///< Check vertex distribution for non-pileup vtx
55065f3f 93 kNsummaryHistosMC ///< Summary histograms for MC
9728bcfd 94 };
aad6618e 95
662e37fe 96 enum {
b201705a 97 kHistoPtResolutionMC, ///< Pt resolution
589e3f71 98 kNhistoTypesMC ///< Number of MC histograms
aad6618e 99 };
100
662e37fe 101 enum {
9728bcfd 102 kCharmMu, ///< Mu from charm
103 kBeautyMu, ///< Mu from beauty
104 kPrimaryMu, ///< Primary mu
105 kSecondaryMu, ///< Secondary mu
106 kRecoHadron, ///< Reconstructed hadron
107 kUnknownPart, ///< Particle that fails matching kine
108 kNtrackSources ///< Total number of track sources
662e37fe 109 };
aad6618e 110
93d6def1 111 // Tree
b201705a 112 enum {
113 kVarPx, ///< Px at vertex
114 kVarPy, ///< Py at vertex
115 kVarPz, ///< Pz at vertex
116 kVarPt, ///< Pt at vertex
117 kVarPxAtDCA, ///< Px at DCA
118 kVarPyAtDCA, ///< Py at DCA
119 kVarPzAtDCA, ///< Pz at DCA
120 kVarPtAtDCA, ///< Pt at DCA
121 kVarPxUncorrected, ///< Px at first chamber
122 kVarPyUncorrected, ///< Py at first chamber
123 kVarPzUncorrected, ///< Pz at first chamber
124 kVarPtUncorrected, ///< Pt at first chamber
125 kVarXUncorrected, ///< X at first chamber
126 kVarYUncorrected, ///< Y at at first chamber
127 kVarZUncorrected, ///< Z at at first chamber
128 kVarXatDCA, ///< X position at DCA
129 kVarYatDCA, ///< Y position at DCA
130 kVarDCA, ///< DCA
131 kVarEta, ///< Eta
132 kVarRapidity, ///< Rapidity
133 kVarCharge, ///< Charge
589e3f71 134 kVarRAtAbsEnd, ///< R at absorber end
b201705a 135 // Global event info
136 kVarIPVx, ///< IP x position
137 kVarIPVy, ///< IP y position
138 kVarIPVz, ///< IP z position
93d6def1 139 kVarCentrality, ///< Event centrality
b201705a 140 kNvarFloat
141 };
142
143 enum {
144 kVarMatchTrig, ///< Match trigger
145 kVarIsMuon, ///< Is muon
146 kVarIsGhost, ///< Is Ghost (trigger track not matching tracker)
589e3f71 147 kVarLocalCircuit, ///< Fired local circuit
b201705a 148 // Global event info
149 kVarPassPhysicsSelection, ///< Pass physics selection (Requires ESD)
589e3f71 150 kVarNVtxContrib, ///< Vertex contributors
151 kVarNspdTracklets, ///< SPD tracklets
152 kVarIsPileup, ///< Pileup vertices
b201705a 153 kNvarInt
154 };
155
156 enum {
157 // Global event info
158 kVarTrigMask, ///< Fires triggers mask
159 kNvarChar
160 };
161
589e3f71 162 // Event ID
b201705a 163 enum {
164 // Global event info
165 kVarBunchCrossNumber, ///< Bunch crossing number
166 kVarOrbitNumber, ///< Orbit number
167 kVarPeriodNumber, ///< Period number
168 kVarRunNumber, ///< Run number
169 kNvarUInt
170 };
171
93d6def1 172 // Tree MC
b201705a 173 enum {
174 kVarPxMC, ///< Px from Kine
175 kVarPyMC, ///< Py from Kine
176 kVarPzMC, ///< Pz from Kine
177 kVarPtMC, ///< Pt from Kine
178 kVarEtaMC, ///< Eta from Kine
179 kVarRapidityMC, ///< Rapidity from Kine
180 kVarVxMC, ///< Particle production x vertex from Kine
181 kVarVyMC, ///< Particle production y vertex from Kine
182 kVarVzMC, ///< Particle production z vertex from Kine
93d6def1 183 kVarMotherPxMC, ///< Mother px from Kine
184 kVarMotherPyMC, ///< Mother py from Kine
185 kVarMotherPzMC, ///< Mother pz from Kine
186 kVarMotherEtaMC, ///< Mother eta from Kine
187 kVarMotherRapidityMC, ///< Mother rapidity from Kine
188 kVarMotherVxMC, ///< Mother production x vertex from Kine
189 kVarMotherVyMC, ///< Mother production y vertex from Kine
190 kVarMotherVzMC, ///< Mother production z vertex from Kine
191 // Global event info
192 kVarIPVxMC, ///< IP x position
193 kVarIPVyMC, ///< IP y position
194 kVarIPVzMC, ///< IP z position
b201705a 195 kNvarFloatMC
196 };
197
198 enum {
199 kVarPdg, ///< PDG
93d6def1 200 kVarMotherPdg, ///< Mother PDG
b201705a 201 kVarMotherType, ///< Mother type
202 kNvarIntMC
203 };
204
589e3f71 205 Int_t GetHistoIndex(Int_t histoTypeIndex, Int_t trigIndex = -1, Int_t srcIndex = -1);
206 Float_t GetBinThetaAbsEnd(Float_t RAtAbsEnd, Bool_t isTheta = kFALSE);
207 Float_t GetBinTrigClass(const Char_t* trigClass);
9728bcfd 208
209 void FillTriggerHistos(Int_t histoIndex, Int_t matchTrig, Int_t motherType,
210 Float_t var1, Float_t var2 = 0. , Float_t var3 = 0.);
662e37fe 211
589e3f71 212 Int_t RecoTrackMother(AliMCParticle* mcParticle);
9728bcfd 213
b201705a 214 void Reset(Bool_t keepGlobal = kTRUE);
215
589e3f71 216 void SetAxisLabel(TAxis* axis);
217
218 Int_t fFillTreeScaleDown; ///< Ntuple must be filled each fFillTreeScaleDown events
b201705a 219 Bool_t fKeepAll; ///< Flag indicating to keep all info in tree
589e3f71 220 Int_t fkNvtxContribCut; ///< Number of cuts in vertex contributors
4ab8d5a6 221 TObjArray* fTriggerClasses; ///< full trigger class name
589e3f71 222 AliCFManager* fCFManager; //!< Pointer to the CF manager
9728bcfd 223 TList* fHistoList; //!< List of histograms for data
224 TList* fHistoListMC; //!< List of histograms for MC
589e3f71 225 TList* fHistoListQA; //!< List of QA histos
b201705a 226 TTree* fTreeSingleMu; //!< Optional output Tree
b201705a 227 Float_t* fVarFloat; //!< Reconstructed parameters float
228 Int_t* fVarInt; //!< Reconstructed parameters int
229 Char_t** fVarChar; //!< Reconstructed parameters string
230 UInt_t* fVarUInt; //!< Reconstructed parameters Uint
231 Float_t* fVarFloatMC; //!< MC parameters float
232 Int_t* fVarIntMC; //!< MC parameters int
55065f3f 233 TMap* fAuxObjects; //!< Map of vertex distribution per run
93d6def1 234 TString fDebugString; //!< Debug string
aad6618e 235
b201705a 236 ClassDef(AliAnalysisTaskSingleMu, 2); // Single muon analysis
aad6618e 237};
238
4ab8d5a6 239#endif