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

Member Function Documentation

◆ accept() [1/3]

bool TriggerResultsByName::accept ( ) const

Definition at line 52 of file TriggerResultsByName.cc.

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

Referenced by esMonitoring.FDJsonServer::handle_accept().

52  {
53  if (triggerResults_ == nullptr)
55  return triggerResults_->accept();
56  }
bool accept() const
Has at least one path accepted the event?
TriggerResults const * triggerResults_

◆ accept() [2/3]

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

Definition at line 103 of file TriggerResultsByName.cc.

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

Referenced by esMonitoring.FDJsonServer::handle_accept().

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

◆ accept() [3/3]

bool TriggerResultsByName::accept ( unsigned  i) const

Definition at line 110 of file TriggerResultsByName.cc.

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

Referenced by esMonitoring.FDJsonServer::handle_accept().

110  {
111  if (triggerResults_ == nullptr)
113  return triggerResults_->accept(i);
114  }
bool accept() const
Has at least one path accepted the event?
TriggerResults const * triggerResults_

◆ at() [1/2]

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, hltMonBTagIPClient_cfi::pathName, throwTriggerResultsMissing(), and triggerResults_.

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

◆ at() [2/2]

HLTPathStatus const & TriggerResultsByName::at ( unsigned  i) const

Definition at line 71 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::at(), mps_fire::i, 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_

◆ error() [1/3]

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_

◆ error() [2/3]

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

Definition at line 116 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::error(), getAndCheckIndex(), mps_fire::i, hltMonBTagIPClient_cfi::pathName, 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  }
bool error() const
Has any path encountered an error (exception)
unsigned getAndCheckIndex(std::string const &pathName) const
TriggerResults const * triggerResults_

◆ error() [3/3]

bool TriggerResultsByName::error ( unsigned  i) const

Definition at line 123 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::error(), mps_fire::i, 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_

◆ getAndCheckIndex()

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, hltMonBTagIPClient_cfi::pathName, 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_
unsigned int triggerIndex(std::string_view name) const
Definition: TriggerNames.cc:52
std::size_t size() const
Definition: TriggerNames.cc:59

◆ index() [1/2]

unsigned TriggerResultsByName::index ( std::string const &  pathName) const

Definition at line 142 of file TriggerResultsByName.cc.

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

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

◆ index() [2/2]

unsigned TriggerResultsByName::index ( unsigned  i) const

Definition at line 149 of file TriggerResultsByName.cc.

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

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_

◆ isValid()

bool TriggerResultsByName::isValid ( void  ) const

Definition at line 34 of file TriggerResultsByName.cc.

References triggerNames_, and triggerResults_.

Referenced by ntupleDataFormat._Object::_checkIsValid(), 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_

◆ operator[]() [1/2]

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, hltMonBTagIPClient_cfi::pathName, throwTriggerResultsMissing(), and triggerResults_.

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

◆ operator[]() [2/2]

HLTPathStatus const & TriggerResultsByName::operator[] ( unsigned  i) const

Definition at line 84 of file TriggerResultsByName.cc.

References edm::HLTGlobalStatus::at(), mps_fire::i, 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()

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  }
const ParameterSetID & parameterSetID() const
Get stored parameter set id.
TriggerResults const * triggerResults_

◆ size()

std::vector< std::string >::size_type TriggerResultsByName::size ( void  ) const

Definition at line 179 of file TriggerResultsByName.cc.

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

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

179  {
180  if (triggerResults_ == nullptr)
182  return triggerResults_->size();
183  }
unsigned int size() const
Get number of paths stored.
TriggerResults const * triggerResults_

◆ state() [1/2]

hlt::HLTState TriggerResultsByName::state ( std::string const &  pathName) const

Definition at line 129 of file TriggerResultsByName.cc.

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

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

◆ state() [2/2]

hlt::HLTState TriggerResultsByName::state ( unsigned  i) const

Definition at line 136 of file TriggerResultsByName.cc.

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

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

◆ throwTriggerNamesMissing()

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  }

◆ throwTriggerResultsMissing()

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  }

◆ triggerIndex()

unsigned TriggerResultsByName::triggerIndex ( std::string const &  pathName) const

◆ triggerName()

std::string const & TriggerResultsByName::triggerName ( unsigned  i) const

Definition at line 163 of file TriggerResultsByName.cc.

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

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:50
TriggerResults const * triggerResults_

◆ triggerNames()

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:48
TriggerResults const * triggerResults_

◆ wasrun() [1/3]

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_

◆ wasrun() [2/3]

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

Definition at line 90 of file TriggerResultsByName.cc.

References getAndCheckIndex(), mps_fire::i, hltMonBTagIPClient_cfi::pathName, 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_

◆ wasrun() [3/3]

bool TriggerResultsByName::wasrun ( unsigned  i) const

Definition at line 97 of file TriggerResultsByName.cc.

References mps_fire::i, 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_

TriggerNames const* edm::TriggerResultsByName::triggerNames_
private

◆ triggerResults_

TriggerResults const* edm::TriggerResultsByName::triggerResults_
private