Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:05

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 //
0029 // GEANT4 Class header file
0030 //
0031 //
0032 // File name:     G4SeltzerBergerModel
0033 //
0034 // Author:        Andreas Schaelicke & Vladimir Ivantchenko
0035 //
0036 // Creation date: 04.10.2011
0037 //
0038 // Modifications:
0039 //
0040 // 24.07.2018 Introduced possibility to use sampling tables to sample the
0041 //            emitted photon energy (instead of using rejectio) from the 
0042 //            Seltzer-Berger scalled DCS for bremsstrahlung photon emission. 
0043 //            Using these sampling tables option gives faster(30-70%) final 
0044 //            state generation than the original rejection but takes some 
0045 //            extra memory (+ ~6MB in the case of the full CMS detector). 
0046 //            (M Novak)
0047 //
0048 // Class Description:
0049 //
0050 // Implementation of the bremssrahlung energy spectrum using
0051 // 1. S.M. Seltzer and M.J. Berger Nucl. Instr. Meth. B12 (1985) 95
0052 // 2. S.M. Seltzer and M.J. Berger Atomic data and Nuclear Data
0053 //    Tables 35 (1986) 345
0054 
0055 // -------------------------------------------------------------------
0056 //
0057 
0058 #ifndef G4SeltzerBergerModel_h
0059 #define G4SeltzerBergerModel_h 1
0060 
0061 #include "G4VEmModel.hh"
0062 #include "G4eBremsstrahlungRelModel.hh"
0063 #include "globals.hh"
0064 
0065 class G4Physics2DVector;
0066 class G4SBBremTable;
0067 class G4ParticleChangeForLoss;
0068 
0069 class G4SeltzerBergerModel : public G4VEmModel
0070 {
0071 
0072 public:
0073 
0074   explicit G4SeltzerBergerModel(const G4ParticleDefinition* p = nullptr,
0075                                 const G4String& nam = "eBremSB");
0076 
0077   ~G4SeltzerBergerModel() override;
0078 
0079   void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0080 
0081   void InitialiseLocal(const G4ParticleDefinition*,
0082                        G4VEmModel* masterModel) override;
0083 
0084   G4double ComputeDEDXPerVolume(const G4Material*,
0085                                 const G4ParticleDefinition*,
0086                                 G4double ekin,
0087                                 G4double cutEnergy) override;
0088 
0089   G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
0090                                       G4double ekin,
0091                                       G4double zet,
0092                                       G4double,
0093                                       G4double cutEnergy,
0094                                       G4double maxEnergy = DBL_MAX) override;
0095 
0096   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0097                          const G4MaterialCutsCouple*,
0098                          const G4DynamicParticle*,
0099              G4double cutEnergy,
0100                          G4double maxEnergy) override;
0101 
0102   void SetupForMaterial(const G4ParticleDefinition*,
0103                         const G4Material*, G4double) override;
0104 
0105   G4double MinPrimaryEnergy(const G4Material*,
0106                             const G4ParticleDefinition*,
0107                             G4double cutEnergy) override;
0108 
0109   inline void SetBicubicInterpolationFlag(G4bool val) 
0110   { fIsUseBicubicInterpolation = val; };
0111 
0112   // hide assignment operator and cctr
0113   G4SeltzerBergerModel & operator=(const G4SeltzerBergerModel &right) = delete;
0114   G4SeltzerBergerModel(const G4SeltzerBergerModel&) = delete;
0115 
0116 private:
0117 
0118   void SetParticle(const G4ParticleDefinition* p);
0119 
0120   void ReadData(G4int Z);
0121 
0122   G4double ComputeBremLoss(G4double cutEnergy);
0123 
0124   G4double ComputeXSectionPerAtom(G4double cutEnergy);
0125 
0126   G4double ComputeDXSectionPerAtom(G4double gammaEnergy);
0127 
0128   G4double SampleEnergyTransfer(const G4double kineticEnergy, 
0129                                 const G4double logKineticEnergy, 
0130                                 const G4double cut,
0131                                 const G4double emax);
0132 
0133 protected:
0134 
0135   G4ParticleChangeForLoss* fParticleChange{nullptr};
0136 
0137 private:
0138 
0139   static constexpr G4int gMaxZet{101};
0140   static constexpr G4double gExpNumLimit{-12.};
0141   static G4double gYLimitData[gMaxZet];
0142   static G4Physics2DVector* gSBDCSData[gMaxZet];
0143   static G4SBBremTable* gSBSamplingTable;
0144   static const G4double gBremFactor;
0145   static const G4double gMigdalConstant;
0146 
0147   G4bool fIsUseBicubicInterpolation{false};
0148   G4bool fIsUseSamplingTables{true};
0149   G4bool fIsElectron{true};
0150   G4bool fIsScatOffElectron{false};
0151   G4bool isInitializer{false};
0152   //
0153   G4int fCurrentIZ{0};
0154   G4int fNumWarnings{0};
0155 
0156   const G4ParticleDefinition* fPrimaryParticle{nullptr};
0157   G4ParticleDefinition* fGammaParticle;
0158 
0159   // cash
0160   G4double fPrimaryKinEnergy{0.};
0161   G4double fPrimaryTotalEnergy{0.};
0162   G4double fDensityFactor{0.};
0163   G4double fDensityCorr{0.};
0164   G4double fLowestKinEnergy;
0165 
0166   std::size_t fIndx{0};
0167   std::size_t fIndy{0};
0168 };
0169 
0170 #endif