ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::InputLayerMaterialProvider Class Reference

AlgTool that assigns LayerMaterial as specified to the TrackingGeometry. More...

#include <InputLayerMaterialProvider.h>

Inheritance diagram for Trk::InputLayerMaterialProvider:
Collaboration diagram for Trk::InputLayerMaterialProvider:

Public Member Functions

 InputLayerMaterialProvider (const std::string &, const std::string &, const IInterface *)
 Constructor.
virtual ~InputLayerMaterialProvider ()
 Destructor.
virtual StatusCode initialize ()
 Framework initialize()
virtual StatusCode process (TrackingGeometry &tgeo) const
 Processor Action to work on TrackingGeometry& tgeo.
virtual StatusCode process (TrackingVolume &tvol, size_t level=0) const
 Processor Action to work on TrackingVolumes - the level is for the hierachy tree.
virtual StatusCode process (Layer &lay, size_t level=0) const
 Processor Action to work on Layers.
virtual StatusCode process (Surface &surf, size_t level=0) const
 Processor Action to work on Surfaces.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
 DeclareInterfaceID (IGeometryProcessor, 1, 0)
 Creates the InterfaceID and interfaceID() method.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

bool m_constantMaterialToAllLayers
 just assign a dummy material to all layers
float m_constantThicknessInX0
 constant material specifications
float m_constantThicknessInL0
 constant material specifications
float m_constantAverageA
 constant material specifications
float m_constantAverageZ
 constant material specifications
float m_constantAverageRho
 constant material specifications
MaterialProperties m_constantMaterialProperties
 the set together material
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

AlgTool that assigns LayerMaterial as specified to the TrackingGeometry.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 35 of file InputLayerMaterialProvider.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ InputLayerMaterialProvider()

Trk::InputLayerMaterialProvider::InputLayerMaterialProvider ( const std::string & t,
const std::string & n,
const IInterface * p )

Constructor.

Definition at line 21 of file InputLayerMaterialProvider.cxx.

22: AthAlgTool(t,n,p),
29
30{
31 declareInterface<Trk::IGeometryProcessor>(this);
32
33 declareProperty("AssignConstantMaterial", m_constantMaterialToAllLayers);
34 declareProperty("ConstantMaterialInX0", m_constantThicknessInX0);
35 declareProperty("ConstantMaterialInL0", m_constantThicknessInL0);
36 declareProperty("ConstantMaterialA", m_constantAverageA);
37 declareProperty("ConstantMaterialZ", m_constantAverageZ);
38 declareProperty("ConstantMaterialRho", m_constantAverageRho);
39
40}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
float m_constantThicknessInX0
constant material specifications
float m_constantAverageZ
constant material specifications
float m_constantAverageA
constant material specifications
bool m_constantMaterialToAllLayers
just assign a dummy material to all layers
float m_constantThicknessInL0
constant material specifications
float m_constantAverageRho
constant material specifications

◆ ~InputLayerMaterialProvider()

Trk::InputLayerMaterialProvider::~InputLayerMaterialProvider ( )
virtualdefault

Destructor.

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ DeclareInterfaceID()

Trk::IGeometryProcessor::DeclareInterfaceID ( IGeometryProcessor ,
1 ,
0  )
inherited

Creates the InterfaceID and interfaceID() method.

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode Trk::InputLayerMaterialProvider::initialize ( )
virtual

Framework initialize()

Definition at line 46 of file InputLayerMaterialProvider.cxx.

