#include <vector>
#include <iostream>
#include <iomanip>
#include <string>
#include "MucGeomSvc/MucGeoGeneral.h"
Go to the source code of this file.
Functions | |
int | main () |
int main | ( | ) |
Definition at line 24 of file MucGeoTest1.cxx.
References MucGeoGeneral::FindIntersectGaps(), MucGeoGeneral::FindIntersections(), MucGeoGeneral::FindIntersectStrips(), MucID::gap(), MucGeoStrip::GetCenterPos(), MucGeoStrip::GetGap(), MucID::getGapNum(), MucID::getPartNum(), MucGeoGeneral::GetStrip(), genRecEmupikp::i, MucGeoGeneral::Init(), MucGeoGeneral::Instance(), intersection(), iter(), origin, MucID::part(), MucID::seg(), MucID::strip(), and MucGeoGap::TransformToGlobal().
00025 { 00026 //new TRint("ROOT GDML converter", 0, 0); 00027 //if (gGeoManager) delete gGeoManager; 00028 //new TGeoManager("BesGeo", "Bes geometry"); 00029 00030 cout << endl << "****** Initialize MucGeoGeneral! ******" << endl << endl; 00031 MucGeoGeneral::Instance()->Init(); 00032 00033 00034 std::cout<<"================================ begin event " << std::endl; 00035 00036 HepPoint3D gPoint(0,0,0); 00037 Hep3Vector gVect(-1,0.8,-1.4); 00038 00039 cout << "********************" << endl << endl ; 00040 cout << " Origin of the track : " << gPoint << endl; 00041 cout << " Direction of the track : " << gVect << endl; 00042 00043 vector<Identifier> idGap, idGapTemp; 00044 for(unsigned int part = 0; part < MucID::getPartNum(); part++) { 00045 for(unsigned int gap = 0; gap < MucID::getGapNum(part); gap++) { 00046 idGapTemp = MucGeoGeneral::Instance()->FindIntersectGaps(part, gap, gPoint, gVect); 00047 00048 for( vector<Identifier>::iterator iter = idGapTemp.begin(); 00049 iter != idGapTemp.end(); ++iter) { 00050 idGap.push_back(*iter); 00051 } 00052 } 00053 } 00054 00055 cout << endl << "********************" << endl << endl; 00056 cout << " Number of intersect gaps : " << idGap.size() << endl << endl; 00057 00058 for( unsigned int i = 0; i< idGap.size(); i++){ 00059 cout << idGap[i] << endl; 00060 } 00061 00062 vector<Identifier> idStrip, idStripTemp; 00063 for(unsigned int part = 0; part < MucID::getPartNum(); part++) { 00064 for(unsigned int gap = 0; gap < MucID::getGapNum(part); gap++) { 00065 idStripTemp = MucGeoGeneral::Instance()->FindIntersectStrips(part, gap, gPoint, gVect); 00066 00067 for( vector<Identifier>::iterator iter = idStripTemp.begin(); 00068 iter != idStripTemp.end(); ++iter) { 00069 idStrip.push_back(*iter); 00070 } 00071 } 00072 } 00073 00074 cout << endl << "********************" << endl << endl; 00075 cout << " Number of intersect strips : " << idStrip.size() << endl << endl; 00076 00077 float stripCenterX, stripCenterY, stripCenterZ; 00078 HepPoint3D localStripCenter, stripCenter; 00079 MucGeoStrip* pStrip; 00080 MucGeoGap* pGap; 00081 00082 00083 for( unsigned int i = 0; i < idStrip.size(); i++) { 00084 pStrip = MucGeoGeneral::Instance()->GetStrip(MucID::part(idStrip[i]), 00085 MucID::seg(idStrip[i]), 00086 MucID::gap(idStrip[i]), 00087 MucID::strip(idStrip[i])); 00088 pGap = pStrip->GetGap(); 00089 00090 pStrip->GetCenterPos(stripCenterX, 00091 stripCenterY, 00092 stripCenterZ); 00093 00094 localStripCenter.setX(stripCenterX); 00095 localStripCenter.setY(stripCenterY); 00096 localStripCenter.setZ(stripCenterZ); 00097 00098 stripCenter = pGap->TransformToGlobal(localStripCenter); 00099 00100 cout << idStrip[i] << " center : " << stripCenter << endl; 00101 } 00102 00103 vector<HepPoint3D> intersection, intersectionTemp; 00104 HepPoint3D origin(0,0,0); 00105 00106 for(unsigned int part = 0; part < MucID::getPartNum(); part++) { 00107 for(unsigned int gap = 0; gap < MucID::getGapNum(part); gap++) { 00108 intersectionTemp = MucGeoGeneral::Instance()->FindIntersections(part, gap, gPoint, gVect); 00109 00110 for( vector<HepPoint3D>::iterator iter = intersectionTemp.begin(); 00111 iter != intersectionTemp.end(); ++iter) { 00112 intersection.push_back(*iter); 00113 } 00114 } 00115 } 00116 00117 cout << endl << "********************" << endl << endl; 00118 cout << " Number of intersections : " << intersection.size() << endl << endl; 00119 00120 00121 for( unsigned int i = 0; i < intersection.size(); i++) { 00122 cout << intersection[i] << endl; 00123 } 00124 00125 cout << endl << "********************" << endl << endl; 00126 00127 cout << " MucGeoTest1:: Execute Successfully!!" 00128 << endl; 00129 }