CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
LumiInfoRunHeader Class Reference

#include <LumiInfoRunHeader.h>

Public Member Functions

bool getBunchFilled (unsigned int bunch) const
 Get filling scheme for given bunch. More...
 
int getBunchSpacing () const
 Get bunch spacing (in ns). More...
 
const std::bitset< LumiConstants::numBX > & getFillingScheme () const
 Get full filling scheme. More...
 
std::string getFillingSchemeName () const
 Get filling scheme name. More...
 
std::string getLumiProvider () const
 Get lumi provider. More...
 
bool isProductEqual (LumiInfoRunHeader const &o) const
 Product compare function. More...
 
 LumiInfoRunHeader ()
 Default constructor. More...
 
 LumiInfoRunHeader (std::string &lumiProvider, std::string &fillingSchemeName, std::bitset< LumiConstants::numBX > &fillingScheme)
 Constructor with lumi provider, filling scheme name, and filling scheme. More...
 
void setFillingScheme (const std::bitset< LumiConstants::numBX > &fillingScheme)
 Set filling scheme. More...
 
void setFillingSchemeName (const std::string &fillingSchemeName)
 Set filling scheme name. More...
 
void setLumiProvider (const std::string &lumiProvider)
 Set lumi provider. More...
 
 ~LumiInfoRunHeader ()
 Destructor. More...
 

Private Member Functions

void setBunchSpacing ()
 

Private Attributes

int bunchSpacing_
 
std::bitset< LumiConstants::numBXfillingScheme_
 
std::string fillingSchemeName_
 
std::string lumiProvider_
 

Detailed Description

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

Definition at line 21 of file LumiInfoRunHeader.h.

Constructor & Destructor Documentation

◆ LumiInfoRunHeader() [1/2]

LumiInfoRunHeader::LumiInfoRunHeader ( )
inline

Default constructor.

Definition at line 26 of file LumiInfoRunHeader.h.

26 {}

◆ LumiInfoRunHeader() [2/2]

LumiInfoRunHeader::LumiInfoRunHeader ( std::string &  lumiProvider,
std::string &  fillingSchemeName,
std::bitset< LumiConstants::numBX > &  fillingScheme 
)

Constructor with lumi provider, filling scheme name, and filling scheme.

Definition at line 3 of file LumiInfoRunHeader.cc.

References setBunchSpacing().

6  : lumiProvider_(lumiProvider), fillingSchemeName_(fillingSchemeName), fillingScheme_(fillingScheme) {
8 }
std::bitset< LumiConstants::numBX > fillingScheme_
std::string lumiProvider_
std::string fillingSchemeName_

◆ ~LumiInfoRunHeader()

LumiInfoRunHeader::~LumiInfoRunHeader ( )
inline

Destructor.

Definition at line 34 of file LumiInfoRunHeader.h.

34 {}

Member Function Documentation

◆ getBunchFilled()

bool LumiInfoRunHeader::getBunchFilled ( unsigned int  bunch) const
inline

Get filling scheme for given bunch.

Definition at line 59 of file LumiInfoRunHeader.h.

References fillingScheme_.

59 { return fillingScheme_[bunch]; }
std::bitset< LumiConstants::numBX > fillingScheme_

◆ getBunchSpacing()

int LumiInfoRunHeader::getBunchSpacing ( ) const
inline

Get bunch spacing (in ns).

Definition at line 65 of file LumiInfoRunHeader.h.

References bunchSpacing_.

65 { return bunchSpacing_; }

◆ getFillingScheme()

const std::bitset<LumiConstants::numBX>& LumiInfoRunHeader::getFillingScheme ( ) const
inline

Get full filling scheme.

Definition at line 62 of file LumiInfoRunHeader.h.

References fillingScheme_.

62 { return fillingScheme_; }
std::bitset< LumiConstants::numBX > fillingScheme_

◆ getFillingSchemeName()

std::string LumiInfoRunHeader::getFillingSchemeName ( ) const
inline

Get filling scheme name.

Definition at line 56 of file LumiInfoRunHeader.h.

References fillingSchemeName_.

56 { return fillingSchemeName_; }
std::string fillingSchemeName_

◆ getLumiProvider()