46 {
47
48 m_constantMaterialProperties = Trk::MaterialProperties(1.,
54
55 return StatusCode::SUCCESS;
56}
MaterialProperties m_constantMaterialProperties
the set together material

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ process() [1/4]

StatusCode Trk::InputLayerMaterialProvider::process ( Trk::Layer & lay,
size_t level = 0 ) const
virtual

Processor Action to work on Layers.

Implements Trk::IGeometryProcessor.

Definition at line 121 of file InputLayerMaterialProvider.cxx.

121 {
122
123 // skip Layers w/o material
124 if (!lay.layerMaterialProperties())
125 return StatusCode::SUCCESS;
126
127 // get the layer index for assignment
128 Trk::LayerIndex lIndex = lay.layerIndex();
129
130 // display
131 std::stringstream displayBuffer;
132 for (size_t il = 0; il < level; ++il) displayBuffer << " ";
133
134 ATH_MSG_DEBUG(displayBuffer.str() << " assigning material for Layer with Index: " << lIndex.value());
135 ATH_MSG_VERBOSE(displayBuffer.str() << " Layer memory adress is : " << &lay);
136
137 Trk::HomogeneousLayerMaterial hLayerMaterial = Trk::HomogeneousLayerMaterial(m_constantMaterialProperties, 1.);
138 lay.assignMaterialProperties(hLayerMaterial);
139
140 return StatusCode::SUCCESS;
141}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
int value() const
layerIndex expressed in an integer
Definition LayerIndex.h:71
void assignMaterialProperties(const LayerMaterialProperties &, double scale=1.0)
assignMaterialPropeties
Definition Layer.cxx:177
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
const LayerIndex & layerIndex() const
get the layerIndex

◆ process() [2/4]

StatusCode Trk::InputLayerMaterialProvider::process ( Trk::Surface & surf,
size_t level = 0 ) const
virtual

Processor Action to work on Surfaces.

Implements Trk::IGeometryProcessor.

Definition at line 144 of file InputLayerMaterialProvider.cxx.

144 {
145 return StatusCode::SUCCESS;
146}

◆ process() [3/4]

StatusCode Trk::InputLayerMaterialProvider::process ( Trk::TrackingGeometry & tgeo) const
virtual

Processor Action to work on TrackingGeometry& tgeo.

Implements Trk::IGeometryProcessor.

Definition at line 59 of file InputLayerMaterialProvider.cxx.

59 {
60
61 ATH_MSG_VERBOSE("Start processing the TrackingGeometry recursively");
62 // retrieve the highest tracking volume
63 Trk::TrackingVolume* worldVolume = tgeo.highestTrackingVolume();
64 if (worldVolume){
65 ATH_MSG_VERBOSE("TrackingVolume '" << worldVolume->volumeName() << "' retrieved as highest level node.");
66 return process(*worldVolume, 0);
67 }
68 // abort job
69 ATH_MSG_FATAL("No highest level TrackingVolume found. Stopping recursive parsing, abort job.");
70 return StatusCode::FAILURE;
71}
#define ATH_MSG_FATAL(x)
const TrackingVolume * highestTrackingVolume() const
return the world
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
const std::string process

◆ process() [4/4]

StatusCode Trk::InputLayerMaterialProvider::process ( Trk::TrackingVolume & tvol,
size_t level = 0 ) const
virtual

Processor Action to work on TrackingVolumes - the level is for the hierachy tree.

Implements Trk::IGeometryProcessor.

Definition at line 74 of file InputLayerMaterialProvider.cxx.

74 {
75
76 std::stringstream displayBuffer;
77 for (size_t il = 0; il < level; ++il) displayBuffer << " ";
78 // formatted screen output
79 ATH_MSG_VERBOSE(displayBuffer.str() << "TrackingVolume '" << tvol.volumeName() << "'");
80
81 // Process the contained layers if they exist
82 Trk::LayerArray* layerArray = tvol.confinedLayers();
83 if (layerArray) {
84 // display output
85 std::span<Trk::Layer * const> layers = layerArray->arrayObjects();
86 auto layIter = layers.begin();
87 auto layIterE = layers.end();
88 ATH_MSG_VERBOSE(displayBuffer.str() << "--> has " << layers.size() << " confined layers." );
89 for ( ; layIter != layIterE; ++layIter){
90 if (!(*layIter))
91 ATH_MSG_WARNING("Zero-pointer found in LayerArray - indicates problem !");
92 if ((*layIter) && process(**layIter, level).isFailure()){
93 ATH_MSG_FATAL("Failed to call process(const Layer&) on confined layers. Aborting.");
94 return StatusCode::FAILURE;
95 }
96 }
97 }
98
99 // Process the contained TrackingVolumes (recursively) if they exist
100 Trk::BinnedArray< Trk::TrackingVolume >* confinedVolumes = tvol.confinedVolumes();
101 // register the next round
102 if (confinedVolumes) {
103 std::span<Trk::TrackingVolume * const> volumes = confinedVolumes->arrayObjects();
104 auto volumesIter = volumes.begin();
105 for (; volumesIter != volumes.end(); ++volumesIter){
106 if (!(*volumesIter))
107 ATH_MSG_WARNING("Zero-pointer found in VolumeArray - indicates problem !");
108 if ((*volumesIter) && process(**volumesIter, ++level).isFailure() ){
109 ATH_MSG_FATAL("Failed to call process(const TrackingVolume&) on confined volumes. Aborting.");
110 return StatusCode::FAILURE;
111 }
112 }
113 }
114
115 // return
116 return StatusCode::SUCCESS;
117
118}
#define ATH_MSG_WARNING(x)
virtual std::span< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
const LayerArray * confinedLayers() const
Return the subLayer array.
const TrackingVolumeArray * confinedVolumes() const
Return the subLayer array.
layers(flags, cells_name, *args, **kw)
Here we define wrapper functions to set up all of the standard corrections.
BinnedArray< Layer > LayerArray
simply for the eye

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_constantAverageA

float Trk::InputLayerMaterialProvider::m_constantAverageA
private

constant material specifications

Definition at line 65 of file InputLayerMaterialProvider.h.

◆ m_constantAverageRho

float Trk::InputLayerMaterialProvider::m_constantAverageRho
private

constant material specifications

Definition at line 67 of file InputLayerMaterialProvider.h.

◆ m_constantAverageZ

float Trk::InputLayerMaterialProvider::m_constantAverageZ
private

constant material specifications

Definition at line 66 of file InputLayerMaterialProvider.h.

◆ m_constantMaterialProperties

MaterialProperties Trk::InputLayerMaterialProvider::m_constantMaterialProperties
private

the set together material

Definition at line 68 of file InputLayerMaterialProvider.h.

◆ m_constantMaterialToAllLayers

bool Trk::InputLayerMaterialProvider::m_constantMaterialToAllLayers
private

just assign a dummy material to all layers

Definition at line 62 of file InputLayerMaterialProvider.h.

◆ m_constantThicknessInL0

float Trk::InputLayerMaterialProvider::m_constantThicknessInL0
private

constant material specifications

Definition at line 64 of file InputLayerMaterialProvider.h.

◆ m_constantThicknessInX0

float Trk::InputLayerMaterialProvider::m_constantThicknessInX0
private

constant material specifications

Definition at line 63 of file InputLayerMaterialProvider.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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