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