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.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/standard/include/G4hIonisation.hh (Version 11.3.0) and /processes/electromagnetic/standard/include/G4hIonisation.hh (Version 6.2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
                                                   >>  23 // $Id: G4hIonisation.hh,v 1.25 2004/01/21 18:05:22 vnivanch Exp $
                                                   >>  24 // GEANT4 tag $Name: geant4-06-01 $
 26 //                                                 25 //
 27 // -------------------------------------------     26 // -------------------------------------------------------------------
 28 //                                                 27 //
 29 // GEANT4 Class header file                        28 // GEANT4 Class header file
 30 //                                                 29 //
 31 //                                                 30 //
 32 // File name:     G4hIonisation                    31 // File name:     G4hIonisation
 33 //                                                 32 //
 34 // Author:        Laszlo Urban                     33 // Author:        Laszlo Urban
 35 //                                                 34 //
 36 // Creation date: 30.05.1997                       35 // Creation date: 30.05.1997
 37 //                                                 36 //
 38 // Modifications:                                  37 // Modifications:
 39 //                                                 38 //
 40 // corrected by L.Urban on 24/09/97                39 // corrected by L.Urban on 24/09/97
 41 // corrected by L.Urban on 13/01/98                40 // corrected by L.Urban on 13/01/98
 42 // bugs fixed by L.Urban on 02/02/99               41 // bugs fixed by L.Urban on 02/02/99
 43 // 10/02/00 modifications , new e.m. structure     42 // 10/02/00 modifications , new e.m. structure, L.Urban
 44 // 10-08-01 new methods Store/Retrieve Physics     43 // 10-08-01 new methods Store/Retrieve PhysicsTable (mma)
 45 // 14-08-01 new function ComputeRestrictedMean     44 // 14-08-01 new function ComputeRestrictedMeandEdx() + 'cleanup' (mma)
 46 // 19-09-01 come back to previous process name     45 // 19-09-01 come back to previous process name "hIoni"
 47 // 29-10-01 all static functions no more inlin     46 // 29-10-01 all static functions no more inlined
 48 // 07-01-02 new design of em processes (V.Ivan     47 // 07-01-02 new design of em processes (V.Ivanchenko)
 49 // 26-12-02 secondary production moved to deri     48 // 26-12-02 secondary production moved to derived classes (VI)
 50 // 24-01-03 Make models region aware (V.Ivanch     49 // 24-01-03 Make models region aware (V.Ivanchenko)
 51 // 05-02-03 Fix compilation warnings (V.Ivanch     50 // 05-02-03 Fix compilation warnings (V.Ivanchenko)
 52 // 13-02-03 SubCutoff regime is assigned to a      51 // 13-02-03 SubCutoff regime is assigned to a region (V.Ivanchenko)
 53 // 15-02-03 Add control on delta pointer (V.Iv     52 // 15-02-03 Add control on delta pointer (V.Ivanchenko)
 54 // 23-05-03 Add fluctuation model as a member      53 // 23-05-03 Add fluctuation model as a member function (V.Ivanchenko)
 55 // 03-06-03 Fix initialisation problem for STD     54 // 03-06-03 Fix initialisation problem for STD ionisation (V.Ivanchenko)
 56 // 16-06-03 ShortLived are not applicable any      55 // 16-06-03 ShortLived are not applicable any more (V.Ivanchenko)
 57 // 08-08-03 STD substitute standard  (V.Ivanch     56 // 08-08-03 STD substitute standard  (V.Ivanchenko)
 58 // 12-11-03 G4EnergyLossSTD -> G4EnergyLossPro     57 // 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
 59 // 21-01-04 Migrade to G4ParticleChangeForLoss     58 // 21-01-04 Migrade to G4ParticleChangeForLoss (V.Ivanchenko)
 60 // 08-11-04 Migration to new interface of Stor << 
 61 // 08-04-05 Major optimisation of internal int << 
 62 // 11-04-04 Move MaxSecondaryEnergy to models  << 
 63 // 12-09-08 Removed CorrectionsAlongStep (VI)  << 
 64 //                                                 59 //
 65 // Class Description:                              60 // Class Description:
 66 //                                                 61 //
 67 // This class manages the ionisation process f     62 // This class manages the ionisation process for hadrons.
 68 // it inherites from G4VContinuousDiscreteProc     63 // it inherites from G4VContinuousDiscreteProcess via G4VEnergyLoss.
 69 //                                                 64 //
 70                                                    65 
 71 // -------------------------------------------     66 // -------------------------------------------------------------------
 72 //                                                 67 //
 73                                                    68 
 74 #ifndef G4hIonisation_h                            69 #ifndef G4hIonisation_h
 75 #define G4hIonisation_h 1                          70 #define G4hIonisation_h 1
 76                                                    71 
 77 #include "G4VEnergyLossProcess.hh"                 72 #include "G4VEnergyLossProcess.hh"
 78 #include "G4Electron.hh"                           73 #include "G4Electron.hh"
 79 #include "G4Positron.hh"                           74 #include "G4Positron.hh"
 80 #include "globals.hh"                              75 #include "globals.hh"
 81                                                    76 
 82 class G4Material;                                  77 class G4Material;
                                                   >>  78 class G4VEmFluctuationModel;
 83                                                    79 
 84 class G4hIonisation : public G4VEnergyLossProc     80 class G4hIonisation : public G4VEnergyLossProcess
 85 {                                                  81 {
 86                                                    82 
 87 public:                                            83 public:
 88                                                    84 
 89   explicit G4hIonisation(const G4String& name  <<  85   G4hIonisation(const G4String& name = "hIoni");
 90                                                    86 
 91   ~G4hIonisation() override = default;         <<  87   ~G4hIonisation();
 92                                                    88 
 93   G4bool IsApplicable(const G4ParticleDefiniti <<  89   G4bool IsApplicable(const G4ParticleDefinition& p);
 94                                                    90 
 95   G4double MinPrimaryEnergy(const G4ParticleDe <<  91   virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
 96           const G4Material*, G4double cut) fin <<  92                                     const G4Material*, G4double cut);
 97                                                    93 
 98   // print documentation in html format        <<  94   virtual std::vector<G4Track*>* SecondariesAlongStep(
 99   void ProcessDescription(std::ostream&) const <<  95                              const G4Step&,
                                                   >>  96                  G4double&,
                                                   >>  97                  G4double&,
                                                   >>  98                                    G4double&);
100                                                    99 
101   // hide assignment operator                  << 100   virtual void SecondariesPostStep(
102   G4hIonisation & operator=(const G4hIonisatio << 101                                    G4VEmModel*,
103   G4hIonisation(const G4hIonisation&) = delete << 102                              const G4MaterialCutsCouple*,
                                                   >> 103                              const G4DynamicParticle*,
                                                   >> 104                                    G4double&,
                                                   >> 105                                    G4double&);
                                                   >> 106 
                                                   >> 107   void SetSubCutoff(G4bool val);
                                                   >> 108 
                                                   >> 109   void PrintInfoDefinition();
                                                   >> 110   // Print out of the class parameters
104                                                   111 
105 protected:                                        112 protected:
106                                                   113 
107   void InitialiseEnergyLossProcess(const G4Par << 114   virtual const G4ParticleDefinition* DefineBaseParticle(const G4ParticleDefinition* p);
108            const G4ParticleDefinition*) overri << 115 
                                                   >> 116   virtual G4double MaxSecondaryEnergy(const G4DynamicParticle* dynParticle);
109                                                   117 
110 private:                                          118 private:
111                                                   119 
112   G4bool isInitialised = false;                << 120   void InitialiseProcess();
113   G4double mass = 0.0;                         << 121 
114   G4double ratio = 0.0;                        << 122   // hide assignment operator
115   G4double eth;                                << 123   G4hIonisation & operator=(const G4hIonisation &right);
                                                   >> 124   G4hIonisation(const G4hIonisation&);
                                                   >> 125 
                                                   >> 126   G4double   mass;
                                                   >> 127   G4double   ratio;
                                                   >> 128 
                                                   >> 129   const G4ParticleDefinition* theParticle;
                                                   >> 130   const G4ParticleDefinition* theBaseParticle;
                                                   >> 131   G4VEmFluctuationModel*      flucModel;
                                                   >> 132 
                                                   >> 133   G4bool                      subCutoff;
                                                   >> 134   G4bool                      isInitialised;
116 };                                                135 };
                                                   >> 136 
                                                   >> 137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 139 
                                                   >> 140 inline G4bool G4hIonisation::IsApplicable(const G4ParticleDefinition& p)
                                                   >> 141 {
                                                   >> 142   return (p.GetPDGCharge() != 0.0 &&
                                                   >> 143           p.GetPDGMass() > 10.0*MeV &&
                                                   >> 144    !p.IsShortLived());
                                                   >> 145 }
                                                   >> 146 
                                                   >> 147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 148 
                                                   >> 149 inline G4double G4hIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
                                                   >> 150                                                    const G4Material*,
                                                   >> 151                                                          G4double cut)
                                                   >> 152 {
                                                   >> 153   G4double x = 0.5*cut/electron_mass_c2;
                                                   >> 154   G4double y = electron_mass_c2/mass;
                                                   >> 155   G4double g = x*y + sqrt((1. + x)*(1. + x*y*y));
                                                   >> 156   return mass*(g - 1.0);
                                                   >> 157 }
                                                   >> 158 
                                                   >> 159 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 160 
                                                   >> 161 inline G4double G4hIonisation::MaxSecondaryEnergy(const G4DynamicParticle* dynParticle)
                                                   >> 162 {
                                                   >> 163   G4double gamma= dynParticle->GetKineticEnergy()/mass + 1.0;
                                                   >> 164   G4double tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
                                                   >> 165                   (1. + 2.0*gamma*ratio + ratio*ratio);
                                                   >> 166 
                                                   >> 167   return tmax;
                                                   >> 168 }
                                                   >> 169 
                                                   >> 170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 171 
                                                   >> 172 #include "G4VSubCutoffProcessor.hh"
                                                   >> 173 
                                                   >> 174 inline std::vector<G4Track*>*  G4hIonisation::SecondariesAlongStep(
                                                   >> 175                            const G4Step&   step,
                                                   >> 176                          G4double& tmax,
                                                   >> 177                G4double& eloss,
                                                   >> 178                                  G4double& kinEnergy)
                                                   >> 179 {
                                                   >> 180   std::vector<G4Track*>* newp = 0;
                                                   >> 181   if(subCutoff) {
                                                   >> 182     G4VSubCutoffProcessor* sp = SubCutoffProcessor(CurrentMaterialCutsCoupleIndex());
                                                   >> 183     if (sp) {
                                                   >> 184       G4VEmModel* model = SelectModel(kinEnergy);
                                                   >> 185       newp = sp->SampleSecondaries(step,tmax,eloss,model);
                                                   >> 186     }
                                                   >> 187   }
                                                   >> 188   return newp;
                                                   >> 189 }
                                                   >> 190 
                                                   >> 191 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 192 
                                                   >> 193 #include "G4VEmModel.hh"
                                                   >> 194 
                                                   >> 195 inline void G4hIonisation::SecondariesPostStep(
                                                   >> 196                                                   G4VEmModel* model,
                                                   >> 197                                             const G4MaterialCutsCouple* couple,
                                                   >> 198                                             const G4DynamicParticle* dp,
                                                   >> 199                                                   G4double& tcut,
                                                   >> 200                                                   G4double& kinEnergy)
                                                   >> 201 {
                                                   >> 202   G4DynamicParticle* delta = model->SampleSecondary(couple, dp, tcut, kinEnergy);
                                                   >> 203   if (delta) {
                                                   >> 204     fParticleChange.SetNumberOfSecondaries(1);
                                                   >> 205     fParticleChange.AddSecondary(delta);
                                                   >> 206     G4ThreeVector finalP = dp->GetMomentum();
                                                   >> 207     kinEnergy -= delta->GetKineticEnergy();
                                                   >> 208     finalP -= delta->GetMomentum();
                                                   >> 209     finalP  = finalP.unit();
                                                   >> 210     fParticleChange.SetProposedMomentumDirection(finalP);
                                                   >> 211   }
                                                   >> 212 }
117                                                   213 
118 //....oooOO0OOooo........oooOO0OOooo........oo    214 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
119                                                   215 
120 #endif                                            216 #endif
121                                                   217