ATLAS Offline Software
Loading...
Searching...
No Matches
Geo2G4ElementFactory.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "GeoModelKernel/GeoElement.h"
7#include "G4Element.hh"
8#include <iostream>
9
13
14G4Element *Geo2G4ElementFactory::Build(const GeoElement* theEle)
15{
16 //
17 // Check if this element has already been defined.
18 //
19 const std::string& sym = theEle->getSymbol();
20 const auto itr = m_definedElements.find(sym);
21 if (itr != m_definedElements.end())
22 {
23 return itr->second;
24 }
25 G4Element* elm = new G4Element(theEle->getName(),
26 sym,
27 theEle->getZ(),
28 theEle->getA());
29
30 m_definedElements.emplace(sym, elm);
31 return elm;
32}
G4Element * Build(const GeoElement *)