Back to home page

EIC code displayed by LXR

 
 

    


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

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 // Authors: S. Meylan and C. Villagrasa (IRSN, France)
0027 // Models come from
0028 // M. Bug et al, Rad. Phys and Chem. 130, 459-479 (2017)
0029 //
0030 
0031 #ifndef G4DNAPTBIONISATIONMODEL_h
0032 #define G4DNAPTBIONISATIONMODEL_h 1
0033 
0034 #include "G4DNACrossSectionDataSet.hh"
0035 #include "G4DNAGenericIonsManager.hh"
0036 #include "G4DNAPTBAugerModel.hh"
0037 #include "G4DNAPTBIonisationStructure.hh"
0038 #include "G4Electron.hh"
0039 #include "G4LogLogInterpolation.hh"
0040 #include "G4NistManager.hh"
0041 #include "G4ParticleChangeForGamma.hh"
0042 #include "G4ProductionCutsTable.hh"
0043 #include "G4Proton.hh"
0044 #include "G4VDNAModel.hh"
0045 
0046 /*!
0047  * \brief The G4DNAPTBIonisationModel class
0048  * Implements the PTB ionisation model.
0049  */
0050 class G4DNAPTBIonisationModel : public G4VDNAModel
0051 {
0052  public:
0053   using TriDimensionMap =
0054     std::map<std::size_t, std::map<const G4ParticleDefinition*,
0055                        std::map<G4double, std::map<G4double, std::map<G4double, G4double>>>>>;
0056   using VecMap = std::map<std::size_t,
0057     std::map<const G4ParticleDefinition*, std::map<G4double, std::vector<G4double>>>>;
0058   using VecMapWithShell =
0059     std::map<std::size_t, std::map<const G4ParticleDefinition*,
0060                        std::map<G4double, std::map<G4double, std::vector<G4double>>>>>;
0061   /*!
0062    * \brief G4DNAPTBIonisationModel
0063    * Constructor
0064    * \param applyToMaterial
0065    * \param p
0066    * \param nam
0067    * \param isAuger
0068    */
0069   explicit G4DNAPTBIonisationModel(const G4String& applyToMaterial = "all",
0070     const G4ParticleDefinition* p = nullptr, const G4String& nam = "DNAPTBIonisationModel",
0071     const G4bool isAuger = true);
0072 
0073   /*!
0074    * \brief ~G4DNAPTBIonisationModel
0075    * Destructor
0076    */
0077   ~G4DNAPTBIonisationModel() override = default;
0078 
0079   // copy constructor and hide assignment operator
0080   G4DNAPTBIonisationModel(const G4DNAPTBIonisationModel&) = delete;  // prevent copy-construction
0081   G4DNAPTBIonisationModel& operator=(
0082     const G4DNAPTBIonisationModel& right) = delete;  // prevent assignement
0083 
0084 
0085   /*!
0086    * \brief Initialise
0087    * Method called once at the beginning of the simulation. It is used to setup the list of the
0088    * materials managed by the model and the energy limits. All the materials are setup but only a
0089    * part of them can be activated by the user through the constructor.
0090    */
0091   void Initialise(const G4ParticleDefinition* particle, const G4DataVector& data) override;
0092 
0093   /*!
0094    * \brief CrossSectionPerVolume
0095    * Mandatory for every model the CrossSectionPerVolume method is in charge of returning the
0096    * cross section value corresponding to the material, particle and energy current values.
0097    * \param material
0098    * \param materialName
0099    * \param p
0100    * \param ekin
0101    * \param emin
0102    * \param emax
0103    * \return the cross section value
0104    */
0105   G4double CrossSectionPerVolume(const G4Material* material, const G4ParticleDefinition* p,
0106     G4double ekin, G4double emin, G4double emax) override;
0107 
0108   /*!
0109    * \brief SampleSecondaries
0110    * If the model is selected for the ModelInterface then SampleSecondaries will be called.
0111    * The method sets the characteristics of the particles implied with the physical process after
0112    * the ModelInterface (energy, momentum...). This method is mandatory for every model. \param
0113    * materialName \param particleChangeForGamma \param tmin \param tmax
0114    */
0115   void SampleSecondaries(std::vector<G4DynamicParticle*>*, const G4MaterialCutsCouple*,
0116     const G4DynamicParticle*, G4double tmin, G4double tmax) override;
0117 
0118   G4ParticleChangeForGamma* fParticleChangeForGamma = nullptr;
0119 
0120  private:
0121   std::unique_ptr<G4DNAPTBAugerModel>
0122     fpDNAPTBAugerModel;  ///< PTB Auger model instanciated in the constructor and deleted in the
0123                          ///< destructor of the class
0124   G4int verboseLevel = 0;  ///< verbose level
0125   G4DNAPTBIonisationStructure
0126     ptbStructure; /*!< ptbStructure class which contains the shell binding energies */
0127   TriDimensionMap diffCrossSectionData;
0128   TriDimensionMap fEnergySecondaryData;
0129   std::map<std::size_t, std::map<const G4ParticleDefinition*, std::vector<G4double>>> fTMapWithVec;
0130   VecMap fEMapWithVector;
0131   VecMapWithShell fProbaShellMap;
0132 
0133   G4double RandomizeEjectedElectronEnergy(const G4ParticleDefinition* aP,
0134     G4double incomingParticleEnergy, G4int shell, const std::size_t& materialName);
0135   G4double DifferentialCrossSection(const G4ParticleDefinition* p, G4double k,
0136     G4double energyTransfer, G4int shell, const std::size_t& materialName);
0137 
0138   /*!
0139    * \brief RandomizeEjectedElectronEnergyFromCumulated
0140    * Uses the cumulated tables to find the energy of the ejected particle (electron)
0141    * \param particleDefinition
0142    * \param k
0143    * \param shell
0144    * \param materialName
0145    * \return the ejected electron energy
0146    */
0147   G4double RandomizeEjectedElectronEnergyFromCumulated(
0148     const G4ParticleDefinition*, G4double k, G4int shell, const std::size_t& materialID);
0149 
0150   /*!
0151    * \brief RandomizeEjectedElectronDirection
0152    * Method to calculate the ejected electron direction
0153    * \param aParticleDefinition
0154    * \param incomingParticleEnergy
0155    * \param outgoingParticleEnergy
0156    * \param cosTheta
0157    * \param phi
0158    */
0159   void RandomizeEjectedElectronDirection(const G4ParticleDefinition*,
0160     G4double incomingParticleEnergy, G4double outgoingParticleEnergy, G4double& cosTheta,
0161     G4double& phi);
0162   /*!
0163    * \brief ReadDiffCSFile
0164    * Method to read the differential cross section files.
0165    * \param materialName
0166    * \param particleName
0167    * \param file
0168    * \param scaleFactor
0169    */
0170   void ReadDiffCSFile(const std::size_t& materialName, const G4ParticleDefinition* p,
0171     const G4String& file, const G4double& scaleFactor) override;
0172 
0173   /*!
0174    * \brief QuadInterpolator
0175    * \param e11
0176    * \param e12
0177    * \param e21
0178    * \param e22
0179    * \param xs11
0180    * \param xs12
0181    * \param xs21
0182    * \param xs22
0183    * \param t1
0184    * \param t2
0185    * \param t
0186    * \param e
0187    * \return the interpolated value
0188    */
0189   G4double QuadInterpolator(G4double e11, G4double e12, G4double e21, G4double e22, G4double xs11,
0190     G4double xs12, G4double xs21, G4double xs22, G4double t1, G4double t2, G4double t, G4double e);
0191   /*!
0192    * \brief LogLogInterpolate
0193    * \param e1
0194    * \param e2
0195    * \param e
0196    * \param xs1
0197    * \param xs2
0198    * \return the interpolate value
0199    */
0200   G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
0201 
0202   G4Material* fpGuanine_PU = nullptr;
0203   G4Material* fpTHF = nullptr;
0204   G4Material* fpPY = nullptr;
0205   G4Material* fpPU = nullptr;
0206   G4Material* fpTMP = nullptr;
0207   G4Material* fpG4_WATER = nullptr;
0208   G4Material* fpBackbone_THF = nullptr;
0209   G4Material* fpCytosine_PY = nullptr;
0210   G4Material* fpThymine_PY = nullptr;
0211   G4Material* fpAdenine_PU = nullptr;
0212   G4Material* fpBackbone_TMP = nullptr;
0213   G4Material* fpN2 = nullptr;
0214   G4DNAPTBIonisationModel* fpModelData = nullptr;
0215 
0216 };
0217 
0218 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0219 
0220 #endif