MucGeoStrip Class Reference

#include <MucGeoStrip.h>

List of all members.

Public Member Functions

 MucGeoStrip (const int strip, MucGeoGap *const pGap)
 Default constructor.
 ~MucGeoStrip ()
 Desctructor.
int Part ()
 Get Part No.
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?

Private Attributes

float m_Xmin
float m_Xmax
float m_Ymin
float m_Ymax
float m_Zmin
float m_Zmax
float m_dzFarFrontGas
float m_dzNearFrontGas
float m_dzNearBackGas
float m_dzFarBackGas
int m_Strip
MucGeoGapm_pGap
MucGeoStripm_pLeftNeighbor
MucGeoStripm_pRightNeighbor
HepPoint3D m_CenterPos
HepPoint3D m_CenterSigma
bool m_HitStatus
int m_padID


Detailed Description

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

Author:
Zhengyun You {mailto:youzy@pku.edu.cn}

Definition at line 40 of file MucGeoStrip.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 20 of file MucGeoStrip.cxx.

00021   : m_Strip(strip),
00022     m_pGap(pGap),
00023     m_pLeftNeighbor(0L),
00024     m_pRightNeighbor(0L),
00025     m_CenterPos(0.0,0.0,0.0),
00026     m_CenterSigma(0.0,0.0,0.0)
00027 {
00028   // Constructor (dummy strip position and sizes).
00029 }

MucGeoStrip::~MucGeoStrip (  ) 

Desctructor.

Definition at line 31 of file MucGeoStrip.cxx.

References m_pGap, m_pLeftNeighbor, and m_pRightNeighbor.

00032 {
00033   // Destructor.
00034   m_pLeftNeighbor = 0L;
00035   m_pRightNeighbor = 0L;
00036   m_pGap = 0L;
00037 }


Member Function Documentation

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

Does the line cross this strip?

Definition at line 166 of file MucGeoStrip.cxx.

References MucGeometron::GetIntersectionLinePlane(), m_dzFarBackGas, m_dzFarFrontGas, m_dzNearBackGas, m_dzNearFrontGas, m_Xmax, m_Xmin, m_Ymax, and m_Ymin.

Referenced by MucGeoGeneral::FindIntersectStrips().

