Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
DetectorVolumeSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <Acts/Utilities/AxisDefinitions.hpp>
7 
9 // ATHENA
10 #include "GaudiKernel/EventContext.h"
13 
14 // ACTS
15 #include "Acts/Detector/Detector.hpp"
16 #include "Acts/Detector/DetectorVolume.hpp"
17 #include "Acts/Detector/CylindricalContainerBuilder.hpp"
18 #include "Acts/Detector/DetectorBuilder.hpp"
19 
20 using namespace ActsTrk;
22  ISvcLocator *svc)
23  : base_class(name, svc) {}
24 
26  ATH_CHECK(m_builderTools.retrieve());
27  if (m_builderTools.empty()) {
28  ATH_MSG_FATAL("No subdetectors were defined ");
29  return StatusCode::FAILURE;
30  }
31  return StatusCode::SUCCESS;
32 }
33 
34 std::shared_ptr<const Acts::Experimental::Detector> DetectorVolumeSvc::detector() const {
35  if (!m_detector.isValid()) {
36  ATH_MSG_INFO("Build the Acts tracking detector");
38  }
39  return *m_detector.ptr();
40 }
41 
42 unsigned int DetectorVolumeSvc::populateAlignmentStore(AlignmentStore& /*store*/) const {
43  return 0;
44 }
45 
47  return m_nomContext;
48 }
49 
50 std::shared_ptr<const Acts::Experimental::Detector> DetectorVolumeSvc::buildDetector() const {
51  ActsGeometryContext gctx{};
52  std::vector<std::shared_ptr<const Acts::Experimental::IDetectorComponentBuilder> > builders;
53  for (const auto &builder : m_builderTools) {
55  }
56  using enum Acts::AxisDirection;
57 
58  //Define config for cylindrical container builder
59  Acts::Experimental::CylindricalContainerBuilder::Config cylindricalCfg;
60  cylindricalCfg.builders = builders;
61  cylindricalCfg.binning = std::vector<Acts::AxisDirection>{AxisZ, AxisR};
62  auto cylindricalBuilder = std::make_shared<Acts::Experimental::CylindricalContainerBuilder>(cylindricalCfg);
63 
64  //Define config for detector builder
65  Acts::Experimental::DetectorBuilder::Config detectorCfg;
66  detectorCfg.builder = cylindricalBuilder;
67  return Acts::Experimental::DetectorBuilder(detectorCfg).construct(gctx.context());
68 }
ActsTrk::DetectorVolumeSvc::detector
DetectorPtr detector() const override
Definition: DetectorVolumeSvc.cxx:34
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CxxUtils::CachedValue::ptr
const T * ptr() const
Return a pointer to the cached value.
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CxxUtils::CachedValue::isValid
bool isValid() const
Test to see if the value is valid.
ActsTrk::DetectorVolumeSvc::populateAlignmentStore
unsigned int populateAlignmentStore(AlignmentStore &store) const override
Definition: DetectorVolumeSvc.cxx:42
ActsTrk::DetectorVolumeSvc::m_nomContext
ActsGeometryContext m_nomContext
Definition: DetectorVolumeSvc.h:43
ActsTrk::DetectorVolumeSvc::m_builderTools
ToolHandleArray< IDetectorVolumeBuilderTool > m_builderTools
Definition: DetectorVolumeSvc.h:40
ActsTrk::DetectorVolumeSvc::buildDetector
std::shared_ptr< const Acts::Experimental::Detector > buildDetector() const
Definition: DetectorVolumeSvc.cxx:50
GeoPrimitives.h
DetectorVolumeSvc.h
ActsTrk::DetectorVolumeSvc::initialize
StatusCode initialize() override
Definition: DetectorVolumeSvc.cxx:25
createSimpleDistributions.builder
builder
Definition: createSimpleDistributions.py:52
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ActsTrk::DetectorVolumeSvc::m_detector
CxxUtils::CachedValue< DetectorPtr > m_detector
Definition: DetectorVolumeSvc.h:42
NoDeletePtr.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ActsTrk::DetectorVolumeSvc::DetectorVolumeSvc
DetectorVolumeSvc(const std::string &name, ISvcLocator *pSvcLocator)
Definition: DetectorVolumeSvc.cxx:21
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
PathResolver.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CxxUtils::CachedValue::set
void set(const T &val) const
Set the value, assuming it is currently invalid.
ActsTrk::DetectorVolumeSvc::getNominalContext
const ActsGeometryContext & getNominalContext() const override
Definition: DetectorVolumeSvc.cxx:46
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:55
ActsTrk::NoDeletePtr
Definition: NoDeletePtr.h:17