ATLAS Offline Software
Loading...
Searching...
No Matches
InDetDD::ServiceVolumeMakerMgr Class Reference

#include <ServiceVolumeMaker.h>

Collaboration diagram for InDetDD::ServiceVolumeMakerMgr:

Public Member Functions

 ServiceVolumeMakerMgr (IRDBRecordset_ptr table, const ServiceVolumeSchema &schema, InDetDD::AthenaComps *athenaComps)
double rmin (int index) const
double rmax (int index) const
double rmin2 (int index) const
double rmax2 (int index) const
double zmin (int index) const
double zmax (int index) const
double width (int index) const
double phiStart (int index) const
double phiDelta (int index) const
double phiStep (int index) const
bool zsymm (int index) const
int repeat (int index) const
int radialDiv (int index) const
int volId (int index) const
int shiftFlag (int index) const
std::string shapeType (int index) const
std::string volName (int index) const
std::string materialName (int index) const
std::vector< double > readLayerShift ()
unsigned int numElements () const
const ServiceVolumeSchemaschema () const

Private Attributes

IRDBRecordset_ptr m_table
IRDBRecordset_ptr m_layer
ServiceVolumeSchema m_schema
InDetDD::AthenaCompsm_athenaComps

Detailed Description

Definition at line 97 of file ServiceVolumeMaker.h.

Constructor & Destructor Documentation

◆ ServiceVolumeMakerMgr()

InDetDD::ServiceVolumeMakerMgr::ServiceVolumeMakerMgr ( IRDBRecordset_ptr table,
const ServiceVolumeSchema & schema,
InDetDD::AthenaComps * athenaComps )

Definition at line 87 of file ServiceVolumeMaker.cxx.

89 : m_table(std::move(table)),
91 m_athenaComps(athenaComps)
92 {}
const ServiceVolumeSchema & schema() const
InDetDD::AthenaComps * m_athenaComps

Member Function Documentation

◆ materialName()

std::string InDetDD::ServiceVolumeMakerMgr::materialName ( int index) const

Definition at line 197 of file ServiceVolumeMaker.cxx.

197 {
198 return (*m_table)[index]->getString(m_schema.materialName());
199 }
str index
Definition DeMoScan.py:362

◆ numElements()

unsigned int InDetDD::ServiceVolumeMakerMgr::numElements ( ) const

Definition at line 202 of file ServiceVolumeMaker.cxx.

202 {
203 return m_table->size();
204 }

◆ phiDelta()

double InDetDD::ServiceVolumeMakerMgr::phiDelta ( int index) const

Definition at line 125 of file ServiceVolumeMaker.cxx.

125 {
126 return (*m_table)[index]->getDouble(m_schema.phiDelta()) * Gaudi::Units::deg;
127 }

◆ phiStart()

double InDetDD::ServiceVolumeMakerMgr::phiStart ( int index) const

Definition at line 138 of file ServiceVolumeMaker.cxx.

138 {
139 return (*m_table)[index]->getDouble(m_schema.phiStart()) * Gaudi::Units::deg;
140 }

◆ phiStep()

double InDetDD::ServiceVolumeMakerMgr::phiStep ( int index) const

Definition at line 143 of file ServiceVolumeMaker.cxx.

143 {
144 if (m_schema.has_phiStep()) {
145 return (*m_table)[index]->getDouble(m_schema.phiStep()) * Gaudi::Units::deg;
146 }
147 return 0;
148 }

◆ radialDiv()

int InDetDD::ServiceVolumeMakerMgr::radialDiv ( int index) const

Definition at line 161 of file ServiceVolumeMaker.cxx.

161 {
162 if (m_schema.has_radial()) {
163 return (*m_table)[index]->getInt(m_schema.radialDiv());
164 } else {
165 return 0;
166 }
167 }

◆ readLayerShift()

std::vector< double > InDetDD::ServiceVolumeMakerMgr::readLayerShift ( )

Definition at line 229 of file ServiceVolumeMaker.cxx.

229 {
230 std::vector<double> layerShift;
231
232 IRDBAccessSvc* rdbSvc = m_athenaComps->rdbAccessSvc();
233 const IGeoDbTagSvc* geoDbTag = m_athenaComps->geoDbTagSvc();
234
235 DecodeVersionKey versionKey(geoDbTag, "Pixel");
236 const std::string& detectorKey = versionKey.tag();
237 const std::string& detectorNode = versionKey.node();
238
239 IRDBRecordset_ptr PixelBarrelGeneral = rdbSvc->getRecordsetPtr("PixelBarrelGeneral", detectorKey, detectorNode);
240 IRDBRecordset_ptr PixelLayer = rdbSvc->getRecordsetPtr("PixelLayer", detectorKey, detectorNode);
241
242 int numLayers = (*PixelBarrelGeneral)[0]->getInt("NLAYER");
243 layerShift.reserve(numLayers);
244 for(const auto& rec : *PixelLayer) {
245 double shift = 0;
246 try {
247 if(!rec->isFieldNull("GBLSHIFT")) {
248 shift = rec->getDouble("GBLSHIFT");
249 }
250 }
251 catch(std::runtime_error&) {
252 }
253 layerShift.push_back(shift);
254 }
255
256 return layerShift;
257 }
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
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.
constexpr unsigned int numLayers()
Definition HIEventDefs.h:23

◆ repeat()

int InDetDD::ServiceVolumeMakerMgr::repeat ( int index) const

