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

#include <G4EmDataHandler.hh>

Public Member Functions

void CleanTable (size_t idx)
 
 G4EmDataHandler (const G4EmDataHandler &)=delete
 
 G4EmDataHandler (size_t nTable)
 
const G4VEmProcessGetMasterProcess (size_t idx) const
 
const G4PhysicsTableGetTable (size_t idx) const
 
const std::vector< G4PhysicsTable * > & GetTables () const
 
const G4PhysicsVectorGetVector (size_t itable, size_t ivec) const
 
G4PhysicsTableMakeTable (size_t idx)
 
G4EmDataHandleroperator= (const G4EmDataHandler &right)=delete
 
G4bool RetrievePhysicsTable (size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii, G4bool spline)
 
void SetMasterProcess (const G4VEmProcess *)
 
size_t SetTable (G4PhysicsTable *)
 
G4bool StorePhysicsTable (size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii)
 
G4PhysicsTableTable (size_t idx) const
 
 ~G4EmDataHandler ()
 

Private Attributes

std::vector< G4PhysicsTable * > data
 
std::vector< const G4VEmProcess * > masterProcess
 
size_t tLength
 

Detailed Description

Definition at line 62 of file G4EmDataHandler.hh.

Constructor & Destructor Documentation

◆ G4EmDataHandler() [1/2]

G4EmDataHandler::G4EmDataHandler ( size_t  nTable)
explicit

Definition at line 52 of file G4EmDataHandler.cc.

52 : tLength(n)
53{
54 data.resize(n, nullptr);
55}
std::vector< G4PhysicsTable * > data

References data, and CLHEP::detail::n.

◆ ~G4EmDataHandler()

G4EmDataHandler::~G4EmDataHandler ( )

Definition at line 59 of file G4EmDataHandler.cc.

60{
61 //std::cout << "G4EmDataHandler::~G4EmDataHandler "
62 // << tLength << " " << this << std::endl;
63 for(size_t i=0; i<tLength; ++i) { CleanTable(i); }
64}
void CleanTable(size_t idx)

References CleanTable(), and tLength.

◆ G4EmDataHandler() [2/2]

G4EmDataHandler::G4EmDataHandler ( const G4EmDataHandler )
delete

Member Function Documentation

◆ CleanTable()

void G4EmDataHandler::CleanTable ( size_t  idx)

Definition at line 95 of file G4EmDataHandler.cc.

96{
97 //std::cout << i << " " << data[i] << std::endl;
98 if(i < tLength && nullptr != data[i]) {
99 data[i]->clearAndDestroy();
100 delete data[i];
101 data[i] = nullptr;
102 }
103}

References data, and tLength.

Referenced by ~G4EmDataHandler().

◆ GetMasterProcess()

const G4VEmProcess * G4EmDataHandler::GetMasterProcess ( size_t  idx) const

Definition at line 163 of file G4EmDataHandler.cc.

164{
165 return (idx < masterProcess.size()) ? masterProcess[idx] : nullptr;
166}
std::vector< const G4VEmProcess * > masterProcess

References masterProcess.

Referenced by G4GammaGeneralProcess::BuildPhysicsTable().

◆ GetTable()

const G4PhysicsTable * G4EmDataHandler::GetTable ( size_t  idx) const
inline

Definition at line 90 of file G4EmDataHandler.hh.

90 {
91 return (idx < tLength) ? data[idx] : nullptr;
92 }

References data, and tLength.

◆ GetTables()

const std::vector< G4PhysicsTable * > & G4EmDataHandler::GetTables ( ) const
inline

Definition at line 101 of file G4EmDataHandler.hh.

101{ return data; }

References data.

Referenced by G4GammaGeneralProcess::BuildPhysicsTable().

◆ GetVector()

const G4PhysicsVector * G4EmDataHandler::GetVector ( size_t  itable,
size_t  ivec 
) const
inline

Definition at line 98 of file G4EmDataHandler.hh.

99 { return (*(data[itable]))[ivec]; }

References data.

Referenced by G4GammaGeneralProcess::ComputeGeneralLambda(), and G4GammaGeneralProcess::GetProbability().

◆ MakeTable()

G4PhysicsTable * G4EmDataHandler::MakeTable ( size_t  idx)

Definition at line 77 of file G4EmDataHandler.cc.

