5 #include "LArReadoutGeometry/FCAL_ChannelMap.h"
13 #include "GaudiKernel/IService.h"
14 #include "GaudiKernel/ISvcLocator.h"
15 #include "GaudiKernel/Bootstrap.h"
16 #include "GaudiKernel/MsgStream.h"
17 #include "GaudiKernel/IMessageSvc.h"
24 #include "GeoModelKernel/GeoAlignableTransform.h"
25 #include "GeoModelKernel/GeoGraphNode.h"
31 #include "GeoModelKernel/GeoFullPhysVol.h"
32 #include "GeoModelRead/ReadGeoModel.h"
39 #define LAR_ALIGN "/LAR/Align"
43 ,
const std::string&
name
44 ,
const IInterface*
parent)
46 , m_barrelSaggingOn(false)
47 , m_barrelVisLimit(-1)
51 , m_applyAlignments(false)
53 , m_geometryConfig(
"FULL")
54 , m_EMECVariantInner(
"Wheel")
55 , m_EMECVariantOuter(
"Wheel")
59 declareProperty(
"SaggingBarrelAccordeon",m_barrelSaggingOn);
60 declareProperty(
"BarrelCellVisLimit", m_barrelVisLimit);
61 declareProperty(
"FCALVisLimit", m_fcalVisLimit);
63 declareProperty(
"BuildBarrel", m_buildBarrel);
64 declareProperty(
"BuildEndcap", m_buildEndcap);
65 declareProperty(
"ApplyAlignments", m_applyAlignments);
66 declareProperty(
"GeometryConfig", m_geometryConfig);
67 declareProperty(
"EMECVariantInner", m_EMECVariantInner);
68 declareProperty(
"EMECVariantOuter", m_EMECVariantOuter);
69 declareProperty(
"ActivateFeedThrougs", m_activateFT);
70 declareProperty(
"EnableMBTS", m_enableMBTS);
79 ATH_MSG_FATAL(
"LAr GeoModel description has already been built. LArDetectorToolNV::create() cannot be called more than once!");
80 return StatusCode::FAILURE;
94 GeoModelIO::ReadGeoModel* sqliteReader = geoDbTag->getSqliteReader();
95 std::string detectorKey{
""};
96 std::string detectorNode{
""};
101 std::string LArVersion = geoDbTag->LAr_VersionOverride();
103 detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
104 detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
105 ATH_MSG_INFO(
"Keys for LAr are " << detectorKey <<
" " << detectorNode);
106 ATH_MSG_INFO(
"Building LAr version " << geoDbTag->LAr_Version()
110 IRDBRecordset_ptr switchSet = accessSvc->getRecordsetPtr(
"LArSwitches", detectorKey, detectorNode);
111 if ((*switchSet).size()==0) {
112 ATH_MSG_ERROR(
"Unable to retrieve LArSwitches from Geometry DB");
113 return StatusCode::FAILURE;
139 GeoIntrusivePtr<GeoPhysVol>world=theExpt->
getPhysVol();
143 , accessSvc.operator->()
147 theLArFactoryLite.create(world);
148 m_manager = theLArFactoryLite.getDetectorManager();
150 std::unique_ptr<LArGeo::VDetectorParameters>
params = std::make_unique<LArGeo::RAL>();
158 std::string LArTag = accessSvc->getChildTag(
"LAr",detectorKey,detectorNode);
159 if(LArTag.find(
"H8")!=std::string::npos) {
162 else if(LArTag.find(
"H6")!=std::string::npos) {
180 theLArFactory.create(world);
181 m_manager = theLArFactory.getDetectorManager();
191 return StatusCode::SUCCESS;
198 std::vector<std::string> sgkeysFPV;
201 for (
const std::string& stored : sgkeysFPV) {
209 storedPV->getPhysVol()->getAbsoluteTransform();
210 storedPV->getPhysVol()->getDefAbsoluteTransform();
214 for (
const std::string& stored : sgkeysFPV) {
222 storedPV->getPhysVol()->clear();
227 std::vector<std::string> sgkeysAXF;
229 for (
const std::string& stored : sgkeysAXF) {
241 return StatusCode::SUCCESS;
247 if(!m_applyAlignments) {
249 return StatusCode::FAILURE;
254 ATH_MSG_DEBUG( (
sc.isSuccess() ?
"Successfully registered" :
"Registration failed for")
255 <<
" callback on DetCondKeyTrans with folder " <<
LAR_ALIGN);
264 return StatusCode::SUCCESS;
268 ATH_MSG_ERROR(
" LArDetDescrManager not created yet, cannot align !");
269 return StatusCode::FAILURE;
283 return StatusCode::FAILURE;
289 return StatusCode::FAILURE;
294 ATH_MSG_DEBUG(
" No LAr DetCondKeyTrans in SG, skipping align() ");
297 return StatusCode::SUCCESS;