17 #include "GaudiKernel/ISvcLocator.h"
18 #include "GaudiKernel/Bootstrap.h"
21 #include "G4LogicalVolumeStore.hh"
24 #include "boost/property_tree/xml_parser.hpp"
25 #include "boost/property_tree/ptree.hpp"
40 ISvcLocator * svcLocator = Gaudi::svcLocator();
44 SmartIF<StoreGateSvc> smartSG{svcLocator->service(
"StoreGateSvc")};
48 throw std::runtime_error(
"Unable to locate StoreGate!");
50 SmartIF<StoreGateSvc>
detStore{svcLocator->service(
"DetectorStore")};
53 throw std::runtime_error(
"Unable to locate DetectorStore!");
57 if (StatusCode::SUCCESS ==
detStore->retrieve(idDictMgr,
"IdDict")) {
59 std::string
tag = idDictMgr->manager()->tag();
61 (
tag ==
"initial_layout" ||
tag ==
"destaged_layout");
64 ATH_MSG_FATAL(
"Could not retrieve geometry layout. TR process is not to be trusted in the following");
65 throw std::runtime_error(
"Could not retrieve geometry layout!");
70 if (!fb.open(
name,std::ios::in)){
72 throw std::runtime_error(
"Could not open file!");
78 for( boost::property_tree::ptree::value_type
const&
v :
pt.get_child(
"FADS") ) {
79 if(
v.first ==
"TRRegionParameters" ) {
81 std::string volName=
v.second.get<std::string>(
"<xmlattr>.RadiatorName");
82 double foilThickness=
v.second.get<
double>(
"<xmlattr>.RadiatorFoilThickness");
83 double gasThickness=
v.second.get<
double>(
"<xmlattr>.RadiatorGasThickness");
84 int regionFlag=
v.second.get<
int>(
"<xmlattr>.RadiatorBARRELorENDCAP");
85 std::string detectorPart=
v.second.get<std::string>(
"<xmlattr>.DetectorPart");
87 G4LogicalVolumeStore *g4lvs = G4LogicalVolumeStore::GetInstance();
88 unsigned int numberOfVolumes = 0;
89 for (
const auto log_vol : *g4lvs){
90 if (volName ==
static_cast<const std::string&
>(log_vol->GetName())) {
92 foilThickness,gasThickness,
99 if( numberOfVolumes == 0 ) {
104 if ( ( volName!=
"TRT::MainRadiatorC" ) &&
105 ( volName!=
"TRT::ThinRadiatorC" ) ) {
107 <<
" not found! Geometry layout "