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
57 changes: 46 additions & 11 deletions PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
///
/// \author Giovanni Malfattore <giovanni.malfattore@cern.ch> and Rutuparna Rath <rutuparna.rath@cern.ch>

// o2-linter: disable=name/workflow-file
// o2-linter: disable=name/workflow-file (temporary fix)

#include "PWGLF/DataModel/LFNucleiTables.h"
#include "PWGLF/DataModel/LFParticleIdentification.h"
Expand Down Expand Up @@ -428,6 +428,9 @@ struct lfNucleiBATask {
histoGen.get<TH1>(HIST("events/hMCReco"))->GetXaxis()->SetBinLabel(2, "Ev sel passed");
histoGen.get<TH1>(HIST("events/hMCReco"))->GetXaxis()->SetBinLabel(3, "INELgt0");

histoGen.add("events/hNRecoCollPerMCColl_INEL", "Reco collisions per MC collision;N_{reco coll};Counts", HistType::kTH1D, {{6, -0.5, 5.5}});
histoGen.add("events/hNRecoCollPerMCColl_INELgt0", "Reco INEL>0 collisions per MC collision;N_{reco coll};Counts", HistType::kTH1D, {{6, -0.5, 5.5}});

histoGen.add<TH2>("helium/MCGen/h2HeliumYvsPt", "#it{y} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptHeAxis}});
histoGen.add<TH2>("helium/MCGen/h2antiHeliumYvsPt", "#it{y} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptHeAxis}});

Expand Down Expand Up @@ -467,6 +470,9 @@ struct lfNucleiBATask {
histoGen.get<TH2>(HIST("events/hMCRecoVsMult"))->GetXaxis()->SetBinLabel(2, "Ev sel passed");
histoGen.get<TH2>(HIST("events/hMCRecoVsMult"))->GetXaxis()->SetBinLabel(3, "INELgt0");

histoGen.add("events/hNRecoCollPerMCCollVsMult_INEL", "Reco collisions per MC collision vs FT0M;N_{reco coll};FT0M percentile", HistType::kTH2D, {{6, -0.5, 5.5}, {binsPercentile}});
histoGen.add("events/hNRecoCollPerMCCollVsMult_INELgt0", "Reco INEL>0 collisions per MC collision vs FT0M;N_{reco coll};FT0M percentile", HistType::kTH2D, {{6, -0.5, 5.5}, {binsPercentile}});

histoGen.add("helium/MCGen/ptGenVsMult_INEL_Prim_He", "generated particles", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}});
histoGen.add("helium/MCGen/ptGenVsMult_INEL_Prim_antiHe", "generated particles", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}});
histoGen.add("helium/MCGen/ptGenVsMult_INELgt0_Prim_He", "generated particles", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}});
Expand Down Expand Up @@ -2324,6 +2330,8 @@ struct lfNucleiBATask {
LOG(info) << "Histograms of lfNucleiBATask:";
histos.print();
spectraGen.print();
if (doprocessMCGenLosses)
histoGen.print();
}

