Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-02 09:16:12

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 //
0027 
0028 #ifndef G4DNABornIonisationModel1_h
0029 #define G4DNABornIonisationModel1_h 1
0030 
0031 #include "G4VEmModel.hh"
0032 #include "G4ParticleChangeForGamma.hh"
0033 #include "G4ProductionCutsTable.hh"
0034 
0035 #include "G4DNACrossSectionDataSet.hh"
0036 #include "G4Electron.hh"
0037 #include "G4Proton.hh"
0038 #include "G4DNAGenericIonsManager.hh"
0039 
0040 #include "G4LogLogInterpolation.hh"
0041 
0042 #include "G4DNAWaterIonisationStructure.hh"
0043 #include "G4VAtomDeexcitation.hh"
0044 #include "G4NistManager.hh"
0045 
0046 class G4DNAChemistryManager;
0047 
0048 class G4DNABornIonisationModel1 : public G4VEmModel
0049 {
0050 
0051 public:
0052 
0053   G4DNABornIonisationModel1(const G4ParticleDefinition* p = nullptr,
0054                    const G4String& nam = "DNABornIonisationModel");
0055 
0056   ~G4DNABornIonisationModel1() override;
0057    
0058   G4DNABornIonisationModel1 & operator=(const  G4DNABornIonisationModel1 &right) = delete;
0059   G4DNABornIonisationModel1(const  G4DNABornIonisationModel1&) = delete;
0060 
0061   void Initialise(const G4ParticleDefinition*, const G4DataVector& = *(new G4DataVector())) override;
0062 
0063   G4double CrossSectionPerVolume(  const G4Material* material,
0064                        const G4ParticleDefinition* p,
0065                        G4double ekin,
0066                        G4double emin,
0067                        G4double emax) override;
0068 
0069   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0070                  const G4MaterialCutsCouple*,
0071                  const G4DynamicParticle*,
0072                  G4double tmin,
0073                  G4double maxEnergy) override;
0074 
0075   G4double GetPartialCrossSection(const G4Material*,
0076                                           G4int /*level*/,
0077                                           const G4ParticleDefinition*,
0078                                           G4double /*kineticEnergy*/) override;
0079   void StartTracking(G4Track*) override;
0080 
0081   G4double DifferentialCrossSection(G4ParticleDefinition * aParticleDefinition, G4double k, G4double energyTransfer, G4int shell);
0082 
0083   G4double TransferedEnergy(G4ParticleDefinition * aParticleDefinition,
0084                             G4double incomingParticleEnergy, G4int shell, G4double random);
0085 
0086   inline void SelectFasterComputation(G4bool input); 
0087 
0088   inline void SelectStationary(G4bool input); 
0089 
0090   inline void SelectSPScaling(G4bool input); 
0091 
0092 protected:
0093 
0094   G4ParticleChangeForGamma* fParticleChangeForGamma;
0095 
0096 private:
0097 
0098   G4bool fasterCode{false};
0099   G4bool statCode{false};
0100   G4bool spScaling{true};
0101 
0102   // Water density table
0103   const std::vector<G4double>* fpMolWaterDensity;
0104 
0105   // Deexcitation manager to produce fluo photons and e-
0106   G4VAtomDeexcitation* fAtomDeexcitation;
0107 
0108   const G4Track* fTrack{nullptr};
0109   G4DNAChemistryManager* fChemistry{nullptr};
0110   
0111 
0112   std::map<G4String,G4double,std::less<G4String> > lowEnergyLimit;
0113   std::map<G4String,G4double,std::less<G4String> > highEnergyLimit;
0114 
0115   G4bool isInitialised{false};
0116   G4int verboseLevel;
0117   
0118   // Cross section
0119   using MapFile = std::map<G4String, G4String, std::less<G4String>>;
0120   MapFile tableFile; // useful ?
0121 
0122   using MapData = std::map<G4String, G4DNACrossSectionDataSet *, std::less<G4String>>;
0123   MapData tableData;
0124   
0125   // Final state
0126   
0127   G4DNAWaterIonisationStructure waterStructure;
0128 
0129   G4double RandomizeEjectedElectronEnergy(G4ParticleDefinition * aParticleDefinition, G4double incomingParticleEnergy, G4int shell) ;
0130 
0131   G4double RandomizeEjectedElectronEnergyFromCumulatedDcs(G4ParticleDefinition * aParticleDefinition, G4double incomingParticleEnergy, G4int shell) ;
0132    
0133   G4double Interpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
0134    
0135   G4double QuadInterpolator( G4double e11, 
0136                  G4double e12, 
0137                  G4double e21, 
0138                  G4double e22, 
0139                  G4double x11,
0140                  G4double x12, 
0141                  G4double x21, 
0142                  G4double x22, 
0143                  G4double t1, 
0144                  G4double t2, 
0145                  G4double t, 
0146                  G4double e);
0147 
0148   using TriDimensionMap = std::map<G4double, std::map<G4double, G4double>>;
0149   
0150   TriDimensionMap eDiffCrossSectionData[6];
0151   TriDimensionMap eNrjTransfData[6]; // for cumulated dcs
0152   
0153   TriDimensionMap pDiffCrossSectionData[6];
0154   TriDimensionMap pNrjTransfData[6]; // for cumulated dcs
0155   
0156   std::vector<G4double> eTdummyVec;
0157   std::vector<G4double> pTdummyVec;
0158 
0159   using VecMap = std::map<G4double, std::vector<G4double>>;
0160   
0161   VecMap eVecm;
0162   VecMap pVecm;
0163   
0164   VecMap eProbaShellMap[6]; // for cumulated dcs
0165   VecMap pProbaShellMap[6]; // for cumulated dcs
0166   
0167   // Partial cross section  
0168   G4int RandomSelect(G4double energy,const G4String& particle );
0169 };
0170 
0171 inline void G4DNABornIonisationModel1::SelectFasterComputation (G4bool input)
0172 { 
0173   fasterCode = input;
0174 }        
0175 
0176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0177 
0178 inline void G4DNABornIonisationModel1::SelectStationary (G4bool input)
0179 { 
0180   statCode = input;
0181 }        
0182 
0183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0184 
0185 inline void G4DNABornIonisationModel1::SelectSPScaling (G4bool input)
0186 { 
0187   spScaling = input; 
0188 }        
0189 
0190 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0191 
0192 #endif