@@ -54,15 +54,15 @@ struct HfTaskSingleMuonMult {
5454
5555 // enum for event selection bins
5656 enum EventSelection {
57- AllEvents = 1 ,
57+ AllEvents = 0 ,
5858 Sel8,
5959 VtxZAfterSel,
6060 NEventSelection
6161 };
6262
6363 // enum for muon track selection bins
6464 enum MuonSelection {
65- NoCut = 1 ,
65+ NoCut = 0 ,
6666 EtaCut,
6767 RAbsorbCut,
6868 PDcaCut,
@@ -92,15 +92,17 @@ struct HfTaskSingleMuonMult {
9292
9393 // Number the types of muon tracks
9494 static constexpr uint8_t NTrackTypes{ForwardTrackTypeEnum::MCHStandaloneTrack + 1 };
95+ static constexpr float EventSelectionMax = static_cast <float >(NEventSelection) + 0 .5f ;
96+ static constexpr float MuonSelectionMax = static_cast <float >(NMuonSelection) + 0 .5f ;
9597
9698 HistogramRegistry registry{" registry" };
9799
98100 void init (InitContext&)
99101 {
100102 AxisSpec axisCent = {101 , -0.5 , 100.5 , " centrality" };
101- AxisSpec axisEvent{NEventSelection, 0.5 , NEventSelection + 0.5 , " Muon Selection" };
103+ AxisSpec axisEvent{NEventSelection, 0.5 , EventSelectionMax , " Event Selection" };
102104 AxisSpec axisVtxZ{80 , -20 ., 20 ., " #it{z}_{vtx} (cm)" };
103- AxisSpec axisMuon{NMuonSelection, 0.5 , NMuonSelection + 0.5 , " Muon Selection" };
105+ AxisSpec axisMuon{NMuonSelection, 0.5 , MuonSelectionMax , " Muon Selection" };
104106 AxisSpec axisNCh{500 , 0.5 , 500.5 , " #it{N}_{ch}" };
105107 AxisSpec axisNMu{20 , -0.5 , 19.5 , " #it{N}_{#mu}" };
106108 AxisSpec axisPt{1000 , 0 ., 500 ., " #it{p}_{T} (GeV/#it{c})" };
@@ -141,35 +143,35 @@ struct HfTaskSingleMuonMult {
141143
142144 auto hEvstat = registry.get <TH1>(HIST (" hEventSel" ));
143145 auto * xEv = hEvstat->GetXaxis ();
144- xEv->SetBinLabel (AllEvents, " All events" );
145- xEv->SetBinLabel (Sel8, " sel8" );
146- xEv->SetBinLabel (VtxZAfterSel, " VtxZAfterSel" );
146+ xEv->SetBinLabel (AllEvents + 1 , " All events" );
147+ xEv->SetBinLabel (Sel8 + 1 , " sel8" );
148+ xEv->SetBinLabel (VtxZAfterSel + 1 , " VtxZAfterSel" );
147149
148150 auto hMustat = registry.get <TH1>(HIST (" hMuonSel" ));
149151 auto * xMu = hMustat->GetXaxis ();
150- xMu->SetBinLabel (NoCut, " noCut" );
151- xMu->SetBinLabel (EtaCut, " etaCut" );
152- xMu->SetBinLabel (RAbsorbCut, " RAbsorbCut" );
153- xMu->SetBinLabel (PDcaCut, " pDcaCut" );
154- xMu->SetBinLabel (Chi2Cut, " chi2Cut" );
152+ xMu->SetBinLabel (NoCut + 1 , " noCut" );
153+ xMu->SetBinLabel (EtaCut + 1 , " etaCut" );
154+ xMu->SetBinLabel (RAbsorbCut + 1 , " RAbsorbCut" );
155+ xMu->SetBinLabel (PDcaCut + 1 , " pDcaCut" );
156+ xMu->SetBinLabel (Chi2Cut + 1 , " chi2Cut" );
155157 }
156158
157159 void process (MyCollisions::iterator const & collision,
158160 MyTracks const & tracks,
159161 MyMuons const & muons)
160162 {
161- registry.fill (HIST (" hEventSel" ), 1 . );
163+ registry.fill (HIST (" hEventSel" ), AllEvents + 1 );
162164
163165 if (!collision.sel8 ()) {
164166 return ;
165167 }
166- registry.fill (HIST (" hEventSel" ), 2 . );
168+ registry.fill (HIST (" hEventSel" ), Sel8 + 1 );
167169 registry.fill (HIST (" hVtxZBeforeSel" ), collision.posZ ());
168170
169171 if (std::abs (collision.posZ ()) > zVtxMax) {
170172 return ;
171173 }
172- registry.fill (HIST (" hEventSel" ), 3 . );
174+ registry.fill (HIST (" hEventSel" ), VtxZAfterSel + 1 );
173175 registry.fill (HIST (" hVtxZAfterSel" ), collision.posZ ());
174176
175177 // T0M centrality
@@ -205,7 +207,7 @@ struct HfTaskSingleMuonMult {
205207 registry.fill (HIST (" hMuBeforeMatchMFT" ), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
206208
207209 // histograms before the acceptance cuts
208- registry.fill (HIST (" hMuonSel" ), 1 . );
210+ registry.fill (HIST (" hMuonSel" ), NoCut + 1 );
209211 registry.fill (HIST (" hMuBeforeAccCuts" ), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
210212 registry.fill (HIST (" h3DCABeforeAccCuts" ), muon.fwdDcaX (), muon.fwdDcaY (), muTrackType);
211213
@@ -222,14 +224,14 @@ struct HfTaskSingleMuonMult {
222224 if ((eta >= etaMax) || (eta < etaMin)) {
223225 continue ;
224226 }
225- registry.fill (HIST (" hMuonSel" ), 2 . );
227+ registry.fill (HIST (" hMuonSel" ), EtaCut + 1 );
226228 registry.fill (HIST (" hMuAfterEtaCuts" ), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
227229
228230 // Rabsorb cuts
229231 if ((rAbsorb < rAbsorbMin) || (rAbsorb >= rAbsorbMax)) {
230232 continue ;
231233 }
232- registry.fill (HIST (" hMuonSel" ), 3 . );
234+ registry.fill (HIST (" hMuonSel" ), RAbsorbCut + 1 );
233235 registry.fill (HIST (" hMuAfterRAbsorbCuts" ), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
234236
235237 if ((rAbsorb < rAbsorbMid) && (pDca >= pDcaMin)) {
@@ -238,14 +240,14 @@ struct HfTaskSingleMuonMult {
238240 if ((rAbsorb >= rAbsorbMid) && (pDca >= pDcaMax)) {
239241 continue ;
240242 }
241- registry.fill (HIST (" hMuonSel" ), 4 . );
243+ registry.fill (HIST (" hMuonSel" ), PDcaCut + 1 );
242244 registry.fill (HIST (" hMuAfterPdcaCuts" ), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
243245
244246 // MCH-MFT matching chi2
245247 if (muon.chi2 () >= 1e6 ) {
246248 continue ;
247249 }
248- registry.fill (HIST (" hMuonSel" ), 5 . );
250+ registry.fill (HIST (" hMuonSel" ), Chi2Cut + 1 );
249251
250252 // histograms after acceptance cuts
251253 registry.fill (HIST (" hMuAfterAccCuts" ), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
0 commit comments