ATLAS Offline Software
SimpleCylinderDetBuilderTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
5 
6 #include "Acts/Geometry/CutoutCylinderVolumeBounds.hpp"
7 #include "Acts/Geometry/CylinderVolumeBounds.hpp"
8 #include "Acts/Geometry/TrapezoidVolumeBounds.hpp"
9 #include "Acts/Visualization/GeometryView3D.hpp"
10 #include "Acts/Geometry/GeometryIdentifier.hpp"
11 #include "Acts/Detector/GeometryIdGenerator.hpp"
12 #include "Acts/Detector/DetectorVolume.hpp"
13 #include "Acts/Detector/PortalGenerators.hpp"
14 #include "Acts/Navigation/DetectorVolumeFinders.hpp"
15 #include "Acts/Navigation/InternalNavigation.hpp"
16 #include "Acts/Navigation/NavigationDelegates.hpp"
17 #include "Acts/Navigation/NavigationState.hpp"
18 #include "Acts/Navigation/DetectorVolumeFinders.hpp"
19 #include "Acts/Visualization/ObjVisualization3D.hpp"
21 
22 namespace ActsTrk {
23 
24  SimpleCylinderDetBuilderTool::SimpleCylinderDetBuilderTool( const std::string& type, const std::string& name, const IInterface* parent ):
26  declareInterface<IDetectorVolumeBuilderTool>(this);
27  }
28 
29  Acts::Experimental::DetectorComponent SimpleCylinderDetBuilderTool::construct(const Acts::GeometryContext& context) const {
30  const ActsGeometryContext* gctx = context.get<const ActsGeometryContext* >();
31 
32  auto cylinderBounds = std::make_unique<Acts::CylinderVolumeBounds>(0, m_radiusMax, m_outerZ);
33  auto cylinderDetectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(
34  Acts::Experimental::defaultPortalGenerator(), gctx->context(), "EnvelopeSimple",
35  Acts::Transform3::Identity(), std::move(cylinderBounds), Acts::Experimental::tryAllPortalsAndSurfaces());
36  cylinderDetectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.setVolume(1));
37 
38  if(msgLvl(MSG::VERBOSE)){
39  Acts::ObjVisualization3D helper;
40  Acts::GeometryView3D::drawDetectorVolume(helper, *cylinderDetectorVolume, gctx->context());
41  helper.write("detectorSimple.obj");
42  helper.clear();
43  }
44 
45  Acts::Experimental::DetectorComponent::PortalContainer portalContainer;
46  for (auto [ip, p] : Acts::enumerate(cylinderDetectorVolume->portalPtrs())) {
47  portalContainer[ip] = p;
48  }
49 
50  return Acts::Experimental::DetectorComponent{
51  {cylinderDetectorVolume},
52  std::move(portalContainer),
53  {{cylinderDetectorVolume}, Acts::Experimental::tryRootVolumes()}};
54  }
55 }
SimpleCylinderDetBuilderTool.h
ActsGeometryContext.h
ActsTrk::SimpleCylinderDetBuilderTool::construct
Acts::Experimental::DetectorComponent construct(const Acts::GeometryContext &context) const override final
Definition: SimpleCylinderDetBuilderTool.cxx:29
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
ActsTrk::SimpleCylinderDetBuilderTool::SimpleCylinderDetBuilderTool
SimpleCylinderDetBuilderTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard tool constructor.
Definition: SimpleCylinderDetBuilderTool.cxx:24
ActsGeometryContext::context
Acts::GeometryContext context() const
Definition: ActsGeometryContext.h:45
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
test_pyathena.parent
parent
Definition: test_pyathena.py:15
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::SimpleCylinderDetBuilderTool::m_radiusMax
Gaudi::Property< double > m_radiusMax
Definition: SimpleCylinderDetBuilderTool.h:24
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:49
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
AthAlgTool
Definition: AthAlgTool.h:26
ActsTrk::SimpleCylinderDetBuilderTool::m_outerZ
Gaudi::Property< double > m_outerZ
Definition: SimpleCylinderDetBuilderTool.h:25