17#include "GaudiKernel/SystemOfUnits.h"
99 return std::as_const(*m_athenaComps).geomDB();
226 std::vector<double> layerShift;
232 const std::string& detectorKey = versionKey.
tag();
233 const std::string& detectorNode = versionKey.
node();
238 int numLayers =
db()->
getInt(std::move(PixelBarrelGeneral),
"NLAYER");
239 layerShift.reserve(numLayers);
240 for (
int iLayer = 0; iLayer < numLayers; iLayer++) {
242 if (
db()->testField(PixelLayer,
"GBLSHIFT", iLayer)) shift =
db()->
getDouble(PixelLayer,
"GBLSHIFT", iLayer);
243 layerShift.push_back(shift);
260 for (
unsigned int i = 0; i <
m_services.size(); i++) {
266 const std::vector<const ServiceVolume*>&
268 for (
unsigned int ii = 0; ii <
numElements(); ++ii) {
276 return m_mgr->numElements();
298 int volId =
m_mgr->volId(ii);
299 if (volId == 0) volId = ii + 1;
301 bool needsRotation =
false;
304 std::string shapeType =
m_mgr->shapeType(ii);
305 if (!
m_mgr->schema().simple() && !shapeType.empty() && shapeType !=
"TUBE") {
306 double rmin2 =
m_mgr->rmin2(ii);
307 double rmax2 =
m_mgr->rmax2(ii);
309 if (rmin2 <= 0) rmin2 = param->
rmin();
310 if (rmax2 <= 0) rmax2 = param->
rmax();
312 int radialDiv =
m_mgr->radialDiv(ii);
314 double phiDelta =
m_mgr->phiDelta(ii);
316 bool fullPhiSector =
false;
317 if (phiDelta == 0 || phiDelta >= 359.9 * Gaudi::Units::degree) {
318 phiDelta = 360 * Gaudi::Units::degree;
319 fullPhiSector =
true;
326 if (shapeType ==
"UNKNOWN") {
328 shapeType =
"RADIAL";
329 }
else if (param->
rmin() == rmin2 && param->
rmax() == rmax2) {
341 int repeat =
m_mgr->repeat(ii);
342 if (repeat == 0) repeat = 1;
344 double phiStart =
m_mgr->phiStart(ii);
345 double phiWidth = phiDelta;
347 if (shapeType ==
"CONS" || shapeType ==
"TUBS") {
348 const double phiepsilon = 0.001 * Gaudi::Units::degree;
349 phiWidth -= 2 * phiepsilon;
350 phiStart += phiepsilon;
355 if (shapeType ==
"BOX" || shapeType ==
"ROD" || shapeType ==
"ROD2" || shapeType ==
"TRAP") {
356 phiWidth =
m_mgr->width(ii);
359 if (shapeType ==
"PGON" || shapeType ==
"PGON2" ||
360 shapeType ==
"CONE" || shapeType ==
"CONS" ||
361 shapeType ==
"PGON3" || shapeType ==
"PGON4") {
362 if ((rmin2 != param->
rmin()) || (rmax2 != param->
rmax())) {
363 needsRotation =
true;
369 if (shapeType ==
"PGON" || shapeType ==
"PGON2" ||
370 shapeType ==
"PGON3" || shapeType ==
"PGON4") {
377 if (shapeType.empty() || shapeType ==
"TUBE" || shapeType ==
"CONE") {
399 if (std::abs(param->
zmin()) < 0.000001) {
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition of the abstract IRDBRecordset interface.
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
const std::string & tag() const
Return version tag.
const std::string & node() const
Return the version node.
Interface class to access geometry database with possibility to override parameters from a text file.
virtual std::string getString(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const =0
virtual int getInt(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const =0
virtual double getDouble(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const =0
The following methods will first look in the text file if provided and then look in the database.
virtual unsigned int getTableSize(IRDBRecordset_ptr recordSet) const =0
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
Class to hold various Athena components.
std::vector< double > readLayerShift()
int volId(int index) const
double width(int index) const
double phiStep(int index) const
double phiStart(int index) const
double rmin2(int index) const
ServiceVolumeSchema m_schema
const ServiceVolumeSchema & schema() const
double phiDelta(int index) const
double rmax(int index) const
bool zsymm(int index) const
int repeat(int index) const
ServiceVolumeMakerMgr(IRDBRecordset_ptr table, const ServiceVolumeSchema &schema, InDetDD::AthenaComps *athenaComps)
double rmin(int index) const
InDetDD::AthenaComps * m_athenaComps
unsigned int numElements() const
double rmax2(int index) const
std::string volName(int index) const
double zmax(int index) const
const IGeometryDBSvc * db() const
std::string shapeType(int index) const
std::string materialName(int index) const
int radialDiv(int index) const
IRDBRecordset_ptr m_table
int shiftFlag(int index) const
double zmin(int index) const
std::vector< const ServiceVolume * > m_services
std::vector< double > m_layerShift
ServiceVolumeMakerMgr * m_mgr
ServiceVolumeMaker(const std::string &label, IRDBRecordset_ptr table, const ServiceVolumeSchema &schema, InDetDD::AthenaComps *)
unsigned int numElements() const
const std::vector< const ServiceVolume * > & makeAll()
ServiceVolume * make(int index)
std::string m_materialName
void setVolName(const std::string &name)
void setZShift(double shift)
void setRmax(double rmax)
void setZmin(double zmin)
void setMaterial(const std::string &mat)
void setNeedsRotation(bool flag)
void setPhiWidth(double phiWidth)
void setRmax2(double rmax2)
void setLabel(const std::string &name, int volId)
void setZmax(double zmax)
void setZsymm(bool zsymm)
void setRmin(double rmin)
void setPhiLoc(double phiLoc)
void setRmin2(double rmin2)
void setShapeType(const std::string &shapeType)
std::string label(const std::string &format, int i)