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

LayerMaterialProperties creator for BinnedLayerMaterial. More...

#include <BinnedLayerMaterialCreator.h>

Inheritance diagram for Trk::BinnedLayerMaterialCreator:
Collaboration diagram for Trk::BinnedLayerMaterialCreator:

Public Member Functions

 BinnedLayerMaterialCreator (const std::string &, const std::string &, const IInterface *)
 Constructor.
 ~BinnedLayerMaterialCreator ()
 Destructor.
LayerMaterialPropertiescreateLayerMaterial (const LayerMaterialRecord &lmr) const
 process the material properties
LayerMaterialPropertiesconvertLayerMaterial (const LayerMaterialProperties &lmr) const
 create layer material properties from layer material properties - simply clones
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 (ILayerMaterialCreator, 1, 0)
const std::string & layerMaterialName () const
 the name of the created material map

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.

Protected Attributes

std::string m_layerMaterialName
std::string m_layerMaterialDirectory

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

double m_compressedMaterialThickness
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
CxxUtils::CachedValue< std::string > m_layerMaterialFullName

Detailed Description

LayerMaterialProperties creator for BinnedLayerMaterial.

The convert LayerMaterialProperties method converts the given LayerMaterial of any type into a binned LayerMaterialMap BinnedLayerMaterial

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

Definition at line 34 of file BinnedLayerMaterialCreator.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

◆ BinnedLayerMaterialCreator()

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

Constructor.

Definition at line 22 of file BinnedLayerMaterialCreator.cxx.

23: AthAlgTool(t,n,p),
25{
26 declareInterface<Trk::ILayerMaterialCreator>(this);
27
28 // give the map a name
29 declareProperty("LayerMaterialName" , m_layerMaterialName);
30 declareProperty("LayerMaterialDirectory" , m_layerMaterialDirectory);
31 // setup for compressed layer creation
33
34}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ ~BinnedLayerMaterialCreator()

Trk::BinnedLayerMaterialCreator::~BinnedLayerMaterialCreator ( )
default

Destructor.

Member Function Documentation

◆ convertLayerMaterial()

Trk::LayerMaterialProperties * Trk::BinnedLayerMaterialCreator::convertLayerMaterial ( const LayerMaterialProperties & lmr) const
virtual

create layer material properties from layer material properties - simply clones

Implements Trk::ILayerMaterialCreator.

Definition at line 51 of file BinnedLayerMaterialCreator.cxx.

52{
53 // the return object
54 Trk::LayerMaterialProperties* bLayerMaterial = nullptr;
55 // get the binUtility of the LayerMaterialProperties
56 const Trk::BinUtility* bUtility = lmProperties.binUtility();
57 // we have a bin utility, get the matrix and fill it
58 if (bUtility){
59 // prepare the matrix
60 // nF x nS
61 size_t nBins0 = bUtility->max(0)+1;
62 size_t nBins1 = bUtility->max(1)+1;
63 // create the MaterialMatrix
64 Trk::MaterialPropertiesMatrix materialMatrix;
65 materialMatrix.reserve(nBins1);
66 // fill the matrix
67 for (size_t ibin1 = 0; ibin1 < nBins1; ++ibin1) {
68 // create the vector first
69 Trk::MaterialPropertiesVector materialVector;
70 materialVector.reserve(nBins0);
71 // loop over local 1 bins
72 for (size_t ibin0 = 0; ibin0 < nBins0; ++ibin0) {
73 // get the material from the properties and push them as clones for the BinnedLayerMaterial
74 const Trk::MaterialProperties* mProperties = lmProperties.material(ibin0,ibin1) ? lmProperties.material(ibin0,ibin1)->clone() : nullptr;
75 materialVector.push_back(mProperties);
76 }
77 // now pus the vector into the matrix
78 materialMatrix.push_back(materialVector);
79 }
80
81
82 } else {
83 // must be homogenous material, can be transformed into a 0-bin material, would be silly though
84 bLayerMaterial = lmProperties.clone();
85 }
86 //
87 return bLayerMaterial;
88}
size_t max(size_t ba=0) const
First bin maximal value.
Definition BinUtility.h:212
virtual LayerMaterialProperties * clone() const =0
Pseudo-Constructor clone()
std::vector< const MaterialProperties * > MaterialPropertiesVector
Useful typedefs.
std::vector< std::vector< const MaterialProperties * > > MaterialPropertiesMatrix

◆ createLayerMaterial()

Trk::LayerMaterialProperties * Trk::BinnedLayerMaterialCreator::createLayerMaterial ( const LayerMaterialRecord & lmr) const
virtual

process the material properties

Implements Trk::ILayerMaterialCreator.

Definition at line 41 of file BinnedLayerMaterialCreator.cxx.

42{
43 // get the material matrix and copy
44 const Trk::MaterialPropertiesMatrix& mpm = lmr.associatedLayerMaterial();
45 // this method creates a compressed representation of the BinnedLayerMaterial
46 const Trk::BinUtility* cbinutil = lmr.binUtility();
47 // create the compressed material
48 return new Trk::BinnedLayerMaterial(*cbinutil,mpm);
49}

◆ 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::ILayerMaterialCreator::DeclareInterfaceID ( ILayerMaterialCreator ,
1 ,
0  )
inherited

◆ 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

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

◆ layerMaterialName()

const std::string & Trk::ILayerMaterialCreator::layerMaterialName ( ) const
inlineinherited

the name of the created material map

Definition at line 47 of file ILayerMaterialCreator.h.

47 {
48 if (!m_layerMaterialFullName.isValid()) {
50 }
51 return *m_layerMaterialFullName.ptr();
52 }
CxxUtils::CachedValue< std::string > m_layerMaterialFullName

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

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

double Trk::BinnedLayerMaterialCreator::m_compressedMaterialThickness
private

Definition at line 52 of file BinnedLayerMaterialCreator.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_layerMaterialDirectory

std::string Trk::ILayerMaterialCreator::m_layerMaterialDirectory
protectedinherited

Definition at line 56 of file ILayerMaterialCreator.h.

◆ m_layerMaterialFullName

CxxUtils::CachedValue<std::string> Trk::ILayerMaterialCreator::m_layerMaterialFullName
privateinherited

Definition at line 59 of file ILayerMaterialCreator.h.

◆ m_layerMaterialName

std::string Trk::ILayerMaterialCreator::m_layerMaterialName
protectedinherited

Definition at line 55 of file ILayerMaterialCreator.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: