CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::TriggerResultsByName Class Reference

#include <TriggerResultsByName.h>

Public Member Functions

bool accept () const
 
bool accept (std::string const &pathName) const
 
bool accept (unsigned i) const
 
HLTPathStatus const & at (std::string const &pathName) const
 
HLTPathStatus const & at (unsigned i) const
 
bool error () const
 
bool error (std::string const &pathName) const
 
bool error (unsigned i) const
 
unsigned index (std::string const &pathName) const
 
unsigned index (unsigned i) const
 
bool isValid () const
 
HLTPathStatus const & operator[] (std::string const &pathName) const
 
HLTPathStatus const & operator[] (unsigned i) const
 
ParameterSetID const & parameterSetID () const
 
std::vector< std::string >::size_type size () const
 
hlt::HLTState state (std::string const &pathName) const
 
hlt::HLTState state (unsigned i) const
 
unsigned triggerIndex (std::string const &pathName) const
 
std::string const & triggerName (unsigned i) const
 
std::vector< std::string > const & triggerNames () const
 
 TriggerResultsByName (TriggerResults const *triggerResults, TriggerNames const *triggerNames)
 
bool wasrun () const
 
bool wasrun (std::string const &pathName) const
 
bool wasrun (unsigned i) const
 

Private Member Functions

unsigned getAndCheckIndex (std::string const &pathName) const
 
void throwTriggerNamesMissing () const
 
void throwTriggerResultsMissing () const
 

Private Attributes

TriggerNames const * triggerNames_
 
TriggerResults const * triggerResults_
 

Detailed Description

Definition at line 48 of file TriggerResultsByName.h.

Constructor & Destructor Documentation

TriggerResultsByName::TriggerResultsByName ( TriggerResults const *  triggerResults,
TriggerNames const *  triggerNames 
)

Definition at line 9 of file TriggerResultsByName.cc.

References Exception, edm::TriggerResults::parameterSetID(), edm::TriggerNames::parameterSetID(), edm::HLTGlobalStatus::size(), edm::TriggerNames::size(), triggerNames_, triggerResults_, and edm::errors::Unknown.

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  }
TriggerNames const * triggerNames_
Strings::size_type size() const
Definition: TriggerNames.cc:31
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:33
std::vector< std::string > const & triggerNames() const
unsigned int size() const
Get number of paths stored.
static std::string const triggerResults("TriggerResults")
TriggerResults const * triggerResults_
const ParameterSetID & parameterSetID() const
Get stored parameter set id.

Member Function Documentation

bool TriggerResultsByName::accept ( ) const
bool TriggerResultsByName::accept ( std::string const &  pathName) const

Definition at line 103 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::accept(), getAndCheckIndex(), mps_fire::i, throwTriggerResultsMissing(), and triggerResults_.

Referenced by Vispa.Gui.BoxContentDialog.BoxContentDialog::apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::apply(), and esMonitoring.FDJsonServer::handle_accept().

103  {
104  if (triggerResults_ == nullptr)
106  unsigned i = getAndCheckIndex(pathName);
107  return triggerResults_->accept(i);
108  }
unsigned getAndCheckIndex(std::string const &pathName) const
bool accept() const
Has at least one path accepted the event?
TriggerResults const * triggerResults_
bool TriggerResultsByName::accept ( unsigned  i) const
HLTPathStatus const & TriggerResultsByName::at ( std::string const &  pathName) const

Definition at line 64 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::at(), getAndCheckIndex(), mps_fire::i, throwTriggerResultsMissing(), and triggerResults_.

64  {
65  if (triggerResults_ == nullptr)
67  unsigned i = getAndCheckIndex(pathName);
68  return triggerResults_->at(i);
69  }
unsigned getAndCheckIndex(std::string const &pathName) const
const HLTPathStatus & at(const unsigned int i) const
TriggerResults const * triggerResults_
HLTPathStatus const & TriggerResultsByName::at ( unsigned  i) const

Definition at line 71 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::at(), throwTriggerResultsMissing(), and triggerResults_.

71  {
72  if (triggerResults_ == nullptr)
74  return triggerResults_->at(i);
75  }
const HLTPathStatus & at(const unsigned int i) const
TriggerResults const * triggerResults_
bool TriggerResultsByName::error ( ) const

Definition at line 58 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::error(), throwTriggerResultsMissing(), and triggerResults_.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag().

58  {
59  if (triggerResults_ == nullptr)
61  return triggerResults_->error();
62  }
bool error() const
Has any path encountered an error (exception)
TriggerResults const * triggerResults_
bool TriggerResultsByName::error ( std::string const &  pathName) const

Definition at line 116 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::error(), getAndCheckIndex(), mps_fire::i, throwTriggerResultsMissing(), and triggerResults_.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag().

