Skip to content

Commit 8003ea8

Browse files
Benedikt Volkelsawenzel
authored andcommitted
Assign MCCollID -1 for PVs with undefined labels
PVs made from tracks of mostly noise hits have labels with source and event ID of -1. In that case assign MCCollID of -1 as well
1 parent e8e4db3 commit 8003ea8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Detectors/AOD/src/AODProducerWorkflowSpec.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
11691169
for (auto& label : primVerLabels) {
11701170
auto it = std::find_if(mcColToEvSrc.begin(), mcColToEvSrc.end(),
11711171
[&label](const std::pair<int, int>& item) { return (item.first == label.getEventID() && item.second == label.getSourceID()); });
1172-
int32_t mcCollisionID = it - mcColToEvSrc.begin();
1172+
int32_t mcCollisionID = (it != mcColToEvSrc.end()) ? it - mcColToEvSrc.begin() : -1;
11731173
uint16_t mcMask = 0; // todo: set mask using normalized weights?
11741174
mcColLabelsCursor(0, mcCollisionID, mcMask);
11751175
}

0 commit comments

Comments
 (0)