CMS 3D CMS Logo

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  m_pathStatus.reserve(m_pathStatusTokens.size());
52  triggerNames.reserve(m_pathStatusTokens.size());
53  for (auto const& p : m_pathStatusTokens) {
54  auto const& handle = event.getHandle(p.second);
55  if (handle.isValid()) {
56  m_pathStatus.push_back(handle->accept());
57  triggerNames.push_back(p.first);
58  } else {
59  edm::LogError("MissingHLTPathStatus")
60  << "invalid handle for requested edm::HLTPathStatus with label \"" << p.first << "\"";
61  }
62  }
65  } else if (hasHLT()) {
66  // cache the HLT TriggerResults
68  if (not m_hltResults)
69  return false;
70 
71  // access the TriggerNames, and check if it has changed
74  m_hltUpdated = false;
75  } else {
77  m_hltUpdated = true;
78  }
79  }
80 
81  return true;
82  }
83 
84 } // namespace triggerExpression
std::vector< std::string > m_triggerNames
Strings const & triggerNames() const
Definition: TriggerNames.cc:48
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > const m_l1tUtmTriggerMenuToken
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
delete x;
Definition: CaloConfig.h:22
Log< level::Error, false > LogError
void setPathStatusToken(edm::BranchDescription const &branch, edm::ConsumesCollector &&iC)
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
const edm::TriggerResults * m_hltResults
edm::EDGetTokenT< edm::TriggerResults > m_hltResultsToken
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:61
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
const std::vector< std::string > & triggerNames() const
std::map< std::string, edm::EDGetTokenT< edm::HLTPathStatus > > m_pathStatusTokens
edm::ParameterSetID m_hltCacheID
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
Definition: event.py:1