00168 {
00169   // Does the line cross this strip?
00170 
00171   // We need to define the 6 planes then loop over to check for intersection.
00172   // All are defined in the gap coordinate.
00173   HepPlane3D stripSide[6];
00174 
00175   // Xmin.
00176   HepPoint3D p0Xmin(m_Xmin, m_Ymin, m_dzFarFrontGas);
00177   HepPoint3D p1Xmin(m_Xmin, m_Ymax, m_dzFarFrontGas);
00178   HepPoint3D p2Xmin(m_Xmin, m_Ymin, m_dzFarBackGas);
00179   HepPlane3D plane0(p0Xmin, p1Xmin, p2Xmin);
00180   stripSide[0] = plane0;
00181 
00182   // Xmax.
00183   HepPoint3D p0Xmax(m_Xmax, m_Ymin, m_dzFarFrontGas);
00184   HepPoint3D p1Xmax(m_Xmax, m_Ymax, m_dzFarFrontGas);
00185   HepPoint3D p2Xmax(m_Xmax, m_Ymin, m_dzFarBackGas);
00186   HepPlane3D plane1(p0Xmax, p1Xmax, p2Xmax);
00187   stripSide[1] = plane1;
00188 
00189   // Ymin.
00190   HepPoint3D p0Ymin(m_Xmin, m_Ymin, m_dzFarFrontGas);
00191   HepPoint3D p1Ymin(m_Xmax, m_Ymin, m_dzFarFrontGas);
00192   HepPoint3D p2Ymin(m_Xmin, m_Ymin, m_dzFarBackGas);
00193   HepPlane3D plane2(p0Ymin, p1Ymin, p2Ymin);
00194   stripSide[2] = plane2;
00195 
00196   // Ymax.
00197   HepPoint3D p0Ymax(m_Xmin, m_Ymax, m_dzFarFrontGas);
00198   HepPoint3D p1Ymax(m_Xmax, m_Ymax, m_dzFarFrontGas);
00199   HepPoint3D p2Ymax(m_Xmin, m_Ymax, m_dzFarBackGas);
00200   HepPlane3D plane3(p0Ymax, p1Ymax, p2Ymax);
00201   stripSide[3] = plane3;
00202 
00203   // Zmin.
00204   HepPoint3D p0Zmin(m_Xmin, m_Ymin, m_dzFarFrontGas);
00205   HepPoint3D p1Zmin(m_Xmax, m_Ymin, m_dzFarFrontGas);
00206   HepPoint3D p2Zmin(m_Xmin, m_Ymax, m_dzFarFrontGas);
00207   HepPlane3D plane4(p0Zmin, p1Zmin, p2Zmin);
00208   stripSide[4] = plane4;
00209 
00210   // Zmax.
00211   HepPoint3D p0Zmax(m_Xmin, m_Ymin, m_dzFarBackGas);
00212   HepPoint3D p1Zmax(m_Xmax, m_Ymin, m_dzFarBackGas);
00213   HepPoint3D p2Zmax(m_Xmin, m_Ymax, m_dzFarBackGas);
00214   HepPlane3D plane5(p0Zmax, p1Zmax, p2Zmax);
00215   stripSide[5] = plane5;
00216 
00217   //cout << m_Xmin << "  " << m_Xmax << endl
00218   //   << m_Ymin << "  " << m_Ymax << endl
00219   //   << m_dzFarFrontGas << "  " << m_dzFarBackGas << endl;
00220     
00221   //If particle intersects this strip there should only be two crossings.
00222   int numIntersections = 0;
00223   MucGeometron geometron;
00224   bool intersectFlag = 0;
00225   HepPoint3D gCross(0,0,0);
00226 
00227   for (int sideID = 0; sideID<6; sideID++)
00228   {
00229     intersectFlag = geometron.GetIntersectionLinePlane(linePoint, 
00230                                                        lineDir,
00231                                                        stripSide[sideID],
00232                                                        gCross);
00233     if( intersectFlag && 
00234   ( gCross.x() >= m_Xmin - 1) &&  // expend strip size, to avoid gap between two strip
00235   ( gCross.x() <= m_Xmax + 1) &&
00236   ( gCross.y() >= m_Ymin - 1) &&
00237   ( gCross.y() <= m_Ymax + 1) &&
00238   ( ( gCross.z() >= m_dzFarFrontGas && gCross.z() <= m_dzNearFrontGas ) ||
00239           ( gCross.z() >= m_dzNearBackGas && gCross.z() <= m_dzFarBackGas) ) ) {
00240       numIntersections++;
00241       //cout << m_StripID.GetStrip() << gCross << endl;
00242     }
00243   }
00244 
00245   //if( numIntersections == 1 ) {
00246   //  cout<<"MucGeoStrip::IntersectStrip(): Warning only one intersection.  Should be two!" << endl;
00247   //}
00248   
00249   if( numIntersections > 2 ) {
00250 //    cout<<"MucGeoStrip::CrossGasChamber(): Warning too many intersections " 
00251 //      << numIntersections 
00252 //      << endl;
00253   }
00254 
00255   if( numIntersections > 0 ) return true;
00256   
00257   return false;
00258 }

int MucGeoStrip::Gap (  )  [inline]

Get Gap No.

Definition at line 59 of file MucGeoStrip.h.

References MucGeoGap::Gap(), and m_pGap.

00059 { return m_pGap->Gap(); }

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

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

Definition at line 40 of file MucGeoStrip.cxx.

References m_CenterPos.

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

00041 {
00042   // Get center position of this strip (in the gap coordinate system).
00043   x = m_CenterPos.x();
00044   y = m_CenterPos.y();
00045   z = m_CenterPos.z();
00046   
00047   return;
00048 }

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 51 of file MucGeoStrip.cxx.

References m_CenterSigma.

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

