#include <G4DCtable.hh>
Public Member Functions | |
G4DCtable () | |
~G4DCtable () | |
G4int | Registor (G4String SDname, G4String DCname) |
G4int | GetCollectionID (G4String DCname) const |
G4int | GetCollectionID (G4VDigitizerModule *aDM) const |
G4int | entries () const |
G4String | GetDMname (G4int i) const |
G4String | GetDCname (G4int i) const |
Definition at line 50 of file G4DCtable.hh.
G4DCtable::G4DCtable | ( | ) |
G4DCtable::~G4DCtable | ( | ) |
G4int G4DCtable::entries | ( | ) | const [inline] |
Definition at line 66 of file G4DCtable.hh.
Referenced by G4DigiManager::GetCollectionCapacity(), GetDCname(), GetDMname(), and G4DigiManager::SetDigiCollection().
G4int G4DCtable::GetCollectionID | ( | G4VDigitizerModule * | aDM | ) | const |
Definition at line 77 of file G4DCtable.cc.
References G4cerr, G4endl, G4VDigitizerModule::GetCollectionName(), G4VDigitizerModule::GetName(), and G4VDigitizerModule::GetNumberOfCollections().
00078 { 00079 if(aDM->GetNumberOfCollections()<1) 00080 { 00081 G4cerr << "Digitizer Module <" << aDM->GetName() 00082 << "> does not have a registered digits collection." 00083 << G4endl; 00084 return -1; 00085 } 00086 if(aDM->GetNumberOfCollections()>1) 00087 { 00088 G4cerr << "Digitizer Module <" << aDM->GetName() 00089 << "> has more than one registered digits collections." 00090 << G4endl; 00091 G4cerr << "Candidates are : "; 00092 for(G4int j=0;j<aDM->GetNumberOfCollections();j++) 00093 { G4cerr << aDM->GetCollectionName(j) << " "; } 00094 G4cerr << G4endl; 00095 return -1; 00096 } 00097 for(size_t k=0;k<DMlist.size();k++) 00098 { if(DMlist[k]==aDM->GetName()) return k; } 00099 return -1; 00100 }
Definition at line 46 of file G4DCtable.cc.
References G4String::index().
Referenced by G4DigiManager::GetDigiCollectionID().
00047 { 00048 G4int i = -1; 00049 if(DCname.index("/")==std::string::npos) // DCname only 00050 { 00051 for(int j=0;j<int(DClist.size());j++) 00052 { 00053 if(DClist[j]==DCname) 00054 { 00055 if(i>=0) return -2; 00056 i = j; 00057 } 00058 } 00059 } 00060 else 00061 { 00062 for(int j=0;j<int(DClist.size());j++) 00063 { 00064 G4String tgt = DMlist[j]; 00065 tgt += "/"; 00066 tgt += DClist[j]; 00067 if(tgt==DCname) 00068 { 00069 if(i>=0) return -2; 00070 i = j; 00071 } 00072 } 00073 } 00074 return i; 00075 }
Definition at line 73 of file G4DCtable.hh.
References entries().
00074 { 00075 if(i<0||i>entries()) return "***Not Defined***"; 00076 return DClist[i]; 00077 }
Definition at line 68 of file G4DCtable.hh.
References entries().
00069 { 00070 if(i<0||i>entries()) return "***Not Defined***"; 00071 return DMlist[i]; 00072 }
Definition at line 37 of file G4DCtable.cc.
Referenced by G4DigiManager::AddNewModule().
00038 { 00039 for(int i=0;i<int(DClist.size());i++) 00040 { if(DClist[i]==DCname && DMlist[i]==DMname) return -1; } 00041 DClist.push_back(DCname); 00042 DMlist.push_back(DMname); 00043 return DClist.size(); 00044 }