Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::Experimental::Detector Class Reference

A detector. More...

#include <acts/blob/sPHENIX/Core/include/Acts/Detector/Detector.hpp>

+ Inheritance diagram for Acts::Experimental::Detector:
+ Collaboration diagram for Acts::Experimental::Detector:

Public Member Functions

std::shared_ptr< DetectorgetSharedPtr ()
 
std::shared_ptr< const DetectorgetSharedPtr () const
 
std::vector< std::shared_ptr
< DetectorVolume > > & 
rootVolumePtrs ()
 
const std::vector< const
DetectorVolume * > & 
rootVolumes () const
 
std::vector< std::shared_ptr
< DetectorVolume > > & 
volumePtrs ()
 
const std::vector< const
DetectorVolume * > & 
volumes () const
 
const GeometryHierarchyMap
< const Surface * > & 
sensitiveHierarchyMap () const
 
void updateDetectorVolume (const GeometryContext &gctx, NavigationState &nState) const
 
const DetectorVolumefindDetectorVolume (const GeometryContext &gctx, const Vector3 &position) const
 
const DetectorVolumefindDetectorVolume (const std::string &name) const
 
void updateDetectorVolumeFinder (DetectorVolumeUpdator detectorVolumeUpdator)
 
const DetectorVolumeUpdatordetectorVolumeFinder () const
 Const access to the volume finder.
 
const std::string & name () const
 Return the name of the detector.
 
const std::vector< const
DetectorVolume * > 
volumes () const
 

Static Public Member Functions

static std::shared_ptr< DetectormakeShared (std::string name, std::vector< std::shared_ptr< DetectorVolume >> rootVolumes, DetectorVolumeUpdator detectorVolumeUpdator)
 Factory for producing memory managed instances of Detector.
 

Public Attributes

std::vector< const
DetectorVolume * > 
vs = {}
 

Protected Member Functions

 Detector (std::string name, std::vector< std::shared_ptr< DetectorVolume >> rootVolumes, DetectorVolumeUpdator detectorVolumeUpdator) noexcept(false)
 

Private Attributes

std::string m_name
 Name of the detector.
 
DetectorVolume::ObjectStore
< std::shared_ptr
< DetectorVolume > > 
m_rootVolumes
 Root volumes.
 
DetectorVolume::ObjectStore
< std::shared_ptr
< DetectorVolume > > 
m_volumes
 Volume store (internal/external)
 
DetectorVolumeUpdator m_detectorVolumeUpdator
 A volume finder delegate.
 
std::unordered_map
< std::string, size_t > 
m_volumeNameIndex
 Name/index map to find volumes by name and detect duplicates.
 
GeometryHierarchyMap< const
Surface * > 
m_sensitiveHierarchyMap
 Geometry Id hierarchy map of all sensitive surfaces.
 

Detailed Description

A detector.

Definition at line 34 of file Detector.hpp.

View newest version in sPHENIX GitHub at line 34 of file Detector.hpp

Constructor & Destructor Documentation

Acts::Experimental::Detector::Detector ( std::string  name,
std::vector< std::shared_ptr< DetectorVolume >>  rootVolumes,
DetectorVolumeUpdator  detectorVolumeUpdator 
)
protectednoexcept

Create a detector from volumes

Parameters
namethe detecor name
rootVolumesthe volumes contained by this detector
detectorVolumeUpdatoris a Delegate to find the associated volume
Note
will throw an exception if volumes vector is empty
will throw an exception if duplicate volume names exist
will throw an exception if the delegate is not connected

Definition at line 22 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 22 of file Detector.cpp

References Acts::enumerate(), Acts::Experimental::DetectorVolume::ObjectStore< internal_type >::internal, m_detectorVolumeUpdator, m_rootVolumes, m_sensitiveHierarchyMap, m_volumeNameIndex, m_volumes, testing::internal::move(), fixGDML::root, physmon_simulation::s, writeMapConfig::surface, testSigmaEff::v, and volumes().

