Skip to content

Commit 3c91d2c

Browse files
authored
[ALICE3] Add inner- and outermost hit information to alice 3 tracks (#18260)
1 parent faf54fe commit 3c91d2c

9 files changed

Lines changed: 80 additions & 34 deletions

File tree

‎ALICE3/Core/DetLayer.h‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,25 +108,25 @@ struct DetLayer {
108108
TString mName;
109109

110110
// position variables
111-
float mR; // radius in centimeters
112-
float mZ; // mZ dimension in centimeters
111+
float mR{}; // radius in centimeters
112+
float mZ{}; // mZ dimension in centimeters
113113

114114
// material variables
115-
float mX0; // radiation length
116-
float mXrho; // density
115+
float mX0{}; // radiation length
116+
float mXrho{}; // density
117117

118118
// resolution variables for active layers
119-
float mResRPhi; // RPhi resolution in centimeters
120-
float mResZ; // Z resolution in centimeters
119+
float mResRPhi{}; // RPhi resolution in centimeters
120+
float mResZ{}; // Z resolution in centimeters
121121

122122
// efficiency
123-
float mEff; // detection efficiency
123+
float mEff{1.f}; // detection efficiency
124124

125125
// dead regions in phi (in radians)
126126
TGraph* mDeadPhiRegions = nullptr;
127127

128128
// layer type
129-
int mType; // 0: undefined/inert, 1: silicon, 2: gas/tpc
129+
int mType{0}; // 0: undefined/inert, 1: silicon, 2: gas/tpc
130130
};
131131

132132
} // namespace o2::fastsim

‎ALICE3/Core/FastTracker.cxx‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ int FastTracker::fastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
312312
nIntercepts = 0;
313313
nSiliconPoints = 0;
314314
nGasPoints = 0;
315+
trackIU = -1.f;
316+
trackOU = -1.f;
315317
std::array<float, 3> posIni{}; // provision for != PV
316318
inputTrack.getXYZGlo(posIni);
317319
const float initialRadius = std::hypot(posIni[0], posIni[1]);
@@ -416,6 +418,9 @@ int FastTracker::fastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
416418
firstLayerReached = il;
417419
}
418420
lastLayerReached = il;
421+
if (layers[il].isTOF()) {
422+
continue; // TOF layers are not used for tracking, but are kept in range for the innermost/outermost update
423+
}
419424
nIntercepts++;
420425
}
421426

@@ -475,7 +480,7 @@ int FastTracker::fastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
475480
continue;
476481
}
477482

