@@ -369,6 +369,9 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
369369 if (iv != nv - 1 ) {
370370 auto & pve = pveVec[iv];
371371 static_cast <o2::dataformats::PrimaryVertex&>(pve) = pvvec[iv];
372+ if (mUseMC ) {
373+ pve.mcLb = recoData.getPrimaryVertexMCLabel (iv);
374+ }
372375 // find best matching FT0 signal
373376 float bestTimeDiff = 1000 , bestTime = -999 ;
374377 int bestFTID = -1 ;
@@ -611,13 +614,16 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
611614 vid[slot] = id;
612615 };
613616
617+ std::vector<o2::dataformats::PrimaryVertexExt> pveT; // neighbours in time
618+ std::vector<o2::dataformats::PrimaryVertexExt> pveZ; // neighbours in Z
619+ std::vector<int > idT (mMaxNeighbours ), idZ (mMaxNeighbours );
620+ std::vector<float > dT (mMaxNeighbours ), dZ (mMaxNeighbours );
614621 for (int cnt = 0 ; cnt < nvtot; cnt++) {
622+ pveT.clear (); // neighbours in time
623+ pveZ.clear (); // neighbours in Z
624+
615625 const auto & pve = pveVec[cnt];
616626 float tv = pve.getTimeStamp ().getTimeStamp ();
617- std::vector<o2::dataformats::PrimaryVertexExt> pveT (mMaxNeighbours ); // neighbours in time
618- std::vector<o2::dataformats::PrimaryVertexExt> pveZ (mMaxNeighbours ); // neighbours in Z
619- std::vector<int > idT (mMaxNeighbours ), idZ (mMaxNeighbours );
620- std::vector<float > dT (mMaxNeighbours ), dZ (mMaxNeighbours );
621627 for (int i = 0 ; i < mMaxNeighbours ; i++) {
622628 idT[i] = idZ[i] = -1 ;
623629 dT[i] = mMaxVTTimeDiff ;
@@ -666,14 +672,14 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
666672 }
667673 for (int i = 0 ; i < mMaxNeighbours ; i++) {
668674 if (idT[i] != -1 ) {
669- pveT[i] = pveVec[idT[i]];
675+ pveT. push_back ( pveVec[idT[i]]) ;
670676 } else {
671677 break ;
672678 }
673679 }
674680 for (int i = 0 ; i < mMaxNeighbours ; i++) {
675681 if (idZ[i] != -1 ) {
676- pveZ[i] = pveVec[idZ[i]];
682+ pveZ. push_back ( pveVec[idZ[i]]) ;
677683 } else {
678684 break ;
679685 }
0 commit comments