Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:40

0001 #ifndef DataFormats_Luminosity_LumiSummaryRunHeader_h
0002 #define DataFormats_Luminosity_LumiSummaryRunHeader_h
0003 
0004 /** \class LumiSummaryRunHeader
0005  *
0006  * LumiSummaryRunHeader contains LumiSummary data which remains valid
0007  * during the whole run.
0008 
0009  * 1. Vectors of L1 and HLT trigger / path names. LumiSummary uses
0010  * integer indices into these two vectors to minimize disk-usage in
0011  * highly selective skim files.
0012  *
0013  * \author Matevz Tadel
0014  * \date   2011-02-22
0015  *
0016  */
0017 
0018 #include <vector>
0019 #include <string>
0020 
0021 class LumiSummaryRunHeader {
0022 public:
0023   typedef std::vector<std::string> vstring_t;
0024 
0025   //----------------------------------------------------------------
0026 
0027   /// Default constructor.
0028   LumiSummaryRunHeader() {}
0029 
0030   /// Constructor with names.
0031   /// Vectors are swapped so they are empty on return.
0032   LumiSummaryRunHeader(vstring_t& l1names, vstring_t& hltnames);
0033 
0034   /// Destructor.
0035   ~LumiSummaryRunHeader() {}
0036 
0037   /// Product compare function.
0038   bool isProductEqual(LumiSummaryRunHeader const& o) const;
0039 
0040   //----------------------------------------------------------------
0041 
0042   /// Set L1 name vector.
0043   void setL1Names(const vstring_t& l1names);
0044 
0045   /// Set HLT name vector.
0046   void setHLTNames(const vstring_t& hltnames);
0047 
0048   /// Swap L1 name vector.
0049   void swapL1Names(vstring_t& l1names);
0050 
0051   /// Swap HLT name vector.
0052   void swapHLTNames(vstring_t& hltnames);
0053 
0054   //----------------------------------------------------------------
0055 
0056   /// Get L1 name at given position.
0057   std::string getL1Name(unsigned int idx) const { return m_l1Names.at(idx); }
0058 
0059   /// Get HLT name at given position.
0060   std::string getHLTName(unsigned int idx) const { return m_hltNames.at(idx); }
0061 
0062   /// Get L1 name vector.
0063   const vstring_t& getL1Names(vstring_t& l1names) const { return m_l1Names; }
0064 
0065   /// Get HLT name vector.
0066   const vstring_t& getHLTNames(vstring_t& hltnames) const { return m_hltNames; }
0067 
0068   /// Get index of given L1 trigger-name. Returns -1 if not found.
0069   unsigned int getL1Index(const std::string& name) const;
0070 
0071   /// Get index of given HLT path-name. Returns -1 if not found.
0072   unsigned int getHLTIndex(const std::string& name) const;
0073 
0074   //----------------------------------------------------------------
0075 
0076 private:
0077   vstring_t m_l1Names;   // L1 trigger-name vector.
0078   vstring_t m_hltNames;  // HLT path-name vector.
0079 };
0080 
0081 #endif