00001 #ifndef __SECGEOM_H__
00002 #define __SECGEOM_H__
00003
00004 #ifndef PHMATRIX_H
00005 #include "PHMatrix.h"
00006 #endif
00007 #ifndef __PHVECTOR_H__
00008 #include "PHVector.h"
00009 #endif
00010
00011 #include <iosfwd>
00012
00019 class SecGeom
00020 {
00021
00022 public:
00023
00024 friend std::ostream& operator<<(std::ostream&, const SecGeom&);
00025
00026 SecGeom();
00027 ~SecGeom();
00028 SecGeom(const SecGeom& obj);
00029 SecGeom& operator = (const SecGeom& obj);
00030 void Copy(SecGeom& obj);
00031
00032 int GetTowerPosGlobal(size_t ind, float &x, float &y, float &z) const;
00033
00034 int GetTowerPosLocal(size_t ind, float &x, float &y, float &z) const;
00035
00036 void GlobalToLocal(float xg, float yg, float zg,
00037 float &xl, float &yl, float &zl) const;
00038
00039 const PHMatrix& InvRotationMatrix(void) const
00040 {
00041 return fInvRotationMat;
00042 }
00043 const PHVector& InvTranslationVector(void) const
00044 {
00045 return fInvTranslationVec;
00046 }
00047
00048 void LocalToGlobal(float xl, float yl, float zl,
00049 float &xg, float &yg, float &zg) const;
00050
00051 size_t nx(void) const
00052 {
00053 return fNx;
00054 }
00055 size_t ny(void) const
00056 {
00057 return fNy;
00058 }
00059
00060 void Print(void) const;
00061
00062 const PHMatrix& RotationMatrix(void) const
00063 {
00064 return fRotationMat;
00065 }
00066
00067 void SetNxNy(size_t nx, size_t ny)
00068 {
00069 fNx = nx;
00070 fNy = ny;
00071 }
00072
00073 void SetTowerXYSize(double txsize, double tysize)
00074 {
00075 fTower_xSize = txsize;
00076 fTower_ySize = tysize;
00077 }
00078
00079 void SetDirectTransformation(PHMatrix mat, PHVector vec);
00080
00081 double Tower_xSize(void) const
00082 {
00083 return fTower_xSize;
00084 }
00085 double Tower_ySize(void) const
00086 {
00087 return fTower_ySize;
00088 }
00089
00090 const PHVector& TranslationVector(void) const
00091 {
00092 return fTranslationVec;
00093 }
00094
00095 private:
00096 size_t fNx;
00097 size_t fNy;
00098 double fTower_xSize;
00099 double fTower_ySize;
00100 PHMatrix fRotationMat;
00101 PHVector fTranslationVec;
00102 PHMatrix fInvRotationMat;
00103 PHVector fInvTranslationVec;
00104 static double fgABSURD;
00105 };
00106
00107 #endif