CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
MucGeoGap.h
Go to the documentation of this file.
1//$id$
2//
3//$log$
4
5/*
6 * 2003/08/30 Zhengyun You Peking University
7 *
8 * 2004/09/09 Zhengyun You Peking University
9 * transplanted to Gaudi framework
10 */
11
12#ifndef MUC_GEO_GAP_H
13#define MUC_GEO_GAP_H
14
15#include <iostream>
16#include <vector>
17#include <CLHEP/Vector/ThreeVector.h>
18#include <CLHEP/Geometry/Point3D.h>
19#include <CLHEP/Geometry/Plane3D.h>
20#include <CLHEP/Vector/Rotation.h>
21#include <CLHEP/Matrix/Matrix.h>
22#include "TGeoNode.h"
23#include "TGeoMatrix.h"
24#include "TGeoPhysicalNode.h"
25
26#ifndef ENABLE_BACKWARDS_COMPATIBILITY
28#endif
29#ifndef ENABLE_BACKWARDS_COMPATIBILITY
31#endif
32
33using namespace std;
34using namespace CLHEP;
35
36/**
37 * Class MucGeoGap describes a single gap in the muon chamber
38 *
39 * @author Zhengyun You \URL{mailto:[email protected]}
40 */
41
42class MucGeoStrip;
43
45{
46 public:
47
48 /// Default constructor.
49 MucGeoGap();
50
51 /// Real constructor (construct strips externally).
52 MucGeoGap(const int part,
53 const int seg,
54 const int gap,
55 const int orient,
56 const int stripNum,
57 const float xSize,
58 const float ySize,
59 const float zSize,
60 const float xTarget1Global,
61 const float yTarget1Global,
62 const float zTarget1Global,
63 const float xTarget2Global,
64 const float yTarget2Global,
65 const float zTarget2Global,
66 const float xTarget3Global,
67 const float yTarget3Global,
68 const float zTarget3Global,
69 const float dzHighEdge,
70 const float dzFarFrontGas,
71 const float dzNearFrontGas,
72 const float dzNearBackGas,
73 const float dzFarBackGas,
74 const float dxTarget1ToFiducial,
75 const float dyTarget1ToFiducial,
76 const float dxFiducialToCenter,
77 const float dyFiducialToCenter);
78
79 /// ROOT constructor.
80 MucGeoGap(const int part,
81 const int seg,
82 const int gap,
83 const int orient,
84 const int stripNum,
85 const TGeoPhysicalNode *gapPhyscialNode,
86 const float ironThickness);
87
88 /// Assignment constructor.
89 MucGeoGap& operator=(const MucGeoGap& orig);
90
91 /// Copy constructor.
92 MucGeoGap(const MucGeoGap& orig);
93
94 /// Desctructor.
95 ~MucGeoGap();
96
97 /// Get part identifier (0,2 for cap, 1 for barrel).
98 int Part() const { return m_Part; }
99
100 /// Get seg identifier (0-7).
101 int Seg() const { return m_Seg; }
102
103 /// Get gap identifier (0-8).
104 int Gap() const { return m_Gap; }
105
106 /// Get orientation of strips in this gap
107 /// ( 0 for strips parrel to x axis, 1 for strips parrel to y axis. in gap coordinate).
108 int Orient() const { return m_Orient; }
109
110 /// Get SoftID.
111 // MucSoftID GetSoftID() const { return m_GapID; }
112
113 /// Get number of strips in this gap.
114 int GetStripNum() const { return m_StripNum; }
115
116 float GetIronThickness() const { return m_IronThickness; }
117
118 /// Get whether this gap is hit.
119 bool GetHitStatus() const { return m_HitStatus; }
120
121 /// Get m_dzFarFrontGas;
122 float GetdzFarFrontGas() const { return m_dzFarFrontGas; }
123
124 /// Get m_dzNearFrontGas;
125 float GetdzNearFrontGas() const { return m_dzNearFrontGas; }
126
127 /// Get m_dzFarFrontGas;
128 float GetdzFarBackGas() const { return m_dzFarBackGas; }
129
130 /// Get m_dzNearBackGas;
131 float GetdzNearBackGas() const { return m_dzNearBackGas; }
132
133 /// Point to a strip within this gap.
134 MucGeoStrip *GetStrip(const int strip) const;
135
136 /// Get gap center position in global coordinate.
137 HepPoint3D GetCenter() const { return m_Center; }
138
139 /// Get size of this gap.
140 void GetSize(float &xSize, float &ySize, float &zSize) const;
141
142 /// Get the rotation angles (in degrees) of the gap in global coordinate.
143 void GetRotationMatrix(float &thetaX, float &phiX,
144 float &thetaY, float &phiY,
145 float &thetaZ, float &phiZ) const;
146
147 /// Given a position (gap coordinate), guess the approximate strip containing the position,
148 /// as there are intervals between the strips.
149 int GuessStrip(const float x, const float y,const float z) const;
150
151 /// Given a line, find the intersection with the gap in the global.
152 HepPoint3D ProjectToGap(const HepPoint3D gPoint,
153 const Hep3Vector gVect) const;
154
156 const Hep3Vector gVect,
157 const HepPoint3D gPointSigma,
158 const Hep3Vector gVectSigma,
159 HepPoint3D &gCross,
160 HepPoint3D &gCrossSigma) const;
161
162 /// Given a line, find the intersection with two surface of the gap in the global.
163 void ProjectToGapSurface(const HepPoint3D gPoint,
164 const Hep3Vector gVect,
165 HepPoint3D& cross1,
166 HepPoint3D& cross2) const;
167
168 HepPoint3D ProjectToGapQuadLocal(const int part,
169 const int orient, const float a,
170 const float b, const float c, const int whichhalf,
171 HepPoint3D& cross1,
172 HepPoint3D& cross2) const;
173
174
175
176 /// Given parabola, and a line, find the intersection with the gap in the global.
177 HepPoint3D ProjectToGap(const HepPoint3D gPoint,
178 const float vy,const float y0, const float a,
179 const float b, const float c, const int whichhalf,
180 HepPoint3D& cross1,
181 HepPoint3D& cross2) const;
182
183 /// Given parabola, and a line, find the intersection with two surface of the gap in the global.
184 void ProjectToGapSurface(const HepPoint3D gPoint,
185 const float vy,const float y0, const float a,
186 const float b, const float c, const int whichhalf,
187 HepPoint3D& cross1,
188 HepPoint3D& cross2) const;
189
190
191 HepPoint3D CompareIntersection(const int whichhalf, const HepPoint3D gCross1, const HepPoint3D gCross2,
192 const float a, const float b, const float c )const;
193
194
195 /// Rotate a vector from gap coordinate to global coordinate.
196 Hep3Vector RotateToGlobal(const Hep3Vector pVect) const;
197
198 /// Rotate a vector from global coordinate to gap coordinate.
199 Hep3Vector RotateToGap(const Hep3Vector gVect) const;
200
201 /// Transform a point from gap coordinate to global coordinate.
202 HepPoint3D TransformToGlobal(const HepPoint3D pPoint) const;
203
204 /// Transform a point from global coordinate to gap coordinate.
205 HepPoint3D TransformToGap(const HepPoint3D gPoint) const;
206
207 /// Check if the point (given in gap coordinate) is within the gap boundary.
208 bool IsInGap(const float x, const float y,const float z) const;
209
210 /// Add a strip to the gap.
211 MucGeoStrip *AddStrip(const int strip);
212
213 /// Set SoftID of the gap.
214 //void SetID(const int part, const int seg, const int gap)
215 //{ m_GapID.SetID(part, seg, gap); }
216
217 /// Tell whether or not this gap registered a signal in this event.
218 void SetHitStatus(const bool hit) { m_HitStatus = hit; }
219
220 private:
221
222 int m_Part; // Part No of this gap.
223 int m_Seg; // Segment No of this gap.
224 int m_Gap; // Gap No of this gap.
225 int m_StripNum; // Number of strips in this gap.
226 int m_Orient; // Orientation of this gap.
227 bool m_HitStatus; // Whether this gap is hit.
228
229 float m_XSize; // X size of this gap.
230 float m_YSize; // Y size of this gap.
231 float m_ZSize; // Z size of this gap.
232 float m_dzHighEdge; // Z distance from higer Z edge to strip center.
233
234 float m_dzFarFrontGas; // Z distance from low edge of front gas chamber to strip center.
235 float m_dzNearFrontGas; // Z distance from high edge of front gas chamber to strip center.
236 float m_dzNearBackGas; // Z distance from low edge of back gas chamber to strip center.
237 float m_dzFarBackGas; // Z distance from high edge of back gas chamber to strip center.
238
239 float m_IronThickness; // Thickness of iron before this gap
240
241 HepPoint3D m_Center; // Position of gap center in global coordinate.
242 HepRotation m_Rotation; // Rotaion matrix from global to gap coordinate.
243 HepRotation m_RotationT; // Rotaion matrix from gap to global coordinate.
244 Hep3Vector m_Translation;// Transform matrix from global to gap coordinate.
245
246 HepPoint3D m_SurfaceInner; // Position of the inner surface center in this gap in global coordinate.
247 HepPoint3D m_SurfaceOuter; // Position of the outer surface center in this gap in global coordinate.
248
249 TGeoPhysicalNode *m_PhyNode;
250
251 vector<MucGeoStrip*> m_pMucGeoStrip;
252};
253
254ostream& operator << (ostream& s, const MucGeoGap& gap);
255
256#endif /* MUC_GEO_GAP_H */
257
XmlRpcServer s
HepGeom::Point3D< double > HepPoint3D
Definition MucGeoGap.h:27
ostream & operator<<(ostream &s, const MucGeoGap &gap)
HepGeom::Vector3D< double > HepVector3D
Definition MucGeoGap.h:30
void GetSize(float &xSize, float &ySize, float &zSize) const
Get size of this gap.
HepPoint3D CompareIntersection(const int whichhalf, const HepPoint3D gCross1, const HepPoint3D gCross2, const float a, const float b, const float c) const
Hep3Vector RotateToGlobal(const Hep3Vector pVect) const
Rotate a vector from gap coordinate to global coordinate.
Hep3Vector RotateToGap(const Hep3Vector gVect) const
Rotate a vector from global coordinate to gap coordinate.
HepPoint3D TransformToGlobal(const HepPoint3D pPoint) const
Transform a point from gap coordinate to global coordinate.
int GetStripNum() const
Get SoftID.
Definition MucGeoGap.h:114
MucGeoGap()
Default constructor.
Definition MucGeoGap.cxx:24
int GuessStrip(const float x, const float y, const float z) const
bool GetHitStatus() const
Get whether this gap is hit.
Definition MucGeoGap.h:119
void ProjectToGapSurface(const HepPoint3D gPoint, const Hep3Vector gVect, HepPoint3D &cross1, HepPoint3D &cross2) const
Given a line, find the intersection with two surface of the gap in the global.
HepPoint3D GetCenter() const
Get gap center position in global coordinate.
Definition MucGeoGap.h:137
float GetdzNearFrontGas() const
Get m_dzNearFrontGas;.
Definition MucGeoGap.h:125
float GetdzFarFrontGas() const
Get m_dzFarFrontGas;.
Definition MucGeoGap.h:122
int Seg() const
Get seg identifier (0-7).
Definition MucGeoGap.h:101
float GetdzNearBackGas() const
Get m_dzNearBackGas;.
Definition MucGeoGap.h:131
HepPoint3D ProjectToGap(const HepPoint3D gPoint, const Hep3Vector gVect) const
Given a line, find the intersection with the gap in the global.
~MucGeoGap()
Desctructor.
MucGeoStrip * AddStrip(const int strip)
Add a strip to the gap.
int Gap() const
Get gap identifier (0-8).
Definition MucGeoGap.h:104
int Part() const
Get part identifier (0,2 for cap, 1 for barrel).
Definition MucGeoGap.h:98
void SetHitStatus(const bool hit)
Set SoftID of the gap.
Definition MucGeoGap.h:218
void GetRotationMatrix(float &thetaX, float &phiX, float &thetaY, float &phiY, float &thetaZ, float &phiZ) const
Get the rotation angles (in degrees) of the gap in global coordinate.
HepPoint3D ProjectToGapWithSigma(const HepPoint3D gPoint, const Hep3Vector gVect, const HepPoint3D gPointSigma, const Hep3Vector gVectSigma, HepPoint3D &gCross, HepPoint3D &gCrossSigma) const
MucGeoGap & operator=(const MucGeoGap &orig)
Assignment constructor.
float GetIronThickness() const
Definition MucGeoGap.h:116
bool IsInGap(const float x, const float y, const float z) const
Check if the point (given in gap coordinate) is within the gap boundary.
HepPoint3D ProjectToGapQuadLocal(const int part, const int orient, const float a, const float b, const float c, const int whichhalf, HepPoint3D &cross1, HepPoint3D &cross2) const
HepPoint3D TransformToGap(const HepPoint3D gPoint) const
Transform a point from global coordinate to gap coordinate.
int Orient() const
Definition MucGeoGap.h:108
MucGeoStrip * GetStrip(const int strip) const
Point to a strip within this gap.
float GetdzFarBackGas() const
Get m_dzFarFrontGas;.
Definition MucGeoGap.h:128