Geant4 Cross Reference |
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 // Geant4 header G4EmTableUtil 28 // 29 // Author V.Ivanchenko 14.03.2022 30 // 31 // Utilities used at initialisation of EM physics 32 // 33 34 #ifndef G4EmTableUtil_h 35 #define G4EmTableUtil_h 1 36 37 #include "globals.hh" 38 #include "G4PhysicsTable.hh" 39 #include "G4VMultipleScattering.hh" 40 #include "G4VEmProcess.hh" 41 #include "G4VEnergyLossProcess.hh" 42 #include "G4EmModelManager.hh" 43 #include "G4LossTableBuilder.hh" 44 #include "G4ParticleDefinition.hh" 45 #include "G4MscStepLimitType.hh" 46 #include "G4DataVector.hh" 47 48 class G4EmTableUtil 49 { 50 public: 51 52 static const G4DataVector* 53 PrepareEmProcess(G4VEmProcess* proc, 54 const G4ParticleDefinition* part, 55 const G4ParticleDefinition* secPart, 56 G4EmModelManager* modelManager, 57 const G4double& maxKinEnergy, 58 G4int& secID, G4int& tripletID, 59 G4int& mainSec, const G4int& verb, 60 const G4bool& master); 61 62 static void BuildEmProcess(G4VEmProcess* proc, 63 const G4VEmProcess* masterProc, 64 const G4ParticleDefinition* firstPart, 65 const G4ParticleDefinition* part, 66 const G4int nModels, const G4int verb, 67 const G4bool master, const G4bool isLocked, 68 const G4bool toBuild, G4bool& baseMat); 69 70 static void BuildLambdaTable(G4VEmProcess* proc, 71 const G4ParticleDefinition* part, 72 G4EmModelManager* modelManager, 73 G4LossTableBuilder* bld, 74 G4PhysicsTable* theLambdaTable, 75 G4PhysicsTable* theLambdaTablePrim, 76 const G4double minKinEnergy, 77 const G4double minKinEnergyPrim, 78 const G4double maxKinEnergy, 79 const G4double scale, 80 const G4int verbose, 81 const G4bool startFromNull, 82 const G4bool splineFlag); 83 84 static void BuildLambdaTable(G4VEnergyLossProcess* proc, 85 const G4ParticleDefinition* part, 86 G4EmModelManager* modelManager, 87 G4LossTableBuilder* bld, 88 G4PhysicsTable* theLambdaTable, 89 const G4DataVector* theCuts, 90 const G4double minKinEnergy, 91 const G4double maxKinEnergy, 92 const G4double scale, 93 const G4int verbose, 94 const G4bool splineFlag); 95 96 static const G4ParticleDefinition* CheckIon( 97 G4VEnergyLossProcess* proc, 98 const G4ParticleDefinition* part, 99 const G4ParticleDefinition* particle, 100 const G4int verboseLevel, G4bool& isIon); 101 102 static void UpdateModels(G4VEnergyLossProcess* proc, 103 G4EmModelManager* modelManager, 104 const G4double maxKinEnergy, 105 const G4int nModels, 106 G4int& secID, G4int& biasID, 107 G4int& mainSecondaries, const G4bool baseMat, 108 const G4bool isMaster, const G4bool useAGen); 109 110 static void BuildLocalElossProcess(G4VEnergyLossProcess* proc, 111 const G4VEnergyLossProcess* masterProc, 112 const G4ParticleDefinition* part, 113 const G4int nModels); 114 115 static void BuildDEDXTable(G4VEnergyLossProcess* proc, 116 const G4ParticleDefinition* part, 117 G4EmModelManager* modelManager, 118 G4LossTableBuilder* bld, 119 G4PhysicsTable* table, 120 const G4double minKinEnergy, 121 const G4double maxKinEnergy, 122 const G4int nbins, 123 const G4int verbose, 124 const G4EmTableType tType, 125 const G4bool splineFlag); 126 127 static void PrepareMscProcess(G4VMultipleScattering* proc, 128 const G4ParticleDefinition& part, 129 G4EmModelManager* modelManager, 130 G4MscStepLimitType& stepLimit, 131 G4double& facrange, 132 G4bool& latDisplacement, G4bool& master, 133 G4bool& isIon, G4bool& baseMat); 134 135 static void BuildMscProcess(G4VMultipleScattering* proc, 136 const G4VMultipleScattering* masterProc, 137 const G4ParticleDefinition& part, 138 const G4ParticleDefinition* firstPart, 139 G4int nModels, G4bool master); 140 141 static G4bool StoreMscTable(G4VMultipleScattering* proc, 142 const G4ParticleDefinition* part, 143 const G4String& directory, 144 const G4int nModels, const G4int verb, 145 const G4bool ascii); 146 147 static G4bool StoreTable(G4VProcess*, const G4ParticleDefinition*, 148 G4PhysicsTable*, const G4String& dir, 149 const G4String& tname, G4int verb, 150 G4bool ascii); 151 152 static G4bool RetrieveTable(G4VProcess* ptr, 153 const G4ParticleDefinition* part, 154 G4PhysicsTable* aTable, 155 const G4String& dir, const G4String& tname, 156 const G4int verb, const G4bool ascii, 157 const G4bool spline); 158 159 }; 160 161 #endif 162 163 164