ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ActsTrk::DetectorVolumeSvc Class Reference

#include <DetectorVolumeSvc.h>

Inheritance diagram for ActsTrk::DetectorVolumeSvc:
Collaboration diagram for ActsTrk::DetectorVolumeSvc:

Public Member Functions

 DetectorVolumeSvc (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize () override
 
DetectorPtr detector () const override
 
unsigned int populateAlignmentStore (AlignmentStore &store) const override
 
const ActsGeometryContextgetNominalContext () const override
 

Private Member Functions

std::shared_ptr< const Acts::Experimental::Detector > buildDetector () const
 

Private Attributes

ToolHandleArray< IDetectorVolumeBuilderToolm_builderTools {this, "DetectorBuilders", {}}
 
CxxUtils::CachedValue< DetectorPtr > m_detector {}
 
ActsGeometryContext m_nomContext {}
 

Detailed Description

Definition at line 24 of file DetectorVolumeSvc.h.

Constructor & Destructor Documentation

◆ DetectorVolumeSvc()

DetectorVolumeSvc::DetectorVolumeSvc ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 20 of file DetectorVolumeSvc.cxx.

22  : base_class(name, svc) {}

Member Function Documentation

◆ buildDetector()

std::shared_ptr< const Acts::Experimental::Detector > DetectorVolumeSvc::buildDetector ( ) const
private

Definition at line 49 of file DetectorVolumeSvc.cxx.

49  {
50  ActsGeometryContext gctx{};
51  std::vector<std::shared_ptr<const Acts::Experimental::IDetectorComponentBuilder> > builders;
52  for (const auto &builder : m_builderTools) {
54  }
55 
56  //Define config for cylindrical container builder
57  Acts::Experimental::CylindricalContainerBuilder::Config cylindricalCfg;
58  cylindricalCfg.builders = builders;
59  cylindricalCfg.binning = std::vector<Acts::BinningValue>{Acts::BinningValue::binZ, Acts::BinningValue::binR};
60  auto cylindricalBuilder = std::make_shared<Acts::Experimental::CylindricalContainerBuilder>(cylindricalCfg);
61 
62  //Define config for detector builder
63  Acts::Experimental::DetectorBuilder::Config detectorCfg;
64  detectorCfg.builder = cylindricalBuilder;
65  return Acts::Experimental::DetectorBuilder(detectorCfg).construct(gctx.context());
66 }

◆ detector()

std::shared_ptr< const Acts::Experimental::Detector > DetectorVolumeSvc::detector ( ) const
override

Definition at line 33 of file DetectorVolumeSvc.cxx.

33  {
34  if (!m_detector.isValid()) {
35  ATH_MSG_INFO("Build the Acts tracking detector");
37  }
38  return *m_detector.ptr();
39 }

◆ getNominalContext()

const ActsGeometryContext & DetectorVolumeSvc::getNominalContext ( ) const
override

Definition at line 45 of file DetectorVolumeSvc.cxx.

45  {
46  return m_nomContext;
47 }

◆ initialize()

StatusCode DetectorVolumeSvc::initialize ( )
override

Definition at line 24 of file DetectorVolumeSvc.cxx.

24  {
25  ATH_CHECK(m_builderTools.retrieve());
26  if (m_builderTools.empty()) {
27  ATH_MSG_FATAL("No subdetectors were defined ");
28  return StatusCode::FAILURE;
29  }
30  return StatusCode::SUCCESS;
31 }

◆ populateAlignmentStore()

unsigned int DetectorVolumeSvc::populateAlignmentStore ( AlignmentStore &  store) const
override

Definition at line 41 of file DetectorVolumeSvc.cxx.

41  {
42  return 0;
43 }

Member Data Documentation

◆ m_builderTools

ToolHandleArray<IDetectorVolumeBuilderTool> ActsTrk::DetectorVolumeSvc::m_builderTools {this, "DetectorBuilders", {}}
private

Definition at line 40 of file DetectorVolumeSvc.h.

◆ m_detector

CxxUtils::CachedValue<DetectorPtr> ActsTrk::DetectorVolumeSvc::m_detector {}
private

Definition at line 42 of file DetectorVolumeSvc.h.

◆ m_nomContext

ActsGeometryContext ActsTrk::DetectorVolumeSvc::m_nomContext {}
private

Definition at line 43 of file DetectorVolumeSvc.h.


The documentation for this class was generated from the following files:
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
Trk::binZ
@ binZ
Definition: BinningType.h:49
CxxUtils::CachedValue::isValid
bool isValid() const
Test to see if the value is valid.
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:49
createSimpleDistributions.builder
builder
Definition: createSimpleDistributions.py:52
ActsTrk::DetectorVolumeSvc::m_detector
CxxUtils::CachedValue< DetectorPtr > m_detector
Definition: DetectorVolumeSvc.h:42
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
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
CxxUtils::CachedValue::set
void set(const T &val) const
Set the value, assuming it is currently invalid.
Trk::binR
@ binR
Definition: BinningType.h:50
ActsTrk::NoDeletePtr
Definition: NoDeletePtr.h:17