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 ;
47 int main(
int argc,
char**argv){
50 std::set_terminate( gear_unexpected ) ;
53 std::cout <<
" testgear: Testprogram for gear classes. " << std::endl
54 <<
" usage: testgear input.xml " << std::endl ;
58 std::string fileName( argv[1] ) ;
62 GearMgr* gearMgr = gearXML.createGearMgr() ;
65 double L_tpc=0, Rtpc_i=0,Rtpc_o=0, Recal_o=0,Recal_i=0, Zecal=0;
69 double r_in = tpcparams.
getDoubleVal(
"tpcInnerRadius")/10.;
70 double wall_in = tpcparams.
getDoubleVal(
"tpcInnerWallThickness")/10.;
71 double wall_out = tpcparams.
getDoubleVal(
"tpcOuterWallThickness")/10.;
72 double r_out = tpcparams.
getDoubleVal(
"tpcOuterRadius")/10. ;
74 Rtpc_o=r_out+wall_out;
77 std::cout <<
" oops - no TPC available :( " << std::endl ;
83 L_tpc = hcalparams.
getDoubleVal(
"TPC_Ecal_Hcal_barrel_halfZ")/10.;
86 std::cout <<
" oops - no TPC_Ecal_Hcal_barrel_halfZ available :( " << std::endl ;
95 std::cout <<
" oops - no Ecal barrel available :( " << std::endl ;
104 std::cout <<
" oops - no Ecal endcap available :( " << std::endl ;
113 std::cout <<
" oops - no Ecal endcap available :( " << std::endl ;
122 double tpc_radLen=0, all_radLen=0, bf_radLen=0;
123 std::cout<<
"# theta before TPC TPC up to ECAL"<<std::endl;
124 for(
int theta=0;theta<90;theta++)
131 all_final[1] = Recal_o;
132 all_final[2] = Recal_o/tan(theta*M_PI/180);
133 if(all_final[2]>Zecal)
136 all_final[1]=Zecal*tan(theta*M_PI/180);
138 if(all_final[1]<Recal_i)
141 all_radLen=distProp.
getNRadlen(all_initial, all_final);
144 tpc_initial[1] = Rtpc_i;
145 tpc_initial[2] = Rtpc_i/tan(theta*M_PI/180);
148 tpc_final[1] = Rtpc_o;
149 tpc_final[2] = Rtpc_o/tan(theta*M_PI/180);
150 if(tpc_final[2]>L_tpc)
153 tpc_final[1]=L_tpc*tan(theta*M_PI/180);
155 if(tpc_initial[2]>L_tpc)
158 tpc_radLen=distProp.
getNRadlen(tpc_initial, tpc_final);
165 bf_final[1] = tpc_initial[1];
166 bf_final[2] = tpc_initial[2];
167 if(bf_final[2]>L_tpc)
170 bf_radLen=distProp.
getNRadlen(bf_initial, bf_final);
172 std::cout<<theta<<
" "<<bf_radLen<<
" "<<tpc_radLen<<
" "<<all_radLen<<std::endl;
virtual const TPCParameters & getTPCParameters() const =0
Get the TPCParameters.
Proposal for an abstract interface that defines the geometry properties of a TPC like detector needed...
virtual double getNRadlen(const Vector3D &p0, const Vector3D &p1) const
The number of radiation lengths along the distance between [p0,p1] .
virtual const GearDistanceProperties & getDistanceProperties() const =0
Get the distance properties object.
Proposal for an abstract interface that defines geometry properties of a typical sampling calorimeter...
TGeo Implementation of the abstract interface that returns the (material) properties along a given di...
virtual const std::vector< double > & getExtent() const =0
Extent of the calorimeter in the r-z-plane [ rmin, rmax, zmin, zmax ] in mm.
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...
UnknownParameterException call Processor::end().
virtual const CalorimeterParameters & getEcalPlugParameters() const =0
Get the Ecal plug parameters.
virtual const CalorimeterParameters & getEcalBarrelParameters() const =0
Get the Ecal barrel parameters.
virtual const CalorimeterParameters & getHcalBarrelParameters() const =0
Get the Hcal barrel parameters.
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
virtual const CalorimeterParameters & getEcalEndcapParameters() const =0
Get the Ecal endcap parameters.
virtual double getDoubleVal(const std::string &key) const =0
Double value for key.