Skip to content

Commit f5fcbd1

Browse files
authored
Added enum for Event and Track selection bins
1. Added enum for event selection bins (line #56) 2. Added enum for track selection bins (line #63)
1 parent 7257414 commit f5fcbd1

File tree

1 file changed

+37
-21
lines changed

1 file changed

+37
-21
lines changed

PWGHF/HFL/Tasks/taskSingleMuonMult.cxx

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,23 @@ using namespace o2::framework::expressions;
5151
using namespace o2::aod::fwdtrack;
5252

5353
struct HfTaskSingleMuonMult {
54+
55+
// enum for event selection bins
56+
enum EventSelectionBins : int {
57+
AllEvents = 1,
58+
Sel8,
59+
VtxZAfterSel
60+
};
61+
62+
// enum for muon track selection bins
63+
enum MuonTrackSelectionBinsEnum : int {
64+
NoCut = 1,
65+
EtaCut,
66+
RAbsorbCut,
67+
PDcaCut,
68+
Chi2Cut
69+
};
70+
5471
Configurable<float> zVtxMax{"zVtxMax", 10., "maxium z of primary vertex [cm]"};
5572
Configurable<float> ptTrackMin{"ptTrackMin", 0.15, "minimum pt of tracks"};
5673
Configurable<float> etaTrackMax{"etaTrackMax", 0.8, "maximum pseudorapidity of tracks"};
@@ -80,7 +97,6 @@ struct HfTaskSingleMuonMult {
8097
{
8198
AxisSpec axisCent = {101, -0.5, 100.5, "centrality"};
8299
AxisSpec axisEvent{3, 0.5, 3.5, "Event Selection"};
83-
AxisSpec axisEventSize{500, 0.5, 500.5, "Event Size"};
84100
AxisSpec axisVtxZ{80, -20., 20., "#it{z}_{vtx} (cm)"};
85101
AxisSpec axisMuTrk{5, 0.5, 5.5, "Muon Selection"};
86102
AxisSpec axisNCh{500, 0.5, 500.5, "#it{N}_{ch}"};
@@ -100,8 +116,8 @@ struct HfTaskSingleMuonMult {
100116
AxisSpec axisPtDif{200, -2., 2., "#it{p}_{T} diff (GeV/#it{c})"};
101117

102118
registry.add("hCentrality", "Centrality Percentile", {HistType::kTH1F, {axisCent}});
103-
registry.add("hEvent", " Number of Events", {HistType::kTH1F, {axisEvent}});
104-
registry.add("hEventSize", "Event Size", {HistType::kTH1F, {axisEventSize}});
119+
registry.add("hEventSel", " Number of Events", {HistType::kTH1F, {axisEvent}});
120+
registry.add("hNch", "Charged Particle Multiplicity", {HistType::kTH1F, {axisNCh}});
105121
registry.add("hVtxZBeforeSel", "Z-vertex distribution before zVtx Cut", {HistType::kTH1F, {axisVtxZ}});
106122
registry.add("hVtxZAfterSel", "Z-vertex distribution after zVtx Cut", {HistType::kTH1F, {axisVtxZ}});
107123

@@ -121,37 +137,37 @@ struct HfTaskSingleMuonMult {
121137
registry.add("h3MultNchNmu", "Number of muons and multiplicity", {HistType::kTH3F, {axisCent, axisNCh, axisNMu}});
122138
registry.add("hMultNchNmuTrackType", "Number of muons with different types and multiplicity", {HistType::kTHnSparseF, {axisCent, axisNCh, axisNMu, axisTrackType}, 4});
123139

124-
auto hEvstat = registry.get<TH1>(HIST("hEvent"));
140+
auto hEvstat = registry.get<TH1>(HIST("hEventSel"));
125141
auto* xEv = hEvstat->GetXaxis();
126-
xEv->SetBinLabel(1, "All events");
127-
xEv->SetBinLabel(2, "sel8");
128-
xEv->SetBinLabel(3, "VtxZAfterSel");
142+
xEv->SetBinLabel(AllEvents, "All events");
143+
xEv->SetBinLabel(Sel8, "sel8");
144+
xEv->SetBinLabel(VtxZAfterSel, "VtxZAfterSel");
129145

130146
auto hMustat = registry.get<TH1>(HIST("hMuTrkSel"));
131147
auto* xMu = hMustat->GetXaxis();
132-
xMu->SetBinLabel(1, "noCut");
133-
xMu->SetBinLabel(2, "etaCut");
134-
xMu->SetBinLabel(3, "RAbsorbCut");
135-
xMu->SetBinLabel(4, "pDcaCut");
136-
xMu->SetBinLabel(5, "chi2Cut");
148+
xMu->SetBinLabel(NoCut, "noCut");
149+
xMu->SetBinLabel(EtaCut, "etaCut");
150+
xMu->SetBinLabel(RAbsorbCut, "RAbsorbCut");
151+
xMu->SetBinLabel(PDcaCut, "pDcaCut");
152+
xMu->SetBinLabel(Chi2Cut, "chi2Cut");
137153
}
138154

139155
void process(MyCollisions::iterator const& collision,
140156
MyTracks const& tracks,
141157
MyMuons const& muons)
142158
{
143-
registry.fill(HIST("hEvent"), 1);
159+
registry.fill(HIST("hEventSel"), AllEvents);
144160

145161
if (!collision.sel8()) {
146162
return;
147163
}
148-
registry.fill(HIST("hEvent"), 2);
164+
registry.fill(HIST("hEventSel"), Sel8);
149165
registry.fill(HIST("hVtxZBeforeSel"), collision.posZ());
150166

151167
if (std::abs(collision.posZ()) > zVtxMax) {
152168
return;
153169
}
154-
registry.fill(HIST("hEvent"), 3);
170+
registry.fill(HIST("hEventSel"), VtxZAfterSel);
155171
registry.fill(HIST("hVtxZAfterSel"), collision.posZ());
156172

157173
// T0M centrality
@@ -169,7 +185,7 @@ struct HfTaskSingleMuonMult {
169185
if (nCh < 1) {
170186
return;
171187
}
172-
registry.fill(HIST("hEventSize"), nCh);
188+
registry.fill(HIST("hNch"), nCh);
173189

174190
for (const auto& track : tracks) {
175191
registry.fill(HIST("hTHnTrk"), cent, nCh, track.pt(), track.eta(), track.sign());
@@ -187,7 +203,7 @@ struct HfTaskSingleMuonMult {
187203
registry.fill(HIST("hMuBeforeMatchMFT"), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
188204

189205
// histograms before the acceptance cuts
190-
registry.fill(HIST("hMuTrkSel"), 1);
206+
registry.fill(HIST("hMuTrkSel"), NoCut);
191207
registry.fill(HIST("hMuBeforeAccCuts"), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
192208
registry.fill(HIST("h3DCABeforeAccCuts"), muon.fwdDcaX(), muon.fwdDcaY(), muTrackType);
193209

@@ -204,14 +220,14 @@ struct HfTaskSingleMuonMult {
204220
if ((eta >= etaMax) || (eta < etaMin)) {
205221
continue;
206222
}
207-
registry.fill(HIST("hMuTrkSel"), 2);
223+
registry.fill(HIST("hMuTrkSel"), EtaCut);
208224
registry.fill(HIST("hMuAfterEtaCuts"), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
209225

210226
// Rabsorb cuts
211227
if ((rAbsorb < rAbsorbMin) || (rAbsorb >= rAbsorbMax)) {
212228
continue;
213229
}
214-
registry.fill(HIST("hMuTrkSel"), 3);
230+
registry.fill(HIST("hMuTrkSel"), RAbsorbCut);
215231
registry.fill(HIST("hMuAfterRAbsorbCuts"), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
216232

217233
if ((rAbsorb < rAbsorbMid) && (pDca >= pDcaMin)) {
@@ -220,14 +236,14 @@ struct HfTaskSingleMuonMult {
220236
if ((rAbsorb >= rAbsorbMid) && (pDca >= pDcaMax)) {
221237
continue;
222238
}
223-
registry.fill(HIST("hMuTrkSel"), 4);
239+
registry.fill(HIST("hMuTrkSel"), PDcaCut);
224240
registry.fill(HIST("hMuAfterPdcaCuts"), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
225241

226242
// MCH-MFT matching chi2
227243
if (muon.chi2() >= 1e6) {
228244
continue;
229245
}
230-
registry.fill(HIST("hMuTrkSel"), 5);
246+
registry.fill(HIST("hMuTrkSel"), Chi2Cut);
231247

232248
// histograms after acceptance cuts
233249
registry.fill(HIST("hMuAfterAccCuts"), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);

0 commit comments

Comments
 (0)