CMS 3D CMS Logo

TriggerExpressionData.cc
Go to the documentation of this file.
1 #include <boost/shared_ptr.hpp>
2 
15 
16 namespace triggerExpression {
17 
19 
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 {
41  m_l1tMenu = & edm::get<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>(setup);
42  m_l1tCacheID = l1tCacheID;
43  m_l1tUpdated = true;
44  }
45  }
46 
47  // access HLT objects only if HLT is used
48  if (hasHLT()) {
49  // cache the HLT TriggerResults
51  if (not m_hltResults)
52  return false;
53 
54  // access the TriggerNames, and check if it has changed
55  m_hltMenu = & event.triggerNames(* m_hltResults);
57  m_hltUpdated = false;
58  } else {
60  m_hltUpdated = true;
61  }
62  }
63 
64  return true;
65 }
66 
67 } // namespace triggerExpression
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
delete x;
Definition: CaloConfig.h:22
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:33
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
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
T const & get(Event const &event, InputTag const &tag)(false)
Definition: Event.h:658
edm::ParameterSetID m_hltCacheID
T get() const
Definition: EventSetup.h:71
edm::EventNumber_t m_eventNumber
unsigned long long m_l1tCacheID
Definition: event.py:1