CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
MucGeoGap Class Reference

#include <MucGeoGap.h>

Public Member Functions

 MucGeoGap ()
 Default 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 int part, const int seg, const int gap, const int orient, const int stripNum, const TGeoPhysicalNode *gapPhyscialNode, const float ironThickness)
 ROOT constructor.
 
MucGeoGapoperator= (const MucGeoGap &orig)
 Assignment constructor.
 
 MucGeoGap (const MucGeoGap &orig)
 Copy constructor.
 
 ~MucGeoGap ()
 Desctructor.
 
int Part () const
 Get part identifier (0,2 for cap, 1 for barrel).
 
int Seg () const
 Get seg identifier (0-7).
 
int Gap () const
 Get gap identifier (0-8).
 
int Orient () const
 
int GetStripNum () const
 Get SoftID.
 
float GetIronThickness () const
 
bool GetHitStatus () const
 Get whether this gap is hit.
 
float GetdzFarFrontGas () const
 Get m_dzFarFrontGas;.
 
float GetdzNearFrontGas () const
 Get m_dzNearFrontGas;.
 
float GetdzFarBackGas () const
 Get m_dzFarFrontGas;.
 
float GetdzNearBackGas () const
 Get m_dzNearBackGas;.
 
MucGeoStripGetStrip (const int strip) const
 Point to a strip within this gap.
 
HepPoint3D GetCenter () const
 Get gap center position in global coordinate.
 
void GetSize (float &xSize, float &ySize, float &zSize) const
 Get size of this gap.
 
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.
 
int GuessStrip (const float x, const float y, const float z) const
 
HepPoint3D ProjectToGap (const HepPoint3D gPoint, const Hep3Vector gVect) const
 Given a line, find the intersection with the gap in the global.
 
HepPoint3D ProjectToGapWithSigma (const HepPoint3D gPoint, const Hep3Vector gVect, const HepPoint3D gPointSigma, const Hep3Vector gVectSigma, HepPoint3D &gCross, HepPoint3D &gCrossSigma) const
 
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 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 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.
 
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
 Given parabola, and a line, find the intersection with two surface of the gap in the global.
 
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.
 
HepPoint3D TransformToGap (const HepPoint3D gPoint) const
 Transform a point from global coordinate to gap coordinate.
 
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.
 
MucGeoStripAddStrip (const int strip)
 Add a strip to the gap.
 
void SetHitStatus (const bool hit)
 Set SoftID of the gap.
 

Detailed Description

Definition at line 44 of file MucGeoGap.h.

Constructor & Destructor Documentation

◆ MucGeoGap() [1/4]

MucGeoGap::MucGeoGap ( )

Default constructor.

Definition at line 24 of file MucGeoGap.cxx.

25 : m_Part(-1),
26 m_Seg(-1),
27 m_Gap(-1),
28 m_StripNum(-1),
29 m_XSize(-1.0),
30 m_YSize(-1.0),
31 m_ZSize(-1.0)
32{
33 // Default constructor.
34}

◆ MucGeoGap() [2/4]

MucGeoGap::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).

Definition at line 36 of file MucGeoGap.cxx.

62 : m_Part(part),
63 m_Seg(seg),
64 m_Gap(gap),
65 m_StripNum(stripNum),
66 m_Orient(orient),
67 m_XSize(xSize),
68 m_YSize(ySize),
69 m_ZSize(zSize),
70 m_dzHighEdge(dzHighEdge),
71 m_dzFarFrontGas(dzFarFrontGas),
72 m_dzNearFrontGas(dzNearFrontGas),
73 m_dzNearBackGas(dzNearBackGas),
74 m_dzFarBackGas(dzFarBackGas),
75 m_pMucGeoStrip(MucID::getStripNum(part, seg, gap))
76{
77 // Real constructor (construct strips externally).
78
79 // v1Global, v2Global, v3Global are position vectors of the three survey targets in the
80 // Bes global coordinate system.
81 //cout << m_dzHighEdge << " " << m_dzFarFrontGas << " " << m_dzNearFrontGas << " " << dzNearBackGas << " " << dzFarBackGas << endl;
82 Hep3Vector v1Global(xTarget1Global, yTarget1Global, zTarget1Global);
83 Hep3Vector v2Global(xTarget2Global, yTarget2Global, zTarget2Global);
84 Hep3Vector v3Global(xTarget3Global, yTarget3Global, zTarget3Global);
85
86 Hep3Vector v2To1Global = v1Global - v2Global;
87 Hep3Vector v3To1Global = v1Global - v3Global;
88
89 // v1Gap is the position vector of target1 in the gap coordinate system.
90 Hep3Vector v1Gap(dxTarget1ToFiducial + dxFiducialToCenter,
91 dyTarget1ToFiducial + dyFiducialToCenter,
92 0.0);
93
94 // Make rotaiton and translation matrix.
95 Hep3Vector newX(1,0,0), newY(0,1,0), newZ(0,0,1);
96 HepRotation rotateGap(newX, newY, newZ);
97
98 if(part == 1) {
99 newX = v2To1Global;
100 newX.setMag(1.0);
101 newY = v3To1Global;
102 newY.setMag(1.0);
103 newZ = newX.cross(newY);
104 }
105 if(part != 1) {
106 newY = -1.0*v2To1Global;
107 newY.setMag(1.0);
108 newZ = v3To1Global.cross(newY);
109 newZ.setMag(1.0);
110 newX = newY.cross(newZ);
111 }
112
113 HepRotation rotateGlobal(newX, newY, newZ);
114 HepRotation rotateGapToGlobal(rotateGlobal * rotateGap);
115
116 Hep3Vector translateGapToGlobal(v1Global - rotateGapToGlobal * v1Gap);
117
118 m_Rotation = rotateGapToGlobal;
119 m_Translation = translateGapToGlobal;
120 m_Center = m_Translation;
121
122 //cout << " Rotation : " << endl << m_Rotation.xx() << " " << m_Rotation.xy() << " " << m_Rotation.xz() << endl << m_Rotation.yx() << " " << m_Rotation.yy() << " " << m_Rotation.yz() << endl << m_Rotation.zx() << " " << m_Rotation.zy() << " " << m_Rotation.zz() << endl;
123 //cout << " Center : " << m_Center << endl;
124
125 HepMatrix rM(3,3), rMT(3,3);
126 for(int i=0; i<3; i++){
127 for(int j=0; j<3; j++){
128 rM[i][j] = m_Rotation(i,j);
129 }
130 }
131 rMT = rM.T();
132
133 Hep3Vector newXT(rMT(1,1),rMT(2,1),rMT(3,1));
134 Hep3Vector newYT(rMT(1,2),rMT(2,2),rMT(3,2));
135 Hep3Vector newZT(rMT(1,3),rMT(2,3),rMT(3,3));
136 HepRotation rotateGlobalToGap(newXT,newYT,newZT);
137
138 m_RotationT = rotateGlobalToGap;
139}
static value_type getStripNum(int part, int seg, int gap)
Definition MucID.cxx:178

◆ MucGeoGap() [3/4]

MucGeoGap::MucGeoGap ( const int part,
const int seg,
const int gap,
const int orient,
const int stripNum,
const TGeoPhysicalNode * gapPhyscialNode,
const float ironThickness )

ROOT constructor.

Definition at line 142 of file MucGeoGap.cxx.

