File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -1128,14 +1128,17 @@ void AODProducerWorkflowDPL::fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTr
11281128
11291129 // filling the tables with the strangeness tracking labels
11301130 auto sTrackLabels = data.getStrangeTracksMCLabels ();
1131- mcTrackLabelCursor.reserve (mVertexStrLUT [vertexId + 1 ] + mcTrackLabelCursor.lastIndex ());
1132- for (int iS{mVertexStrLUT [vertexId]}; iS < mVertexStrLUT [vertexId + 1 ]; ++iS) {
1133- auto & collStrTrk = mCollisionStrTrk [iS];
1134- auto & label = sTrackLabels [collStrTrk.second ];
1135- MCLabels labelHolder;
1136- labelHolder.labelID = label.isValid () ? (*mToStore [label.getSourceID ()][label.getEventID ()])[label.getTrackID ()] : -1 ;
1137- labelHolder.labelMask = (label.isFake () << 15 ) | (label.isNoise () << 14 );
1138- mcTrackLabelCursor (labelHolder.labelID , labelHolder.labelMask );
1131+ // check if vertexId and vertexId + 1 maps into mVertexStrLUT
1132+ if (!(vertexId < 0 || vertexId >= mVertexStrLUT .size () - 1 )) {
1133+ mcTrackLabelCursor.reserve (mVertexStrLUT [vertexId + 1 ] + mcTrackLabelCursor.lastIndex ());
1134+ for (int iS{mVertexStrLUT [vertexId]}; iS < mVertexStrLUT [vertexId + 1 ]; ++iS) {
1135+ auto & collStrTrk = mCollisionStrTrk [iS];
1136+ auto & label = sTrackLabels [collStrTrk.second ];
1137+ MCLabels labelHolder;
1138+ labelHolder.labelID = label.isValid () ? (*mToStore [label.getSourceID ()][label.getEventID ()])[label.getTrackID ()] : -1 ;
1139+ labelHolder.labelMask = (label.isFake () << 15 ) | (label.isNoise () << 14 );
1140+ mcTrackLabelCursor (labelHolder.labelID , labelHolder.labelMask );
1141+ }
11391142 }
11401143}
11411144
You can’t perform that action at this time.
0 commit comments