Geant4-11
Public Member Functions | Private Attributes
G3VolTable Class Reference

#include <G3VolTable.hh>

Public Member Functions

void Clear ()
 
void CountG3Pos ()
 
 G3VolTable ()
 
G3VolTableEntryGetFirstVTE ()
 
G4LogicalVolumeGetG3toG4Mother ()
 
G3VolTableEntryGetVTE (const G4String &Vname)
 
void PrintAll ()
 
G3VolTableEntryPutVTE (G3VolTableEntry *aVTE)
 
void SetFirstVTE ()
 
void VTEStat ()
 
virtual ~G3VolTable ()
 

Private Attributes

G4String _FirstKey
 
G4int _NG3Pos
 
G3VolTableEntryG3toG4TopVTE
 
std::map< G4String, G3VolTableEntry *, std::less< G4String > > VTD
 

Detailed Description

Definition at line 59 of file G3VolTable.hh.

Constructor & Destructor Documentation

◆ G3VolTable()

G3VolTable::G3VolTable ( )

Definition at line 38 of file G3VolTable.cc.

39 : G3toG4TopVTE(0), _FirstKey("UnDefined"), _NG3Pos(0){
40}
G3VolTableEntry * G3toG4TopVTE
Definition: G3VolTable.hh:78
G4String _FirstKey
Definition: G3VolTable.hh:79
G4int _NG3Pos
Definition: G3VolTable.hh:81

◆ ~G3VolTable()

G3VolTable::~G3VolTable ( )
virtual

Definition at line 42 of file G3VolTable.cc.

42 {
43 if (VTD.size()>0){
44 // G4cout << "Deleting VTD" << G4endl;
45 for (VTDiterator i=VTD.begin(); i != VTD.end(); i++) {
46 delete (*i).second;
47 }
48 VTD.clear();
49 }
50}
std::map< G4String, G3VolTableEntry *, std::less< G4String > >::iterator VTDiterator
Definition: G3VolTable.cc:36
std::map< G4String, G3VolTableEntry *, std::less< G4String > > VTD
Definition: G3VolTable.hh:80

References VTD.

Member Function Documentation

◆ Clear()

void G3VolTable::Clear ( )

Definition at line 118 of file G3VolTable.cc.

118 {
119 if (VTD.size()>0){
120 for (VTDiterator i=VTD.begin(); i != VTD.end(); i++) {
121 delete (*i).second;
122 }
123 VTD.clear();
124 }
125 G3toG4TopVTE = 0;
126 _FirstKey = "UnDefined";
127 _NG3Pos = 0;
128}

References _FirstKey, _NG3Pos, G3toG4TopVTE, and VTD.

◆ CountG3Pos()

void G3VolTable::CountG3Pos ( )

Definition at line 91 of file G3VolTable.cc.

91 {
92 _NG3Pos++;
93}

References _NG3Pos.

Referenced by G3VolTableEntry::AddG3Pos().

◆ GetFirstVTE()

G3VolTableEntry * G3VolTable::GetFirstVTE ( )

Definition at line 106 of file G3VolTable.cc.

106 {
107 return G3toG4TopVTE;
108}

References G3toG4TopVTE.

Referenced by G4BuildGeom().

◆ GetG3toG4Mother()

G4LogicalVolume * G3VolTable::GetG3toG4Mother ( )

◆ GetVTE()

G3VolTableEntry * G3VolTable::GetVTE ( const G4String Vname)

Definition at line 53 of file G3VolTable.cc.

53 {
54 VTDiterator i = VTD.find(Vname);
55 if (i == VTD.end()) return 0;
56 else return (*i).second;
57}

References VTD.

Referenced by G4gsbool(), G4gsdvn(), G4gsdvn2(), G4gsdvt(), G4gsdvt2(), G4gspos(), G4gsposp(), G4gsvolu(), G3VolTableEntry::GetMasterClone(), and PutVTE().

