@@ -575,7 +575,12 @@ void VertexerTraits::addTruthSeedingVertices()
575575 int64_t roFrameBiasInBC = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance ().roFrameBiasInBC ;
576576 int64_t roFrameLengthInBC = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance ().roFrameLengthInBC ;
577577 o2::steer::MCKinematicsReader mcReader (dc);
578- std::map<int , bounded_vector<Vertex>> vertices;
578+ struct VertInfo {
579+ bounded_vector<Vertex> vertices;
580+ bounded_vector<int > srcs;
581+ bounded_vector<int > events;
582+ };
583+ std::map<int , VertInfo> vertices;
579584 for (int iSrc{0 }; iSrc < mcReader.getNSources (); ++iSrc) {
580585 auto eveId2colId = dc->getCollisionIndicesForSource (iSrc);
581586 for (int iEve{0 }; iEve < mcReader.getNEvents (iSrc); ++iEve) {
@@ -584,7 +589,11 @@ void VertexerTraits::addTruthSeedingVertices()
584589 const auto & eve = mcReader.getMCEventHeader (iSrc, iEve);
585590 int rofId = ((ir - raw::HBFUtils::Instance ().getFirstSampledTFIR ()).toLong () - roFrameBiasInBC) / roFrameLengthInBC;
586591 if (!vertices.contains (rofId)) {
587- vertices[rofId] = bounded_vector<Vertex>(mMemoryPool .get ());
592+ vertices[rofId] = {
593+ .vertices = bounded_vector<Vertex>(mMemoryPool .get ()),
594+ .srcs = bounded_vector<int >(mMemoryPool .get ()),
595+ .events = bounded_vector<int >(mMemoryPool .get ()),
596+ };
588597 }
589598 Vertex vert;
590599 vert.setTimeStamp (rofId);
@@ -595,7 +604,9 @@ void VertexerTraits::addTruthSeedingVertices()
595604 vert.setChi2 (1 );
596605 constexpr float cov = 50e-9 ;
597606 vert.setCov (cov, cov, cov, cov, cov, cov);
598- vertices[rofId].push_back (vert);
607+ vertices[rofId].vertices .push_back (vert);
608+ vertices[rofId].srcs .push_back (iSrc);
609+ vertices[rofId].events .push_back (iEve);
599610 }
600611 }
601612 }
@@ -604,10 +615,11 @@ void VertexerTraits::addTruthSeedingVertices()
604615 bounded_vector<Vertex> verts (mMemoryPool .get ());
605616 bounded_vector<std::pair<o2::MCCompLabel, float >> polls (mMemoryPool .get ());
606617 if (vertices.contains (iROF)) {
607- verts = vertices[iROF];
618+ const auto & vertInfo = vertices[iROF];
619+ verts = vertInfo.vertices ;
608620 nVerts += verts.size ();
609621 for (size_t i{0 }; i < verts.size (); ++i) {
610- o2::MCCompLabel lbl; // unset label for now
622+ o2::MCCompLabel lbl ( o2::MCCompLabel::maxTrackID (), vertInfo. events [i], vertInfo. srcs [i], false );
611623 polls.emplace_back (lbl, 1 .f );
612624 }
613625 } else {
0 commit comments