ATLAS Offline Software
GeoModelSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELSVC_GEOMODELSVC_H
6 #define GEOMODELSVC_GEOMODELSVC_H
7 
8 #include "GeoModelInterfaces/IGeoModelSvc.h" //inheritance
9 #include "EventInfoMgt/ITagInfoMgr.h"//inheritance
10 #include "AthenaBaseComps/AthService.h" //inheritance
11 
12 #include "GeoModelInterfaces/IGeoDbTagSvc.h" //SvcHandle template
13 #include "GeoModelInterfaces/IGeoModelTool.h" //ToolHandle template
14 #include "GeoModelDBManager/GMDBManager.h" //unique_ptr with compiler d'tor
15 #include "GeoModelRead/ReadGeoModel.h" //unique_ptr with compiler d'tor
16 #include "GaudiKernel/ServiceHandle.h" //member
17 #include "GaudiKernel/ToolHandle.h" //member
18 #include "Gaudi/Property.h" //member
19 
20 #include "CxxUtils/checker_macros.h" //ATLAS_NOT_THREAD_SAFE()
21 #include "StoreGate/StoreGateSvc.h" //SvcHandle template
22 #include <memory> //unique_ptr
23 
24 class ISvcLocator;
25 
26 class GeoModelSvc : public extends<AthService,
27  IGeoModelSvc>,
28  virtual public ITagInfoMgr::Listener
29 {
30 public:
31  // Standard Constructor
32  GeoModelSvc(const std::string& name, ISvcLocator* svc);
33 
35  virtual StatusCode finalize() override;
36 
38  virtual void tagInfoUpdated() override final;
39 
41 
42  virtual const IGeoModelTool* getTool(std::string toolName) const override;
43 
44  virtual StatusCode clear() override;
45 
46 private:
47  ToolHandleArray<IGeoModelTool> m_detectorTools{this,"DetectorTools",{}};
48 
49  ISvcLocator* m_pSvcLocator{nullptr};
50 
51  ServiceHandle<StoreGateSvc> m_detStore{this,"DetectorStore","DetectorStore",""};
52  ServiceHandle<ITagInfoMgr> m_tagInfoMgr{this,"TagInfoMgr","TagInfoMgr",""};
53  ServiceHandle<IGeoDbTagSvc> m_geoDbTagSvc{this,"GeoDbTagSvc","GeoDbTagSvc",""};
54 
55  Gaudi::Property<std::string> m_atlasVersion{this,"AtlasVersion","","ATLAS Geometry Tag"};
56 
57  Gaudi::Property<std::string> m_inDetVersionOverride{this,"InDetVersionOverride","","Overrider for InDet version"};
58  Gaudi::Property<std::string> m_pixelVersionOverride{this,"PixelVersionOverride","","Overrider for Pixel version"};
59  Gaudi::Property<std::string> m_sctVersionOverride{this,"SCT_VersionOverride","","Overrider for SCT version"};
60  Gaudi::Property<std::string> m_trtVersionOverride{this,"TRT_VersionOverride","","Overrider for TRT version"};
61  Gaudi::Property<std::string> m_larVersionOverride{this,"LAr_VersionOverride","","Overrider for LAr version"};
62  Gaudi::Property<std::string> m_tileVersionOverride{this,"TileVersionOverride","","Overrider for Tile version"};
63  Gaudi::Property<std::string> m_muonVersionOverride{this,"MuonVersionOverride","","Overrider for Muon version"};
64  Gaudi::Property<std::string> m_caloVersionOverride{this,"CaloVersionOverride","","Overrider for Calo version"};
65  Gaudi::Property<std::string> m_bFieldVersionOverride{this,"MagFieldVersionOverride","","Overrider for MagField version"};
66  Gaudi::Property<std::string> m_cavInfraVersionOverride{this,"CavernInfraVersionOverride","","Overrider for CavernInfra version"};
67  Gaudi::Property<std::string> m_forDetVersionOverride{this,"ForwardDetectorsVersionOverride","","Overrider for Forward Detectors version"};
68 
69  Gaudi::Property<bool> m_callBackON{this,"AlignCallbacks",true,"Read alignment in callbacks"};
70  Gaudi::Property<bool> m_ignoreTagDifference{this,"IgnoreTagDifference",false,"Ignore TagInfo and configuration tag diffs"};
71 
72  Gaudi::Property<bool> m_useTagInfo{this,"UseTagInfo",true,"Use TagInfo"};
73  Gaudi::Property<bool> m_statisticsToFile{this,"StatisticsToFile",false,"Generate GeoModelStatistics file in the run directory"};
74 
75  Gaudi::Property<int> m_supportedGeometry{this,"SupportedGeometry",0,"Supported geometry flag is set in jobOpt and is equal to major release version"};
76  Gaudi::Property<bool> m_ignoreTagSupport{this,"IgnoreTagSupport",false,"Skip checking if the geometry tag is supported/obsolete"};
77 
78  Gaudi::Property<bool> m_emecStandard{this,"EMECStandard",false,"Activate the EMEC construction from standard Geant4 Shapes: G4GenericTrap"};
79 
80  Gaudi::Property<bool> m_sqliteDb{this,"SQLiteDB",false,"Activate GeoModel initialization from SQLite"};
81  Gaudi::Property<std::string> m_sqliteDbFullPath{this,"SQLiteDBFullPath","","Explicit setting of full path to SQLiteDB. For testing purposes only"};
82 
83 
84  std::unique_ptr<GeoModelIO::ReadGeoModel> m_sqliteReader{};
85  std::unique_ptr<GMDBManager> m_sqliteDbManager{};
86 
87  virtual const std::string & atlasVersion() const override {return m_atlasVersion;}
88  virtual const std::string & inDetVersionOverride() const override {return m_inDetVersionOverride;}
89  virtual const std::string & pixelVersionOverride() const override {return m_pixelVersionOverride;}
90  virtual const std::string & SCT_VersionOverride() const override {return m_sctVersionOverride;}
91  virtual const std::string & TRT_VersionOverride() const override {return m_trtVersionOverride;}
92  virtual const std::string & LAr_VersionOverride() const override {return m_larVersionOverride;}
93  virtual const std::string & tileVersionOverride() const override {return m_tileVersionOverride;}
94  virtual const std::string & muonVersionOverride() const override {return m_muonVersionOverride;}
95  virtual const std::string & caloVersionOverride() const override {return m_caloVersionOverride;}
96  virtual const std::string & magFieldVersionOverride() const override {return m_bFieldVersionOverride;}
97  virtual const std::string & cavernInfraVersionOverride() const override {return m_cavInfraVersionOverride;}
98  virtual const std::string & forwardDetectorsVersionOverride() const override {return m_forDetVersionOverride;}
99 
100  virtual const std::string & inDetVersion() const override {return m_geoDbTagSvc->inDetVersion();}
101  virtual const std::string & pixelVersion() const override {return m_geoDbTagSvc->pixelVersion();}
102  virtual const std::string & SCT_Version() const override {return m_geoDbTagSvc->SCT_Version();}
103  virtual const std::string & TRT_Version() const override {return m_geoDbTagSvc->TRT_Version();}
104  virtual const std::string & LAr_Version() const override {return m_geoDbTagSvc->LAr_Version();}
105  virtual const std::string & tileVersion() const override {return m_geoDbTagSvc->tileVersion();}
106  virtual const std::string & muonVersion() const override {return m_geoDbTagSvc->muonVersion();}
107  virtual const std::string & caloVersion() const override {return m_geoDbTagSvc->caloVersion();}
108  virtual const std::string & magFieldVersion() const override {return m_geoDbTagSvc->magFieldVersion();}
109  virtual const std::string & cavernInfraVersion() const override {return m_geoDbTagSvc->cavernInfraVersion();}
110  virtual const std::string & forwardDetectorsVersion() const override {return m_geoDbTagSvc->forwardDetectorsVersion();}
111 
112  virtual GeoModel::GeoConfig geoConfig() const override {return m_geoDbTagSvc->geoConfig();}
113 
114  virtual const bool & isEmecStandard() const override {return m_emecStandard;}
115 
117  StatusCode fillTagInfo() const;
118 };
119 
120 #endif // GEOMODELSVC_GEOMODELSVC_H
121 
GeoModelSvc::caloVersionOverride
virtual const std::string & caloVersionOverride() const override
Definition: GeoModelSvc.h:95
GeoModelSvc::m_sctVersionOverride
Gaudi::Property< std::string > m_sctVersionOverride
Definition: GeoModelSvc.h:59
GeoModelSvc::m_tileVersionOverride
Gaudi::Property< std::string > m_tileVersionOverride
Definition: GeoModelSvc.h:62
GeoModelSvc::m_muonVersionOverride
Gaudi::Property< std::string > m_muonVersionOverride
Definition: GeoModelSvc.h:63
GeoModelSvc::isEmecStandard
virtual const bool & isEmecStandard() const override
Definition: GeoModelSvc.h:114
GeoModelSvc::m_trtVersionOverride
Gaudi::Property< std::string > m_trtVersionOverride
Definition: GeoModelSvc.h:60
GeoModelSvc::forwardDetectorsVersionOverride
virtual const std::string & forwardDetectorsVersionOverride() const override
Definition: GeoModelSvc.h:98
GeoModelSvc::m_sqliteDbFullPath
Gaudi::Property< std::string > m_sqliteDbFullPath
Definition: GeoModelSvc.h:81
GeoModelSvc::cavernInfraVersionOverride
virtual const std::string & cavernInfraVersionOverride() const override
Definition: GeoModelSvc.h:97
GeoModelSvc::tileVersionOverride
virtual const std::string & tileVersionOverride() const override
Definition: GeoModelSvc.h:93
GeoModel::GeoConfig
GeoConfig
Definition: IGeoDbTagSvc.h:17
GeoModelSvc::getTool
virtual const IGeoModelTool * getTool(std::string toolName) const override
Definition: GeoModelSvc.cxx:562
initialize
void initialize()
Definition: run_EoverP.cxx:894
ITagInfoMgr.h
GeoModelSvc::tagInfoUpdated
virtual void tagInfoUpdated() override final
Callback from TagInfoMgr on TagInfo change.
Definition: GeoModelSvc.cxx:323
GeoModelSvc::finalize
virtual StatusCode finalize() override
Definition: GeoModelSvc.cxx:117
GeoModelSvc::caloVersion
virtual const std::string & caloVersion() const override
Definition: GeoModelSvc.h:107
GeoModelSvc::m_callBackON
Gaudi::Property< bool > m_callBackON
Definition: GeoModelSvc.h:69
GeoModelSvc::atlasVersion
virtual const std::string & atlasVersion() const override
Definition: GeoModelSvc.h:87
GeoModelSvc::m_supportedGeometry
Gaudi::Property< int > m_supportedGeometry
Definition: GeoModelSvc.h:75
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
GeoModelSvc::muonVersion
virtual const std::string & muonVersion() const override
Definition: GeoModelSvc.h:106
GeoModelSvc::fillTagInfo
StatusCode fillTagInfo() const
Definition: GeoModelSvc.cxx:470
GeoModelSvc::pixelVersionOverride
virtual const std::string & pixelVersionOverride() const override
Definition: GeoModelSvc.h:89
GeoModelSvc::pixelVersion
virtual const std::string & pixelVersion() const override
Definition: GeoModelSvc.h:101
GeoModelSvc::m_useTagInfo
Gaudi::Property< bool > m_useTagInfo
Definition: GeoModelSvc.h:72
GeoModelSvc::m_atlasVersion
Gaudi::Property< std::string > m_atlasVersion
Definition: GeoModelSvc.h:55
GeoModelSvc::SCT_Version
virtual const std::string & SCT_Version() const override
Definition: GeoModelSvc.h:102
GeoModelSvc::ATLAS_NOT_THREAD_SAFE
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
GeoModelSvc::muonVersionOverride
virtual const std::string & muonVersionOverride() const override
Definition: GeoModelSvc.h:94
GeoModelSvc::m_sqliteReader
std::unique_ptr< GeoModelIO::ReadGeoModel > m_sqliteReader
Definition: GeoModelSvc.h:84
ITagInfoMgr::Listener
Listener interface class that client who want to be notified about TagInfo update should implement (a...
Definition: ITagInfoMgr.h:72
GeoModelSvc::m_detectorTools
ToolHandleArray< IGeoModelTool > m_detectorTools
Definition: GeoModelSvc.h:47
GeoModelSvc::tileVersion
virtual const std::string & tileVersion() const override
Definition: GeoModelSvc.h:105
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
GeoModelSvc::LAr_Version
virtual const std::string & LAr_Version() const override
Definition: GeoModelSvc.h:104
GeoModelSvc::m_caloVersionOverride
Gaudi::Property< std::string > m_caloVersionOverride
Definition: GeoModelSvc.h:64
GeoModelSvc::TRT_VersionOverride
virtual const std::string & TRT_VersionOverride() const override
Definition: GeoModelSvc.h:91
GeoModelSvc::LAr_VersionOverride
virtual const std::string & LAr_VersionOverride() const override
Definition: GeoModelSvc.h:92
GeoModelSvc
Definition: GeoModelSvc.h:29
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
GeoModelSvc::magFieldVersionOverride
virtual const std::string & magFieldVersionOverride() const override
Definition: GeoModelSvc.h:96
GeoModelSvc::m_inDetVersionOverride
Gaudi::Property< std::string > m_inDetVersionOverride
Definition: GeoModelSvc.h:57
GeoModelSvc::geoConfig
virtual GeoModel::GeoConfig geoConfig() const override
Definition: GeoModelSvc.h:112
GeoModelSvc::clear
virtual StatusCode clear() override
Definition: GeoModelSvc.cxx:572
IGeoModelTool.h
GeoModelSvc::m_forDetVersionOverride
Gaudi::Property< std::string > m_forDetVersionOverride
Definition: GeoModelSvc.h:67
GeoModelSvc::m_pixelVersionOverride
Gaudi::Property< std::string > m_pixelVersionOverride
Definition: GeoModelSvc.h:58
GeoModelSvc::m_larVersionOverride
Gaudi::Property< std::string > m_larVersionOverride
Definition: GeoModelSvc.h:61
GeoModelSvc::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition: GeoModelSvc.h:53
GeoModelSvc::m_pSvcLocator
ISvcLocator * m_pSvcLocator
Definition: GeoModelSvc.h:49
GeoModelSvc::m_emecStandard
Gaudi::Property< bool > m_emecStandard
Definition: GeoModelSvc.h:78
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
GeoModelSvc::m_tagInfoMgr
ServiceHandle< ITagInfoMgr > m_tagInfoMgr
Definition: GeoModelSvc.h:52
GeoModelSvc::m_cavInfraVersionOverride
Gaudi::Property< std::string > m_cavInfraVersionOverride
Definition: GeoModelSvc.h:66
GeoModelSvc::TRT_Version
virtual const std::string & TRT_Version() const override
Definition: GeoModelSvc.h:103
IGeoModelTool
Definition: IGeoModelTool.h:12
GeoModelSvc::m_statisticsToFile
Gaudi::Property< bool > m_statisticsToFile
Definition: GeoModelSvc.h:73
GeoModelSvc::inDetVersion
virtual const std::string & inDetVersion() const override
Definition: GeoModelSvc.h:100
GeoModelSvc::m_sqliteDb
Gaudi::Property< bool > m_sqliteDb
Definition: GeoModelSvc.h:80
GeoModelSvc::forwardDetectorsVersion
virtual const std::string & forwardDetectorsVersion() const override
Definition: GeoModelSvc.h:110
GeoModelSvc::geoInit
StatusCode geoInit()
Definition: GeoModelSvc.cxx:123
AthService.h
GeoModelSvc::compareTags
StatusCode compareTags()
Definition: GeoModelSvc.cxx:329
GeoModelSvc::GeoModelSvc
GeoModelSvc(const std::string &name, ISvcLocator *svc)
Definition: GeoModelSvc.cxx:30
GeoModelSvc::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: GeoModelSvc.h:51
GeoModelSvc::m_sqliteDbManager
std::unique_ptr< GMDBManager > m_sqliteDbManager
Definition: GeoModelSvc.h:85
GeoModelSvc::m_bFieldVersionOverride
Gaudi::Property< std::string > m_bFieldVersionOverride
Definition: GeoModelSvc.h:65
GeoModelSvc::magFieldVersion
virtual const std::string & magFieldVersion() const override
Definition: GeoModelSvc.h:108
checker_macros.h
Define macros for attributes used to control the static checker.
IGeoModelSvc.h
GeoModelSvc::m_ignoreTagSupport
Gaudi::Property< bool > m_ignoreTagSupport
Definition: GeoModelSvc.h:76
StoreGateSvc.h
GeoModelSvc::SCT_VersionOverride
virtual const std::string & SCT_VersionOverride() const override
Definition: GeoModelSvc.h:90
IGeoDbTagSvc.h
GeoModelSvc::cavernInfraVersion
virtual const std::string & cavernInfraVersion() const override
Definition: GeoModelSvc.h:109
GeoModelSvc::inDetVersionOverride
virtual const std::string & inDetVersionOverride() const override
Definition: GeoModelSvc.h:88
ServiceHandle< StoreGateSvc >
GeoModelSvc::m_ignoreTagDifference
Gaudi::Property< bool > m_ignoreTagDifference
Definition: GeoModelSvc.h:70