Back to home page

EIC code displayed by LXR

 
 

    


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

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 // GEANT4 Class header file
0029 //
0030 //
0031 // File name:     G4LindhardSorensenIonModel
0032 //
0033 // Author:        Alexander Bagulya & Vladimir Ivanchenko
0034 //
0035 // Creation date: 16.04.2018
0036 //
0037 //
0038 // Class Description:
0039 //
0040 // Implementation of ion ionisation energy loss and delta-electron 
0041 // production by heavy charged particles according to
0042 // J. Lindhard & A.H. Sorensen, Phys. Rev. A 53 (1996) 2443-2455
0043 
0044 // -------------------------------------------------------------------
0045 //
0046 
0047 #ifndef G4LindhardSorensenIonModel_h
0048 #define G4LindhardSorensenIonModel_h 1
0049 
0050 #include <vector>
0051 
0052 #include "G4VEmModel.hh"
0053 #include "G4NistManager.hh"
0054 
0055 class G4EmCorrections;
0056 class G4ParticleChangeForLoss;
0057 class G4LindhardSorensenData;
0058 class G4BraggModel;
0059 class G4BetheBlochModel;
0060 class G4IonICRU73Data;
0061 
0062 class G4LindhardSorensenIonModel : public G4VEmModel
0063 {
0064 public:
0065 
0066   explicit G4LindhardSorensenIonModel(const G4ParticleDefinition* p = nullptr,
0067                       const G4String& nam = "LindhardSorensen");
0068 
0069   ~G4LindhardSorensenIonModel() override;
0070 
0071   void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0072 
0073   G4double MinEnergyCut(const G4ParticleDefinition*,
0074                         const G4MaterialCutsCouple* couple) override;
0075 
0076   G4double ComputeCrossSectionPerElectron(
0077                          const G4ParticleDefinition*,
0078                  G4double kineticEnergy,
0079                  G4double cutEnergy,
0080                  G4double maxEnergy);
0081                  
0082   G4double ComputeCrossSectionPerAtom(
0083                  const G4ParticleDefinition*,
0084                  G4double kineticEnergy,
0085                  G4double Z, G4double A,
0086                  G4double cutEnergy,
0087                  G4double maxEnergy) override;
0088                                  
0089   G4double CrossSectionPerVolume(const G4Material*,
0090                  const G4ParticleDefinition*,
0091                  G4double kineticEnergy,
0092                  G4double cutEnergy,
0093                  G4double maxEnergy) override;
0094                      
0095   G4double ComputeDEDXPerVolume(const G4Material*,
0096                                 const G4ParticleDefinition*,
0097                                 G4double kineticEnergy,
0098                                 G4double cutEnergy) override;
0099 
0100   G4double GetChargeSquareRatio(const G4ParticleDefinition* p,
0101                                 const G4Material* mat,
0102                                 G4double kineticEnergy) override;
0103 
0104   G4double GetParticleCharge(const G4ParticleDefinition* p,
0105                  const G4Material* mat,
0106                              G4double kineticEnergy) override;
0107 
0108   void CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
0109                             const G4DynamicParticle* dp,
0110                             const G4double& length,
0111                             G4double& eloss) override;
0112 
0113   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0114                          const G4MaterialCutsCouple*,
0115                  const G4DynamicParticle*,
0116              G4double tmin,
0117                      G4double maxEnergy) override;
0118 
0119   // hide assignment operator
0120   G4LindhardSorensenIonModel & operator=
0121   (const  G4LindhardSorensenIonModel &right) = delete;
0122   G4LindhardSorensenIonModel(const  G4LindhardSorensenIonModel&) = delete;
0123 
0124 protected:
0125 
0126   G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
0127                               G4double kinEnergy) override;
0128 
0129   inline void SetChargeSquareRatio(G4double val);
0130 
0131 private:
0132 
0133   void SetupParameters();
0134 
0135   void InitialiseLS();
0136 
0137   G4double ComputeDEDXPerVolumeLS(const G4Material*,
0138                                   const G4ParticleDefinition*,
0139                   G4double kinEnergy, G4double cutEnergy);
0140 
0141   inline void SetParticle(const G4ParticleDefinition* p);
0142 
0143   //  static const G4int MAXZION = 93;
0144 
0145   static G4IonICRU73Data* fIonData;
0146   static G4LindhardSorensenData* lsdata;
0147 
0148   const G4ParticleDefinition* particle = nullptr;
0149   G4ParticleDefinition* theElectron;
0150   G4EmCorrections* corr;
0151   G4ParticleChangeForLoss* fParticleChange = nullptr;
0152   G4NistManager* nist;
0153   G4BraggModel* fBraggModel;
0154   G4BetheBlochModel* fBBModel;
0155 
0156   G4int Zin = 1;
0157   G4double mass = 0.0;
0158   G4double tlimit = DBL_MAX;
0159   G4double spin = 0.0;
0160   G4double magMoment2 = 0.0;
0161   G4double chargeSquare = 1.0;
0162   G4double charge = 1.0;
0163   G4double eRatio = 0.0;
0164   G4double pRatio = 1.0;
0165   G4double formfact = 0.0;
0166   G4double twoln10;
0167   G4double fElimit;
0168   G4bool isFirst = false;
0169 };
0170 
0171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0172 
0173 inline void 
0174 G4LindhardSorensenIonModel::SetParticle(const G4ParticleDefinition* p)
0175 {
0176   if(particle != p) {
0177     particle = p;
0178     SetupParameters();
0179   }
0180 }
0181 
0182 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0183 
0184 inline void G4LindhardSorensenIonModel::SetChargeSquareRatio(G4double val)
0185 {
0186   chargeSquare = val;
0187 }
0188 
0189 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0190 
0191 #endif