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

#include <G3DetTable.hh>

Public Member Functions

 G3DetTable ()
 
virtual ~G3DetTable ()
 
G4int GetID (G4String &set, G4String &det)
 
void Put (G4String &set, G4String &det, G4int id, G4VSensitiveDetector *D)
 
G4VSensitiveDetectorGetSD (G4String &set, G4String &det)
 
void PrintAll ()
 

Detailed Description

Definition at line 39 of file G3DetTable.hh.

Constructor & Destructor Documentation

◆ G3DetTable()

G3DetTable::G3DetTable ( )

Definition at line 40 of file G3DetTable.cc.

40 {
41}

◆ ~G3DetTable()

G3DetTable::~G3DetTable ( )
virtual

Definition at line 43 of file G3DetTable.cc.

43 {
44 if (DTD.size() > 0) {
45 // G4cout << "Deleting DTD" << G4endl;
46 for (DTDiterator i=DTD.begin(); i != DTD.end(); i++) {
47 delete (*i).second;
48 }
49 DTD.clear();
50 }
51}
std::map< G4String, G3DetTableEntry *, std::less< G4String > >::iterator DTDiterator
Definition: G3DetTable.cc:33
Definition: xmlparse.cc:260

Member Function Documentation

◆ GetID()

G4int G3DetTable::GetID ( G4String set,
G4String det 
)

Definition at line 70 of file G3DetTable.cc.

70 {
71
72 // make hash ID
73 G4String ShashID = MakeHash(set, det);
74
75 // search the Hash Dictionary
76 DTDiterator i = DTD.find(ShashID);
77 G3DetTableEntry* DTE = (*i).second;
78 if (DTE != 0) {
79 return DTE->GetID();
80 } else {
81 return 0;
82 }
83}

Referenced by G4gsdeta().

◆ GetSD()

G4VSensitiveDetector * G3DetTable::GetSD ( G4String set,
G4String det 
)

Definition at line 54 of file G3DetTable.cc.

54 {
55
56 // make hash ID
57 const G4String ShashID = MakeHash(set, det);
58
59 // search the map
60 DTDiterator i = DTD.find(ShashID);
61 G3DetTableEntry* DTE = (*i).second;
62 if (DTE != 0) {
63 return DTE->GetSD();
64 } else {
65 return 0;
66 }
67}
G4VSensitiveDetector * GetSD()

◆ PrintAll()

void G3DetTable::PrintAll ( )

Definition at line 96 of file G3DetTable.cc.

96 {
97 if (DTD.size()>0){
98 G4int count=0;
99 G4cout << "Dump of DTD - " << DTD.size() << " entries:" << G4endl;
100 for (DTDiterator i=DTD.begin(); i != DTD.end(); i++) {
101 count++;
102 G3DetTableEntry* DTE = (*i).second;
103 G4cout << "DTD entry " << std::setw(3) << count << " sensitive detector name: "
104 << DTE->GetSD()->GetName() << G4endl;
105 }
106 }
107}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by G4BuildGeom().

◆ Put()

void G3DetTable::Put ( G4String set,
G4String det,
G4int  id,
G4VSensitiveDetector D 
)

Definition at line 86 of file G3DetTable.cc.

87 {
88 // make hash ID
89 G4String ShashID = MakeHash(set, det);
90 G3DetTableEntry* DTE = new G3DetTableEntry(set, det, id, D);
91 G4cout << "Inserted DTE with id " << ShashID << G4endl;
92 DTD[ShashID] = DTE;
93}

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