CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HLTHighLevel Class Reference

#include <HLTHighLevel.h>

Inheritance diagram for HLTHighLevel:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 
 HLTHighLevel (const edm::ParameterSet &)
 
std::vector< std::string > pathsFromSetup (const std::string &key, const edm::Event &, const edm::EventSetup &iSetup) const
 get HLTPaths with key 'key' from EventSetup (AlCaRecoTriggerBitsRcd) More...
 
 ~HLTHighLevel () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Member Functions

void init (const edm::TriggerResults &results, const edm::Event &, const edm::EventSetup &iSetup, const edm::TriggerNames &triggerNames)
 initialize the trigger conditions (call this if the trigger paths have changed) More...
 
std::string const & moduleLabel () const
 
std::string const & pathName (const edm::Event &) const
 stolen from HLTFilter More...
 

Private Attributes

bool andOr_
 false = and-mode (all requested triggers), true = or-mode (at least one) More...
 
const std::string eventSetupPathsKey_
 not empty => use read paths from AlCaRecoTriggerBitsRcd via this key More...
 
std::vector< unsigned int > HLTPathsByIndex_
 list of required HLT triggers by HLT index More...
 
std::vector< std::string > HLTPathsByName_
 list of required HLT triggers by HLT name More...
 
std::vector< std::string > HLTPatterns_
 input patterns that will be expanded into trigger names More...
 
edm::InputTag inputTag_
 HLT TriggerResults EDProduct. More...
 
edm::EDGetTokenT< edm::TriggerResultsinputToken_
 
bool throw_
 throw on any requested trigger being unknown More...
 
edm::ParameterSetID triggerNamesID_
 HLT trigger names. More...
 
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchAlCaRecoTriggerBitsRcd_
 Watcher to be created and used if 'eventSetupPathsKey_' non empty: More...
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

See header file for documentation

Author
Martin Grunewald

This class is an HLTFilter (-> EDFilter) implementing filtering on HLT bits

Author
Martin Grunewald

Definition at line 38 of file HLTHighLevel.h.

Constructor & Destructor Documentation

HLTHighLevel::HLTHighLevel ( const edm::ParameterSet iConfig)
explicit

Definition at line 39 of file HLTHighLevel.cc.

References eventSetupPathsKey_, Exception, edm::ParameterSet::getParameter(), HLTPatterns_, AlCaHLTBitMon_QueryRunRegistry::string, and watchAlCaRecoTriggerBitsRcd_.

39  :
40  inputTag_ (iConfig.getParameter<edm::InputTag> ("TriggerResultsTag")),
41  inputToken_ (consumes<edm::TriggerResults>(inputTag_)),
42  triggerNamesID_ (),
43  andOr_ (iConfig.getParameter<bool> ("andOr")),
44  throw_ (iConfig.getParameter<bool> ("throw")),
45  eventSetupPathsKey_(iConfig.getParameter<std::string>("eventSetupPathsKey")),
47  HLTPatterns_ (iConfig.getParameter<std::vector<std::string> >("HLTPaths")),
50 {
51  // names and slot numbers are computed during the event loop,
52  // as they need to access the TriggerNames object via the TriggerResults
53 
54  if (!eventSetupPathsKey_.empty()) {
55  // If paths come from eventsetup, we must watch for IOV changes.
56  if (!HLTPatterns_.empty()) {
57  // We do not want double trigger path setting, so throw!
58  throw cms::Exception("Configuration")
59  << " HLTHighLevel instance: "<< iConfig.getParameter<std::string>("@module_label")
60  << "\n configured with " << HLTPatterns_.size() << " HLTPaths and\n"
61  << " eventSetupPathsKey " << eventSetupPathsKey_ << ", choose either of them.";
62  }
64  }
65 }
T getParameter(std::string const &) const
bool andOr_
false = and-mode (all requested triggers), true = or-mode (at least one)
Definition: HLTHighLevel.h:68
std::vector< unsigned int > HLTPathsByIndex_
list of required HLT triggers by HLT index
Definition: HLTHighLevel.h:89
edm::ParameterSetID triggerNamesID_
HLT trigger names.
Definition: HLTHighLevel.h:65
edm::EDGetTokenT< edm::TriggerResults > inputToken_
Definition: HLTHighLevel.h:62
const std::string eventSetupPathsKey_
not empty => use read paths from AlCaRecoTriggerBitsRcd via this key
Definition: HLTHighLevel.h:78
bool throw_
throw on any requested trigger being unknown
Definition: HLTHighLevel.h:71
std::vector< std::string > HLTPathsByName_
list of required HLT triggers by HLT name
Definition: HLTHighLevel.h:86
std::vector< std::string > HLTPatterns_
input patterns that will be expanded into trigger names
Definition: HLTHighLevel.h:83
edm::InputTag inputTag_
HLT TriggerResults EDProduct.
Definition: HLTHighLevel.h:61
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchAlCaRecoTriggerBitsRcd_
Watcher to be created and used if &#39;eventSetupPathsKey_&#39; non empty:
Definition: HLTHighLevel.h:80
HLTHighLevel::~HLTHighLevel ( )
override

