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