149 : m_Part(part),
150 m_Seg(seg),
151 m_Gap(gap),
152 m_StripNum(stripNum),
153 m_Orient(orient),
154 m_pMucGeoStrip(MucID::getStripNum(part, seg, gap)),
155 m_IronThickness(ironThickness)
156
157{
158 TGeoBBox *gapBox = (TGeoBBox*)gapPhysicalNode->GetShape();
159
160 m_XSize = gapBox->GetDX() * 2.0;
161 m_YSize = gapBox->GetDY() * 2.0;
162 m_ZSize = gapBox->GetDZ() * 2.0;
163
164 m_dzHighEdge = 20.0;
165 m_dzFarFrontGas = -4.5;
166 m_dzNearFrontGas = -2.5;
167 m_dzNearBackGas = 2.5;
168 m_dzFarBackGas = 4.5;
169
170 double eRot[9], *pRot;
171 pRot = eRot;
172 pRot = gapPhysicalNode->GetMatrix()->GetRotationMatrix();
173
174 //cout << "part " << part << " seg " << seg << " gap " << gap << endl;
175 //cout << pRot[0] << " " << pRot[1] << " " << pRot[2] << endl
176 // << pRot[3] << " " << pRot[4] << " " << pRot[5] << endl
177 // << pRot[6] << " " << pRot[7] << " " << pRot[8] << endl;
178 Hep3Vector rotX(pRot[0], pRot[3], pRot[6]);
179 Hep3Vector rotY(pRot[1], pRot[4], pRot[7]);
180 Hep3Vector rotZ(pRot[2], pRot[5], pRot[8]);
181 HepRotation rotateGapToGlobal(rotX, rotY, rotZ);
182 m_Rotation = rotateGapToGlobal;
183
184 Hep3Vector rotTX(pRot[0], pRot[1], pRot[2]);
185 Hep3Vector rotTY(pRot[3], pRot[4], pRot[5]);
186 Hep3Vector rotTZ(pRot[6], pRot[7], pRot[8]);
187 HepRotation rotateGlobalToGap(rotTX, rotTY, rotTZ);
188 m_RotationT = rotateGlobalToGap;
189
190 double eTrans[3], *pTrans;
191 pTrans = eTrans;
192 pTrans = gapPhysicalNode->GetMatrix()->GetTranslation();
193
194 Hep3Vector translateGapToGlobal(pTrans[0], pTrans[1], pTrans[2]);
195 m_Translation = translateGapToGlobal;
196 m_Center = m_Translation;
197
198
199 double eTrans_gap[3], *pTrans_gap; //pTran is for box now!!!
200 pTrans_gap = eTrans_gap;
201 pTrans_gap = gapPhysicalNode->GetMatrix(2)->GetTranslation();
202 //std::cout <<"gap position: "<<pTrans_gap[0]<< " " << pTrans_gap[1] << " " << pTrans_gap[2] << std::endl;
203
204 Hep3Vector GapSurface1, GapSurface2;
205 Hep3Vector GapCenter(pTrans_gap[0], pTrans_gap[1], pTrans_gap[2]);
206 GapSurface1 = GapCenter - rotZ * 20; //Gap thickness/2= 20
207 GapSurface2 = GapCenter + rotZ * 20; //Gap thickness/2= 20
208
209 m_SurfaceInner = GapSurface1;
210 m_SurfaceOuter = GapSurface2;
211 if(GapSurface1.mag()>GapSurface2.mag())//keep Inner be the little one
212 {
213 m_SurfaceInner = GapSurface2;
214 m_SurfaceOuter = GapSurface1;
215 }
216
217 // std::cout <<"sur1 position: "<<GapSurface1[0]<<" "<<GapSurface1[1]<<" "<<GapSurface1[2]<<std::endl;
218// std::cout <<"sur2 position: "<<GapSurface2[0]<<" "<<GapSurface2[1]<<" "<<GapSurface2[2]<<std::endl;
219// std::cout <<"box position: "<< pTrans[0] << " " << pTrans[1] << " " << pTrans[2] << std::endl;
220}

◆ MucGeoGap() [4/4]

MucGeoGap::MucGeoGap ( const MucGeoGap & orig)

Copy constructor.

Definition at line 257 of file MucGeoGap.cxx.

258 : m_Part(orig.m_Part),
259 m_Seg(m_Seg),
260 m_Gap(m_Gap),
261 m_StripNum(orig.m_StripNum),
262 m_Orient(orig.m_Orient),
263 m_HitStatus(orig.m_HitStatus),
264 m_XSize(orig.m_XSize),
265 m_YSize(orig.m_YSize),
266 m_ZSize(orig.m_ZSize),
267 m_dzHighEdge(orig.m_dzHighEdge),
268 m_dzFarFrontGas(orig.m_dzFarFrontGas),
269 m_dzNearFrontGas(orig.m_dzNearFrontGas),
270 m_dzNearBackGas(orig.m_dzNearBackGas),
271 m_dzFarBackGas(orig.m_dzFarBackGas),
272 m_Center(orig.m_Center),
273 m_Rotation(orig.m_Rotation),
274 m_RotationT(orig.m_RotationT),
275 m_Translation(orig.m_Translation),
276 m_IronThickness(orig.m_IronThickness)
277{
278 // Copy constructor.
279 m_pMucGeoStrip = orig.m_pMucGeoStrip;
280}

◆ ~MucGeoGap()

MucGeoGap::~MucGeoGap ( )

Desctructor.

Definition at line 282 of file MucGeoGap.cxx.

283{
284 // Destructor.
285 MucGeoStrip* pStrip = 0;
286 while(m_pMucGeoStrip.size() > 0){
287 pStrip = m_pMucGeoStrip.back();
288 delete pStrip;
289 m_pMucGeoStrip.pop_back();
290 }
291}

Member Function Documentation

◆ AddStrip()

MucGeoStrip * MucGeoGap::AddStrip ( const int strip)

Add a strip to the gap.

Definition at line 645 of file MucGeoGap.cxx.

