CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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, 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(), i, throwTriggerResultsMissing(), and triggerResults_.

75  {
77  unsigned i = getAndCheckIndex(pathName);
78  return triggerResults_->at(i);
79  }
int i
Definition: DBlmapReader.cc:9
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(), throwTriggerResultsMissing(), and triggerResults_.

83  {
85  return triggerResults_->at(i);
86  }
int i
Definition: DBlmapReader.cc:9
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(), getAndCheckIndex(), 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(), 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  }
int i
Definition: DBlmapReader.cc:9
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
unsigned TriggerResultsByName::getAndCheckIndex ( std::string const &  pathName) const
private

Definition at line 211 of file TriggerResultsByName.cc.

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

Referenced by accept(), at(), error(), index(), operator[](), 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  }
int i
Definition: DBlmapReader.cc:9
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(), i, edm::HLTGlobalStatus::index(), throwTriggerResultsMissing(), and triggerResults_.

Referenced by BeautifulSoup.PageElement::_invert().

165  {
167  unsigned i = getAndCheckIndex(pathName);
168  return triggerResults_->index(i);
169  }
int i
Definition: DBlmapReader.cc:9
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(), and triggerResults_.

Referenced by BeautifulSoup.PageElement::_invert().

173  {
175  return triggerResults_->index(i);
176  }
int i
Definition: DBlmapReader.cc:9
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 40 of file TriggerResultsByName.cc.

References triggerNames_, and triggerResults_.

Referenced by HSCPHLTFilter::filter(), and core.AutoHandle.AutoHandle::ReallyLoad().

40  {
41  if (triggerResults_ == 0 || triggerNames_ == 0) return false;
42  return true;
43  }
TriggerNames const * triggerNames_
TriggerResults const * triggerResults_
HLTPathStatus const & TriggerResultsByName::operator[] ( std::string const &  pathName) const

Definition at line 90 of file TriggerResultsByName.cc.

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

90  {
92  unsigned i = getAndCheckIndex(pathName);
93  return triggerResults_->at(i);
94  }
int i
Definition: DBlmapReader.cc:9
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(), and triggerResults_.

98  {
100  return triggerResults_->at(i);
101  }
int i
Definition: DBlmapReader.cc:9
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(), and triggerResults_.

47  {
50  }
TriggerResults const * triggerResults_
const ParameterSetID & parameterSetID() const
Get stored parameter set id.
std::vector< std::string >::size_type TriggerResultsByName::size ( void  ) const

Definition at line 204 of file TriggerResultsByName.cc.

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

Referenced by HSCPHLTFilter::filter().

204  {
206  return triggerResults_->size();
207  }
unsigned int size() const
Get number of paths stored.
TriggerResults const * triggerResults_
hlt::HLTState TriggerResultsByName::state ( std::string const &  pathName) const

Definition at line 150 of file TriggerResultsByName.cc.

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

150  {
152  unsigned i = getAndCheckIndex(pathName);
153  return triggerResults_->state(i);
154  }
int i
Definition: DBlmapReader.cc:9
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 edm::HLTGlobalStatus::state(), throwTriggerResultsMissing(), and triggerResults_.

158  {
160  return triggerResults_->state(i);
161  }
int i
Definition: DBlmapReader.cc:9
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(), 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, and edm::errors::ProductNotFound.

Referenced by accept(), at(), error(), 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 throwTriggerNamesMissing(), throwTriggerResultsMissing(), edm::TriggerNames::triggerIndex(), triggerNames_, and triggerResults_.

Referenced by HSCPHLTFilter::filter().

196  {
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

Definition at line 188 of file TriggerResultsByName.cc.

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

Referenced by HSCPHLTFilter::filter().

188  {
191  return triggerNames_->triggerName(i);
192  }
int i
Definition: DBlmapReader.cc:9
TriggerNames const * triggerNames_
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
TriggerResults const * triggerResults_
std::vector< std::string > const & TriggerResultsByName::triggerNames ( ) const
bool TriggerResultsByName::wasrun ( ) const

Definition at line 54 of file TriggerResultsByName.cc.

References throwTriggerResultsMissing(), triggerResults_, and edm::HLTGlobalStatus::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(), i, throwTriggerResultsMissing(), triggerResults_, and edm::HLTGlobalStatus::wasrun().

105  {
107  unsigned i = getAndCheckIndex(pathName);
108  return triggerResults_->wasrun(i);
109  }
int i
Definition: DBlmapReader.cc:9
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 throwTriggerResultsMissing(), triggerResults_, and edm::HLTGlobalStatus::wasrun().

113  {
115  return triggerResults_->wasrun(i);
116  }
int i
Definition: DBlmapReader.cc:9
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