BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
MucGeoStrip Class Reference

#include <MucGeoStrip.h>

Public Member Functions

 MucGeoStrip (const int strip, MucGeoGap *const pGap)
 Default constructor.
 
 ~MucGeoStrip ()
 Desctructor.
 
int Part ()
 Get the softID.
 
int Seg ()
 Get Seg No.
 
int Gap ()
 Get Gap No.
 
int Strip ()
 Get Strip No.
 
MucGeoGapGetGap () const
 Get the pointer to the gap that contains the strip.
 
MucGeoStripGetLeftNeighbor () const
 Get the pointer to the adjacent strip on the -X or -Y side of this one.
 
MucGeoStripGetRightNeighbor () const
 Get the pointer to the adjacent strip on the +X or +Y side of this one.
 
float GetXmin () const
 Get position of low-X edge in the gap coordinate system.
 
float GetXmax () const
 Get position of high-X edge in the gap coordinate system.
 
float GetYmin () const
 Get position of low-Y edge in the gap coordinate system.
 
float GetYmax () const
 Get position of high-Y edge in the gap coordinate system.
 
float GetZmin () const
 Get position of low-Z edge in the gap coordinate system.
 
float GetZmax () const
 Get position of high-Z edge in the gap coordinate system.
 
void GetCenterPos (float &x, float &y, float &z) const
 Get center position of this strip (in the gap coordinate system).
 
void GetCenterSigma (float &sx, float &sy, float &sz)
 Get uncertainty in the position of this strip (in the gap coordinate system).
 
bool GetHitStatus () const
 Get the strip hit status.
 
void SetStrip (const float x1, const float x2, const float y1, const float y2, const float xSize, const float ySize, const float zSize)
 Set the edge, center and sigma of the strip (in the gap coordinate system).
 
void SetStrip (TGeoPhysicalNode *stripPhysicalNode)
 Set strip from ROOT.
 
void SetLeftNeighbor (MucGeoStrip *p)
 Set pointer to the adjacent strip on the -X or -Y side of this one.
 
void SetRightNeighbor (MucGeoStrip *p)
 Set pointer to the adjacent strip on the +X or +Y side of this one.
 
void SetHitStatus (const bool hit)
 Set the strip hit status.
 
bool IsInStrip (const float x, const float y, const float z) const
 Is the point within the boundaries of this strip?
 
bool CrossGasChamber (const HepPoint3D linePoint, const Hep3Vector lineDir) const
 Does the line cross this strip?
 

Detailed Description

Class MucGeoStrip describes a single strip in a gap of the muon chamber

Author
Zhengyun You \URL{youzy.nosp@m.@pku.nosp@m..edu..nosp@m.cn}

Definition at line 40 of file MucGeoStrip.h.

Constructor & Destructor Documentation

◆ MucGeoStrip()

MucGeoStrip::MucGeoStrip ( const int strip,
MucGeoGap *const pGap )

Default constructor.

Definition at line 21 of file MucGeoStrip.cxx.

22 : m_Strip(strip),
23 m_pGap(pGap),
24 m_pLeftNeighbor(0L),
25 m_pRightNeighbor(0L),
26 m_CenterPos(0.0,0.0,0.0),
27 m_CenterSigma(0.0,0.0,0.0)
28{
29 // Constructor (dummy strip position and sizes).
30}

◆ ~MucGeoStrip()

MucGeoStrip::~MucGeoStrip ( )

Desctructor.

Definition at line 32 of file MucGeoStrip.cxx.

33{
34 // Destructor.
35 m_pLeftNeighbor = 0L;
36 m_pRightNeighbor = 0L;
37 m_pGap = 0L;
38}

Member Function Documentation

◆ CrossGasChamber()

bool MucGeoStrip::CrossGasChamber ( const HepPoint3D linePoint,
const Hep3Vector lineDir ) const

Does the line cross this strip?

Definition at line 167 of file MucGeoStrip.cxx.

