CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TriggerExpressionData.cc
Go to the documentation of this file.
11 
12 namespace triggerExpression {
13 
15  if (branch.branchType() == edm::InEvent && branch.className() == "edm::HLTPathStatus" &&
16  branch.moduleLabel().rfind("HLT_", 0) == 0)
17  m_pathStatusTokens[branch.moduleLabel()] = iC.consumes<edm::HLTPathStatus>(
18  edm::InputTag(branch.moduleLabel(), branch.productInstanceName(), branch.processName()));
19  }
20 
22  // cache the event number
23  m_eventNumber = event.id().event();
24 
25  // access L1 objects only if L1 is used
26  if (hasL1T()) {
27  // cache the L1 GT results objects
28  auto const& l1t = edm::get(event, m_l1tResultsToken);
29  if (l1t.size() == 0 or l1t.isEmpty(0)) {
30  m_l1tResults = nullptr;
31  return false;
32  }
34  m_l1tResults = &l1t.at(0, 0).getAlgoDecisionInitial();
35  else
36  m_l1tResults = &l1t.at(0, 0).getAlgoDecisionFinal();
37 
38  // cache the L1 trigger menu
39  unsigned long long l1tCacheID = setup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
40  if (m_l1tCacheID == l1tCacheID) {
41  m_l1tUpdated = false;
42  } else {
44  m_l1tCacheID = l1tCacheID;
45  m_l1tUpdated = true;
46  }
47  }
48 
49  // access HLT objects only if HLT is used
50  if (usePathStatus()) {
51  m_pathStatus.clear();
52  std::vector<std::string> triggerNames;
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  }
59  }
62  } else if (hasHLT()) {
63  // cache the HLT TriggerResults
65  if (not m_hltResults)
66  return false;
67 
68  // access the TriggerNames, and check if it has changed
71  m_hltUpdated = false;
72  } else {
74  m_hltUpdated = true;
75  }
76  }
77 
78  return true;
79  }
80 
81 } // namespace triggerExpression
Handle.h
MessageLogger.h
triggerExpression::Data::m_hltResults
const edm::TriggerResults * m_hltResults
Definition: TriggerExpressionData.h:212
ESHandle.h
TriggerResults.h
L1TUtmTriggerMenuRcd
Definition: L1TUtmTriggerMenuRcd.h:11
edm::TriggerNames::parameterSetID
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:61
patZpeak.handle
handle
Definition: patZpeak.py:23
MicroEventContent_cff.branch
branch
Definition: MicroEventContent_cff.py:174
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
triggerExpression::Data::m_eventNumber
edm::EventNumber_t m_eventNumber
Definition: TriggerExpressionData.h:218
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
triggerExpression::Data::m_hltCacheID
edm::ParameterSetID m_hltCacheID
Definition: TriggerExpressionData.h:214
triggerExpression::Data::triggerNames
const std::vector< std::string > & triggerNames() const
Definition: TriggerExpressionData.h:167
triggerExpression::Data::m_pathStatus
std::vector< bool > m_pathStatus
Definition: TriggerExpressionData.h:210
triggerExpression::Data::m_l1tUpdated
bool m_l1tUpdated
Definition: TriggerExpressionData.h:207
triggerExpression::Data::m_pathStatusTokens
std::map< std::string, edm::EDGetTokenT< edm::HLTPathStatus > > m_pathStatusTokens
Definition: TriggerExpressionData.h:194
triggerExpression::Data::hasL1T
bool hasL1T() const
Definition: TriggerExpressionData.h:143
edm::TriggerNames::triggerNames
Strings const & triggerNames() const
Definition: TriggerNames.cc:48
edm::InEvent
Definition: BranchType.h:11
triggerExpression::Data::m_l1tResults
const std::vector< bool > * m_l1tResults
Definition: TriggerExpressionData.h:204
triggerExpression::Data::m_l1tCacheID
unsigned long long m_l1tCacheID
Definition: TriggerExpressionData.h:206
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Event.h
l1t
delete x;
Definition: CaloConfig.h:22
edm::get
T const & get(Event const &event, InputTag const &tag) noexcept(false)
Definition: Event.h:679
edm::HLTPathStatus
Definition: HLTPathStatus.h:33
TriggerNames.h
triggerExpression::Data::setEvent
bool setEvent(const edm::Event &event, const edm::EventSetup &setup)
Definition: TriggerExpressionData.cc:21
GlobalAlgBlk.h
triggerExpression::Data::m_l1tIgnoreMaskAndPrescale
bool m_l1tIgnoreMaskAndPrescale
Definition: TriggerExpressionData.h:200
triggerExpression::Data::m_hltResultsToken
edm::EDGetTokenT< edm::TriggerResults > m_hltResultsToken
Definition: TriggerExpressionData.h:196
edm::EventSetup
Definition: EventSetup.h:58
triggerExpression::Data::setPathStatusToken
void setPathStatusToken(edm::BranchDescription const &branch, edm::ConsumesCollector &&iC)
Definition: TriggerExpressionData.cc:14
triggerExpression::Data::usePathStatus
bool usePathStatus() const
Definition: TriggerExpressionData.h:141
triggerExpression::Data::m_hltUpdated
bool m_hltUpdated
Definition: TriggerExpressionData.h:215
triggerExpression::Data::hasHLT
bool hasHLT() const
Definition: TriggerExpressionData.h:145
triggerExpression::Data::m_hltMenu
const edm::TriggerNames * m_hltMenu
Definition: TriggerExpressionData.h:213
triggerExpression::Data::m_l1tUtmTriggerMenuToken
const edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1tUtmTriggerMenuToken
Definition: TriggerExpressionData.h:199
EventSetup.h
or
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
triggerExpression
Definition: TriggerExpressionConstant.h:6
Exception.h
TriggerExpressionData.h
edm::BranchDescription
Definition: BranchDescription.h:32
triggerExpression::Data::m_triggerNames
std::vector< std::string > m_triggerNames
Definition: TriggerExpressionData.h:211
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
triggerExpression::Data::m_l1tMenu
const L1TUtmTriggerMenu * m_l1tMenu
Definition: TriggerExpressionData.h:205
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
triggerExpression::Data::m_l1tResultsToken
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
Definition: TriggerExpressionData.h:198