MucGeoGap Class Reference

#include <MucGeoGap.h>

List of all members.

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 number of strips in this gap.
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)
 Tell whether or not this gap registered a signal in this event.

Private Attributes

int m_Part
int m_Seg
int m_Gap
int m_StripNum
int m_Orient
bool m_HitStatus
float m_XSize
float m_YSize
float m_ZSize
float m_dzHighEdge
float m_dzFarFrontGas
float m_dzNearFrontGas
float m_dzNearBackGas
float m_dzFarBackGas
float m_IronThickness
HepPoint3D m_Center
HepRotation m_Rotation
HepRotation m_RotationT
Hep3Vector m_Translation
HepPoint3D m_SurfaceInner
HepPoint3D m_SurfaceOuter
TGeoPhysicalNode * m_PhyNode
vector< MucGeoStrip * > m_pMucGeoStrip


Detailed Description

Definition at line 44 of file MucGeoGap.h.


Constructor & Destructor Documentation

MucGeoGap::MucGeoGap (  ) 

Default constructor.

Definition at line 24 of file MucGeoGap.cxx.

00025   : m_Part(-1),
00026     m_Seg(-1),
00027     m_Gap(-1),
00028     m_StripNum(-1),
00029     m_XSize(-1.0),
00030     m_YSize(-1.0),
00031     m_ZSize(-1.0)
00032 {
00033   // Default constructor.
00034 }

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.

References genRecEmupikp::i, ganga-rec::j, m_Center, m_Rotation, m_RotationT, and m_Translation.

00062   : m_Part(part),
00063     m_Seg(seg),
00064     m_Gap(gap),
00065     m_StripNum(stripNum),
00066     m_Orient(orient),
00067     m_XSize(xSize),
00068     m_YSize(ySize),
00069     m_ZSize(zSize),
00070     m_dzHighEdge(dzHighEdge),
00071     m_dzFarFrontGas(dzFarFrontGas),
00072     m_dzNearFrontGas(dzNearFrontGas),
00073     m_dzNearBackGas(dzNearBackGas),
00074     m_dzFarBackGas(dzFarBackGas),
00075     m_pMucGeoStrip(MucID::getStripNum(part, seg, gap))
00076 {
00077   // Real constructor (construct strips externally).
00078 
00079   // v1Global, v2Global, v3Global are position vectors of the three survey targets in the
00080   // Bes global coordinate system.
00081   //cout << m_dzHighEdge << " " << m_dzFarFrontGas << " " << m_dzNearFrontGas << " " << dzNearBackGas << " " << dzFarBackGas << endl;
00082   Hep3Vector v1Global(xTarget1Global, yTarget1Global, zTarget1Global);
00083   Hep3Vector v2Global(xTarget2Global, yTarget2Global, zTarget2Global);
00084   Hep3Vector v3Global(xTarget3Global, yTarget3Global, zTarget3Global);
00085 
00086   Hep3Vector v2To1Global = v1Global - v2Global;
00087   Hep3Vector v3To1Global = v1Global - v3Global;
00088 
00089   // v1Gap is the position vector of target1 in the gap coordinate system. 
00090   Hep3Vector v1Gap(dxTarget1ToFiducial + dxFiducialToCenter,
00091                    dyTarget1ToFiducial + dyFiducialToCenter,
00092                    0.0);
00093  
00094   // Make rotaiton and translation matrix.
00095   Hep3Vector newX(1,0,0), newY(0,1,0), newZ(0,0,1);
00096   HepRotation rotateGap(newX, newY, newZ);
00097 
00098   if(part == 1) {
00099     newX = v2To1Global;
00100     newX.setMag(1.0);
00101     newY = v3To1Global;
00102     newY.setMag(1.0);
00103     newZ = newX.cross(newY);
00104   }
00105   if(part != 1) { 
00106     newY = -1.0*v2To1Global;
00107     newY.setMag(1.0);
00108     newZ = v3To1Global.cross(newY);
00109     newZ.setMag(1.0);
00110     newX = newY.cross(newZ);
00111   }
00112 
00113   HepRotation rotateGlobal(newX, newY, newZ);
00114   HepRotation rotateGapToGlobal(rotateGlobal * rotateGap);
00115 
00116   Hep3Vector  translateGapToGlobal(v1Global - rotateGapToGlobal * v1Gap);
00117 
00118   m_Rotation    = rotateGapToGlobal;
00119   m_Translation = translateGapToGlobal;
00120   m_Center      = m_Translation;
00121 
00122   //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;
00123   //cout << " Center   : " << m_Center   << endl;
00124 
00125   HepMatrix rM(3,3), rMT(3,3);
00126   for(int i=0; i<3; i++){
00127     for(int j=0; j<3; j++){
00128       rM[i][j] = m_Rotation(i,j);
00129     }
00130   }
00131   rMT = rM.T();
00132 
00133   Hep3Vector newXT(rMT(1,1),rMT(2,1),rMT(3,1));
00134   Hep3Vector newYT(rMT(1,2),rMT(2,2),rMT(3,2));
00135   Hep3Vector newZT(rMT(1,3),rMT(2,3),rMT(3,3));
00136   HepRotation rotateGlobalToGap(newXT,newYT,newZT);
00137 
00138   m_RotationT = rotateGlobalToGap;
00139 }

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.

