ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
GeoModel
GeoModelUtilities
src
GeoModelExperiment.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
GeoModelUtilities/GeoModelExperiment.h
"
6
#include "GeoModelKernel/GeoPhysVol.h"
7
#include "GeoModelKernel/GeoVDetectorManager.h"
8
#include <algorithm>
9
#include <sstream>
10
#include <stdexcept>
14
GeoModelExperiment::GeoModelExperiment
( PVLink physVol )
15
:
m_physVol
(physVol) {}
16
20
21
GeoPhysVol *
GeoModelExperiment::getPhysVol
() {
22
return
dynamic_pointer_cast<GeoPhysVol>(
m_physVol
);
23
}
24
25
26
const
GeoPhysVol *
GeoModelExperiment::getPhysVol
()
const
{
27
return
dynamic_pointer_cast<GeoPhysVol>(
m_physVol
);
28
}
29
30
31
32
GeoModelExperiment::ConstIterator
GeoModelExperiment::beginManager
()
const
{
33
return
m_managers
.begin();
34
}
35
36
GeoModelExperiment::ConstIterator
GeoModelExperiment::endManager
()
const
{
37
return
m_managers
.end();
38
}
39
40
void
GeoModelExperiment::addManager
(
const
GeoVDetectorManager *mgr) {
41
if
(
getManager
(mgr->getName())) {
42
std::ostringstream errorMessage;
43
errorMessage
44
<<
"A detector manager named"
<< mgr->getName()
45
<<
" has already been declared to GeoModelExperiment"
;
46
47
throw
std::runtime_error(errorMessage.str());
48
}
49
m_managers
.insert(mgr);
50
}
51
52
const
GeoVDetectorManager *
GeoModelExperiment::getManager
(
const
std::string & name)
const
{
53
54
const_iterator_type
m = std::find_if(
m_managers
.begin(),
m_managers
.end(),
NameEquals
(name));
55
if
(m!=
m_managers
.end()) {
56
return
*m;
57
}
58
else
{
59
return
NULL;
60
}
61
62
}
63
64
std::vector<std::string>
GeoModelExperiment::getListOfManagers
()
const
{
65
std::vector<std::string> managersList;
66
for
(
auto
manager :
m_managers
) {
67
managersList.push_back(manager->getName());
68
}
69
return
managersList;
70
}
71
72
73
GeoModelExperiment::NameEquals::NameEquals
(
const
std::string & name):
m_name
(name) {
74
}
75
76
bool
GeoModelExperiment::NameEquals::operator()
(
const
value_type
& m)
const
{
77
return
m->getName()==
m_name
;
78
}
79
80
bool
GeoModelExperiment::LexigraphicalOrder::operator ()
(
const
value_type
&
a
,
const
value_type
&b)
const
{
81
return
a
->getName()< b->getName();
82
}
83
84
void
GeoModelExperiment::addTmpVolume
(PVConstLink volume)
85
{
86
m_tmpVolumes
.push_back(volume);
87
}
GeoModelExperiment.h
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
GeoModelExperiment::LexigraphicalOrder::operator()
bool operator()(const value_type &a, const value_type &b) const
Definition
GeoModelExperiment.cxx:80
GeoModelExperiment::NameEquals
Definition
GeoModelExperiment.h:41
GeoModelExperiment::NameEquals::operator()
bool operator()(const value_type &m) const
Definition
GeoModelExperiment.cxx:76
GeoModelExperiment::NameEquals::m_name
std::string m_name
Definition
GeoModelExperiment.h:49
GeoModelExperiment::NameEquals::NameEquals
NameEquals(const std::string &name)
Definition
GeoModelExperiment.cxx:73
GeoModelExperiment::m_physVol
PVLink m_physVol
Definition
GeoModelExperiment.h:98
GeoModelExperiment::endManager
ConstIterator endManager() const
Definition
GeoModelExperiment.cxx:36
GeoModelExperiment::getManager
const GeoVDetectorManager * getManager(const std::string &name) const
Definition
GeoModelExperiment.cxx:52
GeoModelExperiment::beginManager
ConstIterator beginManager() const
Definition
GeoModelExperiment.cxx:32
GeoModelExperiment::m_tmpVolumes
std::vector< PVConstLink > m_tmpVolumes
Definition
GeoModelExperiment.h:100
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition
GeoModelExperiment.cxx:21
GeoModelExperiment::m_managers
collection_type m_managers
Definition
GeoModelExperiment.h:99
GeoModelExperiment::const_iterator_type
collection_type::const_iterator const_iterator_type
Definition
GeoModelExperiment.h:61
GeoModelExperiment::GeoModelExperiment
GeoModelExperiment(PVLink physVol)
Constructor(s).
Definition
GeoModelExperiment.cxx:14
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition
GeoModelExperiment.cxx:40
GeoModelExperiment::addTmpVolume
void addTmpVolume(PVConstLink volume)
Definition
GeoModelExperiment.cxx:84
GeoModelExperiment::getListOfManagers
std::vector< std::string > getListOfManagers() const
Definition
GeoModelExperiment.cxx:64
GeoModelExperiment::value_type
const GeoVDetectorManager * value_type
Definition
GeoModelExperiment.h:39
GeoModelExperiment::ConstIterator
const_iterator_type ConstIterator
Definition
GeoModelExperiment.h:64
Generated on
for ATLAS Offline Software by
1.17.0