ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
InDetTrackingGeometry
src
BeamPipeBuilderImpl.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
InDetTrackingGeometry/BeamPipeBuilderImpl.h
"
6
7
// Amg
8
#include "
GeoPrimitives/GeoPrimitives.h
"
9
// Trk inlcude
10
#include "
TrkDetDescrUtils/GeometryStatics.h
"
11
#include "
TrkDetDescrUtils/BinUtility.h
"
12
//#include "TrkDetDescrGeoModelCnv/GeoShapeConverter.h"
13
#include "
TrkGeometry/MaterialProperties.h
"
14
#include "
TrkGeometry/LayerMaterialProperties.h
"
15
#include "
TrkGeometry/BinnedLayerMaterial.h
"
16
#include "
TrkGeometry/HomogeneousLayerMaterial.h
"
17
#include "
TrkGeometry/CylinderLayer.h
"
18
#include "
TrkSurfaces/CylinderBounds.h
"
19
// GeoModel include
20
#include "
BeamPipeGeoModel/BeamPipeDetectorManager.h
"
21
#include "GeoModelKernel/GeoTube.h"
22
23
// Athena standard methods
24
// initialize
25
StatusCode
InDet::BeamPipeBuilderImpl::initialize
()
26
{
27
if
(
m_beamPipeFromDb
) {
28
ATH_CHECK
(
detStore
()->retrieve(
m_beamPipeMgr
,
m_beamPipeMgrName
));
29
ATH_MSG_DEBUG
(
"Successfully retrieved BeamPipe detector manager '"
<<
m_beamPipeMgrName
<<
"'."
);
30
}
31
ATH_MSG_DEBUG
(
"initialize()"
);
32
return
StatusCode::SUCCESS;
33
}
34
35
std::unique_ptr<const std::vector<Trk::CylinderLayer*> >
InDet::BeamPipeBuilderImpl::cylindricalLayersImpl
()
const
36
{
37
auto
beamPipe = std::make_unique<std::vector<Trk::CylinderLayer*> >();
38
39
// the geometry
40
Amg::Transform3D
beamPipeTransform;
41
beamPipeTransform.setIdentity();
42
43
double
beamPipeRadius =
m_beamPipeRadius
;
44
45
if
(
m_beamPipeMgr
) {
46
// get the central top volume
47
PVConstLink beamPipeTopVolume =
m_beamPipeMgr
->getTreeTop(0);
48
if
(
m_beamPipeMgr
->getNumTreeTops()==1) {
49
// Beampipe implementation using assembly volume has only one tree top instead of 3 in the default case(union of a central and two forward beampipes)
50
beamPipeTopVolume =
m_beamPipeMgr
->getTreeTop(0)->getChildVol(0)->getChildVol(0);
51
//the BeamPipeCentral volume is the child of the child volume of the top volume in this case
52
}
53
beamPipeTransform =
Amg::Translation3D
(beamPipeTopVolume->getX().translation().x(),
54
beamPipeTopVolume->getX().translation().y(),
55
beamPipeTopVolume->getX().translation().z());
56
const
GeoLogVol* beamPipeLogVolume = beamPipeTopVolume->getLogVol();
57
const
GeoTube* beamPipeTube =
nullptr
;
58
if
(beamPipeLogVolume) {
59
// get the geoShape and translate
60
//Trk::GeoShapeConverter geoShaper;
61
beamPipeTube =
dynamic_cast<
const
GeoTube*
>
(beamPipeLogVolume->getShape());
62
if
(beamPipeTube) {
63
for
(
unsigned
int
i=0;i<beamPipeTopVolume->getNChildVols();i++) {
64
if
(beamPipeTopVolume->getNameOfChildVol(i)==
"SectionC03"
){
65
PVConstLink childTopVolume = beamPipeTopVolume->getChildVol(i);
66
const
GeoLogVol* childLogVolume = childTopVolume->getLogVol();
67
const
GeoTube* childTube =
nullptr
;
68
if
(childLogVolume) {
69
childTube =
dynamic_cast<
const
GeoTube*
>
(childLogVolume->getShape());
70
if
(childTube) {
71
beamPipeRadius = 0.5 * (childTube->getRMax()+childTube->getRMin());
72
}
73
}
74
break
;
//Exit loop after SectionC03 is found
75
}
76
}
// Loop over child volumes
77
}
78
}
79
ATH_MSG_VERBOSE
(
"BeamPipe constructed from Database: translation (yes) - radius "
<< ( beamPipeTube ?
"(yes)"
:
"(no)"
) <<
" - r = "
<< beamPipeRadius );
80
}
else
{
81
beamPipeTransform =
Amg::Translation3D
(
m_beamPipeOffsetX
,
m_beamPipeOffsetY
, 0.);
82
}
83
84
ATH_MSG_VERBOSE
(
"BeamPipe shift estimated as : "
85
<< beamPipeTransform.translation().x() <<
", "
86
<< beamPipeTransform.translation().y() <<
","
87
<< beamPipeTransform.translation().y());
88
89
auto
beamPipeBounds = std::make_shared<Trk::CylinderBounds>(beamPipeRadius,
m_beamPipeHalflength
);
90
ATH_MSG_VERBOSE
(
"BeamPipe bounds constructed as : "
<< (*beamPipeBounds) );
91
92
// the material
93
Trk::MaterialProperties
beamPipeMaterial(
m_beamPipeThickness
,
94
m_beamPipeX0
,
95
m_beamPipeL0
,
96
m_beamPipeA
,
97
m_beamPipeZ
,
98
m_beamPipeRho
);
99
100
// binned layer material for the beam pipe possible
101
Trk::CylinderLayer
* pThisCylinderLayer{};
102
if
(
m_beamPipeBinsZ
== 1u) {
103
const
auto
&beamPipeLayerMaterial =
Trk::HomogeneousLayerMaterial
(beamPipeMaterial, 1.0);
104
pThisCylinderLayer =
new
Trk::CylinderLayer
(beamPipeTransform,
105
beamPipeBounds,
106
beamPipeLayerMaterial,
107
m_beamPipeThickness
);
108
109
}
else
{
110
Trk::BinUtility
layerBinUtility(
m_beamPipeBinsZ
, -
m_beamPipeHalflength
,
m_beamPipeHalflength
,
Trk::open
,
Trk::binZ
);
111
const
auto
&beamPipeLayerMaterial =
Trk::BinnedLayerMaterial
(layerBinUtility);
112
pThisCylinderLayer =
new
Trk::CylinderLayer
(beamPipeTransform,
113
beamPipeBounds,
114
beamPipeLayerMaterial,
115
m_beamPipeThickness
);
116
}
117
beamPipe->push_back(pThisCylinderLayer);
118
return
beamPipe;
119
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x,...)
Definition
AthMsgStreamMacros.h:42
BeamPipeBuilderImpl.h
BeamPipeDetectorManager.h
BinUtility.h
BinnedLayerMaterial.h
CylinderBounds.h
CylinderLayer.h
GeoPrimitives.h
GeometryStatics.h
HomogeneousLayerMaterial.h
LayerMaterialProperties.h
MaterialProperties.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
InDet::BeamPipeBuilderImpl::m_beamPipeMgrName
StringProperty m_beamPipeMgrName
the name of the beam pipe manager to be configured
Definition
BeamPipeBuilderImpl.h:57
InDet::BeamPipeBuilderImpl::m_beamPipeBinsZ
UnsignedIntegerProperty m_beamPipeBinsZ
number of bins in the beam pipe
Definition
BeamPipeBuilderImpl.h:72
InDet::BeamPipeBuilderImpl::m_beamPipeThickness
DoubleProperty m_beamPipeThickness
thickness of the beam pipe
Definition
BeamPipeBuilderImpl.h:64
InDet::BeamPipeBuilderImpl::m_beamPipeZ
DoubleProperty m_beamPipeZ
averageZ of the beam pipe
Definition
BeamPipeBuilderImpl.h:69
InDet::BeamPipeBuilderImpl::m_beamPipeHalflength
DoubleProperty m_beamPipeHalflength
halflength of the beampipe
Definition
BeamPipeBuilderImpl.h:63
InDet::BeamPipeBuilderImpl::m_beamPipeA
DoubleProperty m_beamPipeA
averageA of the beam pipe
Definition
BeamPipeBuilderImpl.h:68
InDet::BeamPipeBuilderImpl::m_beamPipeRadius
DoubleProperty m_beamPipeRadius
radius of the beam pipe
Definition
BeamPipeBuilderImpl.h:62
InDet::BeamPipeBuilderImpl::m_beamPipeOffsetY
DoubleProperty m_beamPipeOffsetY
beam pipe offset in y
Definition
BeamPipeBuilderImpl.h:61
InDet::BeamPipeBuilderImpl::m_beamPipeL0
double m_beamPipeL0
X0 of the beam pipe.
Definition
BeamPipeBuilderImpl.h:66
InDet::BeamPipeBuilderImpl::cylindricalLayersImpl
std::unique_ptr< const std::vector< Trk::CylinderLayer * > > cylindricalLayersImpl() const
Definition
BeamPipeBuilderImpl.cxx:35
InDet::BeamPipeBuilderImpl::m_beamPipeRho
DoubleProperty m_beamPipeRho
averageRho of the beam pipe
Definition
BeamPipeBuilderImpl.h:70
InDet::BeamPipeBuilderImpl::m_beamPipeMgr
const BeamPipeDetectorManager * m_beamPipeMgr
the beam pipe manager
Definition
BeamPipeBuilderImpl.h:56
InDet::BeamPipeBuilderImpl::initialize
virtual StatusCode initialize() override
AlgTool initialize method.
Definition
BeamPipeBuilderImpl.cxx:25
InDet::BeamPipeBuilderImpl::m_beamPipeOffsetX
DoubleProperty m_beamPipeOffsetX
beam pipe offset in x
Definition
BeamPipeBuilderImpl.h:60
InDet::BeamPipeBuilderImpl::m_beamPipeFromDb
BooleanProperty m_beamPipeFromDb
steer beam pipe parameters from DataBase
Definition
BeamPipeBuilderImpl.h:55
InDet::BeamPipeBuilderImpl::m_beamPipeX0
DoubleProperty m_beamPipeX0
X0 of the beam pipe.
Definition
BeamPipeBuilderImpl.h:65
Trk::BinUtility
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
Definition
BinUtility.h:39
Trk::BinnedLayerMaterial
It extends the LayerMaterialProperties base class.
Definition
BinnedLayerMaterial.h:34
Trk::CylinderLayer
Class to describe a cylindrical detector layer for tracking, it inhertis from both,...
Definition
CylinderLayer.h:43
Trk::HomogeneousLayerMaterial
It extends the LayerMaterialProperties base class.
Definition
HomogeneousLayerMaterial.h:53
Trk::MaterialProperties
Material with information about thickness of material.
Definition
MaterialProperties.h:40
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition
GeoPrimitives.h:46
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition
GeoPrimitives.h:44
Trk::open
@ open
Definition
BinningType.h:40
Trk::binZ
@ binZ
Definition
BinningType.h:49
Generated on
for ATLAS Offline Software by
1.17.0