16 #include "GaudiKernel/ISvcLocator.h"
17 #include "GaudiKernel/Bootstrap.h"
20 #include "G4LogicalVolumeStore.hh"
23 #include "boost/property_tree/xml_parser.hpp"
24 #include "boost/property_tree/ptree.hpp"
39 ISvcLocator * svcLocator = Gaudi::svcLocator();
43 SmartIF<StoreGateSvc> smartSG{svcLocator->service(
"StoreGateSvc")};
47 throw std::runtime_error(
"Unable to locate StoreGate!");
49 SmartIF<StoreGateSvc>
detStore{svcLocator->service(
"DetectorStore")};
52 throw std::runtime_error(
"Unable to locate DetectorStore!");
56 if (StatusCode::SUCCESS ==
detStore->retrieve(idDictMgr,
"IdDict")) {
58 std::string
tag = idDictMgr->manager()->tag();
60 (
tag ==
"initial_layout" ||
tag ==
"destaged_layout");
63 ATH_MSG_FATAL(
"Could not retrieve geometry layout. TR process is not to be trusted in the following");
64 throw std::runtime_error(
"Could not retrieve geometry layout!");
69 if (!fb.open(
name,std::ios::in)){
71 throw std::runtime_error(
"Could not open file!");
77 for( boost::property_tree::ptree::value_type
const&
v :
pt.get_child(
"FADS") ) {
78 if(
v.first ==
"TRRegionParameters" ) {
80 std::string volName=
v.second.get<std::string>(
"<xmlattr>.RadiatorName");
81 double foilThickness=
v.second.get<
double>(
"<xmlattr>.RadiatorFoilThickness");
82 double gasThickness=
v.second.get<
double>(
"<xmlattr>.RadiatorGasThickness");
83 int regionFlag=
v.second.get<
int>(
"<xmlattr>.RadiatorBARRELorENDCAP");
84 std::string detectorPart=
v.second.get<std::string>(
"<xmlattr>.DetectorPart");
86 G4LogicalVolumeStore *g4lvs = G4LogicalVolumeStore::GetInstance();
87 unsigned int numberOfVolumes = 0;
88 for (
const auto log_vol : *g4lvs){
89 if (volName ==
static_cast<const std::string&
>(log_vol->GetName())) {
91 foilThickness,gasThickness,
98 if( numberOfVolumes == 0 ) {
103 if ( ( volName!=
"TRT::MainRadiatorC" ) &&
104 ( volName!=
"TRT::ThinRadiatorC" ) ) {
106 <<
" not found! Geometry layout "