CMS 3D CMS Logo

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 
00017 
00018 class BeamSpotObjects {
00019         
00020   public:
00021 
00023         BeamSpotObjects(): sigmaZ_(0), beamwidth_(0), dxdz_(0), dydz_(0) {
00024                 
00025                 std::memset(position_, 0, sizeof position_);
00026                 std::memset(covariance_, 0, sizeof covariance_);
00027         }
00028         
00029         virtual ~BeamSpotObjects(){}
00030 
00032         void SetPosition( double x, double y, double z) { 
00033                 position_[0] = x;
00034                 position_[1] = y;
00035                 position_[2] = z;
00036         };
00038         void SetSigmaZ(double val) { sigmaZ_ = val; }
00040         void Setdxdz(double val) { dxdz_ = val; }
00042         void Setdydz(double val) { dydz_ = val; }
00044         void SetBeamWidth(double val) { beamwidth_ = val; }
00046         void SetCovariance(int i, int j, double val) {
00047                 covariance_[i][j] = val;
00048         }
00049 
00051         double GetX() const { return position_[0]; }
00053         double GetY() const { return position_[1]; }
00055         double GetZ() const { return position_[2]; }
00057         double GetSigmaZ() const { return sigmaZ_; }
00059         double GetBeamWidth() const { return beamwidth_; }
00061         double Getdxdz() const { return dxdz_; }
00063         double Getdydz() const { return dydz_; }
00065         double GetCovariance(int i, int j) const { return covariance_[i][j]; }
00067         double GetXError() const { return sqrt(covariance_[0][0]); }
00069         double GetYError() const { return sqrt(covariance_[1][1]); }
00071         double GetZError() const { return sqrt(covariance_[2][2]); }
00073         double GetSigmaZError() const { return sqrt(covariance_[3][3]); }
00075         double GetBeamWidthError() const { return sqrt(covariance_[6][6]); }
00077         double GetdxdzError() const { return sqrt(covariance_[4][4]); }
00079         double GetdydzError() const { return sqrt(covariance_[5][5]); }
00081         void print(std::stringstream& ss) const;
00082 
00083   private:
00084 
00085         double position_[3];
00086         double sigmaZ_;
00087         double beamwidth_;
00088         double dxdz_;
00089         double dydz_;
00090         double covariance_[7][7];
00091         
00092 };
00093 
00094 std::ostream& operator<< ( std::ostream&, BeamSpotObjects beam );
00095 
00096 #endif

Generated on Tue Jun 9 17:26:17 2009 for CMSSW by  doxygen 1.5.4