646{
647 // Add a strip to the gap.
648 MucGeoStrip *pStrip;
649 MucGeoStrip *neighbor;
650
651 if( strip >= int(m_pMucGeoStrip.size()) ) {
652 cout << " MucGeoGap::AddStrip strip number "
653 << strip << " outside of expected range "
654 << m_pMucGeoStrip.size()
655 << endl;
656 return 0;
657 }
658
659 if( (strip + 1) > m_StripNum ) m_StripNum = strip + 1;
660
661 if(m_pMucGeoStrip[strip]) {
662 // The strip object has already been created; don't create a new one.
663 return m_pMucGeoStrip[strip];
664 }
665
666 pStrip = new MucGeoStrip(strip, this);
667
668 m_pMucGeoStrip[strip] = pStrip;
669 pStrip->SetLeftNeighbor(0L);
670 pStrip->SetRightNeighbor(0L);
671
672 // Make this strip and the previous one neighbors.
673 if ( strip > 0 ) {
674 neighbor = m_pMucGeoStrip[strip-1];
675 if(neighbor) {
676 neighbor->SetRightNeighbor(pStrip);
677 pStrip->SetLeftNeighbor(neighbor);
678 }
679 }
680
681 return pStrip;
682}
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.

◆ CompareIntersection()

HepPoint3D MucGeoGap::CompareIntersection ( const int whichhalf,
const HepPoint3D gCross1,
const HepPoint3D gCross2,
const float a,
const float b,
const float c ) const

Definition at line 559 of file MucGeoGap.cxx.

562{
563 bool found = false;
564 bool found1 = false;
565 bool found2 = false;
566 int good = 0;
567
568 HepPoint3D localCross = TransformToGap(gCross1);
569 if ( IsInGap(localCross.x(),
570 localCross.y(),
571 0.0) ) {
572 good = 1;
573 found1 = true;
574 }
575
576 localCross = TransformToGap(gCross2);
577 if ( IsInGap(localCross.x(),
578 localCross.y(),
579 0.0) ) {
580 good = 2;
581 found2 = true;
582 }
583 if(found1&&found2) {
584 float center = b/(-2*a);
585 if(whichhalf==2){
586 if(gCross1.x()>center) good = 1;
587 if(gCross2.x()>center) good = 2;
588 }
589 if(whichhalf==1){
590 if(gCross1.x()<center) good = 1;
591 if(gCross2.x()<center) good = 2;
592 }
593 }
594
595 if(good == 1) return gCross1;
596 else if(good == 2) return gCross2;
597 else {
598 HepPoint3D Empty(-9999,-9999,-9999);
599 cout<<"in MucGeoGap:: both intersection position are bad!!!"<<endl; return Empty;
600 }
601
602}
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 TransformToGap(const HepPoint3D gPoint) const
Transform a point from global coordinate to gap coordinate.

Referenced by ProjectToGapSurface().

◆ Gap()

int MucGeoGap::Gap ( ) const
inline

Get gap identifier (0-8).

Definition at line 104 of file MucGeoGap.h.

104{ return m_Gap; }

Referenced by RecMucTrack::ComputeDistanceMatch(), MucGeoStrip::Gap(), and operator<<().

◆ GetCenter()

HepPoint3D MucGeoGap::GetCenter ( ) const
inline

Get gap center position in global coordinate.

Definition at line 137 of file MucGeoGap.h.

137{ return m_Center; }

Referenced by MucRecLineFit::LineFit(), and operator<<().

◆ GetdzFarBackGas()

float MucGeoGap::GetdzFarBackGas ( ) const
inline

Get m_dzFarFrontGas;.

Definition at line 128 of file MucGeoGap.h.

128{ return m_dzFarBackGas; }

Referenced by MucGeoStrip::SetStrip(), and MucGeoStrip::SetStrip().

◆ GetdzFarFrontGas()

float MucGeoGap::GetdzFarFrontGas ( ) const
inline

Get m_dzFarFrontGas;.

Definition at line 122 of file MucGeoGap.h.

122{ return m_dzFarFrontGas; }

Referenced by MucGeoStrip::SetStrip(), and MucGeoStrip::SetStrip().

◆ GetdzNearBackGas()

float MucGeoGap::GetdzNearBackGas ( ) const
inline

Get m_dzNearBackGas;.

Definition at line 131 of file MucGeoGap.h.

131{ return m_dzNearBackGas; }

Referenced by MucGeoStrip::SetStrip(), and MucGeoStrip::SetStrip().

