141 mDebugTreeFileName =
name;
146 std::vector<o2::dataformats::CalibInfoTOF>&
getCalibVector() {
return mCalibInfoTOF; }
148 std::vector<o2::dataformats::MatchInfoTOFReco>&
getMatchedTracksPair(
int sec) {
return mMatchedTracksPairsSec[sec]; }
156 static int findFITIndex(
int bc,
const gsl::span<const o2::ft0::RecPoints>& FITRecPoints,
unsigned long firstOrbit);
162 template <
typename MtcInfo,
typename MCInfo,
typename CTrack>
166 mtcCont.reserve(nmatch);
167 trcCont.reserve(nmatch);
169 MCCont.reserve(nmatch);
175 int nconstrained = 0;
176 for (
unsigned i = 0;
i < nmatch;
i++) {
177 auto& ctr = trcCont.emplace_back();
179 mtcCont.push_back(info[
i]);
181 MCCont.push_back(mclabs[
i]);
190 void setTS(
unsigned long creationTime) { mTimestamp = creationTime; }
191 unsigned long getTS()
const {
return mTimestamp; }
193 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);
194 static void printGrouping(
const std::vector<o2::dataformats::MatchInfoTOFReco>&
origin,
const std::vector<std::vector<o2::dataformats::MatchInfoTOFReco>>& grouped);
201 bool prepareFITData();
202 int prepareInteractionTimes();
203 bool prepareTPCData();
204 void propagateTPCTracks(
int sec);
205 void propagateConstrTracks(
int sec);
212 bool prepareTOFClusters();
214 void doMatching(
int sec);
215 void doMatchingForTPC(
int sec);
216 void selectBestMatches(
int sec);
217 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);
218 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);
220 bool propagateToRefXWithoutCov(
const o2::track::TrackParCov& trc,
float xRef ,
float stepInCm ,
float bz);
224 void updateTimeDependentParams();
226 static bool mHasFillScheme;
238 const MatchTOFParams* mMatchParams =
nullptr;
241 int mCurrTracksTreeEntry = 0;
245 bool mMCTruthON =
false;
248 float mTPCVDriftRef = -1.;
249 float mTPCVDriftCorrFact = 1.;
250 float mTPCVDrift = -1.;
251 float mTPCDriftTimeOffset = 0;
254 float mMaxInvPt = 999.;
257 float mTPCTBinMUS = 0.;
258 float mTPCTBinMUSInv = 0.;
259 float mTPCBin2Z = 0.;
261 bool mIsCosmics =
false;
262 float mTimeTolerance = 1e3;
263 float mExtraTimeToleranceTRD = 500E3;
264 float mSpaceTolerance = 10;
265 float mSigmaTimeCut = 3;
268 bool mIsITSTPCused =
false;
269 bool mIsTPCused =
false;
270 bool mIsTPCTRDused =
false;
271 bool mIsITSTPCTRDused =
false;
272 bool mSetHighPurity =
false;
273 bool mStoreMatchable =
false;
275 unsigned long mTimestamp = 0;
277 unsigned long mFirstTForbit = 0;
280 gsl::span<const o2::tpc::TrackTPC> mTPCTracksArray;
285 gsl::span<const Cluster> mTOFClustersArrayInp;
288 gsl::span<const o2::tpc::TPCClRefElem> mTPCTrackClusIdx;
289 gsl::span<const unsigned char> mTPCRefitterShMap;
290 gsl::span<const unsigned int> mTPCRefitterOccMap;
294 float mCTPLumi = {-1};
295 std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mTPCRefitter;
299 int mNotPropagatedToTOF[trkType::SIZE];
301 gsl::span<const o2::ft0::RecPoints> mFITRecPoints;
316 std::vector<Cluster> mTOFClusWork;
326 std::vector<o2::dataformats::CalibInfoTOF> mCalibInfoTOF;
330 std::vector<o2::dataformats::MatchInfoTOF> mMatchedTracks[trkType::SIZEALL];
331 std::vector<o2::MCCompLabel> mOutTOFLabels[trkType::SIZEALL];
336 int* mMatchedClustersIndex =
nullptr;
338 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
339 UInt_t mDBGFlags = 0;
340 std::string mDebugTreeFileName =
"dbg_matchTOF.root";
342 std::array<float, 5> mCovDiagInner{};
343 std::array<float, 5> mCovDiagOuter{};
346 static constexpr float MAXSNP = 0.85;
348 TStopwatch mTimerTot;
349 TStopwatch mTimerMatchITSTPC;
350 TStopwatch mTimerMatchTPC;
351 TStopwatch mTimerDBG;
352 ClassDefNV(MatchTOF, 6);