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)
55 ATH_MSG_FATAL(
"LAr GeoModel description has already been built. LArDetectorToolNV::create() cannot be called more than once!");
56 return StatusCode::FAILURE;
61 ATH_CHECK(detStore()->record(hvManager,
"LArHVManager"));
70 GeoModelIO::ReadGeoModel* sqliteReader = geoDbTag->getSqliteReader();
71 std::string detectorKey{
""};
72 std::string detectorNode{
""};
76 std::string AtlasVersion = geoDbTag->atlasVersion();
77 std::string LArVersion = geoDbTag->LAr_VersionOverride();
79 detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
80 detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
81 ATH_MSG_INFO(
"Keys for LAr are " << detectorKey <<
" " << detectorNode);
82 ATH_MSG_INFO(
"Building LAr version " << geoDbTag->LAr_Version()
83 <<
" while ATLAS version is " << AtlasVersion);
86 IRDBRecordset_ptr switchSet = accessSvc->getRecordsetPtr(
"LArSwitches", detectorKey, detectorNode);
87 if ((*switchSet).size()==0) {
88 ATH_MSG_ERROR(
"Unable to retrieve LArSwitches from Geometry DB");
89 return StatusCode::FAILURE;
110 ATH_CHECK(detStore()->retrieve(theExpt,
"ATLAS"));
115 GeoIntrusivePtr<GeoPhysVol>world=theExpt->
getPhysVol();
119 , accessSvc.operator->()
123 theLArFactoryLite.
create(world);
126 std::unique_ptr<LArGeo::VDetectorParameters> params = std::make_unique<LArGeo::RAL>();
134 std::string LArTag = accessSvc->getChildTag(
"LAr",detectorKey,detectorNode);
135 if(LArTag.find(
"H8")!=std::string::npos) {
138 else if(LArTag.find(
"H6")!=std::string::npos) {
156 theLArFactory.
create(world);
167 return StatusCode::SUCCESS;
173 StatusCode status(StatusCode::SUCCESS);
174 std::vector<std::string> sgkeysFPV;
177 for (
const std::string& stored : sgkeysFPV) {
178 status = detStore()->retrieve(storedPV,stored);
179 if(status.isFailure()) {
185 storedPV->
getPhysVol()->getAbsoluteTransform();
186 storedPV->
getPhysVol()->getDefAbsoluteTransform();
190 for (
const std::string& stored : sgkeysFPV) {
191 status = detStore()->retrieve(storedPV,stored);
192 if(status.isFailure()) {
203 std::vector<std::string> sgkeysAXF;
205 for (
const std::string& stored : sgkeysAXF) {
207 if(proxy) proxy->reset();
217 return StatusCode::SUCCESS;
224 return StatusCode::SUCCESS;
228 ATH_MSG_ERROR(
" LArDetDescrManager not created yet, cannot align !");
229 return StatusCode::FAILURE;
238 return StatusCode::FAILURE;
243 ATH_MSG_DEBUG(
" No LAr DetCondKeyTrans in SG, skipping align() ");
246 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...
Definition of the abstract IRDBAccessSvc interface.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition of the abstract IRDBRecord interface.
Definition of the abstract IRDBRecordset interface.
Class to hold set of HepGeom::Transform3D keyed by string value for storage in the conditions DB typi...
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