Skip to content

Commit a586772

Browse files
committed
Add centrality selection and histos for re-weighting
1 parent 4c30ac2 commit a586772

1 file changed

Lines changed: 45 additions & 6 deletions

File tree

PWGLF/TableProducer/Nuspex/coalescenceTreeProducer.cxx

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
///
2828
/// \author Alberto Calivà <alberto.caliva@cern.ch>
2929

30+
#include <Common/DataModel/Centrality.h>
3031
#include <CommonConstants/PhysicsConstants.h>
3132
#include <Framework/ASoA.h>
3233
#include <Framework/AnalysisDataModel.h>
@@ -39,6 +40,7 @@
3940
#include <Framework/Logger.h>
4041
#include <Framework/OutputObjHeader.h>
4142
#include <Framework/runDataProcessing.h>
43+
#include <PWGLF/DataModel/mcCentrality.h>
4244

4345
#include <Math/GenVector/Boost.h>
4446
#include <Math/Vector3D.h> // IWYU pragma: keep (do not replace with Math/Vector3Dfwd.h)
@@ -65,6 +67,8 @@ using namespace o2::constants::math;
6567

6668
constexpr double massHypertriton = 2.99116;
6769

70+
using GenCollisionsMc = soa::Join<aod::McCollisions, aod::McCentFT0Ms>;
71+
6872
// Lightweight particle container
6973
struct ReducedParticle {
7074
int64_t idPart = 0;
@@ -85,6 +89,8 @@ struct CoalescenceTreeProducer {
8589

8690
// Configurable analysis parameters
8791
Configurable<float> zVtxMax{"zVtxMax", 10.f, "Maximum |z vertex| in cm"};
92+
Configurable<float> multMin{"multMin", 0.f, "Lower edge of the multiplicity/centrality interval (%)"};
93+
Configurable<float> multMax{"multMax", 90.f, "Upper edge of the multiplicity/centrality interval (%)"};
8894
Configurable<float> etaMax{"etaMax", 1.5f, "Maximum |eta| for generated particles"};
8995
Configurable<float> pRhoMax{"pRhoMax", 0.5f, "Maximum Jacobi p_rho in GeV/c"};
9096
Configurable<float> pLambdaMax{"pLambdaMax", 0.5f, "Maximum Jacobi p_lambda in GeV/c"};
@@ -112,8 +118,17 @@ struct CoalescenceTreeProducer {
112118
registry.add("eventCounter", "event Counter", HistType::kTH1F, {{5, 0, 5, "counter"}});
113119
registry.get<TH1>(HIST("eventCounter"))->GetXaxis()->SetBinLabel(1, "Before z-vertex cut");
114120
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");
121+
registry.get<TH1>(HIST("eventCounter"))->GetXaxis()->SetBinLabel(3, "After multiplicity selection");
122+
registry.get<TH1>(HIST("eventCounter"))->GetXaxis()->SetBinLabel(4, "After non-empty constituent lists");
123+
registry.get<TH1>(HIST("eventCounter"))->GetXaxis()->SetBinLabel(5, "After non-empty candidate lists");
124+
125+
// Multiplicity distribution
126+
registry.add("multDistribution", "multiplicity distribution", HistType::kTH1F, {{200, 0, 100, "Multiplicity (%)"}});
127+
128+
// pt distributions of constituents (to be used for re-weighting)
129+
registry.add("ptProtons", "ptProtons", HistType::kTH1F, {{200, 0, 10, "p_{T} (GeV/c)"}});
130+
registry.add("ptNeutrons", "ptNeutrons", HistType::kTH1F, {{200, 0, 10, "p_{T} (GeV/c)"}});
131+
registry.add("ptLambdas", "ptLambdas", HistType::kTH1F, {{200, 0, 10, "p_{T} (GeV/c)"}});
117132

118133
// Output tree for bound-state candidates
119134
treeBoundState.setObject(new TTree("BoundStateTree", "Tree for coalescence"));
@@ -231,7 +246,7 @@ struct CoalescenceTreeProducer {
231246
Preslice<aod::McParticles> mcParticlesPerMcCollision = o2::aod::mcparticle::mcCollisionId;
232247

233248
// Process Hypertriton
234-
void processHypertriton(aod::McCollisions const& collisions, aod::McParticles const& mcParticles)
249+
void processHypertriton(GenCollisionsMc const& collisions, aod::McParticles const& mcParticles)
235250
{
236251
// Loop over MC collisions
237252
for (const auto& collision : collisions) {
@@ -246,7 +261,16 @@ struct CoalescenceTreeProducer {
246261
// Event counter after z-vertex cut
247262
registry.fill(HIST("eventCounter"), 1.5);
248263

249-
// To be implemented: maybe add INEL>0 selection
264+
// Multiplicity Distribution
265+
const float multiplicityPerc = collision.centFT0M();
266+
registry.fill(HIST("multDistribution"), multiplicityPerc);
267+
268+
// Multiplicity selection
269+
if (multiplicityPerc < multMin || multiplicityPerc > multMax)
270+
continue;
271+
272+
// Event counter multiplicity selection
273+
registry.fill(HIST("eventCounter"), 2.5);
250274

251275
// Get particles in this MC collision
252276
const auto mcParticlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, collision.globalIndex());
@@ -284,14 +308,29 @@ struct CoalescenceTreeProducer {
284308
if (std::abs(particle.pdgCode()) == PDG_t::kLambda0) {
285309
lambdas.push_back({particle.globalIndex(), particle.pdgCode(), particle.vx(), particle.vy(), particle.vz(), particle.vt(), particle.px(), particle.py(), particle.pz()});
286310
}
311+
312+
// Rapidity selection
313+
if (std::abs(particle.y()) > yMax)
314+
continue;
315+
316+
// Pt distributions of constituents
317+
if (std::abs(particle.pdgCode()) == PDG_t::kProton) {
318+
registry.fill(HIST("ptProtons"), particle.pt());
319+
}
320+
if (std::abs(particle.pdgCode()) == PDG_t::kNeutron) {
321+
registry.fill(HIST("ptNeutrons"), particle.pt());
322+
}
323+
if (std::abs(particle.pdgCode()) == PDG_t::kLambda0) {
324+
registry.fill(HIST("ptLambdas"), particle.pt());
325+
}
287326
} // end of loop over MC particles
288327

289328
// Reject events that do not contain at least one proton, one neutron, and one lambda
290329
if (protons.empty() || neutrons.empty() || lambdas.empty())
291330
continue;
292331

293332
// Event counter: events containing all three constituent species
294-
registry.fill(HIST("eventCounter"), 2.5);
333+
registry.fill(HIST("eventCounter"), 3.5);
295334

296335
// Count matter and antimatter candidates in the event
297336
Long64_t nCandidatesMatter(0);
@@ -321,7 +360,7 @@ struct CoalescenceTreeProducer {
321360
continue;
322361

323362
// Event counter: number of events with at least one candidate
324-
registry.fill(HIST("eventCounter"), 3.5);
363+
registry.fill(HIST("eventCounter"), 4.5);
325364

326365
// Store number of candidates per event
327366
nMatterCandidatesPerEvent = nCandidatesMatter;

0 commit comments

Comments
 (0)