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 10 of file TriggerResultsByName.cc.

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

11  :
14 
15  // If either of these is true the object is in an invalid state
16  if (triggerResults_ == 0 || triggerNames_ == 0) {
17  return;
18  }
19 
22  << "TriggerResultsByName::TriggerResultsByName, Trigger names vector and TriggerResults\n"
23  "have different ParameterSetID's. This should be impossible when the object is obtained\n"
24  "from the function named triggerResultsByName in the Event class, which is the way\n"
25  "TriggerResultsByName should always be created. If this is the case, please send\n"
26  "information to reproduce this problem to the edm developers. Otherwise, you are\n"
27  "using this class incorrectly and in a way that is not supported.\n";
28  }
29 
30  if (triggerResults_->size() != triggerNames_->size()) {
32  << "TriggerResultsByName::TriggerResultsByName, Trigger names vector\n"
33  "and TriggerResults have different sizes. This should be impossible,\n"
34  "please send information to reproduce this problem to the edm developers.\n";
35  }
36  }
TriggerNames const * triggerNames_
Strings::size_type size() const
Definition: TriggerNames.cc:39
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:42
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
bool TriggerResultsByName::accept ( unsigned  i) const
HLTPathStatus const & TriggerResultsByName::at ( std::string const &  pathName) const

Definition at line 75 of file TriggerResultsByName.cc.

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

Referenced by error().

75  {
77  unsigned i = getAndCheckIndex(pathName);
78  return triggerResults_->at(i);
79  }
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 83 of file TriggerResultsByName.cc.

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

83  {
85  return triggerResults_->at(i);
86  }
const HLTPathStatus & at(const unsigned int i) const
TriggerResults const * triggerResults_
bool TriggerResultsByName::error ( ) const
bool TriggerResultsByName::error ( std::string const &  pathName) const

Definition at line 135 of file TriggerResultsByName.cc.

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

Referenced by argparse.ArgumentParser::_get_option_tuples(), python.rootplot.argparse.ArgumentParser::_get_option_tuples(), argparse.ArgumentParser::_parse_known_args(), python.rootplot.argparse.ArgumentParser::_parse_known_args(), argparse.ArgumentParser::_parse_optional(), python.rootplot.argparse.ArgumentParser::_parse_optional(), argparse.ArgumentParser::_read_args_from_files(), python.rootplot.argparse.ArgumentParser::_read_args_from_files(), argparse.ArgumentParser::add_subparsers(), python.rootplot.argparse.ArgumentParser::add_subparsers(), Page1Parser.Page1Parser::check_for_whole_start_tag(), argparse.ArgumentParser::parse_args(), python.rootplot.argparse.ArgumentParser::parse_args(), argparse.ArgumentParser::parse_known_args(), and python.rootplot.argparse.ArgumentParser::parse_known_args().

135  {
137  unsigned i = getAndCheckIndex(pathName);
138  return triggerResults_->error(i);
139  }
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 143 of file TriggerResultsByName.cc.

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

Referenced by argparse.ArgumentParser::_get_option_tuples(), python.rootplot.argparse.ArgumentParser::_get_option_tuples(), argparse.ArgumentParser::_parse_known_args(), python.rootplot.argparse.ArgumentParser::_parse_known_args(), argparse.ArgumentParser::_parse_optional(), python.rootplot.argparse.ArgumentParser::_parse_optional(), argparse.ArgumentParser::_read_args_from_files(), python.rootplot.argparse.ArgumentParser::_read_args_from_files(), argparse.ArgumentParser::add_subparsers(), python.rootplot.argparse.ArgumentParser::add_subparsers(), Page1Parser.Page1Parser::check_for_whole_start_tag(), argparse.ArgumentParser::parse_args(), python.rootplot.argparse.ArgumentParser::parse_args(), argparse.ArgumentParser::parse_known_args(), and python.rootplot.argparse.ArgumentParser::parse_known_args().

143  {
145  return triggerResults_->error(i);
146  }
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 211 of file TriggerResultsByName.cc.

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

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