00052 {
00053   // Get uncertainty in the position of this strip (in the gap coordinate system).
00054   sx = m_CenterSigma.x();
00055   sy = m_CenterSigma.y();
00056   sz = m_CenterSigma.z();
00057  
00058   return;
00059 }

MucGeoGap* MucGeoStrip::GetGap (  )  const [inline]

Get the pointer to the gap that contains the strip.

Definition at line 65 of file MucGeoStrip.h.

References m_pGap.

Referenced by main(), and SetStrip().

00065 { return m_pGap; }

bool MucGeoStrip::GetHitStatus (  )  const [inline]

Get the strip hit status.

Definition at line 98 of file MucGeoStrip.h.

References m_HitStatus.

00098 { return m_HitStatus; }

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.

References m_pLeftNeighbor.

00068 { return m_pLeftNeighbor; }

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.

References m_pRightNeighbor.

00071 { return m_pRightNeighbor; }

float MucGeoStrip::GetXmax (  )  const [inline]

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

Definition at line 77 of file MucGeoStrip.h.

References m_Xmax.

Referenced by MucGeoGeneral::FindIntersectStrips().

00077 { return m_Xmax; }

float MucGeoStrip::GetXmin (  )  const [inline]

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

Definition at line 74 of file MucGeoStrip.h.

References m_Xmin.

Referenced by MucGeoGeneral::FindIntersectStrips().

00074 { return m_Xmin; }

float MucGeoStrip::GetYmax (  )  const [inline]

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

Definition at line 83 of file MucGeoStrip.h.

References m_Ymax.

Referenced by MucGeoGeneral::FindIntersectStrips().

00083 { return m_Ymax; }

float MucGeoStrip::GetYmin (  )  const [inline]

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

Definition at line 80 of file MucGeoStrip.h.

References m_Ymin.

Referenced by MucGeoGeneral::FindIntersectStrips().

00080 { return m_Ymin; }

float MucGeoStrip::GetZmax (  )  const [inline]

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

Definition at line 89 of file MucGeoStrip.h.

References m_Zmax.

00089 { return m_Zmax; }

float MucGeoStrip::GetZmin (  )  const [inline]

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

Definition at line 86 of file MucGeoStrip.h.

References m_Zmin.

00086 { return m_Zmin; }

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 153 of file MucGeoStrip.cxx.

References m_dzFarBackGas, m_dzFarFrontGas, m_Xmax, m_Xmin, m_Ymax, and m_Ymin.

00156 {
00157   // Is the point within the boundaries of this strip?
00158   return ( (x > m_Xmin) && (x < m_Xmax) 
00159            && (y > m_Ymin) && (y < m_Ymax)
00160            && (z >= m_dzFarFrontGas)
00161            && (z <= m_dzFarBackGas) );
00162 }

int MucGeoStrip::Part (  )  [inline]

Get Part No.

Definition at line 53 of file MucGeoStrip.h.

References m_pGap, and MucGeoGap::Part().

00053 { return m_pGap->Part(); }

int MucGeoStrip::Seg (  )  [inline]

Get Seg No.

Definition at line 56 of file MucGeoStrip.h.

References m_pGap, and MucGeoGap::Seg().

00056 { return m_pGap->Seg(); }

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

Set the strip hit status.

Definition at line 119 of file MucGeoStrip.h.

References m_HitStatus.

00119 { m_HitStatus = hit; }

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 135 of file MucGeoStrip.cxx.

References m_pLeftNeighbor.

Referenced by MucGeoGap::AddStrip().

00136 {
00138   // (0 if no neighbor in this gap).
00139   if (p)
00140     m_pLeftNeighbor = p;
00141 }

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 144 of file MucGeoStrip.cxx.

References m_pRightNeighbor.

Referenced by MucGeoGap::AddStrip().

00145 {
00147   // (0 if no neighbor in this gap).
00148   if (p)
00149     m_pRightNeighbor = p;
00150 }

void MucGeoStrip::SetStrip ( TGeoPhysicalNode *  stripPhysicalNode  ) 

