107#include "GaudiKernel/PhysicalConstants.h"
116 GeoModelIO::ReadGeoModel* sqliteReader,
117 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
118 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX,
127 double barrelRmin =
m_gmt_mgr->PixelBarrelRMin();
128 double barrelRmax =
m_gmt_mgr->PixelBarrelRMax();
129 double barrelZmin = -
m_gmt_mgr->PixelBarrelHalfLength();
130 double barrelZmax =
m_gmt_mgr->PixelBarrelHalfLength();
131 double endcapRmin =
m_gmt_mgr->PixelEndcapRMin();
132 double endcapRmax =
m_gmt_mgr->PixelEndcapRMax();
133 double endcapZmin =
m_gmt_mgr->PixelEndcapZMin();
134 double endcapZmax =
m_gmt_mgr->PixelEndcapZMax();
136 double pixelRmin, pixelRmax, pixelZmax;
140 pixelZmax =
m_gmt_mgr->PixelHalfLength();
141 pixZone =
new InDetDD::TubeZone(
"Pixel",-pixelZmax,pixelZmax,pixelRmin,pixelRmax);
147 pixelZmax =
m_gmt_mgr->PixelHalfLength();
150 pixelZmax =
m_gmt_mgr->PixelEnvelopeZ(0);
151 pixelRmin =
m_gmt_mgr->PixelEnvelopeRMin(0);
152 pixelRmax =
m_gmt_mgr->PixelEnvelopeRMax(0);
160 topZone.
add(pixZone);
164 for(
int ii = 0; ii <
m_gmt_mgr->PixelBarrelNLayer(); ii++){
171 bool barrelPresent =
m_gmt_mgr->partPresent(
"Barrel");
172 bool endcapAPresent =
m_gmt_mgr->partPresent(
"EndcapA");
173 bool endcapCPresent =
m_gmt_mgr->partPresent(
"EndcapC");
176 if (endcapAPresent || endcapCPresent)
initialize(
"endcap");
183 if (
m_gmt_mgr->athenaComps()->serviceBuilderTool()) {
184 const std::vector<const InDetDD::ServiceVolume *> & services =
m_gmt_mgr->athenaComps()->serviceBuilderTool()->getServices();
193 for (
unsigned int i = 0; i <
m_services.size(); ++i) {
214 schema.setSimpleSchema();
216 }
else if (
a==
"barrel") {
217 schema.setPixelSchema();
219 }
else if (
a==
"endcap") {
220 schema.setPixelSchema();
223 m_gmt_mgr->msg(MSG::ERROR) <<
"Unrecognized service table type: " <<
a <<
endmsg;
230 for (
unsigned int i = 0; i < volMaker.
numElements(); ++i) {
242 int numServices =
m_gmt_mgr->PixelServiceElements(
a);
243 for(
int ii = 0; ii < numServices; ii++) {
263 int iShiftIndex =
m_gmt_mgr->PixelServiceShift(
a, ii);
270 int envNum=
m_gmt_mgr->PixelServiceEnvelopeNum(
a, ii);
272 int envParent=
m_gmt_mgr->PixelServiceParentEnvelopeNum(
a, ii);
274 int volId =
m_gmt_mgr->PixelServiceFrameNum(
a, ii);
276 bool needsRotation =
false;
279 std::string shapeType =
m_gmt_mgr->PixelServiceShape(
a, ii);
280 if (!shapeType.empty() && shapeType !=
"TUBE") {
281 double rmin2 =
m_gmt_mgr->PixelServiceRMin2(
a, ii);
282 double rmax2 =
m_gmt_mgr->PixelServiceRMax2(
a, ii);
283 int repeat =
m_gmt_mgr->PixelServiceRepeat(
a, ii);
284 double phiLoc =
m_gmt_mgr->PixelServicePhiLoc(
a, ii);
285 double phiWidth =
m_gmt_mgr->PixelServiceWidth(
a, ii);
289 if (shapeType ==
"BOX" || shapeType ==
"ROD" || shapeType ==
"ROD2" || shapeType ==
"TRAP") {
290 phiWidth *= Gaudi::Units::mm;
292 phiWidth *= Gaudi::Units::degree;
295 if (phiWidth == 0) phiWidth = 2*Gaudi::Units::pi;
296 if (rmin2 <= 0) rmin2 = param.
rmin();
297 if (rmax2 <= 0) rmax2 = param.
rmax();
298 if (repeat == 0) repeat = 1;
300 if (shapeType ==
"PGON" || shapeType ==
"PGON2" ||
301 shapeType ==
"CONE" || shapeType ==
"CONS" ||
302 shapeType ==
"PGON3" || shapeType ==
"PGON31" || shapeType ==
"PGON4") {
303 if ((rmin2 != param.
rmin()) || (rmax2 != param.
rmax())) {
304 needsRotation =
true;
310 if (shapeType ==
"PGON" || shapeType ==
"PGON2" ||
311 shapeType ==
"PGON3" || shapeType ==
"PGON31" || shapeType ==
"PGON4") {
318 if (shapeType.empty() || shapeType ==
"TUBE" || shapeType ==
"CONE") {
337 if(std::abs(param.
zmin()) < 0.000001) {
343 if(envNum>0)
label=
"Env";
344 else if (
a ==
"barrel")
label =
"Brl";
345 else if (
a ==
"endcap")
label =
"EC";
346 else if (
a ==
"simple")
label =
"Svc";
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
InDetDD::VolumeBuilder * m_servMatBuilder
std::vector< double > m_layerShift
virtual GeoVPhysVol * Build() override
void initialize(const std::string &)
void initializeOld(const std::string &)
std::vector< const InDetDD::ServiceVolume * > m_services
GeoPixelServices(InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX, InDetDD::Zone *envelopeZone=0)
InDetDD::VolumeBuilder * m_pixServBuilder
PixelGeometryManager * m_gmt_mgr
InDetMaterialManager * m_mat_mgr
GeoVPixelFactory(InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX)
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
unsigned int numElements() const
ServiceVolume * make(int index)
void setEnvelopeNum(int num)
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 setParentEnvelope(int num)
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)