52 : tLength(n), fName(nam)
54 data.resize(n,
nullptr);
55 fMaxXS =
new std::vector<G4double>;
56 fXSpeaks =
new std::vector<G4TwoPeaksXS*>;
58 fRegistry->Register(
this);
65 if (!fUseBaseParticleTable && 0 < tLength) {
66 for (std::size_t i=0; i<tLength; ++i) {
76 if (!fElemSelectors.empty()) {
77 for (
auto const & ptr : fElemSelectors) {
79 for (
auto const & p : *ptr) {
delete p; }
84 fElemSelectors.clear();
86 fRegistry->DeRegister(
this);
97 G4cout <<
"### G4EmDataHandler::UpdateTable fail for idx=" << idx
98 <<
" length=" << tLength <<
G4endl;
106 if (idx >= tLength) {
107 for (std::size_t j=tLength; j<=idx; ++j) {
108 data.push_back(
nullptr);
120 if (idx >= tLength) {
121 for (std::size_t j=tLength; j<=idx; ++j) {
122 data.push_back(
nullptr);
135 if (i < tLength &&
nullptr != data[i]) {
137 ptr->clearAndDestroy();
138 for (std::size_t j=0; j<tLength; ++j) {
139 if (ptr == data[j]) { data[j] =
nullptr; }
153 if(
nullptr != data[idx]) {
154 yes = data[idx]->StorePhysicsTable(fname, ascii);
157 G4cout <<
"### Physics table is stored for "
159 <<
" <" << fname <<
"> " <<
G4endl;
161 G4cout <<
"### Fail to store Physics Table for "
163 <<
" <" << fname <<
"> " <<
G4endl;
181 G4cout <<
"### Physics table " << idx <<
" for "
183 <<
" is retrieved from <" << fname <<
">"
186 }
else if (1 < param->
Verbose()) {
187 G4cout <<
"### Fail to retrieve physics table " << idx <<
" for "
189 << fname <<
">" <<
G4endl;
198 masterProcess.push_back(ptr);
205 return (idx < masterProcess.size()) ? masterProcess[idx] :
nullptr;
214 if (fElemSelectors[i] != p) {
215 delete fElemSelectors[i];
217 fElemSelectors[i] = p;
219 fElemSelectors.push_back(p);
G4GLOB_DLL std::ostream G4cout
void SetMasterProcess(const G4VEmProcess *)
void SetElementSelectors(std::vector< G4EmElementSelector * > *, std::size_t)
G4PhysicsTable * Table(std::size_t idx) const
const G4VEmProcess * GetMasterProcess(size_t idx) const
G4EmDataHandler(std::size_t nTable, const G4String &nam="")
G4bool RetrievePhysicsTable(std::size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii, G4bool spline)
G4bool StorePhysicsTable(std::size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii)
void UpdateTable(G4PhysicsTable *, std::size_t idx)
void CleanTable(std::size_t idx)
G4PhysicsTable * MakeTable(std::size_t idx)
static G4EmDataRegistry * Instance()
static G4EmParameters * Instance()
const G4String & GetParticleName() const
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii, G4bool spline)