21#include "MucGeomSvc/MucGeoGeneral.h"
28 cout << endl <<
"****** Initialize MucGeoGeneral! ******" << endl << endl;
31 std::cout <<
"================================ begin event " << std::endl;
34 Hep3Vector gVect( -1, 0.8, -1.4 );
36 cout <<
"********************" << endl << endl;
37 cout <<
" Origin of the track : " << gPoint << endl;
38 cout <<
" Direction of the track : " << gVect << endl;
40 vector<Identifier> idGap, idGapTemp;
47 for ( vector<Identifier>::iterator
iter = idGapTemp.begin();
iter != idGapTemp.end();
49 { idGap.push_back( *
iter ); }
53 cout << endl <<
"********************" << endl << endl;
54 cout <<
" Number of intersect gaps : " << idGap.size() << endl << endl;
56 for (
unsigned int i = 0; i < idGap.size(); i++ ) { cout << idGap[i] << endl; }
58 vector<Identifier> idStrip, idStripTemp;
65 for ( vector<Identifier>::iterator
iter = idStripTemp.begin();
iter != idStripTemp.end();
67 { idStrip.push_back( *
iter ); }
71 cout << endl <<
"********************" << endl << endl;
72 cout <<
" Number of intersect strips : " << idStrip.size() << endl << endl;
74 float stripCenterX, stripCenterY, stripCenterZ;
79 for (
unsigned int i = 0; i < idStrip.size(); i++ )
86 pStrip->
GetCenterPos( stripCenterX, stripCenterY, stripCenterZ );
88 localStripCenter.setX( stripCenterX );
89 localStripCenter.setY( stripCenterY );
90 localStripCenter.setZ( stripCenterZ );
94 cout << idStrip[i] <<
" center : " << stripCenter << endl;
107 for ( vector<HepPoint3D>::iterator
iter = intersectionTemp.begin();
108 iter != intersectionTemp.end(); ++
iter )
113 cout << endl <<
"********************" << endl << endl;
114 cout <<
" Number of intersections : " <<
intersection.size() << endl << endl;
118 cout << endl <<
"********************" << endl << endl;
120 cout <<
" MucGeoTest1:: Execute Successfully!!" << endl;
HepGeom::Point3D< double > HepPoint3D
int intersection(const HepPoint3D &c1, double r1, const HepPoint3D &c2, double r2, double eps, HepPoint3D &x1, HepPoint3D &x2)
Circle utilities.
HepPoint3D TransformToGlobal(const HepPoint3D pPoint) const
Transform a point from gap coordinate to global coordinate.
void Init()
Initialize the instance of MucGeoGeneral.
MucGeoStrip * 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).
vector< HepPoint3D > FindIntersections(const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
vector< Identifier > FindIntersectGaps(const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
vector< Identifier > FindIntersectStrips(const int part, const int gap, const HepPoint3D gPoint, const Hep3Vector gDirection)
static MucGeoGeneral * Instance()
Get a pointer to the single instance of MucGeoGeneral.
MucGeoGap * GetGap() const
Get the pointer to the gap that contains the strip.
void GetCenterPos(float &x, float &y, float &z) const
Get center position of this strip (in the gap coordinate system).
static int part(const Identifier &id)
static value_type getPartNum()
static int gap(const Identifier &id)
static int seg(const Identifier &id)
static int strip(const Identifier &id)
static value_type getGapNum(int part)