Definition at line 67 of file HLTHighLevel.cc.

References watchAlCaRecoTriggerBitsRcd_.

68 {
69  delete watchAlCaRecoTriggerBitsRcd_; // safe on null pointer...
70 }
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchAlCaRecoTriggerBitsRcd_
Watcher to be created and used if &#39;eventSetupPathsKey_&#39; non empty:
Definition: HLTHighLevel.h:80

Member Function Documentation

void HLTHighLevel::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 77 of file HLTHighLevel.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DQMSequences_cfi::hltPaths, and AlCaHLTBitMon_QueryRunRegistry::string.

77  {
79  desc.add<edm::InputTag>("TriggerResultsTag",edm::InputTag("TriggerResults","","HLT"));
80  std::vector<std::string> hltPaths(0);
81  // # provide list of HLT paths (or patterns) you want
82  desc.add<std::vector<std::string> >("HLTPaths",hltPaths);
83  // # not empty => use read paths from AlCaRecoTriggerBitsRcd via this key
84  desc.add<std::string>("eventSetupPathsKey","");
85  // # how to deal with multiple triggers: True (OR) accept if ANY is true, False (AND) accept if ALL are true
86  desc.add<bool>("andOr",true);
87  // # throw exception on unknown path names
88  desc.add<bool>("throw",true);
89  descriptions.add("hltHighLevel", desc);
90 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTHighLevel::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 208 of file HLTHighLevel.cc.

References accept(), edm::HLTGlobalStatus::accept(), andOr_, edm::ESWatcher< T >::check(), edm::InputTag::encode(), Exception, edm::Event::getByToken(), HLTPathsByIndex_, HLTPathsByName_, mps_fire::i, init(), inputTag_, inputToken_, edm::HandleBase::isValid(), LogDebug, LogTrace, python.rootplot.argparse::message, moduleLabel(), gen::n, or, edm::TriggerNames::parameterSetID(), pathName(), edm::HLTGlobalStatus::size(), AlCaHLTBitMon_QueryRunRegistry::string, throw_, edm::Event::triggerNames(), triggerNamesID_, and watchAlCaRecoTriggerBitsRcd_.

209 {
210  using namespace std;
211  using namespace edm;
212 
213  // get hold of TriggerResults Object
215  iEvent.getByToken(inputToken_, trh);
216  if (trh.isValid()) {
217  LogDebug("HLTHighLevel") << "TriggerResults found, number of HLT paths: " << trh->size();
218  } else {
219  LogError("HLTHighLevel") << "TriggerResults product " << inputTag_.encode() << " not found - returning result=false!";
220  return false;
221  }
222 
223  // init the TriggerNames with the TriggerResults
224  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*trh);
225  bool config_changed = false;
226  if (triggerNamesID_ != triggerNames.parameterSetID()) {
227  triggerNamesID_ = triggerNames.parameterSetID();
228  config_changed = true;
229  }
230 
231  // (re)run the initialization stuff if
232  // - this is the first event
233  // - or the HLT table has changed
234  // - or selected trigger bits come from AlCaRecoTriggerBitsRcd and these changed
235  if (config_changed or (watchAlCaRecoTriggerBitsRcd_ and watchAlCaRecoTriggerBitsRcd_->check(iSetup))) {
236  this->init(*trh, iEvent, iSetup, triggerNames);
237  }
238  unsigned int n = HLTPathsByName_.size();
239  unsigned int nbad = 0;
240  unsigned int fired = 0;
241 
242  // count invalid and fired triggers
243  for (unsigned int i = 0; i < n; i++)
244  if (HLTPathsByIndex_[i] == (unsigned int) -1)
245  ++nbad;
246  else if (trh->accept(HLTPathsByIndex_[i]))
247  ++fired;
248 
249  if ((nbad > 0) and (config_changed or throw_)) {
250  // only generate the error message if it's actually going to be used
252 
253  for (unsigned int i = 0; i < n; i++)
254  if (HLTPathsByIndex_[i] == (unsigned int) -1)
255  message += HLTPathsByName_[i] + " ";
256 
257  if (config_changed) {
258  LogTrace("HLTHighLevel")
259  << " HLTHighLevel [instance: " << moduleLabel()
260  << " - path: " << pathName(iEvent)
261  << "] configured with " << nbad
262  << "/" << n
263  << " unknown HLT path names: " << message;
264  }
265 
266  if (throw_) {
267  throw cms::Exception("Configuration")
268  << " HLTHighLevel [instance: " << moduleLabel()
269  << " - path: " << pathName(iEvent)
270  << "] configured with " << nbad
271  << "/" << n
272  << " unknown HLT path names: " << message;
273  }
274  }
275 
276  // Boolean filter result (always at least one trigger)
277  const bool accept( (fired > 0) and ( andOr_ or (fired == n-nbad) ) );
278  LogDebug("HLTHighLevel") << "Accept = " << std::boolalpha << accept;
279 
280  return accept;
281 }
#define LogDebug(id)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
void init(const edm::TriggerResults &results, const edm::Event &, const edm::EventSetup &iSetup, const edm::TriggerNames &triggerNames)
initialize the trigger conditions (call this if the trigger paths have changed)
Definition: HLTHighLevel.cc:96
bool accept() const
Has at least one path accepted the event?
bool andOr_
false = and-mode (all requested triggers), true = or-mode (at least one)
Definition: HLTHighLevel.h:68
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
std::string encode() const
Definition: InputTag.cc:166
std::string const & moduleLabel() const
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:42
unsigned int size() const
Get number of paths stored.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< unsigned int > HLTPathsByIndex_
list of required HLT triggers by HLT index
Definition: HLTHighLevel.h:89
edm::ParameterSetID triggerNamesID_
HLT trigger names.
Definition: HLTHighLevel.h:65
bool isValid() const
Definition: HandleBase.h:74
#define LogTrace(id)
edm::EDGetTokenT< edm::TriggerResults > inputToken_
Definition: HLTHighLevel.h:62
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
bool throw_
throw on any requested trigger being unknown
Definition: HLTHighLevel.h:71
HLT enums.
std::string const & pathName(const edm::Event &) const
stolen from HLTFilter
std::vector< std::string > HLTPathsByName_
list of required HLT triggers by HLT name
Definition: HLTHighLevel.h:86
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:301
edm::InputTag inputTag_
HLT TriggerResults EDProduct.
Definition: HLTHighLevel.h:61
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchAlCaRecoTriggerBitsRcd_
Watcher to be created and used if &#39;eventSetupPathsKey_&#39; non empty:
Definition: HLTHighLevel.h:80
void HLTHighLevel::init ( const edm::TriggerResults results,
const edm::Event event,
const edm::EventSetup iSetup,
const edm::TriggerNames triggerNames 
)
private