◆ GetdzNearFrontGas()

float MucGeoGap::GetdzNearFrontGas ( ) const
inline

Get m_dzNearFrontGas;.

Definition at line 125 of file MucGeoGap.h.

125{ return m_dzNearFrontGas; }

Referenced by MucGeoStrip::SetStrip(), and MucGeoStrip::SetStrip().

◆ GetHitStatus()

bool MucGeoGap::GetHitStatus ( ) const
inline

Get whether this gap is hit.

Definition at line 119 of file MucGeoGap.h.

119{ return m_HitStatus; }

◆ GetIronThickness()

float MucGeoGap::GetIronThickness ( ) const
inline

Definition at line 116 of file MucGeoGap.h.

116{ return m_IronThickness; }

Referenced by RecMucTrack::ComputeDepth(), and RecMucTrack::ComputeDepth().

◆ GetRotationMatrix()

void MucGeoGap::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.

Definition at line 321 of file MucGeoGap.cxx.

324{
325 // Get the rotation angles (in degrees) of the gap in the global coordinate system.
326 Hep3Vector x(m_Rotation.colX());
327 Hep3Vector y(m_Rotation.colY());
328 Hep3Vector z(m_Rotation.colZ());
329
330 thetaX = kRad * x.theta();
331 phiX = kRad * x.phi();
332 thetaY = kRad * y.theta();
333 phiY = kRad * y.phi();
334 thetaZ = kRad * z.theta();
335 phiZ = kRad * z.phi();
336
337 // cout << "Gap rotation matrix : " << endl
338 // << "X: theta = " << thetaX << " phi = " << phiX << endl
339 // << "Y: theta = " << thetaY << " phi = " << phiY << endl
340 // << "Z: theta = " << thetaZ << " phi = " << phiZ << endl;
341
342 return;
343}
const Double_t kRad
Definition BesTView.cxx:34
Double_t x[10]

Referenced by ExtMucKal::GetRoationMatrix().

◆ GetSize()

void MucGeoGap::GetSize ( float & xSize,
float & ySize,
float & zSize ) const

Get size of this gap.

Definition at line 310 of file MucGeoGap.cxx.

311{
312 // Get size of this gap.
313 xSize = m_XSize;
314 ySize = m_YSize;
315 zSize = m_ZSize;
316
317 return;
318}

Referenced by operator<<().

◆ GetStrip()

MucGeoStrip * MucGeoGap::GetStrip ( const int strip) const

Point to a strip within this gap.

Definition at line 294 of file MucGeoGap.cxx.

295{
296 // Point to a strip within this gap.
297 if ( strip < 0 || strip >= int(m_pMucGeoStrip.size()) ) {
298 std::cout << "Error: MucGeoGap::GetStrip() strip " << strip << " exceed strip range" << endl;
299 return 0;
300 }
301 if ( !m_pMucGeoStrip[strip] ) {
302 std::cout << "Error: MucGeoGap::GetStrip() strip " << strip << " not found" << endl;
303 return 0;
304 }
305
306 return m_pMucGeoStrip[strip];
307}

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

◆ GetStripNum()

int MucGeoGap::GetStripNum ( ) const
inline

Get SoftID.

Get number of strips in this gap.

Definition at line 114 of file MucGeoGap.h.

114{ return m_StripNum; }

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

◆ GuessStrip()

int MucGeoGap::GuessStrip ( const float x,
const float y,
const float z ) const

Given a position (gap coordinate), guess the approximate strip containing the position, as there are intervals between the strips.

Definition at line 346 of file MucGeoGap.cxx.

349{
350 // Given a position (gap coordinate), find the approximate strip containing the position, as there are intervals between the strips.
351 float x0, y0, z0; // XYZ position of the strip NO min.
352 float xn, yn, zn; // XYZ position of the strip NO max.
353 float dx; // Approximate width of a strip and a interval.
354 int n, iGuess;
355
356 n = m_StripNum - 1;
357
358 GetStrip(0)->GetCenterPos(x0, y0, z0);
359 GetStrip(n)->GetCenterPos(xn, yn, zn);
360
361 //cout << n << endl;
362 //cout << "x0 " << x0 << " xn " << xn << " x " << x << endl;
363 //cout << "y0 " << y0 << " yn " << yn << " y " << y << endl;
364 //cout << "orient " << m_Orient << endl;
365
366 if(m_Orient == 0){
367 dx = (yn-y0)/n;
368 iGuess = int ((y-y0)/dx+0.5);
369 return iGuess;
370 }
371 else{
372 dx = (xn-x0)/n;
373 iGuess = int ((x-x0)/dx+0.5);
374 return iGuess;
375 }
376}
const Int_t n
MucGeoStrip * GetStrip(const int strip) const
Point to a strip within this gap.
void GetCenterPos(float &x, float &y, float &z) const
Get center position of this strip (in the gap coordinate system).

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

