00001
00002
00003
00004
00005
00006
00007
00008
00009
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
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
00215
00216
00218 void SetHitStatus(const bool hit) { m_HitStatus = hit; }
00219
00220 private:
00221
00222 int m_Part;
00223 int m_Seg;
00224 int m_Gap;
00225 int m_StripNum;
00226 int m_Orient;
00227 bool m_HitStatus;
00228
00229 float m_XSize;
00230 float m_YSize;
00231 float m_ZSize;
00232 float m_dzHighEdge;
00233
00234 float m_dzFarFrontGas;
00235 float m_dzNearFrontGas;
00236 float m_dzNearBackGas;
00237 float m_dzFarBackGas;
00238
00239 float m_IronThickness;
00240
00241 HepPoint3D m_Center;
00242 HepRotation m_Rotation;
00243 HepRotation m_RotationT;
00244 Hep3Vector m_Translation;
00245
00246 HepPoint3D m_SurfaceInner;
00247 HepPoint3D m_SurfaceOuter;
00248
00249 TGeoPhysicalNode *m_PhyNode;
00250
00251 vector<MucGeoStrip*> m_pMucGeoStrip;
00252 };
00253
00254 ostream& operator << (ostream& s, const MucGeoGap& gap);
00255
00256 #endif
00257