Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:43

0001 #ifndef HLTcore_HLTConfigData_h
0002 #define HLTcore_HLTConfigData_h
0003 
0004 /** \class HLTConfigData
0005  *
0006  *  
0007  *  This class provides access routines to get hold of the HLT Configuration
0008  *
0009  *
0010  *  \author Martin Grunewald
0011  *
0012  */
0013 
0014 #include "DataFormats/HLTReco/interface/HLTPrescaleTable.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 
0017 #include <map>
0018 #include <string>
0019 #include <vector>
0020 
0021 //
0022 // class declaration
0023 //
0024 
0025 class HLTConfigData {
0026 public:
0027   HLTConfigData();
0028   HLTConfigData(const edm::ParameterSet* iID);
0029 
0030 private:
0031   /// extract information into data members - called by init() methods
0032   void extract();
0033 
0034 public:
0035   /// Dumping config info to cout
0036   void dump(const std::string& what) const;
0037 
0038   /// Accessors (const methods)
0039 
0040   /// process name
0041   const std::string& processName() const;
0042 
0043   /// GlobalTag.globaltag
0044   const std::string& globalTag() const;
0045 
0046   /// HLT ConfDB table name
0047   const std::string& tableName() const;
0048 
0049   /// number of trigger paths in trigger table
0050   unsigned int size() const;
0051   /// number of modules on a specific trigger path
0052   unsigned int size(unsigned int trigger) const;
0053   unsigned int size(const std::string& trigger) const;
0054 
0055   /// names of trigger paths
0056   const std::vector<std::string>& triggerNames() const;
0057   const std::string& triggerName(unsigned int triggerIndex) const;
0058 
0059   /// slot position of trigger path in trigger table (0 - size-1)
0060   unsigned int triggerIndex(const std::string& triggerName) const;
0061 
0062   /// label(s) of module(s) on a trigger path
0063   const std::vector<std::string>& moduleLabels(unsigned int trigger) const;
0064   const std::vector<std::string>& moduleLabels(const std::string& trigger) const;
0065   const std::vector<std::string>& saveTagsModules(unsigned int trigger) const;
0066   const std::vector<std::string>& saveTagsModules(const std::string& trigger) const;
0067   const std::string& moduleLabel(unsigned int trigger, unsigned int module) const;
0068   const std::string& moduleLabel(const std::string& trigger, unsigned int module) const;
0069 
0070   /// slot position of module on trigger path (0 - size-1)
0071   unsigned int moduleIndex(unsigned int trigger, const std::string& module) const;
0072   unsigned int moduleIndex(const std::string& trigger, const std::string& module) const;
0073 
0074   /// C++ class name of module
0075   const std::string moduleType(const std::string& module) const;
0076 
0077   /// C++ base class name of module
0078   const std::string moduleEDMType(const std::string& module) const;
0079 
0080   /// ParameterSet of process
0081   const edm::ParameterSet& processPSet() const;
0082 
0083   /// ParameterSet of module
0084   const edm::ParameterSet& modulePSet(const std::string& module) const;
0085 
0086   /// Is module an L3 filter (ie, tracked saveTags=true)
0087   bool saveTags(const std::string& module) const;
0088 
0089   /// L1T type (0=unknown, 1=legacy/stage-1 or 2=stage-2)
0090   unsigned int l1tType() const;
0091 
0092   /// HLTLevel1GTSeed module
0093   /// HLTLevel1GTSeed modules for all trigger paths
0094   const std::vector<std::vector<std::pair<bool, std::string> > >& hltL1GTSeeds() const;
0095   /// HLTLevel1GTSeed modules for trigger path with name
0096   const std::vector<std::pair<bool, std::string> >& hltL1GTSeeds(const std::string& trigger) const;
0097   /// HLTLevel1GTSeed modules for trigger path with index i
0098   const std::vector<std::pair<bool, std::string> >& hltL1GTSeeds(unsigned int trigger) const;
0099 
0100   /// HLTL1TSeed module
0101   /// HLTL1TSeed modules for all trigger paths
0102   const std::vector<std::vector<std::string> >& hltL1TSeeds() const;
0103   /// HLTL1TSeed modules for trigger path with name
0104   const std::vector<std::string>& hltL1TSeeds(const std::string& trigger) const;
0105   /// HLTL1TSeed modules for trigger path with index i
0106   const std::vector<std::string>& hltL1TSeeds(unsigned int trigger) const;
0107 
0108   /// Streams
0109   /// list of names of all streams
0110   const std::vector<std::string>& streamNames() const;
0111   /// name of stream with index i
0112   const std::string& streamName(unsigned int stream) const;
0113   /// index of stream with name
0114   unsigned int streamIndex(const std::string& stream) const;
0115   /// names of datasets for all streams
0116   const std::vector<std::vector<std::string> >& streamContents() const;
0117   /// names of datasets in stream with index i
0118   const std::vector<std::string>& streamContent(unsigned int stream) const;
0119   /// names of datasets in stream with name
0120   const std::vector<std::string>& streamContent(const std::string& stream) const;
0121 
0122   /// Datasets
0123   /// list of names of all datasets
0124   const std::vector<std::string>& datasetNames() const;
0125   /// name of dataset with index i
0126   const std::string& datasetName(unsigned int dataset) const;
0127   /// index of dataset with name
0128   unsigned int datasetIndex(const std::string& dataset) const;
0129   /// names of trigger paths for all datasets
0130   const std::vector<std::vector<std::string> >& datasetContents() const;
0131   /// names of trigger paths in dataset with index i
0132   const std::vector<std::string>& datasetContent(unsigned int dataset) const;
0133   /// names of trigger paths in dataset with name
0134   const std::vector<std::string>& datasetContent(const std::string& dataset) const;
0135 
0136   /// HLT prescale info
0137   /// Number of HLT prescale sets
0138   unsigned int prescaleSize() const;
0139   /// HLT prescale value in specific prescale set for a specific trigger path
0140   unsigned int prescaleValue(unsigned int set, const std::string& trigger) const;
0141   /// low-level data member access
0142   const std::vector<std::string>& prescaleLabels() const;
0143   const std::map<std::string, std::vector<unsigned int> >& prescaleTable() const;
0144 
0145   /// technical: id() function needed for use with ThreadSafeRegistry
0146   edm::ParameterSetID id() const;
0147 
0148 private:
0149   const edm::ParameterSet* processPSet_;
0150 
0151   std::string processName_;
0152   std::string globalTag_;
0153   std::string tableName_;
0154   std::vector<std::string> triggerNames_;
0155   std::vector<std::vector<std::string> > moduleLabels_;
0156   std::vector<std::vector<std::string> > saveTagsModules_;
0157 
0158   std::map<std::string, unsigned int> triggerIndex_;
0159   std::vector<std::map<std::string, unsigned int> > moduleIndex_;
0160 
0161   unsigned int l1tType_;
0162   std::vector<std::vector<std::pair<bool, std::string> > > hltL1GTSeeds_;
0163   std::vector<std::vector<std::string> > hltL1TSeeds_;
0164 
0165   std::vector<std::string> streamNames_;
0166   std::map<std::string, unsigned int> streamIndex_;
0167   std::vector<std::vector<std::string> > streamContents_;
0168 
0169   std::vector<std::string> datasetNames_;
0170   std::map<std::string, unsigned int> datasetIndex_;
0171   std::vector<std::vector<std::string> > datasetContents_;
0172 
0173   trigger::HLTPrescaleTable hltPrescaleTable_;
0174 };
0175 #endif