References m_Center, m_dzFarBackGas, m_dzFarFrontGas, m_dzHighEdge, m_dzNearBackGas, m_dzNearFrontGas, m_Rotation, m_RotationT, m_SurfaceInner, m_SurfaceOuter, m_Translation, m_XSize, m_YSize, and m_ZSize.

00149   : m_Part(part),
00150     m_Seg(seg),
00151     m_Gap(gap),
00152     m_StripNum(stripNum),
00153     m_Orient(orient),
00154     m_pMucGeoStrip(MucID::getStripNum(part, seg, gap)),
00155     m_IronThickness(ironThickness)
00156 
00157 {
00158   TGeoBBox *gapBox = (TGeoBBox*)gapPhysicalNode->GetShape();
00159 
00160   m_XSize = gapBox->GetDX() * 2.0;
00161   m_YSize = gapBox->GetDY() * 2.0;
00162   m_ZSize = gapBox->GetDZ() * 2.0;
00163 
00164   m_dzHighEdge     = 20.0;
00165   m_dzFarFrontGas  = -4.5;
00166   m_dzNearFrontGas = -2.5;
00167   m_dzNearBackGas  =  2.5;
00168   m_dzFarBackGas   =  4.5;  
00169 
00170   double eRot[9], *pRot;
00171   pRot = eRot;
00172   pRot = gapPhysicalNode->GetMatrix()->GetRotationMatrix();
00173 
00174   //cout << "part " << part << " seg " << seg << " gap " << gap << endl; 
00175   //cout << pRot[0] << " " << pRot[1] << " " << pRot[2] << endl
00176   //     << pRot[3] << " " << pRot[4] << " " << pRot[5] << endl
00177   //     << pRot[6] << " " << pRot[7] << " " << pRot[8] << endl;
00178   Hep3Vector rotX(pRot[0], pRot[3], pRot[6]);
00179   Hep3Vector rotY(pRot[1], pRot[4], pRot[7]);
00180   Hep3Vector rotZ(pRot[2], pRot[5], pRot[8]);
00181   HepRotation rotateGapToGlobal(rotX, rotY, rotZ);
00182   m_Rotation = rotateGapToGlobal;
00183 
00184   Hep3Vector rotTX(pRot[0], pRot[1], pRot[2]);
00185   Hep3Vector rotTY(pRot[3], pRot[4], pRot[5]);
00186   Hep3Vector rotTZ(pRot[6], pRot[7], pRot[8]);
00187   HepRotation rotateGlobalToGap(rotTX, rotTY, rotTZ);
00188   m_RotationT = rotateGlobalToGap;
00189   
00190   double eTrans[3], *pTrans;
00191   pTrans = eTrans;
00192   pTrans = gapPhysicalNode->GetMatrix()->GetTranslation();
00193   
00194   Hep3Vector translateGapToGlobal(pTrans[0], pTrans[1], pTrans[2]);
00195   m_Translation = translateGapToGlobal;
00196   m_Center      = m_Translation;
00197 
00198 
00199   double eTrans_gap[3], *pTrans_gap;  //pTran is for box now!!!
00200   pTrans_gap = eTrans_gap;
00201   pTrans_gap = gapPhysicalNode->GetMatrix(2)->GetTranslation();
00202   //std::cout <<"gap position: "<<pTrans_gap[0]<< " " << pTrans_gap[1] << " " << pTrans_gap[2] << std::endl;
00203 
00204   Hep3Vector GapSurface1, GapSurface2;
00205   Hep3Vector GapCenter(pTrans_gap[0], pTrans_gap[1], pTrans_gap[2]);
00206   GapSurface1 = GapCenter - rotZ * 20; //Gap thickness/2= 20
00207   GapSurface2 = GapCenter + rotZ * 20; //Gap thickness/2= 20
00208 
00209   m_SurfaceInner = GapSurface1;
00210   m_SurfaceOuter = GapSurface2;
00211   if(GapSurface1.mag()>GapSurface2.mag())//keep Inner be the little one
00212     {
00213       m_SurfaceInner = GapSurface2;
00214       m_SurfaceOuter = GapSurface1;
00215     }
00216 
00217  //  std::cout <<"sur1 position: "<<GapSurface1[0]<<" "<<GapSurface1[1]<<" "<<GapSurface1[2]<<std::endl;
00218 //   std::cout <<"sur2 position: "<<GapSurface2[0]<<" "<<GapSurface2[1]<<" "<<GapSurface2[2]<<std::endl; 
00219 //   std::cout <<"box position: "<< pTrans[0] << " " << pTrans[1] << " " << pTrans[2] << std::endl;
00220 }

