CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/HLTrigger/HLTcore/interface/HLTConfigProvider.h

Go to the documentation of this file.
00001 #ifndef HLTcore_HLTConfigProvider_h
00002 #define HLTcore_HLTConfigProvider_h
00003 
00016 #include "FWCore/Framework/interface/Run.h"
00017 #include "FWCore/Framework/interface/Event.h"
00018 #include "FWCore/Framework/interface/LuminosityBlock.h"
00019 
00020 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h"
00021 #include "HLTrigger/HLTcore/interface/HLTConfigData.h"
00022 
00023 #include "boost/shared_ptr.hpp"
00024 
00025 #include<map>
00026 #include<string>
00027 #include<vector>
00028 
00029 
00030 //
00031 // class declaration
00032 //
00033 
00034 class HLTConfigProvider {
00035 
00036  public:
00038   HLTConfigProvider();
00039   
00040  public:
00044   bool init(const edm::Run& iRun, const edm::EventSetup& iSetup,
00045             const std::string& processName, bool& changed);
00046 
00048   void dump(const std::string& what) const {
00049     hltConfigData_->dump(what);
00050   }
00051 
00053 
00055   bool inited() const {
00056     return inited_;
00057   }
00059   bool changed() const {
00060     return changed_;
00061   }
00062 
00064   const std::string& processName() const {
00065     return hltConfigData_->processName();
00066   }
00067 
00069   const std::string& globalTag() const {
00070     return hltConfigData_->globalTag();
00071   }
00072 
00074   const std::string& tableName() const {
00075     return hltConfigData_->tableName();
00076   }
00077 
00079   unsigned int size() const {
00080     return hltConfigData_->size();
00081   }
00083   unsigned int size(unsigned int trigger) const {
00084     return hltConfigData_->size(trigger);
00085   }
00086   unsigned int size(const std::string& trigger) const {
00087     return hltConfigData_->size(trigger);
00088   }
00089 
00091   const std::vector<std::string>& triggerNames() const {
00092     return hltConfigData_->triggerNames();
00093   }
00094   const std::string& triggerName(unsigned int triggerIndex) const {
00095     return hltConfigData_->triggerName(triggerIndex);
00096   }
00097 
00099   unsigned int triggerIndex(const std::string& triggerName) const {
00100     return hltConfigData_->triggerIndex(triggerName);
00101   }
00102 
00104   const std::vector<std::string>& moduleLabels(unsigned int trigger) const {
00105     return hltConfigData_->moduleLabels(trigger);
00106   }
00107   const std::vector<std::string>& moduleLabels(const std::string& trigger) const {
00108     return hltConfigData_->moduleLabels(trigger);
00109   }
00110   const std::vector<std::string>& saveTagsModules(unsigned int trigger) const {
00111     return hltConfigData_->saveTagsModules(trigger);
00112   }
00113   const std::vector<std::string>& saveTagsModules(const std::string& trigger) const {
00114     return hltConfigData_->saveTagsModules(trigger);
00115   }
00116   const std::string& moduleLabel(unsigned int trigger, unsigned int module) const {
00117     return hltConfigData_->moduleLabel(trigger,module);
00118   }
00119   const std::string& moduleLabel(const std::string& trigger, unsigned int module) const {
00120     return hltConfigData_->moduleLabel(trigger,module);
00121   }
00122 
00124   unsigned int moduleIndex(unsigned int trigger, const std::string& module) const {
00125     return hltConfigData_->moduleIndex(trigger,module);
00126   }
00127   unsigned int moduleIndex(const std::string& trigger, const std::string& module) const {
00128     return hltConfigData_->moduleIndex(trigger,module);
00129   }
00130 
00132   const std::string moduleType(const std::string& module) const {
00133     return hltConfigData_->moduleType(module);
00134   }
00135 
00137   const std::string moduleEDMType(const std::string& module) const {
00138     return hltConfigData_->moduleEDMType(module);
00139   }
00140 
00142   const edm::ParameterSet& processPSet() const {
00143     return hltConfigData_->processPSet();
00144   }
00145 
00147   const edm::ParameterSet& modulePSet(const std::string& module) const {
00148     return hltConfigData_->modulePSet(module);
00149   }
00150 
00152   bool saveTags(const std::string& module) const {
00153     return hltConfigData_->saveTags(module);
00154   }
00155 
00158   const std::vector<std::vector<std::pair<bool,std::string> > >& hltL1GTSeeds() const {
00159     return hltConfigData_->hltL1GTSeeds();
00160   }
00162   const std::vector<std::pair<bool,std::string> >& hltL1GTSeeds(const std::string& trigger) const {
00163     return hltConfigData_->hltL1GTSeeds(trigger);
00164   }
00166   const std::vector<std::pair<bool,std::string> >& hltL1GTSeeds(unsigned int trigger) const {
00167     return hltConfigData_->hltL1GTSeeds(trigger);
00168   }
00169 
00170 
00173   const std::vector<std::string>& streamNames() const {
00174     return hltConfigData_->streamNames();
00175   }
00177   const std::string& streamName(unsigned int stream) const {
00178     return hltConfigData_->streamName(stream);
00179   }
00181   unsigned int streamIndex(const std::string& stream) const {
00182     return hltConfigData_->streamIndex(stream);
00183   }
00185   const std::vector<std::vector<std::string> >& streamContents() const {
00186     return hltConfigData_->streamContents();
00187   }
00189   const std::vector<std::string>& streamContent(unsigned int stream) const {
00190     return hltConfigData_->streamContent(stream);
00191   }
00193   const std::vector<std::string>& streamContent(const std::string& stream) const {
00194     return hltConfigData_->streamContent(stream);
00195   }
00196 
00197 
00200   const std::vector<std::string>& datasetNames() const {
00201     return hltConfigData_->datasetNames();
00202   }
00204   const std::string& datasetName(unsigned int dataset) const {
00205     return hltConfigData_->datasetName(dataset);
00206   }
00208   unsigned int datasetIndex(const std::string& dataset) const {
00209     return hltConfigData_->datasetIndex(dataset);
00210   }
00212   const std::vector<std::vector<std::string> >& datasetContents() const {
00213     return hltConfigData_->datasetContents();
00214   }
00216   const std::vector<std::string>& datasetContent(unsigned int dataset) const {
00217     return hltConfigData_->datasetContent(dataset);
00218   }
00220   const std::vector<std::string>& datasetContent(const std::string& dataset) const {
00221     return hltConfigData_->datasetContent(dataset);
00222   }
00223 
00224 
00227   unsigned int prescaleSize() const {
00228     return hltConfigData_->prescaleSize();
00229   }
00231   unsigned int prescaleValue(unsigned int set, const std::string& trigger) const {
00232     return hltConfigData_->prescaleValue(set,trigger);
00233   }
00234 
00237   int prescaleSet(const edm::Event& iEvent, const edm::EventSetup& iSetup) const;
00238   // negative == error
00239   
00241   unsigned int prescaleValue(const edm::Event& iEvent, const edm::EventSetup& iSetup, const std::string& trigger) const;
00242   
00244   std::pair<int,int> prescaleValues(const edm::Event& iEvent, const edm::EventSetup& iSetup, const std::string& trigger) const;
00245   // any one negative => error in retrieving this (L1T or HLT) prescale
00246 
00247 
00249   const std::vector<std::string>& prescaleLabels() const {
00250     return hltConfigData_->prescaleLabels();
00251   }
00252   const std::map<std::string,std::vector<unsigned int> >& prescaleTable() const {
00253     return hltConfigData_->prescaleTable();
00254   }
00255 
00257   static const std::vector<std::string> matched(const std::vector<std::string>& inputs, const std::string& pattern);
00258   static const std::string removeVersion(const std::string& trigger);
00259   static const std::vector<std::string> restoreVersion(const std::vector<std::string>& inputs, const std::string& trigger);
00260 
00261  private:
00262 
00263   void getDataFrom(const edm::ParameterSetID& iID);
00264   void init(const edm::ProcessHistory& iHistory, const std::string& processName);
00265   void init(const std::string& processName);
00266   void clear();
00267   
00269   std::string processName_;
00270   bool inited_;
00271   bool changed_;
00272   const HLTConfigData* hltConfigData_;
00273   boost::shared_ptr<L1GtUtils> l1GtUtils_;
00274   
00275 };
00276 #endif