File indexing completed on 2025-01-18 09:58:38
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 G4LossTableBuilder_h
0049 #define G4LossTableBuilder_h 1
0050
0051 #include <vector>
0052 #include "globals.hh"
0053 #include "G4PhysicsTable.hh"
0054
0055 class G4VEmModel;
0056 class G4ParticleDefinition;
0057 class G4EmParameters;
0058
0059 class G4LossTableBuilder
0060 {
0061
0062 public:
0063
0064 G4LossTableBuilder(G4bool master=true);
0065
0066 ~G4LossTableBuilder();
0067
0068
0069 void BuildDEDXTable(G4PhysicsTable* dedxTable,
0070 const std::vector<G4PhysicsTable*>&);
0071
0072
0073 void BuildRangeTable(const G4PhysicsTable* dedxTable,
0074 G4PhysicsTable* rangeTable);
0075
0076
0077 void BuildInverseRangeTable(const G4PhysicsTable* rangeTable,
0078 G4PhysicsTable* invRangeTable);
0079
0080
0081 G4PhysicsTable* BuildTableForModel(G4PhysicsTable* table,
0082 G4VEmModel* model,
0083 const G4ParticleDefinition*,
0084 G4double emin, G4double emax,
0085 G4bool spline);
0086
0087
0088 void InitialiseBaseMaterials(const G4PhysicsTable* table=nullptr);
0089
0090
0091 const std::vector<G4int>* GetCoupleIndexes() const;
0092
0093 const std::vector<G4double>* GetDensityFactors() const;
0094
0095 G4bool GetFlag(size_t idx);
0096
0097 G4bool GetBaseMaterialFlag();
0098
0099 inline void SetSplineFlag(G4bool flag);
0100
0101 inline void SetInitialisationFlag(G4bool flag);
0102
0103 inline void SetBaseMaterialActive(G4bool flag);
0104
0105 G4LossTableBuilder & operator=(const G4LossTableBuilder &right) = delete;
0106 G4LossTableBuilder(const G4LossTableBuilder&) = delete;
0107
0108 private:
0109
0110 G4EmParameters* theParameters;
0111
0112 G4bool splineFlag = true;
0113 G4bool isInitialized = false;
0114 G4bool baseMatFlag = false;
0115 G4bool isBaseMatActive = true;
0116 G4bool isInitializer = false;
0117
0118 static std::vector<G4double>* theDensityFactor;
0119 static std::vector<G4int>* theDensityIdx;
0120 static std::vector<G4bool>* theFlag;
0121 };
0122
0123 inline void G4LossTableBuilder::SetSplineFlag(G4bool flag)
0124 {
0125 splineFlag = flag;
0126 }
0127
0128 inline void G4LossTableBuilder::SetInitialisationFlag(G4bool flag)
0129 {
0130 isInitialized = flag;
0131 }
0132
0133 inline void G4LossTableBuilder::SetBaseMaterialActive(G4bool flag)
0134 {
0135 isBaseMatActive = flag;
0136 if(!flag) {
0137 baseMatFlag = false;
0138 isInitialized = false;
0139 }
0140 }
0141
0142
0143
0144 #endif