MucGeoGap::MucGeoGap ( const MucGeoGap orig  ) 

Copy constructor.

Definition at line 257 of file MucGeoGap.cxx.

References m_pMucGeoStrip.

00258   : m_Part(orig.m_Part),
00259     m_Seg(m_Seg),
00260     m_Gap(m_Gap),
00261     m_StripNum(orig.m_StripNum),
00262     m_Orient(orig.m_Orient),
00263     m_HitStatus(orig.m_HitStatus),
00264     m_XSize(orig.m_XSize),
00265     m_YSize(orig.m_YSize),
00266     m_ZSize(orig.m_ZSize),
00267     m_dzHighEdge(orig.m_dzHighEdge),
00268     m_dzFarFrontGas(orig.m_dzFarFrontGas),
00269     m_dzNearFrontGas(orig.m_dzNearFrontGas),
00270     m_dzNearBackGas(orig.m_dzNearBackGas),
00271     m_dzFarBackGas(orig.m_dzFarBackGas),
00272     m_Center(orig.m_Center),
00273     m_Rotation(orig.m_Rotation),
00274     m_RotationT(orig.m_RotationT),
00275     m_Translation(orig.m_Translation),
00276     m_IronThickness(orig.m_IronThickness)
00277 { 
00278   // Copy constructor.
00279   m_pMucGeoStrip = orig.m_pMucGeoStrip;
00280 }

MucGeoGap::~MucGeoGap (  ) 

Desctructor.

Definition at line 282 of file MucGeoGap.cxx.

References m_pMucGeoStrip.

00283 { 
00284   // Destructor.
00285   MucGeoStrip* pStrip = 0;
00286   while(m_pMucGeoStrip.size() > 0){
00287     pStrip = m_pMucGeoStrip.back();
00288     delete pStrip;
00289     m_pMucGeoStrip.pop_back();
00290   }
00291 }


Member Function Documentation

MucGeoStrip * MucGeoGap::AddStrip ( const int  strip  ) 

Add a strip to the gap.

Definition at line 645 of file MucGeoGap.cxx.

References m_pMucGeoStrip, m_StripNum, MucGeoStrip::SetLeftNeighbor(), and MucGeoStrip::SetRightNeighbor().

00646 { 
00647   // Add a strip to the gap.
00648   MucGeoStrip *pStrip;
00649   MucGeoStrip *neighbor;
00650 
00651   if( strip >= int(m_pMucGeoStrip.size()) ) {
00652     cout << " MucGeoGap::AddStrip  strip number "
00653          << strip << " outside of expected range " 
00654          << m_pMucGeoStrip.size() 
00655          << endl;
00656     return 0;
00657   }
00658 
00659   if( (strip + 1) > m_StripNum ) m_StripNum = strip + 1;
00660 
00661   if(m_pMucGeoStrip[strip]) {
00662     // The strip object has already been created; don't create a new one.
00663     return m_pMucGeoStrip[strip];
00664   }
00665 
00666   pStrip = new MucGeoStrip(strip,  this);
00667   
00668   m_pMucGeoStrip[strip] = pStrip;
00669   pStrip->SetLeftNeighbor(0L);
00670   pStrip->SetRightNeighbor(0L);
00671   
00672   // Make this strip and the previous one neighbors.
00673   if ( strip > 0 ) {
00674     neighbor = m_pMucGeoStrip[strip-1];
00675     if(neighbor) {
00676       neighbor->SetRightNeighbor(pStrip);
00677       pStrip->SetLeftNeighbor(neighbor);
00678     }
00679   }
00680   
00681   return pStrip;
00682 }

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.

References IsInGap(), and TransformToGap().

Referenced by ProjectToGapSurface().

00562 {
00563   bool found = false;
00564   bool found1 = false;
00565   bool found2 = false;
00566   int good = 0;
00567 
00568   HepPoint3D localCross = TransformToGap(gCross1);
00569   if ( IsInGap(localCross.x(),
00570                localCross.y(),
00571                0.0) ) {
00572     good = 1;
00573     found1 = true;
00574   }
00575 
00576   localCross = TransformToGap(gCross2);
00577   if ( IsInGap(localCross.x(),
00578                localCross.y(),
00579                0.0) ) {
00580     good = 2;
00581     found2 = true;
00582   }
00583   if(found1&&found2) {
00584     float center = b/(-2*a);
00585     if(whichhalf==2){
00586       if(gCross1.x()>center) good = 1;
00587       if(gCross2.x()>center) good = 2;
00588     }
00589     if(whichhalf==1){
00590       if(gCross1.x()<center) good = 1;
00591       if(gCross2.x()<center) good = 2;
00592     }
00593   }
00594 
00595   if(good == 1) return gCross1;
00596   else if(good == 2) return gCross2;
00597   else {
00598     HepPoint3D Empty(-9999,-9999,-9999);
00599     cout<<"in MucGeoGap:: both intersection position are bad!!!"<<endl; return Empty;
00600   }
00601 
00602 }

