Skip to content

Commit ccc70a9

Browse files
authored
Standardise scalers reporting in LF (#5456)
This is an example to be followed by the other PWGs to enable automatic verification of the consistency of the scalers with the CEFP reporting
1 parent baa39e2 commit ccc70a9

3 files changed

Lines changed: 26 additions & 24 deletions

File tree

EventFiltering/PWGLF/filterf1proton.cxx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ struct filterf1proton {
130130
Configurable<double> cMaxRelMom{"cMaxRelMom", 0.5, "Relative momentum cut"};
131131

132132
// Histogram
133+
OutputObj<TH1D> hProcessedEvents{TH1D("hProcessedEvents", ";; Number of events", 3, 0.0f, 3.0f)};
133134
HistogramRegistry qaRegistry{"QAHistos", {
134-
{"hEventstat", "hEventstat", {HistType::kTH1F, {{3, 0.0f, 3.0f}}}},
135135
{"hInvMassf1", "hInvMassf1", {HistType::kTH2F, {{400, 1.1f, 1.9f}, {100, 0.0f, 10.0f}}}},
136136
{"hInvMassf1Like", "hInvMassf1Like", {HistType::kTH2F, {{400, 1.1f, 1.9f}, {100, 0.0f, 10.0f}}}},
137137
{"hInvMassf1kstar", "hInvMassf1kstar", {HistType::kTH3F, {{400, 1.1f, 1.9f}, {100, 0.0f, 10.0f}, {8, 0.0f, 0.8f}}}},
@@ -158,6 +158,9 @@ struct filterf1proton {
158158
ccdb->setCaching(true);
159159
ccdb->setLocalObjectValidityChecking();
160160
ccdb->setCreatedNotAfter(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count());
161+
hProcessedEvents->GetXaxis()->SetBinLabel(1, "All events");
162+
hProcessedEvents->GetXaxis()->SetBinLabel(2, "Events with F1");
163+
hProcessedEvents->GetXaxis()->SetBinLabel(3, aod::filtering::TriggerEventF1Proton::columnLabel());
161164
}
162165

163166
template <typename T>
@@ -643,12 +646,12 @@ struct filterf1proton {
643646
}
644647
}
645648
}
646-
qaRegistry.fill(HIST("hEventstat"), 0.5);
649+
hProcessedEvents->Fill(0.5);
647650
if (numberF1 > 0) {
648-
qaRegistry.fill(HIST("hEventstat"), 1.5);
651+
hProcessedEvents->Fill(1.5);
649652
}
650653
if (keepEventF1Proton) {
651-
qaRegistry.fill(HIST("hEventstat"), 2.5);
654+
hProcessedEvents->Fill(2.5);
652655
}
653656
tags(keepEventF1Proton);
654657
}

EventFiltering/PWGLF/nucleiFilter.cxx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ static constexpr std::array<int, nNuclei> charges{1, 1, 2};
4444
static const std::vector<std::string> matterOrNot{"Matter", "Antimatter"};
4545
static const std::vector<std::string> nucleiNames{"H2", "H3", "Helium"};
4646
static const std::vector<std::string> hypernucleiNames{"H3L"}; // 3-body decay case
47+
static const std::vector<std::string> columnsNames{"fH2", "fH3", o2::aod::filtering::He::columnLabel(), o2::aod::filtering::H3L3Body::columnLabel()};
4748
static const std::vector<std::string> cutsNames{
4849
"TPCnSigmaMin", "TPCnSigmaMax", "TOFnSigmaMin", "TOFnSigmaMax", "TOFpidStartPt"};
4950
constexpr double betheBlochDefault[nNuclei][6]{
@@ -112,6 +113,7 @@ struct nucleiFilter {
112113
Configurable<bool> fixTPCinnerParam{"fixTPCinnerParam", false, "Fix TPC inner param"};
113114

114115
HistogramRegistry qaHists{"qaHists", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
116+
OutputObj<TH1D> hProcessedEvents{TH1D("hProcessedEvents", ";;Number of filtered events", nNuclei + nHyperNuclei + 1, -0.5, nNuclei + nHyperNuclei + 0.5)};
115117

116118
void init(o2::framework::InitContext&)
117119
{
@@ -130,13 +132,9 @@ struct nucleiFilter {
130132
h2TPCnSigma[iN] = qaHists.add<TH2>(Form("fTPCcounts_%s", nucleiNames[iN].data()), "n-sigma TPC", HistType::kTH2F, {{100, -5, 5, "#it{p} /Z (GeV/#it{c})"}, {200, -10., +10., "n#sigma_{He} (a. u.)"}});
131133
}
132134

133-
auto scalers{std::get<std::shared_ptr<TH1>>(qaHists.add("fProcessedEvents", ";;Number of filtered events", HistType::kTH1F, {{nNuclei + nHyperNuclei + 1, -0.5, nNuclei + nHyperNuclei + 0.5}}))};
134-
scalers->GetXaxis()->SetBinLabel(1, "Processed events");
135-
for (uint32_t iS{0}; iS < nucleiNames.size(); ++iS) {
136-
scalers->GetXaxis()->SetBinLabel(iS + 2, nucleiNames[iS].data());
137-
}
138-
for (uint32_t iS{0}; iS < hypernucleiNames.size(); ++iS) {
139-
scalers->GetXaxis()->SetBinLabel(iS + nucleiNames.size() + 2, hypernucleiNames[iS].data());
135+
hProcessedEvents->GetXaxis()->SetBinLabel(1, "Processed events");
136+
for (uint32_t iS{0}; iS < columnsNames.size(); ++iS) {
137+
hProcessedEvents->GetXaxis()->SetBinLabel(iS + 2, columnsNames[iS].data());
140138
}
141139
}
142140

@@ -149,7 +147,7 @@ struct nucleiFilter {
149147
bool keepEvent[nNuclei + nHyperNuclei]{false};
150148
//
151149
qaHists.fill(HIST("fCollZpos"), collision.posZ());
152-
qaHists.fill(HIST("fProcessedEvents"), 0);
150+
hProcessedEvents->Fill(0);
153151
//
154152
if (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
155153
tags(keepEvent[2], keepEvent[3]);
@@ -258,7 +256,7 @@ struct nucleiFilter {
258256

259257
for (int iDecision{0}; iDecision < nNuclei + nHyperNuclei; ++iDecision) {
260258
if (keepEvent[iDecision]) {
261-
qaHists.fill(HIST("fProcessedEvents"), iDecision + 1);
259+
hProcessedEvents->Fill(iDecision + 1);
262260
}
263261
}
264262
tags(keepEvent[2], keepEvent[3]);

EventFiltering/PWGLF/strangenessFilter.cxx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct strangenessFilter {
6868
HistogramRegistry QAHistosTriggerParticles{"QAHistosTriggerParticles", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
6969
HistogramRegistry QAHistosStrangenessTracking{"QAHistosStrangenessTracking", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
7070
HistogramRegistry EventsvsMultiplicity{"EventsvsMultiplicity", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
71-
OutputObj<TH1F> hProcessedEvents{TH1F("hProcessedEvents", "Strangeness - event filtered; Event counter; Number of events", 13, -1., 12.)};
71+
OutputObj<TH1D> hProcessedEvents{TH1D("hProcessedEvents", "Strangeness - event filtered;; Number of events", 13, -1., 12.)};
7272
OutputObj<TH1F> hCandidate{TH1F("hCandidate", "; Candidate pass selection; Number of events", 30, 0., 30.)};
7373
OutputObj<TH1F> hEvtvshMinPt{TH1F("hEvtvshMinPt", " Number of h-Xi events with pT_h higher than thrd; hadrons with p_{T}>bincenter (GeV/c); Number of events", 11, 0., 11.)};
7474
OutputObj<TH1F> hhXiPairsvsPt{TH1F("hhXiPairsvsPt", "pt distributions of Xi in events with a trigger particle; #it{p}_{T} (GeV/c); Number of Xi", 100, 0., 10.)};
@@ -180,18 +180,19 @@ struct strangenessFilter {
180180
mTrackSelector.SetMaxDcaXY(1.f);
181181
mTrackSelector.SetMaxDcaZ(2.f);
182182

183-
hProcessedEvents->GetXaxis()->SetBinLabel(2, "Events processed");
183+
hProcessedEvents->GetXaxis()->SetBinLabel(1, "Events processed");
184+
hProcessedEvents->GetXaxis()->SetBinLabel(2, "Event selection");
184185
hProcessedEvents->GetXaxis()->SetBinLabel(3, "Events w/ high-#it{p}_{T} hadron");
185-
hProcessedEvents->GetXaxis()->SetBinLabel(4, "#Omega");
186-
hProcessedEvents->GetXaxis()->SetBinLabel(5, "high-#it{p}_{T} hadron - #Xi");
187-
hProcessedEvents->GetXaxis()->SetBinLabel(6, "2#Xi");
188-
hProcessedEvents->GetXaxis()->SetBinLabel(7, "3#Xi");
189-
hProcessedEvents->GetXaxis()->SetBinLabel(8, "4#Xi");
190-
hProcessedEvents->GetXaxis()->SetBinLabel(9, "#Xi-YN");
191-
hProcessedEvents->GetXaxis()->SetBinLabel(10, "#Omega high radius");
186+
hProcessedEvents->GetXaxis()->SetBinLabel(4, aod::filtering::Omega::columnLabel());
187+
hProcessedEvents->GetXaxis()->SetBinLabel(5, aod::filtering::hadronXi::columnLabel());
188+
hProcessedEvents->GetXaxis()->SetBinLabel(6, aod::filtering::DoubleXi::columnLabel());
189+
hProcessedEvents->GetXaxis()->SetBinLabel(7, aod::filtering::TripleXi::columnLabel());
190+
hProcessedEvents->GetXaxis()->SetBinLabel(8, aod::filtering::QuadrupleXi::columnLabel());
191+
hProcessedEvents->GetXaxis()->SetBinLabel(9, aod::filtering::SingleXiYN::columnLabel());
192+
hProcessedEvents->GetXaxis()->SetBinLabel(10, aod::filtering::OmegaLargeRadius::columnLabel());
192193
hProcessedEvents->GetXaxis()->SetBinLabel(11, "#Xi");
193-
hProcessedEvents->GetXaxis()->SetBinLabel(12, "trk. #Xi");
194-
hProcessedEvents->GetXaxis()->SetBinLabel(13, "trk. #Omega");
194+
hProcessedEvents->GetXaxis()->SetBinLabel(12, aod::filtering::TrackedXi::columnLabel());
195+
hProcessedEvents->GetXaxis()->SetBinLabel(13, aod::filtering::TrackedOmega::columnLabel());
195196

196197
hCandidate->GetXaxis()->SetBinLabel(1, "All");
197198
hCandidate->GetXaxis()->SetBinLabel(2, "Has_V0");

0 commit comments

Comments
 (0)