BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MucGeoGeneral Class Reference

#include <MucGeoGeneral.h>

Public Member Functions

 MucGeoGeneral ()
 Constructor.
MucGeoGeneraloperator= (const MucGeoGeneral &orig)
 Assignment constructor.
 MucGeoGeneral (const MucGeoGeneral &orig)
 Copy constructor.
 ~MucGeoGeneral ()
 Destructor.
void Init ()
 Initialize the instance of MucGeoGeneral.
void InitFromDatabase ()
 Initialize from database.
void InitFromASCII ()
 Initialize form ASCII.
void InitFromXML ()
 Initialize from xml.
void Destroy ()
 Destroy the single instance of MucGeoGeneral.
MucGeoGapGetGap (const int part, const int seg, const int gap) const
 Get a pointer to the gap identified by (part,seg,gap).
MucGeoGapGetGap (const Identifier id) const
 Get a pointer to the gap identified by Indentifier.
MucGeoStripGetStrip (const int part, const int seg, const int gap, const int strip) const
 Get a pointer to the strip identified by (part,seg,gap,strip).
MucGeoStripGetStrip (const Identifier id) const
 Get a pointer to the strip identified by Indentifier.
int GetStripNumInGap (const int part, const int seg, const int gap)
int GetStripNumTotal ()
 Get total number of strips.
