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

#include <G4EmDataHandler.hh>

Public Member Functions

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

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}

◆ ~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)

◆ 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 && data[i]) {
99 data[i]->clearAndDestroy();
100 delete data[i];
101 data[i] = nullptr;
102 }
103}

Referenced by ~G4EmDataHandler().

◆ GetMasterProcess()

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

Definition at line 170 of file G4EmDataHandler.cc.

171{
172 return (idx < masterProcess.size()) ? masterProcess[idx] : nullptr;
173}

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 }

◆ GetTables()

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

Definition at line 101 of file G4EmDataHandler.hh.

101{ return 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]; }

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)

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 
)

Definition at line 131 of file G4EmDataHandler.cc.

135{
136 G4bool yes =
137 G4PhysicsTableHelper::RetrievePhysicsTable(data[idx], fname, ascii);
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 if(param->Spline()) {
147 G4PhysicsTable* table = data[idx];
148 size_t n = table->length();
149 for(size_t i=0; i<n; ++i) {
150 if((*table)[i]) { (*table)[i]->SetSpline(true); }
151 }
152 }
153 } else if (1 < param->Verbose()) {
154 G4cout << "Fail to retrieve physics table " << idx << " for "
155 << part->GetParticleName() << " from <"
156 << fname << ">" << G4endl;
157 }
158 return yes;
159}
bool G4bool
Definition: G4Types.hh:86
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static G4EmParameters * Instance()
G4int Verbose() const
G4bool Spline() const
const G4String & GetParticleName() const
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii)
std::size_t length() const

Referenced by G4GammaGeneralProcess::RetrievePhysicsTable().

◆ SetMasterProcess()

void G4EmDataHandler::SetMasterProcess ( const G4VEmProcess ptr)

Definition at line 163 of file G4EmDataHandler.cc.

164{
165 masterProcess.push_back(ptr);
166}

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}

◆ 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(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}

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 }

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