CMS 3D CMS Logo

DIPLumiDetail.cc
Go to the documentation of this file.
2 
3 #include <iomanip>
4 #include <ostream>
5 #include <iostream>
6 
7 DIPLumiDetail::DIPLumiDetail() : m_runnum(0), m_ls(0), m_lumiValues(3564) {}
8 bool DIPLumiDetail::isNull() const {
9  if (m_runnum == 0 && m_ls == 0) {
10  return true;
11  }
12  return false;
13 }
14 float DIPLumiDetail::lumiValue(unsigned int bx) const { return m_lumiValues[bx]; }
16  return ValueRange(m_lumiValues.begin(), m_lumiValues.end());
17 }
18 void DIPLumiDetail::filldata(std::vector<float>& lumivalues) { lumivalues.swap(m_lumiValues); }
19 void DIPLumiDetail::fillbxdata(unsigned int bxidx, float bxvalue) { m_lumiValues[bxidx] = bxvalue; }
20 unsigned int DIPLumiDetail::fromRun() const { return m_runnum; }
21 unsigned int DIPLumiDetail::fromLS() const { return m_ls; }
22 void DIPLumiDetail::setOrigin(unsigned int runnumber, unsigned int ls) {
24  m_ls = ls;
25 }
26 std::ostream& operator<<(std::ostream& s, DIPLumiDetail const& diplumiDetail) {
27  s << "\nDumping DIPLumiDetail\n";
28  std::cout.setf(std::ios::fixed, std::ios::floatfield);
29  std::cout.setf(std::ios::showpoint);
30  std::vector<float>::const_iterator lumivalueIt = diplumiDetail.lumiValues().first;
31  std::vector<float>::const_iterator lumivalueEnd = diplumiDetail.lumiValues().second;
32  for (unsigned int i = 0; lumivalueIt != lumivalueEnd; ++lumivalueIt, ++i) {
33  s << std::setw(10) << " bunch = " << i << " bunchlumi = " << *lumivalueIt << "\n";
34  }
35  s << "\n";
36  return s;
37 }
ValueRange lumiValues() const
float lumiValue(unsigned int bx) const
unsigned int fromRun() const
unsigned int m_ls
Definition: DIPLumiDetail.h:25
std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > ValueRange
Definition: DIPLumiDetail.h:11
std::vector< float > m_lumiValues
Definition: DIPLumiDetail.h:26
DIPLumiDetail()
default constructor
Definition: DIPLumiDetail.cc:7
def ls(path, rec=False)
Definition: eostools.py:349
unsigned int m_runnum
Definition: DIPLumiDetail.h:24
void setOrigin(unsigned int runnumber, unsigned int ls)
void filldata(std::vector< float > &lumivalues)
bool isNull() const
Definition: DIPLumiDetail.cc:8
unsigned int fromLS() const
void fillbxdata(unsigned int bxidx, float bxlumi)
std::ostream & operator<<(std::ostream &s, DIPLumiDetail const &diplumiDetail)