Back to home page

EIC code displayed by LXR

 
 

    


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

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 G4DNADingfelderChargeIncreaseModel_h
0029 #define G4DNADingfelderChargeIncreaseModel_h 1
0030 
0031 #include "G4VEmModel.hh"
0032 #include "G4ParticleChangeForGamma.hh"
0033 #include "G4ProductionCutsTable.hh"
0034 #include "G4Electron.hh"
0035 #include "G4Proton.hh"
0036 #include "G4DNAGenericIonsManager.hh"
0037 #include "G4NistManager.hh"
0038 
0039 class G4DNADingfelderChargeIncreaseModel : public G4VEmModel
0040 {
0041 public:
0042 
0043   explicit G4DNADingfelderChargeIncreaseModel(const G4ParticleDefinition* p = nullptr,
0044                   const G4String& nam = "DNADingfelderChargeIncreaseModel");
0045   ~G4DNADingfelderChargeIncreaseModel() override = default;
0046 
0047   G4DNADingfelderChargeIncreaseModel & operator=(const  G4DNADingfelderChargeIncreaseModel &right)= delete;
0048   G4DNADingfelderChargeIncreaseModel(const  G4DNADingfelderChargeIncreaseModel&) = delete;
0049  
0050   void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0051   G4double CrossSectionPerVolume(const G4Material* material,
0052                        const G4ParticleDefinition* p,
0053                        G4double ekin,
0054                        G4double emin,
0055                        G4double emax) override;
0056   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0057                  const G4MaterialCutsCouple*,
0058                  const G4DynamicParticle*,
0059                  G4double tmin,
0060                  G4double maxEnergy) override;
0061   inline void SelectStationary(G4bool input);
0062 protected:
0063   G4ParticleChangeForGamma* fParticleChangeForGamma = nullptr;
0064 private:
0065   // Water density table
0066   const std::vector<G4double>* fpMolWaterDensity = nullptr;
0067 
0068   std::map<G4String,G4double,std::less<G4String> > lowEnergyLimit;
0069   std::map<G4String,G4double,std::less<G4String> > highEnergyLimit;
0070 
0071   G4bool isInitialised = false, statCode = false;
0072   // Verbosity scale:
0073   // 0 = nothing
0074   // 1 = warning for energy non-conservation
0075   // 2 = details of energy budget
0076   // 3 = calculation of cross sections, file openings, sampling of atoms
0077   // 4 = entering in methods
0078   G4int verboseLevel = 0;
0079   
0080   // Partial cross section
0081 
0082   G4double PartialCrossSection(const G4double& energy, const G4int& level, const G4ParticleDefinition* particle);
0083 
0084   G4double Sum(const G4double& energy, const G4ParticleDefinition* particle);
0085 
0086   G4int RandomSelect(const G4double& energy, const G4ParticleDefinition* particle);
0087   
0088   G4int numberOfPartialCrossSections[2] = {0}; // 2 is the particle type index
0089   G4double f0[2][2] = {{0, 0},{0, 0}};
0090   G4double a0[2][2] = {{0, 0},{0, 0}};
0091   G4double a1[2][2] = {{0, 0},{0, 0}};
0092   G4double b0[2][2] = {{0, 0},{0, 0}};
0093   G4double b1[2][2] = {{0, 0},{0, 0}};
0094   G4double c0[2][2] = {{0, 0},{0, 0}};
0095   G4double d0[2][2] = {{0, 0},{0, 0}};
0096   G4double x0[2][2] = {{0, 0},{0, 0}};
0097   G4double x1[2][2] = {{0, 0},{0, 0}};
0098 
0099   // Final state
0100   G4int NumberOfFinalStates(G4ParticleDefinition* particleDefinition, G4int finalStateIndex);
0101   G4ParticleDefinition* OutgoingParticleDefinition(G4ParticleDefinition* particleDefinition, G4int finalStateIndex);
0102   G4double IncomingParticleBindingEnergyConstant(G4ParticleDefinition* particleDefinition, G4int finalStateIndex);
0103   // Reusable particle definitions
0104   G4ParticleDefinition* hydrogenDef = nullptr;
0105   G4ParticleDefinition* alphaPlusPlusDef = nullptr;
0106   G4ParticleDefinition* alphaPlusDef = nullptr;
0107   G4ParticleDefinition* heliumDef = nullptr;
0108   
0109 };
0110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0111 
0112 inline void G4DNADingfelderChargeIncreaseModel::SelectStationary (G4bool input)
0113 { 
0114   statCode = input;
0115 }        
0116 
0117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0118 
0119 #endif
0120