ATLAS Offline Software
Loading...
Searching...
No Matches
GeoModelSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
24class ISvcLocator;
25
26class GeoModelSvc : public extends<AthService,
27 IGeoModelSvc>,
28 virtual public ITagInfoMgr::Listener
29{
30public:
31 // Standard Constructor
32 GeoModelSvc(const std::string& name, ISvcLocator* svc);
33
34 virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override;
35 virtual StatusCode finalize() override;
36
38 virtual void tagInfoUpdated() override final;
39
40 StatusCode compareTags();
41
42 virtual const IGeoModelTool* getTool(std::string toolName) const override;
43
44 virtual StatusCode clear() override;
45
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 Gaudi::Property<unsigned> m_nTheads{this, "nThreads", 0, "Number of available threads for the geometry reading"};
83
84 std::unique_ptr<GeoModelIO::ReadGeoModel> m_sqliteReader{};
85 std::shared_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
116 StatusCode geoInit();
117 StatusCode fillTagInfo() const;
118};
119
120#endif // GEOMODELSVC_GEOMODELSVC_H
121
Define macros for attributes used to control the static checker.
ServiceHandle< ITagInfoMgr > m_tagInfoMgr
Definition GeoModelSvc.h:52
Gaudi::Property< bool > m_ignoreTagSupport
Definition GeoModelSvc.h:76
virtual void tagInfoUpdated() override final
Callback from TagInfoMgr on TagInfo change.
virtual const std::string & TRT_Version() const override
Gaudi::Property< std::string > m_muonVersionOverride
Definition GeoModelSvc.h:63
Gaudi::Property< std::string > m_atlasVersion
Definition GeoModelSvc.h:55
virtual const IGeoModelTool * getTool(std::string toolName) const override
virtual const std::string & TRT_VersionOverride() const override
Definition GeoModelSvc.h:91
virtual const std::string & magFieldVersion() const override
virtual const std::string & cavernInfraVersionOverride() const override
Definition GeoModelSvc.h:97
Gaudi::Property< unsigned > m_nTheads
Definition GeoModelSvc.h:82
Gaudi::Property< int > m_supportedGeometry
Definition GeoModelSvc.h:75
std::unique_ptr< GeoModelIO::ReadGeoModel > m_sqliteReader
Definition GeoModelSvc.h:84
virtual GeoModel::GeoConfig geoConfig() const override
Gaudi::Property< std::string > m_larVersionOverride
Definition GeoModelSvc.h:61
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
StatusCode geoInit()
Gaudi::Property< std::string > m_bFieldVersionOverride
Definition GeoModelSvc.h:65
virtual const std::string & SCT_VersionOverride() const override
Definition GeoModelSvc.h:90
ServiceHandle< StoreGateSvc > m_detStore
Definition GeoModelSvc.h:51
virtual const std::string & pixelVersion() const override
Gaudi::Property< std::string > m_sqliteDbFullPath
Definition GeoModelSvc.h:81
Gaudi::Property< std::string > m_tileVersionOverride
Definition GeoModelSvc.h:62
virtual const std::string & magFieldVersionOverride() const override
Definition GeoModelSvc.h:96
Gaudi::Property< std::string > m_trtVersionOverride
Definition GeoModelSvc.h:60
StatusCode fillTagInfo() const
virtual const std::string & inDetVersion() const override
virtual const std::string & caloVersion() const override
virtual const std::string & caloVersionOverride() const override
Definition GeoModelSvc.h:95
virtual const std::string & inDetVersionOverride() const override
Definition GeoModelSvc.h:88
virtual const std::string & atlasVersion() const override
Definition GeoModelSvc.h:87
virtual const std::string & muonVersion() const override
Gaudi::Property< bool > m_ignoreTagDifference
Definition GeoModelSvc.h:70
Gaudi::Property< bool > m_sqliteDb
Definition GeoModelSvc.h:80
Gaudi::Property< bool > m_emecStandard
Definition GeoModelSvc.h:78
virtual const std::string & muonVersionOverride() const override
Definition GeoModelSvc.h:94
virtual const bool & isEmecStandard() const override
virtual StatusCode finalize() override
virtual const std::string & SCT_Version() const override
Gaudi::Property< std::string > m_forDetVersionOverride
Definition GeoModelSvc.h:67
ISvcLocator * m_pSvcLocator
Definition GeoModelSvc.h:49
virtual const std::string & tileVersionOverride() const override
Definition GeoModelSvc.h:93
virtual const std::string & pixelVersionOverride() const override
Definition GeoModelSvc.h:89
virtual const std::string & forwardDetectorsVersionOverride() const override
Definition GeoModelSvc.h:98
Gaudi::Property< std::string > m_inDetVersionOverride
Definition GeoModelSvc.h:57
GeoModelSvc(const std::string &name, ISvcLocator *svc)
Gaudi::Property< std::string > m_caloVersionOverride
Definition GeoModelSvc.h:64
virtual const std::string & tileVersion() const override
Gaudi::Property< std::string > m_pixelVersionOverride
Definition GeoModelSvc.h:58
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition GeoModelSvc.h:53
Gaudi::Property< bool > m_callBackON
Definition GeoModelSvc.h:69
std::shared_ptr< GMDBManager > m_sqliteDbManager
Definition GeoModelSvc.h:85
ToolHandleArray< IGeoModelTool > m_detectorTools
Definition GeoModelSvc.h:47
Gaudi::Property< std::string > m_sctVersionOverride
Definition GeoModelSvc.h:59
Gaudi::Property< std::string > m_cavInfraVersionOverride
Definition GeoModelSvc.h:66
virtual const std::string & forwardDetectorsVersion() const override
virtual const std::string & cavernInfraVersion() const override
virtual const std::string & LAr_VersionOverride() const override
Definition GeoModelSvc.h:92
StatusCode compareTags()
Gaudi::Property< bool > m_statisticsToFile
Definition GeoModelSvc.h:73
virtual StatusCode clear() override
Gaudi::Property< bool > m_useTagInfo
Definition GeoModelSvc.h:72
virtual const std::string & LAr_Version() const override
Listener interface class that client who want to be notified about TagInfo update should implement (a...
Definition ITagInfoMgr.h:72
STL namespace.
void initialize()
#define private