initialize the trigger conditions (call this if the trigger paths have changed)

Definition at line 96 of file HLTHighLevel.cc.

References andOr_, edm::InputTag::encode(), eventSetupPathsKey_, Exception, HLTPathsByIndex_, HLTPathsByName_, HLTPatterns_, mps_fire::i, inputTag_, createfilelist::int, edm::is_glob(), LogDebug, LogTrace, match(), patRefSel_triggerMatching_cfi::matches, gen::n, pathsFromSetup(), listBenchmarks::pattern, edm::regexMatch(), edm::HLTGlobalStatus::size(), AlCaHLTBitMon_QueryRunRegistry::string, throw_, edm::TriggerNames::triggerIndex(), edm::TriggerNames::triggerName(), and edm::TriggerNames::triggerNames().

Referenced by filter().

100 {
101  unsigned int n;
102 
103  // clean up old data
104  HLTPathsByName_.clear();
105  HLTPathsByIndex_.clear();
106 
107  // Overwrite paths from EventSetup via AlCaRecoTriggerBitsRcd if configured:
108  if (!eventSetupPathsKey_.empty()) {
109  HLTPatterns_ = this->pathsFromSetup(eventSetupPathsKey_, event, iSetup);
110  }
111 
112  if (HLTPatterns_.empty()) {
113  // for empty input vector, default to all HLT trigger paths
114  n = result.size();
115  HLTPathsByName_.resize(n);
116  HLTPathsByIndex_.resize(n);
117  for (unsigned int i = 0; i < n; ++i) {
118  HLTPathsByName_[i] = triggerNames.triggerName(i);
119  HLTPathsByIndex_[i] = i;
120  }
121  } else {
122  // otherwise, expand wildcards in trigger names...
123  BOOST_FOREACH(const std::string & pattern, HLTPatterns_) {
124  if (edm::is_glob(pattern)) {
125  // found a glob pattern, expand it
126  std::vector< std::vector<std::string>::const_iterator > matches = edm::regexMatch(triggerNames.triggerNames(), pattern);
127  if (matches.empty()) {
128  // pattern does not match any trigger paths
129  if (throw_)
130  throw cms::Exception("Configuration") << "requested pattern \"" << pattern << "\" does not match any HLT paths";
131  else
132  edm::LogInfo("Configuration") << "requested pattern \"" << pattern << "\" does not match any HLT paths";
133  } else {
134  // store the matching patterns
135  BOOST_FOREACH(auto match, matches)
136  HLTPathsByName_.push_back(*match);
137  }
138  } else {
139  // found a trigger name, just copy it
140  HLTPathsByName_.push_back(pattern);
141  }
142  }
143  n = HLTPathsByName_.size();
144 
145  // ...and get hold of trigger indices
146  bool valid = false;
147  HLTPathsByIndex_.resize(n);
148  for (unsigned int i = 0; i < HLTPathsByName_.size(); i++) {
149  HLTPathsByIndex_[i] = triggerNames.triggerIndex(HLTPathsByName_[i]);
150  if (HLTPathsByIndex_[i] < result.size()) {
151  valid = true;
152  } else {
153  // trigger path not found
154  HLTPathsByIndex_[i] = (unsigned int) -1;
155  if (throw_)
156  throw cms::Exception("Configuration") << "requested HLT path \"" << HLTPathsByName_[i] << "\" does not exist";
157  else
158  edm::LogInfo("Configuration") << "requested HLT path \"" << HLTPathsByName_[i] << "\" does not exist";
159  }
160  }
161 
162  if (not valid) {
163  // no point in throwing - if requested, it should have already happened
164  edm::LogWarning("Configuration") << "none of the requested paths and pattern match any HLT path - no events will be selected";
165  }
166 
167  }
168 
169  // report on what is finally used
170  LogDebug("HLTHighLevel") << "HLT trigger paths: " + inputTag_.encode()
171  << " - Number of paths: " << n
172  << " - andOr mode: " << andOr_
173  << " - throw mode: " << throw_;
174 
175  LogTrace("HLTHighLevel") << "The HLT trigger paths (# index name):";
176  for (unsigned int i = 0; i < n; ++i)
177  if (HLTPathsByIndex_[i] == (unsigned int) -1)
178  LogTrace("HLTHighLevel") << " n/a " << HLTPathsByName_[i];
179  else
180  LogTrace("HLTHighLevel") << " " << std::setw(4) << HLTPathsByIndex_[i] << " " << HLTPathsByName_[i];
181 
182 }
#define LogDebug(id)
bool is_glob(std::string const &pattern)
Definition: RegexMatch.cc:18
bool andOr_
false = and-mode (all requested triggers), true = or-mode (at least one)
Definition: HLTHighLevel.h:68
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
std::string encode() const
Definition: InputTag.cc:166
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
std::vector< unsigned int > HLTPathsByIndex_
list of required HLT triggers by HLT index
Definition: HLTHighLevel.h:89
#define LogTrace(id)
const std::string eventSetupPathsKey_
not empty => use read paths from AlCaRecoTriggerBitsRcd via this key
Definition: HLTHighLevel.h:78
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
std::vector< std::string > pathsFromSetup(const std::string &key, const edm::Event &, const edm::EventSetup &iSetup) const
get HLTPaths with key &#39;key&#39; from EventSetup (AlCaRecoTriggerBitsRcd)
std::vector< std::vector< std::string >::const_iterator > regexMatch(std::vector< std::string > const &strings, std::regex const &regexp)
Definition: RegexMatch.cc:30
bool throw_
throw on any requested trigger being unknown
Definition: HLTHighLevel.h:71
std::vector< std::string > HLTPathsByName_
list of required HLT triggers by HLT name
Definition: HLTHighLevel.h:86
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
std::vector< std::string > HLTPatterns_
input patterns that will be expanded into trigger names
Definition: HLTHighLevel.h:83
edm::InputTag inputTag_
HLT TriggerResults EDProduct.
Definition: HLTHighLevel.h:61
std::string const & HLTHighLevel::moduleLabel ( ) const
private