std::string LumiInfoRunHeader::getLumiProvider ( ) const
inline

Get lumi provider.

Definition at line 53 of file LumiInfoRunHeader.h.

References lumiProvider_.

53 { return lumiProvider_; }
std::string lumiProvider_

◆ isProductEqual()

bool LumiInfoRunHeader::isProductEqual ( LumiInfoRunHeader const &  o) const

Product compare function.

Definition at line 10 of file LumiInfoRunHeader.cc.

References fillingScheme_, fillingSchemeName_, lumiProvider_, and EcalTangentSkim_cfg::o.

10  {
11  return (lumiProvider_ == o.lumiProvider_ && fillingSchemeName_ == o.fillingSchemeName_ &&
12  fillingScheme_ == o.fillingScheme_);
13 }
std::bitset< LumiConstants::numBX > fillingScheme_
std::string lumiProvider_
std::string fillingSchemeName_

◆ setBunchSpacing()

void LumiInfoRunHeader::setBunchSpacing ( void  )
private

Definition at line 25 of file LumiInfoRunHeader.cc.

References bunchSpacing_, LumiConstants::bxSpacingInt, fillingScheme_, mps_fire::i, and LumiConstants::numBX.

Referenced by LumiInfoRunHeader(), and setFillingScheme().

25  {
26  int lastFilledBunch = -1;
27  int minimumSpacingFound = LumiConstants::numBX;
28 
29  for (unsigned int i = 0; i < LumiConstants::numBX; i++) {
30  if (fillingScheme_[i]) {
31  if (lastFilledBunch >= 0) {
32  int thisSpacing = i - lastFilledBunch;
33  if (thisSpacing < minimumSpacingFound)
34  minimumSpacingFound = thisSpacing;
35  }
36  lastFilledBunch = i;
37  }
38  }
39 
40  // If no bunches are filled, then just leave bunchSpacing at 0
41  if (lastFilledBunch == -1)
42  bunchSpacing_ = 0;
43  else
44  bunchSpacing_ = LumiConstants::bxSpacingInt * minimumSpacingFound;
45 }
std::bitset< LumiConstants::numBX > fillingScheme_
static const unsigned int numBX
Definition: LumiConstants.h:8
static const int bxSpacingInt
Definition: LumiConstants.h:10

◆ setFillingScheme()

void LumiInfoRunHeader::setFillingScheme ( const std::bitset< LumiConstants::numBX > &  fillingScheme)

Set filling scheme.

Definition at line 17 of file LumiInfoRunHeader.cc.

References fillingScheme_, and setBunchSpacing().

17  {
18  fillingScheme_ = fillingScheme;
20 }
std::bitset< LumiConstants::numBX > fillingScheme_

◆ setFillingSchemeName()

void LumiInfoRunHeader::setFillingSchemeName ( const std::string &  fillingSchemeName)
inline

Set filling scheme name.

Definition at line 45 of file LumiInfoRunHeader.h.

References fillingSchemeName_.

45 { fillingSchemeName_ = fillingSchemeName; }
std::string fillingSchemeName_

◆ setLumiProvider()

void LumiInfoRunHeader::setLumiProvider ( const std::string &  lumiProvider)
inline

Set lumi provider.

Definition at line 42 of file LumiInfoRunHeader.h.

References lumiProvider_.

42 { lumiProvider_ = lumiProvider; }
std::string lumiProvider_

Member Data Documentation

◆ bunchSpacing_

int LumiInfoRunHeader::bunchSpacing_
private

Definition at line 73 of file LumiInfoRunHeader.h.

Referenced by getBunchSpacing(), and setBunchSpacing().

◆ fillingScheme_

std::bitset<LumiConstants::numBX> LumiInfoRunHeader::fillingScheme_
private

◆ fillingSchemeName_

std::string LumiInfoRunHeader::fillingSchemeName_
private

Definition at line 71 of file LumiInfoRunHeader.h.

Referenced by getFillingSchemeName(), isProductEqual(), and setFillingSchemeName().

◆ lumiProvider_

std::string LumiInfoRunHeader::lumiProvider_
private

Definition at line 70 of file LumiInfoRunHeader.h.

Referenced by getLumiProvider(), isProductEqual(), and setLumiProvider().