Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding protections to PATTriggerProducer when the path has zero filters: 12_1 #35043

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 17 additions & 11 deletions PhysicsTools/PatAlgos/plugins/PATTriggerProducer.cc
Expand Up @@ -469,16 +469,22 @@ void PATTriggerProducer::produce(Event& iEvent, const EventSetup& iSetup) {
for (size_t indexPath = 0; indexPath < sizePaths; ++indexPath) {
const std::string& namePath = pathNames.at(indexPath);
unsigned indexLastFilterPathModules(handleTriggerResults->index(indexPath) + 1);
while (indexLastFilterPathModules > 0) {
--indexLastFilterPathModules;
const std::string& labelLastFilterPathModules(hltConfig.moduleLabel(indexPath, indexLastFilterPathModules));
unsigned indexLastFilterFilters =
handleTriggerEvent->filterIndex(InputTag(labelLastFilterPathModules, "", nameProcess_));
if (indexLastFilterFilters < sizeFilters) {
if (hltConfig.moduleType(labelLastFilterPathModules) == "HLTBool")
continue;
break;
const unsigned sizeModulesPath(hltConfig.size(indexPath));
//protection for paths with zero filters (needed for reco, digi, etc paths)
if (sizeModulesPath != 0) {
while (indexLastFilterPathModules > 0) {
--indexLastFilterPathModules;
const std::string& labelLastFilterPathModules(hltConfig.moduleLabel(indexPath, indexLastFilterPathModules));
unsigned indexLastFilterFilters =
handleTriggerEvent->filterIndex(InputTag(labelLastFilterPathModules, "", nameProcess_));
if (indexLastFilterFilters < sizeFilters) {
if (hltConfig.moduleType(labelLastFilterPathModules) == "HLTBool")
continue;
break;
}
}
} else {
indexLastFilterPathModules = 0;
}
TriggerPath triggerPath(namePath,
indexPath,
Expand All @@ -489,8 +495,8 @@ void PATTriggerProducer::produce(Event& iEvent, const EventSetup& iSetup) {
indexLastFilterPathModules,
hltConfig.saveTagsModules(namePath).size());
// add module names to path and states' map
const unsigned sizeModulesPath(hltConfig.size(indexPath));
assert(indexLastFilterPathModules < sizeModulesPath);

assert(indexLastFilterPathModules < sizeModulesPath || sizeModulesPath == 0);
std::map<unsigned, std::string> indicesModules;
for (size_t iM = 0; iM < sizeModulesPath; ++iM) {
const std::string& nameModule(hltConfig.moduleLabel(indexPath, iM));
Expand Down