Definition at line 288 of file HLTHighLevel.cc.

References edm::EDFilter::moduleDescription(), and edm::ModuleDescription::moduleLabel().

Referenced by filter(), and pathsFromSetup().

288  {
289  return moduleDescription().moduleLabel();
290 }
std::string const & moduleLabel() const
ModuleDescription const & moduleDescription() const
Definition: EDFilter.h:53
std::string const & HLTHighLevel::pathName ( const edm::Event event) const
private

stolen from HLTFilter

Definition at line 284 of file HLTHighLevel.cc.

Referenced by filter(), and pathsFromSetup().

284  {
285  return event.moduleCallingContext()->placeInPathContext()->pathContext()->pathName();
286 }
std::vector< std::string > HLTHighLevel::pathsFromSetup ( const std::string &  key,
const edm::Event event,
const edm::EventSetup iSetup 
) const

get HLTPaths with key 'key' from EventSetup (AlCaRecoTriggerBitsRcd)

Definition at line 186 of file HLTHighLevel.cc.

References AlCaRecoTriggerBits::decompose(), Exception, edm::EventSetup::get(), AlCaRecoTriggerBits::m_alcarecoToTrig, moduleLabel(), and pathName().

Referenced by init().

187 {
188  // Get map of strings to concatenated list of names of HLT paths from EventSetup:
190  iSetup.get<AlCaRecoTriggerBitsRcd>().get(triggerBits);
191  typedef std::map<std::string, std::string> TriggerMap;
192  const TriggerMap &triggerMap = triggerBits->m_alcarecoToTrig;
193 
194  auto listIter = triggerMap.find(key);
195  if (listIter == triggerMap.end()) {
196  throw cms::Exception("Configuration")
197  << " HLTHighLevel [instance: " << moduleLabel() << " - path: " << pathName(event)
198  << "]: No triggerList with key " << key << " in AlCaRecoTriggerBitsRcd";
199  }
200 
201  // We must avoid a map<string,vector<string> > in DB for performance reason,
202  // so the paths are mapped into one string that we have to decompose:
203  return triggerBits->decompose(listIter->second);
204 }
std::map< std::string, std::string > m_alcarecoToTrig
std::vector< std::string > decompose(const std::string &concatPaths) const
Decompose one value of map from concatenated string.
std::string const & moduleLabel() const
const T & get() const
Definition: EventSetup.h:59
std::string const & pathName(const edm::Event &) const
stolen from HLTFilter

