Back to home page

EIC code displayed by LXR

 
 

    


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

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 // CPA100 elastic model class for electrons
0027 //
0028 // Based on the work of M. Terrissol and M. C. Bordage
0029 //
0030 // Users are requested to cite the following papers:
0031 // - M. Terrissol, A. Baudre, Radiat. Prot. Dosim. 31 (1990) 175-177
0032 // - M.C. Bordage, J. Bordes, S. Edel, M. Terrissol, X. Franceries,
0033 //   M. Bardies, N. Lampe, S. Incerti, Phys. Med. 32 (2016) 1833-1840
0034 //
0035 // Authors of this class:
0036 // M.C. Bordage, M. Terrissol, S. Edel, J. Bordes, S. Incerti
0037 //
0038 // 15.01.2014: creation
0039 // Based on the study by S. Zein et. al. Nucl. Inst. Meth. B 488 (2021) 70-82
0040 // 1/2/2023 : Hoang added modification
0041 
0042 #ifndef G4DNACPA100ElasticModel_h
0043 #define G4DNACPA100ElasticModel_h 1
0044 
0045 #include "G4DNACrossSectionDataSet.hh"
0046 #include "G4Electron.hh"
0047 #include "G4LogLogInterpolation.hh"
0048 #include "G4NistManager.hh"
0049 #include "G4ParticleChangeForGamma.hh"
0050 #include "G4ProductionCutsTable.hh"
0051 #include "G4VDNAModel.hh"
0052 
0053 #include <map>
0054 
0055 class G4DNACPA100ElasticModel : public G4VDNAModel
0056 {
0057     using TriDimensionMap =
0058       std::map<std::size_t, std::map<const G4ParticleDefinition*,
0059                                      std::map<G4double, std::map<G4double, G4double>>>>;
0060     using VecMap =
0061       std::map<std::size_t,
0062                std::map<const G4ParticleDefinition*, std::map<G4double, std::vector<G4double>>>>;
0063 
0064   public:
0065     explicit G4DNACPA100ElasticModel(const G4ParticleDefinition* p = nullptr,
0066                                      const G4String& nam = "DNACPA100ElasticModel");
0067 
0068     ~G4DNACPA100ElasticModel() override = default;
0069 
0070     void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0071 
0072     G4double CrossSectionPerVolume(const G4Material* material, const G4ParticleDefinition* p,
0073                                    G4double ekin, G4double emin, G4double emax) override;
0074 
0075     void SampleSecondaries(std::vector<G4DynamicParticle*>*, const G4MaterialCutsCouple*,
0076                            const G4DynamicParticle*, G4double tmin, G4double maxEnergy) override;
0077 
0078     inline void SelectStationary(G4bool input);
0079 
0080     G4DNACPA100ElasticModel& operator=(const G4DNACPA100ElasticModel& right) = delete;
0081 
0082     G4DNACPA100ElasticModel(const G4DNACPA100ElasticModel&) = delete;
0083 
0084     inline G4double GetElasticLevel(const std::size_t& l)
0085     {
0086       return fLevels[l];
0087     }
0088 
0089   private:
0090     G4ParticleChangeForGamma* fParticleChangeForGamma = nullptr;
0091     G4bool statCode = false;
0092     G4bool isInitialised = false;
0093     G4int verboseLevel = 0;
0094 
0095     G4double Theta(const G4ParticleDefinition* p, G4double k, G4double integrDiff,
0096                    const std::size_t& materialID);
0097 
0098     G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
0099 
0100     G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
0101 
0102     G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
0103 
0104     G4double QuadInterpolator(G4double e11, G4double e12, G4double e21, G4double e22, G4double x11,
0105                               G4double x12, G4double x21, G4double x22, G4double t1, G4double t2,
0106                               G4double t, G4double e);
0107 
0108     G4double fKillBelowEnergy = 0.;
0109     TriDimensionMap diffCrossSectionData;
0110     VecMap eValuesVect;
0111     std::map<std::size_t, std::map<const G4ParticleDefinition*, std::vector<G4double>>> tValuesVec;
0112 
0113     G4double RandomizeCosTheta(G4double k, const std::size_t& materialID);
0114 
0115     void ReadDiffCSFile(const std::size_t& id, const G4ParticleDefinition* p, const G4String& file,
0116                         const G4double&) override;
0117 
0118     const G4Material* fpGuanine = nullptr;
0119     const G4Material* fpG4_WATER = nullptr;
0120     const G4Material* fpDeoxyribose = nullptr;
0121     const G4Material* fpCytosine = nullptr;
0122     const G4Material* fpThymine = nullptr;
0123     const G4Material* fpAdenine = nullptr;
0124     const G4Material* fpPhosphate = nullptr;
0125     const G4ParticleDefinition* fpParticle = nullptr;
0126 
0127     G4DNACPA100ElasticModel* fpModelData = nullptr;
0128 
0129     std::map<std::size_t /*MatIndex*/, G4double> fLevels;
0130 };
0131 
0132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0133 
0134 inline void G4DNACPA100ElasticModel::SelectStationary(G4bool input)
0135 {
0136   statCode = input;
0137 }
0138 
0139 #endif