2 #include "gearimpl/Util.h"
3 #include "gearxml/GearXML.h"
4 #include "gear/GearMgr.h"
7 #include "geartgeo/TGeoGearDistanceProperties.h"
8 #include "geartgeo/TGeoGearPointProperties.h"
21 using namespace gear ;
24 void gear_unexpected(){
30 }
catch( std::exception& e) {
32 std::cout <<
" A runtime error has occured : "
35 <<
" the program will have to be terminated - sorry." << std::endl ;
46 int main(
int argc,
char**argv){
49 std::set_terminate( gear_unexpected ) ;
52 std::cout <<
" printMaterials: print all materials between two points given in [mm]: " << std::endl
54 <<
" printMaterials gearFile.xml x0 y0 z0 x1 y1 z1 " << std::endl ;
59 std::stringstream ss ;
60 ss << argv[2] <<
" " << argv[3] <<
" " << argv[4] <<
" " << argv[5] <<
" " << argv[6] <<
" " << argv[7] ;
61 float x0,y0,z0,x1,y1,z1 ;
63 ss >> x0 >> y0 >> z0 >> x1 >> y1 >> z1 ;
66 std::cout <<
" *** Number Format Error: " << ss.str() << std::endl;
72 std::string fileName( argv[1] ) ;
76 GearMgr* gearMgr = gearXML.createGearMgr() ;
89 std::cout <<
" ############################################################ "
90 <<
" materials between the two points : \n "
93 <<
" ############################################################# "
101 dir = ( 1. / dir.
r() ) * dir ;
110 for(
unsigned j=0 ; j < names.size() ; ++j){
115 lambda += thicks[j] ;
119 double rL = distProp.
getNRadlen( prev, next ) ;
120 double iL = distProp.
getNIntlen( prev, next ) ;
125 printf(
"%25s %1.8e, %1.8e, %1.8e, %1.8e %1.8e %1.8e - %1.8e %1.8e %1.8e \n" ,
126 names[j].c_str() , thicks[j] * 10., rL, iL ,
127 prev[0]*10., prev[1]*10., prev[2]*10., next[0]*10., next[1]*10., next[2]*10. ) ;
virtual double getNRadlen(const Vector3D &p0, const Vector3D &p1) const
The number of radiation lengths along the distance between [p0,p1] .
virtual double getNIntlen(const Vector3D &p0, const Vector3D &p1) const
The number of interaction lengths along the distance between [p0,p1] .
virtual const std::vector< std::string > & getMaterialNames(const Vector3D &p0, const Vector3D &p1) const
List of matrial names along the distance between [p0,p1]- WARNING: this method returns a reference to...
virtual const GearDistanceProperties & getDistanceProperties() const =0
Get the distance properties object.
TGeo Implementation of the abstract interface that returns the (material) properties along a given di...
Implementation of GEAR using XML.
Simple three dimensional vector providing the components for cartesian, cylindrical and spherical coo...
virtual const std::vector< double > & getMaterialThicknesses(const Vector3D &p0, const Vector3D &p1) const
List of matrial thicknesses in mm along the distance between [p0,p1] - runs parallel to the array ret...
double r() const
Spherical r/magnitude.
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...