@@ -1581,6 +1581,8 @@ void MatchTOF::doMatchingForTPC(int sec)
15811581// ______________________________________________
15821582int MatchTOF::findFITIndex (int bc, const gsl::span<const o2::ft0::RecPoints>& FITRecPoints, unsigned long firstOrbit)
15831583{
1584+ const auto & FT0Params = o2::ft0::InteractionTag::Instance ();
1585+
15841586 if ((!mHasFillScheme ) && o2::tof::Utils::hasFillScheme ()) {
15851587 mHasFillScheme = true ;
15861588 for (int ibc = 0 ; ibc < o2::tof::Utils::getNinteractionBC (); ibc++) {
@@ -1598,6 +1600,10 @@ int MatchTOF::findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FI
15981600 const int distThr = 8 ;
15991601
16001602 for (unsigned int i = 0 ; i < FITRecPoints.size (); i++) {
1603+ const auto & ft = FITRecPoints[i];
1604+ if (!FT0Params.isSelected (ft)) {
1605+ continue ;
1606+ }
16011607 const o2::InteractionRecord ir = FITRecPoints[i].getInteractionRecord ();
16021608 if (mHasFillScheme && !mFillScheme [ir.bc ]) {
16031609 continue ;
@@ -1702,8 +1708,8 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
17021708 matchingPair.setT0true (TOFClusWork[matchingPair.getTOFClIndex ()].getT0true ());
17031709
17041710 // let's check if cluster has multiple-hits (noferini)
1705- if ( TOFClusWork[matchingPair.getTOFClIndex ()]. getNumOfContributingChannels () > 1 ) {
1706- const auto & tofcl = TOFClusWork[matchingPair. getTOFClIndex ()];
1711+ const auto & tofcl = TOFClusWork[matchingPair.getTOFClIndex ()];
1712+ if ( tofcl. getNumOfContributingChannels () > 1 ) {
17071713 // has an additional hit Up or Down (Z-dir)
17081714 matchingPair.setHitPatternUpDown (tofcl.isAdditionalChannelSet (o2::tof::Cluster::kUp ) ||
17091715 tofcl.isAdditionalChannelSet (o2::tof::Cluster::kUpLeft ) ||
@@ -1719,6 +1725,19 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
17191725 tofcl.isAdditionalChannelSet (o2::tof::Cluster::kDownRight ) ||
17201726 tofcl.isAdditionalChannelSet (o2::tof::Cluster::kUpRight ));
17211727 }
1728+
1729+ // estimate collision time using FT0 info if available
1730+ ULong64_t bclongtofCal = (matchingPair.getSignal () - 10000 ) * o2::tof::Geo::BC_TIME_INPS_INV;
1731+ double t0Best = bclongtofCal * o2::tof::Geo::BC_TIME_INPS; // here just BC
1732+ float t0BestRes = 200 ;
1733+ if (FITRecPoints.size () > 0 ) {
1734+ int index = findFITIndex (bclongtofCal, FITRecPoints, mFirstTForbit );
1735+ if (index > -1 && FITRecPoints[index].isValidTime (1 ) && FITRecPoints[index].isValidTime (2 )) { // require A and C
1736+ t0Best += FITRecPoints[index].getCollisionTime (0 );
1737+ t0BestRes = 15 ;
1738+ }
1739+ }
1740+ matchingPair.setFT0Best (t0Best, t0BestRes);
17221741 matchedTracks[trkTypeSplitted].push_back (matchingPair); // array of MatchInfoTOF
17231742
17241743 // get fit info
0 commit comments