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"
20 using namespace gear ;
23 void gear_unexpected(){
29 }
catch( std::exception& e) {
31 std::cout <<
" A runtime error has occured : "
34 <<
" the program will have to be terminated - sorry." << std::endl ;
44 int main(
int argc,
char**argv){
47 std::set_terminate( gear_unexpected ) ;
50 std::cout <<
" testgear: Testprogram for gear classes. " << std::endl
51 <<
" usage: testgear input.xml " << std::endl ;
55 std::string fileName( argv[1] ) ;
59 GearMgr* gearMgr = gearXML.createGearMgr() ;
71 std::vector<std::string> matNames,volNames;
80 std::cout<<
"Top logical volume containing point (0,0,0): "<<pointProp.
getListOfLogicalVolumes(initial)[0]<<std::endl;
81 double radLen=distProp.
getNRadlen(initial,
final);
82 std::cout<<
"Radiation length between (0,0,0) and (50,50,50): "<<radLen<<std::endl;
86 std::cout<<
"Volumes and their material between (0,0,0) and (50,50,50): "<<std::endl;
87 for(
unsigned int i=0; i<volNames.size();i++)
88 std::cout <<i<<
" "<< volNames[i]<<
" "<<matNames[i] << std::endl;
virtual std::vector< std::string > getListOfLogicalVolumes(const Vector3D &pos) const
Names of (geant4) logical volumes in heirarchy starting at given pos ending with the world volume...
virtual double getNRadlen(const Vector3D &p0, const Vector3D &p1) const
The number of radiation 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...
virtual const std::vector< std::string > getVolumeNames(const Vector3D &p0, const Vector3D &p1) const
List of traversed volumes by name.
Implementation of GEAR using XML.
NotImplementedException used for features that are not implemented.
Simple three dimensional vector providing the components for cartesian, cylindrical and spherical coo...
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
TGeo implementation of the abstract interface that returns the (material) properties of a given point...
virtual const GearPointProperties & getPointProperties() const =0
Get the point properties object.