169{
170 // Does the line cross this strip?
171
172 // We need to define the 6 planes then loop over to check for intersection.
173 // All are defined in the gap coordinate.
174 HepPlane3D stripSide[6];
175
176 // Xmin.
177 HepPoint3D p0Xmin(m_Xmin, m_Ymin, m_dzFarFrontGas);
178 HepPoint3D p1Xmin(m_Xmin, m_Ymax, m_dzFarFrontGas);
179 HepPoint3D p2Xmin(m_Xmin, m_Ymin, m_dzFarBackGas);
180 HepPlane3D plane0(p0Xmin, p1Xmin, p2Xmin);
181 stripSide[0] = plane0;
182
183 // Xmax.
184 HepPoint3D p0Xmax(m_Xmax, m_Ymin, m_dzFarFrontGas);
185 HepPoint3D p1Xmax(m_Xmax, m_Ymax, m_dzFarFrontGas);
186 HepPoint3D p2Xmax(m_Xmax, m_Ymin, m_dzFarBackGas);
187 HepPlane3D plane1(p0Xmax, p1Xmax, p2Xmax);
188 stripSide[1] = plane1;
189
190 // Ymin.
191 HepPoint3D p0Ymin(m_Xmin, m_Ymin, m_dzFarFrontGas);
192 HepPoint3D p1Ymin(m_Xmax, m_Ymin, m_dzFarFrontGas);
193 HepPoint3D p2Ymin(m_Xmin, m_Ymin, m_dzFarBackGas);
194 HepPlane3D plane2(p0Ymin, p1Ymin, p2Ymin);
195 stripSide[2] = plane2;
196
197 // Ymax.
198 HepPoint3D p0Ymax(m_Xmin, m_Ymax, m_dzFarFrontGas);
199 HepPoint3D p1Ymax(m_Xmax, m_Ymax, m_dzFarFrontGas);
200 HepPoint3D p2Ymax(m_Xmin, m_Ymax, m_dzFarBackGas);
201 HepPlane3D plane3(p0Ymax, p1Ymax, p2Ymax);
202 stripSide[3] = plane3;
203
204 // Zmin.
205 HepPoint3D p0Zmin(m_Xmin, m_Ymin, m_dzFarFrontGas);
206 HepPoint3D p1Zmin(m_Xmax, m_Ymin, m_dzFarFrontGas);
207 HepPoint3D p2Zmin(m_Xmin, m_Ymax, m_dzFarFrontGas);
208 HepPlane3D plane4(p0Zmin, p1Zmin, p2Zmin);
209 stripSide[4] = plane4;
210
211 // Zmax.
212 HepPoint3D p0Zmax(m_Xmin, m_Ymin, m_dzFarBackGas);
213 HepPoint3D p1Zmax(m_Xmax, m_Ymin, m_dzFarBackGas);
214 HepPoint3D p2Zmax(m_Xmin, m_Ymax, m_dzFarBackGas);
215 HepPlane3D plane5(p0Zmax, p1Zmax, p2Zmax);
216 stripSide[5] = plane5;
217
218 //cout << m_Xmin << " " << m_Xmax << endl
219 // << m_Ymin << " " << m_Ymax << endl
220 // << m_dzFarFrontGas << " " << m_dzFarBackGas << endl;
221
222 //If particle intersects this strip there should only be two crossings.
223 int numIntersections = 0;
224 MucGeometron geometron;
225 bool intersectFlag = 0;
226 HepPoint3D gCross(0,0,0);
227
228 for (int sideID = 0; sideID<6; sideID++)
229 {
230 intersectFlag = geometron.GetIntersectionLinePlane(linePoint,
231 lineDir,
232 stripSide[sideID],
233 gCross);
234 if( intersectFlag &&
235 ( gCross.x() >= m_Xmin - 1) && // expend strip size, to avoid gap between two strip
236 ( gCross.x() <= m_Xmax + 1) &&
237 ( gCross.y() >= m_Ymin - 1) &&
238 ( gCross.y() <= m_Ymax + 1) &&
239 ( ( gCross.z() >= m_dzFarFrontGas && gCross.z() <= m_dzNearFrontGas ) ||
240 ( gCross.z() >= m_dzNearBackGas && gCross.z() <= m_dzFarBackGas) ) ) {
241 numIntersections++;
242 //cout << m_StripID.GetStrip() << gCross << endl;
243 }
244 }
245
246 //if( numIntersections == 1 ) {
247 // cout<<"MucGeoStrip::IntersectStrip(): Warning only one intersection. Should be two!" << endl;
248 //}
249
250 if( numIntersections > 2 ) {
251// cout<<"MucGeoStrip::CrossGasChamber(): Warning too many intersections "
252// << numIntersections
253// << endl;
254 }
255
256 if( numIntersections > 0 ) return true;
257
258 return false;
259}
HepGeom::Plane3D< double > HepPlane3D
bool GetIntersectionLinePlane(const HepPoint3D pLine, const Hep3Vector vectLine, const HepPlane3D plane, HepPoint3D &cross)
Get intersection of a line and a plane.

