ATLAS Offline Software
Loading...
Searching...
No Matches
GeoModelSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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 "StoreGate/StoreGateSvc.h" //SvcHandle template
21#include <memory> //unique_ptr
22
23class ISvcLocator;
24
25class GeoModelSvc : public extends<AthService,
26 IGeoModelSvc>,
27 virtual public ITagInfoMgr::Listener
28{
29public:
30 // Standard Constructor
31 GeoModelSvc(const std::string& name, ISvcLocator* svc);
32
33 virtual StatusCode initialize() override;
34 virtual StatusCode finalize() override;
35
37 virtual void tagInfoUpdated() override final;
38
39 StatusCode compareTags();
40
41 virtual const IGeoModelTool* getTool(std::string toolName) const override;
42
43 virtual StatusCode clear() override;
44
45private:
46 ToolHandleArray<IGeoModelTool> m_detectorTools{this,"DetectorTools",{}};
47
48 ISvcLocator* m_pSvcLocator{nullptr};
49
50 ServiceHandle<StoreGateSvc> m_detStore{this,"DetectorStore","DetectorStore",""};
51 ServiceHandle<ITagInfoMgr> m_tagInfoMgr{this,"TagInfoMgr","TagInfoMgr",""};
52 ServiceHandle<IGeoDbTagSvc> m_geoDbTagSvc{this,"GeoDbTagSvc","GeoDbTagSvc",""};
53
54 Gaudi::Property<std::string> m_atlasVersion{this,"AtlasVersion","","ATLAS Geometry Tag"};
55
56 Gaudi::Property<std::string> m_inDetVersionOverride{this,"InDetVersionOverride","","Overrider for InDet version"};
57 Gaudi::Property<std::string> m_pixelVersionOverride{this,"PixelVersionOverride","","Overrider for Pixel version"};
58 Gaudi::Property<std::string> m_sctVersionOverride{this,"SCT_VersionOverride","","Overrider for SCT version"};
59 Gaudi::Property<std::string> m_trtVersionOverride{this,"TRT_VersionOverride","","Overrider for TRT version"};
60 Gaudi::Property<std::string> m_larVersionOverride{this,"LAr_VersionOverride","","Overrider for LAr version"};
61 Gaudi::Property<std::string> m_tileVersionOverride{this,"TileVersionOverride","","Overrider for Tile version"};
62 Gaudi::Property<std::string> m_muonVersionOverride{this,"MuonVersionOverride","","Overrider for Muon version"};
63 Gaudi::Property<std::string> m_caloVersionOverride{this,"CaloVersionOverride","","Overrider for Calo version"};
64 Gaudi::Property<std::string> m_bFieldVersionOverride{this,"MagFieldVersionOverride","","Overrider for MagField version"};
65 Gaudi::Property<std::string> m_cavInfraVersionOverride{this,"CavernInfraVersionOverride","","Overrider for CavernInfra version"};
66 Gaudi::Property<std::string> m_forDetVersionOverride{this,"ForwardDetectorsVersionOverride","","Overrider for Forward Detectors version"};
67
68 Gaudi::Property<bool> m_useTagInfo{this,"UseTagInfo",true,"Use TagInfo"};
69 Gaudi::Property<bool> m_checkTagInfo{this,"CheckTagInfo",true,"Compare TagInfo from the job configuration with the one in the input file"};
70 Gaudi::Property<bool> m_ignoreTagDifference{this,"IgnoreTagDifference",false,"Ignore TagInfo and configuration tag diffs"};
71
72 Gaudi::Property<bool> m_statisticsToFile{this,"StatisticsToFile",false,"Generate GeoModelStatistics file in the run directory"};
73
74 Gaudi::Property<int> m_supportedGeometry{this,"SupportedGeometry",0,"Supported geometry flag is set in jobOpt and is equal to major release version"};
75 Gaudi::Property<bool> m_ignoreTagSupport{this,"IgnoreTagSupport",false,"Skip checking if the geometry tag is supported/obsolete"};
76
77 Gaudi::Property<bool> m_emecStandard{this,"EMECStandard",false,"Activate the EMEC construction from standard Geant4 Shapes: G4GenericTrap"};
78
79 Gaudi::Property<bool> m_sqliteDb{this,"SQLiteDB",false,"Activate GeoModel initialization from SQLite"};
80 Gaudi::Property<std::string> m_sqliteDbFullPath{this,"SQLiteDBFullPath","","Explicit setting of full path to SQLiteDB. For testing purposes only"};
81 Gaudi::Property<unsigned> m_nTheads{this, "nThreads", 0, "Number of available threads for the geometry reading"};
82
83 std::unique_ptr<GeoModelIO::ReadGeoModel> m_sqliteReader{};
84 std::shared_ptr<GMDBManager> m_sqliteDbManager{};
85
86 virtual const std::string & atlasVersion() const override {return m_atlasVersion;}
87 virtual const std::string & inDetVersionOverride() const override {return m_inDetVersionOverride;}
88 virtual const std::string & pixelVersionOverride() const override {return m_pixelVersionOverride;}
89 virtual const std::string & SCT_VersionOverride() const override {return m_sctVersionOverride;}
90 virtual const std::string & TRT_VersionOverride() const override {return m_trtVersionOverride;}
91 virtual const std::string & LAr_VersionOverride() const override {return m_larVersionOverride;}
92 virtual const std::string & tileVersionOverride() const override {return m_tileVersionOverride;}
93 virtual const std::string & muonVersionOverride() const override {return m_muonVersionOverride;}
94 virtual const std::string & caloVersionOverride() const override {return m_caloVersionOverride;}
95 virtual const std::string & magFieldVersionOverride() const override {return m_bFieldVersionOverride;}
96 virtual const std::string & cavernInfraVersionOverride() const override {return m_cavInfraVersionOverride;}
97 virtual const std::string & forwardDetectorsVersionOverride() const override {return m_forDetVersionOverride;}
98
99 virtual const std::string & inDetVersion() const override {return m_geoDbTagSvc->inDetVersion();}
100 virtual const std::string & pixelVersion() const override {return m_geoDbTagSvc->pixelVersion();}
101 virtual const std::string & SCT_Version() const override {return m_geoDbTagSvc->SCT_Version();}
102 virtual const std::string & TRT_Version() const override {return m_geoDbTagSvc->TRT_Version();}
103 virtual const std::string & LAr_Version() const override {return m_geoDbTagSvc->LAr_Version();}
104 virtual const std::string & tileVersion() const override {return m_geoDbTagSvc->tileVersion();}
105 virtual const std::string & muonVersion() const override {return m_geoDbTagSvc->muonVersion();}
106 virtual const std::string & caloVersion() const override {return m_geoDbTagSvc->caloVersion();}
107 virtual const std::string & magFieldVersion() const override {return m_geoDbTagSvc->magFieldVersion();}
108 virtual const std::string & cavernInfraVersion() const override {return m_geoDbTagSvc->cavernInfraVersion();}
109 virtual const std::string & forwardDetectorsVersion() const override {return m_geoDbTagSvc->forwardDetectorsVersion();}
110
111 virtual GeoModel::GeoConfig geoConfig() const override {return m_geoDbTagSvc->geoConfig();}
112
113 virtual const bool & isEmecStandard() const override {return m_emecStandard;}
114
115 StatusCode geoInit();
116 StatusCode fillTagInfo() const;
117};
118
119#endif // GEOMODELSVC_GEOMODELSVC_H
120
ServiceHandle< ITagInfoMgr > m_tagInfoMgr
Definition GeoModelSvc.h:51
Gaudi::Property< bool > m_ignoreTagSupport
Definition GeoModelSvc.h:75
virtual void tagInfoUpdated() override final
Callback from TagInfoMgr on TagInfo change.
virtual const std::string & TRT_Version() const override
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_muonVersionOverride
Definition GeoModelSvc.h:62
Gaudi::Property< std::string > m_atlasVersion
Definition GeoModelSvc.h:54
virtual const IGeoModelTool * getTool(std::string toolName) const override
virtual const std::string & TRT_VersionOverride() const override
Definition GeoModelSvc.h:90
virtual const std::string & magFieldVersion() const override
virtual const std::string & cavernInfraVersionOverride() const override
Definition GeoModelSvc.h:96
Gaudi::Property< unsigned > m_nTheads
Definition GeoModelSvc.h:81
Gaudi::Property< int > m_supportedGeometry
Definition GeoModelSvc.h:74
std::unique_ptr< GeoModelIO::ReadGeoModel > m_sqliteReader
Definition GeoModelSvc.h:83
virtual GeoModel::GeoConfig geoConfig() const override
Gaudi::Property< std::string > m_larVersionOverride
Definition GeoModelSvc.h:60
StatusCode geoInit()
Gaudi::Property< std::string > m_bFieldVersionOverride
Definition GeoModelSvc.h:64
virtual const std::string & SCT_VersionOverride() const override
Definition GeoModelSvc.h:89
ServiceHandle< StoreGateSvc > m_detStore
Definition GeoModelSvc.h:50
virtual const std::string & pixelVersion() const override
Gaudi::Property< std::string > m_sqliteDbFullPath
Definition GeoModelSvc.h:80
Gaudi::Property< std::string > m_tileVersionOverride
Definition GeoModelSvc.h:61
virtual const std::string & magFieldVersionOverride() const override
Definition GeoModelSvc.h:95
Gaudi::Property< std::string > m_trtVersionOverride
Definition GeoModelSvc.h:59
StatusCode fillTagInfo() const
virtual const std::string & inDetVersion() const override
Definition GeoModelSvc.h:99
virtual const std::string & caloVersion() const override
virtual const std::string & caloVersionOverride() const override
Definition GeoModelSvc.h:94
virtual const std::string & inDetVersionOverride() const override
Definition GeoModelSvc.h:87
virtual const std::string & atlasVersion() const override
Definition GeoModelSvc.h:86
virtual const std::string & muonVersion() const override
Gaudi::Property< bool > m_ignoreTagDifference
Definition GeoModelSvc.h:70
Gaudi::Property< bool > m_sqliteDb
Definition GeoModelSvc.h:79
Gaudi::Property< bool > m_emecStandard
Definition GeoModelSvc.h:77
virtual const std::string & muonVersionOverride() const override
Definition GeoModelSvc.h:93
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:66
ISvcLocator * m_pSvcLocator
Definition GeoModelSvc.h:48
virtual const std::string & tileVersionOverride() const override
Definition GeoModelSvc.h:92
Gaudi::Property< bool > m_checkTagInfo
Definition GeoModelSvc.h:69
virtual const std::string & pixelVersionOverride() const override
Definition GeoModelSvc.h:88
virtual const std::string & forwardDetectorsVersionOverride() const override
Definition GeoModelSvc.h:97
Gaudi::Property< std::string > m_inDetVersionOverride
Definition GeoModelSvc.h:56
GeoModelSvc(const std::string &name, ISvcLocator *svc)
Gaudi::Property< std::string > m_caloVersionOverride
Definition GeoModelSvc.h:63
virtual const std::string & tileVersion() const override
Gaudi::Property< std::string > m_pixelVersionOverride
Definition GeoModelSvc.h:57
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition GeoModelSvc.h:52
std::shared_ptr< GMDBManager > m_sqliteDbManager
Definition GeoModelSvc.h:84
ToolHandleArray< IGeoModelTool > m_detectorTools
Definition GeoModelSvc.h:46
Gaudi::Property< std::string > m_sctVersionOverride
Definition GeoModelSvc.h:58
Gaudi::Property< std::string > m_cavInfraVersionOverride
Definition GeoModelSvc.h:65
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:91
StatusCode compareTags()
Gaudi::Property< bool > m_statisticsToFile
Definition GeoModelSvc.h:72
virtual StatusCode clear() override
Gaudi::Property< bool > m_useTagInfo
Definition GeoModelSvc.h:68
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