Last active
May 16, 2017 16:07
-
-
Save tmadlener/6728757f9efc723bb5cc07c1db9e6aa5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<std::string> m_trigPathNames; // taken from config | |
edm::Handle<edm::TriggerResults> trigResults; | |
event.getByToken(m_trigResultToken, trigResults); // Token from config | |
std::vector<int> trigRes{}; | |
if (trigResults.isValid()) { | |
const edm::TriggerNames& triggerNames = event.triggerNames(*trigResults); | |
for (const auto& name : m_trigPathNames) { | |
auto trigBit = triggerNames.triggerIndex(edm::InputTag(name).label()); | |
// std::cout << name << " " << trigBit << "/" << trigResults->size() <<"\n"; | |
if (trigBit < trigResults->size() && trigResults->accept(trigBit) && !trigResults->error(trigBit)) { | |
trigRes.push_back(1); | |
} else { | |
trigRes.push_back(0); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment