CMS 3D CMS Logo

BeamSpotObjects.h
Go to the documentation of this file.
1 #ifndef BEAMSPOTOBJECTS_H
2 #define BEAMSPOTOBJECTS_H
3 
15 
16 #include <cmath>
17 #include <sstream>
18 #include <cstring>
19 
21 public:
24  beamwidthXError_ = 0;
25  beamwidthYError_ = 0;
26  emittanceX_ = 0;
27  emittanceY_ = 0;
28  betaStar_ = 0;
29  std::memset(position_, 0, sizeof position_);
30  std::memset(covariance_, 0, sizeof covariance_);
31  }
32 
33  virtual ~BeamSpotObjects() {}
34 
36  void SetPosition(double x, double y, double z) {
37  position_[0] = x;
38  position_[1] = y;
39  position_[2] = z;
40  };
42  void SetSigmaZ(double val) { sigmaZ_ = val; }
44  void Setdxdz(double val) { dxdz_ = val; }
46  void Setdydz(double val) { dydz_ = val; }
48  void SetBeamWidthX(double val) { beamwidthX_ = val; }
50  void SetBeamWidthY(double val) { beamwidthY_ = val; }
56  void SetCovariance(int i, int j, double val) { covariance_[i][j] = val; }
58  void SetType(int type) { type_ = type; }
60  void SetEmittanceX(double val) { emittanceX_ = val; }
62  void SetEmittanceY(double val) { emittanceY_ = val; }
64  void SetBetaStar(double val) { betaStar_ = val; }
65 
67  double GetX() const { return position_[0]; }
69  double GetY() const { return position_[1]; }
71  double GetZ() const { return position_[2]; }
73  double GetSigmaZ() const { return sigmaZ_; }
75  double GetBeamWidthX() const { return beamwidthX_; }
77  double GetBeamWidthY() const { return beamwidthY_; }
79  double Getdxdz() const { return dxdz_; }
81  double Getdydz() const { return dydz_; }
83  double GetCovariance(int i, int j) const { return covariance_[i][j]; }
85  double GetXError() const { return sqrt(covariance_[0][0]); }
87  double GetYError() const { return sqrt(covariance_[1][1]); }
89  double GetZError() const { return sqrt(covariance_[2][2]); }
91  double GetSigmaZError() const { return sqrt(covariance_[3][3]); }
93  double GetBeamWidthXError() const { return sqrt(covariance_[6][6]); }
95  double GetBeamWidthYError() const { return sqrt(covariance_[6][6]); }
97  double GetdxdzError() const { return sqrt(covariance_[4][4]); }
99  double GetdydzError() const { return sqrt(covariance_[5][5]); }
101  int GetBeamType() const { return type_; }
103  double GetEmittanceX() const { return emittanceX_; }
105  double GetEmittanceY() const { return emittanceY_; }
107  double GetBetaStar() const { return betaStar_; }
108 
110  void print(std::stringstream& ss) const;
111 
112 protected:
113  double position_[3];
114  double sigmaZ_;
115  double beamwidthX_;
116  double beamwidthY_;
119  double dxdz_;
120  double dydz_;
121  double covariance_[7][7];
122  int type_;
123  double emittanceX_;
124  double emittanceY_;
125  double betaStar_;
126 
128 };
129 
130 std::ostream& operator<<(std::ostream&, BeamSpotObjects beam);
131 
132 #endif
BeamSpotObjects::covariance_
double covariance_[7][7]
Definition: BeamSpotObjects.h:121
BeamSpotObjects::GetBeamWidthY
double GetBeamWidthY() const
get average transverse beam width
Definition: BeamSpotObjects.h:77
BeamSpotObjects::Getdxdz
double Getdxdz() const
get dxdz slope, crossing angle in XZ
Definition: BeamSpotObjects.h:79
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
BeamSpotObjects::dxdz_
double dxdz_
Definition: BeamSpotObjects.h:119
BeamSpotObjects::SetBetaStar
void SetBetaStar(double val)
set beta star
Definition: BeamSpotObjects.h:64
BeamSpotObjects::GetSigmaZError
double GetSigmaZError() const
get sigma Z, RMS bunch length Error
Definition: BeamSpotObjects.h:91
BeamSpotObjects::emittanceY_
double emittanceY_
Definition: BeamSpotObjects.h:124
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
BeamSpotObjects::GetZ
double GetZ() const
get Z beam position
Definition: BeamSpotObjects.h:71
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
BeamSpotObjects::beamwidthXError_
double beamwidthXError_
Definition: BeamSpotObjects.h:117
BeamSpotObjects::beamwidthYError_
double beamwidthYError_
Definition: BeamSpotObjects.h:118
BeamSpotObjects::SetBeamWidthY
void SetBeamWidthY(double val)
set average transverse beam width Y
Definition: BeamSpotObjects.h:50
BeamSpotObjects::type_
int type_
Definition: BeamSpotObjects.h:122
DDAxes::x
BeamSpotObjects::emittanceX_
double emittanceX_
Definition: BeamSpotObjects.h:123
BeamSpotObjects::SetSigmaZ
void SetSigmaZ(double val)
set sigma Z, RMS bunch length
Definition: BeamSpotObjects.h:42
BeamSpotObjects::beamwidthY_
double beamwidthY_
Definition: BeamSpotObjects.h:116
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
BeamSpotObjects::betaStar_
double betaStar_
Definition: BeamSpotObjects.h:125
BeamSpotObjects::~BeamSpotObjects
virtual ~BeamSpotObjects()
Definition: BeamSpotObjects.h:33
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
BeamSpotObjects::GetCovariance
double GetCovariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
Definition: BeamSpotObjects.h:83
EcalCondDBWriter_cfi.beam
beam
Definition: EcalCondDBWriter_cfi.py:45
BeamSpotObjects::SetEmittanceY
void SetEmittanceY(double val)
set emittance
Definition: BeamSpotObjects.h:62
BeamSpotObjects::SetPosition
void SetPosition(double x, double y, double z)
set XYZ position
Definition: BeamSpotObjects.h:36
BeamSpotObjects::position_
double position_[3]
Definition: BeamSpotObjects.h:113
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
BeamSpotObjects::SetType
void SetType(int type)
set beam type
Definition: BeamSpotObjects.h:58
BeamSpotObjects::dydz_
double dydz_
Definition: BeamSpotObjects.h:120
BeamSpotObjects::GetY
double GetY() const
get Y beam position
Definition: BeamSpotObjects.h:69
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
BeamSpotObjects::SetEmittanceX
void SetEmittanceX(double val)
set emittance
Definition: BeamSpotObjects.h:60
BeamSpotObjects::SetCovariance
void SetCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
Definition: BeamSpotObjects.h:56
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
Serializable.h
BeamSpotObjects::sigmaZ_
double sigmaZ_
Definition: BeamSpotObjects.h:114
BeamSpotObjects::beamwidthX_
double beamwidthX_
Definition: BeamSpotObjects.h:115
BeamSpotObjects
Definition: BeamSpotObjects.h:20
BeamSpotObjects::Setdxdz
void Setdxdz(double val)
set dxdz slope, crossing angle
Definition: BeamSpotObjects.h:44
operator<<
std::ostream & operator<<(std::ostream &, BeamSpotObjects beam)
Definition: BeamSpotObjects.cc:23
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
heppy_batch.val
val
Definition: heppy_batch.py:351
BeamSpotObjects::GetEmittanceY
double GetEmittanceY() const
get emittance
Definition: BeamSpotObjects.h:105
BeamSpotObjects::Getdydz
double Getdydz() const
get dydz slope, crossing angle in YZ
Definition: BeamSpotObjects.h:81
BeamSpotObjects::SetBeamWidthX
void SetBeamWidthX(double val)
set average transverse beam width X
Definition: BeamSpotObjects.h:48
BeamSpotObjects::GetZError
double GetZError() const
get Z beam position Error
Definition: BeamSpotObjects.h:89
BeamSpotObjects::print
void print(std::stringstream &ss) const
print beam spot parameters
Definition: BeamSpotObjects.cc:5
BeamSpotObjects::GetdydzError
double GetdydzError() const
get dydz slope, crossing angle in YZ Error
Definition: BeamSpotObjects.h:99
BeamSpotObjects::SetBeamWidthXError
void SetBeamWidthXError(double val)
set beam width X error
Definition: BeamSpotObjects.h:52
BeamSpotObjects::SetBeamWidthYError
void SetBeamWidthYError(double val)
set beam width Y error
Definition: BeamSpotObjects.h:54
BeamSpotObjects::GetBeamWidthXError
double GetBeamWidthXError() const
get average transverse beam width error ASSUME the same for X and Y
Definition: BeamSpotObjects.h:93
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
BeamSpotObjects::BeamSpotObjects
BeamSpotObjects()
default constructor
Definition: BeamSpotObjects.h:23
BeamSpotObjects::GetBeamWidthYError
double GetBeamWidthYError() const
get average transverse beam width error X = Y
Definition: BeamSpotObjects.h:95
BeamSpotObjects::Setdydz
void Setdydz(double val)
set dydz slope, crossing angle in XZ
Definition: BeamSpotObjects.h:46
BeamSpotObjects::GetX
double GetX() const
get X beam position
Definition: BeamSpotObjects.h:67
BeamSpotObjects::GetdxdzError
double GetdxdzError() const
get dxdz slope, crossing angle in XZ Error
Definition: BeamSpotObjects.h:97