File indexing completed on 2026-08-11 09:22:04
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 #ifndef G4EmDataHandler_h
0049 #define G4EmDataHandler_h 1
0050
0051 #include <vector>
0052
0053 #include "globals.hh"
0054 #include "G4PhysicsTable.hh"
0055 #include "G4PhysicsVector.hh"
0056 #include "G4EmTableType.hh"
0057 #include "G4EmElementSelector.hh"
0058
0059
0060
0061 class G4ParticleDefinition;
0062 class G4VEmProcess;
0063 class G4VEnergyLossProcess;
0064 class G4EmDataRegistry;
0065
0066 class G4EmDataHandler
0067 {
0068 public:
0069
0070 explicit G4EmDataHandler(std::size_t nTable, const G4String& nam="");
0071
0072 ~G4EmDataHandler();
0073
0074
0075 void UpdateTable(G4PhysicsTable*, std::size_t idx);
0076
0077
0078 G4PhysicsTable* MakeTable(std::size_t idx);
0079
0080
0081 G4PhysicsTable* MakeTable(G4PhysicsTable*, std::size_t idx);
0082
0083
0084 void CleanTable(std::size_t idx);
0085
0086 G4bool StorePhysicsTable(std::size_t idx,
0087 const G4ParticleDefinition* part,
0088 const G4String& fname,
0089 G4bool ascii);
0090
0091 G4bool RetrievePhysicsTable(std::size_t idx,
0092 const G4ParticleDefinition* part,
0093 const G4String& fname,
0094 G4bool ascii, G4bool spline);
0095
0096 void SetMasterProcess(const G4VEmProcess*);
0097
0098 const G4VEmProcess* GetMasterProcess(size_t idx) const;
0099
0100 const G4PhysicsTable* GetTable(std::size_t idx) const {
0101 return (idx < tLength) ? data[idx] : nullptr;
0102 }
0103
0104 G4PhysicsTable* Table(std::size_t idx) const {
0105 return (idx < tLength) ? data[idx] : nullptr;
0106 }
0107
0108 const G4PhysicsVector* GetVector(std::size_t itable, std::size_t ivec) const {
0109 return (*(data[itable]))[ivec];
0110 }
0111
0112 const std::vector<G4PhysicsTable*>& GetTables() const {
0113 return data;
0114 }
0115
0116 std::vector<G4double>* EnergyOfCrossSectionMax() const {
0117 return fMaxXS;
0118 }
0119
0120 void SetEnergyOfCrossSectionMax(std::vector<G4double>* p) {
0121 if (p != fMaxXS) {
0122 delete fMaxXS;
0123 fMaxXS = p;
0124 }
0125 }
0126
0127 std::vector<G4TwoPeaksXS*>* TwoPeaksXS() const {
0128 return fXSpeaks;
0129 }
0130
0131 void SetTwoPeaksXS(std::vector<G4TwoPeaksXS*>* p) {
0132 if (p != fXSpeaks) {
0133 delete fXSpeaks;
0134 fXSpeaks = p;
0135 }
0136 }
0137
0138 std::vector<G4EmElementSelector*>* GetElementSelectors(std::size_t i) {
0139 return (i < eLength) ? fElemSelectors[i] : nullptr;
0140 }
0141
0142 void SetElementSelectors(std::vector<G4EmElementSelector*>*, std::size_t);
0143
0144 G4CrossSectionType CrossSectionType() const {
0145 return fXSType;
0146 }
0147
0148 void SetCrossSectionType(G4CrossSectionType val) {
0149 fXSType = val;
0150 }
0151
0152 const G4String& GetName() const {
0153 return fName;
0154 }
0155
0156 void SetUseBaseParticleTable(G4bool val) {
0157 fUseBaseParticleTable = val;
0158 }
0159
0160
0161 G4EmDataHandler & operator=(const G4EmDataHandler &right) = delete;
0162 G4EmDataHandler(const G4EmDataHandler&) = delete;
0163
0164 private:
0165
0166 G4EmDataRegistry* fRegistry;
0167 std::vector<G4PhysicsTable*> data;
0168 std::vector<G4double>* fMaxXS;
0169 std::vector<G4TwoPeaksXS*>* fXSpeaks;
0170 std::vector<std::vector<G4EmElementSelector*>* > fElemSelectors;
0171 std::vector<const G4VEmProcess*> masterProcess;
0172 std::size_t tLength{0};
0173 std::size_t eLength{0};
0174 G4CrossSectionType fXSType{fEmNoIntegral};
0175 G4bool fUseBaseParticleTable{false};
0176 G4String fName;
0177 };
0178
0179
0180
0181 #endif
0182