ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
InDetServMatGeoModel
src
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
5
#include "
PixelServMatFactory.h
"
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
17
#include "
InDetGeoModelUtils/InDetMaterialManager.h
"
18
#include "
InDetGeoModelUtils/GenericTubeMaker.h
"
19
#include "
InDetGeoModelUtils/TubeVolData.h
"
20
21
22
#include "
RDBAccessSvc/IRDBRecord.h
"
23
#include "
RDBAccessSvc/IRDBRecordset.h
"
24
#include "
RDBAccessSvc/IRDBAccessSvc.h
"
25
#include "
GeoModelInterfaces/IGeoDbTagSvc.h
"
26
#include "
GeoModelUtilities/DecodeVersionKey.h
"
27
28
#include "
CxxUtils/checker_macros.h
"
29
30
#include <iostream>
31
32
33
PixelServMatFactory::PixelServMatFactory
(
InDetDD::AthenaComps
* athenaComps)
34
:
InDetDD
::
SubDetectorFactoryBase
(athenaComps)
35
{}
36
37
38
PixelServMatFactory::~PixelServMatFactory
()
39
{
40
}
41
42
43
//## Other Operations (implementation)
44
void
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
());
61
m_materialManager
=
m_materialManagerUnique
.get();
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
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
DecodeVersionKey.h
GenericTubeMaker.h
IGeoDbTagSvc.h
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition
IRDBAccessSvc.h:30
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
InDetMaterialManager.h
PixelServMatFactory.h
TubeVolData.h
checker_macros.h
Define macros for attributes used to control the static checker.
DecodeVersionKey
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
Definition
DecodeVersionKey.h:18
DecodeVersionKey::tag
const std::string & tag() const
Return version tag.
Definition
DecodeVersionKey.cxx:91
DecodeVersionKey::node
const std::string & node() const
Return the version node.
Definition
DecodeVersionKey.cxx:97
IRDBAccessSvc::getRecordsetPtr
virtual IRDBRecordset_ptr getRecordsetPtr(std::string_view node, std::string_view tag, std::string_view tag2node="", std::string_view connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
IRDBRecordset::size
virtual unsigned int size() const =0
InDetDD::AthenaComps
Class to hold various Athena components.
Definition
InDetDDAthenaComps.h:21
InDetDD::GenericTubeMaker
Definition
GenericTubeMaker.h:29
InDetDD::GenericTubeMaker::buildShape
const GeoShape * buildShape()
Definition
GenericTubeMaker.cxx:37
InDetDD::GenericTubeMaker::materialName
std::string materialName() const
Definition
GenericTubeMaker.cxx:27
InDetDD::GenericTubeMaker::placeVolume
void placeVolume(GeoPhysVol *parent, GeoVPhysVol *child, double zParent=0)
Definition
GenericTubeMaker.cxx:75
InDetDD::GenericTubeMaker::name
std::string name() const
Definition
GenericTubeMaker.cxx:32
InDetDD::SubDetectorFactoryBase::materialManager
InDetMaterialManager * materialManager()
Definition
InDetSubDetectorFactoryBase.h:46
InDetDD::SubDetectorFactoryBase::geoDbTagSvc
const IGeoDbTagSvc * geoDbTagSvc() const
Definition
InDetSubDetectorFactoryBase.h:42
InDetDD::SubDetectorFactoryBase::m_materialManager
InDetMaterialManager * m_materialManager
Definition
InDetSubDetectorFactoryBase.h:60
InDetDD::SubDetectorFactoryBase::rdbAccessSvc
IRDBAccessSvc * rdbAccessSvc()
Definition
InDetSubDetectorFactoryBase.h:44
InDetDD::SubDetectorFactoryBase::getAthenaComps
InDetDD::AthenaComps * getAthenaComps()
Definition
InDetSubDetectorFactoryBase.h:54
InDetDD::SubDetectorFactoryBase::m_materialManagerUnique
std::unique_ptr< InDetMaterialManager > m_materialManagerUnique
Definition
InDetSubDetectorFactoryBase.h:62
InDetDD::SubDetectorFactoryBase::SubDetectorFactoryBase
SubDetectorFactoryBase(InDetDD::AthenaComps *athenaComps)
Definition
InDetSubDetectorFactoryBase.h:29
InDetMaterialManager::getMaterial
const GeoMaterial * getMaterial(std::string_view materialName)
Get material. First looks for locally defined material and if not found looks in GeoModel material ma...
Definition
InDetMaterialManager.cxx:99
PixelServMatFactory::create
void create(GeoPhysVol *mother)
Definition
PixelServMatFactory.cxx:44
PixelServMatFactory::PixelServMatFactory
PixelServMatFactory(InDetDD::AthenaComps *athenaComps)
Definition
PixelServMatFactory.cxx:33
PixelServMatFactory::~PixelServMatFactory
~PixelServMatFactory()
Definition
PixelServMatFactory.cxx:38
InDetDD
Message Stream Member.
Definition
FakeTrackBuilder.h:8
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0