Skip to content

Commit

Permalink
ALICE 3: tracksExtra with silicon/TPC point counters
Browse files Browse the repository at this point in the history
  • Loading branch information
ddobrigk committed Aug 26, 2024
1 parent c41071f commit 9fbe3be
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 43 deletions.
3 changes: 3 additions & 0 deletions ALICE3/Core/DetLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
79 changes: 47 additions & 32 deletions ALICE3/Core/FastTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}
}

Expand All @@ -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<float, 3> posIni; // provision for != PV
inputTrack.getXYZGlo(posIni);
float initialRadius = std::hypot(posIni[0], posIni[1]);
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -271,9 +281,14 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
static_cast<float>(xyz1[2])};
const o2::track::TrackParametrization<float>::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
Expand Down
7 changes: 6 additions & 1 deletion ALICE3/Core/FastTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
};

Expand Down
10 changes: 8 additions & 2 deletions ALICE3/DataModel/tracksAlice3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
35 changes: 27 additions & 8 deletions ALICE3/TableProducer/OTF/onTheFlyTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ struct OnTheFlyTracker {
Produces<aod::TracksDCACov> tracksDCACov;
Produces<aod::CollisionsAlice3> collisionsAlice3;
Produces<aod::TracksAlice3> TracksAlice3;
Produces<aod::TracksExtraA3> TracksExtraA3;
Produces<aod::UpgradeCascades> upgradeCascades;

// optionally produced, empty (to be tuned later)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -622,7 +634,9 @@ struct OnTheFlyTracker {
std::vector<o2::track::TrackParCov> xiDaughterTrackParCovsPerfect(3);
std::vector<o2::track::TrackParCov> xiDaughterTrackParCovsTracked(3);
std::vector<bool> isReco(3);
std::vector<int> nHits(3);
std::vector<int> nHits(3); // total
std::vector<int> nSiliconHits(3); // silicon type
std::vector<int> nTPCHits(3); // TPC type
std::vector<o2::delphes::DelphesO2TrackSmearer> smearer = {mSmearer0, mSmearer1, mSmearer2, mSmearer3, mSmearer4, mSmearer5};
if (treatXi && mcParticle.pdgCode() == 3312) {
histos.fill(HIST("hXiBuilding"), 0.0f);
Expand All @@ -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;
Expand All @@ -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});
}
Expand Down

0 comments on commit 9fbe3be

Please sign in to comment.