ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7// Amg
9// Trk inlcude
12//#include "TrkDetDescrGeoModelCnv/GeoShapeConverter.h"
19// GeoModel include
21#include "GeoModelKernel/GeoTube.h"
22
23// Athena standard methods
24// initialize
26{
27 if (m_beamPipeFromDb) {
29 ATH_MSG_DEBUG("Successfully retrieved BeamPipe detector manager '" << m_beamPipeMgrName << "'." );
30 }
31 ATH_MSG_DEBUG( "initialize()" );
32 return StatusCode::SUCCESS;
33}
34
35std::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 {
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
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,
108
109 } else {
111 const auto &beamPipeLayerMaterial = Trk::BinnedLayerMaterial(layerBinUtility);
112 pThisCylinderLayer = new Trk::CylinderLayer(beamPipeTransform,
113 beamPipeBounds,
114 beamPipeLayerMaterial,
116 }
117 beamPipe->push_back(pThisCylinderLayer);
118 return beamPipe;
119}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
const ServiceHandle< StoreGateSvc > & detStore() const
StringProperty m_beamPipeMgrName
the name of the beam pipe manager to be configured
UnsignedIntegerProperty m_beamPipeBinsZ
number of bins in the beam pipe
DoubleProperty m_beamPipeThickness
thickness of the beam pipe
DoubleProperty m_beamPipeZ
averageZ of the beam pipe
DoubleProperty m_beamPipeHalflength
halflength of the beampipe
DoubleProperty m_beamPipeA
averageA of the beam pipe
DoubleProperty m_beamPipeRadius
radius of the beam pipe
DoubleProperty m_beamPipeOffsetY
beam pipe offset in y
double m_beamPipeL0
X0 of the beam pipe.
std::unique_ptr< const std::vector< Trk::CylinderLayer * > > cylindricalLayersImpl() const
DoubleProperty m_beamPipeRho
averageRho of the beam pipe
const BeamPipeDetectorManager * m_beamPipeMgr
the beam pipe manager
virtual StatusCode initialize() override
AlgTool initialize method.
DoubleProperty m_beamPipeOffsetX
beam pipe offset in x
BooleanProperty m_beamPipeFromDb
steer beam pipe parameters from DataBase
DoubleProperty m_beamPipeX0
X0 of the beam pipe.
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
Definition BinUtility.h:39
It extends the LayerMaterialProperties base class.
Class to describe a cylindrical detector layer for tracking, it inhertis from both,...
It extends the LayerMaterialProperties base class.
Material with information about thickness of material.
Eigen::Affine3d Transform3D
Eigen::Translation< double, 3 > Translation3D
@ open
Definition BinningType.h:40
@ binZ
Definition BinningType.h:49