template <bool IsMC, bool IsFilteredData, typename CollisionType, typename TracksType, typename ParticleType>
Expand Down Expand Up @@ -2596,6 +2604,7 @@ struct lfNucleiBATask {
}
if (enablePtShiftPID && fShiftPtPID) {
shiftPtPID = fShiftPtPID->Eval(2 * track.pt());

if (tritonPID && (track.pt() <= cfgPtShiftPID)) {
hePt = track.pt() - shiftPtPID / 2.f;
antihePt = track.pt() - shiftPtPID / 2.f;
Expand Down Expand Up @@ -6719,9 +6728,9 @@ struct lfNucleiBATask {

if (isTvxEvent)
evLossHistos.fill(HIST("evLoss/hEvent"), 1.5);
if (isSel8Event)
evLossHistos.fill(HIST("evLoss/hEvent"), 2.5);
if (isMCSel8Event)
evLossHistos.fill(HIST("evLoss/hEvent"), 2.5);
if (isSel8Event)
evLossHistos.fill(HIST("evLoss/hEvent"), 3.5);

// Loop over all the Generated level particles
Expand Down Expand Up @@ -6791,6 +6800,7 @@ struct lfNucleiBATask {
// Vtz cut
if (mcCollision.posZ() < cfgVzCutLow || mcCollision.posZ() > cfgVzCutHigh)
return;

histoGen.fill(HIST("events/hMCGen"), 1.5);
if (enableCentrality)
histoGen.fill(HIST("events/hMCGenVsMult"), 1.5, mcCollision.centFT0M());
Expand Down Expand Up @@ -6823,6 +6833,7 @@ struct lfNucleiBATask {
if (enableCentrality)
histoGen.fill(HIST("helium/MCGen/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M());
}

if (isINELgt0true) {
if (pdg > 0) {
histoGen.fill(HIST("helium/MCGen/ptGen_INELgt0_Prim_He"), pt);
Expand All @@ -6839,33 +6850,49 @@ struct lfNucleiBATask {

int recoIdxINEL = 0;
int recoIdxINELgt0 = 0;
// for (const auto& collision : collisions) {
bool atLeastOneINEL = false;
bool atLeastOneINELgt0 = false;

for (const auto& collision : collisions) {
bool isSel8Event = collision.sel8();
bool hasTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX);
bool hasNoTFB = collision.selection_bit(aod::evsel::kNoTimeFrameBorder);
bool hasNoItsRofFB = collision.selection_bit(aod::evsel::kNoITSROFrameBorder);

// Check event selection
histoGen.fill(HIST("events/hMCReco"), 0.5);
if (enableCentrality)
histoGen.fill(HIST("events/hMCRecoVsMult"), 0.5, mcCollision.centFT0M());

// Event selection cuts
if (evselOptions.useSel8 && !isSel8Event)
continue;
if (evselOptions.useTVXtrigger && !hasTVX)
continue;
if (evselOptions.removeTFBorder && !hasNoTFB)
continue;
if (evselOptions.removeITSROFBorder && !hasNoItsRofFB)
continue;

// Vtz cut
if (collision.posZ() < cfgVzCutLow || collision.posZ() > cfgVzCutHigh)
continue;

// EVENT SPLITTING DENOMINATOR
histoGen.fill(HIST("events/hMCReco"), 1.5);
if (enableCentrality)
histoGen.fill(HIST("events/hMCRecoVsMult"), 1.5, mcCollision.centFT0M());

recoIdxINEL++;
atLeastOneINEL = true;

if (collision.isInelGt0() && isINELgt0true) {
// EVENT SPLITTING DENOMINATOR
histoGen.fill(HIST("events/hMCReco"), 2.5);
if (enableCentrality)
histoGen.fill(HIST("events/hMCRecoVsMult"), 2.5, mcCollision.centFT0M());

recoIdxINELgt0++;
atLeastOneINELgt0 = true;
}

for (const auto& mcParticle : mcParticles) {
Expand All @@ -6886,7 +6913,8 @@ struct lfNucleiBATask {
if (enableCentrality)
histoGen.fill(HIST("helium/MCReco/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M());
}
if (recoIdxINELgt0 > 0) {

if (atLeastOneINELgt0) {
if (pdg > 0) {
histoGen.fill(HIST("helium/MCReco/ptGen_INELgt0_Prim_He"), pt);
if (enableCentrality)
Expand All @@ -6901,16 +6929,22 @@ struct lfNucleiBATask {
}
}

if (recoIdxINEL < 1) {
return;
histoGen.fill(HIST("events/hNRecoCollPerMCColl_INEL"), recoIdxINEL);
histoGen.fill(HIST("events/hNRecoCollPerMCColl_INELgt0"), recoIdxINELgt0);
if (enableCentrality) {
histoGen.fill(HIST("events/hNRecoCollPerMCCollVsMult_INEL"), recoIdxINEL, mcCollision.centFT0M());
histoGen.fill(HIST("events/hNRecoCollPerMCCollVsMult_INELgt0"), recoIdxINELgt0, mcCollision.centFT0M());
}

// EVENT LOSS NUMERATOR
if (!atLeastOneINEL)
return;

// EVENT LOSS NUMERATOR & EVENT SPLITTING NUMERATOR
histoGen.fill(HIST("events/hMCGenReco"), 0.5);
if (enableCentrality)
histoGen.fill(HIST("events/hMCGenRecoVsMult"), 0.5, mcCollision.centFT0M());

if (recoIdxINELgt0 > 0) {
if (atLeastOneINELgt0) {
histoGen.fill(HIST("events/hMCGenReco"), 1.5);
if (enableCentrality)
histoGen.fill(HIST("events/hMCGenRecoVsMult"), 1.5, mcCollision.centFT0M());
Expand All @@ -6937,7 +6971,8 @@ struct lfNucleiBATask {
if (enableCentrality)
histoGen.fill(HIST("helium/MCGenReco/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M());
}
if (recoIdxINELgt0 > 0) {

if (atLeastOneINELgt0) {
if (pdg > 0) {
histoGen.fill(HIST("helium/MCGenReco/ptGen_INELgt0_Prim_He"), pt);
if (enableCentrality)
Expand Down
Loading