ATLAS Offline Software
Loading...
Searching...
No Matches
DetDescrDBEnvelopeSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#ifndef SUBDETECTORENVELOPES_DETDESCRDBENVELOPESVC_H
11#define SUBDETECTORENVELOPES_DETDESCRDBENVELOPESVC_H
12
13// STL includes
14#include <string>
15#include <vector>
16#include <utility>
17#include <array>
18
19// GaudiKernel & Athena
21
22// interface header file
24
25// Database includes
27
28// GeoModel
30
32using FallbackDoubleVector = std::vector<double>;
33
34class DetDescrDBEnvelopeSvc : public extends<AthService, IEnvelopeDefSvc>
35{
36public:
38 DetDescrDBEnvelopeSvc(const std::string& name, ISvcLocator* svc);
39
42
44 virtual StatusCode initialize() override;
45
47 virtual const RZPairVector& getRZBoundary( AtlasDetDescr::AtlasRegion region ) const override { return m_rz[region]; }
48
50 virtual const RZPairVector &getRPositiveZBoundary( AtlasDetDescr::AtlasRegion region ) const override { return m_rposz[region]; }
51
52private:
56 StatusCode retrieveRZBoundaryOptionalFallback( const std::string &dbNode,
59 RZPairVector &rzVec);
60
62 StatusCode retrieveRZBoundary( const std::string &node, RZPairVector &rzVec);
63
65 StatusCode fallbackRZBoundary( const FallbackDoubleVector &r,
67 RZPairVector &rzVec);
68
71 bool enableFallback();
72
74 ServiceHandle<IRDBAccessSvc> m_dbAccess{this, "RDBAccessSvc", "RDBAccessSvc"};
75
77 ServiceHandle<IGeoModelSvc> m_geoModelSvc{this, "GeoModelSvc", "GeoModelSvc"};
78
80 std::string m_atlasNode{"ATLAS"};
81 std::string m_atlasVersionTag{"AUTO"};
82
84 std::array<StringProperty,AtlasDetDescr::fNumAtlasRegions> m_node{{
85 {this, "DBUndefinedNode", ""} // Dummy
86 , {this, "DBInDetNode","InDetEnvelope"}
87 , {this, "DBBeamPipeNode", "BeamPipeEnvelope"}
88 , {this, "DBCaloNode", "CaloEnvelope"}
89 , {this, "DBMSNode", "MuonEnvelope"}
90 , {this, "DBCavernNode", "CavernEnvelope"}
91 }};
92
98
100 Gaudi::Property<bool> m_allowFallback{this, "EnableFallback", false};
101 bool m_doFallback{false};
102
103 std::array<DoubleArrayProperty,AtlasDetDescr::fNumAtlasRegions> m_fallbackR{{
104 {this, "FallbackUndefinedR", {}} //Dummy
105 , {this, "FallbackInDetR", {}}
106 , {this, "FallbackBeamPipeR", {}}
107 , {this, "FallbackCaloR", {}}
108 , {this, "FallbackMuonR", {}}
109 , {this, "FallbackCavernR", {}}
110 }};
111
112 std::array<DoubleArrayProperty,AtlasDetDescr::fNumAtlasRegions> m_fallbackZ{{
113 {this, "FallbackUndefinedZ", {}} //Dummy
114 , {this, "FallbackInDetZ", {}}
115 , {this, "FallbackBeamPipeZ", {}}
116 , {this, "FallbackCaloZ", {}}
117 , {this, "FallbackMuonZ", {}}
118 , {this, "FallbackCavernZ", {}}
119 }};
120};
121
122#endif // DETDESCRDBENVELOPESVC_H
std::vector< double > FallbackDoubleVector
datatype used for fallback solution
Definition of the abstract IRDBAccessSvc interface.
std::vector< RZPair > RZPairVector
Definition RZPair.h:18
#define z
~DetDescrDBEnvelopeSvc()
Destructor.
bool enableFallback()
enable fallback solution:
std::array< DoubleArrayProperty, AtlasDetDescr::fNumAtlasRegions > m_fallbackR
DetDescrDBEnvelopeSvc(const std::string &name, ISvcLocator *svc)
public AthService constructor
ServiceHandle< IGeoModelSvc > m_geoModelSvc
ATLAS GeoModel.
std::array< StringProperty, AtlasDetDescr::fNumAtlasRegions > m_node
the names of the DB nodes for the respective AtlasRegion
virtual StatusCode initialize() override
AthService initialize method.
StatusCode fallbackRZBoundary(const FallbackDoubleVector &r, const FallbackDoubleVector &z, RZPairVector &rzVec)
use the fallback approach (python arguments) to set the (r,z) values
StatusCode retrieveRZBoundaryOptionalFallback(const std::string &dbNode, const FallbackDoubleVector &r, const FallbackDoubleVector &z, RZPairVector &rzVec)
retrieve and store the (r,z) values locally for the given DB node.
StatusCode retrieveRZBoundary(const std::string &node, RZPairVector &rzVec)
retrieve and store the (r,z) values locally for the given DB node
ServiceHandle< IRDBAccessSvc > m_dbAccess
the DetectorDescription database access method
RZPairVector m_rposz[AtlasDetDescr::fNumAtlasRegions]
internal (r,z) representation for the positive z-side only, one RZPairVector for each AtlasRegion
std::string m_atlasNode
main DDDB node for the ATLAS detector
virtual const RZPairVector & getRPositiveZBoundary(AtlasDetDescr::AtlasRegion region) const override
return a vector of (r,z) pairs, defining the envelope on the z>0 region
virtual const RZPairVector & getRZBoundary(AtlasDetDescr::AtlasRegion region) const override
return a vector of (r,z) pairs, defining the respective envelope
RZPairVector m_rz[AtlasDetDescr::fNumAtlasRegions]
internal (r,z) representation, one RZPairVector for each AtlasRegion
std::array< DoubleArrayProperty, AtlasDetDescr::fNumAtlasRegions > m_fallbackZ
Gaudi::Property< bool > m_allowFallback
fallback solution, in case something goes wrong with the DB
Definition node.h:24
int r
Definition globals.cxx:22
AtlasRegion
A simple enum of ATLAS regions and sub-detectors.
Definition AtlasRegion.h:21