diff --git a/DataFormats/Reconstruction/include/ReconstructionDataFormats/VtxTrackRef.h b/DataFormats/Reconstruction/include/ReconstructionDataFormats/VtxTrackRef.h index 5cdc9aafefb66..93b572376e443 100644 --- a/DataFormats/Reconstruction/include/ReconstructionDataFormats/VtxTrackRef.h +++ b/DataFormats/Reconstruction/include/ReconstructionDataFormats/VtxTrackRef.h @@ -80,12 +80,17 @@ class VtxTrackRef : public RangeReference // set the last +1 element index and finalize all references void setEnd(int end); + const RangeReference& getITSGloContributors() const { return mITSGloContributors; } + RangeReference& getITSGloContributors() { return mITSGloContributors; } + private: using RangeReference::RangeReference; int mVtxID = -1; // vertex ID. The reference for unassigned tracks will have it negative! std::array mFirstEntrySource{0}; - ClassDefNV(VtxTrackRef, 2); + RangeReference mITSGloContributors; // optionally filled to keep ITS parts of all contributors (including ITS-only ones) + + ClassDefNV(VtxTrackRef, 3); }; std::ostream& operator<<(std::ostream& os, const o2::dataformats::VtxTrackRef& v); diff --git a/DataFormats/Reconstruction/src/VtxTrackRef.cxx b/DataFormats/Reconstruction/src/VtxTrackRef.cxx index a3100b1933521..7bda5ebabd6ca 100644 --- a/DataFormats/Reconstruction/src/VtxTrackRef.cxx +++ b/DataFormats/Reconstruction/src/VtxTrackRef.cxx @@ -31,6 +31,9 @@ std::string VtxTrackRef::asString(bool skipEmpty) const str += fmt::format(", N{:s} : {:d}", VtxTrackIndex::getSourceName(i), getEntriesOfSource(i)); } } + if (mITSGloContributors.getEntries()) { + str += fmt::format("| ITScontributors: {} from {}", mITSGloContributors.getEntries(), mITSGloContributors.getFirstEntry()); + } return str; } diff --git a/Detectors/GlobalTracking/src/MatchCosmics.cxx b/Detectors/GlobalTracking/src/MatchCosmics.cxx index 0240ca5daa5ec..53c87d39974c7 100644 --- a/Detectors/GlobalTracking/src/MatchCosmics.cxx +++ b/Detectors/GlobalTracking/src/MatchCosmics.cxx @@ -589,11 +589,6 @@ void MatchCosmics::createSeeds(const o2::globaltracking::RecoContainer& data) seed.vtIDMax = std::max(short(iv), seed.vtIDMax); } } - int nrj1 = 0; - for (auto& s : mSeeds) { - if (s.matchID == Reject) - nrj1++; - } } } diff --git a/Detectors/GlobalTrackingWorkflow/src/VertexTrackMatcherSpec.cxx b/Detectors/GlobalTrackingWorkflow/src/VertexTrackMatcherSpec.cxx index 90e4dd4b0f001..c08d3ab9f4c53 100644 --- a/Detectors/GlobalTrackingWorkflow/src/VertexTrackMatcherSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/VertexTrackMatcherSpec.cxx @@ -98,6 +98,7 @@ void VertexTrackMatcherSpec::updateTimeDependentParams(ProcessingContext& pc) mMatcher.setITSROFrameLengthMUS(o2::base::GRPGeomHelper::instance().getGRPECS()->isDetContinuousReadOut(o2::detectors::DetID::ITS) ? alpParamsITS.roFrameLengthInBC * o2::constants::lhc::LHCBunchSpacingMUS : alpParamsITS.roFrameLengthTrig * 1.e-3); const auto& alpParamsMFT = o2::itsmft::DPLAlpideParam::Instance(); mMatcher.setMFTROFrameLengthMUS(o2::base::GRPGeomHelper::instance().getGRPECS()->isDetContinuousReadOut(o2::detectors::DetID::MFT) ? alpParamsMFT.roFrameLengthInBC * o2::constants::lhc::LHCBunchSpacingMUS : alpParamsMFT.roFrameLengthTrig * 1.e-3); + mMatcher.init(); LOGP(info, "VertexTrackMatcher ITSROFrameLengthMUS:{} MFTROFrameLengthMUS:{}", mMatcher.getITSROFrameLengthMUS(), mMatcher.getMFTROFrameLengthMUS()); } // we may have other params which need to be queried regularly diff --git a/Detectors/Vertexing/include/DetectorsVertexing/PVertexerParams.h b/Detectors/Vertexing/include/DetectorsVertexing/PVertexerParams.h index f7beb009a766d..5b1fd95639d88 100644 --- a/Detectors/Vertexing/include/DetectorsVertexing/PVertexerParams.h +++ b/Detectors/Vertexing/include/DetectorsVertexing/PVertexerParams.h @@ -116,7 +116,7 @@ struct PVertexerParams : public o2::conf::ConfigurableParamHelper& trackIndex, // Global ID's for associated tracks std::vector& vtxRefs); // references on these tracks @@ -69,6 +70,7 @@ class VertexTrackMatcher private: void extractTracks(const o2::globaltracking::RecoContainer& data, const std::unordered_map& vcont); + std::vector mITSGloSources; std::vector mTBrackets; float mITSROFrameLengthMUS = 0; ///< ITS RO frame in mus float mMFTROFrameLengthMUS = 0; ///< MFT RO frame in mus diff --git a/Detectors/Vertexing/src/VertexTrackMatcher.cxx b/Detectors/Vertexing/src/VertexTrackMatcher.cxx index f66d2b8c4d347..9e301c126a2e7 100644 --- a/Detectors/Vertexing/src/VertexTrackMatcher.cxx +++ b/Detectors/Vertexing/src/VertexTrackMatcher.cxx @@ -21,6 +21,19 @@ using namespace o2::vertexing; +void VertexTrackMatcher::init() +{ + const auto& PVParams = o2::vertexing::PVertexerParams::Instance(); + mITSGloSources.clear(); + if (PVParams.fillITSGloContributors) { // collect sources of global tracks with ITS contributor + for (int i = 0; i < GIndex::NSources; i++) { + if (GIndex::includesDet(o2::detectors::DetID::ITS, GIndex::getSourceDetectorsMask(i)) && i != GIndex::ITSAB) { + mITSGloSources.push_back(i); + } + } + } +} + void VertexTrackMatcher::process(const o2::globaltracking::RecoContainer& recoData, std::vector& trackIndex, std::vector& vtxRefs) @@ -123,6 +136,22 @@ void VertexTrackMatcher::process(const o2::globaltracking::RecoContainer& recoDa vr.setFirstEntryOfSource(oldSrc, trackIndex.size()); } vr.setEnd(trackIndex.size()); + + if (PVParams.fillITSGloContributors) { + auto& ITSGloContributors = vr.getITSGloContributors(); + ITSGloContributors.setFirstEntry(trackIndex.size()); + for (auto srcITS : mITSGloSources) { + const int fst = vr.getFirstEntryOfSource(srcITS), lst = fst + vr.getEntriesOfSource(srcITS); + for (int ii = fst; ii < lst; ii++) { + auto vid = trackIndex[ii]; + if (vid.isPVContributor()) { + trackIndex.push_back(ii == GIndex::ITS ? vid : recoData.getITSContributorGID(vid)); + } + } + } + ITSGloContributors.setEntries(trackIndex.size() - ITSGloContributors.getFirstEntry()); + } + if (logVertices) { LOG(info) << vr; }