Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-02 08:28:30

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:     G4DynamicParticleIonisation
0033 //
0034 // Author:        Vladimir Ivanchenko
0035 //
0036 // Creation date: 23.08.2024
0037 //
0038 //
0039 // Class Description:
0040 //
0041 // This class manages the ionisation process for any heavy charged
0042 // particle on-the-fly, using only G4DynamicParticle data, whereas the
0043 // G4ParticleDefinition object is not used.
0044 //
0045 // -------------------------------------------------------------------
0046 //
0047 
0048 #ifndef G4DynamicParticleIonisation_h
0049 #define G4DynamicParticleIonisation_h 1
0050 
0051 #include "G4VContinuousDiscreteProcess.hh"
0052 #include "G4ParticleChangeForLoss.hh"
0053 #include "G4EmSecondaryParticleType.hh"
0054 #include "globals.hh"
0055 #include <vector>
0056 
0057 class G4Track;
0058 class G4Step;
0059 class G4ParticleDefinition;
0060 class G4MaterialCutsCouple;
0061 class G4Material;
0062 class G4LossTableManager;
0063 class G4VEmFluctuationModel;
0064 
0065 class G4DynamicParticleIonisation : public G4VContinuousDiscreteProcess
0066 {
0067 public:
0068 
0069   G4DynamicParticleIonisation();
0070 
0071   ~G4DynamicParticleIonisation() override;
0072 
0073   // initialisation
0074   void BuildPhysicsTable(const G4ParticleDefinition&) override;
0075 
0076   // Step limit from AlongStep 
0077   G4double AlongStepGetPhysicalInteractionLength(
0078                                   const G4Track&,
0079                                   G4double  previousStepSize,
0080                                   G4double  currentMinimumStep,
0081                                   G4double& currentSafety,
0082                                   G4GPILSelection* selection) override;
0083 
0084   // Step limit from cross section
0085   G4double PostStepGetPhysicalInteractionLength(
0086                                   const G4Track& track,
0087                                   G4double previousStepSize,
0088                                   G4ForceCondition* condition) override;
0089 
0090   // AlongStep computations
0091   G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) override;
0092 
0093   // PostStep sampling of secondaries
0094   G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
0095 
0096 
0097   // implementation of the pure virtual method
0098   G4double GetMeanFreePath(const G4Track& track, G4double previousStepSize,
0099                            G4ForceCondition* condition) override;
0100 
0101   // implementation of the pure virtual method
0102   G4double GetContinuousStepLimit(const G4Track& track, G4double previousStepSize,
0103                                   G4double currentMinimumStep, G4double& currentSafety) override;
0104   
0105   // print description in html
0106   void ProcessDescription(std::ostream&) const override;
0107 
0108   // hide assignment operator
0109   G4DynamicParticleIonisation & operator=
0110   (const G4DynamicParticleIonisation& right) = delete;
0111   G4DynamicParticleIonisation(const G4DynamicParticleIonisation&) = delete;
0112 
0113 private:
0114 
0115   // all parameters are dynamic
0116   void PreStepInitialisation(const G4Track&);
0117 
0118   // dEdx for given energy
0119   G4double ComputeDEDX(G4double ekin);
0120 
0121   // cross section per volume
0122   G4double ComputeCrossSection(G4double ekin);
0123 
0124   G4LossTableManager* lManager;
0125   G4VEmFluctuationModel* fUrban;
0126   const G4ParticleDefinition* theElectron;
0127   const G4MaterialCutsCouple* fCouple{nullptr};
0128   const G4Material* fMaterial{nullptr};
0129   const std::vector<G4double>* fCuts{nullptr};
0130   
0131   G4double fMass{0.0};
0132   G4double fRatio{0.0};
0133   G4double fCharge{0.0};
0134   G4double fCut{0.0};
0135   G4double fTmax{0.0};
0136   G4double fEkinPreStep{0.0};
0137   G4double fLowestEkin{0.0};
0138   G4double fLinLimit{0.05};
0139 
0140   G4int fSecID{_DeltaElectron};
0141   G4bool fFluct{true};
0142 
0143   G4ParticleChangeForLoss fParticleChange;
0144 };
0145 
0146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0147 
0148 #endif