test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::LumiInfoRunHeader ( )
inline

Default constructor.

Definition at line 27 of file LumiInfoRunHeader.h.

27 {}
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().

4  :
5  lumiProvider_(lumiProvider),
6  fillingSchemeName_(fillingSchemeName),
7  fillingScheme_(fillingScheme)
8 {
10 }
std::bitset< LumiConstants::numBX > fillingScheme_
std::string lumiProvider_
std::string fillingSchemeName_
LumiInfoRunHeader::~LumiInfoRunHeader ( )
inline

Destructor.

Definition at line 34 of file LumiInfoRunHeader.h.

34 {}

Member Function Documentation

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_
int LumiInfoRunHeader::getBunchSpacing ( ) const
inline

Get bunch spacing (in ns).

Definition at line 65 of file LumiInfoRunHeader.h.

References bunchSpacing_.

65 { return bunchSpacing_; }
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_
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_
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_
bool LumiInfoRunHeader::isProductEqual ( LumiInfoRunHeader const &  o) const

Product compare function.

Definition at line 12 of file LumiInfoRunHeader.cc.

References fillingScheme_, fillingSchemeName_, and lumiProvider_.

13 {
14  return (lumiProvider_ == o.lumiProvider_ &&
15  fillingSchemeName_ == o.fillingSchemeName_ &&
16  fillingScheme_ == o.fillingScheme_);
17 }
std::bitset< LumiConstants::numBX > fillingScheme_
std::string lumiProvider_
std::string fillingSchemeName_
void LumiInfoRunHeader::setBunchSpacing ( void  )
private

Definition at line 29 of file LumiInfoRunHeader.cc.

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

Referenced by LumiInfoRunHeader(), and setFillingScheme().

29  {
30  int lastFilledBunch = -1;
31  int minimumSpacingFound = LumiConstants::numBX;
32 
33  for (unsigned int i=0; i<LumiConstants::numBX; i++) {
34  if (fillingScheme_[i]) {
35  if (lastFilledBunch >= 0) {
36  int thisSpacing = i-lastFilledBunch;
37  if (thisSpacing < minimumSpacingFound)
38  minimumSpacingFound = thisSpacing;
39  }
40  lastFilledBunch = i;
41  }
42  }
43 
44  // If no bunches are filled, then just leave bunchSpacing at 0
45  if (lastFilledBunch == -1)
46  bunchSpacing_ = 0;
47  else
48  bunchSpacing_ = LumiConstants::bxSpacingInt*minimumSpacingFound;
49 }
int i
Definition: DBlmapReader.cc:9
std::bitset< LumiConstants::numBX > fillingScheme_
static const unsigned int numBX
Definition: LumiConstants.h:9
static const int bxSpacingInt
Definition: LumiConstants.h:11
void LumiInfoRunHeader::setFillingScheme ( const std::bitset< LumiConstants::numBX > &  fillingScheme)

Set filling scheme.

Definition at line 21 of file LumiInfoRunHeader.cc.

References fillingScheme_, and setBunchSpacing().

21  {
22  fillingScheme_ = fillingScheme;
24 }
std::bitset< LumiConstants::numBX > fillingScheme_
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_
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

int LumiInfoRunHeader::bunchSpacing_
private

Definition at line 73 of file LumiInfoRunHeader.h.

Referenced by getBunchSpacing(), and setBunchSpacing().

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

Definition at line 71 of file LumiInfoRunHeader.h.

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

std::string LumiInfoRunHeader::lumiProvider_
private

Definition at line 70 of file LumiInfoRunHeader.h.

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