Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-14 09:11:50

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 // Created by Z. Francis, S. Incerti 2010 
0027 //
0028 // Modified for inverse rudd function sampling 26.10.2010
0029 // Rewitten by V.Ivanchenko 21.05.2023
0030 //
0031 
0032 #ifndef G4DNARuddIonisationExtendedModel_h
0033 #define G4DNARuddIonisationExtendedModel_h 1
0034 
0035 #include "G4VEmModel.hh"
0036 #include "G4ParticleChangeForGamma.hh"
0037 #include "G4ProductionCutsTable.hh"
0038 
0039 #include "G4EmCorrections.hh"
0040 #include "G4DNAGenericIonsManager.hh"
0041 #include "G4DNACrossSectionDataSet.hh"
0042 #include "G4Electron.hh"
0043 #include "G4Proton.hh"
0044 #include "G4LogLogInterpolation.hh"
0045 
0046 #include "G4DNAWaterIonisationStructure.hh"
0047 #include "G4VAtomDeexcitation.hh"
0048 #include "G4NistManager.hh"
0049 #include <vector>
0050 
0051 class G4DNARuddIonisationExtendedModel : public G4VEmModel
0052 {
0053 public:
0054 
0055   explicit G4DNARuddIonisationExtendedModel(const G4ParticleDefinition* p = nullptr,
0056                    const G4String& nam = "DNARuddIonisationExtendedModel");
0057 
0058   ~G4DNARuddIonisationExtendedModel() override;
0059 
0060   void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0061 
0062   G4double CrossSectionPerVolume(const G4Material* material,
0063                                  const G4ParticleDefinition* p,
0064                  G4double ekin,
0065                  G4double emin,
0066                  G4double emax) override;
0067 
0068   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0069              const G4MaterialCutsCouple*,
0070              const G4DynamicParticle*,
0071              G4double tmin,
0072              G4double maxEnergy) override;
0073 
0074   // method for unit tests
0075   G4double ComputeProbabilityFunction(const G4ParticleDefinition*, G4double kine,
0076                                       G4double deltae, G4int shell);
0077 
0078   G4DNARuddIonisationExtendedModel & operator=
0079   (const  G4DNARuddIonisationExtendedModel &right) = delete;
0080   G4DNARuddIonisationExtendedModel(const G4DNARuddIonisationExtendedModel&) = delete;
0081 
0082 private:
0083 
0084   void LoadData();
0085   
0086   void SetParticle(const G4ParticleDefinition*);
0087 
0088   G4int SelectShell(G4double energy);
0089 
0090   G4double MaxEnergy(G4double kine, G4int shell);
0091 
0092   G4double SampleElectronEnergy(G4double kine, G4int shell);
0093 
0094   G4double ProbabilityFunction(G4double kine, G4double deltae, G4int shell);
0095 
0096   G4double S_1s(G4double t,
0097         G4double energyTransferred,
0098         G4double slaterEffectiveChg,
0099         G4double shellNumber);
0100 
0101   G4double S_2s(G4double t,
0102         G4double energyTransferred,
0103         G4double slaterEffectiveChg,
0104         G4double shellNumber);
0105 
0106 
0107   G4double S_2p(G4double t,
0108         G4double energyTransferred,
0109         G4double slaterEffectiveChg,
0110         G4double shellNumber);
0111 
0112   G4double Rh(G4double t, 
0113           G4double energyTransferred,
0114           G4double slaterEffectiveChg,
0115           G4double shellNumber);
0116 
0117   G4double CorrectionFactor(G4double kine, G4int shell);
0118 
0119 protected:
0120 
0121   G4ParticleChangeForGamma* fParticleChangeForGamma{nullptr};
0122 
0123 private:
0124 
0125   // idx = 0 - hydrogen
0126   // idx = 1 - proton
0127   // idx = 2%26 - ions idx=Z
0128   // idx = -1 - alpha+
0129   // idx = -1 - helium
0130   static const G4int RUDDZMAX = 27;
0131   static G4DNACrossSectionDataSet* xsdata[RUDDZMAX];
0132   static G4DNACrossSectionDataSet* xsalphaplus;
0133   static G4DNACrossSectionDataSet* xshelium;
0134 
0135   // Water density table
0136   static const std::vector<G4double>* fpWaterDensity;
0137 
0138   G4DNACrossSectionDataSet* xscurrent{nullptr};
0139   const G4ParticleDefinition* fParticle{nullptr};
0140   G4EmCorrections* fEmCorrections;
0141   G4Pow* fGpow;
0142  
0143   //deexcitation manager to produce fluo photons and e-
0144   G4VAtomDeexcitation* fAtomDeexcitation{nullptr};
0145 
0146   // tracking cut and low-energy limit of proton x-section table
0147   G4double fLowestEnergy;
0148   // scaled low-energy limit of ion x-section table
0149   G4double fLimitEnergy;
0150 
0151   G4double fMass{0.0};
0152   G4double fMassRate{1.0};
0153   G4double fElow{0.0};
0154 
0155   G4double F1{0.0};
0156   G4double F2{0.0};
0157   G4double alphaConst{0.0};
0158   G4double bEnergy{0.0};
0159   G4double u{0.0};
0160   G4double v{0.0};
0161   G4double wc{0.0};
0162 
0163   G4double slaterEffectiveCharge[3] = {0.0};
0164   G4double sCoefficient[3] = {0.0};
0165   G4double fTemp[5] = {0.0};
0166 
0167   G4int idx{-1};
0168   G4int verbose{0};
0169 
0170   G4bool isInitialised{false};
0171   G4bool isIon{false};
0172   G4bool isFirst{false};
0173   G4bool isHelium{false};
0174   G4bool statCode{false};
0175   G4bool useDNAWaterStructure{true};
0176 
0177   // energy levels of water molecule  
0178   G4DNAWaterIonisationStructure waterStructure;
0179 };
0180 
0181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0182 
0183 #endif