/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Muc/MucGeomSvc/MucGeomSvc-00-02-25/MucGeomSvc/MucGeoGap.h

Go to the documentation of this file.
00001 //$id$
00002 //
00003 //$log$
00004 
00005 /*
00006  *    2003/08/30   Zhengyun You     Peking University 
00007  * 
00008  *    2004/09/09   Zhengyun You     Peking University
00009  *                 transplanted to Gaudi framework
00010  */
00011 
00012 #ifndef MUC_GEO_GAP_H
00013 #define MUC_GEO_GAP_H
00014 
00015 #include <iostream>
00016 #include <vector>
00017 #include <CLHEP/Vector/ThreeVector.h>
00018 #include <CLHEP/Geometry/Point3D.h>
00019 #include <CLHEP/Geometry/Plane3D.h>
00020 #include <CLHEP/Vector/Rotation.h>
00021 #include <CLHEP/Matrix/Matrix.h>
00022 #include "TGeoNode.h"
00023 #include "TGeoMatrix.h"
00024 #include "TGeoPhysicalNode.h"
00025 
00026 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00027 typedef HepGeom::Point3D<double> HepPoint3D;
00028 #endif
00029 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00030 typedef HepGeom::Vector3D<double> HepVector3D;
00031 #endif
00032 
00033 using namespace std;
00034 using namespace CLHEP;
00035 
00042 class MucGeoStrip;
00043 
00044 class MucGeoGap
00045 {
00046  public:
00047 
00049   MucGeoGap();
00050 
00052   MucGeoGap(const int part,
00053             const int seg,
00054             const int gap,
00055             const int orient,
00056             const int stripNum,
00057             const float xSize,
00058             const float ySize,
00059             const float zSize,
00060             const float xTarget1Global,
00061             const float yTarget1Global,
00062             const float zTarget1Global,
00063             const float xTarget2Global,
00064             const float yTarget2Global,
00065             const float zTarget2Global,
00066             const float xTarget3Global,
00067             const float yTarget3Global,
00068             const float zTarget3Global,
00069             const float dzHighEdge,
00070             const float dzFarFrontGas,
00071             const float dzNearFrontGas,
00072             const float dzNearBackGas,
00073             const float dzFarBackGas,
00074             const float dxTarget1ToFiducial,
00075             const float dyTarget1ToFiducial,
00076             const float dxFiducialToCenter,
00077             const float dyFiducialToCenter);
00078 
00080   MucGeoGap(const int part,
00081             const int seg,
00082             const int gap,
00083             const int orient,
00084             const int stripNum,
00085             const TGeoPhysicalNode *gapPhyscialNode,
00086             const float ironThickness);
00087  
00089   MucGeoGap& operator=(const MucGeoGap& orig);
00090 
00092   MucGeoGap(const MucGeoGap& orig);
00093 
00095   ~MucGeoGap();
00096 
00098   int Part() const { return m_Part; }
00099 
00101   int Seg() const { return m_Seg; }
00102   
00104   int Gap() const { return m_Gap; }
00105 
00108   int Orient() const { return m_Orient; }
00109 
00111   // MucSoftID GetSoftID() const { return m_GapID; }
00112 
00114   int GetStripNum() const { return m_StripNum; }
00115 
00116   float GetIronThickness() const { return m_IronThickness; }
00117 
00119   bool GetHitStatus() const { return m_HitStatus; }
00120 
00122   float GetdzFarFrontGas()  const { return m_dzFarFrontGas; }  
00123 
00125   float GetdzNearFrontGas() const { return m_dzNearFrontGas; }  
00126 
00128   float GetdzFarBackGas()   const { return m_dzFarBackGas; }  
00129 
00131   float GetdzNearBackGas()  const { return m_dzNearBackGas; }  
00132 
00134   MucGeoStrip *GetStrip(const int strip) const;
00135 
00137   HepPoint3D GetCenter() const { return m_Center; }
00138 
00140   void GetSize(float &xSize, float &ySize, float &zSize) const;
00141  
00143   void GetRotationMatrix(float &thetaX, float &phiX,
00144                          float &thetaY, float &phiY,
00145                          float &thetaZ, float &phiZ) const;
00146   
00149   int GuessStrip(const float x, const float y,const float z) const;
00150   
00152   HepPoint3D ProjectToGap(const HepPoint3D gPoint, 
00153                           const Hep3Vector gVect) const;
00154 
00155   HepPoint3D ProjectToGapWithSigma(const HepPoint3D gPoint,
00156               const Hep3Vector gVect,
00157               const HepPoint3D gPointSigma,
00158               const Hep3Vector gVectSigma,
00159               HepPoint3D &gCross,
00160               HepPoint3D &gCrossSigma) const;
00161 
00163   void ProjectToGapSurface(const HepPoint3D gPoint, 
00164                                  const Hep3Vector gVect,
00165                                  HepPoint3D& cross1,
00166                                  HepPoint3D& cross2) const;
00167   
00168   HepPoint3D ProjectToGapQuadLocal(const int part,
00169                           const int orient,   const float a,
00170                           const float b,  const float c, const int whichhalf,
00171                           HepPoint3D& cross1,
00172                           HepPoint3D& cross2) const;
00173 
00174 
00175 
00177   HepPoint3D ProjectToGap(const HepPoint3D gPoint, 
00178                           const float vy,const float y0, const float a,
00179                           const float b,  const float c, const int whichhalf,
00180                           HepPoint3D& cross1,
00181                           HepPoint3D& cross2) const;
00182 
00184   void ProjectToGapSurface(const HepPoint3D gPoint, 
00185                            const float vy,const float y0, const float a,
00186                            const float b,  const float c, const int whichhalf,
00187                            HepPoint3D& cross1,
00188                            HepPoint3D& cross2) const;
00189   
00190 
00191   HepPoint3D CompareIntersection(const int whichhalf, const HepPoint3D gCross1, const HepPoint3D gCross2,
00192                                  const float a, const float b, const float c )const;
00193 
00194   
00196   Hep3Vector RotateToGlobal(const Hep3Vector pVect) const; 
00197 
00199   Hep3Vector RotateToGap(const Hep3Vector gVect) const;
00200   
00202   HepPoint3D TransformToGlobal(const HepPoint3D pPoint) const; 
00203   
00205   HepPoint3D TransformToGap(const HepPoint3D gPoint) const;
00206   
00208   bool IsInGap(const float x, const float y,const float z) const;
00209 
00211   MucGeoStrip *AddStrip(const int strip);
00212 
00214   //void SetID(const int part, const int seg, const int gap)
00215   //{ m_GapID.SetID(part, seg, gap); }
00216 
00218   void SetHitStatus(const bool hit) { m_HitStatus = hit; }
00219   
00220  private:
00221    
00222   int   m_Part;             // Part No of this gap.
00223   int   m_Seg;              // Segment No of this gap.
00224   int   m_Gap;              // Gap No of this gap.
00225   int   m_StripNum;         // Number of strips in this gap.
00226   int   m_Orient;           // Orientation of this gap.
00227   bool  m_HitStatus;        // Whether this gap is hit.
00228 
00229   float m_XSize;            // X size of this gap.
00230   float m_YSize;            // Y size of this gap.
00231   float m_ZSize;            // Z size of this gap.
00232   float m_dzHighEdge;       // Z distance from higer Z edge to strip center.
00233   
00234   float m_dzFarFrontGas;    // Z distance from low  edge of front gas chamber to strip center. 
00235   float m_dzNearFrontGas;   // Z distance from high edge of front gas chamber to strip center.
00236   float m_dzNearBackGas;    // Z distance from low  edge of back  gas chamber to strip center.
00237   float m_dzFarBackGas;     // Z distance from high edge of back  gas chamber to strip center.
00238 
00239   float m_IronThickness;    // Thickness of iron before this gap 
00240   
00241   HepPoint3D  m_Center;     // Position of gap center in global coordinate.
00242   HepRotation m_Rotation;   // Rotaion matrix from global to gap coordinate.
00243   HepRotation m_RotationT;  // Rotaion matrix from gap to global coordinate.
00244   Hep3Vector  m_Translation;// Transform matrix from global to gap coordinate.
00245 
00246   HepPoint3D  m_SurfaceInner;     // Position of the inner surface center in this gap in global coordinate.
00247   HepPoint3D  m_SurfaceOuter;     // Position of the outer surface center in this gap in global coordinate.
00248 
00249   TGeoPhysicalNode *m_PhyNode;
00250 
00251   vector<MucGeoStrip*> m_pMucGeoStrip; 
00252 };
00253  
00254 ostream& operator << (ostream& s, const MucGeoGap& gap);
00255 
00256 #endif    /* MUC_GEO_GAP_H */
00257 

Generated on Tue Nov 29 23:12:57 2016 for BOSS_7.0.2 by  doxygen 1.4.7