Geant4_10
G4hhIonisation.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4hhIonisation.cc 66241 2012-12-13 18:34:42Z gunter $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class file
31 //
32 //
33 // File name: G4hhIonisation
34 //
35 // Author: Vladimir Ivanchenko
36 //
37 // Creation date: 30.09.2005
38 //
39 // Modifications:
40 // 10-01-06 SetStepLimits -> SetStepFunction (V.Ivantchenko)
41 // 27-10-06 Add maxKinEnergy (V.Ivantchenko)
42 //
43 //
44 // -------------------------------------------------------------------
45 //
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
48 
49 #include "G4hhIonisation.hh"
50 #include "G4PhysicalConstants.hh"
51 #include "G4SystemOfUnits.hh"
52 #include "G4BraggNoDeltaModel.hh"
54 #include "G4ICRU73NoDeltaModel.hh"
56 #include "G4BohrFluctuations.hh"
57 #include "G4IonFluctuations.hh"
58 #include "G4UnitsTable.hh"
59 #include "G4Electron.hh"
60 #include "G4LossTableManager.hh"
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
63 
65  : G4VEnergyLossProcess(name),
66  theParticle(0),
67  theBaseParticle(0),
68  isInitialised(false)
69 {
70  SetStepFunction(0.1, 0.1*mm);
71  SetVerboseLevel(1);
73  mass = 0.0;
74  ratio = 0.0;
75  flucModel = 0;
76 }
77 
78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
79 
81 {}
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
84 
86 {
87  return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 100.0*MeV &&
88  !p.IsShortLived());
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
92 
94  const G4Material*,
95  G4double cut)
96 {
97  G4double x = 0.5*cut/electron_mass_c2;
99  G4double gam = x*y + std::sqrt((1. + x)*(1. + x*y*y));
100  return mass*(gam - 1.0);
101 }
102 
103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
104 
106  const G4ParticleDefinition* bpart)
107 {
108  if(isInitialised) { return; }
109 
110  theParticle = part;
111  if(bpart) {
112  G4cout << "G4hhIonisation::InitialiseEnergyLossProcess WARNING: no "
113  << "base particle should be defined for the process "
114  << GetProcessName() << G4endl;
115  }
116  SetBaseParticle(0);
118  mass = theParticle->GetPDGMass();
119  ratio = electron_mass_c2/mass;
120  G4double eth = 2*MeV*mass/proton_mass_c2;
121  flucModel = new G4IonFluctuations();
122 
123  G4double emin = std::min(MinKinEnergy(), 0.1*eth);
124  G4double emax = std::max(MaxKinEnergy(), 100*eth);
125 
126  SetMinKinEnergy(emin);
127  SetMaxKinEnergy(emax);
128  G4int bin = G4lrint(G4LossTableManager::Instance()->GetNumberOfBinsPerDecade()
129  *std::log10(emax/emin));
130  SetDEDXBinning(bin);
131 
132  G4VEmModel* em = 0;
133  if(part->GetPDGCharge() > 0.0) { em = new G4BraggNoDeltaModel(); }
134  else { em = new G4ICRU73NoDeltaModel(); }
135  em->SetLowEnergyLimit(emin);
136  em->SetHighEnergyLimit(eth);
137  AddEmModel(1, em, flucModel);
138 
139  em = new G4BetheBlochNoDeltaModel();
140  em->SetLowEnergyLimit(eth);
141  em->SetHighEnergyLimit(emax);
142  AddEmModel(1, em, flucModel);
143 
144  if(verboseLevel>1) {
145  G4cout << "G4hhIonisation is initialised" << G4endl;
146  }
147  isInitialised = true;
148 }
149 
150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
151 
153 {
154  G4cout << " Delta-ray will not be produced; "
155  << G4endl;
156 }
157 
158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
virtual ~G4hhIonisation()
static G4LossTableManager * Instance()
G4int verboseLevel
Definition: G4VProcess.hh:368
const char * p
Definition: xmltok.h:285
void SetStepFunction(G4double v1, G4double v2)
virtual G4bool IsApplicable(const G4ParticleDefinition &p)
float bin[41]
Definition: plottest35.C:14
const XML_Char * name
Definition: expat.h:151
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *p, const G4Material *, G4double cut)
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:683
Double_t y
Definition: plot.C:279
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
TString part[npart]
Definition: Style.C:32
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:432
float proton_mass_c2
Definition: hepunit.py:275
void SetMaxKinEnergy(G4double e)
float electron_mass_c2
Definition: hepunit.py:274
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=0, const G4Region *region=0)
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
void SetSecondaryParticle(const G4ParticleDefinition *p)
virtual void PrintInfo()
G4double GetPDGMass() const
int G4lrint(double ad)
Definition: templates.hh:163
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double MinKinEnergy() const
G4hhIonisation(const G4String &name="hhIoni")
G4double MaxKinEnergy() const
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:690
G4double GetPDGCharge() const
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition *, const G4ParticleDefinition *)
void SetBaseParticle(const G4ParticleDefinition *p)
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
void SetDEDXBinning(G4int nbins)
void SetMinKinEnergy(G4double e)