Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 45 additions & 15 deletions PWGLF/TableProducer/Nuspex/trackedHypertritonRecoTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,15 @@ struct TrackedHypertritonRecoTask {
selections.minCosPA = threeBody.minCosPA;
selections.maxChi2 = threeBody.maxChi2;

registry.add("events", "Event selection;selection;events", HistType::kTH1D, {{5, -0.5, 4.5}});
auto events = registry.get<TH1>(HIST("events"));
events->GetXaxis()->SetBinLabel(1, "all");
events->GetXaxis()->SetBinLabel(2, "sel8");
events->GetXaxis()->SetBinLabel(3, "z_{vtx}");
events->GetXaxis()->SetBinLabel(4, "kNoSameBunchPileup");
events->GetXaxis()->SetBinLabel(5, "kIsGoodZvtxFT0vsPV");
if (doprocessData) {
registry.add("hEventCounter", "Event selection;selection;events", HistType::kTH1D, {{5, -0.5, 4.5}});
auto hEventCounter = registry.get<TH1>(HIST("hEventCounter"));
hEventCounter->GetXaxis()->SetBinLabel(1, "all");
hEventCounter->GetXaxis()->SetBinLabel(2, "sel8");
hEventCounter->GetXaxis()->SetBinLabel(3, "z_{vtx}");
hEventCounter->GetXaxis()->SetBinLabel(4, "kNoSameBunchPileup");
hEventCounter->GetXaxis()->SetBinLabel(5, "kIsGoodZvtxFT0vsPV");
}
registry.add("zorroEvents", "Zorro accounting;trigger;selection", HistType::kTH2D,
{{2, -0.5, 1.5}, {2, -0.5, 1.5}});
auto zorroEvents = registry.get<TH2>(HIST("zorroEvents"));
Expand All @@ -330,6 +332,13 @@ struct TrackedHypertritonRecoTask {
zorroEvents->GetYaxis()->SetBinLabel(2, "after sel8");

if (doprocessMC) {
registry.add("hRecEventCounter", "Event selection;selection;events", HistType::kTH1D, {{5, -0.5, 4.5}});
auto hRecEventCounter = registry.get<TH1>(HIST("hRecEventCounter"));
hRecEventCounter->GetXaxis()->SetBinLabel(1, "all");
hRecEventCounter->GetXaxis()->SetBinLabel(2, "sel8");
hRecEventCounter->GetXaxis()->SetBinLabel(3, "z_{vtx}");
hRecEventCounter->GetXaxis()->SetBinLabel(4, "kNoSameBunchPileup");
hRecEventCounter->GetXaxis()->SetBinLabel(5, "kIsGoodZvtxFT0vsPV");
auto hMcEventCounter = registry.add<TH1>("hMcEventCounter", "hMcEventCounter; Selection; Counts", HistType::kTH1D, {{3, 0.0f, 3.0f}});
hMcEventCounter->GetXaxis()->SetBinLabel(1, "all");
hMcEventCounter->GetXaxis()->SetBinLabel(2, "reconstructed");
Expand Down Expand Up @@ -377,13 +386,18 @@ struct TrackedHypertritonRecoTask {
runNumber = bc.runNumber();
}

template <typename TCollision>
template <bool isMC, typename TCollision>
void selectCollisions(TCollision const& collisions, bool applyZorro)
{
goodCollision.assign(collisions.size(), false);
zorroDecision.assign(collisions.size(), {});
for (const auto& collision : collisions) {
registry.fill(HIST("events"), 0.);
if constexpr (isMC) {
registry.fill(HIST("hRecEventCounter"), 0.);
} else {
registry.fill(HIST("hEventCounter"), 0.);
}

auto bc = collision.template bc_as<aod::BCsWithTimestamps>();
initCCDB(bc);

Expand All @@ -401,19 +415,35 @@ struct TrackedHypertritonRecoTask {
if (requireSel8 && !collision.sel8()) {
continue;
}
registry.fill(HIST("events"), 1.);
if constexpr (isMC) {
registry.fill(HIST("hRecEventCounter"), 1.);
} else {
registry.fill(HIST("hEventCounter"), 1.);
}
if (maxAbsZvtx >= 0.f && std::abs(collision.posZ()) > maxAbsZvtx) {
continue;
}
registry.fill(HIST("events"), 2.);
if constexpr (isMC) {
registry.fill(HIST("hRecEventCounter"), 2.);
} else {
registry.fill(HIST("hEventCounter"), 2.);
}
if (requireNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
continue;
}
registry.fill(HIST("events"), 3.);
if constexpr (isMC) {
registry.fill(HIST("hRecEventCounter"), 3.);
} else {
registry.fill(HIST("hEventCounter"), 3.);
}
if (requireIsGoodZvtxFT0vsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
continue;
}
registry.fill(HIST("events"), 4.);
if constexpr (isMC) {
registry.fill(HIST("hRecEventCounter"), 4.);
} else {
registry.fill(HIST("hEventCounter"), 4.);
}

goodCollision[collision.globalIndex()] = true;
if (applyZorro) {
Expand Down Expand Up @@ -937,7 +967,7 @@ struct TrackedHypertritonRecoTask {
Tracks const& /*tracks*/,
aod::BCsWithTimestamps const&)
{
selectCollisions(collisions, skimmedProcessing);
selectCollisions<false>(collisions, skimmedProcessing);

for (const auto& trackedV0 : trackedV0s) {
const auto inputV0 = trackedV0.v0_as<aod::V0s>();
Expand Down Expand Up @@ -1016,7 +1046,7 @@ struct TrackedHypertritonRecoTask {
aod::BCsWithTimestamps const&,
aod::McParticles const& mcParticles)
{
selectCollisions(collisions, false);
selectCollisions<true>(collisions, false);

// MC collision counting for event loss and MC closure
registry.fill(HIST("hMcEventCounter"), 0.5, mcCollisions.size());
Expand Down
Loading