From 9fbe3beeaca301b8253f6ff97e8f8cab7e57c889 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 26 Aug 2024 09:59:28 +0200 Subject: [PATCH] ALICE 3: tracksExtra with silicon/TPC point counters --- ALICE3/Core/DetLayer.h | 3 + ALICE3/Core/FastTracker.cxx | 79 ++++++++++++-------- ALICE3/Core/FastTracker.h | 7 +- ALICE3/DataModel/tracksAlice3.h | 10 ++- ALICE3/TableProducer/OTF/onTheFlyTracker.cxx | 35 +++++++-- 5 files changed, 91 insertions(+), 43 deletions(-) diff --git a/ALICE3/Core/DetLayer.h b/ALICE3/Core/DetLayer.h index 7fa6aa25a53..c70901c46c8 100644 --- a/ALICE3/Core/DetLayer.h +++ b/ALICE3/Core/DetLayer.h @@ -42,6 +42,9 @@ struct DetLayer { // efficiency float eff; // detection efficiency + + // layer type + int type; // 0: undefined/inert, 1: silicon, 2: gas/tpc }; } // namespace o2::fastsim diff --git a/ALICE3/Core/FastTracker.cxx b/ALICE3/Core/FastTracker.cxx index 25acbba4af5..23ec0035eb5 100644 --- a/ALICE3/Core/FastTracker.cxx +++ b/ALICE3/Core/FastTracker.cxx @@ -30,13 +30,18 @@ FastTracker::FastTracker() applyZacceptance = false; covMatFactor = 0.99f; verboseLevel = 0; + + // last fast-tracked track properties covMatOK = 0; covMatNotOK = 0; + nIntercepts = 0; + nSiliconPoints = 0; + nGasPoints = 0; } -void FastTracker::AddLayer(TString name, float r, float z, float x0, float xrho, float resRPhi, float resZ, float eff) +void FastTracker::AddLayer(TString name, float r, float z, float x0, float xrho, float resRPhi, float resZ, float eff, int type) { - DetLayer newLayer{name.Data(), r, z, x0, xrho, resRPhi, resZ, eff}; + DetLayer newLayer{name.Data(), r, z, x0, xrho, resRPhi, resZ, eff, type}; layers.push_back(newLayer); } @@ -66,18 +71,18 @@ void FastTracker::AddSiliconALICE3v4() float resZOT = 0.0005; // 5 mum float eff = 1.00; - layers.push_back(DetLayer{"bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f}); // 150 mum Be - layers.push_back(DetLayer{"ddd0", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff}); - layers.push_back(DetLayer{"ddd1", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff}); - layers.push_back(DetLayer{"ddd2", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff}); - layers.push_back(DetLayer{"bpipe1", 5.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f}); // 500 mum Be - layers.push_back(DetLayer{"ddd3", 7., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"ddd4", 10., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"ddd5", 13., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"ddd6", 16., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"ddd7", 25., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"ddd8", 40., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"ddd9", 45., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); + layers.push_back(DetLayer{"bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0}); // 150 mum Be + layers.push_back(DetLayer{"ddd0", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1}); + layers.push_back(DetLayer{"ddd1", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1}); + layers.push_back(DetLayer{"ddd2", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1}); + layers.push_back(DetLayer{"bpipe1", 5.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0}); // 500 mum Be + layers.push_back(DetLayer{"ddd3", 7., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"ddd4", 10., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"ddd5", 13., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"ddd6", 16., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"ddd7", 25., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"ddd8", 40., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"ddd9", 45., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); } void FastTracker::AddSiliconALICE3v1() @@ -94,19 +99,19 @@ void FastTracker::AddSiliconALICE3v1() float resZOT = 0.00100; // 5 mum float eff = 1.00; - layers.push_back(DetLayer{"bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f}); // 150 mum Be - layers.push_back(DetLayer{"B00", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff}); - layers.push_back(DetLayer{"B01", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff}); - layers.push_back(DetLayer{"B02", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff}); - layers.push_back(DetLayer{"bpipe1", 3.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f}); // 500 mum Be - layers.push_back(DetLayer{"B03", 3.75, 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"B04", 7., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"B05", 12., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"B06", 20., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"B07", 30., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"B08", 45., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"B09", 60., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); - layers.push_back(DetLayer{"B10", 80., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff}); + layers.push_back(DetLayer{"bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 1}); // 150 mum Be + layers.push_back(DetLayer{"B00", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1}); + layers.push_back(DetLayer{"B01", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1}); + layers.push_back(DetLayer{"B02", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1}); + layers.push_back(DetLayer{"bpipe1", 3.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 1}); // 500 mum Be + layers.push_back(DetLayer{"B03", 3.75, 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"B04", 7., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"B05", 12., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"B06", 20., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"B07", 30., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"B08", 45., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"B09", 60., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); + layers.push_back(DetLayer{"B10", 80., 250, x0OT, xrhoOB, resRPhiOT, resZOT, eff, 1}); } void FastTracker::AddTPC(float phiResMean, float zResMean) @@ -139,7 +144,7 @@ void FastTracker::AddTPC(float phiResMean, float zResMean) // add boundaries between ITS and TPC for (int i = 0; i < kNPassiveBound; i++) { - AddLayer(Form("tpc_boundary%d", i), rBoundary[i], zLength, radLBoundary[i], xrhoBoundary[i]); // dummy errors + AddLayer(Form("tpc_boundary%d", i), rBoundary[i], zLength, radLBoundary[i], xrhoBoundary[i], 0); // dummy errors } for (Int_t k = 0; k < tpcRows; k++) { Float_t rowRadius = 0; @@ -150,7 +155,7 @@ void FastTracker::AddTPC(float phiResMean, float zResMean) else if (k >= (innerRows + middleRows) && k < tpcRows) rowRadius = row128Radius + (k - innerRows - middleRows + 1) * tpcOuterRadialPitch; - AddLayer(Form("tpc_%d", k), rowRadius, zLength, radLPerRow, 0, phiResMean, zResMean, 1.0f); + AddLayer(Form("tpc_%d", k), rowRadius, zLength, radLPerRow, 0, phiResMean, zResMean, 1.0f, 2); } } @@ -159,7 +164,9 @@ void FastTracker::AddTPC(float phiResMean, float zResMean) int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackParCov& outputTrack) { hits.clear(); - int nIntercepts = 0; + nIntercepts = 0; + nSiliconPoints = 0; + nGasPoints = 0; std::array posIni; // provision for != PV inputTrack.getXYZGlo(posIni); float initialRadius = std::hypot(posIni[0], posIni[1]); @@ -172,7 +179,7 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa // check if layer is doable if (layers[il].r < initialRadius) continue; // this layer should not be attempted, but go ahead - if (layers[il].eff < 1e-5) + if(layers[il].type==0) continue; // inert layer, skip // check if layer is reached @@ -240,6 +247,9 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa // +-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+ // Inward pass to calculate covariances for (int il = lastLayerReached; il >= firstLayerReached; il--) { + if(layers[il].type==0) + continue; // inert layer, skip + float targetX = 1e+3; inputTrack.getXatLabR(layers[il].r, targetX, magneticField); if (targetX > 999) @@ -271,9 +281,14 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa static_cast(xyz1[2])}; const o2::track::TrackParametrization::dim3_t hitpointcov = {layers[il].resRPhi * layers[il].resRPhi, 0.f, layers[il].resZ * layers[il].resZ}; outputTrack.update(hitpoint, hitpointcov); + outputTrack.checkCovariance(); + + if(layers[il].type==1) + nSiliconPoints++; // count silicon hits + if(layers[il].type==2) + nGasPoints++; // count TPC/gas hits hits.push_back(thisHit); - outputTrack.checkCovariance(); } // backpropagate to original radius diff --git a/ALICE3/Core/FastTracker.h b/ALICE3/Core/FastTracker.h index e8ee7f500e6..ecd7d19cb98 100644 --- a/ALICE3/Core/FastTracker.h +++ b/ALICE3/Core/FastTracker.h @@ -34,7 +34,7 @@ class FastTracker FastTracker(); virtual ~FastTracker() {} - void AddLayer(TString name, float r, float z, float x0, float xrho, float resRPhi = 0.0f, float resZ = 0.0f, float eff = 0.0f); + void AddLayer(TString name, float r, float z, float x0, float xrho, float resRPhi = 0.0f, float resZ = 0.0f, float eff = 0.0f, int type = 0); void AddSiliconALICE3v4(); void AddSiliconALICE3v1(); @@ -56,6 +56,11 @@ class FastTracker uint64_t covMatOK; // cov mat has negative eigenvals uint64_t covMatNotOK; // cov mat has negative eigenvals + // last track information + int nIntercepts; // found in first outward propagation + int nSiliconPoints; // silicon-based space points added to track + int nGasPoints; // tpc-based space points added to track + ClassDef(FastTracker, 1); }; diff --git a/ALICE3/DataModel/tracksAlice3.h b/ALICE3/DataModel/tracksAlice3.h index c3a3e82a994..aa32c5f607f 100644 --- a/ALICE3/DataModel/tracksAlice3.h +++ b/ALICE3/DataModel/tracksAlice3.h @@ -26,13 +26,19 @@ namespace o2::aod { namespace track_alice3 { -DECLARE_SOA_COLUMN(IsReconstructed, isReconstructed, bool); //! is reconstructed or not +DECLARE_SOA_COLUMN(IsReconstructed, isReconstructed, bool); //! is reconstructed or not +DECLARE_SOA_COLUMN(NSiliconHits, nSiliconHits, int); //! number of silicon hits +DECLARE_SOA_COLUMN(NTPCHits, nTPCHits, int); //! number of tpc hits } // namespace track_alice3 DECLARE_SOA_TABLE(TracksAlice3, "AOD", "TRACKSALICE3", track_alice3::IsReconstructed); - using TrackAlice3 = TracksAlice3::iterator; +DECLARE_SOA_TABLE(TracksExtraA3, "AOD", "TracksExtraA3", + track_alice3::NSiliconHits, + track_alice3::NTPCHits); +using TrackExtraA3 = TracksExtraA3::iterator; + } // namespace o2::aod #endif // ALICE3_DATAMODEL_TRACKSALICE3_H_ diff --git a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx index 9ee71307610..c04ad933d3c 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx @@ -77,6 +77,7 @@ struct OnTheFlyTracker { Produces tracksDCACov; Produces collisionsAlice3; Produces TracksAlice3; + Produces TracksExtraA3; Produces upgradeCascades; // optionally produced, empty (to be tuned later) @@ -162,18 +163,29 @@ struct OnTheFlyTracker { TrackAlice3() = default; ~TrackAlice3() = default; TrackAlice3(const TrackAlice3& src) = default; - TrackAlice3(const o2::track::TrackParCov& src, const int64_t label, const float t = 0, const float te = 1, bool decayDauInput = false, bool weakDecayDauInput = false, int isUsedInCascadingInput = 0) : o2::track::TrackParCov(src), - mcLabel{label}, - timeEst{t, te}, - isDecayDau(decayDauInput), - isWeakDecayDau(weakDecayDauInput), - isUsedInCascading(isUsedInCascadingInput) {} + TrackAlice3(const o2::track::TrackParCov& src, const int64_t label, + const float t = 0, + const float te = 1, + bool decayDauInput = false, + bool weakDecayDauInput = false, + int isUsedInCascadingInput = 0, + int nSiliconHitsInput = 0, + int nTPCHitsInput = 0) : o2::track::TrackParCov(src), + mcLabel{label}, + timeEst{t, te}, + isDecayDau(decayDauInput), + isWeakDecayDau(weakDecayDauInput), + isUsedInCascading(isUsedInCascadingInput), + nSiliconHits(nSiliconHitsInput), + nTPCHits(nTPCHitsInput) {} const TimeEst& getTimeMUS() const { return timeEst; } int64_t mcLabel; TimeEst timeEst; ///< time estimate in ns bool isDecayDau; bool isWeakDecayDau; int isUsedInCascading; // 0: not at all, 1: is a cascade, 2: is a bachelor, 3: is a pion, 4: is a proton + int nSiliconHits; + int nTPCHits; }; // Helper struct to pass cascade information @@ -622,7 +634,9 @@ struct OnTheFlyTracker { std::vector xiDaughterTrackParCovsPerfect(3); std::vector xiDaughterTrackParCovsTracked(3); std::vector isReco(3); - std::vector nHits(3); + std::vector nHits(3); // total + std::vector nSiliconHits(3); // silicon type + std::vector nTPCHits(3); // TPC type std::vector smearer = {mSmearer0, mSmearer1, mSmearer2, mSmearer3, mSmearer4, mSmearer5}; if (treatXi && mcParticle.pdgCode() == 3312) { histos.fill(HIST("hXiBuilding"), 0.0f); @@ -636,9 +650,14 @@ struct OnTheFlyTracker { for (int i = 0; i < 3; i++) { isReco[i] = false; + nHits[i] = 0; + nSiliconHits[i] = 0; + nTPCHits[i] = 0; if (enableSecondarySmearing) { nHits[i] = fastTracker.FastTrack(xiDaughterTrackParCovsPerfect[i], xiDaughterTrackParCovsTracked[i]); + nSiliconHits[i] = fastTracker.nSiliconPoints; + nTPCHits[i] = fastTracker.nGasPoints; if (nHits[i] >= fastTrackerSettings.minSiliconHits) { isReco[i] = true; @@ -659,7 +678,7 @@ struct OnTheFlyTracker { histos.fill(HIST("hNaNBookkeeping"), i + 1, 1.0f); } if (isReco[i]) { - tracksAlice3.push_back(TrackAlice3{xiDaughterTrackParCovsTracked[i], mcParticle.globalIndex(), t, 100.f * 1e-3, true, true, i + 2}); + tracksAlice3.push_back(TrackAlice3{xiDaughterTrackParCovsTracked[i], mcParticle.globalIndex(), t, 100.f * 1e-3, true, true, i + 2, nSiliconHits[i], nTPCHits[i]}); } else { ghostTracksAlice3.push_back(TrackAlice3{xiDaughterTrackParCovsTracked[i], mcParticle.globalIndex(), t, 100.f * 1e-3, true, true, i + 2}); }