CMS 3D CMS Logo

LumiInfoRunHeader.cc
Go to the documentation of this file.
2 
4  std::string& fillingSchemeName,
5  std::bitset<LumiConstants::numBX>& fillingScheme)
6  : lumiProvider_(lumiProvider), fillingSchemeName_(fillingSchemeName), fillingScheme_(fillingScheme) {
8 }
9 
11  return (lumiProvider_ == o.lumiProvider_ && fillingSchemeName_ == o.fillingSchemeName_ &&
12  fillingScheme_ == o.fillingScheme_);
13 }
14 
15 //==============================================================================
16 
17 void LumiInfoRunHeader::setFillingScheme(const std::bitset<LumiConstants::numBX>& fillingScheme) {
18  fillingScheme_ = fillingScheme;
20 }
21 
22 // This function determines the bunch spacing from the filling scheme
23 // and sets bunchSpacing_ accordingly.
24 
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 }
mps_fire.i
i
Definition: mps_fire.py:428
LumiConstants::numBX
static const unsigned int numBX
Definition: LumiConstants.h:8
LumiInfoRunHeader::isProductEqual
bool isProductEqual(LumiInfoRunHeader const &o) const
Product compare function.
Definition: LumiInfoRunHeader.cc:10
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
LumiInfoRunHeader.h
LumiInfoRunHeader::bunchSpacing_
int bunchSpacing_
Definition: LumiInfoRunHeader.h:73
LumiInfoRunHeader::setBunchSpacing
void setBunchSpacing()
Definition: LumiInfoRunHeader.cc:25
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LumiInfoRunHeader
Definition: LumiInfoRunHeader.h:21
LumiConstants::bxSpacingInt
static const int bxSpacingInt
Definition: LumiConstants.h:10
LumiInfoRunHeader::LumiInfoRunHeader
LumiInfoRunHeader()
Default constructor.
Definition: LumiInfoRunHeader.h:26
LumiInfoRunHeader::fillingSchemeName_
std::string fillingSchemeName_
Definition: LumiInfoRunHeader.h:71
LumiInfoRunHeader::setFillingScheme
void setFillingScheme(const std::bitset< LumiConstants::numBX > &fillingScheme)
Set filling scheme.
Definition: LumiInfoRunHeader.cc:17
LumiInfoRunHeader::lumiProvider_
std::string lumiProvider_
Definition: LumiInfoRunHeader.h:70
LumiInfoRunHeader::fillingScheme_
std::bitset< LumiConstants::numBX > fillingScheme_
Definition: LumiInfoRunHeader.h:72