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.

6  : lumiProvider_(lumiProvider), fillingSchemeName_(fillingSchemeName), fillingScheme_(fillingScheme) {
8 }

References setBunchSpacing().

◆ ~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.

59 { return fillingScheme_[bunch]; }

References fillingScheme_.

◆ getBunchSpacing()

int LumiInfoRunHeader::getBunchSpacing ( ) const
inline

Get bunch spacing (in ns).

Definition at line 65 of file LumiInfoRunHeader.h.

65 { return bunchSpacing_; }

References bunchSpacing_.

◆ getFillingScheme()

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

Get full filling scheme.

Definition at line 62 of file LumiInfoRunHeader.h.

62 { return fillingScheme_; }

References fillingScheme_.

◆ getFillingSchemeName()

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

Get filling scheme name.

Definition at line 56 of file LumiInfoRunHeader.h.

56 { return fillingSchemeName_; }

References fillingSchemeName_.

◆ getLumiProvider()

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

Get lumi provider.

Definition at line 53 of file LumiInfoRunHeader.h.

53 { return lumiProvider_; }

References lumiProvider_.

◆ isProductEqual()

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

Product compare function.

Definition at line 10 of file LumiInfoRunHeader.cc.

10  {
11  return (lumiProvider_ == o.lumiProvider_ && fillingSchemeName_ == o.fillingSchemeName_ &&
12  fillingScheme_ == o.fillingScheme_);
13 }

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

◆ setBunchSpacing()

void LumiInfoRunHeader::setBunchSpacing ( void  )
private

Definition at line 25 of file LumiInfoRunHeader.cc.

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 }

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

Referenced by LumiInfoRunHeader(), and setFillingScheme().

◆ setFillingScheme()

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

Set filling scheme.

Definition at line 17 of file LumiInfoRunHeader.cc.

17  {
18  fillingScheme_ = fillingScheme;
20 }

References fillingScheme_, and setBunchSpacing().

◆ setFillingSchemeName()

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

Set filling scheme name.

Definition at line 45 of file LumiInfoRunHeader.h.

45 { fillingSchemeName_ = fillingSchemeName; }

References fillingSchemeName_.

◆ setLumiProvider()

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

Set lumi provider.

Definition at line 42 of file LumiInfoRunHeader.h.

42 { lumiProvider_ = lumiProvider; }

References 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().

mps_fire.i
i
Definition: mps_fire.py:355
LumiConstants::numBX
static const unsigned int numBX
Definition: LumiConstants.h:8
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
LumiInfoRunHeader::bunchSpacing_
int bunchSpacing_
Definition: LumiInfoRunHeader.h:73
LumiInfoRunHeader::setBunchSpacing
void setBunchSpacing()
Definition: LumiInfoRunHeader.cc:25
LumiConstants::bxSpacingInt
static const int bxSpacingInt
Definition: LumiConstants.h:10
LumiInfoRunHeader::fillingSchemeName_
std::string fillingSchemeName_
Definition: LumiInfoRunHeader.h:71
LumiInfoRunHeader::lumiProvider_
std::string lumiProvider_
Definition: LumiInfoRunHeader.h:70
LumiInfoRunHeader::fillingScheme_
std::bitset< LumiConstants::numBX > fillingScheme_
Definition: LumiInfoRunHeader.h:72