int MucGeoGap::Gap (  )  const [inline]

Get gap identifier (0-8).

Definition at line 104 of file MucGeoGap.h.

References m_Gap.

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

00104 { return m_Gap; }

HepPoint3D MucGeoGap::GetCenter (  )  const [inline]

Get gap center position in global coordinate.

Definition at line 137 of file MucGeoGap.h.

References m_Center.

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

00137 { return m_Center; }

float MucGeoGap::GetdzFarBackGas (  )  const [inline]

Get m_dzFarFrontGas;.

Definition at line 128 of file MucGeoGap.h.

References m_dzFarBackGas.

Referenced by MucGeoStrip::SetStrip().

00128 { return m_dzFarBackGas; }  

float MucGeoGap::GetdzFarFrontGas (  )  const [inline]

Get m_dzFarFrontGas;.

Definition at line 122 of file MucGeoGap.h.

References m_dzFarFrontGas.

Referenced by MucGeoStrip::SetStrip().

00122 { return m_dzFarFrontGas; }  

float MucGeoGap::GetdzNearBackGas (  )  const [inline]

Get m_dzNearBackGas;.

Definition at line 131 of file MucGeoGap.h.

References m_dzNearBackGas.

Referenced by MucGeoStrip::SetStrip().

00131 { return m_dzNearBackGas; }  

float MucGeoGap::GetdzNearFrontGas (  )  const [inline]

Get m_dzNearFrontGas;.

Definition at line 125 of file MucGeoGap.h.

References m_dzNearFrontGas.

Referenced by MucGeoStrip::SetStrip().

00125 { return m_dzNearFrontGas; }  

bool MucGeoGap::GetHitStatus (  )  const [inline]

Get whether this gap is hit.

Definition at line 119 of file MucGeoGap.h.

References m_HitStatus.

00119 { return m_HitStatus; }

float MucGeoGap::GetIronThickness (  )  const [inline]

Definition at line 116 of file MucGeoGap.h.

References m_IronThickness.

Referenced by RecMucTrack::ComputeDepth().

00116 { return m_IronThickness; }

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.

References kRad, m_Rotation, and x.

Referenced by ExtMucKal::GetRoationMatrix().

00324 {
00325   // Get the rotation angles (in degrees) of the gap in the global coordinate system.
00326   Hep3Vector x(m_Rotation.colX());
00327   Hep3Vector y(m_Rotation.colY());
00328   Hep3Vector z(m_Rotation.colZ());
00329 
00330   thetaX = kRad * x.theta();
00331   phiX   = kRad * x.phi();
00332   thetaY = kRad * y.theta();
00333   phiY   = kRad * y.phi();
00334   thetaZ = kRad * z.theta();
00335   phiZ   = kRad * z.phi();
00336 
00337   // cout << "Gap rotation matrix : " << endl
00338   //      << "X:  theta = " << thetaX << "  phi = " << phiX << endl
00339   //      << "Y:  theta = " << thetaY << "  phi = " << phiY << endl
00340   //      << "Z:  theta = " << thetaZ << "  phi = " << phiZ << endl;
00341 
00342   return;
00343 }

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

Get size of this gap.

Definition at line 310 of file MucGeoGap.cxx.

References m_XSize, m_YSize, and m_ZSize.

Referenced by operator<<().

00311 {
00312   // Get size of this gap.
00313   xSize = m_XSize;
00314   ySize = m_YSize;
00315   zSize = m_ZSize;
00316 
00317   return;
00318 }

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

Point to a strip within this gap.

Definition at line 294 of file MucGeoGap.cxx.

References m_pMucGeoStrip.

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

00295 {
00296   // Point to a strip within this gap.
00297   if ( strip < 0 || strip >= int(m_pMucGeoStrip.size()) ) {
00298     std::cout << "Error: MucGeoGap::GetStrip() strip " << strip << " exceed strip range" << endl;
00299     return 0;
00300   }
00301   if ( !m_pMucGeoStrip[strip] ) {
00302     std::cout << "Error: MucGeoGap::GetStrip() strip " << strip << " not found" << endl;
00303     return 0;
00304   }
00305   
00306   return m_pMucGeoStrip[strip];
00307 }

