ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
InDetGeoModelUtils
src
ExtraMaterial.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
InDetGeoModelUtils/ExtraMaterial.h
"
6
#include "
InDetGeoModelUtils/GenericTubeMaker.h
"
7
#include "
InDetGeoModelUtils/TubeVolData.h
"
8
#include "
InDetGeoModelUtils/DistortedMaterialManager.h
"
9
#include "
RDBAccessSvc/IRDBRecordset.h
"
10
#include "
RDBAccessSvc/IRDBRecord.h
"
11
#include "
GeoPrimitives/GeoPrimitives.h
"
12
#include "GeoModelKernel/GeoPhysVol.h"
13
#include "GeoModelKernel/GeoFullPhysVol.h"
14
#include "GeoModelKernel/GeoTube.h"
15
#include "GeoModelKernel/GeoTubs.h"
16
#include "GeoModelKernel/GeoCons.h"
17
#include "GeoModelKernel/GeoLogVol.h"
18
#include "GeoModelKernel/GeoMaterial.h"
19
20
#include "
GeoModelInterfaces/StoredMaterialManager.h
"
21
22
#include <iostream>
23
#include <sstream>
24
#include <string>
25
#include <utility>
26
27
28
namespace
InDetDD
{
29
ExtraMaterial::ExtraMaterial
(
IRDBRecordset_ptr
xMatTable,
StoredMaterialManager
* matManager)
30
:
AthMessaging
(
"ExtraMaterial"
)
31
,
m_xMatTable
(
std
::move(xMatTable))
32
,
m_matManager
(matManager)
33
{}
34
35
ExtraMaterial::ExtraMaterial
(
DistortedMaterialManager
* manager)
36
:
AthMessaging
(
"ExtraMaterial"
)
37
,
m_xMatTable
(manager->extraMaterialTable())
38
,
m_matManager
(manager->materialManager())
39
{}
40
41
void
42
ExtraMaterial::add
(GeoPhysVol* parent,
const
std::string& region,
double
zParent) {
43
add
(parent,
nullptr
, region, zParent);
44
}
45
46
void
47
ExtraMaterial::add
(GeoFullPhysVol* parent,
const
std::string& region,
double
zParent) {
48
add
(
nullptr
, parent, region, zParent);
49
}
50
51
void
52
ExtraMaterial::add
(GeoPhysVol* parent, GeoFullPhysVol* fullparent,
const
std::string& region,
double
zParent) {
53
ATH_MSG_DEBUG
(
"Adding Extra material for region: "
<< region <<
", zParent = "
<< zParent);
54
55
for
(
unsigned
int
i = 0; i <
m_xMatTable
->size(); i++) {
56
std::ostringstream volnamestr;
57
volnamestr <<
"ExtraMaterial"
<< i;
58
59
ATH_MSG_VERBOSE
(
"In Extra material "
<< i);
60
61
if
((*
m_xMatTable
)[i]->getString(
"REGION"
) == region) {
62
ATH_MSG_VERBOSE
(
"Extra material Match "
<< i);
63
64
if
(!
m_matManager
) {
65
std::string errorMessage(
"Null pointer to Stored Material Manager!"
);
66
ATH_MSG_FATAL
(errorMessage);
67
throw
std::runtime_error(errorMessage);
68
}
69
70
GenericTubeMaker
tubeHelper((*
m_xMatTable
)[i]);
71
const
GeoMaterial* material =
m_matManager
->getMaterial(tubeHelper.
volData
().
material
());
72
const
GeoShape* shape = tubeHelper.
buildShape
();
73
GeoLogVol* logVol =
new
GeoLogVol(volnamestr.str(), shape, material);
74
GeoPhysVol* physVol =
new
GeoPhysVol(logVol);
75
76
if
(parent) {
77
tubeHelper.
placeVolume
(parent, physVol, zParent);
78
}
else
{
79
tubeHelper.
placeVolume
(fullparent, physVol, zParent);
80
}
81
}
82
}
83
}
84
}
// end namespace
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
DistortedMaterialManager.h
ExtraMaterial.h
GenericTubeMaker.h
GeoPrimitives.h
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.
StoredMaterialManager.h
TubeVolData.h
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
InDetDD::DistortedMaterialManager
Definition
DistortedMaterialManager.h:15
InDetDD::ExtraMaterial::add
void add(GeoPhysVol *parent, const std::string &parentName, double zPos=0)
Definition
ExtraMaterial.cxx:42
InDetDD::ExtraMaterial::ExtraMaterial
ExtraMaterial(IRDBRecordset_ptr xMatTable, StoredMaterialManager *matManager)
Definition
ExtraMaterial.cxx:29
InDetDD::ExtraMaterial::m_matManager
StoredMaterialManager * m_matManager
Definition
ExtraMaterial.h:33
InDetDD::ExtraMaterial::m_xMatTable
IRDBRecordset_ptr m_xMatTable
Definition
ExtraMaterial.h:32
InDetDD::GenericTubeMaker
Definition
GenericTubeMaker.h:29
InDetDD::GenericTubeMaker::buildShape
const GeoShape * buildShape()
Definition
GenericTubeMaker.cxx:37
InDetDD::GenericTubeMaker::placeVolume
void placeVolume(GeoPhysVol *parent, GeoVPhysVol *child, double zParent=0)
Definition
GenericTubeMaker.cxx:75
InDetDD::GenericTubeMaker::volData
const TubeVolData & volData() const
Definition
GenericTubeMaker.h:32
InDetDD::TubeVolData::material
std::string material() const
Definition
TubeVolData.cxx:15
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition
StoredMaterialManager.h:30
InDetDD
Message Stream Member.
Definition
FakeTrackBuilder.h:8
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0