◆ PrintAll()

void G3VolTable::PrintAll ( )

Definition at line 60 of file G3VolTable.cc.

60 {
61 if (VTD.size()){
62 G4int i=0;
63 G4cout << "Dump of VTD - " << VTD.size() << " entries:" << G4endl;
64 VTEStat();
65 for (VTDiterator v=VTD.begin(); v != VTD.end(); v++){
66 G3VolTableEntry* VTE = (*v).second;
67 G4cout << "G3VolTable element " << std::setw(3) << i++ << " name "
68 << VTE->GetName() << " has " << VTE->GetNoDaughters()
69 << " daughters" << G4endl;
70 }
71 }
72}
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
void VTEStat()
Definition: G3VolTable.cc:111

References G4cout, G4endl, G3VolTableEntry::GetName(), G3VolTableEntry::GetNoDaughters(), VTD, and VTEStat().

Referenced by G4BuildGeom().

◆ PutVTE()

G3VolTableEntry * G3VolTable::PutVTE ( G3VolTableEntry aVTE)

Definition at line 75 of file G3VolTable.cc.

75 {
76
77 if (GetVTE(aG3VolTableEntry->GetName()) == 0 ){
78
79 // create a hash key
80 G4String HashID = aG3VolTableEntry->GetName();
81
82 if (_FirstKey == "UnDefined") _FirstKey = HashID;
83
84 // insert into dictionary
85 VTD[HashID] = aG3VolTableEntry;
86 }
87 return GetVTE(aG3VolTableEntry->GetName());
88}
G3VolTableEntry * GetVTE(const G4String &Vname)
Definition: G3VolTable.cc:53

References _FirstKey, G3VolTableEntry::GetName(), GetVTE(), and VTD.

Referenced by G4CloneDaughters(), G4CreateCloneVTE(), G4CreateCloneVTEWithDivision(), and G4CreateVTE().

◆ SetFirstVTE()

void G3VolTable::SetFirstVTE ( )

Definition at line 96 of file G3VolTable.cc.

96 {
98
99 if (G3toG4TopVTE->NPCopies() > 0) {
101 SetFirstVTE();
102 }
103}
G3VolTableEntry * GetMother(G4int i)
void SetFirstVTE()
Definition: G3VolTable.cc:96

References _FirstKey, G3toG4TopVTE, G3VolTableEntry::GetMother(), G3VolTableEntry::GetName(), G3VolTableEntry::NPCopies(), SetFirstVTE(), and VTD.

Referenced by G4ggclos(), and SetFirstVTE().

◆ VTEStat()

void G3VolTable::VTEStat ( )

Definition at line 111 of file G3VolTable.cc.

111 {
112 G4cout << "Instantiated " << VTD.size() <<
113 " volume table entries \n"
114 << " " << _NG3Pos << " positions." << G4endl;
115}

References _NG3Pos, G4cout, G4endl, and VTD.

Referenced by PrintAll().

Field Documentation

◆ _FirstKey

G4String G3VolTable::_FirstKey
private

Definition at line 79 of file G3VolTable.hh.

Referenced by Clear(), PutVTE(), and SetFirstVTE().

◆ _NG3Pos

G4int G3VolTable::_NG3Pos
private

Definition at line 81 of file G3VolTable.hh.

Referenced by Clear(), CountG3Pos(), and VTEStat().

◆ G3toG4TopVTE

G3VolTableEntry* G3VolTable::G3toG4TopVTE
private

Definition at line 78 of file G3VolTable.hh.

Referenced by Clear(), GetFirstVTE(), and SetFirstVTE().

◆ VTD

std::map<G4String, G3VolTableEntry*, std::less<G4String> > G3VolTable::VTD
private

Definition at line 80 of file G3VolTable.hh.

Referenced by Clear(), GetVTE(), PrintAll(), PutVTE(), SetFirstVTE(), VTEStat(), and ~G3VolTable().


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