◆ IsInGap()

bool MucGeoGap::IsInGap ( const float x,
const float y,
const float z ) const

Check if the point (given in gap coordinate) is within the gap boundary.

Definition at line 634 of file MucGeoGap.cxx.

637{
638 // Check if the point (given in gap coordinate) is within the gap boundary.
639 return ( ( x > -0.5*m_XSize - kGapEdge ) && ( x < 0.5*m_XSize + kGapEdge ) &&
640 ( y > -0.5*m_YSize - kGapEdge ) && ( y < 0.5*m_YSize + kGapEdge ) &&
641 ( z > ( m_dzHighEdge - m_ZSize ) ) && ( z < m_dzHighEdge ) );
642}
const double kGapEdge
Definition MucConstant.h:10

Referenced by CompareIntersection(), MucGeoGeneral::FindIntersectGaps(), MucGeoGeneral::FindIntersections(), and ProjectToGap().

◆ operator=()

MucGeoGap & MucGeoGap::operator= ( const MucGeoGap & orig)

Assignment constructor.

Definition at line 223 of file MucGeoGap.cxx.

224{
225 // Assignment operator.
226 if (this != &orig) { // Watch out for self-assignment!
227 m_Part = orig.m_Part;
228 m_Seg = orig.m_Seg;
229 m_Gap = orig.m_Gap;
230 m_StripNum = orig.m_StripNum;
231 m_Orient = orig.m_Orient;
232 m_HitStatus = orig.m_HitStatus;
233
234 m_XSize = orig.m_XSize;
235 m_YSize = orig.m_YSize;
236 m_ZSize = orig.m_ZSize;
237
238 m_dzHighEdge = orig.m_dzHighEdge;
239 m_dzFarFrontGas = orig.m_dzFarFrontGas;
240 m_dzNearFrontGas = orig.m_dzNearFrontGas;
241 m_dzNearBackGas = orig.m_dzNearBackGas;
242 m_dzFarBackGas = orig.m_dzFarBackGas;
243
244
245 m_Center = orig.m_Center;
246 m_Rotation = orig.m_Rotation;
247 m_RotationT = orig.m_RotationT;
248 m_Translation = orig.m_Translation;
249
250 m_IronThickness = orig.m_IronThickness;
251
252 m_pMucGeoStrip = orig.m_pMucGeoStrip;
253 }
254 return *this;
255}

◆ Orient()

int MucGeoGap::Orient ( ) const
inline

◆ Part()

int MucGeoGap::Part ( ) const
inline

Get part identifier (0,2 for cap, 1 for barrel).

Definition at line 98 of file MucGeoGap.h.

98{ return m_Part; }

Referenced by RecMucTrack::ComputeDistanceMatch(), operator<<(), and MucGeoStrip::Part().

◆ ProjectToGap() [1/2]

HepPoint3D MucGeoGap::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.

Definition at line 468 of file MucGeoGap.cxx.

477{
478 // Given a line by basepoint gPoint and direction gDirection,
479 // find the intersection with the gap (in global coordinate).
480 Hep3Vector gapVect = m_Rotation.colZ();
481
482 HepPlane3D plane(gapVect, m_Center);
483 MucGeometron geometron;
484 //bool getPoint =
485 geometron.GetIntersectionQuadPlane(gPoint, vy, y0, a, b, c, plane, gCross1, gCross2);
486
487 HepPoint3D localCross = TransformToGap(gCross1);
488
489 bool found = false;
490 bool found1 = false;
491 bool found2 = false;
492 HepPoint3D temp;
493 int good = 0;
494
495 if ( IsInGap(localCross.x(),
496 localCross.y(),
497 localCross.z()) ) {
498 good = 1;
499 found1 = true;
500 }
501
502 localCross = TransformToGap(gCross2);
503 if ( IsInGap(localCross.x(),
504 localCross.y(),
505 localCross.z()) ) {
506 good = 2;
507 found2 = true;
508 }
509 if(found1&&found2) {
510 float center = b/(-2*a);
511 if(whichhalf==2){
512 if(gCross1.x()>center) good = 1;
513 if(gCross2.x()>center) good = 2;
514 }
515 if(whichhalf==1){
516 if(gCross1.x()<center) good = 1;
517 if(gCross2.x()<center) good = 2;
518 }
519 }
520 if(good == 2) {temp = gCross1; gCross1 = gCross2; gCross2 = temp;} //keep gCross1 be the good one!
521 //cout<<"detail: "<<whichhalf<<" "<<gCross1<<" & "<<gCross2<<" "<<a<<" "<<b<<" "<<c<<endl;
522
523 return gCross1;
524}
HepGeom::Plane3D< double > HepPlane3D
bool GetIntersectionQuadPlane(const HepPoint3D pLine, const float vy, const float y0, const float a, const float b, const float c, const HepPlane3D plane, HepPoint3D &cross1, HepPoint3D &cross2)

