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 x() const { return position_[0]; }
69  double y() const { return position_[1]; }
71  double z() const { return position_[2]; }
73  double sigmaZ() const { return sigmaZ_; }
75  double beamWidthX() const { return beamwidthX_; }
77  double beamWidthY() const { return beamwidthY_; }
79  double dxdz() const { return dxdz_; }
81  double dydz() const { return dydz_; }
83  double covariance(int i, int j) const { return covariance_[i][j]; }
85  double xError() const { return sqrt(covariance_[0][0]); }
87  double yError() const { return sqrt(covariance_[1][1]); }
89  double zError() const { return sqrt(covariance_[2][2]); }
91  double sigmaZError() const { return sqrt(covariance_[3][3]); }
93  double beamWidthXError() const { return sqrt(covariance_[6][6]); }
95  double beamWidthYError() const { return sqrt(covariance_[6][6]); }
97  double dxdzError() const { return sqrt(covariance_[4][4]); }
99  double dydzError() const { return sqrt(covariance_[5][5]); }
101  int beamType() const { return type_; }
103  double emittanceX() const { return emittanceX_; }
105  double emittanceY() const { return emittanceY_; }
107  double betaStar() 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
double emittanceX() const
get emittance
void setBeamWidthYError(double val)
set beam width Y error
double dxdzError() const
get dxdz slope, crossing angle in XZ Error
void setCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
double z() const
get Z beam position
double dydz() const
get dydz slope, crossing angle in YZ
void setEmittanceY(double val)
set emittance
double covariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
void setBetaStar(double val)
set beta star
double beamWidthX() const
get average transverse beam width
BeamSpotObjects()
default constructor
int beamType() const
get beam type
void setType(int type)
set beam type
void setEmittanceX(double val)
set emittance
double beamWidthYError() const
get average transverse beam width error X = Y
virtual ~BeamSpotObjects()
T sqrt(T t)
Definition: SSEVec.h:19
void setdydz(double val)
set dydz slope, crossing angle in XZ
double zError() const
get Z beam position Error
double x() const
get X beam position
void setdxdz(double val)
set dxdz slope, crossing angle
double beamWidthY() const
get average transverse beam width
double y() const
get Y beam position
double xError() const
get X beam position Error
void setBeamWidthXError(double val)
set beam width X error
void setSigmaZ(double val)
set sigma Z, RMS bunch length
double sigmaZ() const
get sigma Z, RMS bunch length
#define COND_SERIALIZABLE
Definition: Serializable.h:39
double emittanceY() const
get emittance
void print(std::stringstream &ss) const
print beam spot parameters
double betaStar() const
get beta star
double dydzError() const
get dydz slope, crossing angle in YZ Error
double beamWidthXError() const
get average transverse beam width error ASSUME the same for X and Y
void setPosition(double x, double y, double z)
set XYZ position
std::ostream & operator<<(std::ostream &, BeamSpotObjects beam)
void setBeamWidthX(double val)
set average transverse beam width X
double sigmaZError() const
get sigma Z, RMS bunch length Error
double yError() const
get Y beam position Error
double covariance_[7][7]
double dxdz() const
get dxdz slope, crossing angle in XZ
void setBeamWidthY(double val)
set average transverse beam width Y