CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/CondFormats/BeamSpotObjects/interface/BeamSpotObjects.h

Go to the documentation of this file.
00001 #ifndef BEAMSPOTOBJECTS_H
00002 #define BEAMSPOTOBJECTS_H
00003 
00014 #include <math.h>
00015 #include <sstream>
00016 #include <cstring>
00017 
00018 class BeamSpotObjects {
00019         
00020   public:
00021 
00023         BeamSpotObjects(): sigmaZ_(0), beamwidthX_(0), beamwidthY_(0),
00024                 dxdz_(0), dydz_(0), type_(-1) {
00025 
00026                 beamwidthXError_ = 0;
00027                 beamwidthYError_ = 0;
00028                 emittanceX_ = 0;
00029                 emittanceY_ = 0;
00030                 betaStar_ = 0;
00031                 std::memset(position_, 0, sizeof position_);
00032                 std::memset(covariance_, 0, sizeof covariance_);
00033         }
00034         
00035         virtual ~BeamSpotObjects(){}
00036 
00038         void SetPosition( double x, double y, double z) { 
00039                 position_[0] = x;
00040                 position_[1] = y;
00041                 position_[2] = z;
00042         };
00044         void SetSigmaZ(double val) { sigmaZ_ = val; }
00046         void Setdxdz(double val) { dxdz_ = val; }
00048         void Setdydz(double val) { dydz_ = val; }
00050         void SetBeamWidthX(double val) { beamwidthX_ = val; }
00052         void SetBeamWidthY(double val) { beamwidthY_ = val; }
00054         void SetBeamWidthXError(double val) { beamwidthXError_ = val; }
00056         void SetBeamWidthYError(double val) { beamwidthYError_ = val; }
00058         void SetCovariance(int i, int j, double val) {
00059                 covariance_[i][j] = val;
00060         }
00062         void SetType(int type) { type_ = type; }
00064         void SetEmittanceX(double val) { emittanceX_ = val;}
00066         void SetEmittanceY(double val) { emittanceY_ = val;}
00068         void SetBetaStar(double val) { betaStar_ = val;}
00069         
00071         double GetX() const { return position_[0]; }
00073         double GetY() const { return position_[1]; }
00075         double GetZ() const { return position_[2]; }
00077         double GetSigmaZ() const { return sigmaZ_; }
00079         double GetBeamWidthX() const { return beamwidthX_; }
00081         double GetBeamWidthY() const { return beamwidthY_; }
00083         double Getdxdz() const { return dxdz_; }
00085         double Getdydz() const { return dydz_; }
00087         double GetCovariance(int i, int j) const { return covariance_[i][j]; }
00089         double GetXError() const { return sqrt(covariance_[0][0]); }
00091         double GetYError() const { return sqrt(covariance_[1][1]); }
00093         double GetZError() const { return sqrt(covariance_[2][2]); }
00095         double GetSigmaZError() const { return sqrt(covariance_[3][3]); }
00097         double GetBeamWidthXError() const { return sqrt(covariance_[6][6]); }
00099         double GetBeamWidthYError() const { return sqrt(covariance_[6][6]); }
00101         double GetdxdzError() const { return sqrt(covariance_[4][4]); }
00103         double GetdydzError() const { return sqrt(covariance_[5][5]); }
00105         int GetBeamType() const { return type_; }
00107         double GetEmittanceX() const { return emittanceX_; }
00109         double GetEmittanceY() const { return emittanceY_; }
00111         double GetBetaStar() const { return betaStar_; }
00112         
00114         void print(std::stringstream& ss) const;
00115 
00116   private:
00117 
00118         double position_[3];
00119         double sigmaZ_;
00120         double beamwidthX_;
00121         double beamwidthY_;
00122         double beamwidthXError_;
00123         double beamwidthYError_;
00124         double dxdz_;
00125         double dydz_;
00126         double covariance_[7][7];
00127         int type_;
00128         double emittanceX_;
00129         double emittanceY_;
00130         double betaStar_;
00131         
00132 };
00133 
00134 std::ostream& operator<< ( std::ostream&, BeamSpotObjects beam );
00135 
00136 #endif