Skip to content

Commit 0edf15b

Browse files
[PWGLF] Add Neutrons within the ZDC acceptance in the strangeness data model (#10907)
1 parent 328200f commit 0edf15b

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

PWGLF/DataModel/LFStrangenessTables.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,38 @@ DECLARE_SOA_TABLE(Tracked3BodyColls, "AOD", "TRA3BODYCOLL", //! Table joinable w
17621762
using Tracked3BodyColl = Tracked3BodyColls::iterator;
17631763
using AssignedTracked3Bodys = soa::Join<aod::Tracked3Bodys, aod::Tracked3BodyColls>;
17641764
using AssignedTracked3Body = AssignedTracked3Bodys::iterator;
1765+
1766+
namespace zdcneutrons
1767+
{
1768+
// FOR DERIVED
1769+
DECLARE_SOA_INDEX_COLUMN(StraMCCollision, straMCCollision); //!
1770+
// DYNAMIC COLUMNS
1771+
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! neutron transverse momentum (GeV/c)
1772+
[](float px, float py) -> float { return RecoDecay::sqrtSumOfSquares(px, py); });
1773+
DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! neutron total momentum (GeV/c)
1774+
[](float px, float py, float pz) -> float { return RecoDecay::sqrtSumOfSquares(px, py, pz); });
1775+
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, //! neutron phi in the range [0, 2pi)
1776+
[](float px, float py) -> float { return RecoDecay::phi(px, py); });
1777+
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, //! neutron pseudorapidity
1778+
[](float px, float py, float pz) -> float { return RecoDecay::eta(std::array{px, py, pz}); });
1779+
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, //! neutron rapidity
1780+
[](float pz, float e) -> float { return std::atanh(pz / e); });
1781+
} // namespace zdcneutrons
1782+
1783+
DECLARE_SOA_TABLE(ZDCNeutrons, "AOD", "ZDCNEUTRON", //! MC properties of the neutrons within ZDC acceptance (for UPC analysis)
1784+
mcparticle::PdgCode, mcparticle::StatusCode, mcparticle::Flags,
1785+
mcparticle::Vx, mcparticle::Vy, mcparticle::Vz, mcparticle::Vt,
1786+
mcparticle::Px, mcparticle::Py, mcparticle::Pz, mcparticle::E,
1787+
// Dynamic columns for manipulating information
1788+
zdcneutrons::Pt<mcparticle::Px, mcparticle::Py>,
1789+
zdcneutrons::P<mcparticle::Px, mcparticle::Py, mcparticle::Pz>,
1790+
zdcneutrons::Phi<mcparticle::Px, mcparticle::Py>,
1791+
zdcneutrons::Eta<mcparticle::Px, mcparticle::Py, mcparticle::Pz>,
1792+
zdcneutrons::Y<mcparticle::Pz, mcparticle::E>);
1793+
1794+
DECLARE_SOA_TABLE(ZDCNMCCollRefs, "AOD", "ZDCNMCCOLLREF", //! refers MC candidate back to proper MC Collision
1795+
o2::soa::Index<>, zdcneutrons::StraMCCollisionId, o2::soa::Marker<4>);
1796+
17651797
} // namespace o2::aod
17661798

17671799
//______________________________________________________

PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ struct strangederivedbuilder {
111111
Produces<aod::CascMCMothers> cascmothers; // casc mother references
112112
Produces<aod::MotherMCParts> motherMCParts; // mc particles for mothers
113113

114+
//__________________________________________________
115+
// UPC specific information
116+
Produces<aod::ZDCNeutrons> zdcNeutrons; // Primary neutrons within ZDC acceptance
117+
Produces<aod::ZDCNMCCollRefs> zdcNeutronsMCCollRefs; // references collisions from ZDCNeutrons
118+
114119
//__________________________________________________
115120
// Q-vectors
116121
Produces<aod::StraFT0AQVs> StraFT0AQVs; // FT0A Q-vector
@@ -1054,6 +1059,26 @@ struct strangederivedbuilder {
10541059
straOrigin(origin.dataframeID());
10551060
}
10561061

1062+
void processSimulatedZDCNeutrons(soa::Join<aod::McCollisions, aod::McCollsExtra, aod::MultsExtraMC> const& mcCollisions, aod::McParticles const& mcParticlesEntireTable)
1063+
{
1064+
for (const auto& mccollision : mcCollisions) {
1065+
const uint64_t mcCollIndex = mccollision.globalIndex();
1066+
auto mcParticles = mcParticlesEntireTable.sliceBy(mcParticlePerMcCollision, mcCollIndex);
1067+
1068+
for (const auto& mcPart : mcParticles) {
1069+
if (std::abs(mcPart.pdgCode()) == kNeutron) { // check if it is a neutron or anti-neutron
1070+
if (std::abs(mcPart.eta()) > 8.7) { // check if it is within ZDC acceptance
1071+
zdcNeutrons(mcPart.pdgCode(), mcPart.statusCode(), mcPart.flags(),
1072+
mcPart.vx(), mcPart.vy(), mcPart.vz(), mcPart.vt(),
1073+
mcPart.px(), mcPart.py(), mcPart.pz(), mcPart.e());
1074+
1075+
zdcNeutronsMCCollRefs(mcPart.mcCollisionId());
1076+
}
1077+
}
1078+
}
1079+
}
1080+
}
1081+
10571082
// debug processing
10581083
PROCESS_SWITCH(strangederivedbuilder, processDataframeIDs, "Produce data frame ID tags", false);
10591084

@@ -1077,6 +1102,7 @@ struct strangederivedbuilder {
10771102
PROCESS_SWITCH(strangederivedbuilder, processPureSimulation, "Produce pure simulated information", true);
10781103
PROCESS_SWITCH(strangederivedbuilder, processReconstructedSimulation, "Produce reco-ed simulated information", true);
10791104
PROCESS_SWITCH(strangederivedbuilder, processBinnedGenerated, "Produce binned generated information", false);
1105+
PROCESS_SWITCH(strangederivedbuilder, processSimulatedZDCNeutrons, "Produce generated neutrons (within ZDC acceptance) table for UPC analysis", false);
10801106

10811107
// event plane information
10821108
PROCESS_SWITCH(strangederivedbuilder, processFT0AQVectors, "Produce FT0A Q-vectors table", false);

0 commit comments

Comments
 (0)