211  {
213  unsigned i = triggerNames_->triggerIndex(pathName);
214  if (i == triggerNames_->size()) {
216  << "TriggerResultsByName::getAndCheckIndex\n"
217  << "Requested trigger name \""
218  << pathName << "\" does not match any known trigger.\n";
219  }
220  return i;
221  }
TriggerNames const * triggerNames_
Strings::size_type size() const
Definition: TriggerNames.cc:39
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
unsigned TriggerResultsByName::index ( std::string const &  pathName) const

Definition at line 165 of file TriggerResultsByName.cc.

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

Referenced by BeautifulSoup.PageElement::insert(), and state().

165  {
167  unsigned i = getAndCheckIndex(pathName);
168  return triggerResults_->index(i);
169  }
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 173 of file TriggerResultsByName.cc.

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

Referenced by BeautifulSoup.PageElement::insert().

173  {
175  return triggerResults_->index(i);
176  }
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
HLTPathStatus const & TriggerResultsByName::operator[] ( std::string const &  pathName) const

Definition at line 90 of file TriggerResultsByName.cc.

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

Referenced by at().

90  {
92  unsigned i = getAndCheckIndex(pathName);
93  return triggerResults_->at(i);
94  }
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 98 of file TriggerResultsByName.cc.

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

98  {
100  return triggerResults_->at(i);
101  }
const HLTPathStatus & at(const unsigned int i) const
TriggerResults const * triggerResults_
ParameterSetID const & TriggerResultsByName::parameterSetID ( ) const

Definition at line 47 of file TriggerResultsByName.cc.

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

Referenced by isValid().

47  {
50  }
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 150 of file TriggerResultsByName.cc.

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

Referenced by error().

150  {
152  unsigned i = getAndCheckIndex(pathName);
153  return triggerResults_->state(i);
154  }
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 158 of file TriggerResultsByName.cc.

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

158  {
160  return triggerResults_->state(i);
161  }
TriggerResults const * triggerResults_
hlt::HLTState state(const unsigned int i) const
Get status of ith path.
void TriggerResultsByName::throwTriggerNamesMissing ( ) const
private

Definition at line 236 of file TriggerResultsByName.cc.

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

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

236  {
238  << "TriggerResultsByName has a null pointer to TriggerNames.\n"
239  << "This should never happen. It could indicate the ParameterSet\n"
240  << "containing the names is missing from the ParameterSet registry.\n"
241  << "Please report this to the edm developers along with instructions\n"
242  << "to reproduce the problem\n";
243  }
void TriggerResultsByName::throwTriggerResultsMissing ( ) const
private

Definition at line 225 of file TriggerResultsByName.cc.

References Exception, edm::errors::ProductNotFound, and throwTriggerNamesMissing().

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

225  {
227  << "TriggerResultsByName has a null pointer to TriggerResults.\n"
228  << "This probably means TriggerResults was not found in the Event\n"
229  << "because the product was dropped or never created. It could also\n"
230  << "mean it was requested for a process that does not exist or was\n"
231  << "misspelled\n";
232  }
unsigned TriggerResultsByName::triggerIndex ( std::string const &  pathName) const

Definition at line 196 of file TriggerResultsByName.cc.

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

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

196  {
199  return triggerNames_->triggerIndex(pathName);
200  }
TriggerNames const * triggerNames_
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
TriggerResults const * triggerResults_
std::string const & TriggerResultsByName::triggerName ( unsigned  i) const
std::vector< std::string > const & TriggerResultsByName::triggerNames ( ) const
bool TriggerResultsByName::wasrun ( ) const

Definition at line 54 of file TriggerResultsByName.cc.

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

Referenced by operator[](), parameterSetID(), and wasrun().

54  {
56  return triggerResults_->wasrun();
57  }
bool wasrun() const
Was at least one path run?
TriggerResults const * triggerResults_
bool TriggerResultsByName::wasrun ( std::string const &  pathName) const

Definition at line 105 of file TriggerResultsByName.cc.

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

105  {
107  unsigned i = getAndCheckIndex(pathName);
108  return triggerResults_->wasrun(i);
109  }
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 113 of file TriggerResultsByName.cc.

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

113  {
115  return triggerResults_->wasrun(i);
116  }
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