CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BeamSpotObjects.h
Go to the documentation of this file.
1 #ifndef BEAMSPOTOBJECTS_H
2 #define BEAMSPOTOBJECTS_H
3 
14 #include <math.h>
15 #include <sstream>
16 #include <cstring>
17 
19 
20  public:
21 
24  dxdz_(0), dydz_(0), type_(-1) {
25 
26  beamwidthXError_ = 0;
27  beamwidthYError_ = 0;
28  emittanceX_ = 0;
29  emittanceY_ = 0;
30  betaStar_ = 0;
31  std::memset(position_, 0, sizeof position_);
32  std::memset(covariance_, 0, sizeof covariance_);
33  }
34 
35  virtual ~BeamSpotObjects(){}
36 
38  void SetPosition( double x, double y, double z) {
39  position_[0] = x;
40  position_[1] = y;
41  position_[2] = z;
42  };
44  void SetSigmaZ(double val) { sigmaZ_ = val; }
46  void Setdxdz(double val) { dxdz_ = val; }
48  void Setdydz(double val) { dydz_ = val; }
50  void SetBeamWidthX(double val) { beamwidthX_ = val; }
52  void SetBeamWidthY(double val) { beamwidthY_ = val; }
54  void SetBeamWidthXError(double val) { beamwidthXError_ = val; }
56  void SetBeamWidthYError(double val) { beamwidthYError_ = val; }
58  void SetCovariance(int i, int j, double val) {
59  covariance_[i][j] = val;
60  }
62  void SetType(int type) { type_ = type; }
64  void SetEmittanceX(double val) { emittanceX_ = val;}
66  void SetEmittanceY(double val) { emittanceY_ = val;}
68  void SetBetaStar(double val) { betaStar_ = val;}
69 
71  double GetX() const { return position_[0]; }
73  double GetY() const { return position_[1]; }
75  double GetZ() const { return position_[2]; }
77  double GetSigmaZ() const { return sigmaZ_; }
79  double GetBeamWidthX() const { return beamwidthX_; }
81  double GetBeamWidthY() const { return beamwidthY_; }
83  double Getdxdz() const { return dxdz_; }
85  double Getdydz() const { return dydz_; }
87  double GetCovariance(int i, int j) const { return covariance_[i][j]; }
89  double GetXError() const { return sqrt(covariance_[0][0]); }
91  double GetYError() const { return sqrt(covariance_[1][1]); }
93  double GetZError() const { return sqrt(covariance_[2][2]); }
95  double GetSigmaZError() const { return sqrt(covariance_[3][3]); }
97  double GetBeamWidthXError() const { return sqrt(covariance_[6][6]); }
99  double GetBeamWidthYError() const { return sqrt(covariance_[6][6]); }
101  double GetdxdzError() const { return sqrt(covariance_[4][4]); }
103  double GetdydzError() const { return sqrt(covariance_[5][5]); }
105  int GetBeamType() const { return type_; }
107  double GetEmittanceX() const { return emittanceX_; }
109  double GetEmittanceY() const { return emittanceY_; }
111  double GetBetaStar() const { return betaStar_; }
112 
114  void print(std::stringstream& ss) const;
115 
116  private:
117 
118  double position_[3];
119  double sigmaZ_;
120  double beamwidthX_;
121  double beamwidthY_;
124  double dxdz_;
125  double dydz_;
126  double covariance_[7][7];
127  int type_;
128  double emittanceX_;
129  double emittanceY_;
130  double betaStar_;
131 
132 };
133 
134 std::ostream& operator<< ( std::ostream&, BeamSpotObjects beam );
135 
136 #endif
double Getdydz() const
get dydz slope, crossing angle in YZ
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
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:187
void Setdydz(double val)
set dydz slope, crossing angle in XZ
double GetBeamWidthY() const
get average transverse beam width
double double double z
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:46
double GetdydzError() const
get dydz slope, crossing angle in YZ Error
int j
Definition: DBlmapReader.cc:9
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
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
x
Definition: VDTMath.h:216
double covariance_[7][7]
double GetZError() const
get Z beam position Error
void SetPosition(double x, double y, double z)
set XYZ position