@@ -285,7 +285,7 @@ struct Derivedupcanalysis {
285285 ConfigurableAxis axisNsigmaTPC{" axisNsigmaTPC" , {200 , -10 .0f , 10 .0f }, " N sigma TPC" };
286286 ConfigurableAxis axisTPCsignal{" axisTPCsignal" , {200 , 0 .0f , 200 .0f }, " TPC signal" };
287287 ConfigurableAxis axisTOFdeltaT{" axisTOFdeltaT" , {200 , -5000 .0f , 5000 .0f }, " TOF Delta T (ps)" };
288- ConfigurableAxis axisNctau{ " axisNctau " , {200 , 0 .0f , 20 .0f }, " c x tau (cm)" };
288+ ConfigurableAxis axisCtau{ " axisCtau " , {200 , 0 .0f , 20 .0f }, " c x tau (cm)" };
289289
290290 static constexpr std::string_view kParticlenames [] = {" K0Short" , " Lambda" , " AntiLambda" , " Xi" , " AntiXi" , " Omega" , " AntiOmega" };
291291
@@ -312,7 +312,7 @@ struct Derivedupcanalysis {
312312 histos.add (Form (" %s/hDCAV0Daughters" , kParticlenames [partID].data ()), " hDCAV0Daughters" , kTH2F , {axisPtCoarse, axisDCAdau});
313313 histos.add (Form (" %s/hDCAV0ToPV" , kParticlenames [partID].data ()), " hDCAV0ToPV" , kTH2F , {axisPtCoarse, {44 , 0 .0f , 2 .2f }});
314314 histos.add (Form (" %s/hMassLambdaDau" , kParticlenames [partID].data ()), " hMassLambdaDau" , kTH2F , {axisPtCoarse, axisLambdaMass});
315- histos.add (Form (" %s/hNctau " , kParticlenames [partID].data ()), " hNctau " , kTH2F , {axisPtCoarse, axisNctau });
315+ histos.add (Form (" %s/hCtau " , kParticlenames [partID].data ()), " hCtau " , kTH2F , {axisPtCoarse, axisCtau });
316316 if (doBachelorBaryonCut) {
317317 histos.add (Form (" %s/hBachBaryonCosPA" , kParticlenames [partID].data ()), " hBachBaryonCosPA" , kTH2F , {axisPtCoarse, {100 , 0 .0f , 1 .0f }});
318318 histos.add (Form (" %s/hBachBaryonDCAxyToPV" , kParticlenames [partID].data ()), " hBachBaryonDCAxyToPV" , kTH2F , {axisPtCoarse, {300 , -3 .0f , 3 .0f }});
@@ -326,7 +326,7 @@ struct Derivedupcanalysis {
326326 histos.add (Form (" %s/hV0Radius" , kParticlenames [partID].data ()), " hV0Radius" , kTH1F , {axisV0Radius});
327327 histos.add (Form (" %s/h2dPositiveITSvsTPCpts" , kParticlenames [partID].data ()), " h2dPositiveITSvsTPCpts" , kTH2F , {axisTPCrows, axisITSclus});
328328 histos.add (Form (" %s/h2dNegativeITSvsTPCpts" , kParticlenames [partID].data ()), " h2dNegativeITSvsTPCpts" , kTH2F , {axisTPCrows, axisITSclus});
329- histos.add (Form (" %s/hNctau " , kParticlenames [partID].data ()), " hNctau " , kTH2F , {axisPtCoarse, axisNctau });
329+ histos.add (Form (" %s/hCtau " , kParticlenames [partID].data ()), " hCtau " , kTH2F , {axisPtCoarse, axisCtau });
330330 }
331331 }
332332
@@ -525,7 +525,7 @@ struct Derivedupcanalysis {
525525 histos.fill (HIST (kParticlenames [partID]) + HIST (" /hV0Radius" ), cand.v0radius ());
526526 histos.fill (HIST (kParticlenames [partID]) + HIST (" /h2dPositiveITSvsTPCpts" ), posTrackExtra.tpcCrossedRows (), posTrackExtra.itsNCls ());
527527 histos.fill (HIST (kParticlenames [partID]) + HIST (" /h2dNegativeITSvsTPCpts" ), negTrackExtra.tpcCrossedRows (), negTrackExtra.itsNCls ());
528- histos.fill (HIST (kParticlenames [partID]) + HIST (" /hNctau " ), pT, ctau);
528+ histos.fill (HIST (kParticlenames [partID]) + HIST (" /hCtau " ), pT, ctau);
529529 }
530530 if (doDetectPropQA == 1 ) {
531531 histos.fill (HIST (kParticlenames [partID]) + HIST (" /h6dDetectPropVsCentrality" ), ft0ampl, posDetMap, posITSclusMap, negDetMap, negITSclusMap, pT);
@@ -686,7 +686,7 @@ struct Derivedupcanalysis {
686686 histos.fill (HIST (kParticlenames [partID]) + HIST (" /hDCAV0Daughters" ), pT, cand.dcaV0daughters ());
687687 histos.fill (HIST (kParticlenames [partID]) + HIST (" /hDCAV0ToPV" ), pT, std::fabs (cand.dcav0topv (coll.posX (), coll.posY (), coll.posZ ())));
688688 histos.fill (HIST (kParticlenames [partID]) + HIST (" /hMassLambdaDau" ), pT, cand.mLambda ());
689- histos.fill (HIST (kParticlenames [partID]) + HIST (" /hNctau " ), pT, ctau);
689+ histos.fill (HIST (kParticlenames [partID]) + HIST (" /hCtau " ), pT, ctau);
690690 }
691691 if (PIDConfigurations.doTPCQA ) {
692692 histos.fill (HIST (kParticlenames [partID]) + HIST (" /h3dPosNsigmaTPC" ), centrality, pT, tpcNsigmaPos);
@@ -1715,6 +1715,7 @@ struct Derivedupcanalysis {
17151715 }
17161716
17171717 PresliceUnsorted<StraCollisonsFullMC> perMcCollision = aod::v0data::straMCCollisionId;
1718+ PresliceUnsorted<NeutronsMC> neutronsPerMcCollision = aod::zdcneutrons::straMCCollisionId;
17181719
17191720 std::vector<int > getListOfRecoCollIds (StraMCCollisionsFull const & mcCollisions,
17201721 StraCollisonsFullMC const & collisions,
@@ -1726,7 +1727,10 @@ struct Derivedupcanalysis {
17261727 if (std::find (generatorIds->begin (), generatorIds->end (), mcCollision.generatorsID ()) == generatorIds->end ()) {
17271728 continue ;
17281729 }
1730+
1731+ // Group collisions and neutrons by MC collision index
17291732 auto groupedCollisions = collisions.sliceBy (perMcCollision, mcCollision.globalIndex ());
1733+ auto groupedNeutrons = neutrons.sliceBy (neutronsPerMcCollision, mcCollision.globalIndex ());
17301734 // Find the collision with the biggest nbr of PV contributors
17311735 // Follows what was done here: https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/mcCollsExtra.cxx#L93
17321736 int biggestNContribs = -1 ;
@@ -1738,7 +1742,10 @@ struct Derivedupcanalysis {
17381742
17391743 int selGapSide = collision.isUPC () ? getGapSide (collision) : -1 ;
17401744 if (checkNeutronsInMC) {
1741- for (const auto & neutron : neutrons) {
1745+ for (const auto & neutron : groupedNeutrons) {
1746+ if (selGapSide < -0.5 )
1747+ break ;
1748+
17421749 if (!neutron.has_straMCCollision () || !collision.has_straMCCollision ())
17431750 continue ;
17441751
@@ -1801,8 +1808,9 @@ struct Derivedupcanalysis {
18011808
18021809 histos.fill (HIST (" eventQA/mc/hEventSelectionMC" ), 1.0 , mcCollision.multMCNParticlesEta08 (), mcCollision.generatorsID ());
18031810
1804- // Group collisions by MC collision index
1811+ // Group collisions and neutrons by MC collision index
18051812 auto groupedCollisions = collisions.sliceBy (perMcCollision, mcCollision.globalIndex ());
1813+ auto groupedNeutrons = neutrons.sliceBy (neutronsPerMcCollision, mcCollision.globalIndex ());
18061814
18071815 bool atLeastOne = false ;
18081816 float centrality = -1 .f ;
@@ -1819,7 +1827,10 @@ struct Derivedupcanalysis {
18191827
18201828 int selGapSide = collision.isUPC () ? getGapSide (collision) : -1 ;
18211829 if (checkNeutronsInMC) {
1822- for (const auto & neutron : neutrons) {
1830+ for (const auto & neutron : groupedNeutrons) {
1831+ if (selGapSide < -0.5 )
1832+ break ;
1833+
18231834 if (!neutron.has_straMCCollision () || !collision.has_straMCCollision ())
18241835 continue ;
18251836
@@ -1969,8 +1980,13 @@ struct Derivedupcanalysis {
19691980 histos.fill (HIST (" eventQA/hRawGapSide" ), collision.gapSide ());
19701981
19711982 int selGapSide = collision.isUPC () ? getGapSide (collision) : -1 ;
1983+
1984+ auto groupedNeutrons = neutrons.sliceBy (neutronsPerMcCollision, mcCollision.globalIndex ());
19721985 if (checkNeutronsInMC) {
1973- for (const auto & neutron : neutrons) {
1986+ for (const auto & neutron : groupedNeutrons) {
1987+ if (selGapSide < -0.5 )
1988+ break ;
1989+
19741990 if (!neutron.has_straMCCollision () || !collision.has_straMCCollision ())
19751991 continue ;
19761992
@@ -2086,8 +2102,13 @@ struct Derivedupcanalysis {
20862102 histos.fill (HIST (" eventQA/hRawGapSide" ), collision.gapSide ());
20872103
20882104 int selGapSide = collision.isUPC () ? getGapSide (collision) : -1 ;
2105+
2106+ auto groupedNeutrons = neutrons.sliceBy (neutronsPerMcCollision, mcCollision.globalIndex ());
20892107 if (checkNeutronsInMC) {
2090- for (const auto & neutron : neutrons) {
2108+ for (const auto & neutron : groupedNeutrons) {
2109+ if (selGapSide < -0.5 )
2110+ break ;
2111+
20912112 if (!neutron.has_straMCCollision () || !collision.has_straMCCollision ())
20922113 continue ;
20932114
0 commit comments