Skip to content

Commit 728e9fa

Browse files
Restore doSecondaryV0s code
Updated doSecondaryV0s from bool to int for more options. Added new histograms for secondary V0s based on the updated configuration.
1 parent eb6ac3f commit 728e9fa

1 file changed

Lines changed: 120 additions & 3 deletions

File tree

PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx

Lines changed: 120 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ struct derivedlambdakzeroanalysis {
133133
Configurable<bool> doMCAssociation{"doMCAssociation", true, "if MC, do MC association"};
134134
Configurable<bool> doTreatPiToMuon{"doTreatPiToMuon", false, "Take pi decay into muon into account in MC"};
135135
Configurable<bool> doCollisionAssociationQA{"doCollisionAssociationQA", true, "check collision association"};
136-
Configurable<bool> doSecondaryV0s{"doSecondaryV0s", false, "Look at secondary V0s?"};
136+
Configurable<int> doSecondaryV0s{"doSecondaryV0s", 0, "Look at secondary V0s? 0: No; 1: yes via a loop on V0MCCores; 2: yes via a loop on CascMCCores"};
137137

138138
struct : ConfigurableGroup {
139139
std::string prefix = "eventSelections"; // JSON group name
@@ -1268,24 +1268,33 @@ struct derivedlambdakzeroanalysis {
12681268
}
12691269

12701270
if (doSecondaryV0s) {
1271+
histos.add("h2dGenSecK0Short", "h2dGenSecK0Short", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt});
12711272
histos.add("h2dGenSecLambda", "h2dGenSecLambda", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt});
12721273
histos.add("h2dGenSecAntiLambda", "h2dGenSecAntiLambda", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt});
12731274
histos.add("h2dGenSecLambdaFromXi", "h2dGenSecLambdaFromXi", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt});
12741275
histos.add("h2dGenSecAntiLambdaFromXi", "h2dGenSecAntiLambdaFromXi", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt});
1276+
histos.add("h2dGenSecLambdaFromXiAndXi0", "h2dGenSecLambdaFromXiAndXi0", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt});
1277+
histos.add("h2dGenSecAntiLambdaFromXiAndXi0", "h2dGenSecAntiLambdaFromXiAndXi0", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt});
12751278
histos.add("h2dGenSecLambdaFromOmega", "h2dGenSecLambdaFromOmega", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt});
12761279
histos.add("h2dGenSecAntiLambdaFromOmega", "h2dGenSecAntiLambdaFromOmega", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt});
12771280

