00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 #ifndef G4LossTableBuilder_h
00052 #define G4LossTableBuilder_h 1
00053
00054 #include <vector>
00055 #include "globals.hh"
00056 #include "G4PhysicsTable.hh"
00057
00058 class G4VEmModel;
00059 class G4ParticleDefinition;
00060
00061 class G4LossTableBuilder
00062 {
00063
00064 public:
00065
00066 G4LossTableBuilder();
00067
00068 virtual ~G4LossTableBuilder();
00069
00070
00071 void BuildDEDXTable(G4PhysicsTable* dedxTable,
00072 const std::vector<G4PhysicsTable*>&);
00073
00074
00075 void BuildRangeTable(const G4PhysicsTable* dedxTable,
00076 G4PhysicsTable* rangeTable,
00077 G4bool isIonisation = false);
00078
00079
00080 void BuildInverseRangeTable(const G4PhysicsTable* rangeTable,
00081 G4PhysicsTable* invRangeTable,
00082 G4bool isIonisation = false);
00083
00084
00085 G4PhysicsTable* BuildTableForModel(G4PhysicsTable* table,
00086 G4VEmModel* model,
00087 const G4ParticleDefinition*,
00088 G4double emin, G4double emax,
00089 G4bool spline);
00090
00091
00092 void InitialiseBaseMaterials(G4PhysicsTable* table);
00093
00094
00095
00096 inline const std::vector<G4int>* GetCoupleIndexes();
00097
00098 inline const std::vector<G4double>* GetDensityFactors();
00099
00100 inline G4bool GetFlag(size_t idx) const;
00101
00102 inline void SetSplineFlag(G4bool flag);
00103
00104 inline void SetInitialisationFlag(G4bool flag);
00105
00106 private:
00107
00108 void InitialiseCouples();
00109
00110 G4LossTableBuilder & operator=(const G4LossTableBuilder &right);
00111 G4LossTableBuilder(const G4LossTableBuilder&);
00112
00113 G4bool splineFlag;
00114 G4bool isInitialized;
00115
00116 std::vector<G4double>* theDensityFactor;
00117 std::vector<G4int>* theDensityIdx;
00118 std::vector<G4bool>* theFlag;
00119
00120 };
00121
00122 inline const std::vector<G4int>*
00123 G4LossTableBuilder::GetCoupleIndexes()
00124 {
00125 if(theDensityIdx->size() == 0) { InitialiseCouples(); }
00126 return theDensityIdx;
00127 }
00128
00129 inline const std::vector<G4double>*
00130 G4LossTableBuilder::GetDensityFactors()
00131 {
00132 if(theDensityIdx->size() == 0) { InitialiseCouples(); }
00133 return theDensityFactor;
00134 }
00135
00136 inline G4bool G4LossTableBuilder::GetFlag(size_t idx) const
00137 {
00138 return (*theFlag)[idx];
00139 }
00140
00141 inline void G4LossTableBuilder::SetSplineFlag(G4bool flag)
00142 {
00143 splineFlag = flag;
00144 }
00145
00146 inline void G4LossTableBuilder::SetInitialisationFlag(G4bool flag)
00147 {
00148 isInitialized = flag;
00149 }
00150
00151
00152
00153 #endif