Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DataFormats_Luminosity_LumiInfoRunHeader_h
0002 #define DataFormats_Luminosity_LumiInfoRunHeader_h
0003 
0004 /** \class LumiInfoRunHeader
0005  *
0006  * LumiInfoRunHeader contains LumiInfo data which remains valid
0007  * during the whole run.
0008  *
0009  * This is an updated version of LumiSummaryRunHeader which drops
0010  * the L1/HLT trigger names and adds the filling scheme information.
0011  *
0012  * \author Matevz Tadel, updated by Paul Lujan
0013  * \date   2011-02-22, updated 2014-09-10
0014  *
0015  */
0016 
0017 #include <string>
0018 #include <bitset>
0019 #include "DataFormats/Luminosity/interface/LumiConstants.h"
0020 
0021 class LumiInfoRunHeader {
0022 public:
0023   //----------------------------------------------------------------
0024 
0025   /// Default constructor.
0026   LumiInfoRunHeader() {}
0027 
0028   /// Constructor with lumi provider, filling scheme name, and filling scheme.
0029   LumiInfoRunHeader(std::string& lumiProvider,
0030                     std::string& fillingSchemeName,
0031                     std::bitset<LumiConstants::numBX>& fillingScheme);
0032 
0033   /// Destructor.
0034   ~LumiInfoRunHeader() {}
0035 
0036   /// Product compare function.
0037   bool isProductEqual(LumiInfoRunHeader const& o) const;
0038 
0039   //----------------------------------------------------------------
0040 
0041   /// Set lumi provider.
0042   void setLumiProvider(const std::string& lumiProvider) { lumiProvider_ = lumiProvider; }
0043 
0044   /// Set filling scheme name.
0045   void setFillingSchemeName(const std::string& fillingSchemeName) { fillingSchemeName_ = fillingSchemeName; }
0046 
0047   /// Set filling scheme.
0048   void setFillingScheme(const std::bitset<LumiConstants::numBX>& fillingScheme);
0049 
0050   //----------------------------------------------------------------
0051 
0052   /// Get lumi provider.
0053   std::string getLumiProvider() const { return lumiProvider_; }
0054 
0055   /// Get filling scheme name.
0056   std::string getFillingSchemeName() const { return fillingSchemeName_; }
0057 
0058   /// Get filling scheme for given bunch.
0059   bool getBunchFilled(unsigned int bunch) const { return fillingScheme_[bunch]; }
0060 
0061   /// Get full filling scheme.
0062   const std::bitset<LumiConstants::numBX>& getFillingScheme() const { return fillingScheme_; }
0063 
0064   /// Get bunch spacing (in ns).
0065   int getBunchSpacing() const { return bunchSpacing_; }
0066 
0067   //----------------------------------------------------------------
0068 
0069 private:
0070   std::string lumiProvider_;                         // string with name of lumi provider
0071   std::string fillingSchemeName_;                    // name of filling scheme
0072   std::bitset<LumiConstants::numBX> fillingScheme_;  // filling scheme
0073   int bunchSpacing_;
0074 
0075   void setBunchSpacing();
0076 };
0077 
0078 #endif