|
21 | 21 |
|
22 | 22 | using namespace o2::vertexing; |
23 | 23 |
|
| 24 | +void VertexTrackMatcher::init() |
| 25 | +{ |
| 26 | + const auto& PVParams = o2::vertexing::PVertexerParams::Instance(); |
| 27 | + mITSGloSources.clear(); |
| 28 | + if (PVParams.fillITSGloContributors) { // collect sources of global tracks with ITS contributor |
| 29 | + for (int i = 0; i < GIndex::NSources; i++) { |
| 30 | + if (GIndex::includesDet(o2::detectors::DetID::ITS, GIndex::getSourceDetectorsMask(i)) && i != GIndex::ITSAB) { |
| 31 | + mITSGloSources.push_back(i); |
| 32 | + } |
| 33 | + } |
| 34 | + } |
| 35 | +} |
| 36 | + |
24 | 37 | void VertexTrackMatcher::process(const o2::globaltracking::RecoContainer& recoData, |
25 | 38 | std::vector<VTIndex>& trackIndex, |
26 | 39 | std::vector<VRef>& vtxRefs) |
@@ -123,6 +136,22 @@ void VertexTrackMatcher::process(const o2::globaltracking::RecoContainer& recoDa |
123 | 136 | vr.setFirstEntryOfSource(oldSrc, trackIndex.size()); |
124 | 137 | } |
125 | 138 | vr.setEnd(trackIndex.size()); |
| 139 | + |
| 140 | + if (PVParams.fillITSGloContributors) { |
| 141 | + auto& ITSGloContributors = vr.getITSGloContributors(); |
| 142 | + ITSGloContributors.setFirstEntry(trackIndex.size()); |
| 143 | + for (auto srcITS : mITSGloSources) { |
| 144 | + const int fst = vr.getFirstEntryOfSource(srcITS), lst = fst + vr.getEntriesOfSource(srcITS); |
| 145 | + for (int ii = fst; ii < lst; ii++) { |
| 146 | + auto vid = trackIndex[ii]; |
| 147 | + if (vid.isPVContributor()) { |
| 148 | + trackIndex.push_back(ii == GIndex::ITS ? vid : recoData.getITSContributorGID(vid)); |
| 149 | + } |
| 150 | + } |
| 151 | + } |
| 152 | + ITSGloContributors.setEntries(trackIndex.size() - ITSGloContributors.getFirstEntry()); |
| 153 | + } |
| 154 | + |
126 | 155 | if (logVertices) { |
127 | 156 | LOG(info) << vr; |
128 | 157 | } |
|
0 commit comments