/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Emc/EmcRecGeoSvc/EmcRecGeoSvc-01-01-07/EmcRecGeoSvc/EmcRecEndCapGeo.h

Go to the documentation of this file.
00001 //
00002 //   EmcRecEndCapGeo
00003 //   
00004 //   Dec 18, 2003, Created by Wang.Zhe
00005 //
00006 //   unit: mm, radian
00007 //
00008 #ifndef EMC_REC_ENDCAP_GEO_H
00009 #define EMC_REC_ENDCAP_GEO_H
00010 
00011 #include <vector>
00012 #include <iostream>
00013 
00014 #include "CLHEP/Geometry/Point3D.h"
00015 #include "CLHEP/Geometry/Plane3D.h"
00016 #include "CLHEP/Geometry/Normal3D.h"
00017 #include "CLHEP/Matrix/Matrix.h"
00018 #include "CLHEP/Matrix/Vector.h"
00019 
00020 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00021   typedef HepGeom::Point3D<double> HepPoint3D;
00022 #endif
00023 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00024   //  backwards compatibility will be enabled ONLY in CLHEP 1.9
00025   typedef HepGeom::Plane3D<double> HepPlane3D;
00026 #endif
00027 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00028   //  backwards compatibility will be enabled ONLY in CLHEP 1.9
00029   typedef HepGeom::Normal3D<double> HepNormal3D;
00030 #endif
00031 
00032 #include "Identifier/Identifier.h"
00033 #include "Identifier/EmcID.h"
00034 #include "EmcRecGeoSvc/EmcRecCrystal.h"
00035 
00036 using namespace CLHEP;
00037 
00038 class EmcRecGeoPlane;
00039 
00040 class EmcRecEndCapGeo
00041 {
00042  public:
00043    // Constructors and destructors
00044    EmcRecEndCapGeo();
00045    ~EmcRecEndCapGeo();
00046    
00047    // private method
00048  private:
00049    //====for EndCap EMC
00050    void ParameterInitialize();
00051    //====calculate one standard sector
00052    void CalculateStandardSector1();
00053    //====calculate the other standard sector along with y-z plane
00054    void CalculateStandardSector2();
00055    // Fill crystals' center vector
00056    void FillCCenterVector();
00057    
00058  public:
00059    // Ac_ess by others (refer to Identifier for ID arrangement)
00060    EmcRecCrystal GetCrystal(const Identifier& id) const;
00061    HepPoint3D    GetCCenter(const Identifier& id) const;
00062    HepPoint3D    GetCFrontCenter(const Identifier& id) const;
00063 
00064  private:
00065    // Find intersection for three planes
00066    void FindInt(const EmcRecGeoPlane& p1,
00067                 const EmcRecGeoPlane& p2,
00068                 const EmcRecGeoPlane& p3,
00069                 HepPoint3D &p);
00070    
00071    //general
00072    double flength;
00073    double fzshift;
00074    double fz;
00075    double fr[7];
00076    
00077    // for Ring5
00078    double fphi5[7];
00079    double fphi3[6];
00080    double fphi1[5];
00081    
00082    // for EndCap EMC (standard sector 1) (1/16 of whole ring)
00083    // East, theta 5, phi 0-5. ( total 96 )
00084    EmcRecCrystal fRing5[6];
00085    // East, theta 4, phi 0-5. ( total 96 )
00086    EmcRecCrystal fRing4[6];
00087    // East, theta 3, phi 0-4. ( total 80 )
00088    EmcRecCrystal fRing3[5];
00089    // East, theta 2, phi 0-4. ( total 80 )
00090    EmcRecCrystal fRing2[5];
00091    // East, theta 1, phi 0-3. ( total 64 )
00092    EmcRecCrystal fRing1[4];
00093    // East, theta 0, phi 0-3. ( total 64 )
00094    EmcRecCrystal fRing0[4];
00095    // for EndCap EMC (gap, standard sector 2)
00096    // East, theta 5, phi 24-29
00097    EmcRecCrystal fRing5p[6];
00098    // East, theta 4, phi 24-29
00099    EmcRecCrystal fRing4p[6];
00100    // East, theta 3, phi 20-24
00101    EmcRecCrystal fRing3p[5];
00102    // East, theta 2, phi 20-24
00103    EmcRecCrystal fRing2p[5];
00104    // East, theta 1, phi 16-19
00105    EmcRecCrystal fRing1p[4];
00106    // East, theta 1, phi 16-19
00107    EmcRecCrystal fRing0p[4];
00108 
00110    EmcRecCrystal fCrystal[2][6][6];
00112    vector <HepPoint3D> fCCenter;   
00113    vector <HepPoint3D> fCFrontCenter;
00114 };
00115 
00116 //ad_ three building methods for easy use.
00117 class EmcRecGeoPlane:public HepPlane3D
00118 {
00119  public:
00127    EmcRecGeoPlane(double a=0, double b=0, double c=0, double d=0) {
00128       a_=a; b_=b; c_=c; d_=d; return; }
00129    
00131    EmcRecGeoPlane(const HepPoint3D &n, const HepPoint3D &p) {
00132       a_=n.x(); b_=n.y(); c_=n.z(); d_=-n*p; return; }
00133     
00135    EmcRecGeoPlane(const HepPoint3D &p1, const HepPoint3D &p2, const HepPoint3D &p3)
00136      {
00137         HepNormal3D n = (p2-p1).cross(p3-p1);
00138         a_ = n.x(); b_ = n.y(); c_ = n.z(); d_ = -n*p1;
00139      }
00140 
00142    EmcRecGeoPlane& operator=(const EmcRecGeoPlane &plane) {
00143       if(this!=&plane) {
00144          a_ = plane.a_; b_ = plane.b_; c_ = plane.c_; d_ = plane.d_;
00145       } 
00146       return *this;
00147    }
00148    
00149    //More build functions, easy for use
00150    void Build(double a=0, double b=0, double c=0, double d=0) {
00151         a_=a; b_=b; c_=c; d_=d; return; }
00152    
00153    void Build(const HepPoint3D &n, const HepPoint3D &p) {
00154       a_=n.x(); b_=n.y(); c_=n.z(); d_=-n*p; return; }
00155    
00156    void Build(const HepPoint3D &p1, const HepPoint3D &p2, const HepPoint3D &p3) {
00157       HepNormal3D n = (p2-p1).cross(p3-p1);
00158       a_ = n.x(); b_ = n.y(); c_ = n.z(); d_ = -n*p1;
00159       return; }
00160 };
00161 
00162 #endif /* EMC_REC_ENDCAP_GEO_H */

Generated on Tue Nov 29 22:58:18 2016 for BOSS_7.0.2 by  doxygen 1.4.7