478-
if (!layers[il].isInert()) { // only update covm for tracker hits
483+
if (!layers[il].isInert() && !layers[il].isTOF()) { // only update covm for tracker hits
479484
const o2::track::TrackParametrization<float>::dim2_t hitpoint = {xyz1[1], xyz1[2]};
480485
const o2::track::TrackParametrization<float>::dim3_t hitpointcov = {layers[il].getResolutionRPhi() * layers[il].getResolutionRPhi(), 0.f, layers[il].getResolutionZ() * layers[il].getResolutionZ()};
481486

@@ -510,7 +515,14 @@ int FastTracker::fastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
510515
}
511516

512517
hits.push_back(thisHit);
513-
if (!layers[il].isInert()) { // good hit probability calculation
518+
if (!layers[il].isInert()) {
519+
trackIU = std::hypot(spacePoint[0], spacePoint[1]);
520+
if (trackOU < 0.f) {
521+
trackOU = trackIU;
522+
}
523+
}
524+
525+
if (!layers[il].isInert() && !layers[il].isTOF()) { // good hit probability calculation
514526
float sigYCmb = o2::math_utils::sqrt(inwardTrack.getSigmaY2() + layers[il].getResolutionRPhi() * layers[il].getResolutionRPhi());
515527
float sigZCmb = o2::math_utils::sqrt(inwardTrack.getSigmaZ2() + layers[il].getResolutionZ() * layers[il].getResolutionZ());
516528
goodHitProbability[il] = probGoodChiSqHit(layers[il].getRadius() * 100, sigYCmb * 100, sigZCmb * 100);

‎ALICE3/Core/FastTracker.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class FastTracker
5858
/// \param phiEnd End angle of the dead region (in radians)
5959
void addDeadPhiRegionInLayer(const std::string& layerName, float phiStart, float phiEnd);
6060
[[nodiscard]] DetLayer getLayer(const int layer) const { return layers[layer]; }
61-
[[nodiscard]] std::vector<DetLayer> getLayers() const { return layers; }
61+
[[nodiscard]] const std::vector<DetLayer>& getLayers() const { return layers; }
6262
[[nodiscard]] int getLayerIndex(const std::string& name) const;
6363
[[nodiscard]] size_t getNLayers() const { return layers.size(); }
6464
[[nodiscard]] bool isLayerInert(const int layer) const { return layers[layer].isInert(); }
@@ -127,6 +127,8 @@ class FastTracker
127127
[[nodiscard]] int getNIntercepts() const { return nIntercepts; }
128128
[[nodiscard]] int getNSiliconPoints() const { return nSiliconPoints; }
129129
[[nodiscard]] int getNGasPoints() const { return nGasPoints; }
130+
[[nodiscard]] float getTrackIU() const { return trackIU; }
131+
[[nodiscard]] float getTrackOU() const { return trackOU; }
130132
[[nodiscard]] float getGoodHitProb(int layer) const
131133
{
132134
return (layer >= 0 && static_cast<size_t>(layer) < goodHitProbability.size()) ? goodHitProbability[layer] : 0.0f;
@@ -172,6 +174,8 @@ class FastTracker
172174
int nIntercepts = 0; /// found in first outward propagation
173175
int nSiliconPoints = 0; /// silicon-based space points added to track
174176
int nGasPoints = 0; /// tpc-based space points added to track
177+
float trackIU = -1.f; /// innermost update: radius of the innermost active-layer hit added to track
178+
float trackOU = -1.f; /// outermost update: radius of the outermost active-layer hit added to track
175179
std::vector<float> goodHitProbability;
176180

177181
ClassDef(FastTracker, 1);

‎ALICE3/Core/GeometryContainer.cxx‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "Common/Core/TableHelper.h"
2121

22-
#include <CCDB/BasicCCDBManager.h>
2322
#include <Framework/InitContext.h>
2423
#include <Framework/Logger.h>
2524

@@ -41,15 +40,15 @@ void GeometryContainer::init(o2::framework::InitContext& initContext)
4140
}
4241
LOG(info) << "Size of detector configuration: " << detectorConfiguration.size();
4342

44-
bool cleanLutWhenLoaded;
45-
const bool foundCleanLutWhenLoaded = common::core::getTaskOptionValue(initContext, "on-the-fly-detector-geometry-provider", "cleanLutWhenLoaded", cleanLutWhenLoaded, false);
43+
bool cleanLut;
44+
const bool foundCleanLutWhenLoaded = common::core::getTaskOptionValue(initContext, "on-the-fly-detector-geometry-provider", "cleanLutWhenLoaded", cleanLut, false);
4645
if (!foundCleanLutWhenLoaded) {
4746
LOG(fatal) << "Could not retrieve foundCleanLutWhenLoaded option from OnTheFlyDetectorGeometryProvider task.";
4847
return;
4948
}
50-
setLutCleanupSetting(cleanLutWhenLoaded);
49+
setLutCleanupSetting(cleanLut);
5150

52-
for (std::string& configFile : detectorConfiguration) {
51+
for (const std::string& configFile : detectorConfiguration) {
5352
LOG(info) << "Detector geometry configuration file used: " << configFile;
5453
addEntry(configFile);
5554
}

‎ALICE3/Core/GeometryContainer.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ struct GeometryEntry {
3636
// Default constructor
3737
GeometryEntry() = default;
3838
explicit GeometryEntry(const std::string& filename, o2::ccdb::BasicCCDBManager* ccdb = nullptr)
39+
: mFileName(ConfigurationParser::accessFile(filename, "./.ALICE3/Configuration/", ccdb))
3940
{
40-
mFileName = ConfigurationParser::accessFile(filename, "./.ALICE3/Configuration/", ccdb);
4141
mConfigurations = ConfigurationParser::parseTEnvConfiguration(mFileName, mLayerNames);
4242
LOG(info) << "Loaded geometry configuration from file: " << mFileName << " with " << mLayerNames.size() << " layers.";
4343
if (mLayerNames.empty()) {
4444
LOG(warning) << "No layers found in geometry configuration file: " << filename;
4545
}
4646
}
4747

48-
std::map<std::string, std::map<std::string, std::string>> getConfigurations() const { return mConfigurations; }
48+
const std::map<std::string, std::map<std::string, std::string>>& getConfigurations() const { return mConfigurations; }
4949
std::map<std::string, std::string> getConfiguration(const std::string& layerName) const;
50-
std::vector<std::string> getLayerNames() const { return mLayerNames; }
50+
const std::vector<std::string>& getLayerNames() const { return mLayerNames; }
5151
bool hasValue(const std::string& layerName, const std::string& key) const;
5252
std::string getValue(const std::string& layerName, const std::string& key, bool require = true) const;
5353
void setValue(const std::string& layerName, const std::string& key, const std::string& value) { mConfigurations[layerName][key] = value; }

‎ALICE3/DataModel/tracksAlice3.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ DECLARE_SOA_COLUMN(NTPCHits, nTPCHits, int); //! number of tpc hi
3232
DECLARE_SOA_COLUMN(PdgCode, pdgCode, int); //! PDG code of the linked truth MC particle
3333
DECLARE_SOA_COLUMN(TrackType, trackType, int); //! Type of the track
3434
DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //! Has track contributed to the PV fit?
35+
DECLARE_SOA_COLUMN(TrackIU, trackIU, float); //! Innermost update: radius (cm) of the innermost hit assigned to the track
36+
DECLARE_SOA_COLUMN(TrackOU, trackOU, float); //! Outermost update: radius (cm) of the outermost hit assigned to the track
3537
} // namespace track_alice3
3638
DECLARE_SOA_TABLE(TracksAlice3, "AOD", "TRACKSALICE3",
37-
track_alice3::IsReconstructed);
39+
track_alice3::IsReconstructed,
40+
track_alice3::TrackIU,
41+
track_alice3::TrackOU);
3842
using TrackAlice3 = TracksAlice3::iterator;
3943

4044
DECLARE_SOA_TABLE(TracksAlice3Pdg, "AOD", "TRACKSALICE3PDG",

‎ALICE3/Macros/Configuration/a3geometry_v3.ini‎

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,6 @@ B05.resZ: 0.001
9292
B05.eff: 1.00
9393
B05.type: 1
9494

95-
iTOF.r: 19
96-
iTOF.z: 250
97-
iTOF.x0: 0.01*3.
98-
iTOF.xrho: 0.03
99-
iTOF.resRPhi: 0.001
100-
iTOF.resZ: 0.001
101-
iTOF.eff: 1.00
102-
iTOF.type: 0
103-
10495
B06.r: 20.
10596
B06.z: 250
10697
B06.x0: 0.01
@@ -110,6 +101,15 @@ B06.resZ: 0.001
110101
B06.eff: 1.00
111102
B06.type: 1
112103

104+
iTOF.r: 21
105+
iTOF.z: 250
106+
iTOF.x0: 0.01*3.
107+
iTOF.xrho: 0.03
108+
iTOF.resRPhi: 0.001
109+
iTOF.resZ: 0.001
110+
iTOF.eff: 1.00
111+
iTOF.type: 3
112+
113113
B07.r: 30.
114114
B07.z: 250
115115
B07.x0: 0.01
@@ -146,6 +146,15 @@ B10.resZ: 0.001
146146
B10.eff: 1.00
147147
B10.type: 1
148148

149+
oTOF.r: 92
150+
oTOF.z: 250
151+
oTOF.x0: 0.01*3.
152+
oTOF.xrho: 0.03
153+
oTOF.resRPhi: 0.001
154+
oTOF.resZ: 0.001
155+
oTOF.eff: 1.00
156+
oTOF.type: 3
157+
149158
# Lookup tables
150159
global.lutEl: ccdb:/Users/j/jekarlss/LUTs/v3/b/el
151160
global.lutMu: ccdb:/Users/j/jekarlss/LUTs/v3/b/mu

‎ALICE3/TableProducer/OTF/onTheFlyTracker.cxx‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ struct OnTheFlyTracker {
299299
int nSiliconHits = 0; ///< number of silicon hits
300300
int nTPCHits = 0; ///< number of TPC hits
301301
TrackType trackType = TrackType::kNone;
302+
float trackIU = -1.f; ///< radius of the innermost hit (-1 if not available)
303+
float trackOU = -1.f; ///< radius of the outermost hit (-1 if not available)
302304
};
303305

304306
// Helper struct to pass cascade information
@@ -1828,7 +1830,7 @@ struct OnTheFlyTracker {
18281830
tableTrackSelection(static_cast<uint8_t>(0), false, false, false, false, false, false);
18291831
tableTrackSelectionExtension(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
18301832
}
1831-
tableTracksAlice3(true);
1833+
tableTracksAlice3(true, trackParCov.trackIU, trackParCov.trackOU);
18321834
}
18331835
}
18341836

@@ -1949,12 +1951,14 @@ struct OnTheFlyTracker {
19491951

19501952
bool reconstructed = true;
19511953
int nTrkHits = 0;
1954+
std::array<float, 2> hitRadii = {-1.f, -1.f}; // {innermost, outermost}
19521955
if (enablePrimarySmearing) {
19531956
if (fastPrimaryTrackerSettings.fastTrackPrimaries && longLivedToBeHandled) {
19541957
o2::track::TrackParCov perfectTrackParCov = o2::upgrade::convertMCParticleToO2Track(mcParticle, pdgDB);
19551958
perfectTrackParCov.setPID(pdgCodeToPID(mcParticle.pdgCode()));
19561959
computeBremsstrahlungLoss(mcParticle, perfectTrackParCov);
19571960
nTrkHits = fastTracker[icfg]->fastTrack(perfectTrackParCov, trackParCov, dNdEta);
1961+
hitRadii = {fastTracker[icfg]->getTrackIU(), fastTracker[icfg]->getTrackOU()};
19581962
if (nTrkHits < fastPrimaryTrackerSettings.minSiliconHits) {
19591963
reconstructed = false;
19601964
}
@@ -1965,6 +1969,7 @@ struct OnTheFlyTracker {
19651969
const std::array<float, 3> decayVtx = decayer.generateDecayVertex(mcParticle, pdgDB);
19661970
const float decayRadius2D = std::hypot(decayVtx[0], decayVtx[1]);
19671971
nTrkHits = fastTracker[icfg]->fastTrack(perfectTrackParCov, trackParCov, dNdEta, decayRadius2D);
1972+
hitRadii = {fastTracker[icfg]->getTrackIU(), fastTracker[icfg]->getTrackOU()};
19681973
if (nTrkHits < fastPrimaryTrackerSettings.minSiliconHits) {
19691974
reconstructed = false;
19701975
}
@@ -2033,8 +2038,12 @@ struct OnTheFlyTracker {
20332038
bool isPVContributor = trackType == TrackType::kRecoPrimary;
20342039
if (reconstructed) {
20352040
recoPrimaries.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), trackTime, TimeResolutionUs, isDecayDaughter, isPVContributor, false, 0, nTrkHits, trackType});
2041+
recoPrimaries.back().trackIU = hitRadii[0];
2042+
recoPrimaries.back().trackOU = hitRadii[1];
20362043
} else {
20372044
ghostPrimaries.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), trackTime, TimeResolutionUs, isDecayDaughter, isPVContributor, false, 0, nTrkHits, trackType});
2045+
ghostPrimaries.back().trackIU = hitRadii[0];
2046+
ghostPrimaries.back().trackOU = hitRadii[1];
20382047
}
20392048
}
20402049

@@ -2176,6 +2185,7 @@ struct OnTheFlyTracker {
21762185

21772186
bool reconstructed = false;
21782187
int nTrkHits = 0;
2188+
std::array<float, 2> hitRadii = {-1.f, -1.f}; // {innermost, outermost}
21792189
const bool isSecondary = !otfParticle.isPrimary() && otfParticle.checkBit(o2::upgrade::DecayerBits::ProducedByDecayer) && otfParticle.isAlive();
21802190
if (enablePrimarySmearing && longLivedToBeHandled && otfParticle.isPrimary()) {
21812191
o2::upgrade::convertMCParticleToO2Track(mcParticle, trackParCov, pdgDB);
@@ -2186,6 +2196,7 @@ struct OnTheFlyTracker {
21862196
perfectTrackParCov.setPID(pdgCodeToPID(mcParticle.pdgCode()));
21872197
computeBremsstrahlungLoss(mcParticle, perfectTrackParCov);
21882198
nTrkHits = fastTracker[icfg]->fastTrack(perfectTrackParCov, trackParCov, dNdEta, mcParticle.decayRadius());
2199+
hitRadii = {fastTracker[icfg]->getTrackIU(), fastTracker[icfg]->getTrackOU()};
21892200
getHist<TH2>(histPath + "h2dGenShortLivedParticleRadius")->Fill(mcParticle.decayRadius(), perfectTrackParCov.getPt());
21902201
getHist<TH2>(histPath + "h2dGenRadiusIniVsDecay")->Fill(std::hypot(perfectTrackParCov.getX(), perfectTrackParCov.getY()), mcParticle.decayRadius());
21912202
if (nTrkHits < fastPrimaryTrackerSettings.minSiliconHits) {
@@ -2203,6 +2214,7 @@ struct OnTheFlyTracker {
22032214
computeBremsstrahlungLoss(mcParticle, perfectTrackParCov);
22042215
perfectTrackParCov.setPID(pdgCodeToPID(mcParticle.pdgCode()));
22052216
nTrkHits = fastTracker[icfg]->fastTrack(perfectTrackParCov, trackParCov, dNdEta);
2217+
hitRadii = {fastTracker[icfg]->getTrackIU(), fastTracker[icfg]->getTrackOU()};
22062218
reconstructed = nTrkHits >= fastTrackerSettings.minSiliconHits;
22072219
}
22082220

@@ -2260,9 +2272,13 @@ struct OnTheFlyTracker {
22602272

22612273
if (reconstructed) {
22622274
tracksAlice3.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), time, TimeResolutionUs, isSecondary, true, false, 0, nTrkHits, kRecoPrimary});
2275+
tracksAlice3.back().trackIU = hitRadii[0];
2276+
tracksAlice3.back().trackOU = hitRadii[1];
22632277
getHist<TH1>(histPath + "hPtReconstructedPr")->Fill(trackParCov.getPt());
22642278
} else {
22652279
ghostTracksAlice3.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), time, TimeResolutionUs, isSecondary, false, false, false, 0, nTrkHits, kGhostPrimary});
2280+
ghostTracksAlice3.back().trackIU = hitRadii[0];
2281+
ghostTracksAlice3.back().trackOU = hitRadii[1];
22662282
}
22672283
}
22682284

