|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include "GaudiKernel/Bootstrap.h"
14 #include "GaudiKernel/ISvcLocator.h"
17 #include "CLHEP/Units/SystemOfUnits.h"
34 m_atlasVersionTag(
"AUTO"),
38 m_allowFallback(false),
80 ATH_MSG_INFO(
"Unable to retrieve envelope definitions from DDDB. Enabling Python-based fallback definitions.");
83 ATH_MSG_ERROR(
"Unable to retrieve envelope definitions from DDDB and Python-based fallback definitions are disabled.");
99 m_dbAccess.setName(geoDbTag->getParamSvcName());
125 if (
sc.isFailure()) {
126 ATH_MSG_ERROR(
"Unable to retrieve subdetector envelope for detector region '" <<
128 return StatusCode::FAILURE;
140 if (
sc.isFailure()) {
141 ATH_MSG_ERROR(
"Unable to retrieve sub-detector envelope in (r,z)-space for detector region '" <<
143 return StatusCode::FAILURE;
158 int numEntries =
m_rz[region].size();
160 for (
int num = 0;
num<numEntries;
num++) {
168 return StatusCode::SUCCESS;
175 return StatusCode::SUCCESS;
193 if (
sc.isFailure()) {
194 ATH_MSG_DEBUG(
"Will try reading Python-based envelope definition for '" << dbNode <<
"'.");
198 if (
sc.isFailure()) {
199 ATH_MSG_WARNING(
"Could not create envelope volume for '" << dbNode <<
"'.");
200 return StatusCode::FAILURE;
202 ATH_MSG_INFO(
"Sucessfully read Python-based envelope definition for '" << dbNode <<
"'.");
206 return StatusCode::SUCCESS;
246 size_t numEntries = envelopeRec ? envelopeRec->size() : 0;
248 ATH_MSG_INFO(
"No entries for table '" <<
node <<
"' in Detector Description Database (DDDB). Maybe you are using Python-based envelope definitions...");
249 return StatusCode::RECOVERABLE;
255 for ( ; recIt!=recEnd; ++recIt) {
258 double curR = (*recIt)->getDouble(
"R") *
CLHEP::mm;
259 double curZ = (*recIt)->getDouble(
"Z") *
CLHEP::mm;
261 rzVec.emplace_back(curR, curZ );
264 return StatusCode::SUCCESS;
273 unsigned short len =
r.size();
276 if ( len !=
z.size() ) {
277 ATH_MSG_ERROR(
"Unable to construct fallback envelope definition in (r,z) space, as the provided r and z vectors have different length");
279 return StatusCode::FAILURE;
283 for (
unsigned short pos=0;
pos<len; ++
pos) {
286 double curR =
r[
pos];
287 double curZ =
z[
pos];
289 rzVec.emplace_back(curR, curZ );
292 return StatusCode::SUCCESS;
FallbackDoubleVector m_fallbackZ[AtlasDetDescr::fNumAtlasRegions]
std::vector< RZPair > RZPairVector
DetDescrDBEnvelopeSvc(const std::string &name, ISvcLocator *svc)
public AthService constructor
#define ATH_MSG_VERBOSE(x)
static const char * getName(int region)
bool m_allowFallback
fallback solution, in case something goes wrong with the DB
StatusCode finalize()
AthService finalize method.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string m_atlasNode
main DDDB node for the ATLAS detector
StatusCode fallbackRZBoundary(FallbackDoubleVector &r, FallbackDoubleVector &z, RZPairVector &rzVec)
use the fallback approach (python arguments) to set the (r,z) values
StatusCode initialize()
AthService initialize method.
std::vector< double > FallbackDoubleVector
datatype used for fallback solution
AthROOTErrorHandlerSvc * svc
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
StatusCode retrieveRZBoundaryOptionalFallback(std::string &dbNode, FallbackDoubleVector &r, FallbackDoubleVector &z, RZPairVector &rzVec)
retrieve and store the (r,z) values locally for the given DB node.
ServiceHandle< IGeoModelSvc > m_geoModelSvc
ATLAS GeoModel.
Definition of the abstract IRDBRecord interface.
#define ATH_MSG_WARNING(x)
std::string m_node[AtlasDetDescr::fNumAtlasRegions]
the names of the DB nodes for the respective AtlasRegion
std::string m_atlasVersionTag
RZPairVector m_rz[AtlasDetDescr::fNumAtlasRegions]
internal (r,z) representation, one RZPairVector for each AtlasRegion
StatusCode retrieveRZBoundary(std::string &node, RZPairVector &rzVec)
retrieve and store the (r,z) values locally for the given DB node
FallbackDoubleVector m_fallbackR[AtlasDetDescr::fNumAtlasRegions]
Definition of the abstract IRDBRecordset interface.
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
RecordsVector::const_iterator const_iterator
~DetDescrDBEnvelopeSvc()
Destructor.
bool enableFallback()
enable fallback solution: