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