vector< IdentifierFindIntersectGaps (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
vector< IdentifierFindIntersectStrips (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
vector< IdentifierFindIntersectStrips (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection, vector< int > &padID, vector< float > &intersection_x, vector< float > &intersection_y, vector< float > &intersection_z)
vector< HepPoint3DFindIntersections (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
void FindIntersection (const int part, const int seg, const int gap, const float vx, const float vy, const float vz, const float x0, const float y0, const float z0, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x, float &y, float &z, float &sigmaX, float &sigmaY, float &sigmaZ)
void FindIntersectionQuadLocal (const int part, const int seg, const int gap, const float a, const float b, const float c, const int whichhalf, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX, float &sigmaY, float &sigmaZ)
void FindIntersection (const int part, const int seg, const int gap, const float vy, const float x0, const float y0, const float z0, const float a, const float b, const float c, const int whichhalf, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX, float &sigmaY, float &sigmaZ)
void FindIntersectionSurface (const int part, const int seg, const int gap, const float vx, const float vy, const float vz, const float x0, const float y0, const float z0, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX1, float &sigmaY1, float &sigmaZ1, float &sigmaX2, float &sigmaY2, float &sigmaZ2)
void FindIntersectionSurface (const int part, const int seg, const int gap, const float vy, const float x0, const float y0, const float z0, const float a, const float b, const float c, const int whichhalf, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX, float &sigmaY, float &sigmaZ)
void Clear ()
 Clear the fgpMucGeoGap and fgpMucGeoStrip vector containers.
 MucGeoGeneral ()
 Constructor.
MucGeoGeneraloperator= (const MucGeoGeneral &orig)
 Assignment constructor.
 MucGeoGeneral (const MucGeoGeneral &orig)
 Copy constructor.
 ~MucGeoGeneral ()
 Destructor.
void Init ()
 Initialize the instance of MucGeoGeneral.
void InitFromDatabase ()
 Initialize from database.
void InitFromASCII ()
 Initialize form ASCII.
void InitFromXML ()
 Initialize from xml.
void Destroy ()
 Destroy the single instance of MucGeoGeneral.
MucGeoGapGetGap (const int part, const int seg, const int gap) const
 Get a pointer to the gap identified by (part,seg,gap).
MucGeoGapGetGap (const Identifier id) const
 Get a pointer to the gap identified by Indentifier.
MucGeoStripGetStrip (const int part, const int seg, const int gap, const int strip) const
 Get a pointer to the strip identified by (part,seg,gap,strip).
MucGeoStripGetStrip (const Identifier id) const
 Get a pointer to the strip identified by Indentifier.
int GetStripNumInGap (const int part, const int seg, const int gap)
int GetStripNumTotal ()
 Get total number of strips.
vector< IdentifierFindIntersectGaps (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
vector< IdentifierFindIntersectStrips (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
vector< IdentifierFindIntersectStrips (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection, vector< int > &padID, vector< float > &intersection_x, vector< float > &intersection_y, vector< float > &intersection_z)
vector< HepPoint3DFindIntersections (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
void FindIntersection (const int part, const int seg, const int gap, const float vx, const float vy, const float vz, const float x0, const float y0, const float z0, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x, float &y, float &z, float &sigmaX, float &sigmaY, float &sigmaZ)
void FindIntersectionQuadLocal (const int part, const int seg, const int gap, const float a, const float b, const float c, const int whichhalf, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX, float &sigmaY, float &sigmaZ)
void FindIntersection (const int part, const int seg, const int gap, const float vy, const float x0, const float y0, const float z0, const float a, const float b, const float c, const int whichhalf, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX, float &sigmaY, float &sigmaZ)
void FindIntersectionSurface (const int part, const int seg, const int gap, const float vx, const float vy, const float vz, const float x0, const float y0, const float z0, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX1, float &sigmaY1, float &sigmaZ1, float &sigmaX2, float &sigmaY2, float &sigmaZ2)
void FindIntersectionSurface (const int part, const int seg, const int gap, const float vy, const float x0, const float y0, const float z0, const float a, const float b, const float c, const int whichhalf, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX, float &sigmaY, float &sigmaZ)
void Clear ()
 Clear the fgpMucGeoGap and fgpMucGeoStrip vector containers.
 MucGeoGeneral ()
 Constructor.
MucGeoGeneraloperator= (const MucGeoGeneral &orig)
 Assignment constructor.
 MucGeoGeneral (const MucGeoGeneral &orig)
 Copy constructor.
 ~MucGeoGeneral ()
 Destructor.
void Init ()
 Initialize the instance of MucGeoGeneral.
void InitFromDatabase ()
 Initialize from database.
void InitFromASCII ()
 Initialize form ASCII.
void InitFromXML ()
 Initialize from xml.
void Destroy ()
 Destroy the single instance of MucGeoGeneral.
MucGeoGapGetGap (const int part, const int seg, const int gap) const
 Get a pointer to the gap identified by (part,seg,gap).
MucGeoGapGetGap (const Identifier id) const
 Get a pointer to the gap identified by Indentifier.
MucGeoStripGetStrip (const int part, const int seg, const int gap, const int strip) const
 Get a pointer to the strip identified by (part,seg,gap,strip).
MucGeoStripGetStrip (const Identifier id) const
 Get a pointer to the strip identified by Indentifier.
int GetStripNumInGap (const int part, const int seg, const int gap)
int GetStripNumTotal ()
 Get total number of strips.
vector< IdentifierFindIntersectGaps (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
vector< IdentifierFindIntersectStrips (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
vector< IdentifierFindIntersectStrips (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection, vector< int > &padID, vector< float > &intersection_x, vector< float > &intersection_y, vector< float > &intersection_z)
vector< HepPoint3DFindIntersections (const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
void FindIntersection (const int part, const int seg, const int gap, const float vx, const float vy, const float vz, const float x0, const float y0, const float z0, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x, float &y, float &z, float &sigmaX, float &sigmaY, float &sigmaZ)
void FindIntersectionQuadLocal (const int part, const int seg, const int gap, const float a, const float b, const float c, const int whichhalf, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX, float &sigmaY, float &sigmaZ)
void FindIntersection (const int part, const int seg, const int gap, const float vy, const float x0, const float y0, const float z0, const float a, const float b, const float c, const int whichhalf, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX, float &sigmaY, float &sigmaZ)
void FindIntersectionSurface (const int part, const int seg, const int gap, const float vx, const float vy, const float vz, const float x0, const float y0, const float z0, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX1, float &sigmaY1, float &sigmaZ1, float &sigmaX2, float &sigmaY2, float &sigmaZ2)
void FindIntersectionSurface (const int part, const int seg, const int gap, const float vy, const float x0, const float y0, const float z0, const float a, const float b, const float c, const int whichhalf, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2, float &sigmaX, float &sigmaY, float &sigmaZ)
void Clear ()
 Clear the fgpMucGeoGap and fgpMucGeoStrip vector containers.

Static Public Member Functions

static MucGeoGeneralInstance ()
 Get a pointer to the single instance of MucGeoGeneral.
static MucGeoGeneralInstance ()
 Get a pointer to the single instance of MucGeoGeneral.
static MucGeoGeneralInstance ()
 Get a pointer to the single instance of MucGeoGeneral.

Detailed Description

Class MucGeoGeneral contains all of the objects necessary to describe the muon chamber geometry.

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

Definition at line 50 of file InstallArea/x86_64-el9-gcc13-dbg/include/MucGeomSvc/MucGeoGeneral.h.

Constructor & Destructor Documentation

◆ MucGeoGeneral() [1/6]

MucGeoGeneral::MucGeoGeneral ( )

Constructor.

Definition at line 37 of file MucGeoGeneral.cxx.

37 {
38 // Default constructor.
39}

Referenced by Clear(), Destroy(), Instance(), MucGeoGeneral(), and operator=().

◆ MucGeoGeneral() [2/6]

MucGeoGeneral::MucGeoGeneral ( const MucGeoGeneral & orig)

Copy constructor.

◆ ~MucGeoGeneral() [1/3]

MucGeoGeneral::~MucGeoGeneral ( )

Destructor.

Definition at line 41 of file MucGeoGeneral.cxx.

41 {
42 // Destructor.
43 MucGeoGap* pGap = 0;
44 while ( m_gpMucGeoGap.size() > 0 )
45 {
46 map<Identifier, MucGeoGap*>::iterator iter = m_gpMucGeoGap.end();
47 pGap = ( *iter ).second;
48 delete pGap;
49 m_gpMucGeoGap.erase( iter );
50 }
51
52 MucGeoStrip* pStrip = 0;
53 while ( m_gpMucGeoStrip.size() > 0 )
54 {
55 map<Identifier, MucGeoStrip*>::iterator iter = m_gpMucGeoStrip.end();
56 pStrip = ( *iter ).second;
57 delete pStrip;
58 m_gpMucGeoStrip.erase( iter );
59 }
60}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)

◆ MucGeoGeneral() [3/6]

MucGeoGeneral::MucGeoGeneral ( )

Constructor.

◆ MucGeoGeneral() [4/6]

MucGeoGeneral::MucGeoGeneral ( const MucGeoGeneral & orig)

Copy constructor.

◆ ~MucGeoGeneral() [2/3]

MucGeoGeneral::~MucGeoGeneral ( )

Destructor.

◆ MucGeoGeneral() [5/6]

MucGeoGeneral::MucGeoGeneral ( )

Constructor.

◆ MucGeoGeneral() [6/6]

MucGeoGeneral::MucGeoGeneral ( const MucGeoGeneral & orig)

Copy constructor.

◆ ~MucGeoGeneral() [3/3]

MucGeoGeneral::~MucGeoGeneral ( )

Destructor.

Member Function Documentation

◆ Clear() [1/3]

void MucGeoGeneral::Clear ( )

Clear the fgpMucGeoGap and fgpMucGeoStrip vector containers.

◆ Clear() [2/3]

void MucGeoGeneral::Clear ( )

Clear the fgpMucGeoGap and fgpMucGeoStrip vector containers.

◆ Clear() [3/3]

void MucGeoGeneral::Clear ( )

Clear the fgpMucGeoGap and fgpMucGeoStrip vector containers.

◆ Destroy() [1/3]

void MucGeoGeneral::Destroy ( )

Destroy the single instance of MucGeoGeneral.

◆ Destroy() [2/3]

void MucGeoGeneral::Destroy ( )

Destroy the single instance of MucGeoGeneral.

◆ Destroy() [3/3]

void MucGeoGeneral::Destroy ( )

Destroy the single instance of MucGeoGeneral.

◆ FindIntersectGaps() [1/3]

vector< Identifier > MucGeoGeneral::FindIntersectGaps ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection )

Find the intersect gap of a trajectory with the given part and gap. The trajectory is given by the position and direction in global coordinate.

Definition at line 477 of file MucGeoGeneral.cxx.

479 {
480 // Find the intersect gap of a trajectory with the given part and gap. The trajectory is
481 // given by the position gPoint and direction gDirection in global coordinate.
482 vector<Identifier> gapList;
483
484 MucGeoGap* pGap = 0;
485 Identifier id = MucID::channel_id( 0, 0, 0, 0 );
486 HepPoint3D intersection, localIntersection;
487 Hep3Vector intersectionDir;
488 double cos = -1;
489
490 for ( unsigned int seg = 0; seg < MucID::getSegNum( part ); seg++ )
491 {
492 id = MucID::channel_id( part, seg, gap, 0 );
493 pGap = GetGap( id );
494 if ( pGap )
495 {
496 intersection = pGap->ProjectToGap( gPoint, gDirection );
497 localIntersection = pGap->TransformToGap( intersection );
498
499 intersectionDir = ( (CLHEP::Hep3Vector)intersection ) - ( (CLHEP::Hep3Vector)gPoint );
500 if ( intersectionDir.mag() == 0 ) { cos = 0.0; }
501 else
502 {
503 cos = intersectionDir.dot( gDirection ) / ( intersectionDir.mag() * gDirection.mag() );
504 }
505
506 if ( ( cos >= 0.0 ) && ( pGap->IsInGap( localIntersection.x(), localIntersection.y(),
507 localIntersection.z() ) ) )
508 {
509 id = MucID::channel_id( part, seg, gap, 0 );
510 gapList.push_back( id );
511 }
512 else {}
513 }
514 else
515 {
516 std::cout << "MucGeoGeneral::FindIntersectGaps(), Bad gap Pointer"
517 << " part " << part << " seg " << seg << " gap " << gap << std::endl;
518 }
519 }
520
521 return gapList;
522}
int intersection(const HepPoint3D &c1, double r1, const HepPoint3D &c2, double r2, double eps, HepPoint3D &x1, HepPoint3D &x2)
Circle utilities.
Definition TMDCUtil.cxx:93
HepGeom::Point3D< double > HepPoint3D
HepPoint3D ProjectToGap(const HepPoint3D gPoint, const Hep3Vector gVect) const
Given a line, find the intersection with the gap in the global.
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.
MucGeoGap * GetGap(const int part, const int seg, const int gap) const
Get a pointer to the gap identified by (part,seg,gap).
static Identifier channel_id(int barrel_ec, int segment, int layer, int channel)
For a single crystal.
Definition MucID.cxx:114
static value_type getSegNum(int part)
Definition MucID.cxx:134

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

◆ FindIntersectGaps() [2/3]

vector< Identifier > MucGeoGeneral::FindIntersectGaps ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection )

Find the intersect gap of a trajectory with the given part and gap. The trajectory is given by the position and direction in global coordinate.

◆ FindIntersectGaps() [3/3]

vector< Identifier > MucGeoGeneral::FindIntersectGaps ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection )

Find the intersect gap of a trajectory with the given part and gap. The trajectory is given by the position and direction in global coordinate.

◆ FindIntersection() [1/6]

void MucGeoGeneral::FindIntersection ( const int part,
const int seg,
const int gap,
const float vx,
const float vy,
const float vz,
const float x0,
const float y0,
const float z0,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x,
float & y,
float & z,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

Find the intersection position of a trajectory with the given gap. The trajectory is given by unit vector (vx,vy,vz) and intercept (x0,y0,z0) in global coordinates, such that (x-x0)/vx = (y-y0)/vy = (z-z0)/vz . If more than one seg lies along the trajectory, take the first one intersect with the trajectory.

Definition at line 729 of file MucGeoGeneral.cxx.

736 {
737 x = 0.0;
738 sigmaX = 0.0;
739 y = 0.0;
740 sigmaY = 0.0;
741 z = 0.0;
742 sigmaZ = 0.0;
743
744 if ( ( part < 0 ) || ( part >= (int)MucID::getPartNum() ) )
745 {
746 cout << "MucGeoGeneral::FindIntersection-E101 invalid part = " << part << endl;
747 return;
748 }
749
750 if ( ( gap < 0 ) || ( gap >= (int)MucID::getGapNum( part ) ) )
751 {
752 // cout << "MucGeoGeneral::FindIntersection-E102 invalid gap = "
753 // << gap << endl;
754 return;
755 }
756
757 // "Brute-force" algorithm.
758 // 1a. Find intersection with gap.
759 // 1b. Transform intersection position to gap coords.
760 // 2. Check intersection position against gap boundaries.
761 // Save the intersection position and gap id if within
762 // boundaries.
763
764 // bool found = false;
765 float distance = 1e30;
766
767 MucGeoGap* p = GetGap( part, seg, gap );
768 if ( p )
769 {
770
771 Hep3Vector v( vx, vy, vz );
772 HepPoint3D r0( x0, y0, z0 ); // MucGeoGeneral::FindIntersection
773
774 // Hep3Vector vSigma(sigmaVx, sigmaVy, sigmaVz);
775 // HepPoint3D r0Sigma(sigmaX0, sigmaY0, sigmaZ0);
776
777 // HepPoint3D gCross(0.0, 0.0, 0.0);
778 // HepPoint3D gCrossSigma(0.0, 0.0, 0.0);
779 // cout <<"in MucGeoGeneral v ro"<< v << r0 << endl;
780 // HepPoint3D r = p->ProjectToGapWithSigma(r0, v, r0Sigma, vSigma, gCross, gCrossSigma);
781 HepPoint3D r = p->ProjectToGap( r0, v );
782 HepPoint3D localIntersection = p->TransformToGap( r );
783 // cout << "intersect gap point " << r << " local " << localIntersection << endl;
784
785 distance = r.distance( r0 );
786
787 x = r.x();
788 y = r.y();
789 z = r.z();
790
791 // sigmaX = gCrossSigma.x();
792 // sigmaY = gCrossSigma.y();
793 // sigmaZ = gCrossSigma.z();
794
795 // Should be in Gap?
796 // No, return intersection position however.
797
798 // if ( p->IsInGap(localIntersection.x(),
799 // localIntersection.y(),
800 // localIntersection.z()) ) {
801 // cout << "found project in gap" << endl;
802 // found = true;
803 // }
804 // else{
805 // cout << " not in gap" << endl;
806 // }
807 }
808
809 else
810 {
811 cout << "FindIntersection-E103 bad panel pointer!"
812 << " Part" << part << " Seg" << seg << " Gap" << gap << endl;
813 }
814
815 // FIXME: need a calculation of the uncertainty in the intercept!
816
817 return;
818}
Double_t x[10]
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35
static value_type getPartNum()
Definition MucID.cxx:131
static value_type getGapNum(int part)
Definition MucID.cxx:141

Referenced by MucRec2DRoad::GetSearchWindowSize(), MucRec2DRoad::Project(), MucRec3DRoad::Project(), MucRec3DRoad::ProjectNoCurrentGap(), and MucRec3DRoad::ProjectWithSigma().

◆ FindIntersection() [2/6]

void MucGeoGeneral::FindIntersection ( const int part,
const int seg,
const int gap,
const float vx,
const float vy,
const float vz,
const float x0,
const float y0,
const float z0,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x,
float & y,
float & z,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

Find the intersection position of a trajectory with the given gap. The trajectory is given by unit vector (vx,vy,vz) and intercept (x0,y0,z0) in global coordinates, such that (x-x0)/vx = (y-y0)/vy = (z-z0)/vz . If more than one seg lies along the trajectory, take the first one intersect with the trajectory.

◆ FindIntersection() [3/6]

void MucGeoGeneral::FindIntersection ( const int part,
const int seg,
const int gap,
const float vx,
const float vy,
const float vz,
const float x0,
const float y0,
const float z0,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x,
float & y,
float & z,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

Find the intersection position of a trajectory with the given gap. The trajectory is given by unit vector (vx,vy,vz) and intercept (x0,y0,z0) in global coordinates, such that (x-x0)/vx = (y-y0)/vy = (z-z0)/vz . If more than one seg lies along the trajectory, take the first one intersect with the trajectory.

◆ FindIntersection() [4/6]

void MucGeoGeneral::FindIntersection ( const int part,
const int seg,
const int gap,
const float vy,
const float x0,
const float y0,
const float z0,
const float a,
const float b,
const float c,
const int whichhalf,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

Find the intersection position of a trajectory with the given gap. The trajectory is given by a parabola and a line in global coordinates, If more than one seg lies along the trajectory, take the first one whichhalf help to judge which intersection position is better, x1,y1,z1 return the better one . now reserver x2,y2,z2 temp.

Definition at line 903 of file MucGeoGeneral.cxx.

916 {
917 x1 = 0.0;
918 sigmaX = 0.0;
919 x2 = 0.0;
920 y1 = 0.0;
921 sigmaY = 0.0;
922 y2 = 0.0;
923 z1 = 0.0;
924 sigmaZ = 0.0;
925 z2 = 0.0;
926
927 if ( ( part < 0 ) || ( part >= (int)MucID::getPartNum() ) )
928 {
929 cout << "MucGeoGeneral::FindIntersection-E101 invalid part = " << part << endl;
930 return;
931 }
932
933 if ( ( gap < 0 ) || ( gap >= (int)MucID::getGapNum( part ) ) )
934 {
935 // cout << "MucGeoGeneral::FindIntersection-E102 invalid gap = "
936 // << gap << endl;
937 return;
938 }
939
940 // "Brute-force" algorithm.
941 // 1a. Find intersection with gap.
942 // 1b. Transform intersection position to gap coords.
943 // 2. Check intersection position against gap boundaries.
944 // Save the intersection position and gap id if within
945 // boundaries.
946
947 // bool found = false;
948 float distance = 1e30;
949
950 MucGeoGap* p = GetGap( part, seg, gap );
951 if ( p )
952 {
953
954 HepPoint3D r0( x0, y0, z0 ); // MucGeoGeneral::FindIntersection
955
956 HepPoint3D cross1( 0, 0, 0 ), cross2( 0, 0, 0 );
957 // cout <<"in MucGeoGeneral v ro"<< v << r0 << endl;
958 HepPoint3D r = p->ProjectToGap( r0, vy, y0, a, b, c, whichhalf, cross1, cross2 );
959 // cout<<"in MucGeoGeneral r_quad = "<<r<<endl;
960 HepPoint3D localIntersection = p->TransformToGap( r );
961 // cout << "intersect gap point " << r << " local " << localIntersection << endl;
962
963 distance = r.distance( r0 );
964
965 x1 = cross1.x();
966 y1 = cross1.y();
967 z1 = cross1.z();
968
969 x2 = cross2.x();
970 y2 = cross2.y();
971 z2 = cross2.z();
972
973 // Should be in Gap?
974 // No, return intersection position however.
975
976 // if ( p->IsInGap(localIntersection.x(),
977 // localIntersection.y(),
978 // localIntersection.z()) ) {
979 // cout << "found project in gap" << endl;
980 // found = true;
981 // }
982 // else{
983 // cout << " not in gap" << endl;
984 // }
985 }
986
987 else
988 {
989 cout << "FindIntersection-E103 bad panel pointer!"
990 << " Part" << part << " Seg" << seg << " Gap" << gap << endl;
991 }
992
993 // FIXME: need a calculation of the uncertainty in the intercept!
994
995 return;
996}

◆ FindIntersection() [5/6]

void MucGeoGeneral::FindIntersection ( const int part,
const int seg,
const int gap,
const float vy,
const float x0,
const float y0,
const float z0,
const float a,
const float b,
const float c,
const int whichhalf,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

Find the intersection position of a trajectory with the given gap. The trajectory is given by a parabola and a line in global coordinates, If more than one seg lies along the trajectory, take the first one whichhalf help to judge which intersection position is better, x1,y1,z1 return the better one . now reserver x2,y2,z2 temp.

◆ FindIntersection() [6/6]

void MucGeoGeneral::FindIntersection ( const int part,
const int seg,
const int gap,
const float vy,
const float x0,
const float y0,
const float z0,
const float a,
const float b,
const float c,
const int whichhalf,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

Find the intersection position of a trajectory with the given gap. The trajectory is given by a parabola and a line in global coordinates, If more than one seg lies along the trajectory, take the first one whichhalf help to judge which intersection position is better, x1,y1,z1 return the better one . now reserver x2,y2,z2 temp.

◆ FindIntersectionQuadLocal() [1/3]

void MucGeoGeneral::FindIntersectionQuadLocal ( const int part,
const int seg,
const int gap,
const float a,
const float b,
const float c,
const int whichhalf,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

Definition at line 820 of file MucGeoGeneral.cxx.

825 {
826 x1 = 0.0;
827 sigmaX = 0.0;
828 x2 = 0.0;
829 y1 = 0.0;
830 sigmaY = 0.0;
831 y2 = 0.0;
832 z1 = 0.0;
833 sigmaZ = 0.0;
834 z2 = 0.0;
835
836 if ( ( part < 0 ) || ( part >= (int)MucID::getPartNum() ) )
837 {
838 cout << "MucGeoGeneral::FindIntersection-E101 invalid part = " << part << endl;
839 return;
840 }
841
842 if ( ( gap < 0 ) || ( gap >= (int)MucID::getGapNum( part ) ) )
843 {
844 // cout << "MucGeoGeneral::FindIntersection-E102 invalid gap = "
845 // << gap << endl;
846 return;
847 }
848
849 float distance = 1e30;
850
851 MucGeoGap* p = GetGap( part, seg, gap );
852 if ( p )
853 {
854
855 int orient = 0;
856 if ( part == 1 && gap % 2 == 0 ) orient = 1;
857 if ( part != 1 && gap % 2 == 1 ) orient = 1;
858
859 HepPoint3D cross1( 0, 0, 0 ), cross2( 0, 0, 0 );
860 // cout <<"in MucGeoGeneral v ro"<< v << r0 << endl;
861 HepPoint3D r =
862 p->ProjectToGapQuadLocal( part, orient, a, b, c, whichhalf, cross1, cross2 );
863 // cout<<"in MucGeoGeneral r_quad = "<<r<<endl;
864 HepPoint3D localIntersection = p->TransformToGap( r );
865 // cout << "intersect gap point " << r << " local " << localIntersection << endl;
866
867 x1 = cross1.x();
868 y1 = cross1.y();
869 z1 = cross1.z();
870
871 x2 = cross2.x();
872 y2 = cross2.y();
873 z2 = cross2.z();
874
875 // Should be in Gap?
876 // No, return intersection position however.
877
878 // if ( p->IsInGap(localIntersection.x(),
879 // localIntersection.y(),
880 // localIntersection.z()) ) {
881 // cout << "found project in gap" << endl;
882 // found = true;
883 // }
884 // else{
885 // cout << " not in gap" << endl;
886 // }
887 }
888
889 else
890 {
891 cout << "FindIntersection-E103 bad panel pointer!"
892 << " Part" << part << " Seg" << seg << " Gap" << gap << endl;
893 }
894
895 return;
896}
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

Referenced by MucRec3DRoad::ProjectNoCurrentGap().

◆ FindIntersectionQuadLocal() [2/3]

void MucGeoGeneral::FindIntersectionQuadLocal ( const int part,
const int seg,
const int gap,
const float a,
const float b,
const float c,
const int whichhalf,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

◆ FindIntersectionQuadLocal() [3/3]

void MucGeoGeneral::FindIntersectionQuadLocal ( const int part,
const int seg,
const int gap,
const float a,
const float b,
const float c,
const int whichhalf,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

◆ FindIntersections() [1/3]

vector< HepPoint3D > MucGeoGeneral::FindIntersections ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection )

Find the intersection position of a trajectory with the given part and gap. The trajectory is given by the position and direction in global coordinate.

Definition at line 685 of file MucGeoGeneral.cxx.

687 {
688 // Find the intersection position of a trajectory with the given part and gap.
689 // The trajectory is given by the position and direction in global coordinate.
690 vector<HepPoint3D> intersectionList;
691 MucGeoGap* pGap;
692
693 HepPoint3D intersection, localIntersection;
694 Hep3Vector intersectionDir;
695 double cos = -1;
696
697 for ( unsigned int seg = 0; seg < MucID::getSegNum( part ); seg++ )
698 {
699 pGap = GetGap( part, seg, gap );
700 if ( pGap )
701 {
702 intersection = pGap->ProjectToGap( gPoint, gDirection );
703 localIntersection = pGap->TransformToGap( intersection );
704 // cout << localIntersection << endl;
705
706 intersectionDir = ( (CLHEP::Hep3Vector)intersection ) - ( (CLHEP::Hep3Vector)gPoint );
707 if ( intersectionDir.mag() == 0 ) { cos = 0.0; }
708 else
709 {
710 cos = intersectionDir.dot( gDirection ) / ( intersectionDir.mag() * gDirection.mag() );
711 }
712
713 if ( ( cos >= 0.0 ) && ( pGap->IsInGap( localIntersection.x(), localIntersection.y(),
714 localIntersection.z() ) ) )
715 { intersectionList.push_back( intersection ); }
716 else {}
717 }
718 else {}
719 }
720
721 return intersectionList;
722}

Referenced by main(), and RecMucTrack::Project().

◆ FindIntersections() [2/3]

vector< HepPoint3D > MucGeoGeneral::FindIntersections ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection )

Find the intersection position of a trajectory with the given part and gap. The trajectory is given by the position and direction in global coordinate.

◆ FindIntersections() [3/3]

vector< HepPoint3D > MucGeoGeneral::FindIntersections ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection )

Find the intersection position of a trajectory with the given part and gap. The trajectory is given by the position and direction in global coordinate.

◆ FindIntersectionSurface() [1/6]

void MucGeoGeneral::FindIntersectionSurface ( const int part,
const int seg,
const int gap,
const float vx,
const float vy,
const float vz,
const float x0,
const float y0,
const float z0,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX1,
float & sigmaY1,
float & sigmaZ1,
float & sigmaX2,
float & sigmaY2,
float & sigmaZ2 )

Definition at line 1003 of file MucGeoGeneral.cxx.

1015 {
1016 x1 = 0.0;
1017 sigmaX1 = 0.0;
1018 y1 = 0.0;
1019 sigmaY1 = 0.0;
1020 z1 = 0.0;
1021 sigmaZ1 = 0.0;
1022 x2 = 0.0;
1023 sigmaX2 = 0.0;
1024 y2 = 0.0;
1025 sigmaY2 = 0.0;
1026 z2 = 0.0;
1027 sigmaZ2 = 0.0;
1028
1029 if ( ( part < 0 ) || ( part >= (int)MucID::getPartNum() ) )
1030 {
1031 cout << "MucGeoGeneral::FindIntersection-E101 invalid part = " << part << endl;
1032 return;
1033 }
1034
1035 if ( ( gap < 0 ) || ( gap >= (int)MucID::getGapNum( part ) ) )
1036 {
1037 // cout << "MucGeoGeneral::FindIntersection-E102 invalid gap = "
1038 // << gap << endl;
1039 return;
1040 }
1041
1042 // "Brute-force" algorithm.
1043 // 1a. Find intersection with gap.
1044 // 1b. Transform intersection position to gap coords.
1045 // 2. Check intersection position against gap boundaries.
1046 // Save the intersection position and gap id if within
1047 // boundaries.
1048
1049 // bool found = false;
1050 float distance = 1e30;
1051
1052 MucGeoGap* p = GetGap( part, seg, gap );
1053 if ( p )
1054 {
1055
1056 Hep3Vector v( vx, vy, vz );
1057 HepPoint3D r0( x0, y0, z0 ); // MucGeoGeneral::FindIntersection
1058
1059 // cout <<"in MucGeoGeneral v ro"<< v << r0 << endl;
1060
1061 HepPoint3D cross1, cross2;
1062 p->ProjectToGapSurface( r0, v, cross1, cross2 );
1063
1064 x1 = cross1.x();
1065 y1 = cross1.y();
1066 z1 = cross1.z();
1067 x2 = cross2.x();
1068 y2 = cross2.y();
1069 z2 = cross2.z();
1070
1071 // Should be in Gap?
1072 // No, return intersection position however.
1073
1074 // if ( p->IsInGap(localIntersection.x(),
1075 // localIntersection.y(),
1076 // localIntersection.z()) ) {
1077 // cout << "found project in gap" << endl;
1078 // found = true;
1079 // }
1080 // else{
1081 // cout << " not in gap" << endl;
1082 // }
1083 }
1084
1085 else
1086 {
1087 cout << "FindIntersection-E103 bad panel pointer!"
1088 << " Part" << part << " Seg" << seg << " Gap" << gap << endl;
1089 }
1090
1091 // FIXME: need a calculation of the uncertainty in the intercept!
1092
1093 return;
1094}
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.

Referenced by MucRec3DRoad::Project().

◆ FindIntersectionSurface() [2/6]

void MucGeoGeneral::FindIntersectionSurface ( const int part,
const int seg,
const int gap,
const float vx,
const float vy,
const float vz,
const float x0,
const float y0,
const float z0,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX1,
float & sigmaY1,
float & sigmaZ1,
float & sigmaX2,
float & sigmaY2,
float & sigmaZ2 )

◆ FindIntersectionSurface() [3/6]

void MucGeoGeneral::FindIntersectionSurface ( const int part,
const int seg,
const int gap,
const float vx,
const float vy,
const float vz,
const float x0,
const float y0,
const float z0,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX1,
float & sigmaY1,
float & sigmaZ1,
float & sigmaX2,
float & sigmaY2,
float & sigmaZ2 )

◆ FindIntersectionSurface() [4/6]

void MucGeoGeneral::FindIntersectionSurface ( const int part,
const int seg,
const int gap,
const float vy,
const float x0,
const float y0,
const float z0,
const float a,
const float b,
const float c,
const int whichhalf,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

Find the intersection position of a trajectory with two surfaces of the given gap. The trajectory is given by a parabola and a line in global coordinates, If more than one seg lies along the trajectory, take the first one whichhalf help to judge which intersection position is better,and return the better one only. x1,y1,z1 is the intersection position with inner surface and x2,y2,z2 be the outer!

Definition at line 1096 of file MucGeoGeneral.cxx.

1109 {
1110 x1 = 0.0;
1111 sigmaX = 0.0;
1112 x2 = 0.0;
1113 y1 = 0.0;
1114 sigmaY = 0.0;
1115 y2 = 0.0;
1116 z1 = 0.0;
1117 sigmaZ = 0.0;
1118 z2 = 0.0;
1119
1120 if ( ( part < 0 ) || ( part >= (int)MucID::getPartNum() ) )
1121 {
1122 cout << "MucGeoGeneral::FindIntersection-E101 invalid part = " << part << endl;
1123 return;
1124 }
1125
1126 if ( ( gap < 0 ) || ( gap >= (int)MucID::getGapNum( part ) ) )
1127 {
1128 // cout << "MucGeoGeneral::FindIntersection-E102 invalid gap = "
1129 // << gap << endl;
1130 return;
1131 }
1132
1133 // "Brute-force" algorithm.
1134 // 1a. Find intersection with gap.
1135 // 1b. Transform intersection position to gap coords.
1136 // 2. Check intersection position against gap boundaries.
1137 // Save the intersection position and gap id if within
1138 // boundaries.
1139
1140 // bool found = false;
1141 float distance = 1e30;
1142
1143 MucGeoGap* p = GetGap( part, seg, gap );
1144 if ( p )
1145 {
1146
1147 HepPoint3D r0( x0, y0, z0 ); // MucGeoGeneral::FindIntersection
1148
1149 HepPoint3D cross1( 0, 0, 0 ), cross2( 0, 0, 0 );
1150 p->ProjectToGapSurface( r0, vy, y0, a, b, c, whichhalf, cross1, cross2 );
1151
1152 x1 = cross1.x();
1153 y1 = cross1.y();
1154 z1 = cross1.z();
1155
1156 x2 = cross2.x();
1157 y2 = cross2.y();
1158 z2 = cross2.z();
1159
1160 // Should be in Gap?
1161 // No, return intersection position however.
1162
1163 // if ( p->IsInGap(localIntersection.x(),
1164 // localIntersection.y(),
1165 // localIntersection.z()) ) {
1166 // cout << "found project in gap" << endl;
1167 // found = true;
1168 // }
1169 // else{
1170 // cout << " not in gap" << endl;
1171 // }
1172 }
1173
1174 else
1175 {
1176 cout << "FindIntersection-E103 bad panel pointer!"
1177 << " Part" << part << " Seg" << seg << " Gap" << gap << endl;
1178 }
1179
1180 // FIXME: need a calculation of the uncertainty in the intercept!
1181
1182 return;
1183}

◆ FindIntersectionSurface() [5/6]

void MucGeoGeneral::FindIntersectionSurface ( const int part,
const int seg,
const int gap,
const float vy,
const float x0,
const float y0,
const float z0,
const float a,
const float b,
const float c,
const int whichhalf,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

Find the intersection position of a trajectory with two surfaces of the given gap. The trajectory is given by a parabola and a line in global coordinates, If more than one seg lies along the trajectory, take the first one whichhalf help to judge which intersection position is better,and return the better one only. x1,y1,z1 is the intersection position with inner surface and x2,y2,z2 be the outer!

◆ FindIntersectionSurface() [6/6]

void MucGeoGeneral::FindIntersectionSurface ( const int part,
const int seg,
const int gap,
const float vy,
const float x0,
const float y0,
const float z0,
const float a,
const float b,
const float c,
const int whichhalf,
const float sigmaVx,
const float sigmaVy,
const float sigmaVz,
const float sigmaX0,
const float sigmaY0,
const float sigmaZ0,
float & x1,
float & y1,
float & z1,
float & x2,
float & y2,
float & z2,
float & sigmaX,
float & sigmaY,
float & sigmaZ )

Find the intersection position of a trajectory with two surfaces of the given gap. The trajectory is given by a parabola and a line in global coordinates, If more than one seg lies along the trajectory, take the first one whichhalf help to judge which intersection position is better,and return the better one only. x1,y1,z1 is the intersection position with inner surface and x2,y2,z2 be the outer!

◆ FindIntersectStrips() [1/6]

vector< Identifier > MucGeoGeneral::FindIntersectStrips ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection )

Find the intersect strip of a trajectory with the given part and gap. The trajectory is given by the position and direction in global coordinate.

Definition at line 524 of file MucGeoGeneral.cxx.

526 {
527 // Find the intersect strip of a trajectory with the given part and gap. The trajectory is
528 // given by the position gPoint and direction gDirection in global coordinate.
529 vector<Identifier> gapList;
530 vector<Identifier> stripList;
531
532 MucGeoGap* pGap;
533 MucGeoStrip* pStrip;
534
535 int seg, iStripGuess, nStripMax;
536 Identifier id;
537 HepPoint3D intersection, localIntersection;
538 Hep3Vector localDirection;
539
540 gapList = FindIntersectGaps( part, gap, gPoint, gDirection );
541
542 for ( unsigned int i = 0; i < gapList.size(); i++ )
543 {
544 // Get the gap data ...
545 seg = MucID::seg( gapList[i] );
546 pGap = GetGap( part, seg, gap );
547 if ( !pGap )
548 {
549 cout << "FindIntersectStrips : bad gap pointer!" << endl;
550 return stripList;
551 }
552
553 intersection = pGap->ProjectToGap( gPoint, gDirection );
554 localIntersection = pGap->TransformToGap( intersection );
555 localDirection = pGap->RotateToGap( gDirection );
556
557 // Search through gap to find the intersect strips.
558 nStripMax = pGap->GetStripNum() - 1;
559 iStripGuess = pGap->GuessStrip( localIntersection.x(), localIntersection.y(),
560 localIntersection.z() );
561 // cout << "guess " << iStripGuess << endl;
562
563 int iStripLow = iStripGuess - 2;
564 int iStripHigh = iStripGuess + 2;
565 iStripLow = max( 0, iStripLow );
566 iStripHigh = min( nStripMax, iStripHigh );
567
568 iStripLow = 0;
569 iStripHigh = nStripMax;
570
571 // cout << "intersection : " << intersection << endl
572 // << "localIntersection : " << localIntersection << endl
573 // << "localDirection : " << localDirection << endl;
574
575 for ( int j = iStripLow; j < iStripHigh; j++ )
576 {
577 pStrip = pGap->GetStrip( j );
578
579 if ( pStrip->CrossGasChamber( localIntersection, localDirection ) )
580 {
581 id = MucID::channel_id( part, seg, gap, j );
582 stripList.push_back( id );
583 }
584 }
585 }
586
587 return stripList;
588}
#define min(a, b)
#define max(a, b)
Hep3Vector RotateToGap(const Hep3Vector gVect) const
Rotate a vector from global coordinate to gap coordinate.
int GuessStrip(const float x, const float y, const float z) const
MucGeoStrip * GetStrip(const int strip) const
Point to a strip within this gap.
vector< Identifier > FindIntersectGaps(const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
bool CrossGasChamber(const HepPoint3D linePoint, const Hep3Vector lineDir) const
Does the line cross this strip?
static int seg(const Identifier &id)
Definition MucID.cxx:53

Referenced by main(), MucRec3DRoad::ProjectToStrip(), and MucRec3DRoad::ProjectToStrip().

◆ FindIntersectStrips() [2/6]

vector< Identifier > MucGeoGeneral::FindIntersectStrips ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection )

Find the intersect strip of a trajectory with the given part and gap. The trajectory is given by the position and direction in global coordinate.

◆ FindIntersectStrips() [3/6]

vector< Identifier > MucGeoGeneral::FindIntersectStrips ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection )

Find the intersect strip of a trajectory with the given part and gap. The trajectory is given by the position and direction in global coordinate.

◆ FindIntersectStrips() [4/6]

vector< Identifier > MucGeoGeneral::FindIntersectStrips ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection,
vector< int > & padID,
vector< float > & intersection_x,
vector< float > & intersection_y,
vector< float > & intersection_z )

Definition at line 590 of file MucGeoGeneral.cxx.

593 {
594 // Find the intersect strip of a trajectory with the given part and gap. The trajectory is
595 // given by the position gPoint and direction gDirection in global coordinate.
596 vector<Identifier> gapList;
597 vector<Identifier> stripList;
598
599 MucGeoGap* pGap;
600 MucGeoStrip* pStrip;
601
602 int seg, iStripGuess, nStripMax;
603 Identifier id;
604 HepPoint3D intersection, localIntersection;
605 Hep3Vector localDirection;
606
607 gapList = FindIntersectGaps( part, gap, gPoint, gDirection );
608
609 for ( unsigned int i = 0; i < gapList.size(); i++ )
610 {
611 // Get the gap data ...
612 seg = MucID::seg( gapList[i] );
613 pGap = GetGap( part, seg, gap );
614 if ( !pGap )
615 {
616 cout << "FindIntersectStrips : bad gap pointer!" << endl;
617 return stripList;
618 }
619
620 intersection = pGap->ProjectToGap( gPoint, gDirection );
621 localIntersection = pGap->TransformToGap( intersection );
622 localDirection = pGap->RotateToGap( gDirection );
623
624 // Search through gap to find the intersect strips.
625 nStripMax = pGap->GetStripNum() - 1;
626 iStripGuess = pGap->GuessStrip( localIntersection.x(), localIntersection.y(),
627 localIntersection.z() );
628 // cout << "guess " << iStripGuess << endl;
629
630 int iStripLow = iStripGuess - 2;
631 int iStripHigh = iStripGuess + 2;
632 iStripLow = max( 0, iStripLow );
633 iStripHigh = min( nStripMax, iStripHigh );
634
635 iStripLow = 0;
636 iStripHigh = nStripMax;
637
638 // cout << "intersection : " << intersection << endl
639 // << "localIntersection : " << localIntersection << endl
640 // << "localDirection : " << localDirection << endl;
641
642 for ( int j = iStripLow; j < iStripHigh; j++ )
643 {
644 pStrip = pGap->GetStrip( j );
645
646 if ( pStrip->CrossGasChamber( localIntersection, localDirection ) )
647 {
648 // get id of intersect strip, now calc pad id!
649 /*
650 cout<<"Strip: ("<<part<<", "<<seg<<", "<<gap<<", "<<j<<")"<<endl;
651 cout<<"xmin: "<<pStrip->GetXmin()<<" xmax: "<<pStrip->GetXmax()<<endl;
652 cout<<"ymin: "<<pStrip->GetYmin()<<" ymax: "<<pStrip->GetYmax()<<endl;
653 cout<<"zmin: "<<pStrip->GetZmin()<<" zmax: "<<pStrip->GetZmax()<<endl;
654 */
655 float posx, posy, posz;
656 pStrip->GetCenterPos( posx, posy, posz );
657 /*
658 cout<<"orient: "<<pGap->Orient()<<endl;
659 cout<<"center pos: "<<posx<<" "<<posy<<" "<<posz<<endl;
660 cout<<"inter pos: "<<localIntersection<<endl;
661 */
662 int padid = -1;
663 if ( pGap->Orient() == 1 )
664 padid = ( localIntersection.y() - pStrip->GetYmin() ) /
665 ( pStrip->GetXmax() - pStrip->GetXmin() );
666 else
667 padid = ( localIntersection.x() - pStrip->GetXmin() ) /
668 ( pStrip->GetYmax() - pStrip->GetYmin() );
669
670 // cout<<"padID: "<<padid<<endl;
671 padID.push_back( padid );
672 intersection_x.push_back( localIntersection.x() );
673 intersection_y.push_back( localIntersection.y() );
674 intersection_z.push_back( localIntersection.z() );
675
676 id = MucID::channel_id( part, seg, gap, j );
677 stripList.push_back( id );
678 }
679 }
680 }
681
682 return stripList;
683}
float GetYmin() const
Get position of low-Y edge in the gap coordinate system.
float GetXmax() const
Get position of high-X edge in the gap coordinate system.
float GetXmin() const
Get position of low-X edge in the gap coordinate system.
float GetYmax() const
Get position of high-Y 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).

◆ FindIntersectStrips() [5/6]

vector< Identifier > MucGeoGeneral::FindIntersectStrips ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection,
vector< int > & padID,
vector< float > & intersection_x,
vector< float > & intersection_y,
vector< float > & intersection_z )

◆ FindIntersectStrips() [6/6]

vector< Identifier > MucGeoGeneral::FindIntersectStrips ( const int part,
const int gap,
const HepPoint3D gPoint,
const Hep3Vector gDirection,
vector< int > & padID,
vector< float > & intersection_x,
vector< float > & intersection_y,
vector< float > & intersection_z )

◆ GetGap() [1/6]

MucGeoGap * MucGeoGeneral::GetGap ( const Identifier id) const

Get a pointer to the gap identified by Indentifier.

Definition at line 442 of file MucGeoGeneral.cxx.

442 {
443 // Get a pointer to the gap identified by Identifier.
444 Identifier gapID =
445 MucID::channel_id( MucID::part( id ), MucID::seg( id ), MucID::gap( id ), 0 );
446
447 return m_gpMucGeoGap[gapID];
448}
static int part(const Identifier &id)
Definition MucID.cxx:43
static int gap(const Identifier &id)
Definition MucID.cxx:63

◆ GetGap() [2/6]

MucGeoGap * MucGeoGeneral::GetGap ( const Identifier id) const

Get a pointer to the gap identified by Indentifier.

◆ GetGap() [3/6]

MucGeoGap * MucGeoGeneral::GetGap ( const Identifier id) const

Get a pointer to the gap identified by Indentifier.

◆ GetGap() [4/6]

MucGeoGap * MucGeoGeneral::GetGap ( const int part,
const int seg,
const int gap ) const

◆ GetGap() [5/6]

MucGeoGap * MucGeoGeneral::GetGap ( const int part,
const int seg,
const int gap ) const

Get a pointer to the gap identified by (part,seg,gap).

◆ GetGap() [6/6]

MucGeoGap * MucGeoGeneral::GetGap ( const int part,
const int seg,
const int gap ) const

Get a pointer to the gap identified by (part,seg,gap).

◆ GetStrip() [1/6]

MucGeoStrip * MucGeoGeneral::GetStrip ( const Identifier id) const

Get a pointer to the strip identified by Indentifier.

Definition at line 458 of file MucGeoGeneral.cxx.

458 {
459 // Get a pointer to the strip identified Identifier.
460 return m_gpMucGeoStrip[id];
461}

◆ GetStrip() [2/6]

MucGeoStrip * MucGeoGeneral::GetStrip ( const Identifier id) const

Get a pointer to the strip identified by Indentifier.

◆ GetStrip() [3/6]

MucGeoStrip * MucGeoGeneral::GetStrip ( const Identifier id) const

Get a pointer to the strip identified by Indentifier.

◆ GetStrip() [4/6]

MucGeoStrip * MucGeoGeneral::GetStrip ( const int part,
const int seg,
const int gap,
const int strip ) const

Get a pointer to the strip identified by (part,seg,gap,strip).

Definition at line 450 of file MucGeoGeneral.cxx.

451 {
452 // Get a pointer to the strip identified by (part, seg, gap, strip).
453 Identifier id = MucID::channel_id( part, seg, gap, strip );
454
455 return m_gpMucGeoStrip[id];
456}

Referenced by main(), MucRecHit::MucRecHit(), and MucRecHit::MucRecHit().

◆ GetStrip() [5/6]

MucGeoStrip * MucGeoGeneral::GetStrip ( const int part,
const int seg,
const int gap,
const int strip ) const

Get a pointer to the strip identified by (part,seg,gap,strip).

◆ GetStrip() [6/6]

MucGeoStrip * MucGeoGeneral::GetStrip ( const int part,
const int seg,
const int gap,
const int strip ) const

Get a pointer to the strip identified by (part,seg,gap,strip).

◆ GetStripNumInGap() [1/3]

int MucGeoGeneral::GetStripNumInGap ( const int part,
const int seg,
const int gap )
inline

Definition at line 94 of file InstallArea/x86_64-el9-gcc13-dbg/include/MucGeomSvc/MucGeoGeneral.h.

94 {
95 return m_StripNumInGap[part][seg][gap];
96 }

Referenced by GetStripNumTotal().

◆ GetStripNumInGap() [2/3]

int MucGeoGeneral::GetStripNumInGap ( const int part,
const int seg,
const int gap )
inline

Definition at line 94 of file InstallArea/x86_64-el9-gcc13-opt/include/MucGeomSvc/MucGeoGeneral.h.

94 {
95 return m_StripNumInGap[part][seg][gap];
96 }

◆ GetStripNumInGap() [3/3]

int MucGeoGeneral::GetStripNumInGap ( const int part,
const int seg,
const int gap )
inline

Definition at line 94 of file Muc/MucGeomSvc/include/MucGeomSvc/MucGeoGeneral.h.

94 {
95 return m_StripNumInGap[part][seg][gap];
96 }

◆ GetStripNumTotal() [1/3]

int MucGeoGeneral::GetStripNumTotal ( )

Get total number of strips.

Definition at line 463 of file MucGeoGeneral.cxx.

463 {
464 int nStripTotal = 0;
465 for ( unsigned int part = 0; part < MucID::getPartNum(); part++ )
466 {
467 for ( unsigned int seg = 0; seg < MucID::getSegNum( part ); seg++ )
468 {
469 for ( unsigned int gap = 0; gap < MucID::getGapNum( part ); gap++ )
470 { nStripTotal += GetStripNumInGap( part, seg, gap ); }
471 }
472 }
473
474 return nStripTotal;
475}
int GetStripNumInGap(const int part, const int seg, const int gap)

◆ GetStripNumTotal() [2/3]

int MucGeoGeneral::GetStripNumTotal ( )

Get total number of strips.

◆ GetStripNumTotal() [3/3]

int MucGeoGeneral::GetStripNumTotal ( )

Get total number of strips.

◆ Init() [1/3]

void MucGeoGeneral::Init ( )

Initialize the instance of MucGeoGeneral.

Definition at line 73 of file MucGeoGeneral.cxx.

73 {
74 for ( unsigned int part = 0; part < MucID::getPartNum(); part++ )
75 {
76 for ( unsigned int seg = 0; seg < MucID::getSegMax(); seg++ )
77 {
78 for ( unsigned int gap = 0; gap < MucID::getGapMax(); gap++ )
79 { m_StripNumInGap[part][seg][gap] = 0; }
80 }
81 }
82}
static value_type getGapMax()
Definition MucID.cxx:165
static value_type getSegMax()
Definition MucID.cxx:158

Referenced by main().

◆ Init() [2/3]

void MucGeoGeneral::Init ( )

Initialize the instance of MucGeoGeneral.

◆ Init() [3/3]

void MucGeoGeneral::Init ( )

Initialize the instance of MucGeoGeneral.

◆ InitFromASCII() [1/3]

void MucGeoGeneral::InitFromASCII ( )

Initialize form ASCII.

Definition at line 161 of file MucGeoGeneral.cxx.

161 {
162 // Initialize Bes MUC Geometry for ASCII files.
163 string gapSizeFile = "muc-gap-size.dat";
164 string gapGeomFile = "muc-gap-geom.dat";
165 string stripSizeFile = "muc-strip-size.dat";
166 string stripGeomFile = "muc-strip-geom.dat";
167
168 static const int bufSize = 512;
169 char lineBuf[bufSize];
170
171 //
172 // File gapSizeFile contains the gap sizes.
173 //
174
175 ifstream ifGapSize( gapSizeFile.c_str() );
176 if ( !ifGapSize )
177 {
178 cout << "error opening gap size data file : " << gapSizeFile << endl;
179 return;
180 }
181
182 int part, seg, gap, strip, orient, panel;
183 float xGapTemp, yGapTemp, zGapTemp;
184 float xGapSize[m_kPartNum][m_kSegMax][m_kGapMax];
185 float yGapSize[m_kPartNum][m_kSegMax][m_kGapMax];
186 float zGapSize[m_kPartNum][m_kSegMax][m_kGapMax];
187 ;
188
189 // Read the data line by line until we reach EOF.
190
191 while ( ifGapSize.getline( lineBuf, bufSize, '\n' ) )
192 {
193 if ( ifGapSize.gcount() > bufSize )
194 {
195 cout << "input buffer too small! gcount = " << ifGapSize.gcount() << endl;
196 return;
197 }
198
199 istrstream stringBuf( lineBuf, strlen( lineBuf ) );
200
201 if ( stringBuf >> part >> seg >> gap >> xGapTemp >> yGapTemp >> zGapTemp )
202 {
203 xGapSize[part][seg][gap] = xGapTemp;
204 yGapSize[part][seg][gap] = yGapTemp;
205 zGapSize[part][seg][gap] = zGapTemp;
206
207 // cout << part << " " << seg << " " << gap << " "
208 // << " x " << xGapSize[part][seg][gap]
209 // << " y " << yGapSize[part][seg][gap]
210 // << " z " << zGapSize[part][seg][gap]
211 // << endl;
212 }
213 else
214 {
215 // Skip any header or comment lines.
216 // cout << "read comment line" << endl;
217 }
218 }
219
220 ifGapSize.close();
221
222 //
223 // File stripSizeFile contains the strip sizes.
224 //
225
226 ifstream ifStripSize( stripSizeFile.c_str() );
227 if ( !ifStripSize )
228 {
229 cout << "error opening strip size data file : " << stripSizeFile << endl;
230 return;
231 }
232
233 float xStripTemp, yStripTemp, zStripTemp;
234 float xStripSize[m_kPartNum][m_kSegMax][m_kGapMax][m_kStripMax];
235 float yStripSize[m_kPartNum][m_kSegMax][m_kGapMax][m_kStripMax];
236 float zStripSize[m_kPartNum][m_kSegMax][m_kGapMax][m_kStripMax];
237
238 // Read the data line by line until we reach EOF.
239
240 while ( ifStripSize.getline( lineBuf, bufSize, '\n' ) )
241 {
242
243 if ( ifStripSize.gcount() > bufSize )
244 {
245 cout << "input buffer too small! gcount = " << ifStripSize.gcount() << endl;
246 return;
247 }
248
249 istrstream stringBuf( lineBuf, strlen( lineBuf ) );
250
251 if ( stringBuf >> part >> seg >> gap >> strip >> xStripTemp >> yStripTemp >> zStripTemp )
252 {
253 xStripSize[part][seg][gap][strip] = xStripTemp;
254 yStripSize[part][seg][gap][strip] = yStripTemp;
255 zStripSize[part][seg][gap][strip] = zStripTemp;
256
257 m_StripNumInGap[part][seg][gap]++;
258 // cout << part << " " << seg << " " << gap << " "
259 // << strip << " "
260 // << " x " << xStripSize[part][seg][gap][strip]
261 // << " y " << yStripSize[part][seg][gap][strip]
262 // << " z " << zStripSize[part][seg][gap][strip]
263 // << endl;
264 }
265 else
266 {
267 // Skip any header or comment lines.
268 // cout << "read comment line" << endl;
269 }
270 }
271
272 ifStripSize.close();
273
274 // for(int part = 0; part < MucSoftID::m_kPart; part++) {
275 // for(int seg = 0; seg < MucSoftID::m_kSegInPartMax; seg++) {
276 // for(int gap = 0; gap < MucSoftID::m_kGapInSegMax; gap++) {
277 // cout << "nStrips In part " << part << " seg " << seg << " gap " << gap << " is "
278 // << m_NStripInGap[part][seg][gap] << endl;
279 // }
280 // }
281 // }
282
283 //
284 // File gapGeomFile contains the gap positions, etc.
285 //
286
287 ifstream ifGapGeom( gapGeomFile.c_str() );
288 if ( !ifGapGeom )
289 {
290 cout << "error opening gap geometry data file : " << gapGeomFile << endl;
291 return;
292 }
293
294 float xGapTarg1, yGapTarg1, zGapTarg1;
295 float xGapTarg2, yGapTarg2, zGapTarg2;
296 float xGapTarg3, yGapTarg3, zGapTarg3;
297 float dzHighEdge;
298
299 float dzFarFrontGas, dzNearFrontGas;
300 float dzFarBackGas, dzNearBackGas;
301
302 float dxTarget1ToFiducial, dyTarget1ToFiducial;
303 float dxFiducialToCenter, dyFiducialToCenter;
304
305 Identifier gapID = MucID::channel_id( 0, 0, 0, 0 );
306 Identifier stripID = MucID::channel_id( 0, 0, 0, 0 );
307
308 // Read the gap geometry data line by line until we reach EOF.
309
310 while ( ifGapGeom.getline( lineBuf, bufSize, '\n' ) )
311 {
312
313 if ( ifGapGeom.gcount() > bufSize )
314 {
315 cout << "input buffer too small! gcount = " << ifGapGeom.gcount() << endl;
316 return;
317 }
318
319 istrstream stringBuf( lineBuf, strlen( lineBuf ) );
320
321 if ( stringBuf >> part >> seg >> gap >> orient >> xGapTarg1 >> yGapTarg1 >> zGapTarg1 >>
322 xGapTarg2 >> yGapTarg2 >> zGapTarg2 >> xGapTarg3 >> yGapTarg3 >> zGapTarg3 >>
323 dzHighEdge >> dzFarFrontGas >> dzNearFrontGas >> dzNearBackGas >> dzFarBackGas >>
324 dxTarget1ToFiducial >> dyTarget1ToFiducial >> dxFiducialToCenter >>
325 dyFiducialToCenter )
326 {
327
328 // cout << " " << part << " " << seg << " " << gap
329 // << " " << xGapTarg1 << " " << yGapTarg1 << " " << zGapTarg1
330 // << " " << xGapTarg2 << " " << yGapTarg2 << " " << zGapTarg2
331 // << " " << xGapTarg3 << " " << yGapTarg3 << " " << zGapTarg3
332 // << " " << dzHighEdge
333 // << " " << dzFarFrontGas << " " << dzNearFrontGas
334 // << " " << dzFarBackGas << " " << dzNearBackGas
335 // << " " << dxTarget1ToFiducial << " " << dyTarget1ToFiducial
336 // << " " << dxFiducialToCenter << " " << dyFiducialToCenter
337 // << endl;
338
339 gapID = MucID::channel_id( part, seg, gap, 0 );
340
341 MucGeoGap* pGap = new MucGeoGap(
342 part, seg, gap, orient, 0, xGapSize[part][seg][gap], yGapSize[part][seg][gap],
343 zGapSize[part][seg][gap], xGapTarg1, yGapTarg1, zGapTarg1, xGapTarg2, yGapTarg2,
344 zGapTarg2, xGapTarg3, yGapTarg3, zGapTarg3, dzHighEdge, dzFarFrontGas,
345 dzNearFrontGas, dzNearBackGas, dzFarBackGas, dxTarget1ToFiducial,
346 dyTarget1ToFiducial, dxFiducialToCenter, dyFiducialToCenter );
347 m_gpMucGeoGap[gapID] = pGap;
348 }
349 else
350 {
351 // Skip any header or comment lines.
352 // cout << "read comment line" << endl;
353 }
354 }
355
356 ifGapGeom.close();
357
358 //
359 // File stripGeomFile contains the strip positions, etc.
360 //
361
362 ifstream ifStripGeom( stripGeomFile.c_str() );
363 if ( !ifStripGeom )
364 {
365 cout << "error opening strip geometry data file" << stripGeomFile << endl;
366 return;
367 }
368
369 // Read the strip geometry data line by line until we reach EOF.
370
371 float xStripTarg1, yStripTarg1, xStripTarg2, yStripTarg2;
372
373 while ( ifStripGeom.getline( lineBuf, bufSize, '\n' ) )
374 {
375
376 if ( ifStripGeom.gcount() > bufSize )
377 {
378 cout << "input buffer too small! gcount = " << ifStripGeom.gcount() << endl;
379 return;
380 }
381
382 istrstream stringBuf( lineBuf, strlen( lineBuf ) );
383
384 if ( stringBuf >> part >> seg >> gap >> strip >> panel >> xStripTarg1 >> xStripTarg2 >>
385 yStripTarg1 >> yStripTarg2 )
386 {
387
388 // cout << part << " " << seg << " " << gap << " "
389 // << strip << " " << panel << " " << orient << " "
390 // << xStripTarg1 << " " << xStripTarg2 << " "
391 // << yStripTarg1 << " " << yStripTarg2
392 // << endl;
393
394 MucGeoStrip* pStrip = 0;
395 stripID = MucID::channel_id( part, seg, gap, strip );
396 gapID = MucID::channel_id( part, seg, gap, 0 );
397
398 if ( !m_gpMucGeoStrip[stripID] )
399 {
400 if ( m_gpMucGeoGap[gapID] )
401 {
402 pStrip = m_gpMucGeoGap[gapID]->AddStrip( strip );
403 pStrip->SetStrip( xStripTarg1, xStripTarg2, yStripTarg1, yStripTarg2,
404 xStripSize[part][seg][gap][strip],
405 yStripSize[part][seg][gap][strip],
406 zStripSize[part][seg][gap][strip] );
407 m_gpMucGeoStrip[stripID] = pStrip;
408 }
409 else
410 {
411 cout << "missing gap" << gapID << endl;
412 continue;
413 }
414 }
415 }
416 else
417 {
418 // Skip any header or comment lines.
419 // cout << "read comment line" << endl;
420 }
421 }
422
423 ifStripGeom.close();
424
425 m_gGeometryInit = 1;
426}
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).

◆ InitFromASCII() [2/3]

void MucGeoGeneral::InitFromASCII ( )

Initialize form ASCII.

◆ InitFromASCII() [3/3]

void MucGeoGeneral::InitFromASCII ( )

Initialize form ASCII.

◆ InitFromDatabase() [1/3]

void MucGeoGeneral::InitFromDatabase ( )

Initialize from database.

◆ InitFromDatabase() [2/3]

void MucGeoGeneral::InitFromDatabase ( )

Initialize from database.

◆ InitFromDatabase() [3/3]

void MucGeoGeneral::InitFromDatabase ( )

Initialize from database.

◆ InitFromXML() [1/3]

void MucGeoGeneral::InitFromXML ( )

Initialize from xml.

Definition at line 84 of file MucGeoGeneral.cxx.

84 {
85 // new TRint("ROOT GDML converter", 0, 0);
86
87 // Initialize Bes Muc Geometry for XML files.
88 bool geomanager = true;
89 if ( !gGeoManager )
90 {
91 gGeoManager = new TGeoManager( "BesGeo", "Bes geometry" );
92 geomanager = false;
93 }
94 // gGeoManager->SetVisOption(0); // to show all visible volumes.
95 // gGeoManager->SetVisLevel(5);
96
97 MucROOTGeo* m_MucROOTGeo = new MucROOTGeo();
98
99 TGeoVolume* volMuc = m_MucROOTGeo->GetVolumeMuc();
100 if ( volMuc ) std::cout << "Construct Muc from Muc.gdml" << std::endl;
101 else std::cout << "volume Muc not found " << std::endl;
102
103 float m_BesR = 5200;
104 float m_BesZ = 5680;
105 TGeoIdentity* identity = new TGeoIdentity();
106
107 TGeoMaterial* mat = new TGeoMaterial( "VOID", 0, 0, 0 );
108 TGeoMedium* med = new TGeoMedium( "MED", 1, mat );
109 TGeoVolume* m_Bes =
110 gGeoManager->MakeBox( "volBes", med, 0.5 * m_BesR, 0.5 * m_BesR, 0.5 * m_BesZ );
111 gGeoManager->SetTopVolume( m_Bes );
112 m_Bes->AddNode( volMuc, 0, identity );
113 m_MucROOTGeo->SetChildNo( m_Bes->GetNdaughters() - 1 );
114
115 gGeoManager->SetDrawExtraPaths(); // draw physical node or not;
116 if ( !geomanager ) gGeoManager->CloseGeometry();
117 gGeoManager->SetNsegments( 20 );
118
119 m_MucROOTGeo->SetPhysicalNode();
120
121 for ( int part = 0; part < m_MucROOTGeo->GetPartNum(); part++ )
122 {
123 for ( int seg = 0; seg < m_MucROOTGeo->GetSegNum( part ); seg++ )
124 {
125 for ( int gap = 0; gap < m_MucROOTGeo->GetGapNum( part ); gap++ )
126 {
127 Identifier gapID = MucID::channel_id( part, seg, gap, 0 );
128
129 float ironThickness = 0.0;
130 if ( part == 1 )
131 {
132 if ( gap > 0 )
133 ironThickness = m_MucROOTGeo->GetAbsorberThickness( part, seg, gap - 1 );
134 }
135 else { ironThickness = m_MucROOTGeo->GetAbsorberThickness( part, seg, gap ); }
136 // std::cout << "part " << part << " seg " << seg << " gap " << gap << " thick " <<
137 // ironThickness << std::endl;
138
139 int orient = 0;
140 if ( ( part == 1 && gap % 2 == 0 ) || ( part != 1 && gap % 2 == 1 ) ) orient = 1;
141 MucGeoGap* pGap =
142 new MucGeoGap( part, seg, gap, orient, 0,
143 m_MucROOTGeo->GetPhysicalGap( part, seg, gap ), ironThickness );
144 m_gpMucGeoGap[gapID] = pGap;
145
146 for ( int strip = 0; strip < m_MucROOTGeo->GetStripNum( part, seg, gap ); strip++ )
147 {
148 Identifier stripID = MucID::channel_id( part, seg, gap, strip );
149
150 MucGeoStrip* pStrip = m_gpMucGeoGap[gapID]->AddStrip( strip );
151 pStrip->SetStrip( m_MucROOTGeo->GetPhysicalStrip( part, seg, gap, strip ) );
152 m_gpMucGeoStrip[stripID] = pStrip;
153 }
154 }
155 }
156 }
157
158 m_gGeometryInit = 1;
159}
void SetPhysicalNode()
Set the pointers to the physical nodes;.
float GetAbsorberThickness(int part, int seg, int absorber)
Get thickness of an absorber;.
TGeoPhysicalNode * GetPhysicalStrip(int part, int seg, int gap, int strip)
Get strip physical node;.
int GetSegNum(int part)
Get number of segment on part;.
TGeoPhysicalNode * GetPhysicalGap(int part, int seg, int gap)
Get rpc gas chamber node;.
int GetStripNum(int part, int seg, int gap)
Get number of strip on gap;.
int GetGapNum(int part)
Get number of gap on part;.

◆ InitFromXML() [2/3]

void MucGeoGeneral::InitFromXML ( )

Initialize from xml.

◆ InitFromXML() [3/3]

void MucGeoGeneral::InitFromXML ( )

Initialize from xml.

◆ Instance() [1/3]

◆ Instance() [2/3]

MucGeoGeneral * MucGeoGeneral::Instance ( )
static

Get a pointer to the single instance of MucGeoGeneral.

◆ Instance() [3/3]

MucGeoGeneral * MucGeoGeneral::Instance ( )
static

Get a pointer to the single instance of MucGeoGeneral.

◆ operator=() [1/3]

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

Assignment constructor.

Definition at line 62 of file MucGeoGeneral.cxx.

62 {
63 // Assignment operator.
64 if ( this != &orig )
65 { // Watch out for self-assignment!
66 m_gpMucGeoGeneral = orig.m_gpMucGeoGeneral;
67 m_gpMucGeoGap = orig.m_gpMucGeoGap;
68 m_gpMucGeoStrip = orig.m_gpMucGeoStrip;
69 }
70 return *this;
71}

◆ operator=() [2/3]

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

Assignment constructor.

◆ operator=() [3/3]

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

Assignment constructor.


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