Skip to content

Commit 5375fa2

Browse files
committed
Fix: rework interface for mc processing and add mc only processing
WIP
1 parent 1a073d1 commit 5375fa2

33 files changed

Lines changed: 931 additions & 277 deletions

PWGCF/Femto/Core/cascadeHistManager.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -618,16 +618,16 @@ class CascadeHistManager
618618
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kPdg, HistTable)), mcParticle.pdgCode());
619619

620620
// get mother
621-
if (cascadeCandidate.has_fMcMother()) {
622-
auto mother = cascadeCandidate.template fMcMother_as<T3>();
621+
if (mcParticle.has_fMcMother()) {
622+
auto mother = mcParticle.template fMcMother_as<T3>();
623623
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kPdgMother, HistTable)), mother.pdgCode());
624624
} else {
625625
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kPdgMother, HistTable)), 0);
626626
}
627627

628628
// get partonic mother
629-
if (cascadeCandidate.has_fMcPartMoth()) {
630-
auto partonicMother = cascadeCandidate.template fMcPartMoth_as<T4>();
629+
if (mcParticle.has_fMcPartMoth()) {
630+
auto partonicMother = mcParticle.template fMcPartMoth_as<T4>();
631631
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kPdgPartonicMother, HistTable)), partonicMother.pdgCode());
632632
} else {
633633
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kPdgPartonicMother, HistTable)), 0);
@@ -652,8 +652,8 @@ class CascadeHistManager
652652
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kFromMaterial, HistTable)), cascadeCandidate.pt(), cascadeCandidate.cascadeCosPa());
653653
break;
654654
case modes::McOrigin::kFromSecondaryDecay:
655-
if (cascadeCandidate.has_fMcMother()) {
656-
auto mother = cascadeCandidate.template fMcMother_as<T3>();
655+
if (mcParticle.has_fMcMother()) {
656+
auto mother = mcParticle.template fMcMother_as<T3>();
657657
int motherPdgCode = std::abs(mother.pdgCode());
658658
// Switch on PDG of the mother
659659
if (mPlotNSecondaries >= histmanager::kSecondaryPlotLevel1 && motherPdgCode == mPdgCodesSecondaryMother[0]) {

PWGCF/Femto/Core/collisionBuilder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ struct ConfCollisionFilters : o2::framework::ConfigurableGroup {
6262
o2::framework::Configurable<int> subGeneratorId{"subGeneratorId", 0, "MC ONLY: If positive, keep 0 = MB, <0 triggered on something"};
6363
};
6464

65+
6566
struct ConfCollisionBits : o2::framework::ConfigurableGroup {
6667
std::string prefix = std::string("CollisionBits");
6768
o2::framework::Configurable<bool> passThrough{"passThrough", false, "If true, all tracks are passed through. Bits for all selections are stored."};

PWGCF/Femto/Core/collisionHistManager.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ enum ColHist {
5252
kCentVsSphericity,
5353
kMultVsSphericity,
5454
// mc
55+
kTruePosZVsPosZ,
5556
kTrueCentVsCent,
5657
kTrueMultVsMult,
5758
kColHistLast
@@ -80,6 +81,7 @@ constexpr std::array<histmanager::HistInfo<ColHist>, kColHistLast> HistTable = {
8081
{kMultVsSphericity, o2::framework::HistType::kTH2F, "hMultVsSphericity", "Multiplicity vs Sphericity; Multiplicity; Sphericity"},
8182
{kCentVsSphericity, o2::framework::HistType::kTH2F, "hCentVsSphericity", "Centrality vs Sphericity; Centrality (%); Sphericity"},
8283
// mc
84+
{kTruePosZVsPosZ, o2::framework::HistType::kTH2F, "hTruePosZVsPosZ", "True Vertex Z vs Vertex Z; V_{Z,True} (cm); V_{Z} (cm)"},
8385
{kTrueCentVsCent, o2::framework::HistType::kTH2F, "hTrueCentVsCent", "True centrality vs centrality; Centrality_{True} (%); Centrality (%)"},
8486
{kTrueMultVsMult, o2::framework::HistType::kTH2F, "hTrueMultVsMult", "True multiplicity vs multiplicity; Multiplicity_{True}; Multiplicity"},
8587
}};
@@ -102,9 +104,10 @@ constexpr std::array<histmanager::HistInfo<ColHist>, kColHistLast> HistTable = {
102104
{kMultVsSphericity, {confAnalysis.mult, confQa.sphericity}}, \
103105
{kCentVsSphericity, {confBinningAnalysis.cent, confQa.sphericity}},
104106

105-
#define COL_HIST_MC_MAP(conf) \
106-
{kTrueMultVsMult, {conf.mult, conf.mult}}, \
107-
{kTrueCentVsCent, {conf.cent, conf.cent}},
107+
#define COL_HIST_MC_MAP(conf) \
108+
{kTruePosZVsPosZ, {conf.vtxZ, conf.vtxZ}}, \
109+
{kTrueCentVsCent, {conf.cent, conf.cent}}, \
110+
{kTrueMultVsMult, {conf.mult, conf.mult}},
108111

109112
template <typename T>
110113
auto makeColHistSpecMap(const T& confBinningAnalysis)
@@ -253,8 +256,9 @@ class CollisionHistManager
253256
void initMc(std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs)
254257
{
255258
std::string mcDir = std::string(McDir);
256-
mHistogramRegistry->add(mcDir + getHistNameV2(kTrueMultVsMult, HistTable), getHistDesc(kTrueMultVsMult, HistTable), getHistType(kTrueMultVsMult, HistTable), {Specs.at(kTrueMultVsMult)});
259+
mHistogramRegistry->add(mcDir + getHistNameV2(kTruePosZVsPosZ, HistTable), getHistDesc(kTruePosZVsPosZ, HistTable), getHistType(kTruePosZVsPosZ, HistTable), {Specs.at(kTruePosZVsPosZ)});
257260
mHistogramRegistry->add(mcDir + getHistNameV2(kTrueCentVsCent, HistTable), getHistDesc(kTrueCentVsCent, HistTable), getHistType(kTrueCentVsCent, HistTable), {Specs.at(kTrueCentVsCent)});
261+
mHistogramRegistry->add(mcDir + getHistNameV2(kTrueMultVsMult, HistTable), getHistDesc(kTrueMultVsMult, HistTable), getHistType(kTrueMultVsMult, HistTable), {Specs.at(kTrueMultVsMult)});
258262
}
259263

260264
template <typename T>
@@ -290,8 +294,9 @@ class CollisionHistManager
290294
return;
291295
}
292296
auto mcCol = col.template fMcCol_as<T2>();
293-
mHistogramRegistry->fill(HIST(McDir) + HIST(getHistName(kTrueMultVsMult, HistTable)), mcCol.mult(), col.mult());
297+
mHistogramRegistry->fill(HIST(McDir) + HIST(getHistName(kTruePosZVsPosZ, HistTable)), mcCol.posZ(), col.posZ());
294298
mHistogramRegistry->fill(HIST(McDir) + HIST(getHistName(kTrueCentVsCent, HistTable)), mcCol.cent(), col.cent());
299+
mHistogramRegistry->fill(HIST(McDir) + HIST(getHistName(kTrueMultVsMult, HistTable)), mcCol.mult(), col.mult());
295300
}
296301

297302
o2::framework::HistogramRegistry* mHistogramRegistry = nullptr;

PWGCF/Femto/Core/kinkHistManager.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -559,16 +559,16 @@ class KinkHistManager
559559
mHistogramRegistry->fill(HIST(kinkPrefix) + HIST(McDir) + HIST(getHistName(kPdg, HistTable)), mcParticle.pdgCode());
560560

561561
// get mother
562-
if (kinkCandidate.has_fMcMother()) {
563-
auto mother = kinkCandidate.template fMcMother_as<T3>();
562+
if (mcParticle.has_fMcMother()) {
563+
auto mother = mcParticle.template fMcMother_as<T3>();
564564
mHistogramRegistry->fill(HIST(kinkPrefix) + HIST(McDir) + HIST(getHistName(kPdgMother, HistTable)), mother.pdgCode());
565565
} else {
566566
mHistogramRegistry->fill(HIST(kinkPrefix) + HIST(McDir) + HIST(getHistName(kPdgMother, HistTable)), 0);
567567
}
568568

569569
// get partonic mother
570-
if (kinkCandidate.has_fMcPartMoth()) {
571-
auto partonicMother = kinkCandidate.template fMcPartMoth_as<T4>();
570+
if (mcParticle.has_fMcPartMoth()) {
571+
auto partonicMother = mcParticle.template fMcPartMoth_as<T4>();
572572
mHistogramRegistry->fill(HIST(kinkPrefix) + HIST(McDir) + HIST(getHistName(kPdgPartonicMother, HistTable)), partonicMother.pdgCode());
573573
} else {
574574
mHistogramRegistry->fill(HIST(kinkPrefix) + HIST(McDir) + HIST(getHistName(kPdgPartonicMother, HistTable)), 0);
@@ -593,8 +593,8 @@ class KinkHistManager
593593
mHistogramRegistry->fill(HIST(kinkPrefix) + HIST(McDir) + HIST(getHistName(kFromMaterial, HistTable)), kinkCandidate.pt(), kinkCandidate.kinkAngle());
594594
break;
595595
case modes::McOrigin::kFromSecondaryDecay:
596-
if (kinkCandidate.has_fMcMother()) {
597-
auto mother = kinkCandidate.template fMcMother_as<T3>();
596+
if (mcParticle.has_fMcMother()) {
597+
auto mother = mcParticle.template fMcMother_as<T3>();
598598
int motherPdgCode = std::abs(mother.pdgCode());
599599
// Switch on PDG of the mother
600600
if (mPlotNSecondaries >= histmanager::kSecondaryPlotLevel1 && motherPdgCode == mPdgCodesSecondaryMother[0]) {

0 commit comments

Comments
 (0)