Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4tgbElement Class Reference

#include <G4tgbElement.hh>

Public Member Functions

 G4tgbElement ()
 
 ~G4tgbElement ()
 
 G4tgbElement (G4tgrElement *hg)
 
G4ElementBuildG4ElementSimple ()
 
G4ElementBuildG4ElementFromIsotopes ()
 
const G4StringGetName () const
 
const G4StringGetType () const
 

Detailed Description

Definition at line 44 of file G4tgbElement.hh.

Constructor & Destructor Documentation

◆ G4tgbElement() [1/2]

G4tgbElement::G4tgbElement ( )
inline

Definition at line 48 of file G4tgbElement.hh.

48{}

◆ ~G4tgbElement()

G4tgbElement::~G4tgbElement ( )
inline

Definition at line 49 of file G4tgbElement.hh.

49{}

◆ G4tgbElement() [2/2]

G4tgbElement::G4tgbElement ( G4tgrElement * hg)

Definition at line 38 of file G4tgbElement.cc.

39{
40 theTgrElem = hg;
41}

Member Function Documentation

◆ BuildG4ElementFromIsotopes()

G4Element * G4tgbElement::BuildG4ElementFromIsotopes ( )

Definition at line 73 of file G4tgbElement.cc.

74{
75 G4Element* elem = nullptr;
76
77 //-------- if G4Element not found, construct it
78 if(theG4Elem == nullptr)
79 {
80 //----- construct new G4Element
82 static_cast<G4tgrElementFromIsotopes*>(theTgrElem);
83
84 elem = new G4Element(tgrElem->GetName(), tgrElem->GetSymbol(),
85 tgrElem->GetNumberOfIsotopes());
86
87 //----- add isotopes
88 G4Isotope* compIsot;
90 for(G4int ii = 0; ii < tgrElem->GetNumberOfIsotopes(); ++ii)
91 {
92 // Look if this component is a material
93
94 compIsot = mf->FindOrBuildG4Isotope(tgrElem->GetComponent(ii));
95 if(compIsot != nullptr)
96 {
97 elem->AddIsotope(compIsot, tgrElem->GetAbundance(ii));
98 }
99 else
100 {
101 G4String ErrMessage = "Component " + tgrElem->GetComponent(ii) +
102 " of element " + tgrElem->GetName() +
103 " is not an isotope !";
104 G4Exception("G4tgbElement::BuildG4ElementFromIsotopes()",
105 "InvalidSetup", FatalException, ErrMessage);
106 }
107 }
108 theG4Elem = elem;
109 }
110 else
111 {
112 elem = theG4Elem;
113 }
114
115#ifdef G4VERBOSE
117 {
118 G4cout << " Constructing new G4Element from isotopes: " << *elem << G4endl;
119 }
120#endif
121
122 return elem;
123}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
#define elem(i, j)
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4Isotope * FindOrBuildG4Isotope(const G4String &name)
static G4tgbMaterialMgr * GetInstance()
G4double GetAbundance(G4int n) const
const G4String & GetComponent(G4int n) const
const G4String & GetSymbol() const
const G4String & GetName() const
static G4int GetVerboseLevel()

Referenced by G4tgbMaterialMgr::FindOrBuildG4Element().

◆ BuildG4ElementSimple()

G4Element * G4tgbElement::BuildG4ElementSimple ( )

Definition at line 44 of file G4tgbElement.cc.

45{
46 G4Element* elem = nullptr;
47
48 //-------- if G4Element not found, construct it
49 if(theG4Elem == nullptr)
50 {
51 //----- construct new G4Element
52 G4tgrElementSimple* tgrElem = static_cast<G4tgrElementSimple*>(theTgrElem);
53
54 elem = new G4Element(tgrElem->GetName(), tgrElem->GetSymbol(),
55 tgrElem->GetZ(), tgrElem->GetA());
56#ifdef G4VERBOSE
58 {
59 G4cout << " Constructing new G4Element: " << *elem << G4endl;
60 }
61#endif
62 theG4Elem = elem;
63 }
64 else
65 {
66 elem = theG4Elem;
67 }
68
69 return elem;
70}
G4double GetZ() const
G4double GetA() const

Referenced by G4tgbMaterialMgr::FindOrBuildG4Element().

◆ GetName()

const G4String & G4tgbElement::GetName ( ) const
inline

Definition at line 58 of file G4tgbElement.hh.

58{ return theTgrElem->GetName(); }

Referenced by G4tgbMaterialMgr::CopyElements().

◆ GetType()

const G4String & G4tgbElement::GetType ( ) const
inline

Definition at line 59 of file G4tgbElement.hh.

59{ return theTgrElem->GetType(); }
const G4String & GetType() const

Referenced by G4tgbMaterialMgr::FindOrBuildG4Element().


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