‎ALICE3/TableProducer/alice3TrackingTranslator.cxx‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ struct Alice3TrackingTranslator {
419419
// Convert tracks from ACTS to ALICE format
420420
const size_t nParticlesSim = fileParticlesSim.m_vx->size();
421421
const size_t nTracks = fileTracksummary.m_ePX_fit->size();
422-
std::vector<size_t> idMCparticles;
422+
// std::vector<size_t> idMCparticles; // fixme: unused
423423

424424
// local index k within this event -> global AO2D index
425425
int firstIdxThisEvent = tableStoredMcParticles.lastIndex() + 1;
@@ -438,7 +438,7 @@ struct Alice3TrackingTranslator {
438438
fileParticlesSim.m_particle->at(iPart),
439439
fileParticlesSim.m_generation->at(iPart),
440440
fileParticlesSim.m_sub_particle->at(iPart));
441-
barcodeToGlobalIdx[key] = firstIdxThisEvent + (int)iPart;
441+
barcodeToGlobalIdx[key] = firstIdxThisEvent + static_cast<int>(iPart);
442442

443443
if (iPart == 0) {
444444
tableMcCollisions(0, // mccollision::BCId,
@@ -486,7 +486,7 @@ struct Alice3TrackingTranslator {
486486
}
487487
}
488488
for (size_t iPart = 0; iPart < nParticlesSim; ++iPart) {
489-
int globalIdx = firstIdxThisEvent + (int)iPart;
489+
int globalIdx = firstIdxThisEvent + static_cast<int>(iPart);
490490
int motherIdx = -1;
491491
if (GlobalIdxToMotherIdx.find(globalIdx) != GlobalIdxToMotherIdx.end()) {
492492
motherIdx = GlobalIdxToMotherIdx[globalIdx];
@@ -666,7 +666,9 @@ struct Alice3TrackingTranslator {
666666
tableTracksDCACov(0.0f, // sigmaDcaXY2
667667
0.0f); // sigmaDcaZ2
668668
// Fill ALICE3 specific tables
669-
tableTracksAlice3(true); // isReconstructed
669+
tableTracksAlice3(true, // isReconstructed
670+
-1.f, // todo: track innermost update
671+
-1.f); // todo: track outermost update
670672
if (mcParticleIdx > 0)
671673
tableTracksAlice3Pdg(GlobalIdxToPDGCode[mcParticleIdx]); // PdgCode to the linked MC truth particle
672674
else

0 commit comments

Comments
 (0)