int MucGeoGap::GetStripNum (  )  const [inline]

Get number of strips in this gap.

Definition at line 114 of file MucGeoGap.h.

References m_StripNum.

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

00114 { return m_StripNum; }

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.

References MucGeoStrip::GetCenterPos(), GetStrip(), m_Orient, and m_StripNum.

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

00349 {
00350   // Given a position (gap coordinate), find the approximate strip containing the position, as there are intervals between the strips.
00351   float x0, y0, z0;  // XYZ position of the strip NO min.
00352   float xn, yn, zn;  // XYZ position of the strip NO max.
00353   float dx;          // Approximate width of a strip and a interval.
00354   int n, iGuess;           
00355 
00356   n = m_StripNum - 1;
00357 
00358   GetStrip(0)->GetCenterPos(x0, y0, z0);
00359   GetStrip(n)->GetCenterPos(xn, yn, zn);
00360 
00361   //cout << n << endl;
00362   //cout << "x0 " << x0 << " xn " << xn << " x " << x << endl;
00363   //cout << "y0 " << y0 << " yn " << yn << " y " << y << endl;
00364   //cout << "orient " << m_Orient << endl;
00365 
00366   if(m_Orient == 0){
00367     dx = (yn-y0)/n;
00368     iGuess = int ((y-y0)/dx+0.5);
00369     return iGuess;
00370   } 
00371   else{
00372     dx = (xn-x0)/n;
00373     iGuess = int ((x-x0)/dx+0.5);
00374     return iGuess;
00375   }
00376 }

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.

References kGapEdge, m_dzHighEdge, m_XSize, m_YSize, and m_ZSize.

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

00637 {
00638   // Check if the point (given in gap coordinate) is within the gap boundary.
00639   return ( ( x > -0.5*m_XSize - kGapEdge ) && ( x < 0.5*m_XSize + kGapEdge ) &&
00640            ( y > -0.5*m_YSize - kGapEdge ) && ( y < 0.5*m_YSize + kGapEdge ) &&
00641            ( z > ( m_dzHighEdge - m_ZSize ) ) && ( z < m_dzHighEdge ) );
00642 }

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

Assignment constructor.

Definition at line 223 of file MucGeoGap.cxx.

References m_Center, m_dzFarBackGas, m_dzFarFrontGas, m_dzHighEdge, m_dzNearBackGas, m_dzNearFrontGas, m_Gap, m_HitStatus, m_IronThickness, m_Orient, m_Part, m_pMucGeoStrip, m_Rotation, m_RotationT, m_Seg, m_StripNum, m_Translation, m_XSize, m_YSize, and m_ZSize.

00224 {
00225   // Assignment operator.
00226   if (this != &orig) {             // Watch out for self-assignment!
00227     m_Part       = orig.m_Part;
00228     m_Seg        = orig.m_Seg;
00229     m_Gap        = orig.m_Gap;
00230     m_StripNum    = orig.m_StripNum;
00231     m_Orient      = orig.m_Orient;
00232     m_HitStatus   = orig.m_HitStatus;
00233 
00234     m_XSize      = orig.m_XSize;
00235     m_YSize      = orig.m_YSize;
00236     m_ZSize      = orig.m_ZSize;
00237 
00238     m_dzHighEdge     = orig.m_dzHighEdge;
00239     m_dzFarFrontGas  = orig.m_dzFarFrontGas;
00240     m_dzNearFrontGas = orig.m_dzNearFrontGas;
00241     m_dzNearBackGas  = orig.m_dzNearBackGas;
00242     m_dzFarBackGas   = orig.m_dzFarBackGas;
00243 
00244 
00245     m_Center      = orig.m_Center;
00246     m_Rotation    = orig.m_Rotation;
00247     m_RotationT   = orig.m_RotationT;
00248     m_Translation = orig.m_Translation;
00249 
00250     m_IronThickness = orig.m_IronThickness;
00251 
00252     m_pMucGeoStrip = orig.m_pMucGeoStrip;
00253   }
00254   return *this;
00255 }

int MucGeoGap::Orient (  )  const [inline]

Get orientation of strips in this gap ( 0 for strips parrel to x axis, 1 for strips parrel to y axis. in gap coordinate).

Definition at line 108 of file MucGeoGap.h.

References m_Orient.

Referenced by RecMucTrack::CalculateInsct(), RecMucTrack::ComputeDistanceMatch(), MucRecTrkExt::execute(), MucRecRoadFinder::execute(), ExtMucKal::ExtMucFilter(), MucGeoGeneral::FindIntersectStrips(), ExtMucKal::GetDistance(), RecMucTrack::GetHitDistance(), MucRec2DRoad::GetHitDistance(), RecMucTrack::GetHitDistance2(), MucRecTrkExt::TrackFinding(), and MucRecRoadFinder::TrackFinding().

