ATLAS Offline Software
Loading...
Searching...
No Matches
PixelServMatFactory.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7// GeoModel includes
8#include "GeoModelKernel/GeoPhysVol.h"
9#include "GeoModelKernel/GeoLogVol.h"
10#include "GeoModelKernel/GeoTube.h"
11#include "GeoModelKernel/GeoPcon.h"
12#include "GeoModelKernel/GeoNameTag.h"
13#include "GeoModelKernel/GeoMaterial.h"
14#include "GeoModelKernel/GeoTransform.h"
15
16
20
21
27
29
30#include <iostream>
31
32
36
37
41
42
43//## Other Operations (implementation)
44void PixelServMatFactory::create(GeoPhysVol *mother)
45{
46 msg(MSG::DEBUG) << "Building Pixel Service Material" << endmsg;
47
48 DecodeVersionKey indetVersionKey(geoDbTagSvc(),"InnerDetector");
49 DecodeVersionKey pixelVersionKey(geoDbTagSvc(),"Pixel");
50
51 IRDBRecordset_ptr pixelGenServices = rdbAccessSvc()->getRecordsetPtr("PixelGenServices", indetVersionKey.tag(), indetVersionKey.node());
52
53 // Doesn't exist at time of writing but we include it to keep things general
54 IRDBRecordset_ptr weightTable = rdbAccessSvc()->getRecordsetPtr("PixelWeights", pixelVersionKey.tag(), pixelVersionKey.node());
55
56 IRDBRecordset_ptr scalingTable = rdbAccessSvc()->getRecordsetPtr("InDetServMatScaling", indetVersionKey.tag(), indetVersionKey.node());
57
58 // Get the InDet material manager. This is a wrapper around the geomodel one with some extra functionality to deal
59 // with weights table if it exists
60 m_materialManagerUnique = std::make_unique<InDetMaterialManager>("PixelMaterialManager", getAthenaComps());
62 m_materialManager->addWeightTable(weightTable, "pix");
63 m_materialManager->addScalingTable(scalingTable);
64
65 // Build general services:
66 //
67
68 for (unsigned int ii =0; ii < pixelGenServices->size(); ii++) {
69
70 InDetDD::GenericTubeMaker tubeHelper((*pixelGenServices)[ii]);
71 const GeoShape * serviceTubeTmp = tubeHelper.buildShape();
72
73 std::string logName = tubeHelper.name();
74 if (logName.empty()) {
75 std::ostringstream o; o << ii;
76 logName = "ServMat"+o.str();
77 }
78 logName = "Pix" + logName;
79
80 const GeoShape* serviceTube = serviceTubeTmp;
81
82 std::string materialName = tubeHelper.materialName();
83 //const GeoMaterial* material = m_materialManager->getMaterialForVolume(materialName, serviceTube->volume());
84 const GeoMaterial* material = materialManager()->getMaterial(materialName);
85
86 const GeoLogVol* servLog = new GeoLogVol(logName,serviceTube,material);
87 GeoVPhysVol* servPhys = new GeoPhysVol(servLog);
88
89 tubeHelper.placeVolume(mother, servPhys);
90
91 }
92}
93
#define endmsg
Definition of the abstract IRDBAccessSvc interface.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition of the abstract IRDBRecord interface.
Definition of the abstract IRDBRecordset interface.
Define macros for attributes used to control the static checker.
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.
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.
virtual unsigned int size() const =0
Class to hold various Athena components.
const GeoShape * buildShape()
std::string materialName() const
void placeVolume(GeoPhysVol *parent, GeoVPhysVol *child, double zParent=0)
const IGeoDbTagSvc * geoDbTagSvc() const
std::unique_ptr< InDetMaterialManager > m_materialManagerUnique
SubDetectorFactoryBase(InDetDD::AthenaComps *athenaComps)
const GeoMaterial * getMaterial(const std::string &materialName)
Get material. First looks for locally defined material and if not found looks in GeoModel material ma...
void create(GeoPhysVol *mother)
PixelServMatFactory(InDetDD::AthenaComps *athenaComps)
Message Stream Member.
MsgStream & msg
Definition testRead.cxx:32