ATLAS Offline Software
SimpleCylinderDetBuilderTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
5 
6 #include "Acts/Geometry/CutoutCylinderVolumeBounds.hpp"
7 #include "Acts/Geometry/TrapezoidVolumeBounds.hpp"
8 #include "Acts/Visualization/GeometryView3D.hpp"
9 #include "Acts/Detector/DetectorVolume.hpp"
10 #include "Acts/Detector/PortalGenerators.hpp"
11 #include "Acts/Navigation/DetectorVolumeFinders.hpp"
12 #include "Acts/Navigation/InternalNavigation.hpp"
13 #include "Acts/Navigation/NavigationDelegates.hpp"
14 #include "Acts/Navigation/NavigationState.hpp"
15 #include "Acts/Visualization/ObjVisualization3D.hpp"
17 
18 namespace ActsTrk {
19 
20  SimpleCylinderDetBuilderTool::SimpleCylinderDetBuilderTool( const std::string& type, const std::string& name, const IInterface* parent ):
22  declareInterface<IDetectorVolumeBuilderTool>(this);
23  }
24 
25  Acts::Experimental::DetectorComponent SimpleCylinderDetBuilderTool::construct(const Acts::GeometryContext& context) const {
26  const ActsGeometryContext* gctx = context.get<const ActsGeometryContext* >();
27 
28  auto cylinderBounds = std::make_unique<Acts::CutoutCylinderVolumeBounds>(m_radiusMin, m_radiusMed, m_radiusMax, m_outerZ, m_innerZ);
29  auto cylinderDetectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(
30  Acts::Experimental::defaultPortalGenerator(), gctx->context(), "EnvelopeSimple",
31  Acts::Transform3::Identity(), std::move(cylinderBounds), Acts::Experimental::tryAllPortalsAndSurfaces());
32  cylinderDetectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.setVolume(1));
33 
34  if(msgLvl(MSG::VERBOSE)){
35  Acts::ObjVisualization3D helper;
36  Acts::GeometryView3D::drawDetectorVolume(helper, *cylinderDetectorVolume, gctx->context());
37  helper.write("detectorSimple.obj");
38  helper.clear();
39  }
40 
41  Acts::Experimental::DetectorComponent::PortalContainer portalContainer;
42  for (auto [ip, p] : Acts::enumerate(cylinderDetectorVolume->portalPtrs())) {
43  portalContainer[ip] = p;
44  }
45 
46  return Acts::Experimental::DetectorComponent{
47  {cylinderDetectorVolume},
48  portalContainer,
49  {{cylinderDetectorVolume}, Acts::Experimental::tryRootVolumes()}};
50  }
51 }
SimpleCylinderDetBuilderTool.h
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ActsGeometryContext.h
ActsTrk::SimpleCylinderDetBuilderTool::construct
Acts::Experimental::DetectorComponent construct(const Acts::GeometryContext &context) const override final
Definition: SimpleCylinderDetBuilderTool.cxx:25
ActsTrk::SimpleCylinderDetBuilderTool::m_radiusMed
Gaudi::Property< double > m_radiusMed
Definition: SimpleCylinderDetBuilderTool.h:23
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:20
ActsGeometryContext::context
Acts::GeometryContext context() const
Definition: ActsGeometryContext.h:46
ActsTrk::SimpleCylinderDetBuilderTool::m_innerZ
Gaudi::Property< double > m_innerZ
Definition: SimpleCylinderDetBuilderTool.h:26
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:28
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::SimpleCylinderDetBuilderTool::m_radiusMax
Gaudi::Property< double > m_radiusMax
Definition: SimpleCylinderDetBuilderTool.h:24
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ActsTrk::SimpleCylinderDetBuilderTool::m_radiusMin
Gaudi::Property< double > m_radiusMin
Definition: SimpleCylinderDetBuilderTool.h:22
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
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