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

This class extends the DataVector<Trk::LayerMaterialProperties> by an elementTable;. More...

#include <LayerMaterialMap.h>

Inheritance diagram for Trk::LayerMaterialMap:
Collaboration diagram for Trk::LayerMaterialMap:

Public Member Functions

 LayerMaterialMap ()
 Default constructor.
 LayerMaterialMap (const std::shared_ptr< const ElementTable > &eTable)
 Default constructor.
 LayerMaterialMap (const Trk::LayerMaterialMap &lmc)
 Copy constructor.
LayerMaterialMapoperator= (const LayerMaterialMap &lmc)
 Assigment operator.
 ~LayerMaterialMap ()
 Destructor.
const ElementTableelementTable () const
 retrieval method
void updateElementTable (const std::shared_ptr< const ElementTable > &eTable)
 update method
void synchronizeElementTable ()
 synchronize the ElementTable

Public Attributes

keys
 STL member.
elements
 STL member.

Private Attributes

std::shared_ptr< const ElementTablem_elementTable

Detailed Description

This class extends the DataVector<Trk::LayerMaterialProperties> by an elementTable;.

@author Andreas.Salzburger -at- cern.ch

Definition at line 31 of file LayerMaterialMap.h.

Constructor & Destructor Documentation

◆ LayerMaterialMap() [1/3]

Trk::LayerMaterialMap::LayerMaterialMap ( )
inline

Default constructor.

Definition at line 35 of file LayerMaterialMap.h.

36 : std::map<Trk::LayerIndex, const Trk::LayerMaterialProperties*>(),
37 m_elementTable(std::shared_ptr<const ElementTable>(0)) {}
std::shared_ptr< const ElementTable > m_elementTable

◆ LayerMaterialMap() [2/3]

Trk::LayerMaterialMap::LayerMaterialMap ( const std::shared_ptr< const ElementTable > & eTable)
inline

Default constructor.

Definition at line 40 of file LayerMaterialMap.h.

41 : std::map<Trk::LayerIndex, const Trk::LayerMaterialProperties*>(),
42 m_elementTable(eTable) {}

◆ LayerMaterialMap() [3/3]

Trk::LayerMaterialMap::LayerMaterialMap ( const Trk::LayerMaterialMap & lmc)
inline

Copy constructor.

Definition at line 45 of file LayerMaterialMap.h.

46 : std::map<Trk::LayerIndex, const Trk::LayerMaterialProperties*>(lmc),

◆ ~LayerMaterialMap()

Trk::LayerMaterialMap::~LayerMaterialMap ( )
inline

Destructor.

Definition at line 78 of file LayerMaterialMap.h.

78 {
79 // delete the entries to act like a DataVector
80 for (auto& it : (*this)) delete (it.second);
81}

Member Function Documentation

◆ elementTable()

const ElementTable * Trk::LayerMaterialMap::elementTable ( ) const
inline

retrieval method

Definition at line 63 of file LayerMaterialMap.h.

63{ return m_elementTable.get(); }

◆ operator=()

LayerMaterialMap & Trk::LayerMaterialMap::operator= ( const LayerMaterialMap & lmc)
inline

Assigment operator.

Definition at line 50 of file LayerMaterialMap.h.

50 {
51 if (this != &lmc) {
52 m_elementTable = lmc.m_elementTable;
53 std::map<Trk::LayerIndex, const Trk::LayerMaterialProperties*>::operator=(
54 lmc);
55 }
56 return (*this);
57 }

◆ synchronizeElementTable()

void Trk::LayerMaterialMap::synchronizeElementTable ( )
inline

synchronize the ElementTable

Definition at line 83 of file LayerMaterialMap.h.

83 {
84 // loop 1 - add up all the ElementTable
85 Trk::ElementTable* eTable = new Trk::ElementTable();
86 if (elementTable()) (*eTable) += (*elementTable());
87 for (auto& it : (*this)) {
88 const Trk::ElementTable* eTableLM = it.second->elementTable();
89 if (eTableLM) (*eTable) += (*eTableLM);
90 }
91 // loop 2 - set the updated ElementTable
92 m_elementTable = std::shared_ptr<const ElementTable>(eTable);
93 for (auto& it : (*this)) it.second->updateElementTable(m_elementTable);
94}
const ElementTable * elementTable() const
retrieval method

◆ updateElementTable()

void Trk::LayerMaterialMap::updateElementTable ( const std::shared_ptr< const ElementTable > & eTable)
inline

update method

Definition at line 66 of file LayerMaterialMap.h.

66 {
67 m_elementTable = eTable;
69 }
void synchronizeElementTable()
synchronize the ElementTable

Member Data Documentation

◆ elements

T std::map< K, T >::elements
inherited

STL member.

◆ keys

K std::map< K, T >::keys
inherited

STL member.

◆ m_elementTable

std::shared_ptr<const ElementTable> Trk::LayerMaterialMap::m_elementTable
private

Definition at line 75 of file LayerMaterialMap.h.


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