LumiInfoRunHeader

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
#ifndef DataFormats_Luminosity_LumiInfoRunHeader_h
#define DataFormats_Luminosity_LumiInfoRunHeader_h

/** \class LumiInfoRunHeader
 *
 * LumiInfoRunHeader contains LumiInfo data which remains valid
 * during the whole run.
 *
 * This is an updated version of LumiSummaryRunHeader which drops
 * the L1/HLT trigger names and adds the filling scheme information.
 *
 * \author Matevz Tadel, updated by Paul Lujan
 * \date   2011-02-22, updated 2014-09-10
 *
 */

#include <string>
#include <bitset>
#include "DataFormats/Luminosity/interface/LumiConstants.h"

class LumiInfoRunHeader {
public:
  //----------------------------------------------------------------

  /// Default constructor.
  LumiInfoRunHeader() {}

  /// Constructor with lumi provider, filling scheme name, and filling scheme.
  LumiInfoRunHeader(std::string& lumiProvider,
                    std::string& fillingSchemeName,
                    std::bitset<LumiConstants::numBX>& fillingScheme);

  /// Destructor.
  ~LumiInfoRunHeader() {}

  /// Product compare function.
  bool isProductEqual(LumiInfoRunHeader const& o) const;

  //----------------------------------------------------------------

  /// Set lumi provider.
  void setLumiProvider(const std::string& lumiProvider) { lumiProvider_ = lumiProvider; }

  /// Set filling scheme name.
  void setFillingSchemeName(const std::string& fillingSchemeName) { fillingSchemeName_ = fillingSchemeName; }

  /// Set filling scheme.
  void setFillingScheme(const std::bitset<LumiConstants::numBX>& fillingScheme);

  //----------------------------------------------------------------

  /// Get lumi provider.
  std::string getLumiProvider() const { return lumiProvider_; }

  /// Get filling scheme name.
  std::string getFillingSchemeName() const { return fillingSchemeName_; }

  /// Get filling scheme for given bunch.
  bool getBunchFilled(unsigned int bunch) const { return fillingScheme_[bunch]; }

  /// Get full filling scheme.
  const std::bitset<LumiConstants::numBX>& getFillingScheme() const { return fillingScheme_; }

  /// Get bunch spacing (in ns).
  int getBunchSpacing() const { return bunchSpacing_; }

  //----------------------------------------------------------------

private:
  std::string lumiProvider_;                         // string with name of lumi provider
  std::string fillingSchemeName_;                    // name of filling scheme
  std::bitset<LumiConstants::numBX> fillingScheme_;  // filling scheme
  int bunchSpacing_;

  void setBunchSpacing();
};

#endif