@@ -132,7 +132,7 @@ struct derivedlambdakzeroanalysis {
132132 Configurable<bool > doMCAssociation{" doMCAssociation" , true , " if MC, do MC association" };
133133 Configurable<bool > doTreatPiToMuon{" doTreatPiToMuon" , false , " Take pi decay into muon into account in MC" };
134134 Configurable<bool > doCollisionAssociationQA{" doCollisionAssociationQA" , true , " check collision association" };
135- Configurable<bool > doSecondaryV0s{" doSecondaryV0s" , false , " Look at secondary V0s?" };
135+ 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 " };
136136
137137 struct : ConfigurableGroup {
138138 std::string prefix = " eventSelections" ; // JSON group name
@@ -1254,24 +1254,33 @@ struct derivedlambdakzeroanalysis {
12541254 }
12551255
12561256 if (doSecondaryV0s) {
1257+ histos.add (" h2dGenSecK0Short" , " h2dGenSecK0Short" , kTH2D , {axisConfigurations.axisCentrality , axisConfigurations.axisPt });
12571258 histos.add (" h2dGenSecLambda" , " h2dGenSecLambda" , kTH2D , {axisConfigurations.axisCentrality , axisConfigurations.axisPt });
12581259 histos.add (" h2dGenSecAntiLambda" , " h2dGenSecAntiLambda" , kTH2D , {axisConfigurations.axisCentrality , axisConfigurations.axisPt });
12591260 histos.add (" h2dGenSecLambdaFromXi" , " h2dGenSecLambdaFromXi" , kTH2D , {axisConfigurations.axisCentrality , axisConfigurations.axisPt });
12601261 histos.add (" h2dGenSecAntiLambdaFromXi" , " h2dGenSecAntiLambdaFromXi" , kTH2D , {axisConfigurations.axisCentrality , axisConfigurations.axisPt });
1262+ histos.add (" h2dGenSecLambdaFromXiAndXi0" , " h2dGenSecLambdaFromXiAndXi0" , kTH2D , {axisConfigurations.axisCentrality , axisConfigurations.axisPt });
1263+ histos.add (" h2dGenSecAntiLambdaFromXiAndXi0" , " h2dGenSecAntiLambdaFromXiAndXi0" , kTH2D , {axisConfigurations.axisCentrality , axisConfigurations.axisPt });
12611264 histos.add (" h2dGenSecLambdaFromOmega" , " h2dGenSecLambdaFromOmega" , kTH2D , {axisConfigurations.axisCentrality , axisConfigurations.axisPt });
12621265 histos.add (" h2dGenSecAntiLambdaFromOmega" , " h2dGenSecAntiLambdaFromOmega" , kTH2D , {axisConfigurations.axisCentrality , axisConfigurations.axisPt });
12631266
1267+ histos.add (" h2dGenSecK0ShortVsMultMC_RecoedEvt" , " h2dGenSecK0ShortVsMultMC_RecoedEvt" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12641268 histos.add (" h2dGenSecLambdaVsMultMC_RecoedEvt" , " h2dGenSecLambdaVsMultMC_RecoedEvt" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12651269 histos.add (" h2dGenSecAntiLambdaVsMultMC_RecoedEvt" , " h2dGenSecAntiLambdaVsMultMC_RecoedEvt" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12661270 histos.add (" h2dGenSecLambdaFromXiVsMultMC_RecoedEvt" , " h2dGenSecLambdaFromXiVsMultMC_RecoedEvt" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12671271 histos.add (" h2dGenSecAntiLambdaFromXiVsMultMC_RecoedEvt" , " h2dGenSecAntiLambdaFromXiVsMultMC_RecoedEvt" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
1272+ histos.add (" h2dGenSecLambdaFromXiAndXi0VsMultMC_RecoedEvt" , " h2dGenSecLambdaFromXiAndXi0VsMultMC_RecoedEvt" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
1273+ histos.add (" h2dGenSecAntiLambdaFromXiAndXi0VsMultMC_RecoedEvt" , " h2dGenSecAntiLambdaFromXiAndXi0VsMultMC_RecoedEvt" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12681274 histos.add (" h2dGenSecLambdaFromOmegaVsMultMC_RecoedEvt" , " h2dGenSecLambdaFromOmegaVsMultMC_RecoedEvt" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12691275 histos.add (" h2dGenSecAntiLambdaFromOmegaVsMultMC_RecoedEvt" , " h2dGenSecAntiLambdaFromOmegaVsMultMC_RecoedEvt" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12701276
1277+ histos.add (" h2dGenSecK0ShortVsMultMC" , " h2dGenSecK0ShortVsMultMC" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12711278 histos.add (" h2dGenSecLambdaVsMultMC" , " h2dGenSecLambdaVsMultMC" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12721279 histos.add (" h2dGenSecAntiLambdaVsMultMC" , " h2dGenSecAntiLambdaVsMultMC" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12731280 histos.add (" h2dGenSecLambdaFromXiVsMultMC" , " h2dGenSecLambdaFromXiVsMultMC" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12741281 histos.add (" h2dGenSecAntiLambdaFromXiVsMultMC" , " h2dGenSecAntiLambdaFromXiVsMultMC" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
1282+ histos.add (" h2dGenSecLambdaFromXiAndXi0VsMultMC" , " h2dGenSecLambdaFromXiAndXi0VsMultMC" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
1283+ histos.add (" h2dGenSecAntiLambdaFromXiAndXi0VsMultMC" , " h2dGenSecAntiLambdaFromXiAndXi0VsMultMC" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12751284 histos.add (" h2dGenSecLambdaFromOmegaVsMultMC" , " h2dGenSecLambdaFromOmegaVsMultMC" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12761285 histos.add (" h2dGenSecAntiLambdaFromOmegaVsMultMC" , " h2dGenSecAntiLambdaFromOmegaVsMultMC" , kTH2D , {axisConfigurations.axisNch , axisConfigurations.axisPt });
12771286 }
@@ -3156,6 +3165,114 @@ struct derivedlambdakzeroanalysis {
31563165 }
31573166 }
31583167
3168+ if (doSecondaryV0s == 1 ) {
3169+ for (auto const & v0MC : V0MCCores) {
3170+ if (!v0MC.has_straMCCollision ())
3171+ continue ;
3172+
3173+ if (v0MC.isPhysicalPrimary ()) // select only secondary Lambda
3174+ continue ;
3175+
3176+ float ptmc = v0MC.ptMC ();
3177+ float ymc = 1e3 ;
3178+ if (v0MC.pdgCode () == PDG_t::kK0Short )
3179+ ymc = v0MC.rapidityMC (0 );
3180+ else if (std::abs (v0MC.pdgCode ()) == PDG_t::kLambda0 )
3181+ ymc = v0MC.rapidityMC (1 );
3182+
3183+ if (ymc < v0Selections.rapidityMinCut ||
3184+ ymc > v0Selections.rapidityMaxCut )
3185+ continue ;
3186+
3187+ auto mcCollision = v0MC.template straMCCollision_as <TMCCollisions>();
3188+ if (eventSelections.applyZVtxSelOnMCPV && std::abs (mcCollision.posZ ()) > eventSelections.maxZVtxPosition ) {
3189+ continue ;
3190+ }
3191+ if (eventSelections.requireINEL0 && mcCollision.multMCNParticlesEta10 () < 1 ) {
3192+ continue ;
3193+ }
3194+
3195+ if (eventSelections.requireINEL1 && mcCollision.multMCNParticlesEta10 () < 2 ) {
3196+ continue ;
3197+ }
3198+
3199+ float centrality = 100 .5f ;
3200+ if (listBestCollisionIdx[mcCollision.globalIndex ()] > -1 ) {
3201+ auto collision = collisions.iteratorAt (listBestCollisionIdx[mcCollision.globalIndex ()]);
3202+ if constexpr (requires { collision.centFT0C (); }) { // check if we are in Run 3
3203+ centrality = getCentralityRun3 (collision, useMcCentrality);
3204+ } else { // no, we are in Run 2
3205+ centrality = eventSelections.useSPDTrackletsCent ? collision.centRun2SPDTracklets () : collision.centRun2V0M ();
3206+ }
3207+
3208+ if (v0MC.pdgCode () == PDG_t::kK0Short ) {
3209+ histos.fill (HIST (" h2dGenSecK0ShortVsMultMC_RecoedEvt" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3210+ }
3211+ if (v0MC.pdgCode () == PDG_t::kLambda0 ) {
3212+ histos.fill (HIST (" h2dGenSecLambdaVsMultMC_RecoedEvt" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3213+ if (v0MC.pdgCodeMother () == PDG_t::kXiMinus ) {
3214+ histos.fill (HIST (" h2dGenSecLambdaFromXiVsMultMC_RecoedEvt" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3215+ }
3216+ if (v0MC.pdgCodeMother () == PDG_t::kXiMinus || v0MC.pdgCodeMother () == o2::constants::physics::Pdg::kXi0 ) {
3217+ histos.fill (HIST (" h2dGenSecLambdaFromXiAndXi0VsMultMC_RecoedEvt" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3218+ }
3219+ if (v0MC.pdgCodeMother () == PDG_t::kOmegaMinus ) {
3220+ histos.fill (HIST (" h2dGenSecLambdaFromOmegaVsMultMC_RecoedEvt" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3221+ }
3222+ }
3223+ if (v0MC.pdgCode () == PDG_t::kLambda0Bar ) {
3224+ histos.fill (HIST (" h2dGenSecAntiLambdaVsMultMC_RecoedEvt" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3225+ if (v0MC.pdgCodeMother () == PDG_t::kXiPlusBar ) {
3226+ histos.fill (HIST (" h2dGenSecAntiLambdaFromXiVsMultMC_RecoedEvt" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3227+ }
3228+ if (v0MC.pdgCodeMother () == PDG_t::kXiPlusBar || v0MC.pdgCodeMother () == -o2::constants::physics::Pdg::kXi0 ) {
3229+ histos.fill (HIST (" h2dGenSecAntiLambdaFromXiAndXi0VsMultMC_RecoedEvt" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3230+ }
3231+ if (v0MC.pdgCodeMother () == PDG_t::kOmegaPlusBar ) {
3232+ histos.fill (HIST (" h2dGenSecAntiLambdaFromOmegaVsMultMC_RecoedEvt" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3233+ }
3234+ }
3235+ }
3236+
3237+ if (v0MC.pdgCode () == PDG_t::kK0Short ) {
3238+ histos.fill (HIST (" h2dGenSecK0Short" ), centrality, ptmc);
3239+ histos.fill (HIST (" h2dGenSecK0ShortVsMultMC" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3240+ }
3241+ if (v0MC.pdgCode () == PDG_t::kLambda0 ) {
3242+ histos.fill (HIST (" h2dGenSecLambda" ), centrality, ptmc);
3243+ histos.fill (HIST (" h2dGenSecLambdaVsMultMC" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3244+ if (v0MC.pdgCodeMother () == PDG_t::kXiMinus ) {
3245+ histos.fill (HIST (" h2dGenSecLambdaFromXi" ), centrality, ptmc);
3246+ histos.fill (HIST (" h2dGenSecLambdaFromXiVsMultMC" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3247+ }
3248+ if (v0MC.pdgCodeMother () == PDG_t::kXiMinus || v0MC.pdgCodeMother () == o2::constants::physics::Pdg::kXi0 ) {
3249+ histos.fill (HIST (" h2dGenSecLambdaFromXiAndXi0" ), centrality, ptmc);
3250+ histos.fill (HIST (" h2dGenSecLambdaFromXiAndXi0VsMultMC" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3251+ }
3252+ if (v0MC.pdgCodeMother () == PDG_t::kOmegaMinus ) {
3253+ histos.fill (HIST (" h2dGenSecLambdaFromOmega" ), centrality, ptmc);
3254+ histos.fill (HIST (" h2dGenSecLambdaFromOmegaVsMultMC" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3255+ }
3256+ }
3257+ if (v0MC.pdgCode () == PDG_t::kLambda0Bar ) {
3258+ histos.fill (HIST (" h2dGenSecAntiLambda" ), centrality, ptmc);
3259+ histos.fill (HIST (" h2dGenSecAntiLambdaVsMultMC" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3260+ if (v0MC.pdgCodeMother () == PDG_t::kXiPlusBar ) {
3261+ histos.fill (HIST (" h2dGenSecAntiLambdaFromXi" ), centrality, ptmc);
3262+ histos.fill (HIST (" h2dGenSecAntiLambdaFromXiVsMultMC" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3263+ }
3264+ if (v0MC.pdgCodeMother () == PDG_t::kXiPlusBar || v0MC.pdgCodeMother () == -o2::constants::physics::Pdg::kXi0 ) {
3265+ histos.fill (HIST (" h2dGenSecAntiLambdaFromXiAndXi0" ), centrality, ptmc);
3266+ histos.fill (HIST (" h2dGenSecAntiLambdaFromXiAndXi0VsMultMC" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3267+ }
3268+ if (v0MC.pdgCodeMother () == PDG_t::kOmegaPlusBar ) {
3269+ histos.fill (HIST (" h2dGenSecAntiLambdaFromOmega" ), centrality, ptmc);
3270+ histos.fill (HIST (" h2dGenSecAntiLambdaFromOmegaVsMultMC" ), mcCollision.multMCNParticlesEta05 (), ptmc);
3271+ }
3272+ }
3273+ }
3274+ }
3275+
31593276 for (auto const & cascMC : CascMCCores) {
31603277 if (!cascMC.has_straMCCollision ())
31613278 continue ;
@@ -3240,7 +3357,7 @@ struct derivedlambdakzeroanalysis {
32403357 }
32413358 }
32423359
3243- if (doSecondaryV0s && std::abs (cascMC.pdgCodeV0 ()) == kLambda0 ) {
3360+ if (doSecondaryV0s == 2 && std::abs (cascMC.pdgCodeV0 ()) == kLambda0 ) {
32443361 float v0PtMc = std::hypot (cascMC.pxPosMC () + cascMC.pxNegMC (), cascMC.pyPosMC () + cascMC.pyNegMC ());
32453362 float v0RapMc = RecoDecay::y (std::array{cascMC.pxPosMC () + cascMC.pxNegMC (), cascMC.pyPosMC () + cascMC.pyNegMC (), cascMC.pzPosMC () + cascMC.pzNegMC ()}, o2::constants::physics::MassLambda);
32463363 if (v0Selections.rapidityMinCut < v0RapMc && v0RapMc < v0Selections.rapidityMaxCut ) {
@@ -3315,7 +3432,7 @@ struct derivedlambdakzeroanalysis {
33153432 }
33163433 }
33173434
3318- if (doSecondaryV0s && std::abs (cascMC.pdgCodeV0 ()) == kLambda0 ) {
3435+ if (doSecondaryV0s == 2 && std::abs (cascMC.pdgCodeV0 ()) == kLambda0 ) {
33193436 float v0PtMc = std::hypot (cascMC.pxPosMC () + cascMC.pxNegMC (), cascMC.pyPosMC () + cascMC.pyNegMC ());
33203437 float v0RapMc = RecoDecay::y (std::array{cascMC.pxPosMC () + cascMC.pxNegMC (), cascMC.pyPosMC () + cascMC.pyNegMC (), cascMC.pzPosMC () + cascMC.pzNegMC ()}, o2::constants::physics::MassLambda);
33213438 if (v0Selections.rapidityMinCut < v0RapMc && v0RapMc < v0Selections.rapidityMaxCut ) {
0 commit comments