Referenced by MucGeoGeneral::FindIntersectStrips(), and MucGeoGeneral::FindIntersectStrips().

◆ Gap()

int MucGeoStrip::Gap ( )
inline

Get Gap No.

Definition at line 59 of file MucGeoStrip.h.

59{ return m_pGap->Gap(); }
int Gap() const
Get gap identifier (0-8).
Definition MucGeoGap.h:104

◆ GetCenterPos()

void MucGeoStrip::GetCenterPos ( float & x,
float & y,
float & z ) const

Get center position of this strip (in the gap coordinate system).

Definition at line 41 of file MucGeoStrip.cxx.

42{
43 // Get center position of this strip (in the gap coordinate system).
44 x = m_CenterPos.x();
45 y = m_CenterPos.y();
46 z = m_CenterPos.z();
47
48 return;
49}
Double_t x[10]
double y[1000]

Referenced by MucGeoGeneral::FindIntersectStrips(), MucGeoGap::GuessStrip(), main(), MucRecHit::MucRecHit(), and MucRecHit::MucRecHit().

◆ GetCenterSigma()

void MucGeoStrip::GetCenterSigma ( float & sx,
float & sy,
float & sz )

Get uncertainty in the position of this strip (in the gap coordinate system).

Definition at line 52 of file MucGeoStrip.cxx.

53{
54 // Get uncertainty in the position of this strip (in the gap coordinate system).
55 sx = m_CenterSigma.x();
56 sy = m_CenterSigma.y();
57 sz = m_CenterSigma.z();
58
59 return;
60}

Referenced by ExtMucKal::ExtMucFilter(), MucRecHit::MucRecHit(), MucRecHit::MucRecHit(), and ExtMucKal::TrackHit().

◆ GetGap()

MucGeoGap * MucGeoStrip::GetGap ( ) const
inline

Get the pointer to the gap that contains the strip.

Definition at line 65 of file MucGeoStrip.h.

65{ return m_pGap; }

Referenced by main(), SetStrip(), and SetStrip().

◆ GetHitStatus()

bool MucGeoStrip::GetHitStatus ( ) const
inline

Get the strip hit status.

Definition at line 98 of file MucGeoStrip.h.

98{ return m_HitStatus; }

◆ GetLeftNeighbor()

MucGeoStrip * MucGeoStrip::GetLeftNeighbor ( ) const
inline

Get the pointer to the adjacent strip on the -X or -Y side of this one.

Definition at line 68 of file MucGeoStrip.h.

68{ return m_pLeftNeighbor; }

◆ GetRightNeighbor()

MucGeoStrip * MucGeoStrip::GetRightNeighbor ( ) const
inline

Get the pointer to the adjacent strip on the +X or +Y side of this one.

Definition at line 71 of file MucGeoStrip.h.

71{ return m_pRightNeighbor; }

◆ GetXmax()

float MucGeoStrip::GetXmax ( ) const
inline

Get position of high-X edge in the gap coordinate system.

Definition at line 77 of file MucGeoStrip.h.

77{ return m_Xmax; }

Referenced by MucGeoGeneral::FindIntersectStrips().

◆ GetXmin()

float MucGeoStrip::GetXmin ( ) const
inline

Get position of low-X edge in the gap coordinate system.

