@@ -185,12 +185,44 @@ void MatchTOF::run(const o2::globaltracking::RecoContainer& inp, unsigned long f
185185 matchingPair.setFakeMatch ();
186186 }
187187 }
188+ } else {
189+ for (auto & matchingPair : mMatchedTracksPairsSec [sec]) {
190+ int bct0 = int ((matchingPair.getSignal () - 10000 ) * Geo::BC_TIME_INPS_INV);
191+ float tof = matchingPair.getSignal () - bct0 * Geo::BC_TIME_INPS;
192+ if (abs (tof - matchingPair.getLTIntegralOut ().getTOF (2 )) < 600 ) {
193+ } else if (abs (tof - matchingPair.getLTIntegralOut ().getTOF (3 )) < 600 ) {
194+ } else if (abs (tof - matchingPair.getLTIntegralOut ().getTOF (4 )) < 600 ) {
195+ } else if (abs (tof - matchingPair.getLTIntegralOut ().getTOF (0 )) < 600 ) {
196+ } else if (abs (tof - matchingPair.getLTIntegralOut ().getTOF (1 )) < 600 ) {
197+ } else if (abs (tof - matchingPair.getLTIntegralOut ().getTOF (5 )) < 600 ) {
198+ } else if (abs (tof - matchingPair.getLTIntegralOut ().getTOF (6 )) < 600 ) {
199+ } else if (abs (tof - matchingPair.getLTIntegralOut ().getTOF (7 )) < 600 ) {
200+ } else if (abs (tof - matchingPair.getLTIntegralOut ().getTOF (8 )) < 600 ) {
201+ } else { // no pion, kaon, proton, electron, muon, deuteron, triton, 3He, 4He
202+ matchingPair.setFakeMatch ();
203+ }
204+ }
188205 }
189206 }
190207
191208 LOG (debug) << " ...done. Now check the best matches" ;
192209 nMatches[sec] = mMatchedTracksPairsSec [sec].size ();
193210 selectBestMatches (sec);
211+
212+ if (mStoreMatchable ) {
213+ for (auto & matchingPair : mMatchedTracksPairsSec [sec]) {
214+ trkType trkTypeSplitted = trkType::TPC;
215+ auto sourceID = matchingPair.getTrackRef ().getSource ();
216+ if (sourceID == o2::dataformats::GlobalTrackID::ITSTPC) {
217+ trkTypeSplitted = trkType::ITSTPC;
218+ } else if (sourceID == o2::dataformats::GlobalTrackID::TPCTRD) {
219+ trkTypeSplitted = trkType::TPCTRD;
220+ } else if (sourceID == o2::dataformats::GlobalTrackID::ITSTPCTRD) {
221+ trkTypeSplitted = trkType::ITSTPCTRD;
222+ }
223+ matchingPair.setTrackType (trkTypeSplitted);
224+ }
225+ }
194226 }
195227 std::string nMatchesStr = " Number of pairs matched per sector: " ;
196228 for (int sec = o2::constants::math::NSectors - 1 ; sec > -1 ; sec--) {
@@ -801,6 +833,7 @@ void MatchTOF::doMatching(int sec)
801833 int nStripsCrossedInPropagation = 0 ; // how many strips were hit during the propagation
802834 auto & trackWork = mTracksWork [sec][type][cacheTrk[itrk]];
803835 auto & trefTrk = trackWork.first ;
836+ float pt = trefTrk.getPt ();
804837 auto & intLT = mLTinfos [sec][type][cacheTrk[itrk]];
805838 float timeShift = intLT.getL () * 33.35641 ; // integrated time for 0.75 beta particles in ps, to take into account the t.o.f. delay with respect the interaction BC
806839 // using beta=0.75 to cover beta range [0.59 , 1.04] also for a 8 m track lenght with a 10 ns track resolution (TRD)
@@ -1003,6 +1036,7 @@ void MatchTOF::doMatching(int sec)
10031036 // set event indexes (to be checked)
10041037 int eventIndexTOFCluster = mTOFClusSectIndexCache [indices[0 ]][itof];
10051038 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
1039+ mMatchedTracksPairsSec [sec][mMatchedTracksPairsSec [sec].size () - 1 ].setPt (pt);
10061040 }
10071041 }
10081042 }
@@ -1048,6 +1082,7 @@ void MatchTOF::doMatchingForTPC(int sec)
10481082 for (int itrk = 0 ; itrk < cacheTrk.size (); itrk++) {
10491083 auto & trackWork = mTracksWork [sec][trkType::UNCONS][cacheTrk[itrk]];
10501084 auto & trefTrk = trackWork.first ;
1085+ float pt = trefTrk.getPt ();
10511086 auto & intLT = mLTinfos [sec][trkType::UNCONS][cacheTrk[itrk]];
10521087
10531088 float timeShift = intLT.getL () * 33.35641 ; // integrated time for 0.75 beta particles in ps, to take into account the t.o.f. delay with respect the interaction BC
@@ -1333,6 +1368,7 @@ void MatchTOF::doMatchingForTPC(int sec)
13331368 // set event indexes (to be checked)
13341369 int eventIndexTOFCluster = mTOFClusSectIndexCache [indices[0 ]][itof];
13351370 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!
1371+ mMatchedTracksPairsSec [sec][mMatchedTracksPairsSec [sec].size () - 1 ].setPt (pt);
13361372 }
13371373 }
13381374 }
0 commit comments