00108 { return m_Orient; }

int MucGeoGap::Part (  )  const [inline]

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

Definition at line 98 of file MucGeoGap.h.

References m_Part.

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

00098 { return m_Part; }

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.

References MucGeometron::GetIntersectionQuadPlane(), IsInGap(), m_Center, m_Rotation, subSeperate::temp, and TransformToGap().

00477 {
00478   // Given a line by basepoint gPoint and direction gDirection,
00479   // find the intersection with the gap (in global coordinate).
00480   Hep3Vector gapVect  = m_Rotation.colZ();
00481 
00482   HepPlane3D plane(gapVect, m_Center);
00483   MucGeometron geometron;
00484   //bool getPoint = 
00485   geometron.GetIntersectionQuadPlane(gPoint, vy, y0, a, b, c, plane, gCross1, gCross2);
00486 
00487   HepPoint3D localCross = TransformToGap(gCross1);
00488 
00489   bool found = false;
00490   bool found1 = false;
00491   bool found2 = false;
00492   HepPoint3D temp;
00493   int good = 0;
00494 
00495   if ( IsInGap(localCross.x(),
00496                localCross.y(),
00497                localCross.z()) ) {
00498     good = 1;
00499     found1 = true;
00500   }
00501 
00502   localCross = TransformToGap(gCross2);
00503   if ( IsInGap(localCross.x(),
00504                localCross.y(),
00505                localCross.z()) ) {
00506     good = 2;
00507     found2 = true;
00508   }
00509   if(found1&&found2) {
00510     float center = b/(-2*a);
00511     if(whichhalf==2){
00512       if(gCross1.x()>center) good = 1;
00513       if(gCross2.x()>center) good = 2;
00514     }
00515     if(whichhalf==1){
00516       if(gCross1.x()<center) good = 1;
00517       if(gCross2.x()<center) good = 2;
00518     }
00519   }
00520   if(good == 2) {temp = gCross1; gCross1 = gCross2; gCross2 = temp;}  //keep gCross1 be the good one!
00521   //cout<<"detail: "<<whichhalf<<" "<<gCross1<<" & "<<gCross2<<" "<<a<<" "<<b<<" "<<c<<endl;
00522 
00523   return gCross1;
00524 }

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.

References MucGeometron::GetIntersectionLinePlane(), m_Center, and m_Rotation.

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

00381 {
00382   // Given a line by basepoint gPoint and direction gDirection,
00383   // find the intersection with the gap (in global coordinate).
00384   Hep3Vector gapVect  = m_Rotation.colZ();
00385   HepPoint3D gCross(0,0,0);
00386 
00387   HepPlane3D plane(gapVect, m_Center);
00388   MucGeometron geometron;
00389   //bool getPoint = 
00390   geometron.GetIntersectionLinePlane(gPoint, gDirection, plane, gCross);
00391 
00392   return gCross;
00393 }

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.

References MucGeometron::GetIntersectionQuadPlaneLocal(), m_Center, and m_Rotation.

Referenced by MucGeoGeneral::FindIntersectionQuadLocal().

00443 {
00444   Hep3Vector gapVect, center_local;
00445   if(part == 1 && orient == 1)  {gapVect  = m_Rotation.colZ(); center_local = m_Center;}
00446   else if(part == 1 && orient == 0)  {//in this orientation, the fitting is done in local coordinate.
00447      gapVect.setX(0); gapVect.setY(1); gapVect.setZ(0);
00448      center_local.setX(0); center_local.setY(m_Center.mag()); center_local.setZ(0);
00449   }
00450   else  {//in this orientation, the fitting is done in local coordinate. 
00451      gapVect.setX(1); gapVect.setY(0); gapVect.setZ(0);
00452      center_local.setX(m_Center.z()); center_local.setY(0); center_local.setZ(0);       
00453   }
00454 
00455   //cout<<"in mucgeogap: part = "<<part<<" o: "<<orient<<" gapvect: "<<gapVect<<"  center = "<<m_Center<<endl;
00456   //cout<<"in mucgeogap: center local = "<<center_local<<endl;
00457 
00458   HepPlane3D plane(gapVect, center_local);
00459 
00460   MucGeometron geometron;
00461   geometron.GetIntersectionQuadPlaneLocal(part,orient, a, b, c, plane, gCross1, gCross2);
00462 
00463 
00464 }

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.

References CompareIntersection(), MucGeometron::GetIntersectionQuadPlane(), m_Rotation, m_SurfaceInner, and m_SurfaceOuter.

