@@ -378,6 +378,7 @@ struct V0PtInvMassPlots {
378378 rPtAnalysis.fill (HIST (" hNEvents" ), 5.5 , collision.centFT0M ());
379379 rPtAnalysis.get <TH2>(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (6 , " cutZVertex" );
380380 if (doisInelGt0 && !(collision.multNTracksPVeta1 () > 0 )) {
381+ // if (doisInelGt0 && !(collision.multMCNParticlesEta10() > 0)) { CHANGE TO THIS
381382 return false ;
382383 }
383384 rPtAnalysis.fill (HIST (" hNEvents" ), 6.5 , collision.centFT0M ());
@@ -694,6 +695,7 @@ struct V0PtInvMassPlots {
694695 using DaughterTracksDerived = soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs>;
695696 o2::framework::Service<o2::framework::O2DatabasePDG> pdgDB;
696697
698+ // This is the process for Generated Particles
697699 void genMCProcess (
698700 soa::Join<aod::McCollisions, aod::McCentFT0Ms>::iterator const & mcCollision,
699701 soa::SmallGroups<soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::PVMults, aod::McCentFT0Ms>> const & collisions,
@@ -704,6 +706,7 @@ struct V0PtInvMassPlots {
704706 if (std::abs (mcCollision.posZ ()) > cutZVertex) {
705707 return ;
706708 }
709+ // if (!(mcCollision.multMCNParticlesEta10() > 0)) { TRY TO CHANGE TO THIS
707710 if (!pwglf::isINELgtNmc (mcParticles, 0 , pdgDB)) {
708711 return ;
709712 }
@@ -1092,11 +1095,10 @@ struct V0PtInvMassPlots {
10921095 }
10931096 }
10941097 }
1095- // This is the Process for the MC reconstructed Data
1096- void recMCProcessDerived (soa::Join<aod::StraCollisions, aod::StraEvSels, aod::StraCollLabels, aod::StraCents>::iterator const & collision,
1097- // <aod::McCollisions> const& /*mcCollisions*/,
1098- soa::Join<aod::V0CollRefs, aod::V0Cores, aod::V0Extras, aod::V0CoreMCLabels, aod::V0MCMothers> const & V0s,
1099- DaughterTracksDerived const &)
1098+ void recMCProcessDerived (
1099+ soa::Join<aod::StraCollisions, aod::StraEvSels, aod::StraCollLabels, aod::StraCents, aod::StraMCCollMults>::iterator const & collision,
1100+ soa::Join<aod::V0CollRefs, aod::V0MCCores, aod::V0Datas, aod::V0Extras, aod::V0CoreMCLabels, aod::V0MCMothers> const & V0s,
1101+ DaughterTracksDerived const &)
11001102 {
11011103 // tokenise strings into individual values
11021104 pthistos::kaonPtBins = o2::utils::Str::tokenize (kzeroSettingPtBinsString, ' ,' );
@@ -1139,18 +1141,18 @@ struct V0PtInvMassPlots {
11391141 if (acceptK0sh (v0, posDaughterTrack, negDaughterTrack, collision)) { // K0sh Selection
11401142 // K0sh Signal Split Numerator Start
11411143 for (int i = 0 ; i < nKaonHistograms; i++) {
1142- if (kaonptedgevalues[i] <= v0.pt () && v0.pt () < kaonptedgevalues[i + 1 ]) { // finding v0s with pt within the range of our bin edges for K0sh Splitting Numerator
1143- pthistos::kaonSplit[i]->Fill (v0.mK0Short (), collision.centFT0M ()); // filling the k0s namespace histograms for K0sh Splitting Numerator
1144+ if (kaonptedgevalues[i] <= v0.ptMC () && v0.ptMC () < kaonptedgevalues[i + 1 ]) { // finding v0s with pt within the range of our bin edges for K0sh Splitting Numerator
1145+ pthistos::kaonSplit[i]->Fill (v0.mK0Short (), collision.centFT0M ()); // filling the k0s namespace histograms for K0sh Splitting Numerator
11441146 }
11451147 }
1146- // K0sh Signla Split Numerator End
1148+ // K0sh SignaL Split Numerator End
11471149 if (v0.has_v0MCCore ()) {
11481150 auto v0mcParticle = v0.v0MCCore_as <aod::V0MCCores>();
11491151 if (dotruthk0sh && (v0mcParticle.pdgCode () == kK0Short )) { // kzero matched
11501152 if (v0mcParticle.isPhysicalPrimary ()) {
11511153 for (int i = 0 ; i < nKaonHistograms; i++) {
1152- if (kaonptedgevalues[i] <= v0.pt () && v0.pt () < kaonptedgevalues[i + 1 ]) { // finding v0s with pt within the range of our bin edges
1153- pthistos::kaonPt[i]->Fill (v0.mK0Short (), collision.centFT0M ()); // filling the k0s namespace histograms
1154+ if (kaonptedgevalues[i] <= v0.ptMC () && v0.ptMC () < kaonptedgevalues[i + 1 ]) { // finding v0s with pt within the range of our bin edges
1155+ pthistos::kaonPt[i]->Fill (v0.mK0Short (), collision.centFT0M ()); // filling the k0s namespace histograms
11541156 }
11551157 }
11561158 }
@@ -1170,7 +1172,7 @@ struct V0PtInvMassPlots {
11701172 if (acceptLambda (v0, posDaughterTrack, negDaughterTrack, collision)) { // Lambda Selections
11711173 // Lambda Signal Split Numerator Start
11721174 for (int i = 0 ; i < nLambdaHistograms; i++) {
1173- if (lambdaptedgevalues[i] <= v0.pt () && v0.pt () < lambdaptedgevalues[i + 1 ]) {
1175+ if (lambdaptedgevalues[i] <= v0.ptMC () && v0.ptMC () < lambdaptedgevalues[i + 1 ]) {
11741176 pthistos::lambdaSplit[i]->Fill (v0.mLambda (), collision.centFT0M ());
11751177 }
11761178 }
@@ -1180,7 +1182,7 @@ struct V0PtInvMassPlots {
11801182 if (dotruthLambda && (v0mcParticle.pdgCode () == kLambda0 )) { // lambda matched
11811183 if (v0mcParticle.isPhysicalPrimary ()) {
11821184 for (int i = 0 ; i < nLambdaHistograms; i++) {
1183- if (lambdaptedgevalues[i] <= v0.pt () && v0.pt () < lambdaptedgevalues[i + 1 ]) {
1185+ if (lambdaptedgevalues[i] <= v0.ptMC () && v0.ptMC () < lambdaptedgevalues[i + 1 ]) {
11841186 pthistos::lambdaPt[i]->Fill (v0.mLambda (), collision.centFT0M ());
11851187 }
11861188 }
@@ -1207,7 +1209,7 @@ struct V0PtInvMassPlots {
12071209 if (acceptAntilambda (v0, posDaughterTrack, negDaughterTrack, collision)) { // Antilambda Selections
12081210 // Antilambda Signal Split Numerator End
12091211 for (int i = 0 ; i < nAntilambdaHistograms; i++) {
1210- if (antilambdaptedgevalues[i] <= v0.pt () && v0.pt () < antilambdaptedgevalues[i + 1 ]) {
1212+ if (antilambdaptedgevalues[i] <= v0.ptMC () && v0.ptMC () < antilambdaptedgevalues[i + 1 ]) {
12111213 pthistos::antilambdaSplit[i]->Fill (v0.mAntiLambda (), collision.centFT0M ());
12121214 }
12131215 }
@@ -1217,7 +1219,7 @@ struct V0PtInvMassPlots {
12171219 if (dotruthAntilambda && (v0mcParticle.pdgCode () == kLambda0Bar )) { // antilambda matched
12181220 if (v0mcParticle.isPhysicalPrimary ()) {
12191221 for (int i = 0 ; i < nAntilambdaHistograms; i++) {
1220- if (antilambdaptedgevalues[i] <= v0.pt () && v0.pt () < antilambdaptedgevalues[i + 1 ]) {
1222+ if (antilambdaptedgevalues[i] <= v0.ptMC () && v0.ptMC () < antilambdaptedgevalues[i + 1 ]) {
12211223 pthistos::antilambdaPt[i]->Fill (v0.mAntiLambda (), collision.centFT0M ());
12221224 }
12231225 }
@@ -1241,10 +1243,133 @@ struct V0PtInvMassPlots {
12411243 }
12421244 }
12431245 }
1246+
1247+ // This si the process for the MC generated derived data
1248+ void genMCProcessDerived (
1249+ // soa::Join<aod::StraMcCollisions, aod::StraMcCents>::iterator const& mcCollision, will include when table is available in the O2 framework
1250+ soa::Join<aod::StraMCCollisions, aod::StraCents, aod::StraMCCollMults>::iterator const & mcCollision,
1251+ soa::SmallGroups<soa::Join<aod::StraCollisions, aod::StraEvSels, aod::StraCollLabels, aod::StraCents>> const & collisions,
1252+ soa::Join<aod::V0MCCores, aod::V0CoreMCLabels> const & V0s,
1253+ soa::Join<aod::CascMCCores, aod::CascCoreMCLabels> const & cascs,
1254+ DaughterTracksDerived const &)
1255+ {
1256+ // Event Efficiency, Event Split and V0 Signal Loss Corrections
1257+ rMCCorrections.fill (HIST (" hNEvents_Corrections" ), 0.5 , mcCollision.centFT0M ()); // All Events
1258+ if (std::abs (mcCollision.posZ ()) > cutZVertex) {
1259+ return ;
1260+ }
1261+ if (!(mcCollision.multMCNParticlesEta10 () > 0 )) {
1262+ return ;
1263+ }
1264+ rMCCorrections.fill (HIST (" hNEvents_Corrections" ), 1.5 , mcCollision.centFT0M ()); // Event Efficiency Denominator
1265+ // Particles (of interest) Generated Pt Spectrum and Signal Loss Denominator Loop
1266+ for (const auto & v0 : V0s) {
1267+ if (v0.has_v0MCCore ()) {
1268+ auto v0mcParticle = v0.v0MCCore_as <aod::V0MCCores>();
1269+ if (v0mcParticle.isPhysicalPrimary ()) {
1270+ if (v0mcParticle.pdgCode () == kK0Short ) // kzero matched
1271+ {
1272+ if (std::abs (v0mcParticle.rapidityMC (0 )) < rapidityCut) {
1273+ rMCCorrections.fill (HIST (" hK0shGeneratedPtSpectrum" ), v0.ptMC (), mcCollision.centFT0M ());
1274+ }
1275+ }
1276+ if (v0mcParticle.pdgCode () == kLambda0 ) // lambda matched
1277+ {
1278+ if (std::abs (v0mcParticle.rapidityMC (1 )) < rapidityCut) {
1279+ rMCCorrections.fill (HIST (" hLambdaGeneratedPtSpectrum" ), v0.ptMC (), mcCollision.centFT0M ());
1280+ }
1281+ }
1282+ if (v0mcParticle.pdgCode () == kLambda0Bar ) // antilambda matched
1283+ {
1284+ if (std::abs (v0mcParticle.rapidityMC (2 )) < rapidityCut) {
1285+ rMCCorrections.fill (HIST (" hAntiLambdaGeneratedPtSpectrum" ), v0.ptMC (), mcCollision.centFT0M ());
1286+ }
1287+ }
1288+ }
1289+ }
1290+ }
1291+ for (const auto & casc : cascs) {
1292+ if (casc.isPhysicalPrimary ()) {
1293+ // Make rapidity cuts, from O2's documentation: rapidity (0, 1: Xi; 2, 3: Omega)
1294+ if (casc.pdgCode () == kXiMinus ) // Xi Minus matched
1295+ {
1296+ if (std::abs (casc.rapidityMC (0 )) < rapidityCut) {
1297+ rMCCorrections.fill (HIST (" hXiMinusGeneratedPtSpectrum" ), casc.ptMC (), mcCollision.centFT0M ());
1298+ }
1299+ }
1300+ if (casc.pdgCode () == kXi0 ) // Xi Zero matched
1301+ {
1302+ if (std::abs (casc.rapidityMC (0 )) < rapidityCut) { // Using the Xi mass assumption
1303+ rMCCorrections.fill (HIST (" hXiZeroGeneratedPtSpectrum" ), casc.ptMC (), mcCollision.centFT0M ());
1304+ }
1305+ }
1306+ if (casc.pdgCode () == kOmegaMinus ) // Omega matched
1307+ {
1308+ if (std::abs (casc.rapidityMC (2 )) < rapidityCut) {
1309+ rMCCorrections.fill (HIST (" hOmegaGeneratedPtSpectrum" ), casc.ptMC (), mcCollision.centFT0M ());
1310+ }
1311+ }
1312+ if (casc.pdgCode () == kXiPlusBar ) // Xi Plus matched
1313+ {
1314+ if (std::abs (casc.rapidityMC (1 )) < rapidityCut) {
1315+ rMCCorrections.fill (HIST (" hXiPlusGeneratedPtSpectrum" ), casc.ptMC (), mcCollision.centFT0M ());
1316+ }
1317+ }
1318+ if (casc.pdgCode () == -kXi0 ) // Anti-Xi Zero matched
1319+ {
1320+ if (std::abs (casc.rapidityMC (1 )) < rapidityCut) { // Using the Xi mass assumption
1321+ rMCCorrections.fill (HIST (" hAntiXiZeroGeneratedPtSpectrum" ), casc.ptMC (), mcCollision.centFT0M ());
1322+ }
1323+ }
1324+ if (casc.pdgCode () == kOmegaPlusBar ) // Anti-Omega matched
1325+ {
1326+ if (std::abs (casc.rapidityMC (3 )) < rapidityCut) {
1327+ rMCCorrections.fill (HIST (" hAntiOmegaGeneratedPtSpectrum" ), casc.ptMC (), mcCollision.centFT0M ());
1328+ }
1329+ }
1330+ }
1331+ }
1332+ // Signal Loss Numenator Loop
1333+ for (const auto & collision : collisions) {
1334+ rMCCorrections.fill (HIST (" hNEvents_Corrections" ), 2.5 , mcCollision.centFT0M ()); // Number of Events Reconsctructed
1335+ if (!acceptEvent (collision)) { // Event Selection
1336+ return ;
1337+ }
1338+ rMCCorrections.fill (HIST (" hNEvents_Corrections" ), 3.5 , mcCollision.centFT0M ()); // Event Split Denomimator and Event Efficiency Numenator
1339+ for (const auto & v0 : V0s) {
1340+ if (v0.has_v0MCCore ()) {
1341+ auto v0mcParticle = v0.v0MCCore_as <aod::V0MCCores>();
1342+ if (!v0mcParticle.isPhysicalPrimary ()) {
1343+ continue ;
1344+ }
1345+ if (v0mcParticle.pdgCode () == kK0Short ) // kzero matched
1346+ {
1347+ if (std::abs (v0mcParticle.rapidityMC (0 )) < rapidityCut) {
1348+ rMCCorrections.fill (HIST (" hK0shAfterEventSelectionPtSpectrum" ), v0.ptMC (), mcCollision.centFT0M ());
1349+ }
1350+ }
1351+ if (v0mcParticle.pdgCode () == kLambda0 ) // lambda matched
1352+ {
1353+ if (std::abs (v0mcParticle.rapidityMC (1 )) < rapidityCut) {
1354+ rMCCorrections.fill (HIST (" hLambdaAfterEventSelectionPtSpectrum" ), v0.ptMC (), mcCollision.centFT0M ());
1355+ }
1356+ }
1357+ if (v0mcParticle.pdgCode () == kLambda0Bar ) // antilambda matched
1358+ {
1359+ if (std::abs (v0mcParticle.rapidityMC (2 )) < rapidityCut) {
1360+ rMCCorrections.fill (HIST (" hAntiLambdaAfterEventSelectionPtSpectrum" ), v0.ptMC (), mcCollision.centFT0M ());
1361+ }
1362+ }
1363+ }
1364+ }
1365+ }
1366+ // End of Signal Loss Numenator Loop
1367+ }
1368+
12441369 PROCESS_SWITCH (V0PtInvMassPlots, genMCProcess, " Process Run 3 MC Generated" , false );
12451370 PROCESS_SWITCH (V0PtInvMassPlots, recMCProcess, " Process Run 3 MC Reconstructed" , false );
12461371 PROCESS_SWITCH (V0PtInvMassPlots, dataProcess, " Process Run 3 Data," , false );
1247- // PROCESS_SWITCH(V0PtInvMassPlots, genMCProcessDerived, "Process Run 3 MC Generated", false);
1372+ PROCESS_SWITCH (V0PtInvMassPlots, genMCProcessDerived, " Process Run 3 MC Generated" , false );
12481373 PROCESS_SWITCH (V0PtInvMassPlots, recMCProcessDerived, " Process Run 3 MC Reconstructed" , false );
12491374 PROCESS_SWITCH (V0PtInvMassPlots, dataProcessDerived, " Process Run 3 Data," , false );
12501375};
0 commit comments