CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TriggerExpressionData.cc
Go to the documentation of this file.
11 
12 namespace triggerExpression {
13 
15  m_pathStatusTokens[branch.moduleLabel()] = iC.consumes<edm::HLTPathStatus>(
16  edm::InputTag(branch.moduleLabel(), branch.productInstanceName(), branch.processName()));
17  }
18 
20  // cache the event number
21  m_eventNumber = event.id().event();
22 
23  // access L1 objects only if L1 is used
24  if (hasL1T()) {
25  // cache the L1 GT results objects
26  auto const& l1t = edm::get(event, m_l1tResultsToken);
27  if (l1t.size() == 0 or l1t.isEmpty(0)) {
28  m_l1tResults = nullptr;
29  return false;
30  }
32  m_l1tResults = &l1t.at(0, 0).getAlgoDecisionInitial();
33  else
34  m_l1tResults = &l1t.at(0, 0).getAlgoDecisionFinal();
35 
36  // cache the L1 trigger menu
37  unsigned long long l1tCacheID = setup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
38  if (m_l1tCacheID == l1tCacheID) {
39  m_l1tUpdated = false;
40  } else {
42  m_l1tCacheID = l1tCacheID;
43  m_l1tUpdated = true;
44  }
45  }
46 
47  // access HLT objects only if HLT is used
48  if (usePathStatus()) {
49  m_pathStatus.clear();
50  std::vector<std::string> triggerNames;
51  for (auto const& p : m_pathStatusTokens) {
52  auto const& handle = event.getHandle(p.second);
53  if (handle.isValid()) {
54  m_pathStatus.push_back(handle->accept());
55  triggerNames.push_back(p.first);
56  }
57  }
60  } else if (hasHLT()) {
61  // cache the HLT TriggerResults
63  if (not m_hltResults)
64  return false;
65 
66  // access the TriggerNames, and check if it has changed
67  m_hltMenu = &event.triggerNames(*m_hltResults);
69  m_hltUpdated = false;
70  } else {
72  m_hltUpdated = true;
73  }
74  }
75 
76  return true;
77  }
78 
79 } // namespace triggerExpression
std::vector< std::string > m_triggerNames
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
const std::vector< std::string > & triggerNames() const
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > const m_l1tUtmTriggerMenuToken
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
std::string const & processName() const
Strings const & triggerNames() const
Definition: TriggerNames.cc:48
void setPathStatusToken(edm::BranchDescription const &branch, edm::ConsumesCollector &&iC)
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:61
bool getData(T &iHolder) const
Definition: EventSetup.h:128
std::string const & moduleLabel() const
std::string const & productInstanceName() const
const edm::TriggerResults * m_hltResults
edm::EDGetTokenT< edm::TriggerResults > m_hltResultsToken
tuple handle
Definition: patZpeak.py:23
const edm::TriggerNames * m_hltMenu
bool setEvent(const edm::Event &event, const edm::EventSetup &setup)
const L1TUtmTriggerMenu * m_l1tMenu
const std::vector< bool > * m_l1tResults
std::map< std::string, edm::EDGetTokenT< edm::HLTPathStatus > > m_pathStatusTokens
edm::ParameterSetID m_hltCacheID
T get() const
Definition: EventSetup.h:88
std::vector< bool > m_pathStatus
T const & get(Event const &event, InputTag const &tag) noexcept(false)
Definition: Event.h:679
edm::EventNumber_t m_eventNumber
unsigned long long m_l1tCacheID