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

#include <G4HCIOcatalog.hh>

Public Member Functions

 G4HCIOcatalog ()
 
virtual ~G4HCIOcatalog ()
 
void SetVerboseLevel (G4int v)
 
void RegisterEntry (G4VHCIOentry *d)
 
void RegisterHCIOmanager (G4VPHitsCollectionIO *d)
 
G4VHCIOentryGetEntry (const G4String &name)
 
G4VPHitsCollectionIOGetHCIOmanager (const G4String &name)
 
void PrintEntries ()
 
G4String CurrentHCIOmanager ()
 
void PrintHCIOmanager ()
 
std::size_t NumberOfHCIOmanager ()
 
G4VPHitsCollectionIOGetHCIOmanager (G4int n)
 

Static Public Member Functions

static G4HCIOcatalogGetHCIOcatalog ()
 

Detailed Description

Definition at line 49 of file G4HCIOcatalog.hh.

Constructor & Destructor Documentation

◆ G4HCIOcatalog()

G4HCIOcatalog::G4HCIOcatalog ( )

Definition at line 37 of file G4HCIOcatalog.cc.

38{
39}

Referenced by GetHCIOcatalog().

◆ ~G4HCIOcatalog()

virtual G4HCIOcatalog::~G4HCIOcatalog ( )
inlinevirtual

Definition at line 56 of file G4HCIOcatalog.hh.

56{}

Member Function Documentation

◆ CurrentHCIOmanager()

G4String G4HCIOcatalog::CurrentHCIOmanager ( )

Definition at line 129 of file G4HCIOcatalog.cc.

130{
131 G4String list = "";
132 for(auto it = theStore.cbegin(); it != theStore.cend(); ++it)
133 {
134 list += (*it).first + " ";
135 }
136 return list;
137}

Referenced by G4PersistencyCenter::CurrentHCIOmanager().

◆ GetEntry()

G4VHCIOentry * G4HCIOcatalog::GetEntry ( const G4String name)

Definition at line 86 of file G4HCIOcatalog.cc.

87{
88 if(theCatalog.find(name) == theCatalog.end())
89 {
90 G4cout << "Hit Collection I/O manager entry \"" << name << "\" not found!"
91 << std::endl;
92 return nullptr;
93 }
94 else
95 {
96 G4VHCIOentry* ds = theCatalog[name];
97 return ds;
98 }
99}
G4GLOB_DLL std::ostream G4cout
const char * name(G4int ptype)

Referenced by G4PersistencyCenter::AddHCIOmanager().

◆ GetHCIOcatalog()

G4HCIOcatalog * G4HCIOcatalog::GetHCIOcatalog ( )
static

◆ GetHCIOmanager() [1/2]

G4VPHitsCollectionIO * G4HCIOcatalog::GetHCIOmanager ( const G4String name)

Definition at line 102 of file G4HCIOcatalog.cc.

103{
104 if(theStore.find(name) == theStore.cend())
105 {
106 G4cout << "Hit Collection I/O manager \"" << name << "\" not found!"
107 << G4endl;
108 return nullptr;
109 }
110 else
111 {
112 G4VPHitsCollectionIO* ds = theStore[name];
113 return ds;
114 }
115}
#define G4endl
Definition: G4ios.hh:57

Referenced by G4PersistencyManager::SetVerboseLevel(), and G4VPHitIO::SetVerboseLevel().

◆ GetHCIOmanager() [2/2]

G4VPHitsCollectionIO * G4HCIOcatalog::GetHCIOmanager ( G4int  n)

Definition at line 151 of file G4HCIOcatalog.cc.

152{
153 G4int i = 0;
154 for(auto it = theStore.cbegin(); it != theStore.cend(); ++it)
155 {
156 if(i++ == n)
157 return (*it).second;
158 }
159 return nullptr;
160}
int G4int
Definition: G4Types.hh:85

◆ NumberOfHCIOmanager()

std::size_t G4HCIOcatalog::NumberOfHCIOmanager ( )
inline

Definition at line 86 of file G4HCIOcatalog.hh.

86{ return theStore.size(); }

Referenced by G4PersistencyManager::SetVerboseLevel(), and G4VPHitIO::SetVerboseLevel().

◆ PrintEntries()

void G4HCIOcatalog::PrintEntries ( )

Definition at line 118 of file G4HCIOcatalog.cc.

119{
120 G4cout << "I/O manager entries: ";
121 G4cout << theCatalog.size() << G4endl;
122 for(auto it = theCatalog.cbegin(); it != theCatalog.cend(); ++it)
123 {
124 G4cout << " --- " << (*it).first << G4endl;
125 }
126}

Referenced by G4PersistencyCenter::PrintAll().

◆ PrintHCIOmanager()

void G4HCIOcatalog::PrintHCIOmanager ( )

Definition at line 140 of file G4HCIOcatalog.cc.

141{
142 G4cout << "I/O managers: ";
143 G4cout << theStore.size() << G4endl;
144 for(auto it = theStore.cbegin(); it != theStore.cend(); ++it)
145 {
146 G4cout << " --- " << (*it).first << ", " << (*it).second << "." << G4endl;
147 }
148}

Referenced by G4HCIOentryT< T >::CreateHCIOmanager(), and G4PersistencyCenter::PrintAll().

◆ RegisterEntry()

void G4HCIOcatalog::RegisterEntry ( G4VHCIOentry d)

Definition at line 50 of file G4HCIOcatalog.cc.

51{
52 if(m_verbose > 0)
53 {
54 G4cout << "registering I/O manager entry \"" << d->GetName() << "\" " << d
55 << "." << G4endl;
56 }
57 if(theCatalog.find(d->GetName()) != theCatalog.cend())
58 {
59 G4cout << "Redefining I/O Managers list " << d->GetName() << G4endl;
60 }
61 else
62 {
63 theCatalog[d->GetName()] = d;
64 }
65}
const G4String & GetName()
Definition: G4VHCIOentry.hh:53

Referenced by G4VHCIOentry::G4VHCIOentry().

◆ RegisterHCIOmanager()

void G4HCIOcatalog::RegisterHCIOmanager ( G4VPHitsCollectionIO d)

Definition at line 68 of file G4HCIOcatalog.cc.

69{
70 if(m_verbose > 0)
71 {
72 G4cout << "registering I/O manager \"" << d->SDname() << "\" " << d << "."
73 << G4endl;
74 }
75 if(theStore.find(d->SDname()) != theStore.cend())
76 {
77 G4cout << "Redefining I/O Manager " << d->SDname() << G4endl;
78 }
79 else
80 {
81 theStore[d->SDname()] = d;
82 }
83}
const G4String & SDname()

Referenced by G4HCIOentryT< T >::CreateHCIOmanager().

◆ SetVerboseLevel()

void G4HCIOcatalog::SetVerboseLevel ( G4int  v)
inline

Definition at line 62 of file G4HCIOcatalog.hh.

62{ m_verbose = v; }

Referenced by G4PersistencyManager::SetVerboseLevel().


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