2727// /
2828// / \author Alberto Calivà <alberto.caliva@cern.ch>
2929
30+ #include " PWGLF/DataModel/mcCentrality.h"
31+
32+ #include " Common/DataModel/Centrality.h"
33+
3034#include < CommonConstants/PhysicsConstants.h>
3135#include < Framework/ASoA.h>
3236#include < Framework/AnalysisDataModel.h>
@@ -65,6 +69,8 @@ using namespace o2::constants::math;
6569
6670constexpr double massHypertriton = 2.99116 ;
6771
72+ using GenCollisionsMc = soa::Join<aod::McCollisions, aod::McCentFT0Ms>;
73+
6874// Lightweight particle container
6975struct ReducedParticle {
7076 int64_t idPart = 0 ;
@@ -85,6 +91,8 @@ struct CoalescenceTreeProducer {
8591
8692 // Configurable analysis parameters
8793 Configurable<float > zVtxMax{" zVtxMax" , 10 .f , " Maximum |z vertex| in cm" };
94+ Configurable<float > multMin{" multMin" , 0 .f , " Lower edge of the multiplicity/centrality interval (%)" };
95+ Configurable<float > multMax{" multMax" , 90 .f , " Upper edge of the multiplicity/centrality interval (%)" };
8896 Configurable<float > etaMax{" etaMax" , 1 .5f , " Maximum |eta| for generated particles" };
8997 Configurable<float > pRhoMax{" pRhoMax" , 0 .5f , " Maximum Jacobi p_rho in GeV/c" };
9098 Configurable<float > pLambdaMax{" pLambdaMax" , 0 .5f , " Maximum Jacobi p_lambda in GeV/c" };
@@ -112,8 +120,17 @@ struct CoalescenceTreeProducer {
112120 registry.add (" eventCounter" , " event Counter" , HistType::kTH1F , {{5 , 0 , 5 , " counter" }});
113121 registry.get <TH1 >(HIST (" eventCounter" ))->GetXaxis ()->SetBinLabel (1 , " Before z-vertex cut" );
114122 registry.get <TH1 >(HIST (" eventCounter" ))->GetXaxis ()->SetBinLabel (2 , " After z-vertex cut" );
115- registry.get <TH1 >(HIST (" eventCounter" ))->GetXaxis ()->SetBinLabel (3 , " After non-empty constituent lists" );
116- registry.get <TH1 >(HIST (" eventCounter" ))->GetXaxis ()->SetBinLabel (4 , " After non-empty candidate lists" );
123+ registry.get <TH1 >(HIST (" eventCounter" ))->GetXaxis ()->SetBinLabel (3 , " After multiplicity selection" );
124+ registry.get <TH1 >(HIST (" eventCounter" ))->GetXaxis ()->SetBinLabel (4 , " After non-empty constituent lists" );
125+ registry.get <TH1 >(HIST (" eventCounter" ))->GetXaxis ()->SetBinLabel (5 , " After non-empty candidate lists" );
126+
127+ // Multiplicity distribution
128+ registry.add (" multDistribution" , " multiplicity distribution" , HistType::kTH1F , {{200 , 0 , 100 , " Multiplicity (%)" }});
129+
130+ // pt distributions of constituents (to be used for re-weighting)
131+ registry.add (" ptProtons" , " ptProtons" , HistType::kTH1F , {{200 , 0 , 10 , " p_{T} (GeV/c)" }});
132+ registry.add (" ptNeutrons" , " ptNeutrons" , HistType::kTH1F , {{200 , 0 , 10 , " p_{T} (GeV/c)" }});
133+ registry.add (" ptLambdas" , " ptLambdas" , HistType::kTH1F , {{200 , 0 , 10 , " p_{T} (GeV/c)" }});
117134
118135 // Output tree for bound-state candidates
119136 treeBoundState.setObject (new TTree (" BoundStateTree" , " Tree for coalescence" ));
@@ -231,7 +248,7 @@ struct CoalescenceTreeProducer {
231248 Preslice<aod::McParticles> mcParticlesPerMcCollision = o2::aod::mcparticle::mcCollisionId;
232249
233250 // Process Hypertriton
234- void processHypertriton (aod::McCollisions const & collisions, aod::McParticles const & mcParticles)
251+ void processHypertriton (GenCollisionsMc const & collisions, aod::McParticles const & mcParticles)
235252 {
236253 // Loop over MC collisions
237254 for (const auto & collision : collisions) {
@@ -246,7 +263,16 @@ struct CoalescenceTreeProducer {
246263 // Event counter after z-vertex cut
247264 registry.fill (HIST (" eventCounter" ), 1.5 );
248265
249- // To be implemented: maybe add INEL>0 selection
266+ // Multiplicity Distribution
267+ const float multiplicityPerc = collision.centFT0M ();
268+ registry.fill (HIST (" multDistribution" ), multiplicityPerc);
269+
270+ // Multiplicity selection
271+ if (multiplicityPerc < multMin || multiplicityPerc > multMax)
272+ continue ;
273+
274+ // Event counter multiplicity selection
275+ registry.fill (HIST (" eventCounter" ), 2.5 );
250276
251277 // Get particles in this MC collision
252278 const auto mcParticlesThisMcColl = mcParticles.sliceBy (mcParticlesPerMcCollision, collision.globalIndex ());
@@ -284,14 +310,29 @@ struct CoalescenceTreeProducer {
284310 if (std::abs (particle.pdgCode ()) == PDG_t::kLambda0 ) {
285311 lambdas.push_back ({particle.globalIndex (), particle.pdgCode (), particle.vx (), particle.vy (), particle.vz (), particle.vt (), particle.px (), particle.py (), particle.pz ()});
286312 }
313+
314+ // Rapidity selection
315+ if (std::abs (particle.y ()) > yMax)
316+ continue ;
317+
318+ // Pt distributions of constituents
319+ if (std::abs (particle.pdgCode ()) == PDG_t::kProton ) {
320+ registry.fill (HIST (" ptProtons" ), particle.pt ());
321+ }
322+ if (std::abs (particle.pdgCode ()) == PDG_t::kNeutron ) {
323+ registry.fill (HIST (" ptNeutrons" ), particle.pt ());
324+ }
325+ if (std::abs (particle.pdgCode ()) == PDG_t::kLambda0 ) {
326+ registry.fill (HIST (" ptLambdas" ), particle.pt ());
327+ }
287328 } // end of loop over MC particles
288329
289330 // Reject events that do not contain at least one proton, one neutron, and one lambda
290331 if (protons.empty () || neutrons.empty () || lambdas.empty ())
291332 continue ;
292333
293334 // Event counter: events containing all three constituent species
294- registry.fill (HIST (" eventCounter" ), 2 .5 );
335+ registry.fill (HIST (" eventCounter" ), 3 .5 );
295336
296337 // Count matter and antimatter candidates in the event
297338 Long64_t nCandidatesMatter (0 );
@@ -321,7 +362,7 @@ struct CoalescenceTreeProducer {
321362 continue ;
322363
323364 // Event counter: number of events with at least one candidate
324- registry.fill (HIST (" eventCounter" ), 3 .5 );
365+ registry.fill (HIST (" eventCounter" ), 4 .5 );
325366
326367 // Store number of candidates per event
327368 nMatterCandidatesPerEvent = nCandidatesMatter;
0 commit comments