+ Here is the call graph for this function:

Member Function Documentation

const Acts::Experimental::DetectorVolumeUpdator & Acts::Experimental::Detector::detectorVolumeFinder ( ) const

Const access to the volume finder.

Definition at line 127 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 127 of file Detector.cpp

const Acts::Experimental::DetectorVolume * Acts::Experimental::Detector::findDetectorVolume ( const GeometryContext gctx,
const Vector3 position 
) const

Find a volume from a position

Parameters
gctxis the Geometry context of the call
positionis the position of the call
Note
this creates internally a NavigationState object
Returns
the volume pointer or nullptr (if outside)

Definition at line 151 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 151 of file Detector.cpp

References Acts::Experimental::NavigationState::currentDetector, Acts::Experimental::NavigationState::currentVolume, nState, Acts::Experimental::NavigationState::position, and position.

Referenced by Acts::Experimental::DetectorNavigator::initializeTarget().

+ Here is the caller graph for this function:

const Acts::Experimental::DetectorVolume * Acts::Experimental::Detector::findDetectorVolume ( const std::string &  name) const

Find a volume by name

Parameters
namewith which the volume is searched for
Returns
the volume pointer or nullptr (if not found)

Definition at line 161 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 161 of file Detector.cpp

std::shared_ptr< Acts::Experimental::Detector > Acts::Experimental::Detector::getSharedPtr ( )

Retrieve a std::shared_ptr for this surface (non-const version)

Note
Will error if this was not created through the makeShared factory since it needs access to the original reference. In C++14 this is undefined behavior (but most likely implemented as a bad_weak_ptr exception), in C++17 it is defined as that exception.
Only call this if you need shared ownership of this object.
Returns
The shared pointer

Definition at line 136 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 136 of file Detector.cpp

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

Retrieve a std::shared_ptr for this surface (const version)

Note
Will error if this was not created through the makeShared factory since it needs access to the original reference. In C++14 this is undefined behavior, but most likely implemented as a bad_weak_ptr exception, in C++17 it is defined as that exception.
Only call this if you need shared ownership of this object.
Returns
The shared pointer

Definition at line 141 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 141 of file Detector.cpp

std::shared_ptr< Acts::Experimental::Detector > Acts::Experimental::Detector::makeShared ( std::string  name,
std::vector< std::shared_ptr< DetectorVolume >>  rootVolumes,
DetectorVolumeUpdator  detectorVolumeUpdator 
)
static

Factory for producing memory managed instances of Detector.

Definition at line 93 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 93 of file Detector.cpp

References testing::internal::move().

Referenced by BOOST_AUTO_TEST_CASE(), Acts::Experimental::DetectorBuilder::construct(), and main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::string & Acts::Experimental::Detector::name ( ) const

Return the name of the detector.

Definition at line 131 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 131 of file Detector.cpp

References m_name().

Referenced by Acts::Python::addJson(), Acts::DetectorJsonConverter::toJson(), and Acts::DetectorJsonConverter::toJsonDetray().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< std::shared_ptr< Acts::Experimental::DetectorVolume > > & Acts::Experimental::Detector::rootVolumePtrs ( )

Non-const access to the root volumes

Returns
the root volume shared pointer

Definition at line 102 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 102 of file Detector.cpp

const std::vector< const Acts::Experimental::DetectorVolume * > & Acts::Experimental::Detector::rootVolumes ( ) const

Const access to the root volumes

Returns
a vector to const DetectorVolume raw pointers

Definition at line 107 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 107 of file Detector.cpp

Referenced by Acts::Experimental::RootVolumeFinder::update().

+ Here is the caller graph for this function:

const Acts::GeometryHierarchyMap< const Acts::Surface * > & Acts::Experimental::Detector::sensitiveHierarchyMap ( ) const

Const access to the hierarchy map of all sensitive surfaces

Returns
the map which can be queried with GeometryID for ranges

