ATLAS Offline Software
Loading...
Searching...
No Matches
LayerMaterialMap.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// LayerMaterialMap.h, (c) ATLAS Detector software
8
9#ifndef TRKGEOMETRY_LAYERMATERIALMAP_H
10#define TRKGEOMETRY_LAYERMATERIALMAP_H
11
12#include <map>
13#include <vector>
14
17#include <memory>
20
21namespace Trk {
22
30
32 : public std::map<Trk::LayerIndex, const Trk::LayerMaterialProperties*> {
33 public:
38
40 LayerMaterialMap(const std::shared_ptr<const ElementTable>& eTable)
42 m_elementTable(eTable) {}
43
48
51 if (this != &lmc) {
53 std::map<Trk::LayerIndex, const Trk::LayerMaterialProperties*>::operator=(
54 lmc);
55 }
56 return (*this);
57 }
58
61
63 const ElementTable* elementTable() const { return m_elementTable.get(); }
64
66 void updateElementTable(const std::shared_ptr<const ElementTable>& eTable) {
67 m_elementTable = eTable;
69 }
70
73
74 private:
75 std::shared_ptr<const ElementTable> m_elementTable;
76};
77
79 // delete the entries to act like a DataVector
80 for (auto& it : (*this)) delete (it.second);
81}
82
84 // loop 1 - add up all the 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}
95
96} // namespace Trk
97
99#include "AthenaKernel/CondCont.h"
101
102#endif
#define CONDCONT_DEF(...)
Definition CondCont.h:1413
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
LayerIndex for the identification of layers in a simplified detector geometry of Cylinders and Discs.
Definition LayerIndex.h:37
This class extends the DataVector<Trk::LayerMaterialProperties> by an elementTable;.
std::shared_ptr< const ElementTable > m_elementTable
void synchronizeElementTable()
synchronize the ElementTable
const ElementTable * elementTable() const
retrieval method
void updateElementTable(const std::shared_ptr< const ElementTable > &eTable)
update method
LayerMaterialMap(const std::shared_ptr< const ElementTable > &eTable)
Default constructor.
~LayerMaterialMap()
Destructor.
LayerMaterialMap & operator=(const LayerMaterialMap &lmc)
Assigment operator.
LayerMaterialMap()
Default constructor.
LayerMaterialMap(const Trk::LayerMaterialMap &lmc)
Copy constructor.
This virtual base class encapsulates the logics to build pre/post/full update material for Layer stru...
STL class.
Ensure that the ATLAS eigen extensions are properly loaded.
STL namespace.