@@ -183,8 +183,8 @@ struct Lambda1520analysisinpp {
183183
184184 // MC selection cut
185185 Configurable<float > cEtacutMC{" cEtacutMC" , 0 .5f , " MC eta cut" };
186- Configurable<bool > cUseRapcutMC{" cUseRapcutMC" , true , " MC eta cut" };
187- Configurable<bool > cUseEtacutMC{" cUseEtacutMC" , true , " MC eta cut" };
186+ Configurable<bool > cUseRapcutMC{" cUseRapcutMC" , true , " Use rapidity cut for MC " };
187+ Configurable<bool > cUseEtacutMC{" cUseEtacutMC" , false , " Use eta cut for MC " };
188188 Configurable<bool > useWeight{" useWeight" , false , " Use weight for signal loss calculation" };
189189
190190 // cuts on mother
@@ -413,6 +413,7 @@ struct Lambda1520analysisinpp {
413413
414414 // MC QA
415415 histos.add (" Event/hMCEventIndices" , " hMCEventIndices" , kTH2D , {axisMult, idxMCAxis});
416+ histos.add (" Event/MultiplicityRecoEv" , " Multiplicity of Reconstructed Events" , kTH1D , {axisMult});
416417
417418 if (doprocessMCGen) {
418419 histos.add (" QA/Gen" , " Gen histogram" , kTH1D , {{10 , 0 , 10 , " index" }});
@@ -425,16 +426,8 @@ struct Lambda1520analysisinpp {
425426
426427 histos.add (" Result/MC/Genlambda1520pt" , " pT distribution of True MC #Lambda(1520)0" , kTH3F , {axisMClabel, axisPt, axisMult});
427428 histos.add (" Result/MC/Genantilambda1520pt" , " pT distribution of True MC Anti-#Lambda(1520)0" , kTH3F , {axisMClabel, axisPt, axisMult});
428-
429- histos.add (" Result/SignalLoss/GenTrueprotonpt_num" , " True proton (num)" , kTH2F , {axisPt, axisMult});
430- histos.add (" Result/SignalLoss/Genprotonpt_num" , " Proton (num)" , kTH2F , {axisPt, axisMult});
431-
432- histos.add (" Result/SignalLoss/GenTruelambdapt_num" , " True lambda (num)" , kTH2F , {axisPt, axisMult});
433- histos.add (" Result/SignalLoss/Genlambdapt_num" , " Lambda (num)" , kTH2F , {axisPt, axisMult});
434-
435- histos.add (" Result/SignalLoss/GenTruexipt_num" , " True xi (num)" , kTH2F , {axisPt, axisMult});
436- histos.add (" Result/SignalLoss/Genxipt_num" , " Xi (num)" , kTH2F , {axisPt, axisMult});
437429 }
430+
438431 if (doprocessMCRec) {
439432 histos.add (" QA/MC/h2RecoEtaPt_after" , " #eta-#it{p}_{T} distribution of Reconstructed #Lambda(1520); #eta; #it{p}_{T}; Counts;" , HistType::kTHnSparseF , {axisEta, axisPt});
440433 histos.add (" QA/MC/h2RecoPhiRapidity_after" , " #phi-y distribution of Reconstructed #Lambda(1520); #phi; y; Counts;" , HistType::kTHnSparseF , {axisPhi, axisRap});
@@ -451,10 +444,14 @@ struct Lambda1520analysisinpp {
451444 histos.add (" Result/MC/h3lambda1520Recoinvmass" , " Invariant mass of Reconstructed MC #Lambda(1520)0" , kTHnSparseF , {axisMult, axisPt, axisMassLambda1520});
452445 histos.add (" Result/MC/h3antilambda1520Recoinvmass" , " Invariant mass of Reconstructed MC Anti-#Lambda(1520)0" , kTHnSparseF , {axisMult, axisPt, axisMassLambda1520});
453446 }
447+
454448 if (doprocessSignalLoss) {
455449 histos.add (" Result/SignalLoss/GenTruelambda1520pt_den" , " True lambda1520 (den)" , kTH2F , {axisPt, axisMult});
456450 histos.add (" Result/SignalLoss/GenTrueantilambda1520pt_den" , " True anti-lambda1520 (den)" , kTH2F , {axisPt, axisMult});
457451
452+ histos.add (" Result/SignalLoss/GenTruekaonpt_den" , " True kaon (den)" , kTH2F , {axisPt, axisMult});
453+ histos.add (" Result/SignalLoss/Genkaonpt_den" , " kaon (den)" , kTH2F , {axisPt, axisMult});
454+
458455 histos.add (" Result/SignalLoss/GenTrueprotonpt_den" , " True proton (den)" , kTH2F , {axisPt, axisMult});
459456 histos.add (" Result/SignalLoss/Genprotonpt_den" , " Proton (den)" , kTH2F , {axisPt, axisMult});
460457
@@ -463,6 +460,24 @@ struct Lambda1520analysisinpp {
463460
464461 histos.add (" Result/SignalLoss/GenTruexipt_den" , " True xi (den)" , kTH2F , {axisPt, axisMult});
465462 histos.add (" Result/SignalLoss/Genxipt_den" , " Xi (den)" , kTH2F , {axisPt, axisMult});
463+
464+ histos.add (" Result/SignalLoss/GenTrueomegapt_den" , " True omega (den)" , kTH2F , {axisPt, axisMult});
465+ histos.add (" Result/SignalLoss/Genomegapt_den" , " omega (den)" , kTH2F , {axisPt, axisMult});
466+
467+ histos.add (" Result/SignalLoss/GenTruekaonpt_num" , " True kaon (num)" , kTH2F , {axisPt, axisMult});
468+ histos.add (" Result/SignalLoss/Genkaonpt_num" , " kaon (num)" , kTH2F , {axisPt, axisMult});
469+
470+ histos.add (" Result/SignalLoss/GenTrueprotonpt_num" , " True proton (num)" , kTH2F , {axisPt, axisMult});
471+ histos.add (" Result/SignalLoss/Genprotonpt_num" , " Proton (num)" , kTH2F , {axisPt, axisMult});
472+
473+ histos.add (" Result/SignalLoss/GenTruelambdapt_num" , " True lambda (num)" , kTH2F , {axisPt, axisMult});
474+ histos.add (" Result/SignalLoss/Genlambdapt_num" , " Lambda (num)" , kTH2F , {axisPt, axisMult});
475+
476+ histos.add (" Result/SignalLoss/GenTruexipt_num" , " True xi (num)" , kTH2F , {axisPt, axisMult});
477+ histos.add (" Result/SignalLoss/Genxipt_num" , " Xi (num)" , kTH2F , {axisPt, axisMult});
478+
479+ histos.add (" Result/SignalLoss/GenTrueomegapt_num" , " True omega (num)" , kTH2F , {axisPt, axisMult});
480+ histos.add (" Result/SignalLoss/Genomegapt_num" , " omega (num)" , kTH2F , {axisPt, axisMult});
466481 }
467482
468483 // Print output histograms statistics
@@ -1314,70 +1329,28 @@ struct Lambda1520analysisinpp {
13141329 histos.fill (HIST (" Result/MC/Genantilambda1520pt" ), 6 , part.pt (), centrality);
13151330 }
13161331 }
1332+ }
1333+ PROCESS_SWITCH (Lambda1520analysisinpp, processMCGen, " Process Event for MC only" , false );
13171334
1318- auto computePtL = [&](float pt, float m_ref) {
1319- float ptL2 = pt * pt + m_ref * m_ref - MassLambda1520 * MassLambda1520;
1320- return (ptL2 > 0 ) ? std::sqrt (ptL2) : -1 .f ;
1321- };
1322-
1323- // ===== NUM =====
1324- if (!(inVtx10 && isTrueINELgt0))
1325- return ;
1326-
1327- if (!isInAfterAllCuts)
1328- return ;
1329-
1330- for (const auto & part : mcPartsAll) {
1331-
1332- if (!part.isPhysicalPrimary ())
1333- continue ;
1334-
1335- if (cUseRapcutMC && std::abs (part.y ()) > configTracks.cfgCutRapidity )
1336- continue ;
1337-
1338- if (cUseEtacutMC && std::abs (part.eta ()) > cEtacutMC)
1335+ void processEventFactor (MCEventCandidates const & collisions, soa::Join<aod::McCollisions, aod::McCentFT0Ms> const & mcCollisions, aod::McParticles const & mcParticles)
1336+ {
1337+ // Loop on reconstructed collisions
1338+ for (const auto & collision : collisions) {
1339+ if (!collision.has_mcCollision ()) {
13391340 continue ;
1340-
1341- float pt = part.pt ();
1342-
1343- // proton
1344- if (std::abs (part.pdgCode ()) == kProton ) {
1345- histos.fill (HIST (" Result/SignalLoss/GenTrueprotonpt_num" ), pt, centrality);
1346-
1347- float ptL = computePtL (pt, massPr);
1348- if (ptL > 0 ) {
1349- float w = useWeight ? ptL / pt : 1 .f ;
1350- histos.fill (HIST (" Result/SignalLoss/Genprotonpt_num" ), ptL, centrality, w);
1351- }
13521341 }
1342+ const auto & mcCollision = collision.mcCollision_as <soa::Join<aod::McCollisions, aod::McCentFT0Ms>>();
1343+ const auto & particlesInCollision = mcParticles.sliceByCached (aod::mcparticle::mcCollisionId, mcCollision.globalIndex (), cacheMC);
13531344
1354- // lambda
1355- if (std::abs (part.pdgCode ()) == kLambda0 ) {
1356- histos.fill (HIST (" Result/SignalLoss/GenTruelambdapt_num" ), pt, centrality);
1357-
1358- float ptL = computePtL (pt, MassLambda0);
1359- if (ptL > 0 ) {
1360- float w = useWeight ? ptL / pt : 1 .f ;
1361- histos.fill (HIST (" Result/SignalLoss/Genlambdapt_num" ), ptL, centrality, w);
1362- }
1363- }
1345+ bool isTrueINELgt0 = pwglf::isINELgt0mc (particlesInCollision, pdg);
1346+ bool isInAfterAllCuts = isSelected (collision, false );
13641347
1365- // xi
1366- if (std::abs (part.pdgCode ()) == PDG_t::kXiMinus ) {
1367- histos.fill (HIST (" Result/SignalLoss/GenTruexipt_num" ), pt, centrality);
1348+ float centrality = mcCollision.centFT0M ();
13681349
1369- float ptL = computePtL (pt, MassXiMinus);
1370- if (ptL > 0 ) {
1371- float w = useWeight ? ptL / pt : 1 .f ;
1372- histos.fill (HIST (" Result/SignalLoss/Genxipt_num" ), ptL, centrality, w);
1373- }
1374- }
1350+ if (isTrueINELgt0 && isInAfterAllCuts)
1351+ histos.fill (HIST (" Event/MultiplicityRecoEv" ), centrality);
13751352 }
1376- }
1377- PROCESS_SWITCH (Lambda1520analysisinpp, processMCGen, " Process Event for MC only" , false );
13781353
1379- void processEventFactor (soa::Join<aod::McCollisions, aod::McCentFT0Ms> const & mcCollisions, aod::McParticles const & mcParticles)
1380- {
13811354 // Loop on generated collisions to fill the event factor for the INEL>0 correction
13821355 for (const auto & mccolls : mcCollisions) {
13831356 float centrality = mccolls.centFT0M ();
@@ -1397,8 +1370,105 @@ struct Lambda1520analysisinpp {
13971370 }
13981371 PROCESS_SWITCH (Lambda1520analysisinpp, processEventFactor, " Process Event factor" , false );
13991372
1400- void processSignalLoss (soa::Join<aod::McCollisions, aod::McCentFT0Ms> const & mcCollisions, aod::McParticles const & mcParticles)
1373+ void processSignalLoss (MCEventCandidates const & collisions, soa::Join<aod::McCollisions, aod::McCentFT0Ms> const & mcCollisions, aod::McParticles const & mcParticles)
14011374 {
1375+ // Loop on reconstructed collisions
1376+ for (const auto & collision : collisions) {
1377+ if (!collision.has_mcCollision ()) {
1378+ continue ;
1379+ }
1380+ const auto & mcCollision = collision.mcCollision_as <soa::Join<aod::McCollisions, aod::McCentFT0Ms>>();
1381+ const auto & particlesInCollision = mcParticles.sliceByCached (aod::mcparticle::mcCollisionId, mcCollision.globalIndex (), cacheMC);
1382+
1383+ bool isTrueINELgt0 = pwglf::isINELgt0mc (particlesInCollision, pdg);
1384+ bool isInAfterAllCuts = isSelected (collision, false );
1385+ bool inVtx10 = std::abs (mcCollision.posZ ()) <= configEvents.cfgEvtZvtx ;
1386+
1387+ float centrality = mcCollision.centFT0M ();
1388+
1389+ auto computePtL = [&](float pt, float m_ref) {
1390+ float ptL2 = pt * pt + m_ref * m_ref - MassLambda1520 * MassLambda1520;
1391+ return (ptL2 > 0 ) ? std::sqrt (ptL2) : -1 .f ;
1392+ };
1393+
1394+ // ===== NUM =====
1395+ if (!(inVtx10 && isTrueINELgt0))
1396+ continue ;
1397+
1398+ if (!isInAfterAllCuts)
1399+ continue ;
1400+
1401+ for (const auto & part : particlesInCollision) {
1402+
1403+ if (!part.isPhysicalPrimary ())
1404+ continue ;
1405+
1406+ if (cUseRapcutMC && std::abs (part.y ()) > configTracks.cfgCutRapidity )
1407+ continue ;
1408+
1409+ if (cUseEtacutMC && std::abs (part.eta ()) > cEtacutMC)
1410+ continue ;
1411+
1412+ float pt = part.pt ();
1413+
1414+ // kaon
1415+ if (std::abs (part.pdgCode ()) == kKPlus ) {
1416+ histos.fill (HIST (" Result/SignalLoss/GenTruekaonpt_num" ), pt, centrality);
1417+
1418+ float ptL = computePtL (pt, massKa);
1419+ if (ptL > 0 ) {
1420+ float w = useWeight ? ptL / pt : 1 .f ;
1421+ histos.fill (HIST (" Result/SignalLoss/Genkaonpt_num" ), ptL, centrality, w);
1422+ }
1423+ }
1424+
1425+ // proton
1426+ if (std::abs (part.pdgCode ()) == kProton ) {
1427+ histos.fill (HIST (" Result/SignalLoss/GenTrueprotonpt_num" ), pt, centrality);
1428+
1429+ float ptL = computePtL (pt, massPr);
1430+ if (ptL > 0 ) {
1431+ float w = useWeight ? ptL / pt : 1 .f ;
1432+ histos.fill (HIST (" Result/SignalLoss/Genprotonpt_num" ), ptL, centrality, w);
1433+ }
1434+ }
1435+
1436+ // lambda
1437+ if (std::abs (part.pdgCode ()) == kLambda0 ) {
1438+ histos.fill (HIST (" Result/SignalLoss/GenTruelambdapt_num" ), pt, centrality);
1439+
1440+ float ptL = computePtL (pt, MassLambda0);
1441+ if (ptL > 0 ) {
1442+ float w = useWeight ? ptL / pt : 1 .f ;
1443+ histos.fill (HIST (" Result/SignalLoss/Genlambdapt_num" ), ptL, centrality, w);
1444+ }
1445+ }
1446+
1447+ // xi
1448+ if (std::abs (part.pdgCode ()) == PDG_t::kXiMinus ) {
1449+ histos.fill (HIST (" Result/SignalLoss/GenTruexipt_num" ), pt, centrality);
1450+
1451+ float ptL = computePtL (pt, MassXiMinus);
1452+ if (ptL > 0 ) {
1453+ float w = useWeight ? ptL / pt : 1 .f ;
1454+ histos.fill (HIST (" Result/SignalLoss/Genxipt_num" ), ptL, centrality, w);
1455+ }
1456+ }
1457+
1458+ // omega_minus
1459+ if (std::abs (part.pdgCode ()) == PDG_t::kOmegaMinus ) {
1460+ histos.fill (HIST (" Result/SignalLoss/GenTrueomegapt_num" ), pt, centrality);
1461+
1462+ float ptL = computePtL (pt, MassOmegaMinus);
1463+ if (ptL > 0 ) {
1464+ float w = useWeight ? ptL / pt : 1 .f ;
1465+ histos.fill (HIST (" Result/SignalLoss/Genomegapt_num" ), ptL, centrality, w);
1466+ }
1467+ }
1468+ }
1469+ }
1470+
1471+ // Loop on generated collisions to fill the event factor for the INEL>0 correction
14021472 for (const auto & mccolls : mcCollisions) {
14031473 float centrality = mccolls.centFT0M ();
14041474
@@ -1456,6 +1526,24 @@ struct Lambda1520analysisinpp {
14561526 float pt = part.pt ();
14571527 float weight = 1 .f ;
14581528
1529+ // =========================
1530+ // ===== KAON ==============
1531+ // =========================
1532+ if (std::abs (part.pdgCode ()) == kKPlus ) {
1533+
1534+ // --- DENOMINATOR ONLY
1535+ histos.fill (HIST (" Result/SignalLoss/GenTruekaonpt_den" ), pt, centrality);
1536+
1537+ float ptL = computePtL (pt, massKa);
1538+ if (ptL < 0 )
1539+ continue ;
1540+
1541+ if (useWeight)
1542+ weight = ptL / pt;
1543+
1544+ histos.fill (HIST (" Result/SignalLoss/Genkaonpt_den" ), ptL, centrality, weight);
1545+ }
1546+
14591547 // =========================
14601548 // ===== PROTON ============
14611549 // =========================
@@ -1507,6 +1595,23 @@ struct Lambda1520analysisinpp {
15071595
15081596 histos.fill (HIST (" Result/SignalLoss/Genxipt_den" ), ptL, centrality, weight);
15091597 }
1598+
1599+ // ===========================
1600+ // ===== OMEGA ===============
1601+ // ===========================
1602+ if (std::abs (part.pdgCode ()) == PDG_t::kOmegaMinus ) {
1603+
1604+ histos.fill (HIST (" Result/SignalLoss/GenTrueomegapt_den" ), pt, centrality);
1605+
1606+ float ptL = computePtL (pt, MassOmegaMinus);
1607+ if (ptL < 0 )
1608+ continue ;
1609+
1610+ if (useWeight)
1611+ weight = ptL / pt;
1612+
1613+ histos.fill (HIST (" Result/SignalLoss/Genomegapt_den" ), ptL, centrality, weight);
1614+ }
15101615 }
15111616 }
15121617 }
0 commit comments