Definition at line 74 of file MucGeoStrip.h.

74{ return m_Xmin; }

Referenced by MucGeoGeneral::FindIntersectStrips().

◆ GetYmax()

float MucGeoStrip::GetYmax ( ) const
inline

Get position of high-Y edge in the gap coordinate system.

Definition at line 83 of file MucGeoStrip.h.

83{ return m_Ymax; }

Referenced by MucGeoGeneral::FindIntersectStrips().

◆ GetYmin()

float MucGeoStrip::GetYmin ( ) const
inline

Get position of low-Y edge in the gap coordinate system.

Definition at line 80 of file MucGeoStrip.h.

80{ return m_Ymin; }

Referenced by MucGeoGeneral::FindIntersectStrips().

◆ GetZmax()

float MucGeoStrip::GetZmax ( ) const
inline

Get position of high-Z edge in the gap coordinate system.

Definition at line 89 of file MucGeoStrip.h.

89{ return m_Zmax; }

◆ GetZmin()

float MucGeoStrip::GetZmin ( ) const
inline

Get position of low-Z edge in the gap coordinate system.

Definition at line 86 of file MucGeoStrip.h.

86{ return m_Zmin; }

◆ IsInStrip()

bool MucGeoStrip::IsInStrip ( const float x,
const float y,
const float z ) const

Is the point within the boundaries of this strip?

Definition at line 154 of file MucGeoStrip.cxx.

157{
158 // Is the point within the boundaries of this strip?
159 return ( (x > m_Xmin) && (x < m_Xmax)
160 && (y > m_Ymin) && (y < m_Ymax)
161 && (z >= m_dzFarFrontGas)
162 && (z <= m_dzFarBackGas) );
163}

◆ Part()

int MucGeoStrip::Part ( )
inline

Get the softID.

Get Part No.

Definition at line 53 of file MucGeoStrip.h.

53{ return m_pGap->Part(); }
int Part() const
Get part identifier (0,2 for cap, 1 for barrel).
Definition MucGeoGap.h:98

◆ Seg()

int MucGeoStrip::Seg ( )
inline

Get Seg No.

Definition at line 56 of file MucGeoStrip.h.

56{ return m_pGap->Seg(); }
int Seg() const
Get seg identifier (0-7).
Definition MucGeoGap.h:101

◆ SetHitStatus()

void MucGeoStrip::SetHitStatus ( const bool hit)
inline

Set the strip hit status.

Definition at line 119 of file MucGeoStrip.h.

119{ m_HitStatus = hit; }

◆ SetLeftNeighbor()

void MucGeoStrip::SetLeftNeighbor ( MucGeoStrip * p)

Set pointer to the adjacent strip on the -X or -Y side of this one.

Set pointer to the adjacent strip on the -X or -Y side of this one.

Definition at line 136 of file MucGeoStrip.cxx.

137{
138 /// Set pointer to the adjacent strip on the -X or -Y side of this one.
139 // (0 if no neighbor in this gap).
140 if (p)
141 m_pLeftNeighbor = p;
142}

Referenced by MucGeoGap::AddStrip().

◆ SetRightNeighbor()

void MucGeoStrip::SetRightNeighbor ( MucGeoStrip * p)

Set pointer to the adjacent strip on the +X or +Y side of this one.

Set pointer to the adjacent strip on the +X or +Y side of this one.

Definition at line 145 of file MucGeoStrip.cxx.

146{
147 /// Set pointer to the adjacent strip on the +X or +Y side of this one.
148 // (0 if no neighbor in this gap).
149 if (p)
150 m_pRightNeighbor = p;
151}

Referenced by MucGeoGap::AddStrip().

◆ SetStrip() [1/2]

void MucGeoStrip::SetStrip ( const float x1,
const float x2,
const float y1,
const float y2,
const float xSize,
const float ySize,
const float zSize )

Set the edge, center and sigma of the strip (in the gap coordinate system).

Definition at line 63 of file MucGeoStrip.cxx.

