ATLAS Offline Software
Loading...
Searching...
No Matches
Geo2G4AssemblyFactory Class Reference

#include <Geo2G4AssemblyFactory.h>

Collaboration diagram for Geo2G4AssemblyFactory:

Public Member Functions

 Geo2G4AssemblyFactory ()
Geo2G4AssemblyVolumeBuild (const PVConstLink &thePhys, bool &descend)

Private Attributes

std::map< const GeoVPhysVol *, std::unique_ptr< Geo2G4AssemblyVolume >, std::less< const GeoVPhysVol * > > m_assemblyMap

Detailed Description

Definition at line 15 of file Geo2G4AssemblyFactory.h.

Constructor & Destructor Documentation

◆ Geo2G4AssemblyFactory()

Geo2G4AssemblyFactory::Geo2G4AssemblyFactory ( )

Definition at line 13 of file Geo2G4AssemblyFactory.cxx.

14{
15}

Member Function Documentation

◆ Build()

Geo2G4AssemblyVolume * Geo2G4AssemblyFactory::Build ( const PVConstLink & thePhys,
bool & descend )

Definition at line 17 of file Geo2G4AssemblyFactory.cxx.

19{
20 const GeoLogVol* theLog = thePhys->getLogVol();
21
22 // Check if the assembly was used in GeoModel as a leaf node
23 if(thePhys->getNChildVols() == 0)
24 throw std::runtime_error(std::string("In GeoModel description the assembly ") + theLog->getName()
25 + std::string(" has no children!"));
26
27 descend = true;
28
29 // Search for the assembly in the map
30 auto it = m_assemblyMap.find(&(*thePhys));
31 if(it == m_assemblyMap.end())
32 {
33 auto pair = m_assemblyMap.emplace(&(*thePhys), std::make_unique<Geo2G4AssemblyVolume> ());
34 return pair.first->second.get();
35 }
36 else
37 {
38 descend = false;
39 return it->second.get();
40 }
41}
void descend(TDirectory *d, int level, int maxdepth, const std::vector< std::string > &labels)
Definition chains.cxx:107
std::map< const GeoVPhysVol *, std::unique_ptr< Geo2G4AssemblyVolume >, std::less< const GeoVPhysVol * > > m_assemblyMap

Member Data Documentation

◆ m_assemblyMap

std::map<const GeoVPhysVol*, std::unique_ptr<Geo2G4AssemblyVolume>, std::less<const GeoVPhysVol*> > Geo2G4AssemblyFactory::m_assemblyMap
private

Definition at line 23 of file Geo2G4AssemblyFactory.h.


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