00001
00002
00003
00004
00005
00006
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
00025 typedef HepGeom::Plane3D<double> HepPlane3D;
00026 #endif
00027 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00028
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
00044 EmcRecEndCapGeo();
00045 ~EmcRecEndCapGeo();
00046
00047
00048 private:
00049
00050 void ParameterInitialize();
00051
00052 void CalculateStandardSector1();
00053
00054 void CalculateStandardSector2();
00055
00056 void FillCCenterVector();
00057
00058 public:
00059
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
00066 void FindInt(const EmcRecGeoPlane& p1,
00067 const EmcRecGeoPlane& p2,
00068 const EmcRecGeoPlane& p3,
00069 HepPoint3D &p);
00070
00071
00072 double flength;
00073 double fzshift;
00074 double fz;
00075 double fr[7];
00076
00077
00078 double fphi5[7];
00079 double fphi3[6];
00080 double fphi1[5];
00081
00082
00083
00084 EmcRecCrystal fRing5[6];
00085
00086 EmcRecCrystal fRing4[6];
00087
00088 EmcRecCrystal fRing3[5];
00089
00090 EmcRecCrystal fRing2[5];
00091
00092 EmcRecCrystal fRing1[4];
00093
00094 EmcRecCrystal fRing0[4];
00095
00096
00097 EmcRecCrystal fRing5p[6];
00098
00099 EmcRecCrystal fRing4p[6];
00100
00101 EmcRecCrystal fRing3p[5];
00102
00103 EmcRecCrystal fRing2p[5];
00104
00105 EmcRecCrystal fRing1p[4];
00106
00107 EmcRecCrystal fRing0p[4];
00108
00110 EmcRecCrystal fCrystal[2][6][6];
00112 vector <HepPoint3D> fCCenter;
00113 vector <HepPoint3D> fCFrontCenter;
00114 };
00115
00116
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
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