CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

edm::TriggerResultsByName Class Reference

#include <TriggerResultsByName.h>

List of all members.

Public Member Functions

bool accept () const
bool accept (std::string const &pathName) const
bool accept (unsigned i) const
HLTPathStatus const & at (unsigned i) const
HLTPathStatus const & at (std::string const &pathName) const
bool error (unsigned i) const
bool error () const
bool error (std::string const &pathName) 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 (std::string const &pathName) const
bool wasrun (unsigned i) const
bool wasrun () 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.

                                                         :
    triggerResults_(triggerResults),
    triggerNames_(triggerNames) {

   // If either of these is true the object is in an invalid state
   if (triggerResults_ == 0 || triggerNames_ == 0) {
     return;
   }

   if (triggerResults_->parameterSetID() != triggerNames_->parameterSetID()) {
      throw edm::Exception(edm::errors::Unknown)
        << "TriggerResultsByName::TriggerResultsByName, Trigger names vector and TriggerResults\n"
           "have different ParameterSetID's.  This should be impossible when the object is obtained\n"
           "from the function named triggerResultsByName in the Event class, which is the way\n"
           "TriggerResultsByName should always be created. If this is the case, please send\n"
           "information to reproduce this problem to the edm developers.  Otherwise, you are\n"
           "using this class incorrectly and in a way that is not supported.\n";
    }

    if (triggerResults_->size() != triggerNames_->size()) {
      throw edm::Exception(edm::errors::Unknown)
        << "TriggerResultsByName::TriggerResultsByName, Trigger names vector\n"
           "and TriggerResults have different sizes.  This should be impossible,\n"
           "please send information to reproduce this problem to the edm developers.\n";
    }
  }

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
HLTPathStatus const & TriggerResultsByName::at ( unsigned  i) const
bool TriggerResultsByName::error ( ) const
bool TriggerResultsByName::error ( std::string const &  pathName) const
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().

                                                    {
    if (triggerNames_ == 0) throwTriggerNamesMissing(); 
    unsigned i = triggerNames_->triggerIndex(pathName);
    if (i == triggerNames_->size()) {
      throw edm::Exception(edm::errors::LogicError)
        << "TriggerResultsByName::getAndCheckIndex\n"
        << "Requested trigger name \""
        << pathName << "\" does not match any known trigger.\n";
    }
    return i;
  }
unsigned TriggerResultsByName::index ( std::string const &  pathName) const
unsigned TriggerResultsByName::index ( unsigned  i) const
bool TriggerResultsByName::isValid ( void  ) const

Definition at line 40 of file TriggerResultsByName.cc.

References triggerNames_, and triggerResults_.

Referenced by HSCPHLTFilter::filter().

                  {
    if (triggerResults_ == 0 || triggerNames_ == 0) return false;
    return true;
  }
HLTPathStatus const & TriggerResultsByName::operator[] ( unsigned  i) const
HLTPathStatus const & TriggerResultsByName::operator[] ( std::string const &  pathName) const
ParameterSetID const & TriggerResultsByName::parameterSetID ( ) const
std::vector< std::string >::size_type TriggerResultsByName::size ( void  ) const
hlt::HLTState TriggerResultsByName::state ( std::string const &  pathName) const
hlt::HLTState TriggerResultsByName::state ( unsigned  i) const
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().

                                   {
    throw edm::Exception(edm::errors::LogicError)
      << "TriggerResultsByName has a null pointer to TriggerNames.\n"
      << "This should never happen. It could indicate the ParameterSet\n"
      << "containing the names is missing from the ParameterSet registry.\n"
      << "Please report this to the edm developers along with instructions\n"
      << "to reproduce the problem\n";
  }
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().

                                     {
    throw edm::Exception(edm::errors::ProductNotFound)
      << "TriggerResultsByName has a null pointer to TriggerResults.\n"
      << "This probably means TriggerResults was not found in the Event\n"
      << "because the product was dropped or never created. It could also\n"
      << "mean it was requested for a process that does not exist or was\n"
      << "misspelled\n";
  }
unsigned TriggerResultsByName::triggerIndex ( std::string const &  pathName) const
std::string const & TriggerResultsByName::triggerName ( unsigned  i) const
std::vector< std::string > const & TriggerResultsByName::triggerNames ( ) const
bool TriggerResultsByName::wasrun ( unsigned  i) const
bool TriggerResultsByName::wasrun ( ) const
bool TriggerResultsByName::wasrun ( std::string const &  pathName) const

Member Data Documentation