Back to home page

EIC code displayed by LXR

 
 

    


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

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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0029 
0030 // Created by Z. Francis
0031 
0032 #ifndef G4DNASancheExcitationModel_h
0033 #define G4DNASancheExcitationModel_h 1
0034 
0035 #include <deque>
0036 #include <CLHEP/Units/SystemOfUnits.h>
0037 
0038 #include "G4VEmModel.hh"
0039 #include "G4ParticleChangeForGamma.hh"
0040 #include "G4Electron.hh"
0041 #include "G4NistManager.hh"
0042 
0043 class G4DNASancheExcitationModel : public G4VEmModel
0044 {
0045 public:
0046   G4DNASancheExcitationModel(const G4ParticleDefinition* p = nullptr,
0047                              const G4String& nam = "DNASancheExcitationModel");
0048 
0049   ~G4DNASancheExcitationModel() override;
0050 
0051   G4DNASancheExcitationModel & operator=(const G4DNASancheExcitationModel &right) = delete;
0052   G4DNASancheExcitationModel(const G4DNASancheExcitationModel&) = delete;
0053 
0054   void Initialise(const G4ParticleDefinition*,
0055                           const G4DataVector&) override;
0056 
0057   G4double CrossSectionPerVolume(const G4Material* material,
0058                                          const G4ParticleDefinition* p,
0059                                          G4double ekin,
0060                                          G4double emin,
0061                                          G4double emax) override;
0062 
0063   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0064                                  const G4MaterialCutsCouple*,
0065                                  const G4DynamicParticle*,
0066                                  G4double tmin,
0067                                  G4double maxEnergy) override;
0068 
0069   // Cross section
0070 
0071   G4double PartialCrossSection(G4double energy, G4int level);
0072   G4double TotalCrossSection(G4double t);
0073 
0074   inline void ExtendLowEnergyLimit(G4double /*threshold*/);
0075 
0076   inline void SetVerboseLevel(G4int verbose)
0077   {
0078     verboseLevel = verbose;
0079   }
0080 
0081   inline void SelectStationary(G4bool input); 
0082 
0083 protected:
0084 
0085   G4ParticleChangeForGamma* fParticleChangeForGamma;
0086 
0087 private:
0088 
0089   G4bool statCode;
0090 
0091   // Water density table
0092   const std::vector<G4double>* fpWaterDensity;
0093 
0094   G4bool isInitialised{false};
0095   G4int verboseLevel;
0096 
0097   // Cross section
0098 
0099   G4int RandomSelect(G4double energy);
0100   G4int nLevels;
0101   G4double VibrationEnergy(G4int level);
0102   G4double Sum(G4double k);
0103   G4double LinInterpolate(G4double e1,
0104                           G4double e2,
0105                           G4double e,
0106                           G4double xs1,
0107                           G4double xs2);
0108 
0109   //
0110 //  typedef std::map<double, std::map<double, double> > TriDimensionMap;
0111 //  TriDimensionMap map1;
0112   std::vector<G4double> tdummyVec;
0113   std::vector<std::vector<G4double>> fEnergyLevelXS;
0114   std::vector<G4double> fEnergyTotalXS;
0115 
0116 };
0117 
0118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0119 
0120 inline void G4DNASancheExcitationModel::ExtendLowEnergyLimit(G4double threshold)
0121 {
0122   if(threshold < 2 * CLHEP::eV)
0123     G4Exception("*** WARNING : the G4DNASancheExcitationModel class is not "
0124                 "validated below 2 eV !",
0125                 "", JustWarning, "");
0126   
0127   SetLowEnergyLimit(threshold);
0128 }
0129 
0130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0131 
0132 inline void G4DNASancheExcitationModel::SelectStationary (G4bool input)
0133 { 
0134     statCode = input; 
0135 }        
0136 
0137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0138 
0139 #endif