Skip to content

Commit

Permalink
reading TOF time from matchInfo instead of clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
noferini committed May 16, 2024
1 parent 6b1a12e commit e1c2638
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ void o2::globaltracking::RecoContainer::createTracksVariadic(T creator, GTrackID
const auto& match = matchesITSTPCTRDTOF[i];
auto gidx = match.getTrackRef(); // this should be corresponding ITS-TPC-TRD track
// no need to check isUsed: by construction this ITS-TPC-TRD was not used elsewhere
const auto& tofCl = tofClusters[match.getTOFClIndex()];
float timeTOFMUS = (tofCl.getTime() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
// const auto& tofCl = tofClusters[match.getTOFClIndex()];
float timeTOFMUS = (match.getSignal() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
const float timeErr = 0.010f; // assume 10 ns error FIXME
if (creator(tracksITSTPCTRD[gidx.getIndex()], {i, currentSource}, timeTOFMUS, timeErr)) {
flagUsed(gidx); // flag used ITS-TPC-TRD tracks
Expand All @@ -170,9 +170,9 @@ void o2::globaltracking::RecoContainer::createTracksVariadic(T creator, GTrackID
}
for (unsigned i = 0; i < matchesTPCTRDTOF.size(); i++) {
const auto& match = matchesTPCTRDTOF[i];
auto gidx = match.getTrackRef(); // this should be corresponding TPC-TRD track
const auto& tofCl = tofClusters[match.getTOFClIndex()];
float timeTOFMUS = (tofCl.getTime() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
auto gidx = match.getTrackRef(); // this should be corresponding TPC-TRD track
// const auto& tofCl = tofClusters[match.getTOFClIndex()];
float timeTOFMUS = (match.getSignal() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
const float timeErr = 0.010f; // assume 10 ns error FIXME
if (creator(tracksTPCTRD[gidx.getIndex()], {i, currentSource}, timeTOFMUS, timeErr)) {
flagUsed(gidx); // flag used TPC-TRD tracks
Expand Down Expand Up @@ -223,8 +223,8 @@ void o2::globaltracking::RecoContainer::createTracksVariadic(T creator, GTrackID
continue;
}
// no need to check isUsed: by construction this ITS-TPC was not used elsewhere
const auto& tofCl = tofClusters[match.getTOFClIndex()];
float timeTOFMUS = (tofCl.getTime() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
// const auto& tofCl = tofClusters[match.getTOFClIndex()];
float timeTOFMUS = (match.getSignal() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
const float timeErr = 0.010f; // assume 10 ns error FIXME
if (creator(tracksTPCITS[gidx.getIndex()], {i, currentSource}, timeTOFMUS, timeErr)) {
flagUsed(gidx); // flag used ITS-TPC tracks
Expand Down
12 changes: 6 additions & 6 deletions DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1491,8 +1491,8 @@ void RecoContainer::getTrackTimeITSTPCTRDTOF(GTrackID gid, float& t, float& tErr
{
const auto& match = getITSTPCTRDTOFMatches()[gid];
auto gidx = match.getTrackRef(); // this should be corresponding ITS-TPC-TRD track
const auto& tofCl = getTOFClusters()[match.getTOFClIndex()];
t = (tofCl.getTime() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
// const auto& tofCl = getTOFClusters()[match.getTOFClIndex()];
t = (match.getSignal() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
tErr = 0.010f;
}

Expand All @@ -1501,8 +1501,8 @@ void RecoContainer::getTrackTimeTPCTRDTOF(GTrackID gid, float& t, float& tErr) c
{
const auto& match = getTPCTRDTOFMatches()[gid];
auto gidx = match.getTrackRef(); // this should be corresponding ITS-TPC-TRD track
const auto& tofCl = getTOFClusters()[match.getTOFClIndex()];
t = (tofCl.getTime() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
// const auto& tofCl = getTOFClusters()[match.getTOFClIndex()];
t = (match.getSignal() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
tErr = 0.010f;
}

Expand All @@ -1511,8 +1511,8 @@ void RecoContainer::getTrackTimeITSTPCTOF(GTrackID gid, float& t, float& tErr) c
{
const auto& match = getITSTPCTOFMatches()[gid];
auto gidx = match.getTrackRef(); // this should be corresponding ITS-TPC track
const auto& tofCl = getTOFClusters()[match.getTOFClIndex()];
t = (tofCl.getTime() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
// const auto& tofCl = getTOFClusters()[match.getTOFClIndex()];
t = (match.getSignal() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
tErr = 0.010f;
}

Expand Down
8 changes: 6 additions & 2 deletions Detectors/GlobalTracking/src/MatchTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,8 @@ void MatchTOF::doMatching(int sec)
LOG(debug) << "Propagated Track [" << itrk << "]: detId[" << iPropagation << "] = " << detId[iPropagation][0] << ", " << detId[iPropagation][1] << ", " << detId[iPropagation][2] << ", " << detId[iPropagation][3] << ", " << detId[iPropagation][4];
float resX = deltaPos[iPropagation][0] - (indices[4] - detId[iPropagation][4]) * Geo::XPAD + posCorr[0]; // readjusting the residuals due to the fact that the propagation fell in a pad that was not exactly the one of the cluster
float resZ = deltaPos[iPropagation][2] - (indices[3] - detId[iPropagation][3]) * Geo::ZPAD + posCorr[2]; // readjusting the residuals due to the fact that the propagation fell in a pad that was not exactly the one of the cluster
float resXor = resX;
float resZor = resZ;
float res = TMath::Sqrt(resX * resX + resZ * resZ);

if (resX < -1.25) { // distance from closest border
Expand Down Expand Up @@ -1082,7 +1084,7 @@ void MatchTOF::doMatching(int sec)
foundCluster = true;
// set event indexes (to be checked)
int eventIndexTOFCluster = mTOFClusSectIndexCache[indices[0]][itof];
mMatchedTracksPairsSec[sec].emplace_back(cacheTrk[itrk], eventIndexTOFCluster, mTOFClusWork[cacheTOF[itof]].getTime(), chi2, trkLTInt[iPropagation], mTrackGid[sec][type][cacheTrk[itrk]], type, (trefTOF.getTime() - (minTrkTime + maxTrkTime - 100E3) * 0.5) * 1E-6, trefTOF.getZ(), resX, resZ); // subracting 100 ns to max track which was artificially added
mMatchedTracksPairsSec[sec].emplace_back(cacheTrk[itrk], eventIndexTOFCluster, mTOFClusWork[cacheTOF[itof]].getTime(), chi2, trkLTInt[iPropagation], mTrackGid[sec][type][cacheTrk[itrk]], type, (trefTOF.getTime() - (minTrkTime + maxTrkTime - 100E3) * 0.5) * 1E-6, trefTOF.getZ(), resXor, resZor); // subracting 100 ns to max track which was artificially added
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setPt(pt);
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setResX(sqrt(1. / errXinv2));
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setResZ(sqrt(1. / errZinv2));
Expand Down Expand Up @@ -1438,6 +1440,8 @@ void MatchTOF::doMatchingForTPC(int sec)
} else {
resZ -= (bcClus - BCcand[ibc]) * vdriftInBC * side;
}
float resXor = resX;
float resZor = resZ;
float res = TMath::Sqrt(resX * resX + resZ * resZ);

if (resX < -1.25) { // distance from closest border
Expand Down Expand Up @@ -1475,7 +1479,7 @@ void MatchTOF::doMatchingForTPC(int sec)
// set event indexes (to be checked)

int eventIndexTOFCluster = mTOFClusSectIndexCache[indices[0]][itof];
mMatchedTracksPairsSec[sec].emplace_back(cacheTrk[itrk], eventIndexTOFCluster, mTOFClusWork[cacheTOF[itof]].getTime(), chi2, trkLTInt[ibc][iPropagation], mTrackGid[sec][trkType::UNCONS][cacheTrk[itrk]], trkType::UNCONS, trefTOF.getTime() * 1E-6 - tpctime, trefTOF.getZ(), resX, resZ); // TODO: check if this is correct!
mMatchedTracksPairsSec[sec].emplace_back(cacheTrk[itrk], eventIndexTOFCluster, mTOFClusWork[cacheTOF[itof]].getTime(), chi2, trkLTInt[ibc][iPropagation], mTrackGid[sec][trkType::UNCONS][cacheTrk[itrk]], trkType::UNCONS, trefTOF.getTime() * 1E-6 - tpctime, trefTOF.getZ(), resXor, resZor); // TODO: check if this is correct!
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setPt(pt);
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setResX(sqrt(1. / errXinv2));
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setResZ(sqrt(1. / errZinv2));
Expand Down

0 comments on commit e1c2638

Please sign in to comment.