CMS 3D CMS Logo

LHCInfoPerLS.cc
Go to the documentation of this file.
2 //#include "CondFormats/Common/interface/TimeConversions.h"
3 #include <algorithm>
4 #include <iterator>
5 #include <vector>
6 #include <stdexcept>
7 
8 LHCInfoPerLS::LHCInfoPerLS() : LHCInfoVectorizedFields(ISIZE, FSIZE, TSIZE, SSIZE) {}
9 
10 //getters
11 unsigned short const LHCInfoPerLS::fillNumber() const { return LHCInfoPerLS::getOneParam(m_intParams, LHC_FILL); }
12 
14 
16 
18 
20 
22 
24 
25 //setters
26 void LHCInfoPerLS::setFillNumber(unsigned short const& lhcFill) {
27  LHCInfoPerLS::setOneParam(m_intParams, LHC_FILL, static_cast<unsigned int>(lhcFill));
28 }
29 
30 void LHCInfoPerLS::setLumiSection(unsigned int const& lumiSection) {
32 }
33 
36 }
37 
40 }
41 
44 }
45 
48 }
49 
52 };
53 
54 //sets all values in one go
55 void LHCInfoPerLS::setInfo(unsigned short const& lhcFill,
56  unsigned int const& lumiSection,
57  float const& angleX,
58  float const& angleY,
59  float const& betaX,
60  float const& betaY,
61  cond::Time_t const& runNumber) {
62  this->setFillNumber(lhcFill);
63  this->setLumiSection(lumiSection);
64  this->setCrossingAngleX(angleX);
65  this->setCrossingAngleY(angleY);
66  this->setBetaStarX(betaX);
67  this->setBetaStarY(betaY);
68  this->setRunNumber(runNumber);
69 }
70 
71 void LHCInfoPerLS::print(std::stringstream& ss) const {
72  ss << "LHC fill: " << this->fillNumber() << std::endl
73  << "Lumi section: " << this->lumiSection() << std::endl
74  << "Run number: " << this->runNumber() << std::endl
75  << "Crossing angle x (urad): " << this->crossingAngleX() << std::endl
76  << "Crossing angle y (urad): " << this->crossingAngleY() << std::endl
77  << "Beta star x (m): " << this->betaStarX() << std::endl
78  << "Beta star y (m): " << this->betaStarY() << std::endl;
79 }
80 
81 std::ostream& operator<<(std::ostream& os, LHCInfoPerLS beamInfo) {
82  std::stringstream ss;
83  beamInfo.print(ss);
84  os << ss.str();
85  return os;
86 }
87 
88 bool LHCInfoPerLS::equals(const LHCInfoPerLS& rhs) const {
89  if (m_isData != rhs.m_isData)
90  return false;
91  if (m_intParams != rhs.m_intParams)
92  return false;
93  if (m_floatParams != rhs.m_floatParams)
94  return false;
95  if (m_timeParams != rhs.m_timeParams)
96  return false;
97  return true;
98 }
99 
100 bool LHCInfoPerLS::empty() const { return m_intParams[0].empty(); }
void setFillNumber(unsigned short const &lhcFill)
Definition: LHCInfoPerLS.cc:26
static void setOneParam(std::vector< std::vector< T > > &params, size_t index, const T &value)
cond::Time_t runNumber() const
Definition: LHCInfoPerLS.cc:23
void setCrossingAngleY(float const &angle)
Definition: LHCInfoPerLS.cc:38
std::vector< std::vector< unsigned int > > m_intParams
void setLumiSection(unsigned int const &lumiSection)
Definition: LHCInfoPerLS.cc:30
void setBetaStarX(float const &betaStar)
Definition: LHCInfoPerLS.cc:42
static const T & getOneParam(const std::vector< std::vector< T > > &params, size_t index)
float const betaStarY() const
Definition: LHCInfoPerLS.cc:21
float const crossingAngleX() const
Definition: LHCInfoPerLS.cc:15
std::vector< std::vector< unsigned long long > > m_timeParams
void setInfo(unsigned short const &lhcFill, unsigned int const &lumiSection, float const &angleX, float const &angleY, float const &betaX, float const &betaY, cond::Time_t const &runNumber)
Definition: LHCInfoPerLS.cc:55
unsigned long long Time_t
Definition: Time.h:14
std::ostream & operator<<(std::ostream &os, LHCInfoPerLS beamInfo)
Definition: LHCInfoPerLS.cc:81
bool empty() const
void setBetaStarY(float const &betaStar)
Definition: LHCInfoPerLS.cc:46
std::vector< std::vector< float > > m_floatParams
float const crossingAngleY() const
Definition: LHCInfoPerLS.cc:17
bool equals(const LHCInfoPerLS &rhs) const
Definition: LHCInfoPerLS.cc:88
void print(std::stringstream &ss) const
Definition: LHCInfoPerLS.cc:71
unsigned int const & lumiSection() const
Definition: LHCInfoPerLS.cc:13
void setCrossingAngleX(float const &angle)
Definition: LHCInfoPerLS.cc:34
void setRunNumber(cond::Time_t const &runNumber)
Definition: LHCInfoPerLS.cc:50
unsigned short const fillNumber() const
Definition: LHCInfoPerLS.cc:11
float const betaStarX() const
Definition: LHCInfoPerLS.cc:19
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11