68{
69 // Set the edge, center and sigma of the strip (in the gap coordinate system).
70 double un = 1.0; // Uncertainty.
71
72 m_Xmin = x1;
73 m_Xmax = x2;
74 m_Ymin = y1;
75 m_Ymax = y2;
76 m_Zmin = -0.5*zSize;
77 m_Zmax = 0.5*zSize;
78
79 m_dzFarFrontGas = GetGap()->GetdzFarFrontGas();
80 m_dzNearFrontGas = GetGap()->GetdzNearFrontGas();
81 m_dzNearBackGas = GetGap()->GetdzNearBackGas();
82 m_dzFarBackGas = GetGap()->GetdzFarBackGas();
83
84 m_CenterPos.setX(0.5*(m_Xmin + m_Xmax));
85 m_CenterPos.setY(0.5*(m_Ymin + m_Ymax));
86 m_CenterPos.setZ(0.0);
87
88 m_CenterSigma.setX(un*xSize);
89 m_CenterSigma.setY(un*ySize);
90 m_CenterSigma.setZ(un*zSize);
91}
float GetdzNearFrontGas() const
Get m_dzNearFrontGas;.
Definition MucGeoGap.h:125
float GetdzFarFrontGas() const
Get m_dzFarFrontGas;.
Definition MucGeoGap.h:122
float GetdzNearBackGas() const
Get m_dzNearBackGas;.
Definition MucGeoGap.h:131
float GetdzFarBackGas() const
Get m_dzFarFrontGas;.
Definition MucGeoGap.h:128
MucGeoGap * GetGap() const
Get the pointer to the gap that contains the strip.
Definition MucGeoStrip.h:65

Referenced by MucGeoGeneral::InitFromASCII(), and MucGeoGeneral::InitFromXML().

◆ SetStrip() [2/2]

void MucGeoStrip::SetStrip ( TGeoPhysicalNode * stripPhysicalNode)

Set strip from ROOT.

Definition at line 94 of file MucGeoStrip.cxx.

95{
96 // Set the edge, center and sigma of the strip (in the gap coordinate system).
97 double un = 1.0; // Uncertainty.
98
99 TGeoBBox *stripBox = (TGeoBBox*)stripPhysicalNode->GetShape();
100
101 double xSize = 2.0 * stripBox->GetDX();
102 double ySize = 2.0 * stripBox->GetDY();
103 double zSize = 2.0 * stripBox->GetDZ();
104
105 m_dzFarFrontGas = GetGap()->GetdzFarFrontGas();
106 m_dzNearFrontGas = GetGap()->GetdzNearFrontGas();
107 m_dzNearBackGas = GetGap()->GetdzNearBackGas();
108 m_dzFarBackGas = GetGap()->GetdzFarBackGas();
109
110 double eTrans[3], *pTrans;
111 pTrans = eTrans;
112 //int level = stripPhysicalNode->GetLevel();
113 double eLocal[3], *pLocal;
114 pLocal = eLocal;
115 for (int i = 0; i < 3; i++) pLocal[i] = 0.0;
116 stripPhysicalNode->GetNode()->LocalToMaster(pLocal, pTrans);
117
118 m_CenterPos.setX( pTrans[0] );
119 m_CenterPos.setY( pTrans[1] );
120 m_CenterPos.setZ( pTrans[2] );
121
122 m_Xmin = pTrans[0] - 0.5 * xSize;
123 m_Xmax = pTrans[0] + 0.5 * xSize;
124 m_Ymin = pTrans[1] - 0.5 * ySize;
125 m_Ymax = pTrans[1] + 0.5 * ySize;
126 m_Zmin = pTrans[2] - 0.5 * zSize;
127 m_Zmax = pTrans[2] + 0.5 * zSize;
128
129 m_CenterSigma.setX(un*xSize);
130 m_CenterSigma.setY(un*ySize);
131 m_CenterSigma.setZ(un*zSize);
132 //cout << m_CenterPos << endl;
133}

◆ Strip()

int MucGeoStrip::Strip ( )
inline

Get Strip No.

Definition at line 62 of file MucGeoStrip.h.

62{ return m_Strip; }

The documentation for this class was generated from the following files: