diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchTOF.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchTOF.h index 57b7fbbff0a3a..e628058aeca51 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchTOF.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchTOF.h @@ -91,7 +91,7 @@ class MatchTOF void initTPConly(); ///< attach DPL data and run - void run(const gsl::span& trackArray, const gsl::span& clusterArray, const o2::dataformats::MCTruthContainer& toflab, const gsl::span& itslab, const gsl::span& tpclab); + void run(const gsl::span& trackArray, const gsl::span& clusterArray, const o2::dataformats::MCTruthContainer& toflab, const gsl::span& itstpclab); void run(const gsl::span& trackArray, const gsl::span& clusterArray, const o2::dataformats::MCTruthContainer& toflab, const gsl::span& tpclab); ///< set tree/chain containing tracks @@ -113,12 +113,9 @@ class MatchTOF void setTrackBranchName(const std::string& nm) { mTracksBranchName = nm; } void setTPCTrackBranchName(const std::string& nm) { mTPCTracksBranchName = nm; } void setTPCMCTruthBranchName(const std::string& nm) { mTPCMCTruthBranchName = nm; } - void setITSMCTruthBranchName(const std::string& nm) { mITSMCTruthBranchName = nm; } void setTOFMCTruthBranchName(const std::string& nm) { mTOFMCTruthBranchName = nm; } void setTOFClusterBranchName(const std::string& nm) { mTOFClusterBranchName = nm; } void setOutTOFMCTruthBranchName(const std::string& nm) { mOutTOFMCTruthBranchName = nm; } - void setOutTPCMCTruthBranchName(const std::string& nm) { mOutTPCMCTruthBranchName = nm; } - void setOutITSMCTruthBranchName(const std::string& nm) { mOutITSMCTruthBranchName = nm; } void setOutTracksBranchName(const std::string& nm) { mOutTracksBranchName = nm; } void setOutCalibBranchName(const std::string& nm) { mOutCalibBranchName = nm; } @@ -126,12 +123,9 @@ class MatchTOF const std::string& getTracksBranchName() const { return mTracksBranchName; } const std::string& getTPCTracksBranchName() const { return mTPCTracksBranchName; } const std::string& getTPCMCTruthBranchName() const { return mTPCMCTruthBranchName; } - const std::string& getITSMCTruthBranchName() const { return mITSMCTruthBranchName; } const std::string& getTOFMCTruthBranchName() const { return mTOFMCTruthBranchName; } const std::string& getTOFClusterBranchName() const { return mTOFClusterBranchName; } const std::string& getOutTOFMCTruthBranchName() const { return mOutTOFMCTruthBranchName; } - const std::string& getOutTPCMCTruthBranchName() const { return mOutTPCMCTruthBranchName; } - const std::string& getOutITSMCTruthBranchName() const { return mOutITSMCTruthBranchName; } ///< print settings void print() const; @@ -177,15 +171,13 @@ class MatchTOF ///< fill matching debug tree void fillTOFmatchTree(const char* tname, int cacheTOF, int sectTOF, int plateTOF, int stripTOF, int padXTOF, int padZTOF, int cacheeTrk, int crossedStrip, int sectPropagation, int platePropagation, int stripPropagation, int padXPropagation, int padZPropagation, float resX, float resZ, float res, matchTrack& trk, float intLength, float intTimePion, float timeTOF); - void fillTOFmatchTreeWithLabels(const char* tname, int cacheTOF, int sectTOF, int plateTOF, int stripTOF, int padXTOF, int padZTOF, int cacheeTrk, int crossedStrip, int sectPropagation, int platePropagation, int stripPropagation, int padXPropagation, int padZPropagation, float resX, float resZ, float res, matchTrack& trk, int TPClabelTrackID, int TPClabelEventID, int TPClabelSourceID, int ITSlabelTrackID, int ITSlabelEventID, int ITSlabelSourceID, int TOFlabelTrackID0, int TOFlabelEventID0, int TOFlabelSourceID0, int TOFlabelTrackID1, int TOFlabelEventID1, int TOFlabelSourceID1, int TOFlabelTrackID2, int TOFlabelEventID2, int TOFlabelSourceID2, float intLength, float intTimePion, float timeTOF); + void fillTOFmatchTreeWithLabels(const char* tname, int cacheTOF, int sectTOF, int plateTOF, int stripTOF, int padXTOF, int padZTOF, int cacheeTrk, int crossedStrip, int sectPropagation, int platePropagation, int stripPropagation, int padXPropagation, int padZPropagation, float resX, float resZ, float res, matchTrack& trk, int TPClabelTrackID, int TPClabelEventID, int TPClabelSourceID, int TOFlabelTrackID0, int TOFlabelEventID0, int TOFlabelSourceID0, int TOFlabelTrackID1, int TOFlabelEventID1, int TOFlabelSourceID1, int TOFlabelTrackID2, int TOFlabelEventID2, int TOFlabelSourceID2, float intLength, float intTimePion, float timeTOF); void dumpWinnerMatches(); std::vector& getMatchedTrackVector() { return mMatchedTracks; } std::vector& getCalibVector() { return mCalibInfoTOF; } std::vector& getMatchedTOFLabelsVector() { return mOutTOFLabels; } ///< get vector of TOF label of matched tracks - std::vector& getMatchedTPCLabelsVector() { return mOutTPCLabels; } ///< get vector of TPC label of matched tracks - std::vector& getMatchedITSLabelsVector() { return mOutITSLabels; } ///< get vector of ITS label of matched tracks // this method is deprecated void setFITRecPoints(const std::vector* recpoints) @@ -312,9 +304,7 @@ class MatchTOF std::vector mTracksLblWork; /// mTPCLabels; ///< TPC label of input tracks - gsl::span mITSLabels; ///< ITS label of input tracks std::vector* mTPCLabelsVect; ///< TPC label of input tracks (vector to read from tree) - std::vector* mITSLabelsVect; ///< ITS label of input tracks (vector to read from tree) gsl::span mFITRecPoints; ///< FIT recpoints @@ -344,8 +334,6 @@ class MatchTOF //std::vector mMatchedTracks; std::vector mMatchedTracks; // this is the output of the matching std::vector mOutTOFLabels; ///< TOF label of matched tracks - std::vector mOutTPCLabels; ///< TPC label of matched tracks - std::vector mOutITSLabels; ///< ITS label of matched tracks int mNumOfTracks; // number of tracks to be matched std::vector mMatchedTracksIndex; // vector of indexes of the tracks to be matched @@ -354,15 +342,12 @@ class MatchTOF std::string mTracksBranchName = "TPCITS"; ///< name of branch containing input matched tracks std::string mTPCTracksBranchName = "TPCTracks"; ///< name of branch containing actual TPC tracks - std::string mTPCMCTruthBranchName = "MatchTPCMCTruth"; ///< name of branch containing TPC labels - std::string mITSMCTruthBranchName = "MatchITSMCTruth"; ///< name of branch containing ITS labels + std::string mTPCMCTruthBranchName = "MatchMCTruth"; ///< name of branch containing TPC labels std::string mTOFMCTruthBranchName = "TOFClusterMCTruth"; ///< name of branch containing TOF clusters labels std::string mTOFClusterBranchName = "TOFCluster"; ///< name of branch containing input ITS clusters std::string mOutTracksBranchName = "TOFMatchInfo"; ///< name of branch containing output matched tracks std::string mOutCalibBranchName = "TOFCalibInfo"; ///< name of branch containing output calibration infos std::string mOutTOFMCTruthBranchName = "MatchTOFMCTruth"; ///< name of branch containing TOF labels for output matched tracks - std::string mOutTPCMCTruthBranchName = "MatchTPCMCTruth"; ///< name of branch containing TOF labels for output matched tracks - std::string mOutITSMCTruthBranchName = "MatchITSMCTruth"; ///< name of branch containing TOF labels for output matched tracks std::string mOutTPCTrackMCTruthBranchName = "TPCTracksMCTruth"; ///< name of branch containing TPC labels for input TPC tracks std::unique_ptr mDBGOut; diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h index c62cee42a2241..bfdf3b0d1551b 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h @@ -451,8 +451,7 @@ class MatchTPCITS void printCandidatesITS() const; std::vector& getMatchedTracks() { return mMatchedTracks; } - MCLabContTr& getMatchedITSLabels() { return mOutITSLabels; } - MCLabContTr& getMatchedTPCLabels() { return mOutTPCLabels; } + MCLabContTr& getMatchLabels() { return mOutLabels; } //>>> ====================== options =============================>>> void setUseMatCorrFlag(MatCorrType f) { mUseMatCorrFlag = f; } @@ -730,8 +729,7 @@ class MatchTPCITS ///< outputs tracks container std::vector mMatchedTracks; - MCLabContTr mOutITSLabels; ///< ITS label of matched track - MCLabContTr mOutTPCLabels; ///< TPC label of matched track + MCLabContTr mOutLabels; ///< Labels: = TPC labels with flag isFake set in case of fake matching o2::its::RecoGeomHelper mRGHelper; ///< helper for cluster and geometry access float mITSFiducialZCut = 9999.; ///< eliminate TPC seeds outside of this range @@ -782,113 +780,6 @@ inline bool MatchTPCITS::isDisabledITS(const TrackLocITS& t) const { return t.ma //______________________________________________ inline bool MatchTPCITS::isDisabledTPC(const TrackLocTPC& t) const { return t.matchID < 0; } -//______________________________________________ -inline void MatchTPCITS::removeTPCfromITS(int tpcID, int itsID) -{ - ///< remove reference to tpcID track from itsID track matches - auto& tITS = mITSWork[itsID]; - if (isValidatedITS(tITS)) { - return; - } - int topID = MinusOne, next = tITS.matchID; // ITS MatchRecord - while (next > MinusOne) { - auto& rcITS = mMatchRecordsITS[next]; - if (rcITS.partnerID == tpcID) { - if (topID < 0) { - tITS.matchID = rcITS.nextRecID; - } else { - mMatchRecordsITS[topID].nextRecID = rcITS.nextRecID; - } - return; - } - topID = next; - next = rcITS.nextRecID; - } -} - -//______________________________________________ -inline void MatchTPCITS::removeITSfromTPC(int itsID, int tpcID) -{ - ///< remove reference to itsID track from matches of tpcID track - auto& tTPC = mTPCWork[tpcID]; - if (isValidatedTPC(tTPC)) { - return; - } - int topID = MinusOne, next = tTPC.matchID; - while (next > MinusOne) { - auto& rcTPC = mMatchRecordsTPC[next]; - if (rcTPC.partnerID == itsID) { - if (topID < 0) { - tTPC.matchID = rcTPC.nextRecID; - } else { - mMatchRecordsTPC[topID].nextRecID = rcTPC.nextRecID; - } - return; - } - topID = next; - next = rcTPC.nextRecID; - } -} - -//______________________________________________ -inline void MatchTPCITS::flagUsedITSClusters(const o2::its::TrackITS& track, int rofOffset) -{ - // flag clusters used by this track - int clEntry = track.getFirstClusterEntry(); - for (int icl = track.getNumberOfClusters(); icl--;) { - mABClusterLinkIndex[rofOffset + mITSTrackClusIdx[clEntry++]] = MinusTen; - } -} -//__________________________________________________________ -inline int MatchTPCITS::preselectChipClusters(std::vector& clVecOut, const ClusRange& clRange, const ITSChipClustersRefs& clRefs, - float trackY, float trackZ, float tolerY, float tolerZ, - const o2::MCCompLabel& lblTrc) const // TODO lbl is not needed -{ - clVecOut.clear(); - int icID = clRange.getFirstEntry(); - for (int icl = clRange.getEntries(); icl--;) { // note: clusters within a chip are sorted in Z - int clID = clRefs.clusterID[icID++]; // so, we go in clusterID increasing direction - const auto& cls = mITSClustersArray[clID]; - float dz = trackZ - cls.getZ(); - auto label = mITSClsLabels->getLabels(clID)[0]; // tmp - // if (!(label == lblTrc)) { - // continue; // tmp - // } - LOG(DEBUG) << "cl" << icl << '/' << clID << " " << label - << " dZ: " << dz << " [" << tolerZ << "| dY: " << trackY - cls.getY() << " [" << tolerY << "]"; - if (dz > tolerZ) { - float clsZ = cls.getZ(); - LOG(DEBUG) << "Skip the rest since " << trackZ << " > " << clsZ << "\n"; - break; - } else if (dz < -tolerZ) { - LOG(DEBUG) << "Skip cluster dz=" << dz << " Ztr=" << trackZ << " zCl=" << cls.getZ(); - continue; - } - if (fabs(trackY - cls.getY()) > tolerY) { - LOG(DEBUG) << "Skip cluster dy= " << trackY - cls.getY() << " Ytr=" << trackY << " yCl=" << cls.getY(); - continue; - } - clVecOut.push_back(clID); - } - return clVecOut.size(); -} - -//______________________________________________ -inline void MatchTPCITS::cleanAfterBurnerClusRefCache(int currentIC, int& startIC) -{ - // check if some of cached cluster reference from tables startIC to currentIC can be released, - // they will be necessarily in front slots of the mITSChipClustersRefs - while (startIC < currentIC && mInteractions[currentIC].timeBins.getMin() - mInteractions[startIC].timeBins.getMax() > MinTBToCleanCache) { - LOG(INFO) << "CAN REMOVE CACHE FOR " << startIC << " curent IC=" << currentIC; - while (mInteractions[startIC].clRefPtr == &mITSChipClustersRefs.front()) { - LOG(INFO) << "Reset cache pointer" << mInteractions[startIC].clRefPtr << " for IC=" << startIC; - mInteractions[startIC++].clRefPtr = nullptr; - } - LOG(INFO) << "Reset cache slot " << &mITSChipClustersRefs.front(); - mITSChipClustersRefs.pop_front(); - } -} - //______________________________________________ inline void MatchTPCITS::destroyLastABTrackLinksList() { diff --git a/Detectors/GlobalTracking/src/MatchTOF.cxx b/Detectors/GlobalTracking/src/MatchTOF.cxx index 74993eff5b6f6..4ae75fce9b60e 100644 --- a/Detectors/GlobalTracking/src/MatchTOF.cxx +++ b/Detectors/GlobalTracking/src/MatchTOF.cxx @@ -76,8 +76,6 @@ void MatchTOF::run() mMatchedTracks.clear(); mOutTOFLabels.clear(); - mOutTPCLabels.clear(); - mOutITSLabels.clear(); mTimerTot.Stop(); LOGF(INFO, "Timing prepare tracks: Cpu: %.3e s Real: %.3e s in %d slots", mTimerTot.CpuTime(), mTimerTot.RealTime(), mTimerTot.Counter() - 1); @@ -107,8 +105,6 @@ void MatchTOF::run() mMatchedTracks.clear(); mOutTOFLabels.clear(); - mOutTPCLabels.clear(); - mOutITSLabels.clear(); mTimerTot.Stop(); LOGF(INFO, "Timing prepare tracks: Cpu: %.3e s Real: %.3e s in %d slots", mTimerTot.CpuTime(), mTimerTot.RealTime(), mTimerTot.Counter() - 1); @@ -153,17 +149,16 @@ void MatchTOF::fill() } //______________________________________________ -void MatchTOF::run(const gsl::span& trackArray, const gsl::span& clusterArray, const o2::dataformats::MCTruthContainer& toflab, const gsl::span& itslab, const gsl::span& tpclab) +void MatchTOF::run(const gsl::span& trackArray, const gsl::span& clusterArray, const o2::dataformats::MCTruthContainer& toflab, const gsl::span& itstpclab) { mIsITSused = true; mTracksArrayInp = trackArray; mTOFClustersArrayInp = clusterArray; mIsworkflowON = kTRUE; mTOFClusLabels = toflab; - mTPCLabels = tpclab; - mITSLabels = itslab; + mTPCLabels = itstpclab; - mMCTruthON = (mTOFClusLabels.getNElements() && mTPCLabels.size() && mITSLabels.size()); + mMCTruthON = (mTOFClusLabels.getNElements() && mTPCLabels.size()); mWFInputAttached = true; mSAInitDone = true; run(); @@ -202,10 +197,6 @@ void MatchTOF::init() LOG(INFO) << "Matched tracks will be stored in " << mOutTracksBranchName << " branch of tree " << mOutputTree->GetName(); if (mMCTruthON) { - mOutputTree->Branch(mOutITSMCTruthBranchName.data(), &mOutITSLabels); - LOG(INFO) << "ITS Tracks Labels branch: " << mOutITSMCTruthBranchName; - mOutputTree->Branch(mOutTPCMCTruthBranchName.data(), &mOutTPCLabels); - LOG(INFO) << "TPC Tracks Labels branch: " << mOutTPCMCTruthBranchName; mOutputTree->Branch(mOutTOFMCTruthBranchName.data(), &mOutTOFLabels); LOG(INFO) << "TOF Tracks Labels branch: " << mOutTOFMCTruthBranchName; } @@ -258,8 +249,6 @@ void MatchTOF::initTPConly() LOG(INFO) << "Matched tracks will be stored in " << mOutTracksBranchName << " branch of tree " << mOutputTree->GetName(); if (mMCTruthON) { - mOutputTree->Branch(mOutTPCMCTruthBranchName.data(), &mOutTPCLabels); - LOG(INFO) << "TPC Tracks Labels branch: " << mOutTPCMCTruthBranchName; mOutputTree->Branch(mOutTOFMCTruthBranchName.data(), &mOutTOFLabels); LOG(INFO) << "TOF Tracks Labels branch: " << mOutTOFMCTruthBranchName; } @@ -360,12 +349,6 @@ void MatchTOF::attachInputTrees() } else { mMCTruthON = false; } - if (mInputTreeTracks->GetBranch(mITSMCTruthBranchName.data())) { - mInputTreeTracks->SetBranchAddress(mITSMCTruthBranchName.data(), &mITSLabelsVect); - LOG(INFO) << "Found ITS tracks MCLabels branch " << mITSMCTruthBranchName.data(); - } else { - mMCTruthON = false; - } mCurrTracksTreeEntry = -1; mCurrTOFClustersTreeEntry = -1; @@ -766,7 +749,6 @@ bool MatchTOF::loadTracksNextChunk() continue; } if (mMCTruthON) { - mITSLabels = gsl::span{*mITSLabelsVect}; mTPCLabels = gsl::span{*mTPCLabelsVect}; } return true; @@ -1076,8 +1058,7 @@ void MatchTOF::doMatching(int sec) tofLabelSourceID[ilabel] = labelsTOF[ilabel].getSourceID(); } auto labelTPC = mTPCLabels[mTracksSectIndexCache[sec][itrk]]; - auto labelITS = mITSLabels[mTracksSectIndexCache[indices[0]][itrk]]; - fillTOFmatchTreeWithLabels("matchPossibleWithLabels", cacheTOF[itof], indices[0], indices[1], indices[2], indices[3], indices[4], cacheTrk[itrk], iPropagation, detId[iPropagation][0], detId[iPropagation][1], detId[iPropagation][2], detId[iPropagation][3], detId[iPropagation][4], resX, resZ, res, trackWork, labelTPC.getTrackID(), labelTPC.getEventID(), labelTPC.getSourceID(), labelITS.getTrackID(), labelITS.getEventID(), labelITS.getSourceID(), tofLabelTrackID[0], tofLabelEventID[0], tofLabelSourceID[0], tofLabelTrackID[1], tofLabelEventID[1], tofLabelSourceID[1], tofLabelTrackID[2], tofLabelEventID[2], tofLabelSourceID[2], trkLTInt[iPropagation].getL(), trkLTInt[iPropagation].getTOF(o2::track::PID::Pion), trefTOF.getTime()); + fillTOFmatchTreeWithLabels("matchPossibleWithLabels", cacheTOF[itof], indices[0], indices[1], indices[2], indices[3], indices[4], cacheTrk[itrk], iPropagation, detId[iPropagation][0], detId[iPropagation][1], detId[iPropagation][2], detId[iPropagation][3], detId[iPropagation][4], resX, resZ, res, trackWork, labelTPC.getTrackID(), labelTPC.getEventID(), labelTPC.getSourceID(), tofLabelTrackID[0], tofLabelEventID[0], tofLabelSourceID[0], tofLabelTrackID[1], tofLabelEventID[1], tofLabelSourceID[1], tofLabelTrackID[2], tofLabelEventID[2], tofLabelSourceID[2], trkLTInt[iPropagation].getL(), trkLTInt[iPropagation].getTOF(o2::track::PID::Pion), trefTOF.getTime()); } #endif if (indices[0] != detId[iPropagation][0]) { @@ -1094,8 +1075,7 @@ void MatchTOF::doMatching(int sec) fillTOFmatchTree("match1", cacheTOF[itof], indices[0], indices[1], indices[2], indices[3], indices[4], cacheTrk[itrk], iPropagation, detId[iPropagation][0], detId[iPropagation][1], detId[iPropagation][2], detId[iPropagation][3], detId[iPropagation][4], resX, resZ, res, trackWork, trkLTInt[iPropagation].getL(), trkLTInt[iPropagation].getTOF(o2::track::PID::Pion), trefTOF.getTime()); if (mMCTruthON) { auto labelTPC = mTPCLabels[mTracksSectIndexCache[sec][itrk]]; - auto labelITS = mITSLabels[mTracksSectIndexCache[indices[0]][itrk]]; - fillTOFmatchTreeWithLabels("matchOkWithLabels", cacheTOF[itof], indices[0], indices[1], indices[2], indices[3], indices[4], cacheTrk[itrk], iPropagation, detId[iPropagation][0], detId[iPropagation][1], detId[iPropagation][2], detId[iPropagation][3], detId[iPropagation][4], resX, resZ, res, trackWork, labelTPC.getTrackID(), labelTPC.getEventID(), labelTPC.getSourceID(), labelITS.getTrackID(), labelITS.getEventID(), labelITS.getSourceID(), tofLabelTrackID[0], tofLabelEventID[0], tofLabelSourceID[0], tofLabelTrackID[1], tofLabelEventID[1], tofLabelSourceID[1], tofLabelTrackID[2], tofLabelEventID[2], tofLabelSourceID[2], trkLTInt[iPropagation].getL(), trkLTInt[iPropagation].getTOF(o2::track::PID::Pion), trefTOF.getTime()); + fillTOFmatchTreeWithLabels("matchOkWithLabels", cacheTOF[itof], indices[0], indices[1], indices[2], indices[3], indices[4], cacheTrk[itrk], iPropagation, detId[iPropagation][0], detId[iPropagation][1], detId[iPropagation][2], detId[iPropagation][3], detId[iPropagation][4], resX, resZ, res, trackWork, labelTPC.getTrackID(), labelTPC.getEventID(), labelTPC.getSourceID(), tofLabelTrackID[0], tofLabelEventID[0], tofLabelSourceID[0], tofLabelTrackID[1], tofLabelEventID[1], tofLabelSourceID[1], tofLabelTrackID[2], tofLabelEventID[2], tofLabelSourceID[2], trkLTInt[iPropagation].getL(), trkLTInt[iPropagation].getTOF(o2::track::PID::Pion), trefTOF.getTime()); } #endif @@ -1111,13 +1091,11 @@ void MatchTOF::doMatching(int sec) if (mMCTruthON) { const auto& labelsTOF = mTOFClusLabels.getLabels(mTOFClusSectIndexCache[indices[0]][itof]); auto labelTPC = mTPCLabels[mTracksSectIndexCache[sec][itrk]]; - auto labelITS = mITSLabels[mTracksSectIndexCache[indices[0]][itrk]]; for (int ilabel = 0; ilabel < labelsTOF.size(); ilabel++) { LOG(DEBUG) << "TOF label " << ilabel << labelsTOF[ilabel]; } LOG(DEBUG) << "TPC label " << labelTPC; - LOG(DEBUG) << "ITS label " << labelITS; - fillTOFmatchTreeWithLabels("matchOkWithLabelsInSpaceTolerance", cacheTOF[itof], indices[0], indices[1], indices[2], indices[3], indices[4], cacheTrk[itrk], iPropagation, detId[iPropagation][0], detId[iPropagation][1], detId[iPropagation][2], detId[iPropagation][3], detId[iPropagation][4], resX, resZ, res, trackWork, labelTPC.getTrackID(), labelTPC.getEventID(), labelTPC.getSourceID(), labelITS.getTrackID(), labelITS.getEventID(), labelITS.getSourceID(), tofLabelTrackID[0], tofLabelEventID[0], tofLabelSourceID[0], tofLabelTrackID[1], tofLabelEventID[1], tofLabelSourceID[1], tofLabelTrackID[2], tofLabelEventID[2], tofLabelSourceID[2], trkLTInt[iPropagation].getL(), trkLTInt[iPropagation].getTOF(o2::track::PID::Pion), trefTOF.getTime()); + fillTOFmatchTreeWithLabels("matchOkWithLabelsInSpaceTolerance", cacheTOF[itof], indices[0], indices[1], indices[2], indices[3], indices[4], cacheTrk[itrk], iPropagation, detId[iPropagation][0], detId[iPropagation][1], detId[iPropagation][2], detId[iPropagation][3], detId[iPropagation][4], resX, resZ, res, trackWork, labelTPC.getTrackID(), labelTPC.getEventID(), labelTPC.getSourceID(), tofLabelTrackID[0], tofLabelEventID[0], tofLabelSourceID[0], tofLabelTrackID[1], tofLabelEventID[1], tofLabelSourceID[1], tofLabelTrackID[2], tofLabelEventID[2], tofLabelSourceID[2], trkLTInt[iPropagation].getL(), trkLTInt[iPropagation].getTOF(o2::track::PID::Pion), trefTOF.getTime()); } #endif } @@ -1503,32 +1481,24 @@ void MatchTOF::selectBestMatches() const auto& labelsTOF = mTOFClusLabels.getLabels(matchingPair.getTOFClIndex()); const auto& labelTPC = mTPCLabels[matchingPair.getTrackIndex()]; // we want to store positive labels independently of how they are flagged from TPC,ITS people - // o2::MCCompLabel labelTPC(abs(labelTPCor.getTrackID()), labelTPCor.getEventID(), labelTPCor.getSourceID()); - // o2::MCCompLabel labelITS(abs(labelITSor.getTrackID()), labelITSor.getEventID(), labelITSor.getSourceID()); LOG(DEBUG) << "TPC label" << labelTPC; bool labelOk = false; // whether we have found or not the same TPC label of the track among the labels of the TOF cluster for (int ilabel = 0; ilabel < labelsTOF.size(); ilabel++) { LOG(DEBUG) << "TOF label " << ilabel << labelsTOF[ilabel]; - if (labelsTOF[ilabel].getTrackID() == labelTPC.getTrackID() && labelsTOF[ilabel].getEventID() == labelTPC.getEventID() && labelsTOF[ilabel].getSourceID() == labelTPC.getSourceID() && !labelOk) { // if we find one TOF cluster label that is the same as the TPC one, we are happy - even if it is not the first one + if (labelsTOF[ilabel] == labelTPC) { // if we find one TOF cluster label that is the same as the TPC one, we are happy - even if it is not the first one mOutTOFLabels.push_back(labelsTOF[ilabel]); labelOk = true; + break; } } if (!labelOk) { // we have not found the track label among those associated to the TOF cluster --> fake match! We will associate the label of the main channel, but negative - //assert(labelsTOF.size()); if (!labelsTOF.size()) { throw std::runtime_error("TOF label not found since size of label is zero. This should not happen!!!!"); } mOutTOFLabels.emplace_back(labelsTOF[0].getTrackID(), labelsTOF[0].getEventID(), labelsTOF[0].getSourceID(), true); } - mOutTPCLabels.push_back(labelTPC); - if (mIsITSused) { - const auto& labelITS = mITSLabels[matchingPair.getTrackIndex()]; - LOG(DEBUG) << "ITS label" << labelITS; - mOutITSLabels.push_back(labelITS); - } } i++; } @@ -1642,7 +1612,7 @@ void MatchTOF::fillTOFmatchTree(const char* trname, int cacheTOF, int sectTOF, i } //_________________________________________________________ -void MatchTOF::fillTOFmatchTreeWithLabels(const char* trname, int cacheTOF, int sectTOF, int plateTOF, int stripTOF, int padXTOF, int padZTOF, int cacheeTrk, int crossedStrip, int sectPropagation, int platePropagation, int stripPropagation, int padXPropagation, int padZPropagation, float resX, float resZ, float res, matchTrack& trk, int TPClabelTrackID, int TPClabelEventID, int TPClabelSourceID, int ITSlabelTrackID, int ITSlabelEventID, int ITSlabelSourceID, int TOFlabelTrackID0, int TOFlabelEventID0, int TOFlabelSourceID0, int TOFlabelTrackID1, int TOFlabelEventID1, int TOFlabelSourceID1, int TOFlabelTrackID2, int TOFlabelEventID2, int TOFlabelSourceID2, float intLength, float intTimePion, float timeTOF) +void MatchTOF::fillTOFmatchTreeWithLabels(const char* trname, int cacheTOF, int sectTOF, int plateTOF, int stripTOF, int padXTOF, int padZTOF, int cacheeTrk, int crossedStrip, int sectPropagation, int platePropagation, int stripPropagation, int padXPropagation, int padZPropagation, float resX, float resZ, float res, matchTrack& trk, int TPClabelTrackID, int TPClabelEventID, int TPClabelSourceID, int TOFlabelTrackID0, int TOFlabelEventID0, int TOFlabelSourceID0, int TOFlabelTrackID1, int TOFlabelEventID1, int TOFlabelSourceID1, int TOFlabelTrackID2, int TOFlabelEventID2, int TOFlabelSourceID2, float intLength, float intTimePion, float timeTOF) { ///< fill debug tree for TOF tracks matching check @@ -1654,7 +1624,6 @@ void MatchTOF::fillTOFmatchTreeWithLabels(const char* trname, int cacheTOF, int << "crossedStrip=" << crossedStrip << "sectPropagation=" << sectPropagation << "platePropagation=" << platePropagation << "stripPropagation=" << stripPropagation << "padXPropagation=" << padXPropagation << "resX=" << resX << "resZ=" << resZ << "res=" << res << "track=" << trk.first << "TPClabelTrackID=" << TPClabelTrackID << "TPClabelEventID=" << TPClabelEventID << "TPClabelSourceID=" << TPClabelSourceID - << "ITSlabelTrackID=" << ITSlabelTrackID << "ITSlabelEventID=" << ITSlabelEventID << "ITSlabelSourceID=" << ITSlabelSourceID << "TOFlabelTrackID0=" << TOFlabelTrackID0 << "TOFlabelEventID0=" << TOFlabelEventID0 << "TOFlabelSourceID0=" << TOFlabelSourceID0 << "TOFlabelTrackID1=" << TOFlabelTrackID1 << "TOFlabelEventID1=" << TOFlabelEventID1 << "TOFlabelSourceID1=" << TOFlabelSourceID1 << "TOFlabelTrackID2=" << TOFlabelTrackID2 << "TOFlabelEventID2=" << TOFlabelEventID2 << "TOFlabelSourceID2=" << TOFlabelSourceID2 diff --git a/Detectors/GlobalTracking/src/MatchTPCITS.cxx b/Detectors/GlobalTracking/src/MatchTPCITS.cxx index 19fb3604bb1cb..64b656d00ab0d 100644 --- a/Detectors/GlobalTracking/src/MatchTPCITS.cxx +++ b/Detectors/GlobalTracking/src/MatchTPCITS.cxx @@ -313,8 +313,7 @@ void MatchTPCITS::clear() mWinnerChi2Refit.clear(); mMatchedTracks.clear(); if (mMCTruthON) { - mOutITSLabels.clear(); - mOutTPCLabels.clear(); + mOutLabels.clear(); } } @@ -1473,9 +1472,10 @@ bool MatchTPCITS::refitTrackTPCITS(int iTPC, int& iITS) trfit.setRefTPC({unsigned(tTPC.sourceID), o2::dataformats::GlobalTrackID::TPC}); trfit.setRefITS({unsigned(tITS.sourceID), o2::dataformats::GlobalTrackID::ITS}); - if (mMCTruthON) { // store MC info - mOutITSLabels.emplace_back(mITSLblWork[iITS]); - mOutTPCLabels.emplace_back(mTPCLblWork[iTPC]); + if (mMCTruthON) { // store MC info: we assign TPC track label and declare the match fake if the ITS and TPC labels are different (their fake flag is ignored) + auto& lbl = mOutLabels.emplace_back(mTPCLblWork[iTPC]); + lbl.setFakeFlag(mITSLblWork[iITS] != mTPCLblWork[iTPC]); + LOG(INFO) << "ITS: " << mITSLblWork[iITS] << " TPC: " << mTPCLblWork[iTPC] << " -> " << lbl; } // if requested, fill the difference of ITS and TPC tracks tgl for vdrift calibation @@ -2466,6 +2466,113 @@ MatchTPCITS::BracketIR MatchTPCITS::tpcTimeBin2IRBracket(const BracketF tbrange) return {irMin, irMax}; } +//______________________________________________ +void MatchTPCITS::removeTPCfromITS(int tpcID, int itsID) +{ + ///< remove reference to tpcID track from itsID track matches + auto& tITS = mITSWork[itsID]; + if (isValidatedITS(tITS)) { + return; + } + int topID = MinusOne, next = tITS.matchID; // ITS MatchRecord + while (next > MinusOne) { + auto& rcITS = mMatchRecordsITS[next]; + if (rcITS.partnerID == tpcID) { + if (topID < 0) { + tITS.matchID = rcITS.nextRecID; + } else { + mMatchRecordsITS[topID].nextRecID = rcITS.nextRecID; + } + return; + } + topID = next; + next = rcITS.nextRecID; + } +} + +//______________________________________________ +void MatchTPCITS::removeITSfromTPC(int itsID, int tpcID) +{ + ///< remove reference to itsID track from matches of tpcID track + auto& tTPC = mTPCWork[tpcID]; + if (isValidatedTPC(tTPC)) { + return; + } + int topID = MinusOne, next = tTPC.matchID; + while (next > MinusOne) { + auto& rcTPC = mMatchRecordsTPC[next]; + if (rcTPC.partnerID == itsID) { + if (topID < 0) { + tTPC.matchID = rcTPC.nextRecID; + } else { + mMatchRecordsTPC[topID].nextRecID = rcTPC.nextRecID; + } + return; + } + topID = next; + next = rcTPC.nextRecID; + } +} + +//______________________________________________ +void MatchTPCITS::flagUsedITSClusters(const o2::its::TrackITS& track, int rofOffset) +{ + // flag clusters used by this track + int clEntry = track.getFirstClusterEntry(); + for (int icl = track.getNumberOfClusters(); icl--;) { + mABClusterLinkIndex[rofOffset + mITSTrackClusIdx[clEntry++]] = MinusTen; + } +} +//__________________________________________________________ +int MatchTPCITS::preselectChipClusters(std::vector& clVecOut, const ClusRange& clRange, const ITSChipClustersRefs& clRefs, + float trackY, float trackZ, float tolerY, float tolerZ, + const o2::MCCompLabel& lblTrc) const // TODO lbl is not needed +{ + clVecOut.clear(); + int icID = clRange.getFirstEntry(); + for (int icl = clRange.getEntries(); icl--;) { // note: clusters within a chip are sorted in Z + int clID = clRefs.clusterID[icID++]; // so, we go in clusterID increasing direction + const auto& cls = mITSClustersArray[clID]; + float dz = trackZ - cls.getZ(); + auto label = mITSClsLabels->getLabels(clID)[0]; // tmp + // if (!(label == lblTrc)) { + // continue; // tmp + // } + LOG(DEBUG) << "cl" << icl << '/' << clID << " " << label + << " dZ: " << dz << " [" << tolerZ << "| dY: " << trackY - cls.getY() << " [" << tolerY << "]"; + if (dz > tolerZ) { + float clsZ = cls.getZ(); + LOG(DEBUG) << "Skip the rest since " << trackZ << " > " << clsZ << "\n"; + break; + } else if (dz < -tolerZ) { + LOG(DEBUG) << "Skip cluster dz=" << dz << " Ztr=" << trackZ << " zCl=" << cls.getZ(); + continue; + } + if (fabs(trackY - cls.getY()) > tolerY) { + LOG(DEBUG) << "Skip cluster dy= " << trackY - cls.getY() << " Ytr=" << trackY << " yCl=" << cls.getY(); + continue; + } + clVecOut.push_back(clID); + } + return clVecOut.size(); +} + +//______________________________________________ +void MatchTPCITS::cleanAfterBurnerClusRefCache(int currentIC, int& startIC) +{ + // check if some of cached cluster reference from tables startIC to currentIC can be released, + // they will be necessarily in front slots of the mITSChipClustersRefs + while (startIC < currentIC && mInteractions[currentIC].timeBins.getMin() - mInteractions[startIC].timeBins.getMax() > MinTBToCleanCache) { + LOG(INFO) << "CAN REMOVE CACHE FOR " << startIC << " curent IC=" << currentIC; + while (mInteractions[startIC].clRefPtr == &mITSChipClustersRefs.front()) { + LOG(INFO) << "Reset cache pointer" << mInteractions[startIC].clRefPtr << " for IC=" << startIC; + mInteractions[startIC++].clRefPtr = nullptr; + } + LOG(INFO) << "Reset cache slot " << &mITSChipClustersRefs.front(); + mITSChipClustersRefs.pop_front(); + } +} + //<<============================= AfterBurner for TPC-track / ITS cluster matching ===================<< #ifdef _ALLOW_DEBUG_TREES_ diff --git a/Detectors/GlobalTrackingWorkflow/include/GlobalTrackingWorkflow/TrackTPCITSReaderSpec.h b/Detectors/GlobalTrackingWorkflow/include/GlobalTrackingWorkflow/TrackTPCITSReaderSpec.h index 31cec61189a26..6335eb218c98e 100644 --- a/Detectors/GlobalTrackingWorkflow/include/GlobalTrackingWorkflow/TrackTPCITSReaderSpec.h +++ b/Detectors/GlobalTrackingWorkflow/include/GlobalTrackingWorkflow/TrackTPCITSReaderSpec.h @@ -43,8 +43,7 @@ class TrackTPCITSReader : public Task std::unique_ptr mTree; std::string mFileName = ""; std::vector mTracks, *mTracksPtr = &mTracks; - std::vector mTPCLabels, *mTPCLabelsPtr = &mTPCLabels; - std::vector mITSLabels, *mITSLabelsPtr = &mITSLabels; + std::vector mLabels, *mLabelsPtr = &mLabels; }; /// create a processor spec diff --git a/Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx b/Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx index 2fdc73b39c64a..86cf63dd336cd 100644 --- a/Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx @@ -172,8 +172,7 @@ void TPCITSMatchingDPL::run(ProcessingContext& pc) pc.outputs().snapshot(Output{"GLO", "TPCITS", 0, Lifetime::Timeframe}, mMatching.getMatchedTracks()); if (mUseMC) { - pc.outputs().snapshot(Output{"GLO", "TPCITS_ITSMC", 0, Lifetime::Timeframe}, mMatching.getMatchedITSLabels()); - pc.outputs().snapshot(Output{"GLO", "TPCITS_TPCMC", 0, Lifetime::Timeframe}, mMatching.getMatchedTPCLabels()); + pc.outputs().snapshot(Output{"GLO", "TPCITS_MC", 0, Lifetime::Timeframe}, mMatching.getMatchLabels()); } if (mCalibMode) { @@ -223,8 +222,7 @@ DataProcessorSpec getTPCITSMatchingSpec(bool useFT0, bool calib, bool useMC, con inputs.emplace_back("trackTPCMCTR", "TPC", "TRACKSMCLBL", 0, Lifetime::Timeframe); inputs.emplace_back("clusITSMCTR", "ITS", "CLUSTERSMCTR", 0, Lifetime::Timeframe); // - outputs.emplace_back("GLO", "TPCITS_ITSMC", 0, Lifetime::Timeframe); - outputs.emplace_back("GLO", "TPCITS_TPCMC", 0, Lifetime::Timeframe); + outputs.emplace_back("GLO", "TPCITS_MC", 0, Lifetime::Timeframe); } return DataProcessorSpec{ diff --git a/Detectors/GlobalTrackingWorkflow/src/TrackTPCITSReaderSpec.cxx b/Detectors/GlobalTrackingWorkflow/src/TrackTPCITSReaderSpec.cxx index d3d3089ff22ad..6fc047ef0e035 100644 --- a/Detectors/GlobalTrackingWorkflow/src/TrackTPCITSReaderSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/TrackTPCITSReaderSpec.cxx @@ -40,8 +40,7 @@ void TrackTPCITSReader::run(ProcessingContext& pc) pc.outputs().snapshot(Output{"GLO", "TPCITS", 0, Lifetime::Timeframe}, mTracks); if (mUseMC) { - pc.outputs().snapshot(Output{"GLO", "TPCITS_ITSMC", 0, Lifetime::Timeframe}, mITSLabels); - pc.outputs().snapshot(Output{"GLO", "TPCITS_TPCMC", 0, Lifetime::Timeframe}, mTPCLabels); + pc.outputs().snapshot(Output{"GLO", "TPCITS_MC", 0, Lifetime::Timeframe}, mLabels); } if (mTree->GetReadEntry() + 1 >= mTree->GetEntries()) { @@ -59,8 +58,7 @@ void TrackTPCITSReader::connectTree(const std::string& filename) assert(mTree); mTree->SetBranchAddress("TPCITS", &mTracksPtr); if (mUseMC) { - mTree->SetBranchAddress("MatchITSMCTruth", &mITSLabelsPtr); - mTree->SetBranchAddress("MatchTPCMCTruth", &mTPCLabelsPtr); + mTree->SetBranchAddress("MatchMCTruth", &mLabelsPtr); } LOG(INFO) << "Loaded tree from " << filename << " with " << mTree->GetEntries() << " entries"; } @@ -70,8 +68,7 @@ DataProcessorSpec getTrackTPCITSReaderSpec(bool useMC) std::vector outputs; outputs.emplace_back("GLO", "TPCITS", 0, Lifetime::Timeframe); if (useMC) { - outputs.emplace_back("GLO", "TPCITS_ITSMC", 0, Lifetime::Timeframe); - outputs.emplace_back("GLO", "TPCITS_TPCMC", 0, Lifetime::Timeframe); + outputs.emplace_back("GLO", "TPCITS_MC", 0, Lifetime::Timeframe); } return DataProcessorSpec{ diff --git a/Detectors/GlobalTrackingWorkflow/src/TrackWriterTPCITSSpec.cxx b/Detectors/GlobalTrackingWorkflow/src/TrackWriterTPCITSSpec.cxx index 7609ccd2ce9a6..3cca9b6542b7e 100644 --- a/Detectors/GlobalTrackingWorkflow/src/TrackWriterTPCITSSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/TrackWriterTPCITSSpec.cxx @@ -43,12 +43,8 @@ DataProcessorSpec getTrackWriterTPCITSSpec(bool useMC) "TPCITS-branch-name", 1, logger}, - BranchDefinition{InputSpec{"matchITSMC", "GLO", "TPCITS_ITSMC", 0}, - "MatchITSMCTruth", - (useMC ? 1 : 0), // one branch if mc labels enabled - ""}, - BranchDefinition{InputSpec{"matchTPCMC", "GLO", "TPCITS_TPCMC", 0}, - "MatchTPCMCTruth", + BranchDefinition{InputSpec{"matchMC", "GLO", "TPCITS_MC", 0}, + "MatchMCTruth", (useMC ? 1 : 0), // one branch if mc labels enabled ""})(); } diff --git a/Detectors/GlobalTrackingWorkflow/tofworkflow/include/TOFWorkflow/TOFMatchedReaderSpec.h b/Detectors/GlobalTrackingWorkflow/tofworkflow/include/TOFWorkflow/TOFMatchedReaderSpec.h index 3a1b4017489c6..30d4ed601bd97 100644 --- a/Detectors/GlobalTrackingWorkflow/tofworkflow/include/TOFWorkflow/TOFMatchedReaderSpec.h +++ b/Detectors/GlobalTrackingWorkflow/tofworkflow/include/TOFWorkflow/TOFMatchedReaderSpec.h @@ -49,8 +49,6 @@ class TOFMatchedReader : public o2::framework::Task std::vector mMatches, *mMatchesPtr = &mMatches; std::vector mTracks, *mTracksPtr = &mTracks; std::vector mLabelTOF, *mLabelTOFPtr = &mLabelTOF; - std::vector mLabelTPC, *mLabelTPCPtr = &mLabelTPC; - std::vector mLabelITS, *mLabelITSPtr = &mLabelITS; }; /// create a processor spec diff --git a/Detectors/GlobalTrackingWorkflow/tofworkflow/src/RecoWorkflowSpec.cxx b/Detectors/GlobalTrackingWorkflow/tofworkflow/src/RecoWorkflowSpec.cxx index be22c48a9c001..1313a08c38cf2 100644 --- a/Detectors/GlobalTrackingWorkflow/tofworkflow/src/RecoWorkflowSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/tofworkflow/src/RecoWorkflowSpec.cxx @@ -102,17 +102,15 @@ class TOFDPLRecoWorkflowTask // we do a copy of the input but we are looking for a way to avoid it (current problem in conversion form unique_ptr to *) - gsl::span itslab; - gsl::span tpclab; + gsl::span itstpclab; o2::dataformats::MCTruthContainer toflab; if (mUseMC) { const auto toflabel = pc.inputs().get*>("tofclusterlabel"); - itslab = pc.inputs().get>("itstracklabel"); - tpclab = pc.inputs().get>("tpctracklabel"); + itstpclab = pc.inputs().get>("itstpclabel"); toflab = std::move(*toflabel); } - mMatcher.run(tracksRO, clustersRO, toflab, itslab, tpclab); + mMatcher.run(tracksRO, clustersRO, toflab, itstpclab); // in run_match_tof aggiugnere esplicitamente la chiamata a fill del tree (nella classe MatchTOF) e il metodo per leggere i vettori di output @@ -124,8 +122,6 @@ class TOFDPLRecoWorkflowTask pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHINFOS", 0, Lifetime::Timeframe}, mMatcher.getMatchedTrackVector()); if (mUseMC) { pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHTOF", 0, Lifetime::Timeframe}, mMatcher.getMatchedTOFLabelsVector()); - pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHTPC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTPCLabelsVector()); - pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHITS", 0, Lifetime::Timeframe}, mMatcher.getMatchedITSLabelsVector()); } pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "CALIBDATA", 0, Lifetime::Timeframe}, mMatcher.getCalibVector()); mTimer.Stop(); @@ -150,8 +146,7 @@ o2::framework::DataProcessorSpec getTOFRecoWorkflowSpec(bool useMC, bool useFIT) inputs.emplace_back("globaltrack", "GLO", "TPCITS", 0, Lifetime::Timeframe); if (useMC) { inputs.emplace_back("tofclusterlabel", o2::header::gDataOriginTOF, "CLUSTERSMCTR", 0, Lifetime::Timeframe); - inputs.emplace_back("itstracklabel", "GLO", "TPCITS_ITSMC", 0, Lifetime::Timeframe); - inputs.emplace_back("tpctracklabel", "GLO", "TPCITS_TPCMC", 0, Lifetime::Timeframe); + inputs.emplace_back("itstpclabel", "GLO", "TPCITS_MC", 0, Lifetime::Timeframe); } if (useFIT) { @@ -161,8 +156,6 @@ o2::framework::DataProcessorSpec getTOFRecoWorkflowSpec(bool useMC, bool useFIT) outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHINFOS", 0, Lifetime::Timeframe); if (useMC) { outputs.emplace_back(o2::header::gDataOriginTOF, "MCMATCHTOF", 0, Lifetime::Timeframe); - outputs.emplace_back(o2::header::gDataOriginTOF, "MCMATCHTPC", 0, Lifetime::Timeframe); - outputs.emplace_back(o2::header::gDataOriginTOF, "MCMATCHITS", 0, Lifetime::Timeframe); } outputs.emplace_back(o2::header::gDataOriginTOF, "CALIBDATA", 0, Lifetime::Timeframe); diff --git a/Detectors/GlobalTrackingWorkflow/tofworkflow/src/RecoWorkflowWithTPCSpec.cxx b/Detectors/GlobalTrackingWorkflow/tofworkflow/src/RecoWorkflowWithTPCSpec.cxx index 9a816637f2707..d9622404d4fc5 100644 --- a/Detectors/GlobalTrackingWorkflow/tofworkflow/src/RecoWorkflowWithTPCSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/tofworkflow/src/RecoWorkflowWithTPCSpec.cxx @@ -126,8 +126,6 @@ class TOFDPLRecoWorkflowWithTPCTask pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHINFOS_TPC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTrackVector()); if (mUseMC) { pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHTOF_TPC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTOFLabelsVector()); - pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHTPC_TPC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTPCLabelsVector()); - pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHITS_TPC", 0, Lifetime::Timeframe}, mMatcher.getMatchedITSLabelsVector()); } pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "CALIBDATA_TPC", 0, Lifetime::Timeframe}, mMatcher.getCalibVector()); mTimer.Stop(); diff --git a/Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedReaderSpec.cxx b/Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedReaderSpec.cxx index a9604d950e70e..2f8cd069deba2 100644 --- a/Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedReaderSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedReaderSpec.cxx @@ -31,9 +31,7 @@ namespace o2 namespace tof { o2::header::DataDescription ddMatchInfo{"MATCHINFOS"}, ddMatchInfo_tpc{"MATCHINFOS_TPC"}, - ddMCMatchTOF{"MCMATCHTOF"}, ddMCMatchTOF_tpc{"MCMATCHTOF_TPC"}, - ddMCMatchTPC{"MCMATCHTPC"}, ddMCMatchTPC_tpc{"MCMATCHTPC_TPC"}, - ddMCMatchITS{"MCMATCHITS"}, ddMCMatchITS_tpc{"MCMATCHITS_TPC"}; + ddMCMatchTOF{"MCMATCHTOF"}, ddMCMatchTOF_tpc{"MCMATCHTOF_TPC"}; void TOFMatchedReader::init(InitContext& ic) { @@ -60,8 +58,6 @@ void TOFMatchedReader::connectTree(const std::string& filename) } if (mUseMC) { mTree->SetBranchAddress("MatchTOFMCTruth", &mLabelTOFPtr); - mTree->SetBranchAddress("MatchTPCMCTruth", &mLabelTPCPtr); - mTree->SetBranchAddress("MatchITSMCTruth", &mLabelITSPtr); } LOG(INFO) << "Loaded tree from " << filename << " with " << mTree->GetEntries() << " entries"; } @@ -79,8 +75,6 @@ void TOFMatchedReader::run(ProcessingContext& pc) } if (mUseMC) { pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, mTPCMatch ? ddMCMatchTOF_tpc : ddMCMatchTOF, 0, Lifetime::Timeframe}, mLabelTOF); - pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, mTPCMatch ? ddMCMatchTPC_tpc : ddMCMatchTPC, 0, Lifetime::Timeframe}, mLabelTPC); - pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, mTPCMatch ? ddMCMatchITS_tpc : ddMCMatchITS, 0, Lifetime::Timeframe}, mLabelITS); } if (mTree->GetReadEntry() + 1 >= mTree->GetEntries()) { @@ -99,8 +93,6 @@ DataProcessorSpec getTOFMatchedReaderSpec(bool useMC, bool tpcmatch, bool readTr } if (useMC) { outputs.emplace_back(o2::header::gDataOriginTOF, tpcmatch ? ddMCMatchTOF_tpc : ddMCMatchTOF, 0, Lifetime::Timeframe); - outputs.emplace_back(o2::header::gDataOriginTOF, tpcmatch ? ddMCMatchTPC_tpc : ddMCMatchTPC, 0, Lifetime::Timeframe); - outputs.emplace_back(o2::header::gDataOriginTOF, tpcmatch ? ddMCMatchITS_tpc : ddMCMatchITS, 0, Lifetime::Timeframe); } return DataProcessorSpec{ diff --git a/Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedWriterSpec.cxx b/Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedWriterSpec.cxx index 8d7a0fc3ca1b4..e828a0458d5a4 100644 --- a/Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedWriterSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedWriterSpec.cxx @@ -46,19 +46,8 @@ DataProcessorSpec getTOFMatchedWriterSpec(bool useMC, const char* outdef, bool w auto loggerTofLabels = [](LabelsType const& labeltof) { LOG(INFO) << "TOF LABELS GOT " << labeltof.size() << " LABELS "; }; - auto loggerTpcLabels = [](LabelsType const& labeltpc) { - LOG(INFO) << "TPC LABELS GOT " << labeltpc.size() << " LABELS "; - }; - auto loggerItsLabels = [](LabelsType const& labelits) { - LOG(INFO) << "ITS LABELS GOT " << labelits.size() << " LABELS "; - }; - // TODO: there was a comment in the original implementation: - // RS why do we need to repeat ITS/TPC labels ? - // They can be extracted from TPC-ITS matches o2::header::DataDescription ddMatchInfo{"MATCHINFOS"}, ddMatchInfo_tpc{"MATCHINFOS_TPC"}, - ddMCMatchTOF{"MCMATCHTOF"}, ddMCMatchTOF_tpc{"MCMATCHTOF_TPC"}, - ddMCMatchTPC{"MCMATCHTPC"}, ddMCMatchTPC_tpc{"MCMATCHTPC_TPC"}, - ddMCMatchITS{"MCMATCHITS"}, ddMCMatchITS_tpc{"MCMATCHITS_TPC"}; + ddMCMatchTOF{"MCMATCHTOF"}, ddMCMatchTOF_tpc{"MCMATCHTOF_TPC"}; return MakeRootTreeWriterSpec(writeTOFTPC ? "TOFMatchedWriter_TPC" : "TOFMatchedWriter", outdef, @@ -76,17 +65,7 @@ DataProcessorSpec getTOFMatchedWriterSpec(bool useMC, const char* outdef, bool w "MatchTOFMCTruth", "MatchTOFMCTruth-branch-name", (useMC ? 1 : 0), // one branch if mc labels enabled - loggerTofLabels}, - BranchDefinition{InputSpec{"matchtpclabels", gDataOriginTOF, writeTOFTPC ? ddMCMatchTPC_tpc : ddMCMatchTPC, 0}, - "MatchTPCMCTruth", - "MatchTPCMCTruth-branch-name", - (useMC ? 1 : 0), // one branch if mc labels enabled - loggerTpcLabels}, - BranchDefinition{InputSpec{"matchitslabels", gDataOriginTOF, writeTOFTPC ? ddMCMatchITS_tpc : ddMCMatchITS, 0}, - "MatchITSMCTruth", - "MatchITSMCTruth-branch-name", - (useMC ? 1 : 0), // one branch if mc labels enabled - loggerItsLabels})(); + loggerTofLabels})(); } } // namespace tof } // namespace o2