test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LumiInfoRunHeader.cc
Go to the documentation of this file.
2 
4  std::bitset<LumiConstants::numBX>& fillingScheme):
5  lumiProvider_(lumiProvider),
6  fillingSchemeName_(fillingSchemeName),
7  fillingScheme_(fillingScheme)
8 {
10 }
11 
13 {
14  return (lumiProvider_ == o.lumiProvider_ &&
17 }
18 
19 //==============================================================================
20 
21 void LumiInfoRunHeader::setFillingScheme(const std::bitset<LumiConstants::numBX>& fillingScheme) {
22  fillingScheme_ = fillingScheme;
24 }
25 
26 // This function determines the bunch spacing from the filling scheme
27 // and sets bunchSpacing_ accordingly.
28 
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 }
50 
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
LumiInfoRunHeader()
Default constructor.
std::string lumiProvider_
std::string fillingSchemeName_
bool isProductEqual(LumiInfoRunHeader const &o) const
Product compare function.
void setFillingScheme(const std::bitset< LumiConstants::numBX > &fillingScheme)
Set filling scheme.