Skip to content

Commit

Permalink
Standardise scalers reporting in LF (AliceO2Group#5456)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mpuccio authored Apr 3, 2024
1 parent baa39e2 commit ccc70a9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
11 changes: 7 additions & 4 deletions EventFiltering/PWGLF/filterf1proton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ struct filterf1proton {
Configurable<double> cMaxRelMom{"cMaxRelMom", 0.5, "Relative momentum cut"};

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

template <typename T>
Expand Down Expand Up @@ -643,12 +646,12 @@ struct filterf1proton {
}
}
}
qaRegistry.fill(HIST("hEventstat"), 0.5);
hProcessedEvents->Fill(0.5);
if (numberF1 > 0) {
qaRegistry.fill(HIST("hEventstat"), 1.5);
hProcessedEvents->Fill(1.5);
}
if (keepEventF1Proton) {
qaRegistry.fill(HIST("hEventstat"), 2.5);
hProcessedEvents->Fill(2.5);
}
tags(keepEventF1Proton);
}
Expand Down
16 changes: 7 additions & 9 deletions EventFiltering/PWGLF/nucleiFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static constexpr std::array<int, nNuclei> charges{1, 1, 2};
static const std::vector<std::string> matterOrNot{"Matter", "Antimatter"};
static const std::vector<std::string> nucleiNames{"H2", "H3", "Helium"};
static const std::vector<std::string> hypernucleiNames{"H3L"}; // 3-body decay case
static const std::vector<std::string> columnsNames{"fH2", "fH3", o2::aod::filtering::He::columnLabel(), o2::aod::filtering::H3L3Body::columnLabel()};
static const std::vector<std::string> cutsNames{
"TPCnSigmaMin", "TPCnSigmaMax", "TOFnSigmaMin", "TOFnSigmaMax", "TOFpidStartPt"};
constexpr double betheBlochDefault[nNuclei][6]{
Expand Down Expand Up @@ -112,6 +113,7 @@ struct nucleiFilter {
Configurable<bool> fixTPCinnerParam{"fixTPCinnerParam", false, "Fix TPC inner param"};

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

void init(o2::framework::InitContext&)
{
Expand All @@ -130,13 +132,9 @@ struct nucleiFilter {
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.)"}});
}

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}}))};
scalers->GetXaxis()->SetBinLabel(1, "Processed events");
for (uint32_t iS{0}; iS < nucleiNames.size(); ++iS) {
scalers->GetXaxis()->SetBinLabel(iS + 2, nucleiNames[iS].data());
}
for (uint32_t iS{0}; iS < hypernucleiNames.size(); ++iS) {
scalers->GetXaxis()->SetBinLabel(iS + nucleiNames.size() + 2, hypernucleiNames[iS].data());
hProcessedEvents->GetXaxis()->SetBinLabel(1, "Processed events");
for (uint32_t iS{0}; iS < columnsNames.size(); ++iS) {
hProcessedEvents->GetXaxis()->SetBinLabel(iS + 2, columnsNames[iS].data());
}
}

Expand All @@ -149,7 +147,7 @@ struct nucleiFilter {
bool keepEvent[nNuclei + nHyperNuclei]{false};
//
qaHists.fill(HIST("fCollZpos"), collision.posZ());
qaHists.fill(HIST("fProcessedEvents"), 0);
hProcessedEvents->Fill(0);
//
if (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
tags(keepEvent[2], keepEvent[3]);
Expand Down Expand Up @@ -258,7 +256,7 @@ struct nucleiFilter {

for (int iDecision{0}; iDecision < nNuclei + nHyperNuclei; ++iDecision) {
if (keepEvent[iDecision]) {
qaHists.fill(HIST("fProcessedEvents"), iDecision + 1);
hProcessedEvents->Fill(iDecision + 1);
}
}
tags(keepEvent[2], keepEvent[3]);
Expand Down
23 changes: 12 additions & 11 deletions EventFiltering/PWGLF/strangenessFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct strangenessFilter {
HistogramRegistry QAHistosTriggerParticles{"QAHistosTriggerParticles", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
HistogramRegistry QAHistosStrangenessTracking{"QAHistosStrangenessTracking", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
HistogramRegistry EventsvsMultiplicity{"EventsvsMultiplicity", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
OutputObj<TH1F> hProcessedEvents{TH1F("hProcessedEvents", "Strangeness - event filtered; Event counter; Number of events", 13, -1., 12.)};
OutputObj<TH1D> hProcessedEvents{TH1D("hProcessedEvents", "Strangeness - event filtered;; Number of events", 13, -1., 12.)};
OutputObj<TH1F> hCandidate{TH1F("hCandidate", "; Candidate pass selection; Number of events", 30, 0., 30.)};
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.)};
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.)};
Expand Down Expand Up @@ -180,18 +180,19 @@ struct strangenessFilter {
mTrackSelector.SetMaxDcaXY(1.f);
mTrackSelector.SetMaxDcaZ(2.f);

hProcessedEvents->GetXaxis()->SetBinLabel(2, "Events processed");
hProcessedEvents->GetXaxis()->SetBinLabel(1, "Events processed");
hProcessedEvents->GetXaxis()->SetBinLabel(2, "Event selection");
hProcessedEvents->GetXaxis()->SetBinLabel(3, "Events w/ high-#it{p}_{T} hadron");
hProcessedEvents->GetXaxis()->SetBinLabel(4, "#Omega");
hProcessedEvents->GetXaxis()->SetBinLabel(5, "high-#it{p}_{T} hadron - #Xi");
hProcessedEvents->GetXaxis()->SetBinLabel(6, "2#Xi");
hProcessedEvents->GetXaxis()->SetBinLabel(7, "3#Xi");
hProcessedEvents->GetXaxis()->SetBinLabel(8, "4#Xi");
hProcessedEvents->GetXaxis()->SetBinLabel(9, "#Xi-YN");
hProcessedEvents->GetXaxis()->SetBinLabel(10, "#Omega high radius");
hProcessedEvents->GetXaxis()->SetBinLabel(4, aod::filtering::Omega::columnLabel());
hProcessedEvents->GetXaxis()->SetBinLabel(5, aod::filtering::hadronXi::columnLabel());
hProcessedEvents->GetXaxis()->SetBinLabel(6, aod::filtering::DoubleXi::columnLabel());
hProcessedEvents->GetXaxis()->SetBinLabel(7, aod::filtering::TripleXi::columnLabel());
hProcessedEvents->GetXaxis()->SetBinLabel(8, aod::filtering::QuadrupleXi::columnLabel());
hProcessedEvents->GetXaxis()->SetBinLabel(9, aod::filtering::SingleXiYN::columnLabel());
hProcessedEvents->GetXaxis()->SetBinLabel(10, aod::filtering::OmegaLargeRadius::columnLabel());
hProcessedEvents->GetXaxis()->SetBinLabel(11, "#Xi");
hProcessedEvents->GetXaxis()->SetBinLabel(12, "trk. #Xi");
hProcessedEvents->GetXaxis()->SetBinLabel(13, "trk. #Omega");
hProcessedEvents->GetXaxis()->SetBinLabel(12, aod::filtering::TrackedXi::columnLabel());
hProcessedEvents->GetXaxis()->SetBinLabel(13, aod::filtering::TrackedOmega::columnLabel());

hCandidate->GetXaxis()->SetBinLabel(1, "All");
hCandidate->GetXaxis()->SetBinLabel(2, "Has_V0");
Expand Down

0 comments on commit ccc70a9

Please sign in to comment.