143 mDebugTreeFileName =
name;
148 std::vector<o2::dataformats::CalibInfoTOF>&
getCalibVector() {
return mCalibInfoTOF; }
150 std::vector<o2::dataformats::MatchInfoTOFReco>&
getMatchedTracksPair(
int sec) {
return mMatchedTracksPairsSec[sec]; }
158 static int findFITIndex(
int bc,
const gsl::span<const o2::ft0::RecPoints>& FITRecPoints,
unsigned long firstOrbit);
164 template <
typename MtcInfo,
typename MCInfo,
typename CTrack>
168 mtcCont.reserve(nmatch);
169 trcCont.reserve(nmatch);
171 MCCont.reserve(nmatch);
177 int nconstrained = 0;
178 for (
unsigned i = 0;
i < nmatch;
i++) {
179 auto& ctr = trcCont.emplace_back();
181 mtcCont.push_back(info[
i]);
183 MCCont.push_back(mclabs[
i]);
192 void setTS(
unsigned long creationTime) { mTimestamp = creationTime; }
193 unsigned long getTS()
const {
return mTimestamp; }
195 static void groupingMatch(
const std::vector<o2::dataformats::MatchInfoTOFReco>& origin, std::vector<std::vector<o2::dataformats::MatchInfoTOFReco>>& grouped, std::vector<std::vector<int>>& firstEls, std::vector<std::vector<int>>& secondEls);
196 static void printGrouping(
const std::vector<o2::dataformats::MatchInfoTOFReco>& origin,
const std::vector<std::vector<o2::dataformats::MatchInfoTOFReco>>& grouped);
203 bool prepareFITData();
204 int prepareInteractionTimes();
205 bool prepareTPCData();
206 void propagateTPCTracks(
int sec);
207 void propagateConstrTracks(
int sec);
214 bool prepareTOFClusters();
216 void doMatching(
int sec);
217 void doMatchingForTPC(
int sec);
218 void selectBestMatches(
int sec);
219 void BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& matchedTracksPairs, std::vector<o2::dataformats::MatchInfoTOF>* matchedTracks, std::vector<int>* matchedTracksIndex,
int* matchedClustersIndex,
const gsl::span<const o2::ft0::RecPoints>& FITRecPoints,
const std::vector<Cluster>& TOFClusWork,
const std::vector<matchTrack>* TracksWork, std::vector<o2::dataformats::CalibInfoTOF>& CalibInfoTOF,
unsigned long Timestamp,
bool MCTruthON,
const o2::dataformats::MCTruthContainer<o2::MCCompLabel>* TOFClusLabels,
const std::vector<o2::MCCompLabel>* TracksLblWork, std::vector<o2::MCCompLabel>* OutTOFLabels,
float calibMaxChi2);
220 void BestMatchesHP(std::vector<o2::dataformats::MatchInfoTOFReco>& matchedTracksPairs, std::vector<o2::dataformats::MatchInfoTOF>* matchedTracks, std::vector<int>* matchedTracksIndex,
int* matchedClustersIndex,
const gsl::span<const o2::ft0::RecPoints>& FITRecPoints,
const std::vector<Cluster>& TOFClusWork, std::vector<o2::dataformats::CalibInfoTOF>& CalibInfoTOF,
unsigned long Timestamp,
bool MCTruthON,
const o2::dataformats::MCTruthContainer<o2::MCCompLabel>* TOFClusLabels,
const std::vector<o2::MCCompLabel>* TracksLblWork, std::vector<o2::MCCompLabel>* OutTOFLabels);
222 bool propagateToRefXWithoutCov(
const o2::track::TrackParCov& trc,
float xRef ,
float stepInCm ,
float bz);
226 void updateTimeDependentParams();
228 static bool mHasFillScheme;
240 const MatchTOFParams* mMatchParams =
nullptr;
243 int mCurrTracksTreeEntry = 0;
247 bool mMCTruthON =
false;
250 float mTPCVDriftRef = -1.;
251 float mTPCVDriftCorrFact = 1.;
252 float mTPCVDrift = -1.;
253 float mTPCDriftTimeOffset = 0;
256 float mMaxInvPt = 999.;
259 float mTPCTBinMUS = 0.;
260 float mTPCTBinMUSInv = 0.;
261 float mTPCBin2Z = 0.;
263 bool mIsCosmics =
false;
264 float mTimeTolerance = 1e3;
265 float mExtraTimeToleranceTRD = 500E3;
266 float mSpaceTolerance = 10;
267 float mSigmaTimeCut = 3;
270 bool mIsITSTPCused =
false;
271 bool mIsTPCused =
false;
272 bool mIsTPCTRDused =
false;
273 bool mIsITSTPCTRDused =
false;
274 bool mSetHighPurity =
false;
275 bool mStoreMatchable =
false;
277 unsigned long mTimestamp = 0;
279 unsigned long mFirstTForbit = 0;
282 gsl::span<const o2::tpc::TrackTPC> mTPCTracksArray;
287 gsl::span<const Cluster> mTOFClustersArrayInp;
290 gsl::span<const o2::tpc::TPCClRefElem> mTPCTrackClusIdx;
291 gsl::span<const unsigned char> mTPCRefitterShMap;
292 gsl::span<const unsigned int> mTPCRefitterOccMap;
296 std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mTPCRefitter;
300 int mNotPropagatedToTOF[trkType::SIZE];
302 gsl::span<const o2::ft0::RecPoints> mFITRecPoints;
317 std::vector<Cluster> mTOFClusWork;
327 std::vector<o2::dataformats::CalibInfoTOF> mCalibInfoTOF;
331 std::vector<o2::dataformats::MatchInfoTOF> mMatchedTracks[trkType::SIZEALL];
332 std::vector<o2::MCCompLabel> mOutTOFLabels[trkType::SIZEALL];
337 int* mMatchedClustersIndex =
nullptr;
339 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
340 UInt_t mDBGFlags = 0;
341 std::string mDebugTreeFileName =
"dbg_matchTOF.root";
343 std::array<float, 5> mCovDiagInner{};
344 std::array<float, 5> mCovDiagOuter{};
347 static constexpr float MAXSNP = 0.85;
349 TStopwatch mTimerTot;
350 TStopwatch mTimerMatchITSTPC;
351 TStopwatch mTimerMatchTPC;
352 TStopwatch mTimerDBG;
353 ClassDefNV(MatchTOF, 6);