Skip to content

Commit 97940ad

Browse files
authored
[PWGLF] cascades in pp: generated border cuts and PDG QA (#16311)
1 parent dc0bdb8 commit 97940ad

3 files changed

Lines changed: 47 additions & 12 deletions

File tree

PWGLF/DataModel/cascqaanalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ DECLARE_SOA_COLUMN(BachHasTOF, bachhastof, int);
8787
DECLARE_SOA_COLUMN(PosPt, pospt, float);
8888
DECLARE_SOA_COLUMN(NegPt, negpt, float);
8989
DECLARE_SOA_COLUMN(BachPt, bachpt, float);
90-
DECLARE_SOA_COLUMN(McPdgCode, mcPdgCode, int); //! -1 unknown
90+
DECLARE_SOA_COLUMN(McPdgCode, mcPdgCode, int); //! 0 unknown/no MC association
9191
DECLARE_SOA_COLUMN(IsPrimary, isPrimary, int); //! -1 unknown, 0 not primary, 1 primary
9292
DECLARE_SOA_COLUMN(BachBaryonCosPA, bachBaryonCosPA, float); //! avoid bach-baryon correlated inv mass structure in analysis
9393
DECLARE_SOA_COLUMN(BachBaryonDCAxyToPV, bachBaryonDCAxyToPV, float); //! avoid bach-baryon correlated inv mass structure in analysis

PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ using namespace o2::aod::rctsel;
6868
using TrkPidInfo = soa::Join<aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTOFPi, aod::pidTOFPr, aod::pidTOFKa>;
6969
using DauTracks = soa::Join<aod::TracksIU, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA, TrkPidInfo>;
7070
using LabeledCascades = soa::Join<aod::CascDataExt, aod::McCascLabels>;
71+
using BCsWithBcSels = soa::Join<aod::BCsWithTimestamps, aod::BcSels>;
7172

7273
struct Cascqaanalysis {
7374

@@ -119,6 +120,7 @@ struct Cascqaanalysis {
119120
Configurable<bool> isTriggerTVX{"isTriggerTVX", 1, "TVX trigger"};
120121
Configurable<bool> isNoTimeFrameBorder{"isNoTimeFrameBorder", 1, "TF border cut"};
121122
Configurable<bool> isNoITSROFrameBorder{"isNoITSROFrameBorder", 1, "ITS ROF border cut"};
123+
Configurable<bool> applyBcBorderCutsOnGen{"applyBcBorderCutsOnGen", false, "Apply enabled BC-level TF and ITS ROF border cuts on generated-level MC collisions"};
122124
Configurable<bool> isNoCollInTimeRangeNarrow{"isNoCollInTimeRangeNarrow", 1, "No collisions in +-2us window"};
123125

124126
Configurable<bool> requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"};
@@ -221,7 +223,7 @@ struct Cascqaanalysis {
221223
void init(InitContext const&)
222224
{
223225
TString hCandidateCounterLabels[4] = {"All candidates", "passed topo cuts", "has associated MC particle", "associated with Xi(Omega)"};
224-
TString hNEventsMCLabels[6] = {"All", "z vrtx", "INEL", "INEL>0", "INEL>1", "Associated with rec. collision"};
226+
TString hNEventsMCLabels[7] = {"All", "z vrtx", "BC TF/ITS ROF border", "INEL", "INEL>0", "INEL>1", "Associated with rec. collision"};
225227
TString hNEventsLabels[14] = {"All", "kIsTriggerTVX", "kNoTimeFrameBorder", "kNoITSROFrameBorder", "kIsVertexITSTPC", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "isVertexTOFmatched", "kNoCollInTimeRangeNarrow", "z vrtx", "RCTFlagsChecker", "INEL", "INEL>0", "INEL>1"};
226228

227229
registry.add("hNEvents", "hNEvents", {HistType::kTH1D, {{14, 0.f, 14.f}}});
@@ -239,7 +241,7 @@ struct Cascqaanalysis {
239241
// Rec. lvl
240242
registry.add("fakeEvents", "fakeEvents", {HistType::kTH1F, {{1, -0.5f, 0.5f}}});
241243
// Gen. lvl
242-
registry.add("hNEventsMC", "hNEventsMC", {HistType::kTH1D, {{6, 0.0f, 6.0f}}});
244+
registry.add("hNEventsMC", "hNEventsMC", {HistType::kTH1D, {{7, 0.0f, 7.0f}}});
243245
for (int n = 1; n <= registry.get<TH1>(HIST("hNEventsMC"))->GetNbinsX(); n++) {
244246
registry.get<TH1>(HIST("hNEventsMC"))->GetXaxis()->SetBinLabel(n, hNEventsMCLabels[n - 1]);
245247
}
@@ -481,6 +483,21 @@ struct Cascqaanalysis {
481483
return true;
482484
}
483485

486+
template <typename TBC>
487+
bool acceptGeneratedEventBcBorderCuts(TBC const& bc)
488+
{
489+
if (!applyBcBorderCutsOnGen) {
490+
return true;
491+
}
492+
if (isNoTimeFrameBorder && !bc.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
493+
return false;
494+
}
495+
if (isNoITSROFrameBorder && !bc.selection_bit(aod::evsel::kNoITSROFrameBorder)) {
496+
return false;
497+
}
498+
return true;
499+
}
500+
484501
void processData(soa::Join<aod::Collisions, aod::EvSels,
485502
aod::PVMults, aod::FT0Mults, aod::FV0Mults,
486503
aod::CentFT0Ms, aod::CentFV0As>::iterator const& collision,
@@ -546,7 +563,7 @@ struct Cascqaanalysis {
546563
posdau.tpcNClsFound(), negdau.tpcNClsFound(), bachelor.tpcNClsFound(),
547564
posdau.tpcNClsCrossedRows(), negdau.tpcNClsCrossedRows(), bachelor.tpcNClsCrossedRows(),
548565
posdau.hasTOF(), negdau.hasTOF(), bachelor.hasTOF(),
549-
posdau.pt(), negdau.pt(), bachelor.pt(), -1, -1, casc.bachBaryonCosPA(), casc.bachBaryonDCAxyToPV(), evFlag, 1e3, 1e3);
566+
posdau.pt(), negdau.pt(), bachelor.pt(), 0, -1, casc.bachBaryonCosPA(), casc.bachBaryonDCAxyToPV(), evFlag, 1e3, 1e3);
550567
}
551568
}
552569
}
@@ -627,16 +644,16 @@ struct Cascqaanalysis {
627644
registry.fill(HIST("hCandidateCounter"), 1.5); // passed topo cuts
628645
nCandSel++;
629646
// Check mc association
630-
float lPDG = 1e3;
647+
int mcPdgCode = 0;
631648
float genPt = 1e3;
632649
float genY = 1e3;
633650
float isPrimary = -1;
634651
if (casc.has_mcParticle()) {
635652
registry.fill(HIST("hCandidateCounter"), 2.5); // has associated MC particle
636653
auto cascmc = casc.mcParticle();
654+
mcPdgCode = cascmc.pdgCode();
637655
if (std::abs(cascmc.pdgCode()) == PDG_t::kXiMinus || std::abs(cascmc.pdgCode()) == PDG_t::kOmegaMinus) {
638656
registry.fill(HIST("hCandidateCounter"), 3.5); // associated with Xi or Omega
639-
lPDG = cascmc.pdgCode();
640657
isPrimary = cascmc.isPhysicalPrimary() ? 1 : 0;
641658
genPt = cascmc.pt();
642659
genY = cascmc.y();
@@ -667,7 +684,7 @@ struct Cascqaanalysis {
667684
posdau.tpcNClsFound(), negdau.tpcNClsFound(), bachelor.tpcNClsFound(),
668685
posdau.tpcNClsCrossedRows(), negdau.tpcNClsCrossedRows(), bachelor.tpcNClsCrossedRows(),
669686
posdau.hasTOF(), negdau.hasTOF(), bachelor.hasTOF(),
670-
posdau.pt(), negdau.pt(), bachelor.pt(), lPDG, isPrimary, casc.bachBaryonCosPA(), casc.bachBaryonDCAxyToPV(), evFlag, genPt, genY);
687+
posdau.pt(), negdau.pt(), bachelor.pt(), mcPdgCode, isPrimary, casc.bachBaryonCosPA(), casc.bachBaryonDCAxyToPV(), evFlag, genPt, genY);
671688
}
672689
}
673690
}
@@ -681,6 +698,7 @@ struct Cascqaanalysis {
681698
void processMCgen(soa::Join<aod::McCollisions, aod::McCentFT0Ms>::iterator const& mcCollision, // mcCollision.centFV0A() to be added
682699
aod::McParticles const& mcParticles,
683700
const soa::SmallGroups<o2::soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels, o2::aod::EvSels, aod::PVMults, aod::FT0Mults, aod::CentFT0Ms, aod::CentFV0As>>& collisions,
701+
BCsWithBcSels const&,
684702
DauTracks const&)
685703
{
686704
// All generated collisions
@@ -690,25 +708,29 @@ struct Cascqaanalysis {
690708
if (std::fabs(mcCollision.posZ()) > cutzvertex) {
691709
return;
692710
}
693-
registry.fill(HIST("hZCollisionGen"), mcCollision.posZ());
694711
registry.fill(HIST("hNEventsMC"), 1.5);
712+
if (!acceptGeneratedEventBcBorderCuts(mcCollision.bc_as<BCsWithBcSels>())) {
713+
return;
714+
}
715+
registry.fill(HIST("hZCollisionGen"), mcCollision.posZ());
716+
registry.fill(HIST("hNEventsMC"), 2.5);
695717

696718
// Define the type of generated MC collision
697719
EventTypeBin evType = kINEL;
698720
uint8_t flagsGen = 0;
699721
flagsGen |= o2::aod::myMCcascades::EvFlags::EvINEL;
700-
registry.fill(HIST("hNEventsMC"), 2.5);
722+
registry.fill(HIST("hNEventsMC"), 3.5);
701723
// Generated collision is INEL>0
702724
if (pwglf::isINELgtNmc(mcParticles, 0, pdgDB)) {
703725
flagsGen |= o2::aod::myMCcascades::EvFlags::EvINELgt0;
704726
evType = kINELgt0;
705-
registry.fill(HIST("hNEventsMC"), 3.5);
727+
registry.fill(HIST("hNEventsMC"), 4.5);
706728
}
707729
// Generated collision is INEL>1
708730
if (pwglf::isINELgtNmc(mcParticles, 1, pdgDB)) {
709731
flagsGen |= o2::aod::myMCcascades::EvFlags::EvINELgt1;
710732
evType = kINELgt1;
711-
registry.fill(HIST("hNEventsMC"), 4.5);
733+
registry.fill(HIST("hNEventsMC"), 5.5);
712734
}
713735

714736
registry.fill(HIST("hCentFT0M_genMC"), mcCollision.centFT0M(), evType);
@@ -783,7 +805,7 @@ struct Cascqaanalysis {
783805
uint8_t flagsAssoc = 0;
784806
if (evtReconstructedAndINEL) {
785807
flagsAssoc |= o2::aod::myMCcascades::EvFlags::EvINEL;
786-
registry.fill(HIST("hNEventsMC"), 5.5);
808+
registry.fill(HIST("hNEventsMC"), 6.5);
787809
}
788810
if (evtReconstructedAndINELgt0) {
789811
flagsAssoc |= o2::aod::myMCcascades::EvFlags::EvINELgt0;

PWGLF/Tasks/Strangeness/cascpostprocessing.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ struct LfCascpostprocessing {
106106
AxisSpec ptAxisTopoVar = {50, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"};
107107
AxisSpec ptAxisPID = {50, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"};
108108
ConfigurableAxis etaAxis{"etaAxis", {40, -2.0f, 2.0f}, "#eta"};
109+
AxisSpec pdgCodeAxis = {10001, -5000.5f, 5000.5f, "MC PDG code (0 = no MC assoc.)"};
109110

110111
ConfigurableAxis centFT0MAxis{"centFT0MAxis",
111112
{VARIABLE_WIDTH, 0., 0.01, 0.05, 0.1, 0.5, 1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 101, 105.5},
@@ -238,6 +239,9 @@ struct LfCascpostprocessing {
238239
registry.add("hCascPlusMassvsPtBG", "hCascPlusMassvsPtBG", {HistType::kTH2F, {ptAxis, massAxis}});
239240
registry.add("hCascMinusMassvsPtBG_FT0M", "hCascMinusMassvsPtBG_FT0M", {HistType::kTH3F, {ptAxis, massAxis, centFT0MAxis}});
240241
registry.add("hCascPlusMassvsPtBG_FT0M", "hCascPlusMassvsPtBG_FT0M", {HistType::kTH3F, {ptAxis, massAxis, centFT0MAxis}});
242+
registry.add("hMisidentifiedCascPdgCode", "hMisidentifiedCascPdgCode", {HistType::kTH1F, {pdgCodeAxis}});
243+
registry.add("hMisidentifiedCascMinusPdgCode", "hMisidentifiedCascMinusPdgCode", {HistType::kTH1F, {pdgCodeAxis}});
244+
registry.add("hMisidentifiedCascPlusPdgCode", "hMisidentifiedCascPlusPdgCode", {HistType::kTH1F, {pdgCodeAxis}});
241245
registry.add("hPtXiPlusTrue", "hPtXiPlusTrue", {HistType::kTH3F, {ptAxis, rapidityAxis, centFT0MAxis}});
242246
registry.add("hPtXiMinusTrue", "hPtXiMinusTrue", {HistType::kTH3F, {ptAxis, rapidityAxis, centFT0MAxis}});
243247
registry.add("hPtOmegaPlusTrue", "hPtOmegaPlusTrue", {HistType::kTH3F, {ptAxis, rapidityAxis, centFT0MAxis}});
@@ -514,6 +518,15 @@ struct LfCascpostprocessing {
514518
// registry.fill(HIST("hNegITSHits"), candidate.negitshits());
515519
// registry.fill(HIST("hBachITSHits"), candidate.bachitshits());
516520

521+
if (isMC && !isCorrectlyRec) {
522+
registry.fill(HIST("hMisidentifiedCascPdgCode"), candidate.mcPdgCode());
523+
if (candidate.sign() < 0) {
524+
registry.fill(HIST("hMisidentifiedCascMinusPdgCode"), candidate.mcPdgCode());
525+
} else if (candidate.sign() > 0) {
526+
registry.fill(HIST("hMisidentifiedCascPlusPdgCode"), candidate.mcPdgCode());
527+
}
528+
}
529+
517530
if (candidate.sign() < 0) {
518531
if (isMC) {
519532
if (isCorrectlyRec) {

0 commit comments

Comments
 (0)