BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcRecEndCapGeo.h
Go to the documentation of this file.
1//
2// EmcRecEndCapGeo
3//
4// Dec 18, 2003, Created by Wang.Zhe
5//
6// unit: mm, radian
7//
8#ifndef EMC_REC_ENDCAP_GEO_H
9#define EMC_REC_ENDCAP_GEO_H
10
11#include <vector>
12#include <iostream>
13
14#include "CLHEP/Geometry/Point3D.h"
15#include "CLHEP/Geometry/Plane3D.h"
16#include "CLHEP/Geometry/Normal3D.h"
17#include "CLHEP/Matrix/Matrix.h"
18#include "CLHEP/Matrix/Vector.h"
19
20#ifndef ENABLE_BACKWARDS_COMPATIBILITY
22#endif
23#ifndef ENABLE_BACKWARDS_COMPATIBILITY
24 // backwards compatibility will be enabled ONLY in CLHEP 1.9
25 typedef HepGeom::Plane3D<double> HepPlane3D;
26#endif
27#ifndef ENABLE_BACKWARDS_COMPATIBILITY
28 // backwards compatibility will be enabled ONLY in CLHEP 1.9
29 typedef HepGeom::Normal3D<double> HepNormal3D;
30#endif
31
33#include "Identifier/EmcID.h"
35
36using namespace CLHEP;
37
38class EmcRecGeoPlane;
39
41{
42 public:
43 // Constructors and destructors
46
47 // private method
48 private:
49 //====for EndCap EMC
50 void ParameterInitialize();
51 //====calculate one standard sector
52 void CalculateStandardSector1();
53 //====calculate the other standard sector along with y-z plane
54 void CalculateStandardSector2();
55 // Fill crystals' center vector
56 void FillCCenterVector();
57
58 public:
59 // Ac_ess by others (refer to Identifier for ID arrangement)
60 EmcRecCrystal GetCrystal(const Identifier& id) const;
61 HepPoint3D GetCCenter(const Identifier& id) const;
62 HepPoint3D GetCFrontCenter(const Identifier& id) const;
63
64 private:
65 // Find intersection for three planes
66 void FindInt(const EmcRecGeoPlane& p1,
67 const EmcRecGeoPlane& p2,
68 const EmcRecGeoPlane& p3,
69 HepPoint3D &p);
70
71 //general
72 double flength;
73 double fzshift;
74 double fz;
75 double fr[7];
76
77 // for Ring5
78 double fphi5[7];
79 double fphi3[6];
80 double fphi1[5];
81
82 // for EndCap EMC (standard sector 1) (1/16 of whole ring)
83 // East, theta 5, phi 0-5. ( total 96 )
84 EmcRecCrystal fRing5[6];
85 // East, theta 4, phi 0-5. ( total 96 )
86 EmcRecCrystal fRing4[6];
87 // East, theta 3, phi 0-4. ( total 80 )
88 EmcRecCrystal fRing3[5];
89 // East, theta 2, phi 0-4. ( total 80 )
90 EmcRecCrystal fRing2[5];
91 // East, theta 1, phi 0-3. ( total 64 )
92 EmcRecCrystal fRing1[4];
93 // East, theta 0, phi 0-3. ( total 64 )
94 EmcRecCrystal fRing0[4];
95 // for EndCap EMC (gap, standard sector 2)
96 // East, theta 5, phi 24-29
97 EmcRecCrystal fRing5p[6];
98 // East, theta 4, phi 24-29
99 EmcRecCrystal fRing4p[6];
100 // East, theta 3, phi 20-24
101 EmcRecCrystal fRing3p[5];
102 // East, theta 2, phi 20-24
103 EmcRecCrystal fRing2p[5];
104 // East, theta 1, phi 16-19
105 EmcRecCrystal fRing1p[4];
106 // East, theta 1, phi 16-19
107 EmcRecCrystal fRing0p[4];
108
109 /// put them together for easy reference
110 EmcRecCrystal fCrystal[2][6][6];
111 /// vector of each crystal's center
112 vector <HepPoint3D> fCCenter;
113 vector <HepPoint3D> fCFrontCenter;
114};
115
116//ad_ three building methods for easy use.
118{
119 public:
120 /**
121 * Constructor from four numbers.
122 * The numbers are the coefficients of the equation of the plane:
123 * @code
124 * a*x+b*y+c*z+d=0
125 * @endcode
126 */
127 EmcRecGeoPlane(double a=0, double b=0, double c=0, double d=0) {
128 a_=a; b_=b; c_=c; d_=d; return; }
129
130 /// Constructor from normal and point.
132 a_=n.x(); b_=n.y(); c_=n.z(); d_=-n*p; return; }
133
134 /// Constructor from three points.
136 {
137 HepNormal3D n = (p2-p1).cross(p3-p1);
138 a_ = n.x(); b_ = n.y(); c_ = n.z(); d_ = -n*p1;
139 }
140
141 /// Assignment
143 if(this!=&plane) {
144 a_ = plane.a_; b_ = plane.b_; c_ = plane.c_; d_ = plane.d_;
145 }
146 return *this;
147 }
148
149 //More build functions, easy for use
150 void Build(double a=0, double b=0, double c=0, double d=0) {
151 a_=a; b_=b; c_=c; d_=d; return; }
152
153 void Build(const HepPoint3D &n, const HepPoint3D &p) {
154 a_=n.x(); b_=n.y(); c_=n.z(); d_=-n*p; return; }
155
156 void Build(const HepPoint3D &p1, const HepPoint3D &p2, const HepPoint3D &p3) {
157 HepNormal3D n = (p2-p1).cross(p3-p1);
158 a_ = n.x(); b_ = n.y(); c_ = n.z(); d_ = -n*p1;
159 return; }
160};
161
162#endif /* EMC_REC_ENDCAP_GEO_H */
const Int_t n
HepGeom::Point3D< double > HepPoint3D
HepGeom::Normal3D< double > HepNormal3D
HepGeom::Plane3D< double > HepPlane3D
EvtVector3R cross(const EvtVector3R &p1, const EvtVector3R &p2)
Definition: EvtVector3R.cc:84
EmcRecCrystal GetCrystal(const Identifier &id) const
HepPoint3D GetCCenter(const Identifier &id) const
HepPoint3D GetCFrontCenter(const Identifier &id) const
void Build(double a=0, double b=0, double c=0, double d=0)
EmcRecGeoPlane & operator=(const EmcRecGeoPlane &plane)
Assignment
void Build(const HepPoint3D &p1, const HepPoint3D &p2, const HepPoint3D &p3)
EmcRecGeoPlane(double a=0, double b=0, double c=0, double d=0)
EmcRecGeoPlane(const HepPoint3D &p1, const HepPoint3D &p2, const HepPoint3D &p3)
Constructor from three points.
void Build(const HepPoint3D &n, const HepPoint3D &p)
EmcRecGeoPlane(const HepPoint3D &n, const HepPoint3D &p)
Constructor from normal and point.
double * p2
Definition: qcdloop1.h:76
double double * p3
Definition: qcdloop1.h:76
const double b
Definition: slope.cxx:9