116  {
117  if (triggerResults_ == nullptr)
119  unsigned i = getAndCheckIndex(pathName);
120  return triggerResults_->error(i);
121  }
unsigned getAndCheckIndex(std::string const &pathName) const
bool error() const
Has any path encountered an error (exception)
TriggerResults const * triggerResults_
bool TriggerResultsByName::error ( unsigned  i) const

Definition at line 123 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::error(), throwTriggerResultsMissing(), and triggerResults_.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag().

123  {
124  if (triggerResults_ == nullptr)
126  return triggerResults_->error(i);
127  }
bool error() const
Has any path encountered an error (exception)
TriggerResults const * triggerResults_
unsigned TriggerResultsByName::getAndCheckIndex ( std::string const &  pathName) const
private

Definition at line 185 of file TriggerResultsByName.cc.

References Exception, mps_fire::i, edm::errors::LogicError, edm::TriggerNames::size(), throwTriggerNamesMissing(), edm::TriggerNames::triggerIndex(), and triggerNames_.

Referenced by accept(), at(), error(), index(), operator[](), state(), and wasrun().

185  {
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  }
TriggerNames const * triggerNames_
Strings::size_type size() const
Definition: TriggerNames.cc:31
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:24
unsigned TriggerResultsByName::index ( std::string const &  pathName) const

Definition at line 142 of file TriggerResultsByName.cc.

References getAndCheckIndex(), mps_fire::i, edm::HLTGlobalStatus::index(), throwTriggerResultsMissing(), and triggerResults_.

Referenced by BeautifulSoup.PageElement::insert().

142  {
143  if (triggerResults_ == nullptr)
145  unsigned i = getAndCheckIndex(pathName);
146  return triggerResults_->index(i);
147  }
unsigned getAndCheckIndex(std::string const &pathName) const
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
TriggerResults const * triggerResults_
unsigned TriggerResultsByName::index ( unsigned  i) const

Definition at line 149 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::index(), throwTriggerResultsMissing(), and triggerResults_.

Referenced by BeautifulSoup.PageElement::insert().

149  {
150  if (triggerResults_ == nullptr)
152  return triggerResults_->index(i);
153  }
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
TriggerResults const * triggerResults_
bool TriggerResultsByName::isValid ( void  ) const

Definition at line 34 of file TriggerResultsByName.cc.

References triggerNames_, and triggerResults_.

Referenced by ntupleDataFormat._Object::_checkIsValid(), HSCPHLTFilter::filter(), HSCPValidator::makeHLTPlots(), and core.AutoHandle.AutoHandle::ReallyLoad().

34  {
35  if (triggerResults_ == nullptr || triggerNames_ == nullptr)
36  return false;
37  return true;
38  }
TriggerNames const * triggerNames_
TriggerResults const * triggerResults_
HLTPathStatus const & TriggerResultsByName::operator[] ( std::string const &  pathName) const

Definition at line 77 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::at(), getAndCheckIndex(), mps_fire::i, throwTriggerResultsMissing(), and triggerResults_.

77  {
78  if (triggerResults_ == nullptr)
80  unsigned i = getAndCheckIndex(pathName);
81  return triggerResults_->at(i);
82  }
unsigned getAndCheckIndex(std::string const &pathName) const
const HLTPathStatus & at(const unsigned int i) const
TriggerResults const * triggerResults_
HLTPathStatus const & TriggerResultsByName::operator[] ( unsigned  i) const

Definition at line 84 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::at(), throwTriggerResultsMissing(), and triggerResults_.

84  {
85  if (triggerResults_ == nullptr)
87  return triggerResults_->at(i);
88  }
const HLTPathStatus & at(const unsigned int i) const
TriggerResults const * triggerResults_
ParameterSetID const & TriggerResultsByName::parameterSetID ( ) const

Definition at line 40 of file TriggerResultsByName.cc.

References edm::TriggerResults::parameterSetID(), throwTriggerResultsMissing(), and triggerResults_.

40  {
41  if (triggerResults_ == nullptr)
44  }
TriggerResults const * triggerResults_
const ParameterSetID & parameterSetID() const
Get stored parameter set id.
std::vector< std::string >::size_type TriggerResultsByName::size ( void  ) const
hlt::HLTState TriggerResultsByName::state ( std::string const &  pathName) const

Definition at line 129 of file TriggerResultsByName.cc.

References getAndCheckIndex(), mps_fire::i, edm::HLTGlobalStatus::state(), throwTriggerResultsMissing(), and triggerResults_.

