Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // $Id: G4PenelopeRayleighModelMI.hh 75573 201 26 // $Id: G4PenelopeRayleighModelMI.hh 75573 2013-11-04 11:48:15Z gcosmo $ 27 // 27 // 28 // Author: Luciano Pandola and Gianfranco Pate 28 // Author: Luciano Pandola and Gianfranco Paternò 29 // 29 // 30 // ------------------------------------------- 30 // ------------------------------------------------------------------- 31 // History: 31 // History: 32 // 03 Dec 2009 L. Pandola 1st implementati 32 // 03 Dec 2009 L. Pandola 1st implementation 33 // 25 May 2011 L. Pandola Renamed (make v2 33 // 25 May 2011 L. Pandola Renamed (make v2008 as default Penelope) 34 // 27 Sep 2013 L. Pandola Migration to MT 34 // 27 Sep 2013 L. Pandola Migration to MT paradigm 35 // 20 Aug 2017 G. Paternò Molecular Inter 35 // 20 Aug 2017 G. Paternò Molecular Interference implementation 36 // 24 Mar 2019 G. Paternò Improved Molecu 36 // 24 Mar 2019 G. Paternò Improved Molecular Interference implementation 37 // 20 Jun 2020 G. Paternò Read qext separ 37 // 20 Jun 2020 G. Paternò Read qext separately and leave original atomic 38 // form factors 38 // form factors 39 // 27 Aug 2020 G. Paternò Further improve 39 // 27 Aug 2020 G. Paternò Further improvement of MI implementation 40 // 04 Mar 2021 L. Pandola Replace maps wit 40 // 04 Mar 2021 L. Pandola Replace maps with arrays 41 // 41 // 42 // ------------------------------------------- 42 // ------------------------------------------------------------------- 43 // Class description: 43 // Class description: 44 // Low Energy Electromagnetic Physics, Rayleig 44 // Low Energy Electromagnetic Physics, Rayleigh Scattering 45 // with the model from Penelope, version 2008 45 // with the model from Penelope, version 2008 46 // extended for Molecular Interference Effects 46 // extended for Molecular Interference Effects 47 // ------------------------------------------- 47 // ------------------------------------------------------------------- 48 // 48 // 49 //....oooOO0OOooo........oooOO0OOooo........oo 49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 50 50 51 #ifndef G4PenelopeRayleighModelMI_HH 51 #ifndef G4PenelopeRayleighModelMI_HH 52 #define G4PenelopeRayleighModelMI_HH 1 52 #define G4PenelopeRayleighModelMI_HH 1 53 53 54 #include "globals.hh" 54 #include "globals.hh" 55 #include "G4VEmModel.hh" 55 #include "G4VEmModel.hh" 56 #include "G4DataVector.hh" 56 #include "G4DataVector.hh" 57 #include "G4ParticleChangeForGamma.hh" 57 #include "G4ParticleChangeForGamma.hh" 58 58 59 #include "G4ExtendedMaterial.hh" 59 #include "G4ExtendedMaterial.hh" 60 #include "G4MIData.hh" 60 #include "G4MIData.hh" 61 61 62 //....oooOO0OOooo........oooOO0OOooo........oo 62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 63 63 64 class G4ParticleDefinition; 64 class G4ParticleDefinition; 65 class G4DynamicParticle; 65 class G4DynamicParticle; 66 class G4MaterialCutsCouple; 66 class G4MaterialCutsCouple; 67 class G4Material; 67 class G4Material; 68 class G4PhysicsFreeVector; 68 class G4PhysicsFreeVector; 69 class G4PenelopeSamplingData; 69 class G4PenelopeSamplingData; 70 70 71 class G4PenelopeRayleighModelMI : public G4VEm 71 class G4PenelopeRayleighModelMI : public G4VEmModel 72 { 72 { 73 73 74 public: 74 public: 75 explicit G4PenelopeRayleighModelMI(const G4P 75 explicit G4PenelopeRayleighModelMI(const G4ParticleDefinition* p = nullptr, 76 const G4String& processName = "Pe 76 const G4String& processName = "PenRayleighMI"); 77 77 78 virtual ~G4PenelopeRayleighModelMI(); 78 virtual ~G4PenelopeRayleighModelMI(); 79 79 80 void Initialise(const G4ParticleDefinition*, 80 void Initialise(const G4ParticleDefinition*, const G4DataVector&) override; 81 void InitialiseLocal(const G4ParticleDefinit 81 void InitialiseLocal(const G4ParticleDefinition*, 82 G4VEmModel *masterModel) override 82 G4VEmModel *masterModel) override; 83 83 84 G4double ComputeCrossSectionPerAtom(const G4 84 G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 85 G4double kinEnergy, 85 G4double kinEnergy, 86 G4double Z, 86 G4double Z, 87 G4double A = 0, 87 G4double A = 0, 88 G4double cut = 0, 88 G4double cut = 0, 89 G4double emax = DBL_MAX) overrid 89 G4double emax = DBL_MAX) override; 90 90 91 //Overriding of parent's (G4VEmModel) method 91 //Overriding of parent's (G4VEmModel) method 92 G4double CrossSectionPerVolume(const G4Mater 92 G4double CrossSectionPerVolume(const G4Material*, 93 const G4ParticleDefinition*, 93 const G4ParticleDefinition*, 94 G4double kineticEnergy, 94 G4double kineticEnergy, 95 G4double cutEnergy = 0., 95 G4double cutEnergy = 0., 96 G4double maxEnergy = DBL_MAX) overrid 96 G4double maxEnergy = DBL_MAX) override; 97 97 98 void SampleSecondaries(std::vector<G4Dynamic 98 void SampleSecondaries(std::vector<G4DynamicParticle*>*, 99 const G4MaterialCutsCouple*, 99 const G4MaterialCutsCouple*, 100 const G4DynamicParticle*, 100 const G4DynamicParticle*, 101 G4double tmin, 101 G4double tmin, 102 G4double maxEnergy) override; 102 G4double maxEnergy) override; 103 103 104 void SetVerbosityLevel(G4int lev) {fVerboseL 104 void SetVerbosityLevel(G4int lev) {fVerboseLevel = lev;}; 105 G4int GetVerbosityLevel() {return fVerboseLe 105 G4int GetVerbosityLevel() {return fVerboseLevel;}; 106 106 107 //Testing purposes 107 //Testing purposes 108 void DumpFormFactorTable(const G4Material*); 108 void DumpFormFactorTable(const G4Material*); 109 109 110 //Settings 110 //Settings 111 void SetMIActive(G4bool val){fIsMIActive = v 111 void SetMIActive(G4bool val){fIsMIActive = val;}; 112 G4bool IsMIActive(){return fIsMIActive;}; 112 G4bool IsMIActive(){return fIsMIActive;}; 113 113 114 G4PenelopeRayleighModelMI& operator=(const G 114 G4PenelopeRayleighModelMI& operator=(const G4PenelopeRayleighModelMI &right) = delete; 115 G4PenelopeRayleighModelMI(const G4PenelopeRa 115 G4PenelopeRayleighModelMI(const G4PenelopeRayleighModelMI&) = delete; 116 116 117 private: 117 private: 118 void SetParticle(const G4ParticleDefinition 118 void SetParticle(const G4ParticleDefinition*); 119 119 120 //Helper methods 120 //Helper methods 121 void ReadDataFile(G4int); 121 void ReadDataFile(G4int); 122 void ClearTables(); 122 void ClearTables(); 123 void BuildFormFactorTable(const G4Material*) 123 void BuildFormFactorTable(const G4Material*); 124 void GetPMaxTable(const G4Material*); 124 void GetPMaxTable(const G4Material*); 125 G4double GetFSquared(const G4Material*,const 125 G4double GetFSquared(const G4Material*,const G4double); 126 void InitializeSamplingAlgorithm(const G4Mat 126 void InitializeSamplingAlgorithm(const G4Material*); 127 void ReadMolInterferenceData(const G4String& 127 void ReadMolInterferenceData(const G4String&,const G4String& filename="NULL"); 128 G4MIData* GetMIData(const G4Material*); 128 G4MIData* GetMIData(const G4Material*); 129 void CalculateThetaAndAngFun(); 129 void CalculateThetaAndAngFun(); 130 G4double CalculateQSquared(G4double angle, G 130 G4double CalculateQSquared(G4double angle, G4double energy); 131 G4double IntegrateFun(G4double y[], G4int n, 131 G4double IntegrateFun(G4double y[], G4int n, G4double dTheta); 132 void LoadKnownMIFFMaterials(); 132 void LoadKnownMIFFMaterials(); 133 133 134 /// Data members 134 /// Data members 135 G4ParticleChangeForGamma* fParticleChange; 135 G4ParticleChangeForGamma* fParticleChange; 136 const G4ParticleDefinition* fParticle; 136 const G4ParticleDefinition* fParticle; 137 137 138 G4DataVector fLogQSquareGrid; //log(Q^2) gri 138 G4DataVector fLogQSquareGrid; //log(Q^2) grid for interpolation 139 std::map<const G4Material*,G4PhysicsFreeVect 139 std::map<const G4Material*,G4PhysicsFreeVector*> *fLogFormFactorTable; //log(Q^2) vs. log(F^2) 140 140 141 G4DataVector fLogEnergyGridPMax; //energy gr 141 G4DataVector fLogEnergyGridPMax; //energy grid for PMax (and originally for the x-section) 142 std::map<const G4Material*,G4PhysicsFreeVect 142 std::map<const G4Material*,G4PhysicsFreeVector*> *fPMaxTable; //E vs. Pmax 143 std::map<const G4Material*,G4PenelopeSamplin 143 std::map<const G4Material*,G4PenelopeSamplingData*> *fSamplingTable; 144 //Internal tables and manager methods 144 //Internal tables and manager methods 145 std::map<G4String,G4PhysicsFreeVector*> *fMo 145 std::map<G4String,G4PhysicsFreeVector*> *fMolInterferenceData; 146 G4PhysicsFreeVector* fAngularFunction; 146 G4PhysicsFreeVector* fAngularFunction; 147 std::map<G4String,G4String> *fKnownMaterials 147 std::map<G4String,G4String> *fKnownMaterials; 148 static const G4int fMaxZ =99; 148 static const G4int fMaxZ =99; 149 static G4PhysicsFreeVector* fLogAtomicCrossS 149 static G4PhysicsFreeVector* fLogAtomicCrossSection[fMaxZ+1]; 150 static G4PhysicsFreeVector* fAtomicFormFacto 150 static G4PhysicsFreeVector* fAtomicFormFactor[fMaxZ+1]; 151 151 152 //Intrinsic energy limits of the model: cann 152 //Intrinsic energy limits of the model: cannot be extended by the parent process 153 G4double fIntrinsicLowEnergyLimit; 153 G4double fIntrinsicLowEnergyLimit; 154 G4double fIntrinsicHighEnergyLimit; 154 G4double fIntrinsicHighEnergyLimit; 155 G4double fDTheta = {0.0001}; 155 G4double fDTheta = {0.0001}; 156 156 157 static const G4int fNtheta = 31415; 157 static const G4int fNtheta = 31415; 158 G4int fVerboseLevel; 158 G4int fVerboseLevel; 159 G4bool fIsInitialised; 159 G4bool fIsInitialised; 160 //Used only for G4EmCalculator and Unit Test 160 //Used only for G4EmCalculator and Unit Tests 161 G4bool fLocalTable; 161 G4bool fLocalTable; 162 G4bool fIsMIActive; 162 G4bool fIsMIActive; 163 }; 163 }; 164 164 165 //....oooOO0OOooo........oooOO0OOooo........oo 165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 166 166 167 #endif 167 #endif 168 168 169 169