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 // Reference:
0027 //    A.D. Dominguez-Munoz, M.I. Gallardo, M.C. Bordage,
0028 //    Z. Francis, S. Incerti, M.A. Cortes-Giraldo,
0029 //    Radiat. Phys. Chem. 199 (2022) 110363.
0030 //
0031 // Class authors:
0032 //    A.D. Dominguez-Munoz
0033 //    M.A. Cortes-Giraldo (miancortes -at- us.es)
0034 //
0035 // Class creation: 2022-03-03
0036 //
0037 //
0038 
0039 #ifndef G4DNARPWBAIonisationModel_h
0040 #define G4DNARPWBAIonisationModel_h 1
0041 #include "G4VEmModel.hh"
0042 #include "G4ParticleChangeForGamma.hh"
0043 #include "G4ProductionCutsTable.hh"
0044 #include "G4DNACrossSectionDataSet.hh"
0045 #include "G4Electron.hh"
0046 #include "G4Proton.hh"
0047 #include "G4DNAGenericIonsManager.hh"
0048 #include "G4LogLogInterpolation.hh"
0049 #include "G4DNAWaterIonisationStructure.hh"
0050 #include "G4VAtomDeexcitation.hh"
0051 #include "G4NistManager.hh"
0052 
0053 class G4DNARPWBAIonisationModel : public G4VEmModel
0054 {
0055  public:
0056   G4DNARPWBAIonisationModel(const G4ParticleDefinition* p = nullptr,
0057                             const G4String& nam = "DNARPWBAIonisationModel");
0058   ~G4DNARPWBAIonisationModel() override;
0059   G4DNARPWBAIonisationModel& operator=(const G4DNARPWBAIonisationModel& right) =
0060     delete;
0061   G4DNARPWBAIonisationModel(const G4DNARPWBAIonisationModel&) = delete;
0062   void Initialise(const G4ParticleDefinition*,
0063                   const G4DataVector& = *(new G4DataVector())) override;
0064 
0065   G4double CrossSectionPerVolume(const G4Material* material,
0066                                  const G4ParticleDefinition* p, G4double ekin,
0067                                  G4double emin, G4double emax) override;
0068   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0069                          const G4MaterialCutsCouple*, const G4DynamicParticle*,
0070                          G4double tmin, G4double maxEnergy) override;
0071   G4double GetPartialCrossSection(const G4Material*, G4int /*level*/,
0072                                   const G4ParticleDefinition*,
0073                                   G4double /*kineticEnergy*/) override;
0074   G4double DifferentialCrossSection(const G4double& k, const G4double& energyTransfer,
0075                                     const G4int& shell);
0076   G4double TransferedEnergy(G4double incomingParticleEnergy, G4int shell,
0077                             const G4double& random);
0078   inline void SelectFasterComputation(const G4bool& input);
0079   inline void SelectStationary(const G4bool& input);
0080   inline void SelectSPScaling(const G4bool& input);
0081 
0082  protected:
0083   G4ParticleChangeForGamma* fParticleChangeForGamma = nullptr;
0084 
0085  private:
0086   using MapData = std::map<G4String, std::unique_ptr<G4DNACrossSectionDataSet>,
0087                            std::less<G4String>>;
0088   using TriDimensionMap = std::map<G4double, std::map<G4double, G4double>>;
0089   using VecMap          = std::map<G4double, std::vector<G4double>>;
0090   // methods
0091   G4double RandomizeEjectedElectronEnergy(const G4double&, const G4int& );
0092   G4double RandomizeEjectedElectronEnergyFromCumulatedDcs(const G4double& incomingParticleEnergy,
0093     const G4int& shell);
0094   G4double Interpolate(const G4double& e1, const G4double& e2, const G4double& e, const G4double& xs1,
0095                        const G4double& xs2);
0096   G4double QuadInterpolator(const G4double& e11, const G4double& e12, const G4double& e21,
0097                             const G4double& e22, const G4double& x11, const G4double& x12,
0098                             const G4double& x21, const G4double& x22, const G4double& t1,
0099                             const G4double& t2, const G4double& t, const G4double& e);
0100   //shoud change to array ?
0101   G4int RandomSelect(G4double energy);
0102   void InitialiseForProton(const G4ParticleDefinition*);
0103   G4bool InEnergyLimit(const G4double&);
0104 
0105   //members
0106   G4bool fasterCode = false;
0107   G4bool statCode   = false;
0108   G4bool spScaling  = true;
0109   // Water density table
0110   const std::vector<G4double>* fpMolWaterDensity = nullptr;
0111   // Deexcitation manager to produce fluo photons and e-
0112   G4VAtomDeexcitation* fAtomDeexcitation = nullptr;
0113   G4double lowEnergyLimit = 0;
0114   G4double highEnergyLimit = 0;
0115   G4bool isInitialised = false;
0116   G4int verboseLevel   = 0;
0117   // Cross section
0118 
0119   std::unique_ptr<G4DNACrossSectionDataSet> fpTotalCrossSection;
0120   // Final state
0121   G4DNAWaterIonisationStructure waterStructure;
0122   TriDimensionMap eDiffCrossSectionData[6];
0123   TriDimensionMap eNrjTransfData[6];  // for cumulated dcs
0124   TriDimensionMap pDiffCrossSectionData[6];
0125   TriDimensionMap pNrjTransfData[6];  // for cumulated dcs
0126   std::vector<G4double> eTdummyVec;
0127   std::vector<G4double> pTdummyVec;
0128   VecMap eVecm;
0129   VecMap pVecm;
0130   VecMap eProbaShellMap[6];  // for cumulated dcs
0131   VecMap pProbaShellMap[6];  // for cumulated dcs
0132   const G4ParticleDefinition* fProtonDef = G4Proton::ProtonDefinition();
0133 };
0134 
0135 inline void G4DNARPWBAIonisationModel::SelectFasterComputation(
0136   const G4bool& input)
0137 {
0138   fasterCode = input;
0139 }
0140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0141 
0142 inline void G4DNARPWBAIonisationModel::SelectStationary(const G4bool& input)
0143 {
0144   statCode = input;
0145 }
0146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0147 
0148 inline void G4DNARPWBAIonisationModel::SelectSPScaling(const G4bool& input)
0149 {
0150   spScaling = input;
0151 }
0152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0153 
0154 #endif