@@ -908,172 +908,172 @@ struct CascadeAnalysisLightIonsDerivedData {
908908
909909 void processMonteCarloRec (SimCollisions::iterator const & RecCol, CascadeMCCandidates const & fullCascades, DaughterTracks const &, CascadeMCCores const &)
910910 {
911- // Fill event counter before event selection
912- registryMC.fill (HIST (" number_of_events_mc_rec" ), 0 );
913-
914- // Initialize CCDB objects using the BC info
915- initCCDB (RecCol);
916-
917- // Define the event centrality using different estimators
918- float centralityMcRec = -1 ;
919- float multiplicityMcRec = -1 ;
920-
921- if (centralityEstimator == Option::kFT0C ) {
922- centralityMcRec = RecCol.centFT0C ();
923- multiplicityMcRec = RecCol.multFT0C ();
924- }
925- if (centralityEstimator == Option::kFT0M ) {
926- centralityMcRec = RecCol.centFT0M ();
927- multiplicityMcRec = RecCol.multFT0C () + RecCol.multFT0A ();
928- }
929- if (centralityEstimator == Option::kFV0A ) {
930- centralityMcRec = RecCol.centFV0A ();
931- multiplicityMcRec = RecCol.multFV0A ();
932- }
933- if (centralityEstimator == Option::kNGlobal ) {
934- centralityMcRec = RecCol.centNGlobal ();
935- multiplicityMcRec = RecCol.multNTracksGlobal ();
936- }
937-
938- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 0 , centralityMcRec);
939-
940- // event selections
941- if (applySel8 && !RecCol.sel8 ())
942- return ;
943- registryMC.fill (HIST (" number_of_events_mc_rec" ), 1 );
944- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 1 , centralityMcRec);
945-
946- if (applyVtxZ && std::fabs (RecCol.posZ ()) > zVtx)
947- return ;
948- registryMC.fill (HIST (" number_of_events_mc_rec" ), 2 );
949- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 2 , centralityMcRec);
950-
951- if (rejectITSROFBorder && !RecCol.selection_bit (o2::aod::evsel::kNoITSROFrameBorder )) {
952- return ;
953- }
954- registryMC.fill (HIST (" number_of_events_mc_rec" ), 3 /* Not at ITS ROF border */ );
955- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 3 , centralityMcRec);
956-
957- if (rejectTFBorder && !RecCol.selection_bit (o2::aod::evsel::kNoTimeFrameBorder )) {
958- return ;
959- }
960- registryMC.fill (HIST (" number_of_events_mc_rec" ), 4 /* Not at TF border */ );
961- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 4 , centralityMcRec);
962-
963- if (requireVertexITSTPC && !RecCol.selection_bit (o2::aod::evsel::kIsVertexITSTPC )) {
964- return ;
965- }
966- registryMC.fill (HIST (" number_of_events_mc_rec" ), 5 /* Contains at least one ITS-TPC track */ );
967- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 5 , centralityMcRec);
968-
969- if (requireIsGoodZvtxFT0VsPV && !RecCol.selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV )) {
970- return ;
971- }
972- registryMC.fill (HIST (" number_of_events_mc_rec" ), 6 /* PV position consistency check */ );
973- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 6 , centralityMcRec);
974-
975- if (requireIsVertexTOFmatched && !RecCol.selection_bit (o2::aod::evsel::kIsVertexTOFmatched )) {
976- return ;
977- }
978- registryMC.fill (HIST (" number_of_events_mc_rec" ), 7 /* PV with at least one contributor matched with TOF */ );
979- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 7 , centralityMcRec);
980-
981- if (requireIsVertexTRDmatched && !RecCol.selection_bit (o2::aod::evsel::kIsVertexTRDmatched )) {
982- return ;
983- }
984- registryMC.fill (HIST (" number_of_events_mc_rec" ), 8 /* PV with at least one contributor matched with TRD */ );
985- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 8 , centralityMcRec);
986-
987- if (rejectSameBunchPileup && !RecCol.selection_bit (o2::aod::evsel::kNoSameBunchPileup )) {
988- return ;
989- }
990- registryMC.fill (HIST (" number_of_events_mc_rec" ), 9 /* Not at same bunch pile-up */ );
991- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 9 , centralityMcRec);
992-
993- if (requireInel0 && RecCol.multNTracksPVeta1 () < 1 ) {
994- return ;
995- }
996- registryMC.fill (HIST (" number_of_events_mc_rec" ), 10 /* INEL > 0 */ );
997- registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 10 , centralityMcRec);
998-
999- // Store the Zvtx
1000- registryQC.fill (HIST (" hVertexZRec" ), RecCol.posZ ());
1001-
1002- // Store the event centrality
1003- registryMC.fill (HIST (" hCentEstimator_truerec" ), centralityMcRec);
1004- registryMC.fill (HIST (" hCentralityVsNch_truerec" ), centralityMcRec, RecCol.multNTracksPVeta1 ());
1005- registryMC.fill (HIST (" hCentralityVsMultiplicity_truerec" ), centralityMcRec, multiplicityMcRec);
1006-
1007- for (const auto & casc : fullCascades) {
1008- if (etaMin > casc.bacheloreta () || casc.bacheloreta () > etaMax ||
1009- etaMin > casc.negativeeta () || casc.negativeeta () > etaMax ||
1010- etaMin > casc.positiveeta () || casc.positiveeta () > etaMax)
1011- continue ; // remove acceptance that's badly reproduced by MC / superfluous in future
1012-
1013- if (!casc.has_cascMCCore ())
1014- continue ;
1015-
1016- auto cascMC = casc.template cascMCCore_as <CascadeMCCores>();
1017-
1018- auto bach = casc.bachTrackExtra_as <DaughterTracks>();
1019- auto pos = casc.posTrackExtra_as <DaughterTracks>();
1020- auto neg = casc.negTrackExtra_as <DaughterTracks>();
1021-
1022- int pdgParent = cascMC.pdgCode ();
1023- bool isPhysPrim = cascMC.isPhysicalPrimary ();
1024- if (pdgParent == 0 )
1025- continue ;
1026- if (!isPhysPrim)
1027- continue ;
1028-
1029- float ptmc = RecoDecay::sqrtSumOfSquares (cascMC.pxMC (), cascMC.pyMC ());
1030-
1031- // ------------------------------------- Store selctions distribution for QC
1032- registryQC.fill (HIST (" hv0cosPARec" ), casc.v0cosPA (RecCol.posX (), RecCol.posY (), RecCol.posZ ()));
1033- registryQC.fill (HIST (" hcasccosPARec" ), casc.casccosPA (RecCol.posX (), RecCol.posY (), RecCol.posZ ()));
1034- registryQC.fill (HIST (" hv0radiusRec" ), casc.v0radius ());
1035- registryQC.fill (HIST (" hcascradiusRec" ), casc.cascradius ());
1036- registryQC.fill (HIST (" hdcaV0daughtersRec" ), casc.dcaV0daughters ());
1037- registryQC.fill (HIST (" hdcacascdaughtersRec" ), casc.dcacascdaughters ());
1038- registryQC.fill (HIST (" hdcapostopvRec" ), casc.dcapostopv ());
1039- registryQC.fill (HIST (" hdcanegtopvRec" ), casc.dcanegtopv ());
1040- registryQC.fill (HIST (" hdcabachtopvRec" ), casc.dcabachtopv ());
1041- registryQC.fill (HIST (" hdcav0topvRec" ), casc.dcav0topv (RecCol.posX (), RecCol.posY (), RecCol.posZ ()));
1042-
1043- // ------------------------------------- Store selctions distribution for analysis
1044- if (casc.sign () < 0 ) {
1045- if (pdgParent == kXiMinus ) {
1046- registryMC.fill (HIST (" hMassXineg_truerec" ), centralityMcRec, ptmc, casc.mXi ());
1047- }
1048- if (pdgParent == kOmegaMinus ) {
1049- registryMC.fill (HIST (" hMassOmeganeg_truerec" ), centralityMcRec, ptmc, casc.mOmega ());
1050- }
1051- }
1052-
1053- if (casc.sign () > 0 ) {
1054- if (pdgParent == kXiPlusBar ) {
1055- registryMC.fill (HIST (" hMassXipos_truerec" ), centralityMcRec, ptmc, casc.mXi ());
1056- }
1057- if (pdgParent == kOmegaPlusBar ) {
1058- registryMC.fill (HIST (" hMassOmegapos_truerec" ), centralityMcRec, ptmc, casc.mOmega ());
1059- }
1060- }
1061-
1062- // compute MC association
1063- const bool isXiMC = (std::abs (pdgParent) == PDG_t::kXiMinus );
1064- const bool isOmegaMC = (std::abs (pdgParent) == PDG_t::kOmegaMinus );
1065- bool isTrueMCCascade = false ;
1066- bool isTrueMCCascadeDecay = false ;
1067- bool isCorrectLambdaDecay = false ;
1068-
1069- if (isPhysPrim && ( isXiMC || isOmegaMC))
1070- isTrueMCCascade = true ;
1071- if (isTrueMCCascade && ((casc.sign () > 0 && cascMC.pdgCodePositive () == PDG_t::kPiPlus && cascMC.pdgCodeNegative () == PDG_t::kProtonBar ) || (casc.sign () < 0 && cascMC.pdgCodePositive () == PDG_t::kProton && cascMC.pdgCodeNegative () == PDG_t::kPiMinus )))
1072- isCorrectLambdaDecay = true ;
1073- if (isTrueMCCascade && isCorrectLambdaDecay && ((isXiMC && std::abs (cascMC.pdgCodeBachelor ()) == PDG_t::kPiPlus ) || (isOmegaMC && std::abs (cascMC.pdgCodeBachelor ()) == PDG_t::kKPlus )))
1074- isTrueMCCascadeDecay = true ;
1075-
1076- if (isTrueMCCascadeDecay){
911+ // Fill event counter before event selection
912+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 0 );
913+
914+ // Initialize CCDB objects using the BC info
915+ initCCDB (RecCol);
916+
917+ // Define the event centrality using different estimators
918+ float centralityMcRec = -1 ;
919+ float multiplicityMcRec = -1 ;
920+
921+ if (centralityEstimator == Option::kFT0C ) {
922+ centralityMcRec = RecCol.centFT0C ();
923+ multiplicityMcRec = RecCol.multFT0C ();
924+ }
925+ if (centralityEstimator == Option::kFT0M ) {
926+ centralityMcRec = RecCol.centFT0M ();
927+ multiplicityMcRec = RecCol.multFT0C () + RecCol.multFT0A ();
928+ }
929+ if (centralityEstimator == Option::kFV0A ) {
930+ centralityMcRec = RecCol.centFV0A ();
931+ multiplicityMcRec = RecCol.multFV0A ();
932+ }
933+ if (centralityEstimator == Option::kNGlobal ) {
934+ centralityMcRec = RecCol.centNGlobal ();
935+ multiplicityMcRec = RecCol.multNTracksGlobal ();
936+ }
937+
938+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 0 , centralityMcRec);
939+
940+ // event selections
941+ if (applySel8 && !RecCol.sel8 ())
942+ return ;
943+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 1 );
944+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 1 , centralityMcRec);
945+
946+ if (applyVtxZ && std::fabs (RecCol.posZ ()) > zVtx)
947+ return ;
948+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 2 );
949+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 2 , centralityMcRec);
950+
951+ if (rejectITSROFBorder && !RecCol.selection_bit (o2::aod::evsel::kNoITSROFrameBorder )) {
952+ return ;
953+ }
954+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 3 /* Not at ITS ROF border */ );
955+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 3 , centralityMcRec);
956+
957+ if (rejectTFBorder && !RecCol.selection_bit (o2::aod::evsel::kNoTimeFrameBorder )) {
958+ return ;
959+ }
960+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 4 /* Not at TF border */ );
961+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 4 , centralityMcRec);
962+
963+ if (requireVertexITSTPC && !RecCol.selection_bit (o2::aod::evsel::kIsVertexITSTPC )) {
964+ return ;
965+ }
966+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 5 /* Contains at least one ITS-TPC track */ );
967+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 5 , centralityMcRec);
968+
969+ if (requireIsGoodZvtxFT0VsPV && !RecCol.selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV )) {
970+ return ;
971+ }
972+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 6 /* PV position consistency check */ );
973+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 6 , centralityMcRec);
974+
975+ if (requireIsVertexTOFmatched && !RecCol.selection_bit (o2::aod::evsel::kIsVertexTOFmatched )) {
976+ return ;
977+ }
978+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 7 /* PV with at least one contributor matched with TOF */ );
979+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 7 , centralityMcRec);
980+
981+ if (requireIsVertexTRDmatched && !RecCol.selection_bit (o2::aod::evsel::kIsVertexTRDmatched )) {
982+ return ;
983+ }
984+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 8 /* PV with at least one contributor matched with TRD */ );
985+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 8 , centralityMcRec);
986+
987+ if (rejectSameBunchPileup && !RecCol.selection_bit (o2::aod::evsel::kNoSameBunchPileup )) {
988+ return ;
989+ }
990+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 9 /* Not at same bunch pile-up */ );
991+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 9 , centralityMcRec);
992+
993+ if (requireInel0 && RecCol.multNTracksPVeta1 () < 1 ) {
994+ return ;
995+ }
996+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 10 /* INEL > 0 */ );
997+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 10 , centralityMcRec);
998+
999+ // Store the Zvtx
1000+ registryQC.fill (HIST (" hVertexZRec" ), RecCol.posZ ());
1001+
1002+ // Store the event centrality
1003+ registryMC.fill (HIST (" hCentEstimator_truerec" ), centralityMcRec);
1004+ registryMC.fill (HIST (" hCentralityVsNch_truerec" ), centralityMcRec, RecCol.multNTracksPVeta1 ());
1005+ registryMC.fill (HIST (" hCentralityVsMultiplicity_truerec" ), centralityMcRec, multiplicityMcRec);
1006+
1007+ for (const auto & casc : fullCascades) {
1008+ if (etaMin > casc.bacheloreta () || casc.bacheloreta () > etaMax ||
1009+ etaMin > casc.negativeeta () || casc.negativeeta () > etaMax ||
1010+ etaMin > casc.positiveeta () || casc.positiveeta () > etaMax)
1011+ continue ; // remove acceptance that's badly reproduced by MC / superfluous in future
1012+
1013+ if (!casc.has_cascMCCore ())
1014+ continue ;
1015+
1016+ auto cascMC = casc.template cascMCCore_as <CascadeMCCores>();
1017+
1018+ auto bach = casc.bachTrackExtra_as <DaughterTracks>();
1019+ auto pos = casc.posTrackExtra_as <DaughterTracks>();
1020+ auto neg = casc.negTrackExtra_as <DaughterTracks>();
1021+
1022+ int pdgParent = cascMC.pdgCode ();
1023+ bool isPhysPrim = cascMC.isPhysicalPrimary ();
1024+ if (pdgParent == 0 )
1025+ continue ;
1026+ if (!isPhysPrim)
1027+ continue ;
1028+
1029+ float ptmc = RecoDecay::sqrtSumOfSquares (cascMC.pxMC (), cascMC.pyMC ());
1030+
1031+ // ------------------------------------- Store selctions distribution for QC
1032+ registryQC.fill (HIST (" hv0cosPARec" ), casc.v0cosPA (RecCol.posX (), RecCol.posY (), RecCol.posZ ()));
1033+ registryQC.fill (HIST (" hcasccosPARec" ), casc.casccosPA (RecCol.posX (), RecCol.posY (), RecCol.posZ ()));
1034+ registryQC.fill (HIST (" hv0radiusRec" ), casc.v0radius ());
1035+ registryQC.fill (HIST (" hcascradiusRec" ), casc.cascradius ());
1036+ registryQC.fill (HIST (" hdcaV0daughtersRec" ), casc.dcaV0daughters ());
1037+ registryQC.fill (HIST (" hdcacascdaughtersRec" ), casc.dcacascdaughters ());
1038+ registryQC.fill (HIST (" hdcapostopvRec" ), casc.dcapostopv ());
1039+ registryQC.fill (HIST (" hdcanegtopvRec" ), casc.dcanegtopv ());
1040+ registryQC.fill (HIST (" hdcabachtopvRec" ), casc.dcabachtopv ());
1041+ registryQC.fill (HIST (" hdcav0topvRec" ), casc.dcav0topv (RecCol.posX (), RecCol.posY (), RecCol.posZ ()));
1042+
1043+ // ------------------------------------- Store selctions distribution for analysis
1044+ if (casc.sign () < 0 ) {
1045+ if (pdgParent == kXiMinus ) {
1046+ registryMC.fill (HIST (" hMassXineg_truerec" ), centralityMcRec, ptmc, casc.mXi ());
1047+ }
1048+ if (pdgParent == kOmegaMinus ) {
1049+ registryMC.fill (HIST (" hMassOmeganeg_truerec" ), centralityMcRec, ptmc, casc.mOmega ());
1050+ }
1051+ }
1052+
1053+ if (casc.sign () > 0 ) {
1054+ if (pdgParent == kXiPlusBar ) {
1055+ registryMC.fill (HIST (" hMassXipos_truerec" ), centralityMcRec, ptmc, casc.mXi ());
1056+ }
1057+ if (pdgParent == kOmegaPlusBar ) {
1058+ registryMC.fill (HIST (" hMassOmegapos_truerec" ), centralityMcRec, ptmc, casc.mOmega ());
1059+ }
1060+ }
1061+
1062+ // compute MC association
1063+ const bool isXiMC = (std::abs (pdgParent) == PDG_t::kXiMinus );
1064+ const bool isOmegaMC = (std::abs (pdgParent) == PDG_t::kOmegaMinus );
1065+ bool isTrueMCCascade = false ;
1066+ bool isTrueMCCascadeDecay = false ;
1067+ bool isCorrectLambdaDecay = false ;
1068+
1069+ if (isPhysPrim && (isXiMC || isOmegaMC))
1070+ isTrueMCCascade = true ;
1071+ if (isTrueMCCascade && ((casc.sign () > 0 && cascMC.pdgCodePositive () == PDG_t::kPiPlus && cascMC.pdgCodeNegative () == PDG_t::kProtonBar ) || (casc.sign () < 0 && cascMC.pdgCodePositive () == PDG_t::kProton && cascMC.pdgCodeNegative () == PDG_t::kPiMinus )))
1072+ isCorrectLambdaDecay = true ;
1073+ if (isTrueMCCascade && isCorrectLambdaDecay && ((isXiMC && std::abs (cascMC.pdgCodeBachelor ()) == PDG_t::kPiPlus ) || (isOmegaMC && std::abs (cascMC.pdgCodeBachelor ()) == PDG_t::kKPlus )))
1074+ isTrueMCCascadeDecay = true ;
1075+
1076+ if (isTrueMCCascadeDecay) {
10771077 if (pdgParent == kXiMinus && passedXiSelection (casc, pos, neg, bach, RecCol)) {
10781078 registryMC.fill (HIST (" hMassXinegSelected_truerec" ), centralityMcRec, ptmc, casc.mXi ());
10791079 }
@@ -1086,8 +1086,8 @@ struct CascadeAnalysisLightIonsDerivedData {
10861086 if (pdgParent == kOmegaPlusBar && passedOmegaSelection (casc, pos, neg, bach, RecCol)) {
10871087 registryMC.fill (HIST (" hMassOmegaposSelected_truerec" ), centralityMcRec, ptmc, casc.mOmega ());
10881088 }
1089- }
1090- } // casc loop
1089+ }
1090+ } // casc loop
10911091 }
10921092
10931093 PROCESS_SWITCH (CascadeAnalysisLightIonsDerivedData, processMonteCarloRec, " Process MC Rec" , false );
0 commit comments