Skip to content

Commit 7ed9227

Browse files
committed
ITS: truth seeding fill labels
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 5afd6cc commit 7ed9227

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,12 @@ void VertexerTraits::addTruthSeedingVertices()
508508
int64_t roFrameBiasInBC = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance().roFrameBiasInBC;
509509
int64_t roFrameLengthInBC = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance().roFrameLengthInBC;
510510
o2::steer::MCKinematicsReader mcReader(dc);
511-
std::map<int, bounded_vector<Vertex>> vertices;
511+
struct VertInfo {
512+
bounded_vector<Vertex> vertices;
513+
bounded_vector<int> srcs;
514+
bounded_vector<int> events;
515+
};
516+
std::map<int, VertInfo> vertices;
512517
for (int iSrc{0}; iSrc < mcReader.getNSources(); ++iSrc) {
513518
auto eveId2colId = dc->getCollisionIndicesForSource(iSrc);
514519
for (int iEve{0}; iEve < mcReader.getNEvents(iSrc); ++iEve) {
@@ -517,7 +522,11 @@ void VertexerTraits::addTruthSeedingVertices()
517522
const auto& eve = mcReader.getMCEventHeader(iSrc, iEve);
518523
int rofId = ((ir - raw::HBFUtils::Instance().getFirstSampledTFIR()).toLong() - roFrameBiasInBC) / roFrameLengthInBC;
519524
if (!vertices.contains(rofId)) {
520-
vertices[rofId] = bounded_vector<Vertex>(mMemoryPool.get());
525+
vertices[rofId] = {
526+
.vertices = bounded_vector<Vertex>(mMemoryPool.get()),
527+
.srcs = bounded_vector<int>(mMemoryPool.get()),
528+
.events = bounded_vector<int>(mMemoryPool.get()),
529+
};
521530
}
522531
Vertex vert;
523532
vert.setTimeStamp(rofId);
@@ -528,7 +537,9 @@ void VertexerTraits::addTruthSeedingVertices()
528537
vert.setChi2(1);
529538
constexpr float cov = 50e-9;
530539
vert.setCov(cov, cov, cov, cov, cov, cov);
531-
vertices[rofId].push_back(vert);
540+
vertices[rofId].vertices.push_back(vert);
541+
vertices[rofId].srcs.push_back(iSrc);
542+
vertices[rofId].events.push_back(iEve);
532543
}
533544
}
534545
}
@@ -537,10 +548,11 @@ void VertexerTraits::addTruthSeedingVertices()
537548
bounded_vector<Vertex> verts(mMemoryPool.get());
538549
bounded_vector<std::pair<o2::MCCompLabel, float>> polls(mMemoryPool.get());
539550
if (vertices.contains(iROF)) {
540-
verts = vertices[iROF];
551+
const auto& vertInfo = vertices[iROF];
552+
verts = vertInfo.vertices;
541553
nVerts += verts.size();
542554
for (size_t i{0}; i < verts.size(); ++i) {
543-
o2::MCCompLabel lbl; // unset label for now
555+
o2::MCCompLabel lbl(o2::MCCompLabel::maxTrackID(), vertInfo.events[i], vertInfo.srcs[i], false);
544556
polls.emplace_back(lbl, 1.f);
545557
}
546558
} else {

0 commit comments

Comments
 (0)