00537 {
00538   // Given a line by basepoint gPoint and direction gDirection,
00539   // find the intersection with the gap (in global coordinate).
00540 
00541   HepPoint3D cross1, cross2, cross3, cross4;
00542   
00543   Hep3Vector gapVect  = m_Rotation.colZ();
00544 
00545   HepPlane3D planeInner(gapVect, m_SurfaceInner);
00546   HepPlane3D planeOuter(gapVect, m_SurfaceOuter);
00547 
00548   MucGeometron geometron;
00549   //bool getPoint = 
00550   geometron.GetIntersectionQuadPlane(gPoint, vy, y0, a, b, c, planeInner, cross1, cross2);
00551   geometron.GetIntersectionQuadPlane(gPoint, vy, y0, a, b, c, planeOuter, cross3, cross4);
00552 
00553   gCross1 = CompareIntersection(whichhalf, cross1, cross2, a, b, c);
00554   gCross2 = CompareIntersection(whichhalf, cross3, cross4, a, b, c);
00555 
00556 }

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.

References MucGeometron::GetIntersectionLinePlane(), m_Rotation, m_SurfaceInner, and m_SurfaceOuter.

Referenced by MucGeoGeneral::FindIntersectionSurface().

00419 {
00420   // Given a line by basepoint gPoint and direction gDirection,
00421   // find the intersection with the gap (in global coordinate).
00422   Hep3Vector gapVect  = m_Rotation.colZ();
00423 
00424   HepPlane3D planeInner(gapVect, m_SurfaceInner);
00425   HepPlane3D planeOuter(gapVect, m_SurfaceOuter);
00426   MucGeometron geometron;
00427   //bool getPoint = 
00428 
00429   geometron.GetIntersectionLinePlane(gPoint, gDirection, planeInner, gCross1);
00430   geometron.GetIntersectionLinePlane(gPoint, gDirection, planeOuter, gCross2);
00431 
00432 }

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.

References MucGeometron::GetIntersectionLinePlaneWithSigma(), m_Center, and m_Rotation.

00402 {
00403   Hep3Vector gapVect  = m_Rotation.colZ();
00404 
00405   HepPlane3D plane(gapVect, m_Center);
00406   MucGeometron geometron;
00407   geometron.GetIntersectionLinePlaneWithSigma(gPoint, gDirection, gPointSigma, gDirectionSigma, plane, gCross, gCrossSigma);
00408 
00409 
00410   return gCross;
00411 } 

Hep3Vector MucGeoGap::RotateToGap ( const Hep3Vector  gVect  )  const

Rotate a vector from global coordinate to gap coordinate.

Definition at line 613 of file MucGeoGap.cxx.

References m_RotationT.

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

00614 {
00615   // Rotate a vector from Bes global coordinate to gap coordinate.
00616   return m_RotationT * gVect;
00617 }

Hep3Vector MucGeoGap::RotateToGlobal ( const Hep3Vector  pVect  )  const

Rotate a vector from gap coordinate to global coordinate.

Definition at line 606 of file MucGeoGap.cxx.

References m_Rotation.

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

00607 {
00608   // Rotate a vector from gap coordinate to Bes global coordinate.
00609   return m_Rotation * pVect;
00610 }

int MucGeoGap::Seg (  )  const [inline]

Get seg identifier (0-7).

Definition at line 101 of file MucGeoGap.h.

References m_Seg.

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

00101 { return m_Seg; }

void MucGeoGap::SetHitStatus ( const bool  hit  )  [inline]

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

Definition at line 218 of file MucGeoGap.h.

References m_HitStatus.

00218 { m_HitStatus = hit; }

HepPoint3D MucGeoGap::TransformToGap ( const HepPoint3D  gPoint  )  const

Transform a point from global coordinate to gap coordinate.

Definition at line 627 of file MucGeoGap.cxx.

References m_RotationT, and m_Translation.

Referenced by RecMucTrack::CalculateInsct(), CompareIntersection(), RecMucTrack::ComputeDistanceMatch(), ExtMucKal::ExtMucFilter(), MucGeoGeneral::FindIntersectGaps(), MucGeoGeneral::FindIntersection(), MucGeoGeneral::FindIntersectionQuadLocal(), MucGeoGeneral::FindIntersections(), MucGeoGeneral::FindIntersectStrips(), ExtMucKal::GetDistance(), RecMucTrack::GetHitDistance(), MucRec2DRoad::GetHitDistance(), RecMucTrack::GetHitDistance2(), ExtMucKal::MucKalIniti(), ProjectToGap(), and ExtSteppingAction::UserSteppingAction().

00628 {
00629   // Transform a point from Bes global coordinate to gap coordinate.
00630   return m_RotationT * (gPoint - m_Translation);
00631 }

HepPoint3D MucGeoGap::TransformToGlobal ( const HepPoint3D  pPoint  )  const

Transform a point from gap coordinate to global coordinate.