Member Data Documentation

bool HLTHighLevel::andOr_
private

false = and-mode (all requested triggers), true = or-mode (at least one)

Definition at line 68 of file HLTHighLevel.h.

Referenced by filter(), and init().

const std::string HLTHighLevel::eventSetupPathsKey_
private

not empty => use read paths from AlCaRecoTriggerBitsRcd via this key

Definition at line 78 of file HLTHighLevel.h.

Referenced by HLTHighLevel(), and init().

std::vector<unsigned int> HLTHighLevel::HLTPathsByIndex_
private

list of required HLT triggers by HLT index

Definition at line 89 of file HLTHighLevel.h.

Referenced by filter(), and init().

std::vector<std::string> HLTHighLevel::HLTPathsByName_
private

list of required HLT triggers by HLT name

Definition at line 86 of file HLTHighLevel.h.

Referenced by filter(), and init().

std::vector<std::string> HLTHighLevel::HLTPatterns_
private

input patterns that will be expanded into trigger names

Definition at line 83 of file HLTHighLevel.h.

Referenced by HLTHighLevel(), and init().

edm::InputTag HLTHighLevel::inputTag_
private

HLT TriggerResults EDProduct.

Definition at line 61 of file HLTHighLevel.h.

Referenced by filter(), and init().

edm::EDGetTokenT<edm::TriggerResults> HLTHighLevel::inputToken_
private

Definition at line 62 of file HLTHighLevel.h.

Referenced by filter().

bool HLTHighLevel::throw_
private

throw on any requested trigger being unknown

Definition at line 71 of file HLTHighLevel.h.

Referenced by filter(), and init().

edm::ParameterSetID HLTHighLevel::triggerNamesID_
private

HLT trigger names.

Definition at line 65 of file HLTHighLevel.h.

Referenced by filter().

edm::ESWatcher<AlCaRecoTriggerBitsRcd>* HLTHighLevel::watchAlCaRecoTriggerBitsRcd_
private

Watcher to be created and used if 'eventSetupPathsKey_' non empty:

Definition at line 80 of file HLTHighLevel.h.

Referenced by filter(), HLTHighLevel(), and ~HLTHighLevel().