◆ ProjectToGap() [2/2]

HepPoint3D MucGeoGap::ProjectToGap ( const HepPoint3D gPoint,
const Hep3Vector gVect ) const

Given a line, find the intersection with the gap in the global.

Definition at line 379 of file MucGeoGap.cxx.

381{
382 // Given a line by basepoint gPoint and direction gDirection,
383 // find the intersection with the gap (in global coordinate).
384 Hep3Vector gapVect = m_Rotation.colZ();
385 HepPoint3D gCross(0,0,0);
386
387 HepPlane3D plane(gapVect, m_Center);
388 MucGeometron geometron;
389 //bool getPoint =
390 geometron.GetIntersectionLinePlane(gPoint, gDirection, plane, gCross);
391
392 return gCross;
393}
bool GetIntersectionLinePlane(const HepPoint3D pLine, const Hep3Vector vectLine, const HepPlane3D plane, HepPoint3D &cross)
Get intersection of a line and a plane.

Referenced by MucGeoGeneral::FindIntersectGaps(), MucGeoGeneral::FindIntersection(), MucGeoGeneral::FindIntersection(), MucGeoGeneral::FindIntersections(), MucGeoGeneral::FindIntersectStrips(), MucGeoGeneral::FindIntersectStrips(), and ExtMucKal::MucKalIniti().

◆ ProjectToGapQuadLocal()

HepPoint3D MucGeoGap::ProjectToGapQuadLocal ( const int part,
const int orient,
const float a,
const float b,
const float c,
const int whichhalf,
HepPoint3D & cross1,
HepPoint3D & cross2 ) const

Definition at line 435 of file MucGeoGap.cxx.

443{
444 Hep3Vector gapVect, center_local;
445 if(part == 1 && orient == 1) {gapVect = m_Rotation.colZ(); center_local = m_Center;}
446 else if(part == 1 && orient == 0) {//in this orientation, the fitting is done in local coordinate.
447 gapVect.setX(0); gapVect.setY(1); gapVect.setZ(0);
448 center_local.setX(0); center_local.setY(m_Center.mag()); center_local.setZ(0);
449 }
450 else {//in this orientation, the fitting is done in local coordinate.
451 gapVect.setX(1); gapVect.setY(0); gapVect.setZ(0);
452 center_local.setX(m_Center.z()); center_local.setY(0); center_local.setZ(0);
453 }
454
455 //cout<<"in mucgeogap: part = "<<part<<" o: "<<orient<<" gapvect: "<<gapVect<<" center = "<<m_Center<<endl;
456 //cout<<"in mucgeogap: center local = "<<center_local<<endl;
457
458 HepPlane3D plane(gapVect, center_local);
459
460 MucGeometron geometron;
461 geometron.GetIntersectionQuadPlaneLocal(part,orient, a, b, c, plane, gCross1, gCross2);
462
463
464}
bool GetIntersectionQuadPlaneLocal(const int part, const int orient, const float a, const float b, const float c, const HepPlane3D plane, HepPoint3D &cross1, HepPoint3D &cross2)

Referenced by MucGeoGeneral::FindIntersectionQuadLocal().

◆ ProjectToGapSurface() [1/2]

void MucGeoGap::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

Given parabola, and a line, find the intersection with two surface of the gap in the global.

Definition at line 528 of file MucGeoGap.cxx.

