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 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

Gaudi::Property< bool > m_constantMaterialToAllLayers
Gaudi::Property< float > m_constantThicknessInX0 {this, "ConstantMaterialInX0", 0.02}
Gaudi::Property< float > m_constantThicknessInL0 {this, "ConstantMaterialInL0", 0.06}
Gaudi::Property< float > m_constantAverageA {this, "ConstantMaterialA", 14.}
Gaudi::Property< float > m_constantAverageZ {this, "ConstantMaterialZ", 7.}
Gaudi::Property< float > m_constantAverageRho {this, "ConstantMaterialRho", 0.00233}
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.

21 : AthAlgTool(t,n,p)
22{
23 declareInterface<Trk::IGeometryProcessor>(this);
24}
AthAlgTool()
Default constructor:

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 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ 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 27 of file InputLayerMaterialProvider.cxx.

27 {
28
29 m_constantMaterialProperties = Trk::MaterialProperties(1.,
35
36 return StatusCode::SUCCESS;
37}
Gaudi::Property< float > m_constantThicknessInL0
Gaudi::Property< float > m_constantAverageRho
MaterialProperties m_constantMaterialProperties
the set together material
Gaudi::Property< float > m_constantThicknessInX0

◆ 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 102 of file InputLayerMaterialProvider.cxx.

102 {
103
104 // skip Layers w/o material
105 if (!lay.layerMaterialProperties())
106 return StatusCode::SUCCESS;
107
108 // get the layer index for assignment
109 Trk::LayerIndex lIndex = lay.layerIndex();
110
111 // display
112 std::stringstream displayBuffer;
113 for (size_t il = 0; il < level; ++il) displayBuffer << " ";
114
115 ATH_MSG_DEBUG(displayBuffer.str() << " assigning material for Layer with Index: " << lIndex.value());
116 ATH_MSG_VERBOSE(displayBuffer.str() << " Layer memory adress is : " << &lay);
117
118 Trk::HomogeneousLayerMaterial hLayerMaterial = Trk::HomogeneousLayerMaterial(m_constantMaterialProperties, 1.);
119 lay.assignMaterialProperties(hLayerMaterial);
120
121 return StatusCode::SUCCESS;
122}
#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 125 of file InputLayerMaterialProvider.cxx.

125 {
126 return StatusCode::SUCCESS;
127}

◆ 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 40 of file InputLayerMaterialProvider.cxx.

40 {
41
42 ATH_MSG_VERBOSE("Start processing the TrackingGeometry recursively");
43 // retrieve the highest tracking volume
44 Trk::TrackingVolume* worldVolume = tgeo.highestTrackingVolume();
45 if (worldVolume){
46 ATH_MSG_VERBOSE("TrackingVolume '" << worldVolume->volumeName() << "' retrieved as highest level node.");
47 return process(*worldVolume, 0);
48 }
49 // abort job
50 ATH_MSG_FATAL("No highest level TrackingVolume found. Stopping recursive parsing, abort job.");
51 return StatusCode::FAILURE;
52}
#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 55 of file InputLayerMaterialProvider.cxx.

55 {
56
57 std::stringstream displayBuffer;
58 for (size_t il = 0; il < level; ++il) displayBuffer << " ";
59 // formatted screen output
60 ATH_MSG_VERBOSE(displayBuffer.str() << "TrackingVolume '" << tvol.volumeName() << "'");
61
62 // Process the contained layers if they exist
63 Trk::LayerArray* layerArray = tvol.confinedLayers();
64 if (layerArray) {
65 // display output
66 std::span<Trk::Layer * const> layers = layerArray->arrayObjects();
67 auto layIter = layers.begin();
68 auto layIterE = layers.end();
69 ATH_MSG_VERBOSE(displayBuffer.str() << "--> has " << layers.size() << " confined layers." );
70 for ( ; layIter != layIterE; ++layIter){
71 if (!(*layIter))
72 ATH_MSG_WARNING("Zero-pointer found in LayerArray - indicates problem !");
73 if ((*layIter) && process(**layIter, level).isFailure()){
74 ATH_MSG_FATAL("Failed to call process(const Layer&) on confined layers. Aborting.");
75 return StatusCode::FAILURE;
76 }
77 }
78 }
79
80 // Process the contained TrackingVolumes (recursively) if they exist
81 Trk::BinnedArray< Trk::TrackingVolume >* confinedVolumes = tvol.confinedVolumes();
82 // register the next round
83 if (confinedVolumes) {
84 std::span<Trk::TrackingVolume * const> volumes = confinedVolumes->arrayObjects();
85 auto volumesIter = volumes.begin();
86 for (; volumesIter != volumes.end(); ++volumesIter){
87 if (!(*volumesIter))
88 ATH_MSG_WARNING("Zero-pointer found in VolumeArray - indicates problem !");
89 if ((*volumesIter) && process(**volumesIter, ++level).isFailure() ){
90 ATH_MSG_FATAL("Failed to call process(const TrackingVolume&) on confined volumes. Aborting.");
91 return StatusCode::FAILURE;
92 }
93 }
94 }
95
96 // return
97 return StatusCode::SUCCESS;
98
99}
#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 >, and AthCheckedComponent<::AthAlgTool >.

◆ 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

Gaudi::Property<float> Trk::InputLayerMaterialProvider::m_constantAverageA {this, "ConstantMaterialA", 14.}
private

Definition at line 66 of file InputLayerMaterialProvider.h.

67{this, "ConstantMaterialA", 14.};

◆ m_constantAverageRho

Gaudi::Property<float> Trk::InputLayerMaterialProvider::m_constantAverageRho {this, "ConstantMaterialRho", 0.00233}
private

Definition at line 70 of file InputLayerMaterialProvider.h.

71{this, "ConstantMaterialRho", 0.00233};

◆ m_constantAverageZ

Gaudi::Property<float> Trk::InputLayerMaterialProvider::m_constantAverageZ {this, "ConstantMaterialZ", 7.}
private

Definition at line 68 of file InputLayerMaterialProvider.h.

69{this, "ConstantMaterialZ", 7.};

◆ m_constantMaterialProperties

MaterialProperties Trk::InputLayerMaterialProvider::m_constantMaterialProperties {}
private

the set together material

Definition at line 72 of file InputLayerMaterialProvider.h.

72{};

◆ m_constantMaterialToAllLayers

Gaudi::Property<bool> Trk::InputLayerMaterialProvider::m_constantMaterialToAllLayers
private
Initial value:
{this, "AssignConstantMaterial", true,
"just assign a dummy material to all layers"}

Definition at line 59 of file InputLayerMaterialProvider.h.

60 {this, "AssignConstantMaterial", true,
61 "just assign a dummy material to all layers"};

◆ m_constantThicknessInL0

Gaudi::Property<float> Trk::InputLayerMaterialProvider::m_constantThicknessInL0 {this, "ConstantMaterialInL0", 0.06}
private

Definition at line 64 of file InputLayerMaterialProvider.h.

65{this, "ConstantMaterialInL0", 0.06};

◆ m_constantThicknessInX0

Gaudi::Property<float> Trk::InputLayerMaterialProvider::m_constantThicknessInX0 {this, "ConstantMaterialInX0", 0.02}
private

Definition at line 62 of file InputLayerMaterialProvider.h.

63{this, "ConstantMaterialInX0", 0.02};

◆ 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: