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_unexpected( gear_unexpected ) ;
51 std::set_terminate( gear_unexpected ) ;
54 std::cout <<
" testgear: Testprogram for gear classes. " << std::endl
55 <<
" usage: testgear input.xml " << std::endl ;
59 std::string fileName( argv[1] ) ;
63 GearMgr* gearMgr = gearXML.createGearMgr() ;
66 double L_tpc=0, Rtpc_i=0,Rtpc_o=0, Recal_o=0,Recal_i=0, Zecal=0;
70 double r_in = tpcparams.
getDoubleVal(
"tpcInnerRadius")/10.;
71 double wall_in = tpcparams.
getDoubleVal(
"tpcInnerWallThickness")/10.;
72 double wall_out = tpcparams.
getDoubleVal(
"tpcOuterWallThickness")/10.;
73 double r_out = tpcparams.
getDoubleVal(
"tpcOuterRadius")/10. ;
75 Rtpc_o=r_out+wall_out;
78 std::cout <<
" oops - no TPC available :( " << std::endl ;
84 L_tpc = hcalparams.
getDoubleVal(
"TPC_Ecal_Hcal_barrel_halfZ")/10.;
87 std::cout <<
" oops - no TPC_Ecal_Hcal_barrel_halfZ available :( " << std::endl ;
96 std::cout <<
" oops - no Ecal barrel available :( " << std::endl ;
105 std::cout <<
" oops - no Ecal endcap available :( " << std::endl ;
114 std::cout <<
" oops - no Ecal endcap available :( " << std::endl ;
123 double tpc_radLen=0, all_radLen=0, bf_radLen=0;
124 std::cout<<
"# theta before TPC TPC up to ECAL"<<std::endl;
125 for(
int theta=0;theta<90;theta++)
132 all_final[1] = Recal_o;
133 all_final[2] = Recal_o/tan(theta*M_PI/180);
134 if(all_final[2]>Zecal)
137 all_final[1]=Zecal*tan(theta*M_PI/180);
139 if(all_final[1]<Recal_i)
142 all_radLen=distProp.
getNRadlen(all_initial, all_final);
145 tpc_initial[1] = Rtpc_i;
146 tpc_initial[2] = Rtpc_i/tan(theta*M_PI/180);
149 tpc_final[1] = Rtpc_o;
150 tpc_final[2] = Rtpc_o/tan(theta*M_PI/180);
151 if(tpc_final[2]>L_tpc)
154 tpc_final[1]=L_tpc*tan(theta*M_PI/180);
156 if(tpc_initial[2]>L_tpc)
159 tpc_radLen=distProp.
getNRadlen(tpc_initial, tpc_final);
166 bf_final[1] = tpc_initial[1];
167 bf_final[2] = tpc_initial[2];
168 if(bf_final[2]>L_tpc)
171 bf_radLen=distProp.
getNRadlen(bf_initial, bf_final);
173 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.