@@ -96,6 +96,9 @@ struct CascadeAnalysisLightIonsDerivedData {
9696 Configurable<bool > requireIsVertexTOFmatched{" requireIsVertexTOFmatched" , false , " require events with at least one of vertex contributors matched to TOF" };
9797 Configurable<bool > requireIsVertexTRDmatched{" requireIsVertexTRDmatched" , false , " require events with at least one of vertex contributors matched to TRD" };
9898 Configurable<bool > rejectSameBunchPileup{" rejectSameBunchPileup" , true , " reject collisions in case of pileup with another collision in the same foundBC" };
99+ Configurable<bool > applyZVtxSelOnMCPV{" applyZVtxSelOnMCPV" , false , " Apply Z-vtx cut on the PV of the generated collision?" };
100+ Configurable<bool > requireInel0{" requireInel0" , false , " Enable INEL > 0 selection" };
101+ Configurable<bool > requireInel0OnMC{" requireInel0OnMC" , false , " Enable INEL > 0 selection for MC gen events" };
99102
100103 // Track analysis Parameters
101104 Configurable<float > minITSnCls{" minITSnCls" , 4 .0f , " min number of ITS clusters" };
@@ -129,6 +132,7 @@ struct CascadeAnalysisLightIonsDerivedData {
129132 Configurable<float > minimumCascRadius{" minimumCascRadius" , 1 .1f , " Minimum Cascade Radius" };
130133 Configurable<float > v0masswindow{" v0masswindow" , 0.005 , " v0 mass window" };
131134 Configurable<float > competingmassrej{" competingmassrej" , 0.008 , " Competing mass rejection" };
135+
132136 // Axes parameters
133137 ConfigurableAxis centEstimatorHistBin{" centEstimatorHistBin" , {101 , 0 .0f , 101 .0f }, " " };
134138 ConfigurableAxis centralityBinning{" centralityBinning" , {VARIABLE_WIDTH, 0 .0f , 5 .0f , 10 .0f , 20 .0f , 30 .0f , 40 .0f , 50 .0f , 60 .0f , 70 .0f , 80 .0f , 90 .0f }, " " };
@@ -145,7 +149,7 @@ struct CascadeAnalysisLightIonsDerivedData {
145149 kNGlobal };
146150
147151 // For manual sliceBy
148- PresliceUnsorted<soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraCollLabels>> perMcCollision = aod::v0data ::straMCCollisionId;
152+ PresliceUnsorted<soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraCollLabels>> perMcCollision = aod::cascdata ::straMCCollisionId;
149153
150154 void init (InitContext const &)
151155 {
@@ -183,6 +187,7 @@ struct CascadeAnalysisLightIonsDerivedData {
183187 registryData.get <TH1>(HIST (" number_of_events_data" ))->GetXaxis ()->SetBinLabel (8 , " kIsVertexTOFmatched" );
184188 registryData.get <TH1>(HIST (" number_of_events_data" ))->GetXaxis ()->SetBinLabel (9 , " kIsVertexTRDmatched" );
185189 registryData.get <TH1>(HIST (" number_of_events_data" ))->GetXaxis ()->SetBinLabel (10 , " kNoSameBunchPileup" );
190+ registryData.get <TH1>(HIST (" number_of_events_data" ))->GetXaxis ()->SetBinLabel (11 , " kINELgr0" );
186191
187192 registryData.add (" number_of_events_data_vs_centrality" , " number of events in data vs centrality" , HistType::kTH2D , {{20 , -0 .5f , +19 .5f }, {101 , 0 .0f , 101 .0f }});
188193 registryData.get <TH2>(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (1 , " All collisions" );
@@ -195,6 +200,7 @@ struct CascadeAnalysisLightIonsDerivedData {
195200 registryData.get <TH2>(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (8 , " kIsVertexTOFmatched" );
196201 registryData.get <TH2>(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (9 , " kIsVertexTRDmatched" );
197202 registryData.get <TH2>(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (10 , " kNoSameBunchPileup" );
203+ registryData.get <TH2>(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (11 , " kINELgr0" );
198204 registryData.get <TH2>(HIST (" number_of_events_data_vs_centrality" ))->GetYaxis ()->SetTitle (" Centrality (%)" );
199205
200206 // QC Histograms
@@ -244,6 +250,7 @@ struct CascadeAnalysisLightIonsDerivedData {
244250 registryMC.get <TH1>(HIST (" number_of_events_mc_rec" ))->GetXaxis ()->SetBinLabel (8 , " kIsVertexTOFmatched" );
245251 registryMC.get <TH1>(HIST (" number_of_events_mc_rec" ))->GetXaxis ()->SetBinLabel (9 , " kIsVertexTRDmatched" );
246252 registryMC.get <TH1>(HIST (" number_of_events_mc_rec" ))->GetXaxis ()->SetBinLabel (10 , " kNoSameBunchPileup" );
253+ registryMC.get <TH1>(HIST (" number_of_events_mc_rec" ))->GetXaxis ()->SetBinLabel (11 , " kINELgr0" );
247254
248255 registryMC.add (" number_of_events_mc_rec_vs_centrality" , " number of events in mc_rec vs centrality" , HistType::kTH2D , {{20 , -0 .5f , +19 .5f }, {101 , 0 .0f , 101 .0f }});
249256 registryMC.get <TH2>(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (1 , " All collisions" );
@@ -256,6 +263,7 @@ struct CascadeAnalysisLightIonsDerivedData {
256263 registryMC.get <TH2>(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (8 , " kIsVertexTOFmatched" );
257264 registryMC.get <TH2>(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (9 , " kIsVertexTRDmatched" );
258265 registryMC.get <TH2>(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (10 , " kNoSameBunchPileup" );
266+ registryMC.get <TH2>(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (11 , " kINELgr0" );
259267 registryMC.get <TH2>(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetYaxis ()->SetTitle (" Centrality (%)" );
260268
261269 // QC Histograms
@@ -313,9 +321,11 @@ struct CascadeAnalysisLightIonsDerivedData {
313321 registryMC.add (" h2dGenOmegaPlus" , " h2dGenOmegaPlus" , HistType::kTH2D , {centAxis, ptAxis});
314322
315323 // Histograms for event loss/splitting
316- registryMC.add (" hGenEvents" , " hGenEvents" , HistType::kTH2D , {{axisNch}, {2 , -0 .5f , +1 .5f }});
324+ registryMC.add (" hGenEvents" , " hGenEvents" , HistType::kTH2D , {{axisNch}, {4 , -0 .5f , +3 .5f }});
317325 registryMC.get <TH2>(HIST (" hGenEvents" ))->GetYaxis ()->SetBinLabel (1 , " All gen. events" );
318- registryMC.get <TH2>(HIST (" hGenEvents" ))->GetYaxis ()->SetBinLabel (2 , " Gen. with at least 1 rec. events" );
326+ registryMC.get <TH2>(HIST (" hGenEvents" ))->GetYaxis ()->SetBinLabel (2 , " All gen. events in INEL > 0" );
327+ registryMC.get <TH2>(HIST (" hGenEvents" ))->GetYaxis ()->SetBinLabel (3 , " Gen. with at least 1 rec. events" );
328+ registryMC.get <TH2>(HIST (" hGenEvents" ))->GetYaxis ()->SetBinLabel (4 , " Gen. with at least 1 rec. events in INEL > 0" );
319329 registryMC.add (" hGenEventCentrality" , " hGenEventCentrality" , kTH1D , {{101 , 0 .0f , 101 .0f }});
320330
321331 registryMC.add (" hCentralityVsNcoll_beforeEvSel" , " hCentralityVsNcoll_beforeEvSel" , HistType::kTH2D , {centAxis, {50 , -0 .5f , 49 .5f }});
@@ -631,6 +641,10 @@ struct CascadeAnalysisLightIonsDerivedData {
631641 continue ;
632642 }
633643
644+ if (requireInel0 && collision.multNTracksPVeta1 () < 1 ) {
645+ continue ;
646+ }
647+
634648 // Find the collision with the biggest nbr of PV contributors
635649 // Follows what was done here: https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/mcCollsExtra.cxx#L93
636650 if (biggestNContribs < collision.multPVTotalContributors ()) {
@@ -650,11 +664,16 @@ struct CascadeAnalysisLightIonsDerivedData {
650664 std::vector<int > listBestCollisionIdx (mcCollisions.size ());
651665 for (auto const & mcCollision : mcCollisions) {
652666 // event selections
653- if (applyVtxZ && std::fabs (mcCollision.posZ ()) > zVtx)
667+ if (applyZVtxSelOnMCPV && std::fabs (mcCollision.posZ ()) > zVtx)
654668 continue ;
655669
656670 registryMC.fill (HIST (" hGenEvents" ), mcCollision.multMCNParticlesEta05 (), 0 /* all gen. events*/ );
657671
672+ if (requireInel0OnMC && mcCollision.multMCNParticlesEta10 () < 1 ) {
673+ continue ;
674+ }
675+ registryMC.fill (HIST (" hGenEvents" ), mcCollision.multMCNParticlesEta05 (), 1 /* all gen. events in INEL > 0*/ );
676+
658677 auto groupedCollisions = getGroupedCollisions (collisions, mcCollision.globalIndex ());
659678 // Check if there is at least one of the reconstructed collisions associated to this MC collision
660679 // If so, we consider it
@@ -698,6 +717,10 @@ struct CascadeAnalysisLightIonsDerivedData {
698717 continue ;
699718 }
700719
720+ if (requireInel0 && collision.multNTracksPVeta1 () < 1 ) {
721+ continue ;
722+ }
723+
701724 if (biggestNContribs < collision.multPVTotalContributors ()) {
702725 biggestNContribs = collision.multPVTotalContributors ();
703726 if (centralityEstimator == Option::kFT0C )
@@ -721,8 +744,8 @@ struct CascadeAnalysisLightIonsDerivedData {
721744 registryQC.fill (HIST (" hVertexZGen" ), mcCollision.posZ ());
722745
723746 if (atLeastOne) {
724- registryMC.fill (HIST (" hGenEvents" ), mcCollision.multMCNParticlesEta05 (), 1 /* at least 1 rec. event*/ );
725-
747+ registryMC.fill (HIST (" hGenEvents" ), mcCollision.multMCNParticlesEta05 (), 2 /* at least 1 rec. event*/ );
748+ registryMC. fill ( HIST ( " hGenEvents " ), mcCollision. multMCNParticlesEta05 (), 3 /* at least 1 rec. event in INEL > 0 */ );
726749 registryMC.fill (HIST (" hGenEventCentrality" ), centralitydata);
727750 }
728751 }
@@ -815,6 +838,12 @@ struct CascadeAnalysisLightIonsDerivedData {
815838 registryData.fill (HIST (" number_of_events_data" ), 9 /* Not at same bunch pile-up */ );
816839 registryData.fill (HIST (" number_of_events_data_vs_centrality" ), 9 , centrality);
817840
841+ if (requireInel0 && collision.multNTracksPVeta1 () < 1 ) {
842+ return ;
843+ }
844+ registryData.fill (HIST (" number_of_events_data" ), 10 /* INEL > 0 */ );
845+ registryData.fill (HIST (" number_of_events_data_vs_centrality" ), 10 , centrality);
846+
818847 // Store the Zvtx
819848 registryQC.fill (HIST (" hVertexZdata" ), collision.posZ ());
820849
@@ -959,6 +988,12 @@ struct CascadeAnalysisLightIonsDerivedData {
959988 registryMC.fill (HIST (" number_of_events_mc_rec" ), 9 /* Not at same bunch pile-up */ );
960989 registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 9 , centralityMcRec);
961990
991+ if (requireInel0 && collision.multNTracksPVeta1 () < 1 ) {
992+ continue ;
993+ }
994+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 10 /* INEL > 0 */ );
995+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 10 , centralityMcRec);
996+
962997 // Store the Zvtx
963998 registryQC.fill (HIST (" hVertexZRec" ), RecCol.posZ ());
964999
@@ -1055,17 +1090,20 @@ struct CascadeAnalysisLightIonsDerivedData {
10551090 if (!isPhysPrim)
10561091 continue ;
10571092
1058- float ptmc = RecoDecay::sqrtSumOfSquares ( cascMC.pxMC (), cascMC. pyMC () );
1093+ float ptmc = cascMC.ptMC ( );
10591094
10601095 auto mcCollision = cascMC.template straMCCollision_as <CollisionMCTrueTable>();
10611096
10621097 // event selections
1063- if (applyVtxZ && std::abs (mcCollision.posZ ()) > zVtx)
1098+ if (applyZVtxSelOnMCPV && std::abs (mcCollision.posZ ()) > zVtx)
10641099 continue ;
1065-
10661100 // Store the Zvtx
10671101 registryQC.fill (HIST (" hVertexZGen" ), mcCollision.posZ ());
10681102
1103+ if (requireInel0OnMC && mcCollision.multMCNParticlesEta10 () < 1 ) {
1104+ continue ;
1105+ }
1106+
10691107 float centralityMC = 100 .5f ;
10701108
10711109 if (listBestCollisionIdx[mcCollision.globalIndex ()] > -1 ) {
0 commit comments