Skip to content

Commit 1aa9886

Browse files
Add Neutrons within the ZDC acceptance in the strangeness data model (for UPC analysis)
1 parent 1daec49 commit 1aa9886

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

PWGLF/DataModel/LFStrangenessTables.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,38 @@ DECLARE_SOA_TABLE(Tracked3BodyColls, "AOD", "TRA3BODYCOLL", //! Table joinable w
17251725
using Tracked3BodyColl = Tracked3BodyColls::iterator;
17261726
using AssignedTracked3Bodys = soa::Join<aod::Tracked3Bodys, aod::Tracked3BodyColls>;
17271727
using AssignedTracked3Body = AssignedTracked3Bodys::iterator;
1728+
1729+
namespace zdcneutrons
1730+
{
1731+
// FOR DERIVED
1732+
DECLARE_SOA_INDEX_COLUMN(StraMCCollision, straMCCollision); //!
1733+
// DYNAMIC COLUMNS
1734+
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! neutron transverse momentum (GeV/c)
1735+
[](float px, float py) -> float { return RecoDecay::sqrtSumOfSquares(px, py); });
1736+
DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! neutron total momentum (GeV/c)
1737+
[](float px, float py, float pz) -> float { return RecoDecay::sqrtSumOfSquares(px, py, pz); });
1738+
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, //! neutron phi in the range [0, 2pi)
1739+
[](float px, float py) -> float { return RecoDecay::phi(px, py); });
1740+
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, //! neutron pseudorapidity
1741+
[](float px, float py, float pz) -> float { return RecoDecay::eta(std::array{px, py, pz}); });
1742+
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, //! neutron rapidity
1743+
[](float pz, float e) -> float { return std::atanh(pz/e); });
1744+
} // namespace zdcneutrons
1745+
1746+
DECLARE_SOA_TABLE(ZDCNeutrons, "AOD", "ZDCNEUTRON", //! MC properties of the neutrons within ZDC acceptance (for UPC analysis)
1747+
mcparticle::PdgCode, mcparticle::StatusCode, mcparticle::Flags,
1748+
mcparticle::Vx, mcparticle::Vy, mcparticle::Vz, mcparticle::Vt,
1749+
mcparticle::Px, mcparticle::Py, mcparticle::Pz, mcparticle::E,
1750+
// Dynamic columns for manipulating information
1751+
zdcneutrons::Pt<mcparticle::Px, mcparticle::Py>,
1752+
zdcneutrons::P<mcparticle::Px, mcparticle::Py, mcparticle::Pz>,
1753+
zdcneutrons::Phi<mcparticle::Px, mcparticle::Py>,
1754+
zdcneutrons::Eta<mcparticle::Px, mcparticle::Py, mcparticle::Pz>,
1755+
zdcneutrons::Y<mcparticle::Pz, mcparticle::E>);
1756+
1757+
DECLARE_SOA_TABLE(ZDCNeutronMCCollRefs, "AOD", "ZDCNEUTRONMCCOLLREF", //! refers MC candidate back to proper MC Collision
1758+
o2::soa::Index<>, zdcneutrons::StraMCCollisionId, o2::soa::Marker<4>);
1759+
17281760
} // namespace o2::aod
17291761

17301762
//______________________________________________________

PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx

Lines changed: 30 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::ZDCNeutronMCCollRefs> zdcNeutronsMCCollRefs; // references collisions from ZDCNeutrons
118+
114119
//__________________________________________________
115120
// Q-vectors
116121
Produces<aod::StraFT0AQVs> StraFT0AQVs; // FT0A Q-vector
@@ -1053,6 +1058,30 @@ struct strangederivedbuilder {
10531058
straOrigin(origin.dataframeID());
10541059
}
10551060

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

@@ -1076,6 +1105,7 @@ struct strangederivedbuilder {
10761105
PROCESS_SWITCH(strangederivedbuilder, processPureSimulation, "Produce pure simulated information", true);
10771106
PROCESS_SWITCH(strangederivedbuilder, processReconstructedSimulation, "Produce reco-ed simulated information", true);
10781107
PROCESS_SWITCH(strangederivedbuilder, processBinnedGenerated, "Produce binned generated information", false);
1108+
PROCESS_SWITCH(strangederivedbuilder, processSimulatedZDCNeutrons, "Produce generated neutrons (within ZDC acceptance) table for UPC analysis", false);
10791109

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

0 commit comments

Comments
 (0)