129  {
130  if (triggerResults_ == nullptr)
132  unsigned i = getAndCheckIndex(pathName);
133  return triggerResults_->state(i);
134  }
unsigned getAndCheckIndex(std::string const &pathName) const
TriggerResults const * triggerResults_
hlt::HLTState state(const unsigned int i) const
Get status of ith path.
hlt::HLTState TriggerResultsByName::state ( unsigned  i) const

Definition at line 136 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::state(), throwTriggerResultsMissing(), and triggerResults_.

136  {
137  if (triggerResults_ == nullptr)
139  return triggerResults_->state(i);
140  }
TriggerResults const * triggerResults_
hlt::HLTState state(const unsigned int i) const
Get status of ith path.
void TriggerResultsByName::throwTriggerNamesMissing ( ) const
private

Definition at line 206 of file TriggerResultsByName.cc.

References Exception, and edm::errors::LogicError.

Referenced by getAndCheckIndex(), triggerIndex(), triggerName(), and triggerNames().

206  {
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  }
void TriggerResultsByName::throwTriggerResultsMissing ( ) const
private

Definition at line 197 of file TriggerResultsByName.cc.

References Exception, and edm::errors::ProductNotFound.

Referenced by accept(), at(), error(), index(), operator[](), parameterSetID(), size(), state(), triggerIndex(), triggerName(), triggerNames(), and wasrun().

197  {
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  }
unsigned TriggerResultsByName::triggerIndex ( std::string const &  pathName) const

Definition at line 171 of file TriggerResultsByName.cc.

References throwTriggerNamesMissing(), throwTriggerResultsMissing(), edm::TriggerNames::triggerIndex(), triggerNames_, and triggerResults_.

Referenced by HSCPHLTFilter::filter(), and HSCPValidator::makeHLTPlots().

171  {
172  if (triggerResults_ == nullptr)
174  if (triggerNames_ == nullptr)
176  return triggerNames_->triggerIndex(pathName);
177  }
TriggerNames const * triggerNames_
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:24
TriggerResults const * triggerResults_
std::string const & TriggerResultsByName::triggerName ( unsigned  i) const

Definition at line 163 of file TriggerResultsByName.cc.

References throwTriggerNamesMissing(), throwTriggerResultsMissing(), edm::TriggerNames::triggerName(), triggerNames_, and triggerResults_.

Referenced by HSCPHLTFilter::filter(), and HSCPValidator::makeHLTPlots().

163  {
164  if (triggerResults_ == nullptr)
166  if (triggerNames_ == nullptr)
168  return triggerNames_->triggerName(i);
169  }
TriggerNames const * triggerNames_
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:22
TriggerResults const * triggerResults_
std::vector< std::string > const & TriggerResultsByName::triggerNames ( ) const

Definition at line 155 of file TriggerResultsByName.cc.

References throwTriggerNamesMissing(), throwTriggerResultsMissing(), edm::TriggerNames::triggerNames(), triggerNames_, and triggerResults_.

155  {
156  if (triggerResults_ == nullptr)
158  if (triggerNames_ == nullptr)
160  return triggerNames_->triggerNames();
161  }
TriggerNames const * triggerNames_
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
TriggerResults const * triggerResults_
bool TriggerResultsByName::wasrun ( ) const

Definition at line 46 of file TriggerResultsByName.cc.

References throwTriggerResultsMissing(), triggerResults_, and edm::HLTGlobalStatus::wasrun().

46  {
47  if (triggerResults_ == nullptr)
49  return triggerResults_->wasrun();
50  }
bool wasrun() const
Was at least one path run?
TriggerResults const * triggerResults_
bool TriggerResultsByName::wasrun ( std::string const &  pathName) const

Definition at line 90 of file TriggerResultsByName.cc.

References getAndCheckIndex(), mps_fire::i, throwTriggerResultsMissing(), triggerResults_, and edm::HLTGlobalStatus::wasrun().

90  {
91  if (triggerResults_ == nullptr)
93  unsigned i = getAndCheckIndex(pathName);
94  return triggerResults_->wasrun(i);
95  }
bool wasrun() const
Was at least one path run?
unsigned getAndCheckIndex(std::string const &pathName) const
TriggerResults const * triggerResults_
bool TriggerResultsByName::wasrun ( unsigned  i) const

Definition at line 97 of file TriggerResultsByName.cc.

References throwTriggerResultsMissing(), triggerResults_, and edm::HLTGlobalStatus::wasrun().

97  {
98  if (triggerResults_ == nullptr)
100  return triggerResults_->wasrun(i);
101  }
bool wasrun() const
Was at least one path run?
TriggerResults const * triggerResults_

Member Data Documentation

TriggerNames const* edm::TriggerResultsByName::triggerNames_
private
TriggerResults const* edm::TriggerResultsByName::triggerResults_
private