Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4EmDataHandler.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// -------------------------------------------------------------------
28//
29// GEANT4 Class header file
30//
31// File name: G4EmDataHandler
32//
33// Author: V. Ivanchenko
34//
35// Creation date: 16 August 2016
36//
37// Modifications:
38//
39// Class Description:
40//
41// A storage of G4PhysicsTable
42//
43// Class Description: End
44
45// -------------------------------------------------------------------
46//
47
48#ifndef G4EmDataHandler_h
49#define G4EmDataHandler_h 1
50
51#include <vector>
52
53#include "globals.hh"
54#include "G4PhysicsTable.hh"
55#include "G4PhysicsVector.hh"
56#include "G4EmTableType.hh"
58
59//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60
62class G4VEmProcess;
65
67{
68public:
69
70 explicit G4EmDataHandler(std::size_t nTable, const G4String& nam="");
71
73
74 // update existing table
75 void UpdateTable(G4PhysicsTable*, std::size_t idx);
76
77 // assuming that the table is already defined
78 G4PhysicsTable* MakeTable(std::size_t idx);
79
80 // existing table may be substituted
81 G4PhysicsTable* MakeTable(G4PhysicsTable*, std::size_t idx);
82
83 // clean existing table
84 void CleanTable(std::size_t idx);
85
86 G4bool StorePhysicsTable(std::size_t idx,
87 const G4ParticleDefinition* part,
88 const G4String& fname,
89 G4bool ascii);
90
91 G4bool RetrievePhysicsTable(std::size_t idx,
92 const G4ParticleDefinition* part,
93 const G4String& fname,
94 G4bool ascii, G4bool spline);
95
96 void SetMasterProcess(const G4VEmProcess*);
97
98 const G4VEmProcess* GetMasterProcess(size_t idx) const;
99
100 const G4PhysicsTable* GetTable(std::size_t idx) const {
101 return (idx < tLength) ? data[idx] : nullptr;
102 }
103
104 G4PhysicsTable* Table(std::size_t idx) const {
105 return (idx < tLength) ? data[idx] : nullptr;
106 }
107
108 const G4PhysicsVector* GetVector(std::size_t itable, std::size_t ivec) const {
109 return (*(data[itable]))[ivec];
110 }
111
112 const std::vector<G4PhysicsTable*>& GetTables() const {
113 return data;
114 }
115
116 std::vector<G4double>* EnergyOfCrossSectionMax() const {
117 return fMaxXS;
118 }
119
120 void SetEnergyOfCrossSectionMax(std::vector<G4double>* p) {
121 if (p != fMaxXS) {
122 delete fMaxXS;
123 fMaxXS = p;
124 }
125 }
126
127 std::vector<G4TwoPeaksXS*>* TwoPeaksXS() const {
128 return fXSpeaks;
129 }
130
131 void SetTwoPeaksXS(std::vector<G4TwoPeaksXS*>* p) {
132 if (p != fXSpeaks) {
133 delete fXSpeaks;
134 fXSpeaks = p;
135 }
136 }
137
138 std::vector<G4EmElementSelector*>* GetElementSelectors(std::size_t i) {
139 return (i < eLength) ? fElemSelectors[i] : nullptr;
140 }
141
142 void SetElementSelectors(std::vector<G4EmElementSelector*>*, std::size_t);
143
145 return fXSType;
146 }
147
149 fXSType = val;
150 }
151
152 const G4String& GetName() const {
153 return fName;
154 }
155
157 fUseBaseParticleTable = val;
158 }
159
160 // hide assignment operator
161 G4EmDataHandler & operator=(const G4EmDataHandler &right) = delete;
163
164private:
165
166 G4EmDataRegistry* fRegistry;
167 std::vector<G4PhysicsTable*> data;
168 std::vector<G4double>* fMaxXS;
169 std::vector<G4TwoPeaksXS*>* fXSpeaks;
170 std::vector<std::vector<G4EmElementSelector*>* > fElemSelectors;
171 std::vector<const G4VEmProcess*> masterProcess;
172 std::size_t tLength{0};
173 std::size_t eLength{0};
175 G4bool fUseBaseParticleTable{false};
176 G4String fName;
177};
178
179//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
180
181#endif
182
G4CrossSectionType
@ fEmNoIntegral
bool G4bool
Definition G4Types.hh:86
std::vector< G4TwoPeaksXS * > * TwoPeaksXS() const
void SetEnergyOfCrossSectionMax(std::vector< G4double > *p)
void SetMasterProcess(const G4VEmProcess *)
void SetUseBaseParticleTable(G4bool val)
std::vector< G4double > * EnergyOfCrossSectionMax() const
std::vector< G4EmElementSelector * > * GetElementSelectors(std::size_t i)
void SetCrossSectionType(G4CrossSectionType val)
G4CrossSectionType CrossSectionType() const
void SetTwoPeaksXS(std::vector< G4TwoPeaksXS * > *p)
void SetElementSelectors(std::vector< G4EmElementSelector * > *, std::size_t)
G4PhysicsTable * Table(std::size_t idx) const
const G4VEmProcess * GetMasterProcess(size_t idx) const
G4EmDataHandler & operator=(const G4EmDataHandler &right)=delete
G4EmDataHandler(std::size_t nTable, const G4String &nam="")
const G4PhysicsTable * GetTable(std::size_t idx) const
const G4PhysicsVector * GetVector(std::size_t itable, std::size_t ivec) const
G4bool RetrievePhysicsTable(std::size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii, G4bool spline)
G4EmDataHandler(const G4EmDataHandler &)=delete
const std::vector< G4PhysicsTable * > & GetTables() const
G4bool StorePhysicsTable(std::size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii)
void UpdateTable(G4PhysicsTable *, std::size_t idx)
const G4String & GetName() const
void CleanTable(std::size_t idx)
G4PhysicsTable * MakeTable(std::size_t idx)