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 (  ) 

Definition at line 40 of file G3DetTable.cc.

00040                       {
00041 }

G3DetTable::~G3DetTable (  )  [virtual]

Definition at line 43 of file G3DetTable.cc.

00043                        {
00044   if (DTD.size() > 0) {
00045     //    G4cout << "Deleting DTD" << G4endl;
00046     for (DTDiterator i=DTD.begin(); i != DTD.end(); i++) {
00047       delete (*i).second;
00048     }
00049     DTD.clear();
00050   }
00051 }


Member Function Documentation

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

Definition at line 70 of file G3DetTable.cc.

References G3DetTableEntry::GetID().

Referenced by G4gsdeta().

00070                                              {
00071 
00072   // make hash ID
00073   G4String ShashID = MakeHash(set, det);
00074 
00075   // search the Hash Dictionary
00076   DTDiterator i = DTD.find(ShashID);
00077   G3DetTableEntry* DTE = (*i).second;
00078   if (DTE != 0) {
00079     return DTE->GetID();
00080   } else {
00081     return 0;
00082   }
00083 }

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

Definition at line 54 of file G3DetTable.cc.

References G3DetTableEntry::GetSD().

00054                                              {
00055 
00056   // make hash ID
00057   const G4String ShashID = MakeHash(set, det);
00058 
00059   // search the map
00060   DTDiterator i = DTD.find(ShashID);
00061   G3DetTableEntry* DTE = (*i).second;
00062   if (DTE != 0) {
00063     return DTE->GetSD();
00064   } else {
00065     return 0;
00066   }  
00067 }

void G3DetTable::PrintAll (  ) 

Definition at line 96 of file G3DetTable.cc.

References G4cout, G4endl, G4VSensitiveDetector::GetName(), and G3DetTableEntry::GetSD().

Referenced by G4BuildGeom().

00096                     {
00097   if (DTD.size()>0){
00098     G4int count=0;
00099     G4cout << "Dump of DTD - " << DTD.size() << " entries:" << G4endl;
00100     for (DTDiterator i=DTD.begin(); i != DTD.end(); i++) {
00101       count++;
00102       G3DetTableEntry* DTE = (*i).second;
00103       G4cout << "DTD entry " << std::setw(3) << count << " sensitive detector name: " 
00104              << DTE->GetSD()->GetName() << G4endl;
00105     }
00106   }
00107 }

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

Definition at line 86 of file G3DetTable.cc.

References G4cout, and G4endl.

00087                                         {
00088   // make hash ID
00089   G4String ShashID = MakeHash(set, det);
00090   G3DetTableEntry* DTE = new G3DetTableEntry(set, det, id, D);
00091   G4cout << "Inserted DTE with id " << ShashID << G4endl;
00092   DTD[ShashID] = DTE;
00093 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:23 2013 for Geant4 by  doxygen 1.4.7