Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-01 09:10:57

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 25.03.2025 V.Ivanchenko 
0027 // on base of the G4DNABornIonisationModel1 of S.Incerti & M.Karamitros
0028 //
0029 // Simulation of ionisation for electrons and protons
0030 //
0031 
0032 #ifndef G4DNABornIonisationModel_h
0033 #define G4DNABornIonisationModel_h 1
0034 
0035 #include "G4VEmModel.hh"
0036 #include "G4VSIntegration.hh"
0037 #include "G4ParticleChangeForGamma.hh"
0038 #include "G4DNAWaterIonisationStructure.hh"
0039 
0040 class G4DNAChemistryManager;
0041 class G4VAtomDeexcitation;
0042 class G4DNACrossSectionDataSet;
0043 class G4DNASamplingTable;
0044 
0045 class G4DNABornIonisationModel : public G4VEmModel, public G4VSIntegration
0046 {
0047 public:
0048 
0049   G4DNABornIonisationModel(const G4ParticleDefinition* p = nullptr,
0050                    const G4String& nam = "DNABornIonisationModel");
0051 
0052   ~G4DNABornIonisationModel() override;
0053    
0054   void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0055 
0056   G4double ProbabilityDensityFunction(G4double ekin) override;
0057 
0058   G4double CrossSectionPerVolume(const G4Material* material,
0059                  const G4ParticleDefinition* p,
0060                  G4double ekin,
0061                  G4double emin,
0062                  G4double emax) override;
0063 
0064   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0065              const G4MaterialCutsCouple*,
0066              const G4DynamicParticle*,
0067              G4double tmin, G4double maxEnergy) override;
0068 
0069   void StartTracking(G4Track*) override;
0070   
0071   void SelectFasterComputation(G4bool input) { fasterCode = input; }; 
0072 
0073   void SelectStationary(G4bool input) { statCode = input; }; 
0074 
0075   void SelectSPScaling(G4bool input) { spScaling = input; };
0076 
0077   G4DNABornIonisationModel & operator=(const  G4DNABornIonisationModel &right) = delete;
0078   G4DNABornIonisationModel(const  G4DNABornIonisationModel&) = delete;
0079 
0080 private:
0081 
0082   void LoadData();
0083 
0084   G4int SelectShell();
0085 
0086   G4double SampleCumulative();
0087 
0088   G4double SampleDifferential();
0089 
0090 protected:
0091 
0092   G4ParticleChangeForGamma* fParticleChangeForGamma;
0093 
0094 private:
0095 
0096   // Water density table
0097   static const std::vector<G4double>* fpWaterDensity;
0098 
0099   // data
0100   static G4DNACrossSectionDataSet* xsdata_e;
0101   static G4DNACrossSectionDataSet* xsdata_p;
0102   G4DNACrossSectionDataSet* xsdata{nullptr};
0103 
0104   // sampling data
0105   static G4DNASamplingTable* sampling_e;
0106   static G4DNASamplingTable* sampling_p;
0107   G4DNASamplingTable* sampling;
0108     
0109   const G4ParticleDefinition* fParticle{nullptr};
0110   const G4Track* fTrack{nullptr};
0111 
0112   G4DNAChemistryManager* fChemistry{nullptr};
0113 
0114   // Deexcitation manager to produce fluo photons and e-
0115   G4VAtomDeexcitation* fAtomDeexcitation;
0116 
0117   // limits of x-section table
0118   G4double fLowEnergy{0.0};
0119   G4double fHighEnergy{0.0};
0120   G4double fpLimitEnergy{0.0};
0121   G4double feLimitEnergy{0.0};
0122 
0123   // tracking cut
0124   G4double fAbsorptionEnergy{0.0};
0125 
0126   G4double fMass{0.0};
0127   G4double fPrimaryEnergy{0.0};
0128   G4double fMaxEnergy{0.0};
0129   G4double fTemp[5] = {0.0};
0130 
0131   G4int fSelectedShell{0};
0132   G4int verbose{0};
0133 
0134   G4bool isFirst{false};
0135   G4bool isInitialised{false};
0136   G4bool isElectron{false};
0137   G4bool fasterCode{false};
0138   G4bool statCode{false};
0139   G4bool spScaling{true};
0140 
0141   // Final state  
0142   G4DNAWaterIonisationStructure waterStructure;
0143 };
0144 
0145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0146 
0147 #endif