#include <G4EmDataHandler.hh>
|
| | G4EmDataHandler (std::size_t nTable, const G4String &nam="") |
| | ~G4EmDataHandler () |
| void | UpdateTable (G4PhysicsTable *, std::size_t idx) |
| G4PhysicsTable * | MakeTable (std::size_t idx) |
| G4PhysicsTable * | MakeTable (G4PhysicsTable *, std::size_t idx) |
| void | CleanTable (std::size_t idx) |
| G4bool | StorePhysicsTable (std::size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii) |
| G4bool | RetrievePhysicsTable (std::size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii, G4bool spline) |
| void | SetMasterProcess (const G4VEmProcess *) |
| const G4VEmProcess * | GetMasterProcess (size_t idx) const |
| const G4PhysicsTable * | GetTable (std::size_t idx) const |
| G4PhysicsTable * | Table (std::size_t idx) const |
| const G4PhysicsVector * | GetVector (std::size_t itable, std::size_t ivec) const |
| const std::vector< G4PhysicsTable * > & | GetTables () const |
| std::vector< G4double > * | EnergyOfCrossSectionMax () const |
| void | SetEnergyOfCrossSectionMax (std::vector< G4double > *p) |
| std::vector< G4TwoPeaksXS * > * | TwoPeaksXS () const |
| void | SetTwoPeaksXS (std::vector< G4TwoPeaksXS * > *p) |
| std::vector< G4EmElementSelector * > * | GetElementSelectors (std::size_t i) |
| void | SetElementSelectors (std::vector< G4EmElementSelector * > *, std::size_t) |
| G4CrossSectionType | CrossSectionType () const |
| void | SetCrossSectionType (G4CrossSectionType val) |
| const G4String & | GetName () const |
| void | SetUseBaseParticleTable (G4bool val) |
| G4EmDataHandler & | operator= (const G4EmDataHandler &right)=delete |
| | G4EmDataHandler (const G4EmDataHandler &)=delete |
Definition at line 66 of file G4EmDataHandler.hh.
◆ G4EmDataHandler() [1/2]
| G4EmDataHandler::G4EmDataHandler |
( |
std::size_t | nTable, |
|
|
const G4String & | nam = "" ) |
|
explicit |
Definition at line 51 of file G4EmDataHandler.cc.
52 : tLength(n), fName(nam)
53{
54 data.resize(n, nullptr);
55 fMaxXS = new std::vector<G4double>;
56 fXSpeaks = new std::vector<G4TwoPeaksXS*>;
58 fRegistry->Register(this);
59}
static G4EmDataRegistry * Instance()
Referenced by G4EmDataHandler(), and operator=().
◆ ~G4EmDataHandler()
| G4EmDataHandler::~G4EmDataHandler |
( |
| ) |
|
Definition at line 63 of file G4EmDataHandler.cc.
64{
65 if (!fUseBaseParticleTable && 0 < tLength) {
66 for (std::size_t i=0; i<tLength; ++i) {
68 }
69 data.clear();
70 tLength = 0;
71 delete fMaxXS;
72 fMaxXS = nullptr;
73 delete fXSpeaks;
74 fXSpeaks = nullptr;
75 }
76 if (!fElemSelectors.empty()) {
77 for (auto const & ptr : fElemSelectors) {
78 if (nullptr != ptr) {
79 for (auto const & p : *ptr) { delete p; }
80 ptr->clear();
81 delete ptr;
82 }
83 }
84 fElemSelectors.clear();
85 }
86 fRegistry->DeRegister(this);
87}
void CleanTable(std::size_t idx)
◆ G4EmDataHandler() [2/2]
◆ CleanTable()
| void G4EmDataHandler::CleanTable |
( |
std::size_t | idx | ) |
|
Definition at line 133 of file G4EmDataHandler.cc.
134{
135 if (i < tLength && nullptr != data[i]) {
136 auto ptr = data[i];
137 ptr->clearAndDestroy();
138 for (std::size_t j=0; j<tLength; ++j) {
139 if (ptr == data[j]) { data[j] = nullptr; }
140 }
141 delete ptr;
142 }
143}
Referenced by ~G4EmDataHandler().
◆ CrossSectionType()
◆ EnergyOfCrossSectionMax()
| std::vector< G4double > * G4EmDataHandler::EnergyOfCrossSectionMax |
( |
| ) |
const |
|
inline |
◆ GetElementSelectors()
Definition at line 138 of file G4EmDataHandler.hh.
138 {
139 return (i < eLength) ? fElemSelectors[i] : nullptr;
140 }
◆ GetMasterProcess()
| const G4VEmProcess * G4EmDataHandler::GetMasterProcess |
( |
size_t | idx | ) |
const |
Definition at line 203 of file G4EmDataHandler.cc.
204{
205 return (idx < masterProcess.size()) ? masterProcess[idx] : nullptr;
206}
◆ GetName()
| const G4String & G4EmDataHandler::GetName |
( |
| ) |
const |
|
inline |
◆ GetTable()
| const G4PhysicsTable * G4EmDataHandler::GetTable |
( |
std::size_t | idx | ) |
const |
|
inline |
Definition at line 100 of file G4EmDataHandler.hh.
100 {
101 return (idx < tLength) ? data[idx] : nullptr;
102 }
◆ GetTables()
| const std::vector< G4PhysicsTable * > & G4EmDataHandler::GetTables |
( |
| ) |
const |
|
inline |
◆ GetVector()
| const G4PhysicsVector * G4EmDataHandler::GetVector |
( |
std::size_t | itable, |
|
|
std::size_t | ivec ) const |
|
inline |
◆ MakeTable() [1/2]
Definition at line 118 of file G4EmDataHandler.cc.
119{
120 if (idx >= tLength) {
121 for (std::size_t j=tLength; j<=idx; ++j) {
122 data.push_back(nullptr);
123 }
124 tLength = idx + 1;
125 }
127
128 return data[idx];
129}
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
◆ MakeTable() [2/2]
Definition at line 104 of file G4EmDataHandler.cc.
105{
106 if (idx >= tLength) {
107 for (std::size_t j=tLength; j<=idx; ++j) {
108 data.push_back(nullptr);
109 }
110 tLength = idx + 1;
111 }
113 return data[idx];
114}
◆ operator=()
◆ RetrievePhysicsTable()
Definition at line 171 of file G4EmDataHandler.cc.
175{
179 if ( yes ) {
181 G4cout <<
"### Physics table " << idx <<
" for "
183 << " is retrieved from <" << fname << ">"
185 }
186 }
else if (1 < param->
Verbose()) {
187 G4cout <<
"### Fail to retrieve physics table " << idx <<
" for "
189 << fname <<
">" <<
G4endl;
190 }
191 return yes;
192}
G4GLOB_DLL std::ostream G4cout
G4PhysicsTable * Table(std::size_t idx) const
static G4EmParameters * Instance()
const G4String & GetParticleName() const
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii, G4bool spline)
◆ SetCrossSectionType()
◆ SetElementSelectors()
| void G4EmDataHandler::SetElementSelectors |
( |
std::vector< G4EmElementSelector * > * | p, |
|
|
std::size_t | i ) |
Definition at line 210 of file G4EmDataHandler.cc.
212{
213 if (i < eLength) {
214 if (fElemSelectors[i] != p) {
215 delete fElemSelectors[i];
216 }
217 fElemSelectors[i] = p;
218 } else {
219 fElemSelectors.push_back(p);
220 ++eLength;
221 }
222}
◆ SetEnergyOfCrossSectionMax()
| void G4EmDataHandler::SetEnergyOfCrossSectionMax |
( |
std::vector< G4double > * | p | ) |
|
|
inline |
Definition at line 120 of file G4EmDataHandler.hh.
120 {
121 if (p != fMaxXS) {
122 delete fMaxXS;
123 fMaxXS = p;
124 }
125 }
◆ SetMasterProcess()
| void G4EmDataHandler::SetMasterProcess |
( |
const G4VEmProcess * | ptr | ) |
|
◆ SetTwoPeaksXS()
| void G4EmDataHandler::SetTwoPeaksXS |
( |
std::vector< G4TwoPeaksXS * > * | p | ) |
|
|
inline |
Definition at line 131 of file G4EmDataHandler.hh.
131 {
132 if (p != fXSpeaks) {
133 delete fXSpeaks;
134 fXSpeaks = p;
135 }
136 }
◆ SetUseBaseParticleTable()
| void G4EmDataHandler::SetUseBaseParticleTable |
( |
G4bool | val | ) |
|
|
inline |
◆ StorePhysicsTable()
Definition at line 147 of file G4EmDataHandler.cc.
151{
153 if(nullptr != data[idx]) {
154 yes = data[idx]->StorePhysicsTable(fname, ascii);
155
156 if ( yes ) {
157 G4cout <<
"### Physics table is stored for "
159 <<
" <" << fname <<
"> " <<
G4endl;
160 } else {
161 G4cout <<
"### Fail to store Physics Table for "
163 <<
" <" << fname <<
"> " <<
G4endl;
164 }
165 }
166 return yes;
167}
◆ Table()
◆ TwoPeaksXS()
| std::vector< G4TwoPeaksXS * > * G4EmDataHandler::TwoPeaksXS |
( |
| ) |
const |
|
inline |
◆ UpdateTable()
| void G4EmDataHandler::UpdateTable |
( |
G4PhysicsTable * | ptr, |
|
|
std::size_t | idx ) |
Definition at line 91 of file G4EmDataHandler.cc.
92{
93
94 if (idx < tLength) {
95 data[idx] = ptr;
96 } else {
97 G4cout <<
"### G4EmDataHandler::UpdateTable fail for idx=" << idx
98 <<
" length=" << tLength <<
G4endl;
99 }
100}
The documentation for this class was generated from the following files: