Skip to content

Commit e0338e4

Browse files
committed
Add protection for signal filtering to be enabled only with emdedding
1 parent 35c4cb6 commit e0338e4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Detectors/AOD/src/AODProducerWorkflowSpec.cxx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,6 +2052,24 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
20522052
int totalNParts = 0;
20532053
for (int iCol = 0; iCol < nMCCollisions; iCol++) {
20542054
totalNParts += mcParts[iCol].size();
2055+
2056+
// if signal filtering enabled, let's check if there are more than one source; otherwise fatalise
2057+
if (mUseSigFiltMC) {
2058+
std::vector<int> sourceIDs{};
2059+
auto& colParts = mcParts[iCol];
2060+
for (auto colPart : colParts) {
2061+
int sourceID = colPart.sourceID;
2062+
if (std::find(sourceIDs.begin(), sourceIDs.end(), sourceID) == sourceIDs.end()) {
2063+
sourceIDs.push_back(sourceID);
2064+
}
2065+
if (sourceIDs.size() > 1) { // we found more than one, exit
2066+
break;
2067+
}
2068+
}
2069+
if (sourceIDs.size() <= 1) {
2070+
LOGP(fatal, "Signal filtering cannot be enabled without embedding. Please fix the configuration either enabling the embedding, or turning off the signal filtering.");
2071+
}
2072+
}
20552073
}
20562074
mcCollisionsCursor.reserve(totalNParts);
20572075

0 commit comments

Comments
 (0)