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 
15 
16 #include <math.h>
17 #include <sstream>
18 #include <cstring>
19 
21 
22  public:
23 
26  dxdz_(0), dydz_(0), type_(-1) {
27 
28  beamwidthXError_ = 0;
29  beamwidthYError_ = 0;
30  emittanceX_ = 0;
31  emittanceY_ = 0;
32  betaStar_ = 0;
33  std::memset(position_, 0, sizeof position_);
34  std::memset(covariance_, 0, sizeof covariance_);
35  }
36 
37  virtual ~BeamSpotObjects(){}
38 
40  void SetPosition( double x, double y, double z) {
41  position_[0] = x;
42  position_[1] = y;
43  position_[2] = z;
44  };
46  void SetSigmaZ(double val) { sigmaZ_ = val; }
48  void Setdxdz(double val) { dxdz_ = val; }
50  void Setdydz(double val) { dydz_ = val; }
52  void SetBeamWidthX(double val) { beamwidthX_ = val; }
54  void SetBeamWidthY(double val) { beamwidthY_ = val; }
56  void SetBeamWidthXError(double val) { beamwidthXError_ = val; }
58  void SetBeamWidthYError(double val) { beamwidthYError_ = val; }
60  void SetCovariance(int i, int j, double val) {
61  covariance_[i][j] = val;
62  }
64  void SetType(int type) { type_ = type; }
66  void SetEmittanceX(double val) { emittanceX_ = val;}
68  void SetEmittanceY(double val) { emittanceY_ = val;}
70  void SetBetaStar(double val) { betaStar_ = val;}
71 
73  double GetX() const { return position_[0]; }
75  double GetY() const { return position_[1]; }
77  double GetZ() const { return position_[2]; }
79  double GetSigmaZ() const { return sigmaZ_; }
81  double GetBeamWidthX() const { return beamwidthX_; }
83  double GetBeamWidthY() const { return beamwidthY_; }
85  double Getdxdz() const { return dxdz_; }
87  double Getdydz() const { return dydz_; }
89  double GetCovariance(int i, int j) const { return covariance_[i][j]; }
91  double GetXError() const { return sqrt(covariance_[0][0]); }
93  double GetYError() const { return sqrt(covariance_[1][1]); }
95  double GetZError() const { return sqrt(covariance_[2][2]); }
97  double GetSigmaZError() const { return sqrt(covariance_[3][3]); }
99  double GetBeamWidthXError() const { return sqrt(covariance_[6][6]); }
101  double GetBeamWidthYError() const { return sqrt(covariance_[6][6]); }
103  double GetdxdzError() const { return sqrt(covariance_[4][4]); }
105  double GetdydzError() const { return sqrt(covariance_[5][5]); }
107  int GetBeamType() const { return type_; }
109  double GetEmittanceX() const { return emittanceX_; }
111  double GetEmittanceY() const { return emittanceY_; }
113  double GetBetaStar() const { return betaStar_; }
114 
116  void print(std::stringstream& ss) const;
117 
118  private:
119 
120  double position_[3];
121  double sigmaZ_;
122  double beamwidthX_;
123  double beamwidthY_;
126  double dxdz_;
127  double dydz_;
128  double covariance_[7][7];
129  int type_;
130  double emittanceX_;
131  double emittanceY_;
132  double betaStar_;
133 
134 
136 };
137 
138 std::ostream& operator<< ( std::ostream&, BeamSpotObjects beam );
139 
140 #endif
double Getdydz() const
get dydz slope, crossing angle in YZ
type
Definition: HCALResponse.h:21
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
float float float 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:48
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
#define COND_SERIALIZABLE
Definition: Serializable.h:30
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
Definition: DDAxes.h:10
double covariance_[7][7]
double GetZError() const
get Z beam position Error
void SetPosition(double x, double y, double z)
set XYZ position