![]() |
![]() |
#include <FWCore/Framework/interface/TriggerNames.h>
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_ |
Definition at line 46 of file TriggerNames.h.
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.
edm::TriggerNames::TriggerNames | ( | ) |
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 }
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_; }
IndexMap edm::TriggerNames::indexMap_ [private] |
ParameterSetID edm::TriggerNames::psetID_ [private] |
bool edm::TriggerNames::psetID_valid_ [private] |
Strings edm::TriggerNames::triggerNames_ [private] |
Definition at line 81 of file TriggerNames.h.
Referenced by init(), size(), triggerName(), and triggerNames().