Skip to content

Commit b64ca47

Browse files
noferiniBenedikt Volkel
authored andcommitted
reading TOF time from matchInfo instead of clusters
(cherry picked from commit e952633)
1 parent 3395cb0 commit b64ca47

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ void o2::globaltracking::RecoContainer::createTracksVariadic(T creator, GTrackID
150150
const auto& match = matchesITSTPCTRDTOF[i];
151151
auto gidx = match.getTrackRef(); // this should be corresponding ITS-TPC-TRD track
152152
// no need to check isUsed: by construction this ITS-TPC-TRD was not used elsewhere
153-
const auto& tofCl = tofClusters[match.getTOFClIndex()];
154-
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
153+
// const auto& tofCl = tofClusters[match.getTOFClIndex()];
154+
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
155155
const float timeErr = 0.010f; // assume 10 ns error FIXME
156156
if (creator(tracksITSTPCTRD[gidx.getIndex()], {i, currentSource}, timeTOFMUS, timeErr)) {
157157
flagUsed(gidx); // flag used ITS-TPC-TRD tracks
@@ -170,9 +170,9 @@ void o2::globaltracking::RecoContainer::createTracksVariadic(T creator, GTrackID
170170
}
171171
for (unsigned i = 0; i < matchesTPCTRDTOF.size(); i++) {
172172
const auto& match = matchesTPCTRDTOF[i];
173-
auto gidx = match.getTrackRef(); // this should be corresponding TPC-TRD track
174-
const auto& tofCl = tofClusters[match.getTOFClIndex()];
175-
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
173+
auto gidx = match.getTrackRef(); // this should be corresponding TPC-TRD track
174+
// const auto& tofCl = tofClusters[match.getTOFClIndex()];
175+
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
176176
const float timeErr = 0.010f; // assume 10 ns error FIXME
177177
if (creator(tracksTPCTRD[gidx.getIndex()], {i, currentSource}, timeTOFMUS, timeErr)) {
178178
flagUsed(gidx); // flag used TPC-TRD tracks
@@ -223,8 +223,8 @@ void o2::globaltracking::RecoContainer::createTracksVariadic(T creator, GTrackID
223223
continue;
224224
}
225225
// no need to check isUsed: by construction this ITS-TPC was not used elsewhere
226-
const auto& tofCl = tofClusters[match.getTOFClIndex()];
227-
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
226+
// const auto& tofCl = tofClusters[match.getTOFClIndex()];
227+
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
228228
const float timeErr = 0.010f; // assume 10 ns error FIXME
229229
if (creator(tracksTPCITS[gidx.getIndex()], {i, currentSource}, timeTOFMUS, timeErr)) {
230230
flagUsed(gidx); // flag used ITS-TPC tracks

DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,8 +1491,8 @@ void RecoContainer::getTrackTimeITSTPCTRDTOF(GTrackID gid, float& t, float& tErr
14911491
{
14921492
const auto& match = getITSTPCTRDTOFMatches()[gid];
14931493
auto gidx = match.getTrackRef(); // this should be corresponding ITS-TPC-TRD track
1494-
const auto& tofCl = getTOFClusters()[match.getTOFClIndex()];
1495-
t = (tofCl.getTime() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
1494+
// const auto& tofCl = getTOFClusters()[match.getTOFClIndex()];
1495+
t = (match.getSignal() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
14961496
tErr = 0.010f;
14971497
}
14981498

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

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

Detectors/GlobalTracking/src/MatchTOF.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,8 @@ void MatchTOF::doMatching(int sec)
10471047
LOG(debug) << "Propagated Track [" << itrk << "]: detId[" << iPropagation << "] = " << detId[iPropagation][0] << ", " << detId[iPropagation][1] << ", " << detId[iPropagation][2] << ", " << detId[iPropagation][3] << ", " << detId[iPropagation][4];
10481048
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
10491049
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
1050+
float resXor = resX;
1051+
float resZor = resZ;
10501052
float res = TMath::Sqrt(resX * resX + resZ * resZ);
10511053

10521054
if (resX < -1.25) { // distance from closest border
@@ -1082,7 +1084,7 @@ void MatchTOF::doMatching(int sec)
10821084
foundCluster = true;
10831085
// set event indexes (to be checked)
10841086
int eventIndexTOFCluster = mTOFClusSectIndexCache[indices[0]][itof];
1085-
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
1087+
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
10861088
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setPt(pt);
10871089
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setResX(sqrt(1. / errXinv2));
10881090
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setResZ(sqrt(1. / errZinv2));
@@ -1438,6 +1440,8 @@ void MatchTOF::doMatchingForTPC(int sec)
14381440
} else {
14391441
resZ -= (bcClus - BCcand[ibc]) * vdriftInBC * side;
14401442
}
1443+
float resXor = resX;
1444+
float resZor = resZ;
14411445
float res = TMath::Sqrt(resX * resX + resZ * resZ);
14421446

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

14771481
int eventIndexTOFCluster = mTOFClusSectIndexCache[indices[0]][itof];
1478-
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!
1482+
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!
14791483
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setPt(pt);
14801484
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setResX(sqrt(1. / errXinv2));
14811485
mMatchedTracksPairsSec[sec][mMatchedTracksPairsSec[sec].size() - 1].setResZ(sqrt(1. / errZinv2));

0 commit comments

Comments
 (0)