CMS 3D CMS Logo

edm::TriggerNames Class Reference

#include <FWCore/Framework/interface/TriggerNames.h>

List of all members.

Public Types

typedef std::map< std::string,
unsigned int
IndexMap
typedef std::vector< std::string > Strings

Public Member Functions

bool init (TriggerResults const &triggerResults)
Strings::size_type size () const
unsigned int triggerIndex (std::string const &name) const
std::string const & triggerName (unsigned int index) const
Strings const & triggerNames () const
 TriggerNames (TriggerResults const &triggerResults)
 TriggerNames ()

Private Attributes

IndexMap indexMap_
ParameterSetID psetID_
bool psetID_valid_
Strings triggerNames_


Detailed Description

Definition at line 46 of file TriggerNames.h.


Member Typedef Documentation

typedef std::map<std::string, unsigned int> edm::TriggerNames::IndexMap

Definition at line 51 of file TriggerNames.h.

typedef std::vector<std::string> edm::TriggerNames::Strings

Definition at line 50 of file TriggerNames.h.


Constructor & Destructor Documentation

edm::TriggerNames::TriggerNames (  ) 

Definition at line 11 of file TriggerNames.cc.

00011 : psetID_valid_(false) { }

edm::TriggerNames::TriggerNames ( TriggerResults const &  triggerResults  ) 

Definition at line 13 of file TriggerNames.cc.

References init().

00013                                                                  :
00014       psetID_valid_(false)
00015   {
00016     init(triggerResults);
00017   }


Member Function Documentation

bool edm::TriggerNames::init ( TriggerResults const &  triggerResults  ) 

Definition at line 20 of file TriggerNames.cc.

References index, indexMap_, edm::TriggerResults::parameterSetID(), psetID_, psetID_valid_, triggerNames_, and edm::errors::Unknown.

Referenced by JetMETAnalyzer::analyze(), CaloMETAnalyzer::analyze(), HLTrigReport::analyze(), HLTInfo::analyze(), AnalysisRootpleProducer::analyze(), TopValidation::analyze(), HLTHighLevel::filter(), and TriggerNames().

00020                                                          {
00021 
00022     if ( psetID_valid_ && psetID_ == triggerResults.parameterSetID()) {
00023       return false;
00024     }
00025     edm::Service<edm::service::TriggerNamesService> tns;
00026     bool fromPSetRegistry;
00027     if (tns->getTrigPaths(triggerResults, triggerNames_, fromPSetRegistry)) {
00028 
00029       if (fromPSetRegistry) {
00030         psetID_ = triggerResults.parameterSetID();
00031         psetID_valid_ = true;
00032       }
00033       // Allows backward compatibility to old TriggerResults objects
00034       // which contain the names.
00035       else {
00036         psetID_valid_ = false;
00037       }
00038     }
00039     // This should never happen
00040     else {
00041       throw edm::Exception(edm::errors::Unknown)
00042         << "TriggerNames::init cannot find the trigger names for\n"
00043            "a TriggerResults object.  This should be impossible,\n"
00044            "please send information to reproduce this problem to\n"
00045            "the edm developers.  (Actually if you started with a\n"
00046            "Streamer file and the release used to read the streamer\n"
00047            "is older than the release used to create it, this may\n"
00048            "occur, but that is not supported and you should not do that)\n"; 
00049     }
00050 
00051     unsigned int index = 0;
00052     for (Strings::const_iterator iName = triggerNames_.begin(), 
00053          iEnd = triggerNames_.end();
00054          iName != iEnd;
00055          ++iName, ++index) {
00056       indexMap_[*iName] = index;
00057     }
00058     return true;
00059   }

TriggerNames::Strings::size_type edm::TriggerNames::size ( void   )  const

Definition at line 77 of file TriggerNames.cc.

References triggerNames_.

00077 { return triggerNames_.size(); }

unsigned int edm::TriggerNames::triggerIndex ( std::string const &  name  )  const

Definition at line 70 of file TriggerNames.cc.

References indexMap_.

Referenced by CaloMETAnalyzer::analyze(), and HLTHighLevel::init().

00070                                                         {
00071     IndexMap::const_iterator const pos = indexMap_.find(name);
00072     if (pos == indexMap_.end()) return indexMap_.size();
00073     return pos->second;
00074   }

std::string const & edm::TriggerNames::triggerName ( unsigned int  index  )  const

Definition at line 65 of file TriggerNames.cc.

References triggerNames_.

Referenced by JetMETAnalyzer::analyze(), CaloMETAnalyzer::analyze(), FourVectorHLTOffline::analyze(), HLTInfo::analyze(), AnalysisRootpleProducer::analyze(), TopValidation::analyze(), HLTHighLevel::init(), and AlCaHOCalibProducer::produce().

00065                                                     {
00066     return triggerNames_.at(index);
00067   }

TriggerNames::Strings const & edm::TriggerNames::triggerNames (  )  const

Definition at line 62 of file TriggerNames.cc.

References triggerNames_.

Referenced by HLTrigReport::analyze(), HLTScalers::analyze(), and HLTHighLevel::init().

00062 { return triggerNames_; }


Member Data Documentation

IndexMap edm::TriggerNames::indexMap_ [private]

Definition at line 82 of file TriggerNames.h.

Referenced by init(), and triggerIndex().

ParameterSetID edm::TriggerNames::psetID_ [private]

Definition at line 79 of file TriggerNames.h.

Referenced by init().

bool edm::TriggerNames::psetID_valid_ [private]

Definition at line 78 of file TriggerNames.h.

Referenced by init().

Strings edm::TriggerNames::triggerNames_ [private]

Definition at line 81 of file TriggerNames.h.

Referenced by init(), size(), triggerName(), and triggerNames().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:44:26 2009 for CMSSW by  doxygen 1.5.4