CMS 3D CMS Logo

TriggerResultsByName.cc
Go to the documentation of this file.
1 
6 
7 namespace edm {
8 
10  : triggerResults_(triggerResults), triggerNames_(triggerNames) {
11  // If either of these is true the object is in an invalid state
12  if (triggerResults_ == nullptr || triggerNames_ == nullptr) {
13  return;
14  }
15 
18  << "TriggerResultsByName::TriggerResultsByName, Trigger names vector and TriggerResults\n"
19  "have different ParameterSetID's. This should be impossible when the object is obtained\n"
20  "from the function named triggerResultsByName in the Event class, which is the way\n"
21  "TriggerResultsByName should always be created. If this is the case, please send\n"
22  "information to reproduce this problem to the edm developers. Otherwise, you are\n"
23  "using this class incorrectly and in a way that is not supported.\n";
24  }
25 
26  if (triggerResults_->size() != triggerNames_->size()) {
28  << "TriggerResultsByName::TriggerResultsByName, Trigger names vector\n"
29  "and TriggerResults have different sizes. This should be impossible,\n"
30  "please send information to reproduce this problem to the edm developers.\n";
31  }
32  }
33 
35  if (triggerResults_ == nullptr || triggerNames_ == nullptr)
36  return false;
37  return true;
38  }
39 
41  if (triggerResults_ == nullptr)
44  }
45 
47  if (triggerResults_ == nullptr)
49  return triggerResults_->wasrun();
50  }
51 
53  if (triggerResults_ == nullptr)
55  return triggerResults_->accept();
56  }
57 
59  if (triggerResults_ == nullptr)
61  return triggerResults_->error();
62  }
63 
65  if (triggerResults_ == nullptr)
67  unsigned i = getAndCheckIndex(pathName);
68  return triggerResults_->at(i);
69  }
70 
71  HLTPathStatus const& TriggerResultsByName::at(unsigned i) const {
72  if (triggerResults_ == nullptr)
74  return triggerResults_->at(i);
75  }
76 
78  if (triggerResults_ == nullptr)
80  unsigned i = getAndCheckIndex(pathName);
81  return triggerResults_->at(i);
82  }
83 
85  if (triggerResults_ == nullptr)
87  return triggerResults_->at(i);
88  }
89 
91  if (triggerResults_ == nullptr)
93  unsigned i = getAndCheckIndex(pathName);
94  return triggerResults_->wasrun(i);
95  }
96 
97  bool TriggerResultsByName::wasrun(unsigned i) const {
98  if (triggerResults_ == nullptr)
100  return triggerResults_->wasrun(i);
101  }
102 
104  if (triggerResults_ == nullptr)
106  unsigned i = getAndCheckIndex(pathName);
107  return triggerResults_->accept(i);
108  }
109 
110  bool TriggerResultsByName::accept(unsigned i) const {
111  if (triggerResults_ == nullptr)
113  return triggerResults_->accept(i);
114  }
115 
117  if (triggerResults_ == nullptr)
119  unsigned i = getAndCheckIndex(pathName);
120  return triggerResults_->error(i);
121  }
122 
123  bool TriggerResultsByName::error(unsigned i) const {
124  if (triggerResults_ == nullptr)
126  return triggerResults_->error(i);
127  }
128 
130  if (triggerResults_ == nullptr)
132  unsigned i = getAndCheckIndex(pathName);
133  return triggerResults_->state(i);
134  }
135 
137  if (triggerResults_ == nullptr)
139  return triggerResults_->state(i);
140  }
141 
143  if (triggerResults_ == nullptr)
145  unsigned i = getAndCheckIndex(pathName);
146  return triggerResults_->index(i);
147  }
148 
149  unsigned TriggerResultsByName::index(unsigned i) const {
150  if (triggerResults_ == nullptr)
152  return triggerResults_->index(i);
153  }
154 
155  std::vector<std::string> const& TriggerResultsByName::triggerNames() const {
156  if (triggerResults_ == nullptr)
158  if (triggerNames_ == nullptr)
160  return triggerNames_->triggerNames();
161  }
162 
164  if (triggerResults_ == nullptr)
166  if (triggerNames_ == nullptr)
168  return triggerNames_->triggerName(i);
169  }
170 
172  if (triggerResults_ == nullptr)
174  if (triggerNames_ == nullptr)
177  }
178 
180  if (triggerResults_ == nullptr)
182  return triggerResults_->size();
183  }
184 
186  if (triggerNames_ == nullptr)
188  unsigned i = triggerNames_->triggerIndex(pathName);
189  if (i == triggerNames_->size()) {
191  << "TriggerResultsByName::getAndCheckIndex\n"
192  << "Requested trigger name \"" << pathName << "\" does not match any known trigger.\n";
193  }
194  return i;
195  }
196 
199  << "TriggerResultsByName has a null pointer to TriggerResults.\n"
200  << "This probably means TriggerResults was not found in the Event\n"
201  << "because the product was dropped or never created. It could also\n"
202  << "mean it was requested for a process that does not exist or was\n"
203  << "misspelled\n";
204  }
205 
208  << "TriggerResultsByName has a null pointer to TriggerNames.\n"
209  << "This should never happen. It could indicate the ParameterSet\n"
210  << "containing the names is missing from the ParameterSet registry.\n"
211  << "Please report this to the edm developers along with instructions\n"
212  << "to reproduce the problem\n";
213  }
214 } // namespace edm
edm::hlt::HLTState
HLTState
status of a trigger path
Definition: HLTenums.h:16
mps_fire.i
i
Definition: mps_fire.py:428
edm::TriggerResultsByName::isValid
bool isValid() const
Definition: TriggerResultsByName.cc:34
TriggerResults.h
edm::TriggerNames::parameterSetID
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:61
edm::TriggerResultsByName::triggerName
std::string const & triggerName(unsigned i) const
Definition: TriggerResultsByName.cc:163
edm::errors::LogicError
Definition: EDMException.h:37
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::TriggerResultsByName::throwTriggerResultsMissing
void throwTriggerResultsMissing() const
Definition: TriggerResultsByName.cc:197
edm::TriggerResultsByName::throwTriggerNamesMissing
void throwTriggerNamesMissing() const
Definition: TriggerResultsByName.cc:206
edm::TriggerResultsByName::triggerIndex
unsigned triggerIndex(std::string const &pathName) const
Definition: TriggerResultsByName.cc:171
edm::HLTGlobalStatus::wasrun
bool wasrun() const
Was at least one path run?
Definition: HLTGlobalStatus.h:47
edm::TriggerResults::parameterSetID
const ParameterSetID & parameterSetID() const
Get stored parameter set id.
Definition: TriggerResults.h:57
edm::errors::Unknown
Definition: EDMException.h:29
edm::HLTGlobalStatus::error
bool error() const
Has any path encountered an error (exception)
Definition: HLTGlobalStatus.h:51
edm::TriggerResultsByName::at
HLTPathStatus const & at(std::string const &pathName) const
Definition: TriggerResultsByName.cc:64
edm::HLTGlobalStatus::state
hlt::HLTState state(const unsigned int i) const
Get status of ith path.
Definition: HLTGlobalStatus.h:68
edm::TriggerResultsByName::index
unsigned index(std::string const &pathName) const
Definition: TriggerResultsByName.cc:142
edm::HLTGlobalStatus::index
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
Definition: HLTGlobalStatus.h:70
EDMException.h
edm::TriggerResultsByName::triggerResults_
TriggerResults const * triggerResults_
Definition: TriggerResultsByName.h:109
edm::errors::ProductNotFound
Definition: EDMException.h:33
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
hltMonBTagIPClient_cfi.pathName
pathName
Definition: hltMonBTagIPClient_cfi.py:5
edm::HLTGlobalStatus::size
unsigned int size() const
Get number of paths stored.
Definition: HLTGlobalStatus.h:35
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
edm::TriggerResultsByName::TriggerResultsByName
TriggerResultsByName(TriggerResults const *triggerResults, TriggerNames const *triggerNames)
Definition: TriggerResultsByName.cc:9
edm::TriggerResultsByName::state
hlt::HLTState state(std::string const &pathName) const
Definition: TriggerResultsByName.cc:129
edm::Hash< ParameterSetType >
edm::TriggerNames::triggerNames
Strings const & triggerNames() const
Definition: TriggerNames.cc:48
edm::TriggerResultsByName::parameterSetID
ParameterSetID const & parameterSetID() const
Definition: TriggerResultsByName.cc:40
edm::TriggerResultsByName::triggerNames_
TriggerNames const * triggerNames_
Definition: TriggerResultsByName.h:110
commonCuts_cff.triggerResults_
triggerResults_
Definition: commonCuts_cff.py:17
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::TriggerResultsByName::wasrun
bool wasrun() const
Definition: TriggerResultsByName.cc:46
edm::HLTPathStatus
Definition: HLTPathStatus.h:33
TriggerNames.h
edm::TriggerResultsByName::accept
bool accept() const
Definition: TriggerResultsByName.cc:52
edm::TriggerResultsByName::operator[]
HLTPathStatus const & operator[](std::string const &pathName) const
Definition: TriggerResultsByName.cc:77
edm::HLTGlobalStatus::at
const HLTPathStatus & at(const unsigned int i) const
Definition: HLTGlobalStatus.h:55
edm::TriggerResultsByName::size
std::vector< std::string >::size_type size() const
Definition: TriggerResultsByName.cc:179
edm::TriggerNames::triggerIndex
unsigned int triggerIndex(std::string_view name) const
Definition: TriggerNames.cc:52
edm::TriggerNames::triggerName
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:50
edm::TriggerNames::size
std::size_t size() const
Definition: TriggerNames.cc:59
edm::TriggerResultsByName::getAndCheckIndex
unsigned getAndCheckIndex(std::string const &pathName) const
Definition: TriggerResultsByName.cc:185
edm::TriggerResultsByName::error
bool error() const
Definition: TriggerResultsByName.cc:58
Exception
Definition: hltDiff.cc:245
edm::TriggerNames
Definition: TriggerNames.h:55
edm::triggerResults
static const std::string triggerResults("TriggerResults")
edm::HLTGlobalStatus::accept
bool accept() const
Has at least one path accepted the event?
Definition: HLTGlobalStatus.h:49
TriggerResultsByName.h
edm::TriggerResultsByName::triggerNames
std::vector< std::string > const & triggerNames() const
Definition: TriggerResultsByName.cc:155
edm::TriggerResults
Definition: TriggerResults.h:35