CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LumiSectionData.cc
Go to the documentation of this file.
2 #include <iostream>
3 lumi::LumiSectionData::LumiSectionData() : m_sectionid(0), m_versionid("-1") {
4  m_bx.reserve(lumi::BXMAX * LUMIALGOMAX);
5 }
6 std::string lumi::LumiSectionData::lumiVersion() const { return m_versionid; }
7 int lumi::LumiSectionData::lumisectionID() const { return m_sectionid; }
8 size_t lumi::LumiSectionData::nBunchCrossing() const { return m_bx.size() / lumi::LUMIALGOMAX; }
9 float lumi::LumiSectionData::lumiAverage() const { return m_lumiavg; }
10 float lumi::LumiSectionData::lumiError() const { return m_lumierror; }
11 float lumi::LumiSectionData::deadFraction() const { return m_deadfrac; }
12 unsigned long long lumi::LumiSectionData::startorbit() const { return m_startorbit; }
13 int lumi::LumiSectionData::lumiquality() const { return m_quality; }
15  std::vector<lumi::BunchCrossingInfo>& result) const {
16  result.clear();
17  size_t offset = lumialgotype * lumi::BXMAX;
18  std::copy(m_bx.begin() + offset, m_bx.begin() + offset + lumi::BXMAX, std::back_inserter(result));
19 }
20 
22  const LumiAlgoType lumialgotype) const {
23  int realIdx = BXIndex - lumi::BXMIN + lumialgotype * lumi::BXMAX;
24  return m_bx.at(realIdx);
25 }
27  return m_bx.begin() + lumialgotype * BXMAX;
28 }
30  return m_bx.end() - (lumi::BXMAX)*lumialgotype;
31 }
32 size_t lumi::LumiSectionData::nHLTPath() const { return m_hlt.size(); }
33 bool lumi::LumiSectionData::HLThasData() const { return !m_hlt.empty(); }
34 lumi::HLTIterator lumi::LumiSectionData::hltBegin() const { return m_hlt.begin(); }
35 lumi::HLTIterator lumi::LumiSectionData::hltEnd() const { return m_hlt.end(); }
36 bool lumi::LumiSectionData::TriggerhasData() const { return !m_trigger.empty(); }
37 lumi::TriggerIterator lumi::LumiSectionData::trgBegin() const { return m_trigger.begin(); }
38 lumi::TriggerIterator lumi::LumiSectionData::trgEnd() const { return m_trigger.end(); }
39 short lumi::LumiSectionData::qualityFlag() const { return m_quality; }
40 void lumi::LumiSectionData::setLumiNull() { m_versionid = -99; }
41 void lumi::LumiSectionData::setLumiVersion(const std::string& versionid) { m_versionid = versionid; }
42 void lumi::LumiSectionData::setLumiSectionId(int sectionid) { m_sectionid = sectionid; }
43 void lumi::LumiSectionData::setLumiAverage(float avg) { m_lumiavg = avg; }
44 void lumi::LumiSectionData::setLumiQuality(int lumiquality) { m_quality = lumiquality; }
45 void lumi::LumiSectionData::setDeadFraction(float deadfrac) { m_deadfrac = deadfrac; }
46 void lumi::LumiSectionData::setLumiError(float lumierr) { m_lumierror = lumierr; }
47 void lumi::LumiSectionData::setStartOrbit(unsigned long long orbtnumber) { m_startorbit = orbtnumber; }
48 void lumi::LumiSectionData::setBunchCrossingData(const std::vector<BunchCrossingInfo>& BXs,
49  const LumiAlgoType algotype) {
50  std::copy(BXs.begin(), BXs.begin() + lumi::BXMAX, std::back_inserter(m_bx));
51 }
52 void lumi::LumiSectionData::setHLTData(const std::vector<HLTInfo>& hltdetail) {
53  std::copy(hltdetail.begin(), hltdetail.end(), std::back_inserter(m_hlt));
54 }
55 void lumi::LumiSectionData::setTriggerData(const std::vector<TriggerInfo>& triggerinfo) {
56  std::copy(triggerinfo.begin(), triggerinfo.end(), std::back_inserter(m_trigger));
57 }
58 void lumi::LumiSectionData::setQualityFlag(short qualityflag) { m_quality = qualityflag; }
59 void lumi::LumiSectionData::print(std::ostream& s) const {
60  s << "lumi section id :" << m_sectionid << ", ";
61  s << "lumi data version : " << m_versionid << ", ";
62  s << "lumi average : " << m_lumiavg << ", ";
63  s << "lumi error : " << m_lumierror << ", ";
64  s << "lumi quality : " << m_quality << ", ";
65  s << "lumi deadfrac : " << m_deadfrac << std::endl;
66  std::vector<lumi::TriggerInfo>::const_iterator trgit;
67  std::vector<lumi::TriggerInfo>::const_iterator trgitBeg = m_trigger.begin();
68  std::vector<lumi::TriggerInfo>::const_iterator trgitEnd = m_trigger.end();
69  unsigned int i = 0;
70  for (trgit = trgitBeg; trgit != trgitEnd; ++trgit) {
71  std::cout << " trg " << i << " : name : " << trgit->name << " : count : " << trgit->triggercount
72  << " : deadtime : " << trgit->deadtimecount << " : prescale : " << trgit->prescale << std::endl;
73  ++i;
74  }
75 }
void setLumiQuality(int lumiquality)
unsigned long long startorbit() const
void setLumiAverage(float lumiavg)
std::vector< BunchCrossingInfo >::const_iterator BunchCrossingIterator
TriggerIterator trgEnd() const
void setBunchCrossingData(const std::vector< BunchCrossingInfo > &BXs, const LumiAlgoType algotype)
void setQualityFlag(short qualityflag)
std::string lumiVersion() const
float lumiAverage() const
BunchCrossingIterator bunchCrossingEnd(const LumiAlgoType lumialgotype) const
HLTIterator hltEnd() const
tuple result
Definition: mps_fire.py:311
size_t nHLTPath() const
HLTIterator hltBegin() const
float lumiError() const
float deadFraction() const
std::vector< TriggerInfo >::const_iterator TriggerIterator
bool HLThasData() const
void bunchCrossingInfo(const LumiAlgoType lumialgotype, std::vector< BunchCrossingInfo > &result) const
static const int LUMIALGOMAX
TriggerIterator trgBegin() const
void setStartOrbit(unsigned long long orbtnumber)
size_t nBunchCrossing() const
std::vector< BunchCrossingInfo > m_bx
short qualityFlag() const
void setTriggerData(const std::vector< TriggerInfo > &triggerinfo)
bool TriggerhasData() const
static const int BXMAX
void print(std::ostream &s) const
void setLumiSectionId(int sectionid)
void setLumiError(float lumierr)
int lumisectionID() const
BunchCrossingIterator bunchCrossingBegin(const LumiAlgoType lumialgotype) const
void setHLTData(const std::vector< HLTInfo > &hltdetail)
tuple cout
Definition: gather_cfg.py:144
void setLumiVersion(const std::string &versionid)
static const int BXMIN
std::vector< HLTInfo >::const_iterator HLTIterator
void setDeadFraction(float deadfrac)