Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:40

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 // G4MicroElecElasticModel.hh, 2011/08/29 A.Valentin, M. Raine
0028 //
0029 // Based on the following publications
0030 //      - Geant4 physics processes for microdosimetry simulation:
0031 //      very low energy electromagnetic models for electrons in Si,
0032 //       NIM B, vol. 288, pp. 66 - 73, 2012.
0033 //
0034 //
0035 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 
0036 
0037 #ifndef G4MicroElecElasticModel_h
0038 #define G4MicroElecElasticModel_h 1
0039 
0040 #include <map>
0041 #include <CLHEP/Units/SystemOfUnits.h>
0042 
0043 #include "G4MicroElecCrossSectionDataSet.hh"
0044 #include "G4VEmModel.hh"
0045 #include "G4Electron.hh"
0046 #include "G4ParticleChangeForGamma.hh"
0047 #include "G4LogLogInterpolation.hh"
0048 #include "G4ProductionCutsTable.hh"
0049 #include "G4NistManager.hh"
0050 
0051 class G4MicroElecElasticModel : public G4VEmModel
0052 {
0053 
0054 public:
0055   G4MicroElecElasticModel(const G4ParticleDefinition* p = nullptr, 
0056                   const G4String& nam = "MicroElecElasticModel");
0057   virtual ~G4MicroElecElasticModel();
0058 
0059   void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0060 
0061   G4double CrossSectionPerVolume(const G4Material* material,
0062                  const G4ParticleDefinition* p,
0063                  G4double ekin,
0064                  G4double emin,
0065                  G4double emax) override;
0066   
0067   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0068                  const G4MaterialCutsCouple*,
0069                  const G4DynamicParticle*,
0070                  G4double tmin,
0071                  G4double maxEnergy) override;
0072 
0073   inline void SetKillBelowThreshold (G4double threshold);        
0074   G4double GetKillBelowThreshold () { return killBelowEnergy; } 
0075 
0076   G4MicroElecElasticModel & operator=(const  G4MicroElecElasticModel &right) = delete;
0077   G4MicroElecElasticModel(const  G4MicroElecElasticModel&) = delete;
0078 
0079 protected:
0080   G4ParticleChangeForGamma* fParticleChangeForGamma;
0081 
0082 private:
0083   // Final state
0084   G4double Theta(G4ParticleDefinition * aParticleDefinition, G4double k, G4double integrDiff);
0085   G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
0086   G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);   
0087   G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);   
0088   G4double QuadInterpolator(G4double e11, 
0089                     G4double e12, 
0090                 G4double e21, 
0091                 G4double e22, 
0092                 G4double x11,
0093                 G4double x12, 
0094                 G4double x21, 
0095                 G4double x22, 
0096                 G4double t1, 
0097                 G4double t2, 
0098                 G4double t, 
0099                 G4double e);
0100   G4double RandomizeCosTheta(G4double k);
0101 
0102   // Cross section 
0103   typedef std::map<G4String,G4String,std::less<G4String> > MapFile;
0104   MapFile tableFile;
0105 
0106   typedef std::map<G4String,G4MicroElecCrossSectionDataSet*,std::less<G4String> > MapData;
0107   MapData tableData;
0108   
0109   typedef std::map<G4double, std::map<G4double, G4double> > TriDimensionMap;
0110   TriDimensionMap eDiffCrossSectionData;
0111   std::vector<G4double> eTdummyVec;
0112 
0113   typedef std::map<G4double, std::vector<G4double> > VecMap;
0114   VecMap eVecm;
0115 
0116   G4Material* nistSi;
0117   G4double killBelowEnergy;  
0118   G4double lowEnergyLimit;  
0119   G4double lowEnergyLimitOfModel;  
0120   G4double highEnergyLimit; 
0121   G4int verboseLevel;
0122   G4bool isInitialised;    
0123 };
0124 
0125 inline void G4MicroElecElasticModel::SetKillBelowThreshold (G4double threshold) 
0126 { 
0127     killBelowEnergy = threshold; 
0128     
0129     if (threshold < 5*CLHEP::eV)
0130     {
0131        G4Exception ("*** WARNING : the G4MicroElecElasticModel class is not validated below 5 eV !","",JustWarning,"") ;
0132        threshold = 5*CLHEP::eV;
0133     }
0134              
0135 }        
0136 
0137 
0138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0139 
0140 #endif