Definition at line 171 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 171 of file Detector.cpp

void Acts::Experimental::Detector::updateDetectorVolume ( const GeometryContext gctx,
NavigationState nState 
) const

Update the current volume of a given navigation state

Parameters
gctxis the Geometry context of the call
nState[in, out] is the navigation state

Definition at line 145 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 145 of file Detector.cpp

void Acts::Experimental::Detector::updateDetectorVolumeFinder ( DetectorVolumeUpdator  detectorVolumeUpdator)

Update the volume finder

Parameters
detectorVolumeUpdatorthe new volume finder

Definition at line 121 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 121 of file Detector.cpp

References testing::internal::move().

+ Here is the call graph for this function:

std::vector< std::shared_ptr< Acts::Experimental::DetectorVolume > > & Acts::Experimental::Detector::volumePtrs ( )

Non-const access to the root volume

Returns
the volumes shared pointer store

Definition at line 112 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 112 of file Detector.cpp

const std::vector<const DetectorVolume*> Acts::Experimental::Detector::volumes ( ) const
inline

Definition at line 54 of file NavigationStateUpdatorsTests.cpp.

View newest version in sPHENIX GitHub at line 54 of file NavigationStateUpdatorsTests.cpp

References vs.

const std::vector< const Acts::Experimental::DetectorVolume * > & Acts::Experimental::Detector::volumes ( ) const

Const access to sub volumes

Returns
a vector to const DetectorVolume raw pointers

Definition at line 117 of file Detector.cpp.

View newest version in sPHENIX GitHub at line 117 of file Detector.cpp

Referenced by Acts::Svg::DetectorConverter::convert(), Detector(), Acts::Experimental::IndexedDetectorVolumeExtractor::extract(), Acts::DetectorJsonConverter::toJson(), and Acts::DetectorJsonConverter::toJsonDetray().

+ Here is the caller graph for this function:

Member Data Documentation

DetectorVolumeUpdator Acts::Experimental::Detector::m_detectorVolumeUpdator
private

A volume finder delegate.

Definition at line 151 of file Detector.hpp.

View newest version in sPHENIX GitHub at line 151 of file Detector.hpp

Referenced by Detector().

std::string Acts::Experimental::Detector::m_name
private

Name of the detector.

Definition at line 142 of file Detector.hpp.

View newest version in sPHENIX GitHub at line 142 of file Detector.hpp

DetectorVolume::ObjectStore<std::shared_ptr<DetectorVolume> > Acts::Experimental::Detector::m_rootVolumes
private

Root volumes.

Definition at line 145 of file Detector.hpp.

View newest version in sPHENIX GitHub at line 145 of file Detector.hpp

Referenced by Detector().

GeometryHierarchyMap<const Surface*> Acts::Experimental::Detector::m_sensitiveHierarchyMap
private

Geometry Id hierarchy map of all sensitive surfaces.

Definition at line 157 of file Detector.hpp.

View newest version in sPHENIX GitHub at line 157 of file Detector.hpp

Referenced by Detector().

std::unordered_map<std::string, size_t> Acts::Experimental::Detector::m_volumeNameIndex
private

Name/index map to find volumes by name and detect duplicates.

Definition at line 154 of file Detector.hpp.

View newest version in sPHENIX GitHub at line 154 of file Detector.hpp

Referenced by Detector().

DetectorVolume::ObjectStore<std::shared_ptr<DetectorVolume> > Acts::Experimental::Detector::m_volumes
private

Volume store (internal/external)

Definition at line 148 of file Detector.hpp.

View newest version in sPHENIX GitHub at line 148 of file Detector.hpp

Referenced by Detector().

std::vector<const DetectorVolume*> Acts::Experimental::Detector::vs = {}

Definition at line 53 of file NavigationStateUpdatorsTests.cpp.

View newest version in sPHENIX GitHub at line 53 of file NavigationStateUpdatorsTests.cpp

Referenced by volumes().


The documentation for this class was generated from the following files: