CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/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  private:
00037   struct HLTConfigCounterSentry {
00038     HLTConfigCounterSentry();
00039     HLTConfigCounterSentry(HLTConfigCounterSentry const&);
00040     HLTConfigCounterSentry(HLTConfigCounterSentry&&); // only C++11
00041     ~HLTConfigCounterSentry();
00042   };
00043   HLTConfigCounterSentry sentry_;
00044 
00045  public:
00047   HLTConfigProvider();
00049   //  ~HLTConfigProvider();
00050   
00051  public:
00055   bool init(const edm::Run& iRun, const edm::EventSetup& iSetup,
00056             const std::string& processName, bool& changed);
00057 
00059   void dump(const std::string& what) const {
00060     hltConfigData_->dump(what);
00061   }
00062 
00064 
00066   bool inited() const {
00067     return inited_;
00068   }
00070   bool changed() const {
00071     return changed_;
00072   }
00073 
00075   const std::string& processName() const {
00076     return hltConfigData_->processName();
00077   }
00078 
00080   const std::string& globalTag() const {
00081     return hltConfigData_->globalTag();
00082   }
00083 
00085   const std::string& tableName() const {
00086     return hltConfigData_->tableName();
00087   }
00088 
00090   unsigned int size() const {
00091     return hltConfigData_->size();
00092   }
00094   unsigned int size(unsigned int trigger) const {
00095     return hltConfigData_->size(trigger);
00096   }
00097   unsigned int size(const std::string& trigger) const {
00098     return hltConfigData_->size(trigger);
00099   }
00100 
00102   const std::vector<std::string>& triggerNames() const {
00103     return hltConfigData_->triggerNames();
00104   }
00105   const std::string& triggerName(unsigned int triggerIndex) const {
00106     return hltConfigData_->triggerName(triggerIndex);
00107   }
00108 
00110   unsigned int triggerIndex(const std::string& triggerName) const {
00111     return hltConfigData_->triggerIndex(triggerName);
00112   }
00113 
00115   const std::vector<std::string>& moduleLabels(unsigned int trigger) const {
00116     return hltConfigData_->moduleLabels(trigger);
00117   }
00118   const std::vector<std::string>& moduleLabels(const std::string& trigger) const {
00119     return hltConfigData_->moduleLabels(trigger);
00120   }
00121   const std::vector<std::string>& saveTagsModules(unsigned int trigger) const {
00122     return hltConfigData_->saveTagsModules(trigger);
00123   }
00124   const std::vector<std::string>& saveTagsModules(const std::string& trigger) const {
00125     return hltConfigData_->saveTagsModules(trigger);
00126   }
00127   const std::string& moduleLabel(unsigned int trigger, unsigned int module) const {
00128     return hltConfigData_->moduleLabel(trigger,module);
00129   }
00130   const std::string& moduleLabel(const std::string& trigger, unsigned int module) const {
00131     return hltConfigData_->moduleLabel(trigger,module);
00132   }
00133 
00135   unsigned int moduleIndex(unsigned int trigger, const std::string& module) const {
00136     return hltConfigData_->moduleIndex(trigger,module);
00137   }
00138   unsigned int moduleIndex(const std::string& trigger, const std::string& module) const {
00139     return hltConfigData_->moduleIndex(trigger,module);
00140   }
00141 
00143   const std::string moduleType(const std::string& module) const {
00144     return hltConfigData_->moduleType(module);
00145   }
00146 
00148   const std::string moduleEDMType(const std::string& module) const {
00149     return hltConfigData_->moduleEDMType(module);
00150   }
00151 
00153   const edm::ParameterSet& processPSet() const {
00154     return hltConfigData_->processPSet();
00155   }
00156 
00158   const edm::ParameterSet& modulePSet(const std::string& module) const {
00159     return hltConfigData_->modulePSet(module);
00160   }
00161 
00163   bool saveTags(const std::string& module) const {
00164     return hltConfigData_->saveTags(module);
00165   }
00166 
00169   const std::vector<std::vector<std::pair<bool,std::string> > >& hltL1GTSeeds() const {
00170     return hltConfigData_->hltL1GTSeeds();
00171   }
00173   const std::vector<std::pair<bool,std::string> >& hltL1GTSeeds(const std::string& trigger) const {
00174     return hltConfigData_->hltL1GTSeeds(trigger);
00175   }
00177   const std::vector<std::pair<bool,std::string> >& hltL1GTSeeds(unsigned int trigger) const {
00178     return hltConfigData_->hltL1GTSeeds(trigger);
00179   }
00180 
00181 
00184   const std::vector<std::string>& streamNames() const {
00185     return hltConfigData_->streamNames();
00186   }
00188   const std::string& streamName(unsigned int stream) const {
00189     return hltConfigData_->streamName(stream);
00190   }
00192   unsigned int streamIndex(const std::string& stream) const {
00193     return hltConfigData_->streamIndex(stream);
00194   }
00196   const std::vector<std::vector<std::string> >& streamContents() const {
00197     return hltConfigData_->streamContents();
00198   }
00200   const std::vector<std::string>& streamContent(unsigned int stream) const {
00201     return hltConfigData_->streamContent(stream);
00202   }
00204   const std::vector<std::string>& streamContent(const std::string& stream) const {
00205     return hltConfigData_->streamContent(stream);
00206   }
00207 
00208 
00211   const std::vector<std::string>& datasetNames() const {
00212     return hltConfigData_->datasetNames();
00213   }
00215   const std::string& datasetName(unsigned int dataset) const {
00216     return hltConfigData_->datasetName(dataset);
00217   }
00219   unsigned int datasetIndex(const std::string& dataset) const {
00220     return hltConfigData_->datasetIndex(dataset);
00221   }
00223   const std::vector<std::vector<std::string> >& datasetContents() const {
00224     return hltConfigData_->datasetContents();
00225   }
00227   const std::vector<std::string>& datasetContent(unsigned int dataset) const {
00228     return hltConfigData_->datasetContent(dataset);
00229   }
00231   const std::vector<std::string>& datasetContent(const std::string& dataset) const {
00232     return hltConfigData_->datasetContent(dataset);
00233   }
00234 
00235 
00238   unsigned int prescaleSize() const {
00239     return hltConfigData_->prescaleSize();
00240   }
00242   unsigned int prescaleValue(unsigned int set, const std::string& trigger) const {
00243     return hltConfigData_->prescaleValue(set,trigger);
00244   }
00245 
00248   int prescaleSet(const edm::Event& iEvent, const edm::EventSetup& iSetup) const;
00249   // negative == error
00250   
00252   unsigned int prescaleValue(const edm::Event& iEvent, const edm::EventSetup& iSetup, const std::string& trigger) const;
00253   
00255   std::pair<int,int> prescaleValues(const edm::Event& iEvent, const edm::EventSetup& iSetup, const std::string& trigger) const;
00256   // any one negative => error in retrieving this (L1T or HLT) prescale
00257 
00258 
00260   const std::vector<std::string>& prescaleLabels() const {
00261     return hltConfigData_->prescaleLabels();
00262   }
00263   const std::map<std::string,std::vector<unsigned int> >& prescaleTable() const {
00264     return hltConfigData_->prescaleTable();
00265   }
00266 
00268   static const std::vector<std::string> matched(const std::vector<std::string>& inputs, const std::string& pattern);
00269   static const std::string removeVersion(const std::string& trigger);
00270   static const std::vector<std::string> restoreVersion(const std::vector<std::string>& inputs, const std::string& trigger);
00271 
00272  private:
00273 
00274   void getDataFrom(const edm::ParameterSetID& iID);
00275   void init(const edm::ProcessHistory& iHistory, const std::string& processName);
00276   void init(const std::string& processName);
00277   void clear();
00278   
00280   std::string processName_;
00281   bool inited_;
00282   bool changed_;
00283   const HLTConfigData* hltConfigData_;
00284   boost::shared_ptr<L1GtUtils> l1GtUtils_;
00285   
00286 };
00287 #endif