ATLAS Offline Software
LayerMaterialMap.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 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 
15 #include "AthenaKernel/CLASS_DEF.h"
20 
21 namespace Trk {
22 
32  : public std::map<Trk::LayerIndex, const Trk::LayerMaterialProperties*> {
33  public:
38 
42  m_elementTable(eTable) {}
43 
46  : std::map<Trk::LayerIndex, const Trk::LayerMaterialProperties*>(lmc),
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 
67  m_elementTable = eTable;
69  }
70 
73 
74  private:
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
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
93  for (auto& it : (*this)) it.second->updateElementTable(m_elementTable);
94 }
95 
96 } // namespace Trk
97 
98 CLASS_DEF(Trk::LayerMaterialMap, 142190734, 1)
99 #include "AthenaKernel/CondCont.h"
101 
102 #endif
ElementTable.h
Trk::LayerMaterialMap::synchronizeElementTable
void synchronizeElementTable()
synchronize the ElementTable
Definition: LayerMaterialMap.h:83
Trk::LayerMaterialMap::~LayerMaterialMap
~LayerMaterialMap()
Destructor.
Definition: LayerMaterialMap.h:78
CONDCONT_DEF
CONDCONT_DEF(Trk::LayerMaterialMap, 139083292)
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Trk::LayerMaterialMap::updateElementTable
void updateElementTable(const SharedObject< const ElementTable > &eTable)
update method
Definition: LayerMaterialMap.h:66
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::LayerMaterialMap
Definition: LayerMaterialMap.h:32
Trk::LayerMaterialMap::elementTable
const ElementTable * elementTable() const
retrieval method
Definition: LayerMaterialMap.h:63
Trk::LayerIndex
Definition: LayerIndex.h:37
Trk::LayerMaterialProperties
Definition: LayerMaterialProperties.h:62
SharedObject.h
LayerIndex.h
Trk::LayerMaterialMap::m_elementTable
SharedObject< const ElementTable > m_elementTable
Definition: LayerMaterialMap.h:75
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
Trk::ElementTable
Definition: ElementTable.h:24
Trk::LayerMaterialMap::LayerMaterialMap
LayerMaterialMap(const Trk::SharedObject< const ElementTable > &eTable)
Default constructor.
Definition: LayerMaterialMap.h:40
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
Trk::LayerMaterialMap::LayerMaterialMap
LayerMaterialMap(const Trk::LayerMaterialMap &lmc)
Copy constructor.
Definition: LayerMaterialMap.h:45
Trk::LayerMaterialMap::LayerMaterialMap
LayerMaterialMap()
Default constructor.
Definition: LayerMaterialMap.h:35
Trk::LayerMaterialMap::operator=
LayerMaterialMap & operator=(const LayerMaterialMap &lmc)
Assigment operator.
Definition: LayerMaterialMap.h:50
CLASS_DEF.h
macros to associate a CLID to a type
LayerMaterialProperties.h