Back to home page

EIC code displayed by LXR

 
 

    


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

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:     G4BraggModel
0033 //
0034 // Author:        Vladimir Ivanchenko
0035 //
0036 // Creation date: 03.01.2002
0037 //
0038 // Modifications:
0039 // 23-12-02 V.Ivanchenko change interface in order to moveto cut per region
0040 // 24-01-03 Make models region aware (V.Ivanchenko)
0041 // 13-02-03 Add name (V.Ivanchenko)
0042 // 12-11-03 Fix for GenericIons (V.Ivanchenko)
0043 // 11-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
0044 // 15-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma)
0045 // 25-04-06 Added stopping data from PSTAR (V.Ivanchenko)
0046 // 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio, 
0047 //          CorrectionsAlongStep needed for ions(V.Ivanchenko)
0048 
0049 //
0050 // Class Description:
0051 //
0052 // Implementation of energy loss and delta-electron production
0053 // by heavy slow charged particles using ICRU'49 and NIST evaluated data 
0054 // for protons
0055 
0056 // -------------------------------------------------------------------
0057 //
0058 
0059 #ifndef G4BraggModel_h
0060 #define G4BraggModel_h 1
0061 
0062 #include "G4VEmModel.hh"
0063 #include "G4PSTARStopping.hh"
0064 
0065 class G4ParticleChangeForLoss;
0066 class G4EmCorrections;
0067 class G4ICRU90StoppingData;
0068 class G4PSTARStopping;
0069 
0070 class G4BraggModel : public G4VEmModel
0071 {
0072 
0073 public:
0074 
0075   explicit G4BraggModel(const G4ParticleDefinition* p = nullptr,
0076             const G4String& nam = "Bragg");
0077 
0078   ~G4BraggModel() override;
0079 
0080   void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0081 
0082   G4double MinEnergyCut(const G4ParticleDefinition*,
0083             const G4MaterialCutsCouple* couple) override;
0084 
0085   G4double ComputeCrossSectionPerElectron(
0086                  const G4ParticleDefinition*,
0087                  G4double kineticEnergy,
0088                  G4double cutEnergy,
0089                  G4double maxEnergy);
0090                  
0091   G4double ComputeCrossSectionPerAtom(
0092                  const G4ParticleDefinition*,
0093                  G4double kineticEnergy,
0094                  G4double Z, G4double A,
0095                  G4double cutEnergy,
0096                  G4double maxEnergy) override;
0097                                  
0098   G4double CrossSectionPerVolume(const G4Material*,
0099                  const G4ParticleDefinition*,
0100                  G4double kineticEnergy,
0101                  G4double cutEnergy,
0102                  G4double maxEnergy) override;
0103                  
0104   G4double ComputeDEDXPerVolume(const G4Material*,
0105                 const G4ParticleDefinition*,
0106                 G4double kineticEnergy,
0107                 G4double cutEnergy) override;
0108 
0109   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0110              const G4MaterialCutsCouple*,
0111              const G4DynamicParticle*,
0112              G4double tmin,
0113              G4double maxEnergy) override;
0114 
0115   // Compute ion charge 
0116   G4double GetChargeSquareRatio(const G4ParticleDefinition*,
0117                 const G4Material*,
0118                 G4double kineticEnergy) override;
0119 
0120   G4double GetParticleCharge(const G4ParticleDefinition* p,
0121                  const G4Material* mat,
0122                  G4double kineticEnergy) override;
0123 
0124   // hide assignment operator
0125   G4BraggModel & operator=(const  G4BraggModel &right) = delete;
0126   G4BraggModel(const  G4BraggModel&) = delete;
0127 
0128 protected:
0129 
0130   void SetParticle(const G4ParticleDefinition* p);
0131 
0132   G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
0133                   G4double kinEnergy) final;
0134 
0135   inline void SetChargeSquareRatio(G4double val);
0136 
0137 private:
0138 
0139   void HasMaterial(const G4Material* material);
0140 
0141   G4double StoppingPower(const G4Material* material,
0142              G4double kineticEnergy);
0143 
0144   G4double ElectronicStoppingPower(G4double z,
0145                                    G4double kineticEnergy) const;
0146 
0147   G4double DEDX(const G4Material* material, G4double kineticEnergy);
0148 
0149   G4bool MolecIsInZiegler1988(const G4Material* material);
0150 
0151   G4double ChemicalFactor(G4double kineticEnergy, G4double eloss125) const;
0152 
0153 protected:
0154 
0155   const G4ParticleDefinition* particle = nullptr;
0156   G4ParticleDefinition* theElectron = nullptr;
0157   G4ParticleChangeForLoss* fParticleChange = nullptr;
0158 
0159   const G4Material* currentMaterial = nullptr;
0160   const G4Material* baseMaterial = nullptr;
0161 
0162   G4EmCorrections* corr = nullptr;
0163 
0164   static G4ICRU90StoppingData* fICRU90;
0165   static G4PSTARStopping* fPSTAR;
0166 
0167   G4double mass = 0.0;
0168   G4double spin = 0.0;
0169   G4double chargeSquare = 1.0;
0170   G4double massRate = 1.0;
0171   G4double ratio = 1.0;
0172   G4double protonMassAMU = 1.007276;
0173   G4double lowestKinEnergy;
0174   G4double theZieglerFactor;
0175   G4double expStopPower125;  // Experimental Stopping power at 125keV
0176 
0177   G4int iMolecula = -1;   // index in the molecula's table
0178   G4int iPSTAR = -1;      // index in NIST PSTAR
0179   G4int iICRU90 = -1;
0180 
0181 private:
0182 
0183   G4bool isIon = false;
0184   G4bool isFirst = false;
0185 };
0186 
0187 inline void G4BraggModel::SetChargeSquareRatio(G4double val)
0188 {
0189   chargeSquare = val;
0190 }
0191 
0192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0193 
0194 #endif