Definition at line 620 of file MucGeoGap.cxx.

References m_Rotation, and m_Translation.

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

00621 {
00622   // Transform a point from gap coordinate to Bes global coordinate.
00623   return m_Rotation * pPoint + m_Translation;
00624 }


Member Data Documentation

HepPoint3D MucGeoGap::m_Center [private]

Definition at line 241 of file MucGeoGap.h.

Referenced by GetCenter(), MucGeoGap(), operator=(), ProjectToGap(), ProjectToGapQuadLocal(), and ProjectToGapWithSigma().

float MucGeoGap::m_dzFarBackGas [private]

Definition at line 237 of file MucGeoGap.h.

Referenced by GetdzFarBackGas(), MucGeoGap(), and operator=().

float MucGeoGap::m_dzFarFrontGas [private]

Definition at line 234 of file MucGeoGap.h.

Referenced by GetdzFarFrontGas(), MucGeoGap(), and operator=().

float MucGeoGap::m_dzHighEdge [private]

Definition at line 232 of file MucGeoGap.h.

Referenced by IsInGap(), MucGeoGap(), and operator=().

float MucGeoGap::m_dzNearBackGas [private]

Definition at line 236 of file MucGeoGap.h.

Referenced by GetdzNearBackGas(), MucGeoGap(), and operator=().

float MucGeoGap::m_dzNearFrontGas [private]

Definition at line 235 of file MucGeoGap.h.

Referenced by GetdzNearFrontGas(), MucGeoGap(), and operator=().

int MucGeoGap::m_Gap [private]

Definition at line 224 of file MucGeoGap.h.

Referenced by Gap(), and operator=().

bool MucGeoGap::m_HitStatus [private]

Definition at line 227 of file MucGeoGap.h.

Referenced by GetHitStatus(), operator=(), and SetHitStatus().

float MucGeoGap::m_IronThickness [private]

Definition at line 239 of file MucGeoGap.h.

Referenced by GetIronThickness(), and operator=().

int MucGeoGap::m_Orient [private]

Definition at line 226 of file MucGeoGap.h.

Referenced by GuessStrip(), operator=(), and Orient().

int MucGeoGap::m_Part [private]

Definition at line 222 of file MucGeoGap.h.

Referenced by operator=(), and Part().

TGeoPhysicalNode* MucGeoGap::m_PhyNode [private]

Definition at line 249 of file MucGeoGap.h.

vector<MucGeoStrip*> MucGeoGap::m_pMucGeoStrip [private]

Definition at line 251 of file MucGeoGap.h.

Referenced by AddStrip(), GetStrip(), MucGeoGap(), operator=(), and ~MucGeoGap().

HepRotation MucGeoGap::m_Rotation [private]

Definition at line 242 of file MucGeoGap.h.

Referenced by GetRotationMatrix(), MucGeoGap(), operator=(), ProjectToGap(), ProjectToGapQuadLocal(), ProjectToGapSurface(), ProjectToGapWithSigma(), RotateToGlobal(), and TransformToGlobal().

HepRotation MucGeoGap::m_RotationT [private]

Definition at line 243 of file MucGeoGap.h.

Referenced by MucGeoGap(), operator=(), RotateToGap(), and TransformToGap().

int MucGeoGap::m_Seg [private]

Definition at line 223 of file MucGeoGap.h.

Referenced by operator=(), and Seg().

int MucGeoGap::m_StripNum [private]

Definition at line 225 of file MucGeoGap.h.

Referenced by AddStrip(), GetStripNum(), GuessStrip(), and operator=().

HepPoint3D MucGeoGap::m_SurfaceInner [private]

Definition at line 246 of file MucGeoGap.h.

Referenced by MucGeoGap(), and ProjectToGapSurface().

HepPoint3D MucGeoGap::m_SurfaceOuter [private]

Definition at line 247 of file MucGeoGap.h.

Referenced by MucGeoGap(), and ProjectToGapSurface().

Hep3Vector MucGeoGap::m_Translation [private]

Definition at line 244 of file MucGeoGap.h.

Referenced by MucGeoGap(), operator=(), TransformToGap(), and TransformToGlobal().

float MucGeoGap::m_XSize [private]

Definition at line 229 of file MucGeoGap.h.

Referenced by GetSize(), IsInGap(), MucGeoGap(), and operator=().

float MucGeoGap::m_YSize [private]

Definition at line 230 of file MucGeoGap.h.

Referenced by GetSize(), IsInGap(), MucGeoGap(), and operator=().

float MucGeoGap::m_ZSize [private]

Definition at line 231 of file MucGeoGap.h.

Referenced by GetSize(), IsInGap(), MucGeoGap(), and operator=().


Generated on Tue Nov 29 23:20:28 2016 for BOSS_7.0.2 by  doxygen 1.4.7