1281+
histos.add("h2dGenSecK0ShortVsMultMC_RecoedEvt", "h2dGenSecK0ShortVsMultMC_RecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12781282
histos.add("h2dGenSecLambdaVsMultMC_RecoedEvt", "h2dGenSecLambdaVsMultMC_RecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12791283
histos.add("h2dGenSecAntiLambdaVsMultMC_RecoedEvt", "h2dGenSecAntiLambdaVsMultMC_RecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12801284
histos.add("h2dGenSecLambdaFromXiVsMultMC_RecoedEvt", "h2dGenSecLambdaFromXiVsMultMC_RecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12811285
histos.add("h2dGenSecAntiLambdaFromXiVsMultMC_RecoedEvt", "h2dGenSecAntiLambdaFromXiVsMultMC_RecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
1286+
histos.add("h2dGenSecLambdaFromXiAndXi0VsMultMC_RecoedEvt", "h2dGenSecLambdaFromXiAndXi0VsMultMC_RecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
1287+
histos.add("h2dGenSecAntiLambdaFromXiAndXi0VsMultMC_RecoedEvt", "h2dGenSecAntiLambdaFromXiAndXi0VsMultMC_RecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12821288
histos.add("h2dGenSecLambdaFromOmegaVsMultMC_RecoedEvt", "h2dGenSecLambdaFromOmegaVsMultMC_RecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12831289
histos.add("h2dGenSecAntiLambdaFromOmegaVsMultMC_RecoedEvt", "h2dGenSecAntiLambdaFromOmegaVsMultMC_RecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12841290

1291+
histos.add("h2dGenSecK0ShortVsMultMC", "h2dGenSecK0ShortVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12851292
histos.add("h2dGenSecLambdaVsMultMC", "h2dGenSecLambdaVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12861293
histos.add("h2dGenSecAntiLambdaVsMultMC", "h2dGenSecAntiLambdaVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12871294
histos.add("h2dGenSecLambdaFromXiVsMultMC", "h2dGenSecLambdaFromXiVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12881295
histos.add("h2dGenSecAntiLambdaFromXiVsMultMC", "h2dGenSecAntiLambdaFromXiVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
1296+
histos.add("h2dGenSecLambdaFromXiAndXi0VsMultMC", "h2dGenSecLambdaFromXiAndXi0VsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
1297+
histos.add("h2dGenSecAntiLambdaFromXiAndXi0VsMultMC", "h2dGenSecAntiLambdaFromXiAndXi0VsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12891298
histos.add("h2dGenSecLambdaFromOmegaVsMultMC", "h2dGenSecLambdaFromOmegaVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12901299
histos.add("h2dGenSecAntiLambdaFromOmegaVsMultMC", "h2dGenSecAntiLambdaFromOmegaVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt});
12911300
}
@@ -3197,6 +3206,114 @@ struct derivedlambdakzeroanalysis {
31973206
}
31983207
}
31993208

3209+
if (doSecondaryV0s == 1) {
3210+
for (auto const& v0MC : V0MCCores) {
3211+
if (!v0MC.has_straMCCollision())
3212+
continue;
3213+
3214+
if (v0MC.isPhysicalPrimary()) // select only secondary Lambda
3215+
continue;
3216+
3217+
float ptmc = v0MC.ptMC();
3218+
float ymc = 1e3;
3219+
if (v0MC.pdgCode() == PDG_t::kK0Short)
3220+
ymc = v0MC.rapidityMC(0);
3221+
else if (std::abs(v0MC.pdgCode()) == PDG_t::kLambda0)
3222+
ymc = v0MC.rapidityMC(1);
3223+
3224+
if (ymc < v0Selections.rapidityMinCut ||
3225+
ymc > v0Selections.rapidityMaxCut)
3226+
continue;
3227+
3228+
auto mcCollision = v0MC.template straMCCollision_as<TMCCollisions>();
3229+
if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) {
3230+
continue;
3231+
}
3232+
if (eventSelections.requireINEL0 && mcCollision.multMCNParticlesEta10() < 1) {
3233+
continue;
3234+
}
3235+
3236+
if (eventSelections.requireINEL1 && mcCollision.multMCNParticlesEta10() < 2) {
3237+
continue;
3238+
}
3239+
3240+
float centrality = 100.5f;
3241+
if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) {
3242+
auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]);
3243+
if constexpr (requires { collision.centFT0C(); }) { // check if we are in Run 3
3244+
centrality = getCentralityRun3(collision, useMcCentrality);
3245+
} else { // no, we are in Run 2
3246+
centrality = eventSelections.useSPDTrackletsCent ? collision.centRun2SPDTracklets() : collision.centRun2V0M();
3247+
}
3248+
3249+
if (v0MC.pdgCode() == PDG_t::kK0Short) {
3250+
histos.fill(HIST("h2dGenSecK0ShortVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
3251+
}
3252+
if (v0MC.pdgCode() == PDG_t::kLambda0) {
3253+
histos.fill(HIST("h2dGenSecLambdaVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
3254+
if (v0MC.pdgCodeMother() == PDG_t::kXiMinus) {
3255+
histos.fill(HIST("h2dGenSecLambdaFromXiVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
3256+
}
3257+
if (v0MC.pdgCodeMother() == PDG_t::kXiMinus || v0MC.pdgCodeMother() == o2::constants::physics::Pdg::kXi0) {
3258+
histos.fill(HIST("h2dGenSecLambdaFromXiAndXi0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
3259+
}
3260+
if (v0MC.pdgCodeMother() == PDG_t::kOmegaMinus) {
3261+
histos.fill(HIST("h2dGenSecLambdaFromOmegaVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
3262+
}
3263+
}
3264+
if (v0MC.pdgCode() == PDG_t::kLambda0Bar) {
3265+
histos.fill(HIST("h2dGenSecAntiLambdaVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
3266+
if (v0MC.pdgCodeMother() == PDG_t::kXiPlusBar) {
3267+
histos.fill(HIST("h2dGenSecAntiLambdaFromXiVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
3268+
}
3269+
if (v0MC.pdgCodeMother() == PDG_t::kXiPlusBar || v0MC.pdgCodeMother() == -o2::constants::physics::Pdg::kXi0) {
3270+
histos.fill(HIST("h2dGenSecAntiLambdaFromXiAndXi0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
3271+
}
3272+
if (v0MC.pdgCodeMother() == PDG_t::kOmegaPlusBar) {
3273+
histos.fill(HIST("h2dGenSecAntiLambdaFromOmegaVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
3274+
}
3275+
}
3276+
}
3277+
3278+
if (v0MC.pdgCode() == PDG_t::kK0Short) {
3279+
histos.fill(HIST("h2dGenSecK0Short"), centrality, ptmc);
3280+
histos.fill(HIST("h2dGenSecK0ShortVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
3281+
}
3282+
if (v0MC.pdgCode() == PDG_t::kLambda0) {
3283+
histos.fill(HIST("h2dGenSecLambda"), centrality, ptmc);
3284+
histos.fill(HIST("h2dGenSecLambdaVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
3285+
if (v0MC.pdgCodeMother() == PDG_t::kXiMinus) {
3286+
histos.fill(HIST("h2dGenSecLambdaFromXi"), centrality, ptmc);
3287+
histos.fill(HIST("h2dGenSecLambdaFromXiVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
3288+
}
3289+
if (v0MC.pdgCodeMother() == PDG_t::kXiMinus || v0MC.pdgCodeMother() == o2::constants::physics::Pdg::kXi0) {
3290+
histos.fill(HIST("h2dGenSecLambdaFromXiAndXi0"), centrality, ptmc);
3291+
histos.fill(HIST("h2dGenSecLambdaFromXiAndXi0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
3292+
}
3293+
if (v0MC.pdgCodeMother() == PDG_t::kOmegaMinus) {
3294+
histos.fill(HIST("h2dGenSecLambdaFromOmega"), centrality, ptmc);
3295+
histos.fill(HIST("h2dGenSecLambdaFromOmegaVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
3296+
}
3297+
}
3298+
if (v0MC.pdgCode() == PDG_t::kLambda0Bar) {
3299+
histos.fill(HIST("h2dGenSecAntiLambda"), centrality, ptmc);
3300+
histos.fill(HIST("h2dGenSecAntiLambdaVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
3301+
if (v0MC.pdgCodeMother() == PDG_t::kXiPlusBar) {
3302+
histos.fill(HIST("h2dGenSecAntiLambdaFromXi"), centrality, ptmc);
3303+
histos.fill(HIST("h2dGenSecAntiLambdaFromXiVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
3304+
}
3305+
if (v0MC.pdgCodeMother() == PDG_t::kXiPlusBar || v0MC.pdgCodeMother() == -o2::constants::physics::Pdg::kXi0) {
3306+
histos.fill(HIST("h2dGenSecAntiLambdaFromXiAndXi0"), centrality, ptmc);
3307+
histos.fill(HIST("h2dGenSecAntiLambdaFromXiAndXi0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
3308+
}
3309+
if (v0MC.pdgCodeMother() == PDG_t::kOmegaPlusBar) {
3310+
histos.fill(HIST("h2dGenSecAntiLambdaFromOmega"), centrality, ptmc);
3311+
histos.fill(HIST("h2dGenSecAntiLambdaFromOmegaVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
3312+
}
3313+
}
3314+
}
3315+
}
3316+
32003317
for (auto const& cascMC : CascMCCores) {
32013318
if (!cascMC.has_straMCCollision())
32023319
continue;
@@ -3281,7 +3398,7 @@ struct derivedlambdakzeroanalysis {
32813398
}
32823399
}
32833400

3284-
if (doSecondaryV0s && std::abs(cascMC.pdgCodeV0()) == kLambda0) {
3401+
if (doSecondaryV0s == 2 && std::abs(cascMC.pdgCodeV0()) == kLambda0) {
32853402
float v0PtMc = std::hypot(cascMC.pxPosMC() + cascMC.pxNegMC(), cascMC.pyPosMC() + cascMC.pyNegMC());
32863403
float v0RapMc = RecoDecay::y(std::array{cascMC.pxPosMC() + cascMC.pxNegMC(), cascMC.pyPosMC() + cascMC.pyNegMC(), cascMC.pzPosMC() + cascMC.pzNegMC()}, o2::constants::physics::MassLambda);
32873404
if (v0Selections.rapidityMinCut < v0RapMc && v0RapMc < v0Selections.rapidityMaxCut) {
@@ -3356,7 +3473,7 @@ struct derivedlambdakzeroanalysis {
33563473
}
33573474
}
33583475

3359-
if (doSecondaryV0s && std::abs(cascMC.pdgCodeV0()) == kLambda0) {
3476+
if (doSecondaryV0s == 2 && std::abs(cascMC.pdgCodeV0()) == kLambda0) {
33603477
float v0PtMc = std::hypot(cascMC.pxPosMC() + cascMC.pxNegMC(), cascMC.pyPosMC() + cascMC.pyNegMC());
33613478
float v0RapMc = RecoDecay::y(std::array{cascMC.pxPosMC() + cascMC.pxNegMC(), cascMC.pyPosMC() + cascMC.pyNegMC(), cascMC.pzPosMC() + cascMC.pzNegMC()}, o2::constants::physics::MassLambda);
33623479
if (v0Selections.rapidityMinCut < v0RapMc && v0RapMc < v0Selections.rapidityMaxCut) {

0 commit comments

Comments
 (0)