ATLAS Offline Software
GeoModelExperiment.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GeoModelKernel/GeoPhysVol.h"
7 #include "GeoModelKernel/GeoVDetectorManager.h"
8 #include <algorithm>
9 #include <sstream>
10 #include <stdexcept>
15  : m_physVol(physVol) {}
16 
22  return m_physVol;
23 }
24 
25 
26 const GeoPhysVol *GeoModelExperiment::getPhysVol() const{
27  return m_physVol;
28 }
29 
30 
31 
33  return m_managers.begin();
34 }
35 
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 
74 }
75 
77  return m->getName()==m_name;
78 }
79 
81  return a->getName()< b->getName();
82 }
83 
84 void GeoModelExperiment::addTmpVolume(PVConstLink volume)
85 {
86  m_tmpVolumes.push_back(volume);
87 }
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition: GeoModelExperiment.cxx:21
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
GeoModelExperiment::NameEquals
Definition: GeoModelExperiment.h:41
GeoModelExperiment::ConstIterator
const_iterator_type ConstIterator
Definition: GeoModelExperiment.h:64
GeoModelExperiment::value_type
const GeoVDetectorManager * value_type
Definition: GeoModelExperiment.h:39
GeoModelExperiment::getListOfManagers
std::vector< std::string > getListOfManagers() const
Definition: GeoModelExperiment.cxx:64
GeoModelExperiment::addTmpVolume
void addTmpVolume(PVConstLink volume)
Definition: GeoModelExperiment.cxx:84
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
GeoModelExperiment.h
GeoModelExperiment::m_physVol
GeoIntrusivePtr< GeoPhysVol > m_physVol
Definition: GeoModelExperiment.h:98
GeoModelExperiment::m_managers
collection_type m_managers
Definition: GeoModelExperiment.h:99
GeoModelExperiment::getManager
const GeoVDetectorManager * getManager(const std::string &name) const
Definition: GeoModelExperiment.cxx:52
GeoModelExperiment::LexigraphicalOrder::operator()
bool operator()(const value_type &a, const value_type &b) const
Definition: GeoModelExperiment.cxx:80
GeoModelExperiment::m_tmpVolumes
std::vector< PVConstLink > m_tmpVolumes
Definition: GeoModelExperiment.h:100
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
GeoModelExperiment::beginManager
ConstIterator beginManager() const
Definition: GeoModelExperiment.cxx:32
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition: GeoModelExperiment.cxx:40
GeoModelExperiment::endManager
ConstIterator endManager() const
Definition: GeoModelExperiment.cxx:36
a
TList * a
Definition: liststreamerinfos.cxx:10
GeoModelExperiment::NameEquals::NameEquals
NameEquals(const std::string &name)
Definition: GeoModelExperiment.cxx:73
GeoModelExperiment::GeoModelExperiment
GeoModelExperiment(GeoPhysVol *physVol)
Constructor(s)
Definition: GeoModelExperiment.cxx:14
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
GeoModelExperiment::NameEquals::operator()
bool operator()(const value_type &m) const
Definition: GeoModelExperiment.cxx:76
GeoModelExperiment::const_iterator_type
collection_type::const_iterator const_iterator_type
Definition: GeoModelExperiment.h:61