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"
36 m_initialLayoutIdDict(false)
41 ISvcLocator * svcLocator = Gaudi::svcLocator();
46 if(
sc.isFailure() ) {
48 throw std::runtime_error(
"Unable to locate StoreGate!");
51 sc = svcLocator->service(
"DetectorStore",
detStore);
52 if(
sc.isFailure() ) {
54 throw std::runtime_error(
"Unable to locate DetectorStore!");
58 if (StatusCode::SUCCESS ==
detStore->retrieve(idDictMgr,
"IdDict")) {
62 (
tag ==
"initial_layout" ||
tag ==
"destaged_layout");
65 ATH_MSG_FATAL(
"Could not retrieve geometry layout. TR process is not to be trusted in the following");
66 throw std::runtime_error(
"Could not retrieve geometry layout!");
71 if (!fb.open(
name,std::ios::in)){
73 throw std::runtime_error(
"Could not open file!");
79 for( boost::property_tree::ptree::value_type
const&
v :
pt.get_child(
"FADS") ) {
80 if(
v.first ==
"TRRegionParameters" ) {
82 std::string volName=
v.second.get<std::string>(
"<xmlattr>.RadiatorName");
83 double foilThickness=
v.second.get<
double>(
"<xmlattr>.RadiatorFoilThickness");
84 double gasThickness=
v.second.get<
double>(
"<xmlattr>.RadiatorGasThickness");
85 int regionFlag=
v.second.get<
int>(
"<xmlattr>.RadiatorBARRELorENDCAP");
86 std::string detectorPart=
v.second.get<std::string>(
"<xmlattr>.DetectorPart");
88 G4LogicalVolumeStore *g4lvs = G4LogicalVolumeStore::GetInstance();
89 unsigned int numberOfVolumes = 0;
90 for (
const auto log_vol : *g4lvs){
91 if (volName ==
static_cast<const std::string&
>(log_vol->GetName())) {
93 foilThickness,gasThickness,
100 if( numberOfVolumes == 0 ) {
105 if ( ( volName!=
"TRT::MainRadiatorC" ) &&
106 ( volName!=
"TRT::ThinRadiatorC" ) ) {
108 <<
" not found! Geometry layout "