CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
double Getdydz() const
get dydz slope, crossing angle in YZ
double GetY() const
get Y beam position
void SetSigmaZ(double val)
set sigma Z, RMS bunch length
double GetSigmaZ() const
get sigma Z, RMS bunch length
double GetBeamWidthX() const
get average transverse beam width
double GetYError() const
get Y beam position Error
void SetCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
double GetBeamWidthYError() const
get average transverse beam width error X = Y
BeamSpotObjects()
default constructor
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
void Setdydz(double val)
set dydz slope, crossing angle in XZ
double GetBeamWidthY() const
get average transverse beam width
double GetEmittanceX() const
get emittance
int GetBeamType() const
get beam type
virtual ~BeamSpotObjects()
void SetEmittanceX(double val)
set emittance
T sqrt(T t)
Definition: SSEVec.h:19
double GetdydzError() const
get dydz slope, crossing angle in YZ Error
double GetZ() const
get Z beam position
void Setdxdz(double val)
set dxdz slope, crossing angle
double Getdxdz() const
get dxdz slope, crossing angle in XZ
double GetdxdzError() const
get dxdz slope, crossing angle in XZ Error
double GetBeamWidthXError() const
get average transverse beam width error ASSUME the same for X and Y
void SetBeamWidthXError(double val)
set beam width X error
void SetBetaStar(double val)
set beta star
double GetSigmaZError() const
get sigma Z, RMS bunch length Error
void SetType(int type)
set beam type
double GetX() const
get X beam position
double GetXError() const
get X beam position Error
void SetEmittanceY(double val)
set emittance
void SetBeamWidthX(double val)
set average transverse beam width X
double GetBetaStar() const
get beta star
#define COND_SERIALIZABLE
Definition: Serializable.h:39
void SetBeamWidthY(double val)
set average transverse beam width Y
double GetCovariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
void SetBeamWidthYError(double val)
set beam width Y error
void print(std::stringstream &ss) const
print beam spot parameters
double GetEmittanceY() const
get emittance
double covariance_[7][7]
double GetZError() const
get Z beam position Error
void SetPosition(double x, double y, double z)
set XYZ position