10 std::vector<unsigned int>
getTriggerIndices(
const std::vector<std::string> &requestedTriggers,
11 const std::vector<std::string> &triggersInEvent) {
12 std::vector<unsigned int> triggerIndices;
14 for (
const auto &requestedTriggerName : requestedTriggers) {
16 std::size_t wildcarPosition = name.find(
'*');
17 if (wildcarPosition != std::string::npos) {
19 name = name.substr(0, wildcarPosition - 1);
22 unsigned int triggerIndex = 0;
23 for (
const auto &triggerName : triggersInEvent) {
24 if (triggerName.find(name) != std::string::npos) {
25 triggerIndices.push_back(triggerIndex);
31 return triggerIndices;
37 results.resize(triggers.size());
40 if (triggers[
index] >= triggerResults.
size()) {
41 results[
index] =
false;
46 results[
index] =
true;
48 results[
index] =
false;
56 std::vector<unsigned int>
results;
58 for (
unsigned int i = 0;
i < triggerResults.size(); ++
i) {
59 if (triggerResults[
i]) {
60 results.push_back(triggers[i]);
69 if (
std::count(results.begin(), results.end(),
true) == 0) {
80 for (
const auto &
filter : hltFilters) {
85 const size_t nTriggers = triggerEvent.
filterIds(filterIndex).size();
86 for (
size_t i = 0;
i < nTriggers; ++
i) {
87 results.push_back(triggerObjects[triggerKeys[
i]]);
93 std::sort(results.begin(), results.end(), [](
const trigObj &obj1,
const trigObj &obj2) {
94 return obj1.et() > obj2.et();
99 std::vector<edm::InputTag>
getHLTFilters(
const std::vector<unsigned int> &triggers,
102 std::vector<edm::InputTag>
results;
103 for (
auto trigger : triggers) {
104 unsigned int hltIndexOffset(2);
105 unsigned int moduleIndex = hltConfig.
size(trigger) - hltIndexOffset;
109 results.push_back(filterInputTag);
121 triggerObjects.begin(),
122 triggerObjects.end(),
123 std::back_inserter(results),
unsigned int size() const
number of trigger paths in trigger table
trigger::TriggerObjectCollection getMatchedTriggerObjects(double eta, double phi, double maxDeltaR, const trigger::TriggerObjectCollection triggerObjects)
The single EDProduct to be saved for each event (AOD case)
trigger::size_type sizeFilters() const
bool accept() const
Has at least one path accepted the event?
const Keys & filterKeys(trigger::size_type index) const
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
trigger::TriggerObjectCollection getTriggerObjects(const std::vector< edm::InputTag > &hltFilters, const trigger::TriggerEvent &triggerEvent)
std::vector< unsigned int > getTriggerIndices(const std::vector< std::string > &requestedTriggers, const std::vector< std::string > &triggersInEvent)
Single trigger physics object (e.g., an isolated muon)
const Vids & filterIds(trigger::size_type index) const
const TriggerObjectCollection & getObjects() const
unsigned int size() const
Get number of paths stored.
std::vector< edm::InputTag > getHLTFilters(const std::vector< unsigned int > &triggers, const HLTConfigProvider &hltConfig, const std::string triggerProcess)
static std::string const triggerResults
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
std::vector< bool > getTriggerResults(const std::vector< unsigned int > &triggers, const edm::TriggerResults &triggerResults)
std::vector< size_type > Keys
std::vector< unsigned int > getFiredTriggerIndices(const std::vector< unsigned int > &triggers, const std::vector< bool > &triggerResults)
bool passesAnyTriggerFromList(const std::vector< unsigned int > &triggers, const edm::TriggerResults &triggerResults)