Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,17 @@ class VtxTrackRef : public RangeReference<int, int>
// set the last +1 element index and finalize all references
void setEnd(int end);

const RangeReference<int, int>& getITSGloContributors() const { return mITSGloContributors; }
RangeReference<int, int>& getITSGloContributors() { return mITSGloContributors; }

private:
using RangeReference<int, int>::RangeReference;
int mVtxID = -1; // vertex ID. The reference for unassigned tracks will have it negative!
std::array<int, VtxTrackIndex::Source::NSources - 1> mFirstEntrySource{0};

ClassDefNV(VtxTrackRef, 2);
RangeReference<int, int> 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);
Expand Down
3 changes: 3 additions & 0 deletions DataFormats/Reconstruction/src/VtxTrackRef.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
5 changes: 0 additions & 5 deletions Detectors/GlobalTracking/src/MatchCosmics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<o2::detectors::DetID::MFT>::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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct PVertexerParams : public o2::conf::ConfigurableParamHelper<PVertexerParam
float nSigmaTimeTrack = 4.; ///< define track time bracket as +- this number of sigmas of its time resolution
float timeMarginTrackTime = 0.5; ///< additive marginal error in \mus to track time bracket
float timeMarginVertexTime = 0.0; ///< additive marginal error to \mus vertex time bracket

bool fillITSGloContributors = false; ///< fill separate entry for ITS contributors
O2ParamDef(PVertexerParams, "pvertexer");
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class VertexTrackMatcher
int origID = -1; ///< vertex origin id
};

void init();
void process(const o2::globaltracking::RecoContainer& recoData,
std::vector<VTIndex>& trackIndex, // Global ID's for associated tracks
std::vector<VRef>& vtxRefs); // references on these tracks
Expand All @@ -69,6 +70,7 @@ class VertexTrackMatcher

private:
void extractTracks(const o2::globaltracking::RecoContainer& data, const std::unordered_map<GIndex, bool>& vcont);
std::vector<int> mITSGloSources;
std::vector<TrackTBracket> mTBrackets;
float mITSROFrameLengthMUS = 0; ///< ITS RO frame in mus
float mMFTROFrameLengthMUS = 0; ///< MFT RO frame in mus
Expand Down
29 changes: 29 additions & 0 deletions Detectors/Vertexing/src/VertexTrackMatcher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<VTIndex>& trackIndex,
std::vector<VRef>& vtxRefs)
Expand Down Expand Up @@ -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;
}
Expand Down