Set strip from ROOT.

Definition at line 93 of file MucGeoStrip.cxx.

References MucGeoGap::GetdzFarBackGas(), MucGeoGap::GetdzFarFrontGas(), MucGeoGap::GetdzNearBackGas(), MucGeoGap::GetdzNearFrontGas(), GetGap(), genRecEmupikp::i, m_CenterPos, m_CenterSigma, m_dzFarBackGas, m_dzFarFrontGas, m_dzNearBackGas, m_dzNearFrontGas, m_Xmax, m_Xmin, m_Ymax, m_Ymin, m_Zmax, and m_Zmin.

00094 {
00095   // Set the edge, center and sigma of the strip (in the gap coordinate system).
00096   double un = 1.0;  // Uncertainty.
00097  
00098   TGeoBBox *stripBox = (TGeoBBox*)stripPhysicalNode->GetShape();
00099  
00100   double xSize = 2.0 * stripBox->GetDX();
00101   double ySize = 2.0 * stripBox->GetDY();
00102   double zSize = 2.0 * stripBox->GetDZ();
00103   
00104   m_dzFarFrontGas  = GetGap()->GetdzFarFrontGas(); 
00105   m_dzNearFrontGas = GetGap()->GetdzNearFrontGas(); 
00106   m_dzNearBackGas  = GetGap()->GetdzNearBackGas(); 
00107   m_dzFarBackGas   = GetGap()->GetdzFarBackGas(); 
00108 
00109   double eTrans[3], *pTrans;
00110   pTrans = eTrans;
00111   //int level = stripPhysicalNode->GetLevel();
00112   double eLocal[3], *pLocal;
00113   pLocal = eLocal;
00114   for (int i = 0; i < 3; i++) pLocal[i] = 0.0;
00115   stripPhysicalNode->GetNode()->LocalToMaster(pLocal, pTrans);
00116   
00117   m_CenterPos.setX( pTrans[0] );
00118   m_CenterPos.setY( pTrans[1] );
00119   m_CenterPos.setZ( pTrans[2] );
00120 
00121   m_Xmin = pTrans[0] - 0.5 * xSize;
00122   m_Xmax = pTrans[0] + 0.5 * xSize;
00123   m_Ymin = pTrans[1] - 0.5 * ySize;
00124   m_Ymax = pTrans[1] + 0.5 * ySize;
00125   m_Zmin = pTrans[2] - 0.5 * zSize;
00126   m_Zmax = pTrans[2] + 0.5 * zSize;
00127 
00128   m_CenterSigma.setX(un*xSize);
00129   m_CenterSigma.setY(un*ySize);
00130   m_CenterSigma.setZ(un*zSize);
00131   //cout << m_CenterPos << endl;
00132 }

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 62 of file MucGeoStrip.cxx.

References MucGeoGap::GetdzFarBackGas(), MucGeoGap::GetdzFarFrontGas(), MucGeoGap::GetdzNearBackGas(), MucGeoGap::GetdzNearFrontGas(), GetGap(), m_CenterPos, m_CenterSigma, m_dzFarBackGas, m_dzFarFrontGas, m_dzNearBackGas, m_dzNearFrontGas, m_Xmax, m_Xmin, m_Ymax, m_Ymin, m_Zmax, and m_Zmin.

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

00067 {
00068   // Set the edge, center and sigma of the strip (in the gap coordinate system).
00069   double un = 1.0;  // Uncertainty.
00070   
00071   m_Xmin = x1;
00072   m_Xmax = x2;
00073   m_Ymin = y1;
00074   m_Ymax = y2;
00075   m_Zmin = -0.5*zSize;
00076   m_Zmax =  0.5*zSize;
00077 
00078   m_dzFarFrontGas  = GetGap()->GetdzFarFrontGas(); 
00079   m_dzNearFrontGas = GetGap()->GetdzNearFrontGas(); 
00080   m_dzNearBackGas  = GetGap()->GetdzNearBackGas(); 
00081   m_dzFarBackGas   = GetGap()->GetdzFarBackGas(); 
00082 
00083   m_CenterPos.setX(0.5*(m_Xmin + m_Xmax));
00084   m_CenterPos.setY(0.5*(m_Ymin + m_Ymax));
00085   m_CenterPos.setZ(0.0);
00086 
00087   m_CenterSigma.setX(un*xSize);
00088   m_CenterSigma.setY(un*ySize);
00089   m_CenterSigma.setZ(un*zSize);
00090 }

