CMS 3D CMS Logo

BeamSpotOnlineObjects.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 
6  template <typename T>
7  const T& getParams(const std::vector<T>& params, size_t index) {
8  if (index >= params.size())
9  throw std::out_of_range("Parameter with index " + std::to_string(index) + " is out of range.");
10  return params[index];
11  }
12 
13  template <typename T>
14  T& accessParams(std::vector<T>& params, size_t index) {
15  if (index >= params.size())
16  throw std::out_of_range("Parameter with index " + std::to_string(index) + " is out of range.");
17  return params[index];
18  }
19 
20  template <typename T>
21  const T& getOneParam(const std::vector<std::vector<T> >& params, size_t index) {
22  if (index >= params.size())
23  throw std::out_of_range("Parameter with index " + std::to_string(index) + " is out of range.");
24  const std::vector<T>& inner = params[index];
25  if (inner.empty())
26  throw std::out_of_range("Parameter with index " + std::to_string(index) + " type=" + typeid(T).name() +
27  " has no value stored.");
28  return inner[0];
29  }
30 
31  template <typename T>
32  void setOneParam(std::vector<std::vector<T> >& params, size_t index, const T& value) {
33  if (index >= params.size())
34  throw std::out_of_range("Parameter with index " + std::to_string(index) + " is out of range.");
35  params[index] = std::vector<T>(1, value);
36  }
37 
38  template <typename T>
39  void setParams(std::vector<T>& params, size_t index, const T& value) {
40  if (index >= params.size())
41  throw std::out_of_range("Parameter with index " + std::to_string(index) + " is out of range.");
42  params[index] = value;
43  }
44 
45 } //namespace BeamSpotOnlineObjectsImpl
46 
47 // getters
50 }
51 
53 
56 }
57 
59 
61 
64 }
65 
67 
70 }
71 
74 }
75 
78 }
79 
82 }
83 
86 }
87 
90 }
91 
94 }
95 
96 // setters
99 }
100 
102 
105 }
106 
109 }
110 
111 void BeamSpotOnlineObjects::SetMeanPV(float meanPVs) {
113 }
114 
117 }
118 
121 }
122 
125 }
126 
129 }
130 
133 }
134 
137 }
138 
141 }
142 
145 }
146 
149 }
150 
151 // printers
152 void BeamSpotOnlineObjects::print(std::stringstream& ss) const {
153  ss << "-----------------------------------------------------\n"
154  << " BeamSpotOnline Data\n\n"
155  << " Beam type = " << GetBeamType() << "\n"
156  << " X0 = " << GetX() << " +/- " << GetXError() << " [cm]\n"
157  << " Y0 = " << GetY() << " +/- " << GetYError() << " [cm]\n"
158  << " Z0 = " << GetZ() << " +/- " << GetZError() << " [cm]\n"
159  << " Sigma Z0 = " << GetSigmaZ() << " +/- " << GetSigmaZError() << " [cm]\n"
160  << " dxdz = " << Getdxdz() << " +/- " << GetdxdzError() << " [radians]\n"
161  << " dydz = " << Getdydz() << " +/- " << GetdydzError() << " [radians]\n"
162  << " Beam Width X = " << GetBeamWidthX() << " +/- " << GetBeamWidthXError() << " [cm]\n"
163  << " Beam Width Y = " << GetBeamWidthY() << " +/- " << GetBeamWidthYError() << " [cm]\n"
164  << " Emittance X = " << GetEmittanceX() << " [cm]\n"
165  << " Emittance Y = " << GetEmittanceY() << " [cm]\n"
166  << " Beta star = " << GetBetaStar() << " [cm]\n"
167  << " Last Lumi = " << GetLastAnalyzedLumi() << "\n"
168  << " Last Run = " << GetLastAnalyzedRun() << "\n"
169  << " Last Fill = " << GetLastAnalyzedFill() << "\n"
170  << "-----------------------------------------------------\n\n";
171 }
172 
173 std::ostream& operator<<(std::ostream& os, BeamSpotOnlineObjects beam) {
174  std::stringstream ss;
175  beam.print(ss);
176  os << ss.str();
177  return os;
178 }
BeamSpotOnlineObjects::intParams_
std::vector< std::vector< int > > intParams_
Definition: BeamSpotOnlineObjects.h:157
BeamSpotObjects::GetBeamWidthY
double GetBeamWidthY() const
get average transverse beam width
Definition: BeamSpotObjects.h:77
BeamSpotPI::nPVs
Definition: BeamSpotPayloadInspectorHelper.h:43
BeamSpotObjects::Getdxdz
double Getdxdz() const
get dxdz slope, crossing angle in XZ
Definition: BeamSpotObjects.h:79
BeamSpotOnlineObjectsImpl::setOneParam
void setOneParam(std::vector< std::vector< T > > &params, size_t index, const T &value)
Definition: BeamSpotOnlineObjects.cc:32
BeamSpotOnlineObjects::MEAN_PV
Definition: BeamSpotOnlineObjects.h:42
BeamSpotOnlineObjects::GetNumPVs
int GetNumPVs() const
Definition: BeamSpotOnlineObjects.cc:52
BeamSpotOnlineObjects::NUM_TRACKS
Definition: BeamSpotOnlineObjects.h:41
BeamSpotObjects::GetSigmaZError
double GetSigmaZError() const
get sigma Z, RMS bunch length Error
Definition: BeamSpotObjects.h:91
BeamSpotOnlineObjects::SetCreationTime
void SetCreationTime(cond::Time_t val)
Definition: BeamSpotOnlineObjects.cc:139
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
BeamSpotOnlineObjects::SetNumTracks
void SetNumTracks(int val)
Definition: BeamSpotOnlineObjects.cc:97
BeamSpotObjects::GetSigmaZ
double GetSigmaZ() const
get sigma Z, RMS bunch length
Definition: BeamSpotObjects.h:73
BeamSpotObjects::GetBeamType
int GetBeamType() const
get beam type
Definition: BeamSpotObjects.h:101
BeamSpotOnlineObjects::SetEndTimeStamp
void SetEndTimeStamp(cond::Time_t val)
Definition: BeamSpotOnlineObjects.cc:147
BeamSpotObjects::GetZ
double GetZ() const
get Z beam position
Definition: BeamSpotObjects.h:71
BeamSpotOnlineObjects::SetEndTime
void SetEndTime(std::string val)
Definition: BeamSpotOnlineObjects.cc:131
BeamSpotOnlineObjects::GetEndTimeStamp
cond::Time_t GetEndTimeStamp() const
Definition: BeamSpotOnlineObjects.cc:92
BeamSpotOnlineObjects::GetUsedEvents
int GetUsedEvents() const
Definition: BeamSpotOnlineObjects.cc:54
BeamSpotOnlineObjects::CREATE_TIME
Definition: BeamSpotOnlineObjects.h:44
BeamSpotOnlineObjects::GetMaxPVs
int GetMaxPVs() const
Definition: BeamSpotOnlineObjects.cc:58
BeamSpotPI::nTracks
Definition: BeamSpotPayloadInspectorHelper.h:42
BeamSpotOnlineObjects::SetMeanErrorPV
void SetMeanErrorPV(float val)
Definition: BeamSpotOnlineObjects.cc:115
BeamSpotOnlineObjects::SetStartTime
void SetStartTime(std::string val)
Definition: BeamSpotOnlineObjects.cc:127
operator<<
std::ostream & operator<<(std::ostream &os, BeamSpotOnlineObjects beam)
Definition: BeamSpotOnlineObjects.cc:173
BeamSpotOnlineObjectsImpl::accessParams
T & accessParams(std::vector< T > &params, size_t index)
Definition: BeamSpotOnlineObjects.cc:14
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
BeamSpotOnlineObjects::GetMeanErrorPV
float GetMeanErrorPV() const
Definition: BeamSpotOnlineObjects.cc:62
BeamSpotOnlineObjects::GetStartTime
std::string GetStartTime() const
Definition: BeamSpotOnlineObjects.cc:72
BeamSpotOnlineObjects::GetMeanPV
float GetMeanPV() const
Definition: BeamSpotOnlineObjects.cc:60
SurfaceOrientation::inner
Definition: Surface.h:19
BeamSpotOnlineObjects::GetEndTime
std::string GetEndTime() const
Definition: BeamSpotOnlineObjects.cc:76
BeamSpotOnlineObjects::floatParams_
std::vector< std::vector< float > > floatParams_
Definition: BeamSpotOnlineObjects.h:158
EcalCondDBWriter_cfi.beam
beam
Definition: EcalCondDBWriter_cfi.py:45
BeamSpotOnlineObjects::GetLastAnalyzedLumi
int GetLastAnalyzedLumi() const
Getters Methods.
Definition: BeamSpotOnlineObjects.h:100
BeamSpotOnlineObjects::END_TIMESTAMP
Definition: BeamSpotOnlineObjects.h:44
BeamSpotOnlineObjects::timeParams_
std::vector< std::vector< unsigned long long > > timeParams_
Definition: BeamSpotOnlineObjects.h:160
BeamSpotOnlineObjects::RMS_PV
Definition: BeamSpotOnlineObjects.h:42
BeamSpotOnlineObjects::SetRmsErrorPV
void SetRmsErrorPV(float val)
Definition: BeamSpotOnlineObjects.cc:123
BeamSpotObjects::GetBetaStar
double GetBetaStar() const
get beta star
Definition: BeamSpotObjects.h:107
BeamSpotObjects::GetEmittanceX
double GetEmittanceX() const
get emittance
Definition: BeamSpotObjects.h:103
BeamSpotObjects::GetXError
double GetXError() const
get X beam position Error
Definition: BeamSpotObjects.h:85
BeamSpotOnlineObjects::START_TIME
Definition: BeamSpotOnlineObjects.h:43
BeamSpotObjects::GetY
double GetY() const
get Y beam position
Definition: BeamSpotObjects.h:69
BeamSpotOnlineObjects::GetCreationTime
cond::Time_t GetCreationTime() const
Definition: BeamSpotOnlineObjects.cc:84
BeamSpotOnlineObjects::SetMaxPVs
void SetMaxPVs(int val)
Definition: BeamSpotOnlineObjects.cc:107
BeamSpotOnlineObjects::USED_EVENTS
Definition: BeamSpotOnlineObjects.h:41
BeamSpotOnlineObjects::SetUsedEvents
void SetUsedEvents(int val)
Definition: BeamSpotOnlineObjects.cc:103
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
BeamSpotOnlineObjects::GetNumTracks
int GetNumTracks() const
Definition: BeamSpotOnlineObjects.cc:48
BeamSpotOnlineObjectsImpl::setParams
void setParams(std::vector< T > &params, size_t index, const T &value)
Definition: BeamSpotOnlineObjects.cc:39
value
Definition: value.py:1
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
BeamSpotOnlineObjects::stringParams_
std::vector< std::vector< std::string > > stringParams_
Definition: BeamSpotOnlineObjects.h:159
BeamSpotOnlineObjects::GetLastAnalyzedRun
int GetLastAnalyzedRun() const
Definition: BeamSpotOnlineObjects.h:103
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BeamSpotOnlineObjects::GetRmsErrorPV
float GetRmsErrorPV() const
Definition: BeamSpotOnlineObjects.cc:68
BeamSpotOnlineObjects::GetLumiRange
std::string GetLumiRange() const
Definition: BeamSpotOnlineObjects.cc:80
BeamSpotOnlineObjects::END_TIME
Definition: BeamSpotOnlineObjects.h:43
BeamSpotObjects::GetBeamWidthX
double GetBeamWidthX() const
get average transverse beam width
Definition: BeamSpotObjects.h:75
BeamSpotObjects::GetYError
double GetYError() const
get Y beam position Error
Definition: BeamSpotObjects.h:87
BeamSpotObjects::GetEmittanceY
double GetEmittanceY() const
get emittance
Definition: BeamSpotObjects.h:105
BeamSpotOnlineObjects::ERR_RMS_PV
Definition: BeamSpotOnlineObjects.h:42
BeamSpotObjects::Getdydz
double Getdydz() const
get dydz slope, crossing angle in YZ
Definition: BeamSpotObjects.h:81
BeamSpotOnlineObjects::SetLumiRange
void SetLumiRange(std::string val)
Definition: BeamSpotOnlineObjects.cc:135
T
long double T
Definition: Basic3DVectorLD.h:48
BeamSpotOnlineObjects
Definition: BeamSpotOnlineObjects.h:25
relativeConstraints.value
value
Definition: relativeConstraints.py:53
BeamSpotOnlineObjects::NUM_PVS
Definition: BeamSpotOnlineObjects.h:41
BeamSpotOnlineObjects::LUMI_RANGE
Definition: BeamSpotOnlineObjects.h:43
BeamSpotOnlineObjects::MAX_PVS
Definition: BeamSpotOnlineObjects.h:41
BeamSpotObjects::GetZError
double GetZError() const
get Z beam position Error
Definition: BeamSpotObjects.h:89
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
BeamSpotOnlineObjects::SetRmsPV
void SetRmsPV(float val)
Definition: BeamSpotOnlineObjects.cc:119
BeamSpotOnlineObjects::GetRmsPV
float GetRmsPV() const
Definition: BeamSpotOnlineObjects.cc:66
BeamSpotOnlineObjects::SetMeanPV
void SetMeanPV(float val)
Definition: BeamSpotOnlineObjects.cc:111
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
BeamSpotOnlineObjects::START_TIMESTAMP
Definition: BeamSpotOnlineObjects.h:44
BeamSpotObjects::GetdydzError
double GetdydzError() const
get dydz slope, crossing angle in YZ Error
Definition: BeamSpotObjects.h:99
BeamSpotOnlineObjects.h
BeamSpotOnlineObjects::ERR_MEAN_PV
Definition: BeamSpotOnlineObjects.h:42
BeamSpotObjects::GetBeamWidthXError
double GetBeamWidthXError() const
get average transverse beam width error ASSUME the same for X and Y
Definition: BeamSpotObjects.h:93
BeamSpotOnlineObjectsImpl
Definition: BeamSpotOnlineObjects.cc:5
BeamSpotOnlineObjects::GetLastAnalyzedFill
int GetLastAnalyzedFill() const
Definition: BeamSpotOnlineObjects.h:106
BeamSpotOnlineObjects::SetStartTimeStamp
void SetStartTimeStamp(cond::Time_t val)
Definition: BeamSpotOnlineObjects.cc:143
BeamSpotObjects::GetBeamWidthYError
double GetBeamWidthYError() const
get average transverse beam width error X = Y
Definition: BeamSpotObjects.h:95
BeamSpotObjects::GetX
double GetX() const
get X beam position
Definition: BeamSpotObjects.h:67
BeamSpotOnlineObjects::print
void print(std::stringstream &ss) const
Print BeamSpotOnline parameters.
Definition: BeamSpotOnlineObjects.cc:152
BeamSpotOnlineObjectsImpl::getParams
const T & getParams(const std::vector< T > &params, size_t index)
Definition: BeamSpotOnlineObjects.cc:7
BeamSpotOnlineObjects::GetStartTimeStamp
cond::Time_t GetStartTimeStamp() const
Definition: BeamSpotOnlineObjects.cc:88
BeamSpotOnlineObjects::SetNumPVs
void SetNumPVs(int val)
Definition: BeamSpotOnlineObjects.cc:101
BeamSpotOnlineObjectsImpl::getOneParam
const T & getOneParam(const std::vector< std::vector< T > > &params, size_t index)
Definition: BeamSpotOnlineObjects.cc:21
BeamSpotObjects::GetdxdzError
double GetdxdzError() const
get dxdz slope, crossing angle in XZ Error
Definition: BeamSpotObjects.h:97