78{
79 G4PhysicsTable* table = nullptr;
80 // create new table only if index corresponds to the
81 // position in the vector
82 if(i <= tLength) {
83 if(i < tLength) { table = data[i]; }
85 if(i == tLength) {
86 data.push_back(table);
87 ++tLength;
88 } else { data[i] = table; }
89 }
90 return table;
91}
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)

References data, G4PhysicsTableHelper::PreparePhysicsTable(), and tLength.

Referenced by G4GammaGeneralProcess::InitialiseProcess(), and G4VEmProcess::PreparePhysicsTable().

◆ operator=()

G4EmDataHandler & G4EmDataHandler::operator= ( const G4EmDataHandler right)
delete

◆ RetrievePhysicsTable()

G4bool G4EmDataHandler::RetrievePhysicsTable ( size_t  idx,
const G4ParticleDefinition part,
const G4String fname,
G4bool  ascii,
G4bool  spline 
)

Definition at line 131 of file G4EmDataHandler.cc.

135{
136 G4PhysicsTable* table = Table(idx);
137 G4bool yes = G4PhysicsTableHelper::RetrievePhysicsTable(table, fname, ascii, spline);
139 if ( yes ) {
140 if (0 < param->Verbose()) {
141 G4cout << "Physics table " << idx << " for "
142 << part->GetParticleName()
143 << " is retrieved from <" << fname << ">"
144 << G4endl;
145 }
146 } else if (1 < param->Verbose()) {
147 G4cout << "Fail to retrieve physics table " << idx << " for "
148 << part->GetParticleName() << " from <"
149 << fname << ">" << G4endl;
150 }
151 return yes;
152}
bool G4bool
Definition: G4Types.hh:86
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4PhysicsTable * Table(size_t idx) const
static G4EmParameters * Instance()
G4int Verbose() const
const G4String & GetParticleName() const
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii, G4bool spline)
string fname
Definition: test.py:308

References test::fname, G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4EmParameters::Instance(), G4PhysicsTableHelper::RetrievePhysicsTable(), Table(), and G4EmParameters::Verbose().

Referenced by G4GammaGeneralProcess::RetrievePhysicsTable().

◆ SetMasterProcess()

void G4EmDataHandler::SetMasterProcess ( const G4VEmProcess ptr)

Definition at line 156 of file G4EmDataHandler.cc.

157{
158 masterProcess.push_back(ptr);
159}

References masterProcess.

Referenced by G4GammaGeneralProcess::InitialiseProcess().

◆ SetTable()

size_t G4EmDataHandler::SetTable ( G4PhysicsTable ptr)

Definition at line 68 of file G4EmDataHandler.cc.

69{
70 data.push_back(ptr);
71 ++tLength;
72 return tLength-1;
73}

References data, and tLength.

◆ StorePhysicsTable()

G4bool G4EmDataHandler::StorePhysicsTable ( size_t  idx,
const G4ParticleDefinition part,
const G4String fname,
G4bool  ascii 
)

Definition at line 107 of file G4EmDataHandler.cc.

111{
112 G4bool yes = true;
113 if(nullptr != data[idx]) {
114 yes = data[idx]->StorePhysicsTable(fname, ascii);
115
116 if ( yes ) {
117 G4cout << "Physics table is stored for "
118 << part->GetParticleName()
119 << " <" << fname << "> " << G4endl;
120 } else {
121 G4cout << "Fail to store Physics Table for "
122 << part->GetParticleName()
123 << " <" << fname << "> " << G4endl;
124 }
125 }
126 return yes;
127}

References data, test::fname, G4cout, G4endl, and G4ParticleDefinition::GetParticleName().

Referenced by G4GammaGeneralProcess::StorePhysicsTable().

◆ Table()

G4PhysicsTable * G4EmDataHandler::Table ( size_t  idx) const
inline

Definition at line 94 of file G4EmDataHandler.hh.

94 {
95 return (idx < tLength) ? data[idx] : nullptr;
96 }

References data, and tLength.

Referenced by RetrievePhysicsTable().

Field Documentation

◆ data

std::vector<G4PhysicsTable*> G4EmDataHandler::data
private

◆ masterProcess

std::vector<const G4VEmProcess*> G4EmDataHandler::masterProcess
private

Definition at line 111 of file G4EmDataHandler.hh.

Referenced by GetMasterProcess(), and SetMasterProcess().

◆ tLength

size_t G4EmDataHandler::tLength
private

Definition at line 110 of file G4EmDataHandler.hh.

Referenced by CleanTable(), GetTable(), MakeTable(), SetTable(), Table(), and ~G4EmDataHandler().


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