Definition at line 156 of file ServiceVolumeMaker.cxx.

156 {
157 return (*m_table)[index]->getInt(m_schema.repeat());
158 }

◆ rmax()

double InDetDD::ServiceVolumeMakerMgr::rmax ( int index) const

Definition at line 100 of file ServiceVolumeMaker.cxx.

100 {
101 return (*m_table)[index]->getDouble(m_schema.rmax()) * Gaudi::Units::mm;
102 }

◆ rmax2()

double InDetDD::ServiceVolumeMakerMgr::rmax2 ( int index) const

Definition at line 110 of file ServiceVolumeMaker.cxx.

110 {
111 return (*m_table)[index]->getDouble(m_schema.rmax2()) * Gaudi::Units::mm;
112 }

◆ rmin()

double InDetDD::ServiceVolumeMakerMgr::rmin ( int index) const

Definition at line 95 of file ServiceVolumeMaker.cxx.

95 {
96 return (*m_table)[index]->getDouble(m_schema.rmin()) * Gaudi::Units::mm;
97 }

◆ rmin2()

double InDetDD::ServiceVolumeMakerMgr::rmin2 ( int index) const

Definition at line 105 of file ServiceVolumeMaker.cxx.

105 {
106 return (*m_table)[index]->getDouble(m_schema.rmin2()) * Gaudi::Units::mm;
107 }

◆ schema()

const ServiceVolumeSchema & InDetDD::ServiceVolumeMakerMgr::schema ( ) const
inline

Definition at line 124 of file ServiceVolumeMaker.h.

124{return m_schema;}

◆ shapeType()

std::string InDetDD::ServiceVolumeMakerMgr::shapeType ( int index) const

Definition at line 170 of file ServiceVolumeMaker.cxx.

170 {
171 if (m_schema.has_shapeType()) {
172 try {
173 if (!(*m_table)[index]->isFieldNull(m_schema.shapeType())) {
174 return (*m_table)[index]->getString(m_schema.shapeType());
175 }
176 }
177 catch(std::runtime_error&) {
178 }
179 return "TUBE";
180 }
181 return "UNKNOWN";
182 }

◆ shiftFlag()

int InDetDD::ServiceVolumeMakerMgr::shiftFlag ( int index) const

Definition at line 215 of file ServiceVolumeMaker.cxx.

215 {
216 if (m_schema.has_shiftFlag()) {
217 try {
218 if (!(*m_table)[index]->isFieldNull(m_schema.shiftFlag())) {
219 return (*m_table)[index]->getInt(m_schema.shiftFlag());
220 }
221 }
222 catch(std::runtime_error&) {
223 }
224 }
225 return 0;
226 }

◆ volId()

int InDetDD::ServiceVolumeMakerMgr::volId ( int index) const

Definition at line 207 of file ServiceVolumeMaker.cxx.

207 {
208 if (m_schema.has_volId()) {
209 return (*m_table)[index]->getInt(m_schema.volId());
210 }
211 return 0;
212 }

◆ volName()

std::string InDetDD::ServiceVolumeMakerMgr::volName ( int index) const

Definition at line 185 of file ServiceVolumeMaker.cxx.

185 {
186 try {
187 if (!(*m_table)[index]->isFieldNull(m_schema.volName())) {
188 return (*m_table)[index]->getString(m_schema.volName());
189 }
190 }
191 catch(std::runtime_error&) {
192 }
193 return "";
194 }

◆ width()

double InDetDD::ServiceVolumeMakerMgr::width ( int index) const

Definition at line 130 of file ServiceVolumeMaker.cxx.

130 {
131 if (m_schema.has_width()) {
132 return (*m_table)[index]->getDouble(m_schema.width()) * Gaudi::Units::mm;
133 }
134 return 0;
135 }

◆ zmax()

double InDetDD::ServiceVolumeMakerMgr::zmax ( int index) const

Definition at line 120 of file ServiceVolumeMaker.cxx.

120 {
121 return (*m_table)[index]->getDouble(m_schema.zmax()) * Gaudi::Units::mm;
122 }

◆ zmin()

double InDetDD::ServiceVolumeMakerMgr::zmin ( int index) const

Definition at line 115 of file ServiceVolumeMaker.cxx.

115 {
116 return (*m_table)[index]->getDouble(m_schema.zmin()) * Gaudi::Units::mm;
117 }

◆ zsymm()

bool InDetDD::ServiceVolumeMakerMgr::zsymm ( int index) const

Definition at line 151 of file ServiceVolumeMaker.cxx.

151 {
152 return (*m_table)[index]->getInt(m_schema.zsymm());
153 }

Member Data Documentation

◆ m_athenaComps

InDetDD::AthenaComps* InDetDD::ServiceVolumeMakerMgr::m_athenaComps
private

Definition at line 130 of file ServiceVolumeMaker.h.

◆ m_layer

IRDBRecordset_ptr InDetDD::ServiceVolumeMakerMgr::m_layer
private

Definition at line 128 of file ServiceVolumeMaker.h.

◆ m_schema

ServiceVolumeSchema InDetDD::ServiceVolumeMakerMgr::m_schema
private

Definition at line 129 of file ServiceVolumeMaker.h.

◆ m_table

IRDBRecordset_ptr InDetDD::ServiceVolumeMakerMgr::m_table
private

Definition at line 127 of file ServiceVolumeMaker.h.


The documentation for this class was generated from the following files: