Skip to content

Commit 538af1f

Browse files
[PWGLF] NucleiTask - Add counter (AliceO2Group#16598)
1 parent 3ba728f commit 538af1f

1 file changed

Lines changed: 46 additions & 11 deletions

File tree

PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
///
1717
/// \author Giovanni Malfattore <giovanni.malfattore@cern.ch> and Rutuparna Rath <rutuparna.rath@cern.ch>
1818

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

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

431+
histoGen.add("events/hNRecoCollPerMCColl_INEL", "Reco collisions per MC collision;N_{reco coll};Counts", HistType::kTH1D, {{6, -0.5, 5.5}});
432+
histoGen.add("events/hNRecoCollPerMCColl_INELgt0", "Reco INEL>0 collisions per MC collision;N_{reco coll};Counts", HistType::kTH1D, {{6, -0.5, 5.5}});
433+
431434
histoGen.add<TH2>("helium/MCGen/h2HeliumYvsPt", "#it{y} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptHeAxis}});
432435
histoGen.add<TH2>("helium/MCGen/h2antiHeliumYvsPt", "#it{y} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptHeAxis}});
433436

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

473+
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}});
474+
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}});
475+
470476
histoGen.add("helium/MCGen/ptGenVsMult_INEL_Prim_He", "generated particles", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}});
471477
histoGen.add("helium/MCGen/ptGenVsMult_INEL_Prim_antiHe", "generated particles", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}});
472478
histoGen.add("helium/MCGen/ptGenVsMult_INELgt0_Prim_He", "generated particles", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}});
@@ -2324,6 +2330,8 @@ struct lfNucleiBATask {
23242330
LOG(info) << "Histograms of lfNucleiBATask:";
23252331
histos.print();
23262332
spectraGen.print();
2333+
if (doprocessMCGenLosses)
2334+
histoGen.print();
23272335
}
23282336

23292337
template <bool IsMC, bool IsFilteredData, typename CollisionType, typename TracksType, typename ParticleType>
@@ -2596,6 +2604,7 @@ struct lfNucleiBATask {
25962604
}
25972605
if (enablePtShiftPID && fShiftPtPID) {
25982606
shiftPtPID = fShiftPtPID->Eval(2 * track.pt());
2607+
25992608
if (tritonPID && (track.pt() <= cfgPtShiftPID)) {
26002609
hePt = track.pt() - shiftPtPID / 2.f;
26012610
antihePt = track.pt() - shiftPtPID / 2.f;
@@ -6719,9 +6728,9 @@ struct lfNucleiBATask {
67196728

67206729
if (isTvxEvent)
67216730
evLossHistos.fill(HIST("evLoss/hEvent"), 1.5);
6722-
if (isSel8Event)
6723-
evLossHistos.fill(HIST("evLoss/hEvent"), 2.5);
67246731
if (isMCSel8Event)
6732+
evLossHistos.fill(HIST("evLoss/hEvent"), 2.5);
6733+
if (isSel8Event)
67256734
evLossHistos.fill(HIST("evLoss/hEvent"), 3.5);
67266735

67276736
// Loop over all the Generated level particles
@@ -6791,6 +6800,7 @@ struct lfNucleiBATask {
67916800
// Vtz cut
67926801
if (mcCollision.posZ() < cfgVzCutLow || mcCollision.posZ() > cfgVzCutHigh)
67936802
return;
6803+
67946804
histoGen.fill(HIST("events/hMCGen"), 1.5);
67956805
if (enableCentrality)
67966806
histoGen.fill(HIST("events/hMCGenVsMult"), 1.5, mcCollision.centFT0M());
@@ -6823,6 +6833,7 @@ struct lfNucleiBATask {
68236833
if (enableCentrality)
68246834
histoGen.fill(HIST("helium/MCGen/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M());
68256835
}
6836+
68266837
if (isINELgt0true) {
68276838
if (pdg > 0) {
68286839
histoGen.fill(HIST("helium/MCGen/ptGen_INELgt0_Prim_He"), pt);
@@ -6839,33 +6850,49 @@ struct lfNucleiBATask {
68396850

68406851
int recoIdxINEL = 0;
68416852
int recoIdxINELgt0 = 0;
6842-
// for (const auto& collision : collisions) {
6853+
bool atLeastOneINEL = false;
6854+
bool atLeastOneINELgt0 = false;
6855+
68436856
for (const auto& collision : collisions) {
6857+
bool isSel8Event = collision.sel8();
68446858
bool hasTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX);
68456859
bool hasNoTFB = collision.selection_bit(aod::evsel::kNoTimeFrameBorder);
68466860
bool hasNoItsRofFB = collision.selection_bit(aod::evsel::kNoITSROFrameBorder);
68476861

6848-
// Check event selection
68496862
histoGen.fill(HIST("events/hMCReco"), 0.5);
68506863
if (enableCentrality)
68516864
histoGen.fill(HIST("events/hMCRecoVsMult"), 0.5, mcCollision.centFT0M());
6865+
6866+
// Event selection cuts
6867+
if (evselOptions.useSel8 && !isSel8Event)
6868+
continue;
68526869
if (evselOptions.useTVXtrigger && !hasTVX)
68536870
continue;
68546871
if (evselOptions.removeTFBorder && !hasNoTFB)
68556872
continue;
68566873
if (evselOptions.removeITSROFBorder && !hasNoItsRofFB)
68576874
continue;
6875+
6876+
// Vtz cut
6877+
if (collision.posZ() < cfgVzCutLow || collision.posZ() > cfgVzCutHigh)
6878+
continue;
6879+
6880+
// EVENT SPLITTING DENOMINATOR
68586881
histoGen.fill(HIST("events/hMCReco"), 1.5);
68596882
if (enableCentrality)
68606883
histoGen.fill(HIST("events/hMCRecoVsMult"), 1.5, mcCollision.centFT0M());
68616884

68626885
recoIdxINEL++;
6886+
atLeastOneINEL = true;
68636887

68646888
if (collision.isInelGt0() && isINELgt0true) {
6889+
// EVENT SPLITTING DENOMINATOR
68656890
histoGen.fill(HIST("events/hMCReco"), 2.5);
68666891
if (enableCentrality)
68676892
histoGen.fill(HIST("events/hMCRecoVsMult"), 2.5, mcCollision.centFT0M());
6893+
68686894
recoIdxINELgt0++;
6895+
atLeastOneINELgt0 = true;
68696896
}
68706897

68716898
for (const auto& mcParticle : mcParticles) {
@@ -6886,7 +6913,8 @@ struct lfNucleiBATask {
68866913
if (enableCentrality)
68876914
histoGen.fill(HIST("helium/MCReco/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M());
68886915
}
6889-
if (recoIdxINELgt0 > 0) {
6916+
6917+
if (atLeastOneINELgt0) {
68906918
if (pdg > 0) {
68916919
histoGen.fill(HIST("helium/MCReco/ptGen_INELgt0_Prim_He"), pt);
68926920
if (enableCentrality)
@@ -6901,16 +6929,22 @@ struct lfNucleiBATask {
69016929
}
69026930
}
69036931

6904-
if (recoIdxINEL < 1) {
6905-
return;
6932+
histoGen.fill(HIST("events/hNRecoCollPerMCColl_INEL"), recoIdxINEL);
6933+
histoGen.fill(HIST("events/hNRecoCollPerMCColl_INELgt0"), recoIdxINELgt0);
6934+
if (enableCentrality) {
6935+
histoGen.fill(HIST("events/hNRecoCollPerMCCollVsMult_INEL"), recoIdxINEL, mcCollision.centFT0M());
6936+
histoGen.fill(HIST("events/hNRecoCollPerMCCollVsMult_INELgt0"), recoIdxINELgt0, mcCollision.centFT0M());
69066937
}
69076938

6908-
// EVENT LOSS NUMERATOR
6939+
if (!atLeastOneINEL)
6940+
return;
6941+
6942+
// EVENT LOSS NUMERATOR & EVENT SPLITTING NUMERATOR
69096943
histoGen.fill(HIST("events/hMCGenReco"), 0.5);
69106944
if (enableCentrality)
69116945
histoGen.fill(HIST("events/hMCGenRecoVsMult"), 0.5, mcCollision.centFT0M());
69126946

6913-
if (recoIdxINELgt0 > 0) {
6947+
if (atLeastOneINELgt0) {
69146948
histoGen.fill(HIST("events/hMCGenReco"), 1.5);
69156949
if (enableCentrality)
69166950
histoGen.fill(HIST("events/hMCGenRecoVsMult"), 1.5, mcCollision.centFT0M());
@@ -6937,7 +6971,8 @@ struct lfNucleiBATask {
69376971
if (enableCentrality)
69386972
histoGen.fill(HIST("helium/MCGenReco/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M());
69396973
}
6940-
if (recoIdxINELgt0 > 0) {
6974+
6975+
if (atLeastOneINELgt0) {
69416976
if (pdg > 0) {
69426977
histoGen.fill(HIST("helium/MCGenReco/ptGen_INELgt0_Prim_He"), pt);
69436978
if (enableCentrality)

0 commit comments

Comments
 (0)