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