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)
79 ATH_MSG_FATAL(
"LAr GeoModel description has already been built. LArDetectorToolNV::create() cannot be called more than once!");
80 return StatusCode::FAILURE;
85 ATH_CHECK(detStore()->record(hvManager,
"LArHVManager"));
94 GeoModelIO::ReadGeoModel* sqliteReader = geoDbTag->getSqliteReader();
95 std::string detectorKey{
""};
96 std::string detectorNode{
""};
100 std::string AtlasVersion = geoDbTag->atlasVersion();
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()
107 <<
" while ATLAS version is " << AtlasVersion);
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;
134 ATH_CHECK(detStore()->retrieve(theExpt,
"ATLAS"));
139 GeoIntrusivePtr<GeoPhysVol>world=theExpt->
getPhysVol();
143 , accessSvc.operator->()
147 theLArFactoryLite.
create(world);
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);
191 return StatusCode::SUCCESS;
197 StatusCode status(StatusCode::SUCCESS);
198 std::vector<std::string> sgkeysFPV;
201 for (
const std::string& stored : sgkeysFPV) {
202 status = detStore()->retrieve(storedPV,stored);
203 if(status.isFailure()) {
209 storedPV->
getPhysVol()->getAbsoluteTransform();
210 storedPV->
getPhysVol()->getDefAbsoluteTransform();
214 for (
const std::string& stored : sgkeysFPV) {
215 status = detStore()->retrieve(storedPV,stored);
216 if(status.isFailure()) {
227 std::vector<std::string> sgkeysAXF;
229 for (
const std::string& stored : sgkeysAXF) {
231 if(proxy) proxy->reset();
241 return StatusCode::SUCCESS;
248 return StatusCode::SUCCESS;
252 ATH_MSG_ERROR(
" LArDetDescrManager not created yet, cannot align !");
253 return StatusCode::FAILURE;
257 const DetCondKeyTrans* align{
nullptr};
267 return StatusCode::FAILURE;
273 return StatusCode::FAILURE;
278 ATH_MSG_DEBUG(
" No LAr DetCondKeyTrans in SG, skipping align() ");
281 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
#define IOVSVC_CALLBACK_ARGS
short hand for IOVSvc call back argument list, to be used when no access to formal arguments is neede...
Definition of the abstract IRDBAccessSvc interface.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition of the abstract IRDBRecord interface.
Definition of the abstract IRDBRecordset interface.
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)
IRDBRecord is one record in the IRDBRecordset object.
virtual bool isFieldNull(const std::string &fieldName) const =0
Check if the field value is NULL.
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
LArDetectorFactoryLite is invoked by the LArDetectorTool when the GeoModel description of LAr calorim...
void setBarrelSagging(bool flag)
virtual void create(GeoPhysVol *world) override
virtual const LArDetectorManager * getDetectorManager() const override
LArDetectorFactory builds GeoModel description of LAr calorimeter by calling relevant 'Construction' ...
void setBarrelSagging(bool flag)
void setFCALVisLimit(int maxCell)
void setBuildBarrel(bool flag)
std::unique_ptr< LArGeo::VDetectorParameters > moveParameters()
virtual void create(GeoPhysVol *world) override
void setEMECVariant(const std::string &inner, const std::string &outer)
void setActivateFT(bool flag)
void setEnableMBTS(bool flag)
void setBuildEndcap(bool flag)
void setBarrelCellVisLimit(int maxCell)
virtual const LArDetectorManager * getDetectorManager() const override
static void SetInstance(std::unique_ptr< VDetectorParameters >)
This class provides access to the High Voltage throughout the LAr.
GeoFullPhysVol * getPhysVol()
Destructor.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
::StatusCode StatusCode
StatusCode definition for legacy code.