Skip to content

Commit 3245c29

Browse files
authored
[ALICE3] Propagate more information from otf decayer to otf tracker (#17659)
1 parent 9fde296 commit 3245c29

4 files changed

Lines changed: 29 additions & 7 deletions

File tree

ALICE3/Core/OTFParticle.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class OTFParticle
7878
void setIndicesDaughter(const int start, const int stop) { mIndicesDaughter = {start, stop}; }
7979
void setProductionTime(const float vt) { mVt = vt; }
8080
void setFlags(uint8_t flag) { mFlag = flag; }
81+
void setDecayRadius(const float decayRadius) { mDecayRadius = decayRadius; }
8182
void setVxVyVz(const float vx, const float vy, const float vz)
8283
{
8384
mVx = vx;
@@ -123,6 +124,7 @@ class OTFParticle
123124
float pz() const { return mPz; }
124125
float e() const { return mE; }
125126
float radius() const { return std::hypot(mVx, mVy); }
127+
float decayRadius() const { return mDecayRadius; }
126128
float r() const { return radius(); }
127129
float pt() const { return std::hypot(mPx, mPy); }
128130
float p() const { return std::hypot(mPx, mPy, mPz); }
@@ -185,6 +187,7 @@ class OTFParticle
185187
int mCollisionId{-1};
186188
float mVx{}, mVy{}, mVz{}, mVt{};
187189
float mPx{}, mPy{}, mPz{}, mE{};
190+
float mDecayRadius{-1};
188191

189192
int mStatusCode{};
190193
uint8_t mFlag{};

ALICE3/DataModel/tracksAlice3.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,20 @@ using TrackExtraA3 = TracksExtraA3::iterator;
5050

5151
namespace mcparticle_alice3
5252
{
53-
DECLARE_SOA_COLUMN(NHits, nHits, int); //! number of silicon hits
54-
DECLARE_SOA_COLUMN(Charge, charge, float); //! particle charge
53+
DECLARE_SOA_COLUMN(NHits, nHits, int); //! number of silicon hits
54+
DECLARE_SOA_COLUMN(Charge, charge, float); //! particle charge
55+
DECLARE_SOA_COLUMN(DecayRadius, decayRadius, float); //! Radius for decayed particle produced by decayer (-1 if not decayed)
5556
DECLARE_SOA_BITMAP_COLUMN(DecayerBits, decayerBits, 8); //! Bit mask for particle produced by the OTF decayer
5657
} // namespace mcparticle_alice3
5758
DECLARE_SOA_TABLE(MCParticlesExtraA3, "AOD", "MCParticlesExtraA3",
5859
mcparticle_alice3::NHits,
5960
mcparticle_alice3::Charge);
6061
using MCParticleExtraA3 = MCParticlesExtraA3::iterator;
6162

62-
DECLARE_SOA_TABLE(OTFDecayerBits, "AOD", "OTFDecayerBits", mcparticle_alice3::DecayerBits);
63+
DECLARE_SOA_TABLE(OTFParticleExtras, "AOD", "OTFPARTICLEEXTRA",
64+
mcparticle_alice3::DecayerBits,
65+
mcparticle_alice3::DecayRadius);
66+
using OTFParticleExtra = OTFParticleExtras::iterator;
6367

6468
} // namespace o2::aod
6569

ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ O2ORIGIN("TMP");
8888
struct OnTheFlyDecayer {
8989
Produces<aod::McCollisions_001> tableMcCollisions;
9090
Produces<aod::StoredMcParticles_001> tableMcParticles;
91-
Produces<aod::OTFDecayerBits> tableOTFDecayerBits;
91+
Produces<aod::OTFParticleExtras> tableOTFParticleExtras;
9292

9393
o2::upgrade::Decayer decayer;
9494
Service<o2::framework::O2DatabasePDG> pdgDB{};
@@ -172,6 +172,7 @@ struct OnTheFlyDecayer {
172172
trackLength = o2::upgrade::computeTrackLength(o2track, decayRadius, magneticField);
173173
}
174174

175+
particle.setDecayRadius(std::hypot(decayer.getSecondaryVertexX(), decayer.getSecondaryVertexY()));
175176
const float trackTimeNS = trackLength / trackVelocity * PicoToNano;
176177
particle.setIndicesDaughter(particlesInDataframe - indexOffset + allParticles.size(), particlesInDataframe - indexOffset + allParticles.size() + (decayStack.size() - 1));
177178
for (auto& daughter : decayStack) {
@@ -220,7 +221,7 @@ struct OnTheFlyDecayer {
220221
histos.fill(HIST("hNaNBookkeeping"), 0);
221222
}
222223

223-
tableOTFDecayerBits(otfParticle.getBitsValue());
224+
tableOTFParticleExtras(otfParticle.getBitsValue(), otfParticle.decayRadius());
224225
tableMcParticles(tableMcCollisions.lastIndex(), otfParticle.pdgCode(), otfParticle.statusCode(), otfParticle.flags(),
225226
otfParticle.getMotherSpan(), otfParticle.getDaughters().data(), otfParticle.weight(),
226227
otfParticle.px(), otfParticle.py(), otfParticle.pz(), otfParticle.e(),

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,14 @@ struct OnTheFlyTracker {
619619
insertHist(histPath + "h2dSecondaryKaPtRes", "h2dSecondaryKaPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}", kTH2D, {{axes.axisMomentum, axes.axisPtRes}});
620620
insertHist(histPath + "h2dPrimaryPrPtRes", "h2dPrimaryPrPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}", kTH2D, {{axes.axisMomentum, axes.axisPtRes}});
621621
insertHist(histPath + "h2dSecondaryPrPtRes", "h2dSecondaryPrPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}", kTH2D, {{axes.axisMomentum, axes.axisPtRes}});
622+
623+
if (fastPrimaryTrackerSettings.fastTrackShortLivedParticles) {
624+
insertHist(histPath + "h2dGenShortLivedParticleRadius", "h2dGenShortLivedParticleRadius;Radius (cm);Momentum p_{T}", kTH2D, {{axes.axisDecayRadius, axes.axisMomentum}});
625+
insertHist(histPath + "h2dRecShortLivedParticleRadius", "h2dRecShortLivedParticleRadius;Radius (cm);Momentum p_{T}", kTH2D, {{axes.axisDecayRadius, axes.axisMomentum}});
626+
insertHist(histPath + "h2dGenRadiusIniVsDecay", "h2dGenRadiusIniVsDecay;Radius (cm);Radius (cm)", kTH2D, {{axes.axisDecayRadius, axes.axisDecayRadius}});
627+
insertHist(histPath + "h2dRecRadiusIniVsDecay", "h2dRecRadiusIniVsDecay;Radius (cm);Radius (cm)", kTH2D, {{axes.axisDecayRadius, axes.axisDecayRadius}});
628+
insertHist(histPath + "h2dDecayRadiusVsNhits", "h2dDecayRadiusVsNhits;Radius (cm);Nhits", kTH2D, {{axes.axisDecayRadius, {20, 0.5, 20}}});
629+
}
622630
}
623631

624632
} // end config loop
@@ -2151,11 +2159,17 @@ struct OnTheFlyTracker {
21512159
o2::upgrade::convertMCParticleToO2Track(mcParticle, perfectTrackParCov, pdgDB);
21522160
perfectTrackParCov.setPID(pdgCodeToPID(mcParticle.pdgCode()));
21532161
computeBremsstrahlungLoss(icfg, mcParticle, perfectTrackParCov);
2154-
nTrkHits = fastTracker[icfg]->FastTrack(perfectTrackParCov, trackParCov, dNdEta);
2162+
nTrkHits = fastTracker[icfg]->FastTrack(perfectTrackParCov, trackParCov, dNdEta, mcParticle.decayRadius());
2163+
getHist<TH2>(histPath + "h2dGenShortLivedParticleRadius")->Fill(mcParticle.decayRadius(), perfectTrackParCov.getPt());
2164+
getHist<TH2>(histPath + "h2dGenRadiusIniVsDecay")->Fill(std::hypot(perfectTrackParCov.getX(), perfectTrackParCov.getY()), mcParticle.decayRadius());
21552165
if (nTrkHits < fastPrimaryTrackerSettings.minSiliconHits) {
21562166
reconstructed = false;
21572167
} else {
21582168
reconstructed = true;
2169+
getHist<TH2>(histPath + "h2dRecShortLivedParticleRadius")->Fill(mcParticle.decayRadius(), perfectTrackParCov.getPt());
2170+
getHist<TH2>(histPath + "h2dRecRadiusIniVsDecay")->Fill(std::hypot(perfectTrackParCov.getX(), perfectTrackParCov.getY()), mcParticle.decayRadius());
2171+
getHist<TH2>(histPath + "h2dDecayRadiusVsNhits")->Fill(mcParticle.decayRadius(), nTrkHits);
2172+
LOG(info) << mcParticle.decayRadius();
21592173
}
21602174
} else if (enableSecondarySmearing && isSecondary) {
21612175
o2::track::TrackParCov perfectTrackParCov;
@@ -2259,7 +2273,7 @@ struct OnTheFlyTracker {
22592273
fillTracksInfo(ghostTracksAlice3, primaryVertex, icfg);
22602274
}
22612275

2262-
void processDecayer(aod::McCollision const& mcCollision, soa::Join<aod::McParticles, aod::OTFDecayerBits> const& mcParticles)
2276+
void processDecayer(aod::McCollision const& mcCollision, soa::Join<aod::McParticles, aod::OTFParticleExtras> const& mcParticles)
22632277
{
22642278
for (size_t icfg = 0; icfg < mSmearer.size(); ++icfg) {
22652279
processConfigurationDev(mcCollision, mcParticles, static_cast<int>(icfg));

0 commit comments

Comments
 (0)