@@ -602,20 +602,20 @@ void AODProducerWorkflowDPL::fillTrackTablesPerCollision(int collisionID,
602602 int end = start + trackRef.getEntriesOfSource (src);
603603 int nToReserve = end - start; // + last index for a given table
604604 if (src == GIndex::Source::MFT ) {
605- mftTracksCursor.reserve (nToReserve + mftTracksCursor.lastIndex ());
605+ mftTracksCursor.reserve (nToReserve + mftTracksCursor.lastIndex () + 1 );
606606 if (mStoreAllMFTCov ) {
607- mftTracksCovCursor.reserve (nToReserve + mftTracksCovCursor.lastIndex ());
607+ mftTracksCovCursor.reserve (nToReserve + mftTracksCovCursor.lastIndex () + 1 );
608608 }
609609 } else if (src == GIndex::Source::MCH || src == GIndex::Source::MFTMCH || src == GIndex::Source::MCHMID ) {
610- fwdTracksCursor.reserve (nToReserve + fwdTracksCursor.lastIndex ());
611- fwdTracksCovCursor.reserve (nToReserve + fwdTracksCovCursor.lastIndex ());
610+ fwdTracksCursor.reserve (nToReserve + fwdTracksCursor.lastIndex () + 1 );
611+ fwdTracksCovCursor.reserve (nToReserve + fwdTracksCovCursor.lastIndex () + 1 );
612612 if (!mStoreAllMFTCov && src == GIndex::Source::MFTMCH ) {
613- mftTracksCovCursor.reserve (nToReserve + mftTracksCovCursor.lastIndex ());
613+ mftTracksCovCursor.reserve (nToReserve + mftTracksCovCursor.lastIndex () + 1 );
614614 }
615615 } else {
616- tracksCursor.reserve (nToReserve + tracksCursor.lastIndex ());
617- tracksCovCursor.reserve (nToReserve + tracksCovCursor.lastIndex ());
618- tracksExtraCursor.reserve (nToReserve + tracksExtraCursor.lastIndex ());
616+ tracksCursor.reserve (nToReserve + tracksCursor.lastIndex () + 1 );
617+ tracksCovCursor.reserve (nToReserve + tracksCovCursor.lastIndex () + 1 );
618+ tracksExtraCursor.reserve (nToReserve + tracksExtraCursor.lastIndex () + 1 );
619619 }
620620 for (int ti = start; ti < end; ti++) {
621621 const auto & trackIndex = GIndices[ti];
@@ -715,9 +715,9 @@ void AODProducerWorkflowDPL::fillTrackTablesPerCollision(int collisionID,
715715 }
716716 // / Add strangeness tracks to the table
717717 auto sTracks = data.getStrangeTracks ();
718- tracksCursor.reserve (mVertexStrLUT [collisionID + 1 ] + tracksCursor.lastIndex ());
719- tracksCovCursor.reserve (mVertexStrLUT [collisionID + 1 ] + tracksCovCursor.lastIndex ());
720- tracksExtraCursor.reserve (mVertexStrLUT [collisionID + 1 ] + tracksExtraCursor.lastIndex ());
718+ tracksCursor.reserve (mVertexStrLUT [collisionID + 1 ] + tracksCursor.lastIndex () + 1 );
719+ tracksCovCursor.reserve (mVertexStrLUT [collisionID + 1 ] + tracksCovCursor.lastIndex () + 1 );
720+ tracksExtraCursor.reserve (mVertexStrLUT [collisionID + 1 ] + tracksExtraCursor.lastIndex () + 1 );
721721 for (int iS{mVertexStrLUT [collisionID]}; iS < mVertexStrLUT [collisionID + 1 ]; ++iS) {
722722 auto & collStrTrk = mCollisionStrTrk [iS];
723723 auto & sTrk = sTracks [collStrTrk.second ];
@@ -1236,9 +1236,9 @@ void AODProducerWorkflowDPL::fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTr
12361236 for (int src = GIndex::NSources; src--;) {
12371237 int start = trackRef.getFirstEntryOfSource (src);
12381238 int end = start + trackRef.getEntriesOfSource (src);
1239- mcMFTTrackLabelCursor.reserve (end - start + mcMFTTrackLabelCursor.lastIndex ());
1240- mcFwdTrackLabelCursor.reserve (end - start + mcFwdTrackLabelCursor.lastIndex ());
1241- mcTrackLabelCursor.reserve (end - start + mcTrackLabelCursor.lastIndex ());
1239+ mcMFTTrackLabelCursor.reserve (end - start + mcMFTTrackLabelCursor.lastIndex () + 1 );
1240+ mcFwdTrackLabelCursor.reserve (end - start + mcFwdTrackLabelCursor.lastIndex () + 1 );
1241+ mcTrackLabelCursor.reserve (end - start + mcTrackLabelCursor.lastIndex () + 1 );
12421242 for (int ti = start; ti < end; ti++) {
12431243 const auto trackIndex = primVerGIs[ti];
12441244
@@ -1320,7 +1320,7 @@ void AODProducerWorkflowDPL::fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTr
13201320 auto sTrackLabels = data.getStrangeTracksMCLabels ();
13211321 // check if vertexId and vertexId + 1 maps into mVertexStrLUT
13221322 if (!(vertexId < 0 || vertexId >= mVertexStrLUT .size () - 1 )) {
1323- mcTrackLabelCursor.reserve (mVertexStrLUT [vertexId + 1 ] + mcTrackLabelCursor.lastIndex ());
1323+ mcTrackLabelCursor.reserve (mVertexStrLUT [vertexId + 1 ] + mcTrackLabelCursor.lastIndex () + 1 );
13241324 for (int iS{mVertexStrLUT [vertexId]}; iS < mVertexStrLUT [vertexId + 1 ]; ++iS) {
13251325 auto & collStrTrk = mCollisionStrTrk [iS];
13261326 auto & label = sTrackLabels [collStrTrk.second ];
@@ -1448,9 +1448,9 @@ void AODProducerWorkflowDPL::addClustersToFwdTrkClsTable(const o2::globaltrackin
14481448
14491449 if (mchTrackID > -1 && mchTrackID < mchTracks.size ()) {
14501450 const auto & mchTrack = mchTracks[mchTrackID];
1451- fwdTrkClsCursor.reserve (mchTrack.getNClusters () + fwdTrkClsCursor.lastIndex ());
14521451 int first = mchTrack.getFirstClusterIdx ();
14531452 int last = mchTrack.getLastClusterIdx ();
1453+ fwdTrkClsCursor.reserve (last - first + 1 + fwdTrkClsCursor.lastIndex () + 1 );
14541454 for (int i = first; i <= last; i++) {
14551455 const auto & cluster = mchClusters[i];
14561456 fwdTrkClsCursor (fwdTrackId,
@@ -1678,10 +1678,10 @@ void AODProducerWorkflowDPL::addToCaloTable(TCaloHandler& caloHandler, TCaloCurs
16781678 auto inputEvent = caloHandler.buildEvent (eventID);
16791679 auto cellsInEvent = inputEvent.mCells ; // get cells belonging to current event
16801680 auto cellMClabels = inputEvent.mMCCellLabels ; // get MC labels belonging to current event (only implemented for EMCal currently!)
1681- caloCellCursor.reserve (cellsInEvent.size () + caloCellCursor.lastIndex ());
1682- caloTRGCursor.reserve (cellsInEvent.size () + caloTRGCursor.lastIndex ());
1681+ caloCellCursor.reserve (cellsInEvent.size () + caloCellCursor.lastIndex () + 1 );
1682+ caloTRGCursor.reserve (cellsInEvent.size () + caloTRGCursor.lastIndex () + 1 );
16831683 if (mUseMC ) {
1684- mcCaloCellLabelCursor.reserve (cellsInEvent.size () + mcCaloCellLabelCursor.lastIndex ());
1684+ mcCaloCellLabelCursor.reserve (cellsInEvent.size () + mcCaloCellLabelCursor.lastIndex () + 1 );
16851685 }
16861686 for (auto iCell = 0U ; iCell < cellsInEvent.size (); iCell++) {
16871687 caloCellCursor (bcID,
0 commit comments