@@ -373,17 +373,17 @@ void PVertexer::finalizeVertex(const VertexingInput& input, const PVertex& vtx,
373373}
374374
375375// ___________________________________________________________________
376- void PVertexer::createMCLabels (gsl::span<const o2::MCCompLabel> lblITS, gsl::span< const o2::MCCompLabel> lblTPC ,
377- const std::vector<PVertex> vertices, const std::vector< o2::dataformats::VtxTrackIndex> vertexTrackIDs, const std::vector<V2TRef> v2tRefs,
376+ void PVertexer::createMCLabels (gsl::span<const o2::MCCompLabel> lblTracks, const std::vector<PVertex> vertices ,
377+ const std::vector<o2::dataformats::VtxTrackIndex> vertexTrackIDs, const std::vector<V2TRef> v2tRefs,
378378 std::vector<o2::MCEventLabel>& lblVtx)
379379{
380380 lblVtx.clear ();
381381 int nv = vertices.size ();
382- if (lblITS. size () != lblITS. size () || !lblITS .size ()) {
383- LOG (ERROR) << " labels are not provided or incorrect " ;
382+ if (!lblTracks .size ()) {
383+ LOG (ERROR) << " Track labels are not provided" ;
384384 return ;
385385 }
386- std::unordered_map<o2::MCEventLabel, int > labelOccurenceCorr, labelOccurenceITS ;
386+ std::unordered_map<o2::MCEventLabel, int > labelOccurenceCorr;
387387
388388 auto bestLbl = [](std::unordered_map<o2::MCEventLabel, int > mp, int norm) -> o2::MCEventLabel {
389389 o2::MCEventLabel best;
@@ -403,25 +403,19 @@ void PVertexer::createMCLabels(gsl::span<const o2::MCCompLabel> lblITS, gsl::spa
403403 for (const auto & v2t : v2tRefs) {
404404 int tref = v2t.getFirstEntry (), last = tref + v2t.getEntries ();
405405 labelOccurenceCorr.clear ();
406- labelOccurenceITS.clear ();
407406 o2::MCEventLabel winner; // unset at the moment
408407 for (; tref < last; tref++) {
409408 int tid = vertexTrackIDs[tref].getIndex ();
410- const auto & lITS = lblITS[tid];
411- const auto & lTPC = lblTPC[tid];
412- if (!lITS.isSet () || !lTPC.isSet ()) {
409+ const auto & lbl = lblTracks[tid];
410+ if (!lbl.isSet ()) {
413411 break ;
414412 }
415- if (lITS.getTrackID () == lTPC.getTrackID () && lITS.getEventID () == lTPC.getEventID () && lITS.getSourceID () == lTPC.getSourceID ()) {
416- labelOccurenceCorr[{lITS.getEventID (), lITS.getSourceID (), 0 .}]++;
417- } else {
418- labelOccurenceITS[{lITS.getEventID (), lITS.getSourceID (), 0 .}]++;
413+ if (!lbl.isFake ()) {
414+ labelOccurenceCorr[{lbl.getEventID (), lbl.getSourceID (), 0 .}]++;
419415 }
420416 }
421417 if (labelOccurenceCorr.size ()) {
422418 winner = bestLbl (labelOccurenceCorr, v2t.getEntries ());
423- } else if (labelOccurenceITS.size ()) {
424- winner = bestLbl (labelOccurenceITS, 0 ); // in absence of correct matches, set the ITS only label but set its weight to 0
425419 }
426420 lblVtx.push_back (winner);
427421 }
0 commit comments