int MucGeoStrip::Strip (  )  [inline]

Get Strip No.

Definition at line 62 of file MucGeoStrip.h.

References m_Strip.

00062 { return m_Strip; }


Member Data Documentation

HepPoint3D MucGeoStrip::m_CenterPos [private]

Definition at line 147 of file MucGeoStrip.h.

Referenced by GetCenterPos(), and SetStrip().

HepPoint3D MucGeoStrip::m_CenterSigma [private]

Definition at line 148 of file MucGeoStrip.h.

Referenced by GetCenterSigma(), and SetStrip().

float MucGeoStrip::m_dzFarBackGas [private]

Definition at line 139 of file MucGeoStrip.h.

Referenced by CrossGasChamber(), IsInStrip(), and SetStrip().

float MucGeoStrip::m_dzFarFrontGas [private]

Definition at line 136 of file MucGeoStrip.h.

Referenced by CrossGasChamber(), IsInStrip(), and SetStrip().

float MucGeoStrip::m_dzNearBackGas [private]

Definition at line 138 of file MucGeoStrip.h.

Referenced by CrossGasChamber(), and SetStrip().

float MucGeoStrip::m_dzNearFrontGas [private]

Definition at line 137 of file MucGeoStrip.h.

Referenced by CrossGasChamber(), and SetStrip().

bool MucGeoStrip::m_HitStatus [private]

Definition at line 149 of file MucGeoStrip.h.

Referenced by GetHitStatus(), and SetHitStatus().

int MucGeoStrip::m_padID [private]

Definition at line 151 of file MucGeoStrip.h.

MucGeoGap* MucGeoStrip::m_pGap [private]

Definition at line 143 of file MucGeoStrip.h.

Referenced by Gap(), GetGap(), Part(), Seg(), and ~MucGeoStrip().

MucGeoStrip* MucGeoStrip::m_pLeftNeighbor [private]

Definition at line 144 of file MucGeoStrip.h.

Referenced by GetLeftNeighbor(), SetLeftNeighbor(), and ~MucGeoStrip().

MucGeoStrip* MucGeoStrip::m_pRightNeighbor [private]

Definition at line 145 of file MucGeoStrip.h.

Referenced by GetRightNeighbor(), SetRightNeighbor(), and ~MucGeoStrip().

int MucGeoStrip::m_Strip [private]

Definition at line 142 of file MucGeoStrip.h.

Referenced by Strip().

float MucGeoStrip::m_Xmax [private]

Definition at line 130 of file MucGeoStrip.h.

Referenced by CrossGasChamber(), GetXmax(), IsInStrip(), and SetStrip().

float MucGeoStrip::m_Xmin [private]

Definition at line 129 of file MucGeoStrip.h.

Referenced by CrossGasChamber(), GetXmin(), IsInStrip(), and SetStrip().

float MucGeoStrip::m_Ymax [private]

Definition at line 132 of file MucGeoStrip.h.

Referenced by CrossGasChamber(), GetYmax(), IsInStrip(), and SetStrip().

float MucGeoStrip::m_Ymin [private]

Definition at line 131 of file MucGeoStrip.h.

Referenced by CrossGasChamber(), GetYmin(), IsInStrip(), and SetStrip().

float MucGeoStrip::m_Zmax [private]

Definition at line 134 of file MucGeoStrip.h.

Referenced by GetZmax(), and SetStrip().

float MucGeoStrip::m_Zmin [private]

Definition at line 133 of file MucGeoStrip.h.

Referenced by GetZmin(), and SetStrip().


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