537{
538 // Given a line by basepoint gPoint and direction gDirection,
539 // find the intersection with the gap (in global coordinate).
540
541 HepPoint3D cross1, cross2, cross3, cross4;
542
543 Hep3Vector gapVect = m_Rotation.colZ();
544
545 HepPlane3D planeInner(gapVect, m_SurfaceInner);
546 HepPlane3D planeOuter(gapVect, m_SurfaceOuter);
547
548 MucGeometron geometron;
549 //bool getPoint =
550 geometron.GetIntersectionQuadPlane(gPoint, vy, y0, a, b, c, planeInner, cross1, cross2);
551 geometron.GetIntersectionQuadPlane(gPoint, vy, y0, a, b, c, planeOuter, cross3, cross4);
552
553 gCross1 = CompareIntersection(whichhalf, cross1, cross2, a, b, c);
554 gCross2 = CompareIntersection(whichhalf, cross3, cross4, a, b, c);
555
556}
HepPoint3D CompareIntersection(const int whichhalf, const HepPoint3D gCross1, const HepPoint3D gCross2, const float a, const float b, const float c) const

◆ ProjectToGapSurface() [2/2]

void MucGeoGap::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.

Definition at line 415 of file MucGeoGap.cxx.

419{
420 // Given a line by basepoint gPoint and direction gDirection,
421 // find the intersection with the gap (in global coordinate).
422 Hep3Vector gapVect = m_Rotation.colZ();
423
424 HepPlane3D planeInner(gapVect, m_SurfaceInner);
425 HepPlane3D planeOuter(gapVect, m_SurfaceOuter);
426 MucGeometron geometron;
427 //bool getPoint =
428
429 geometron.GetIntersectionLinePlane(gPoint, gDirection, planeInner, gCross1);
430 geometron.GetIntersectionLinePlane(gPoint, gDirection, planeOuter, gCross2);
431
432}

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

◆ ProjectToGapWithSigma()

HepPoint3D MucGeoGap::ProjectToGapWithSigma ( const HepPoint3D gPoint,
const Hep3Vector gVect,
const HepPoint3D gPointSigma,
const Hep3Vector gVectSigma,
HepPoint3D & gCross,
HepPoint3D & gCrossSigma ) const

Definition at line 396 of file MucGeoGap.cxx.

402{
403 Hep3Vector gapVect = m_Rotation.colZ();
404
405 HepPlane3D plane(gapVect, m_Center);
406 MucGeometron geometron;
407 geometron.GetIntersectionLinePlaneWithSigma(gPoint, gDirection, gPointSigma, gDirectionSigma, plane, gCross, gCrossSigma);
408
409
410 return gCross;
411}
bool GetIntersectionLinePlaneWithSigma(const HepPoint3D pLine, const Hep3Vector vectLine, const HepPoint3D pLineSigma, const Hep3Vector vectLineSigma, const HepPlane3D plane, HepPoint3D &cross, HepPoint3D &crossSigma)

◆ RotateToGap()

Hep3Vector MucGeoGap::RotateToGap ( const Hep3Vector gVect) const

Rotate a vector from global coordinate to gap coordinate.

Definition at line 613 of file MucGeoGap.cxx.

614{
615 // Rotate a vector from Bes global coordinate to gap coordinate.
616 return m_RotationT * gVect;
617}

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

◆ RotateToGlobal()

Hep3Vector MucGeoGap::RotateToGlobal ( const Hep3Vector pVect) const

Rotate a vector from gap coordinate to global coordinate.

Definition at line 606 of file MucGeoGap.cxx.

607{
608 // Rotate a vector from gap coordinate to Bes global coordinate.
609 return m_Rotation * pVect;
610}

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

◆ Seg()

int MucGeoGap::Seg ( ) const
inline

Get seg identifier (0-7).

Definition at line 101 of file MucGeoGap.h.

101{ return m_Seg; }

Referenced by RecMucTrack::ComputeDistanceMatch(), operator<<(), and MucGeoStrip::Seg().

◆ SetHitStatus()

void MucGeoGap::SetHitStatus ( const bool hit)
inline

Set SoftID of the gap.

Tell whether or not this gap registered a signal in this event.

Definition at line 218 of file MucGeoGap.h.

218{ m_HitStatus = hit; }

◆ TransformToGap()

◆ TransformToGlobal()

HepPoint3D MucGeoGap::TransformToGlobal ( const HepPoint3D pPoint) const

Transform a point from gap coordinate to global coordinate.

Definition at line 620 of file MucGeoGap.cxx.

621{
622 // Transform a point from gap coordinate to Bes global coordinate.
623 return m_Rotation * pPoint + m_Translation;
624}

Referenced by RecMucTrack::CalculateInsct(), ExtMucKal::ExtMucFilter(), main(), MucRecHit::MucRecHit(), and MucRecHit::MucRecHit().


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