Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4DNAOneStepThermalizationModel.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: G4DNAOneStepThermalizationModel.cc 102637 2017-02-10 11:08:17Z gcosmo $
27 //
28 // Author: Mathieu Karamitros
29 //
30 // WARNING : This class is released as a prototype.
31 // It might strongly evolve or even disapear in the next releases.
32 //
33 // History:
34 // -----------
35 // 10 Oct 2011 M.Karamitros created
36 //
37 // -------------------------------------------------------------------
38 
39 #include <algorithm>
41 #include "G4Exp.hh"
42 #include "G4RandomDirection.hh"
43 
44 //------------------------------------------------------------------------------
45 
46 namespace DNA{ namespace Penetration{
47 
48  const double
50  { -4.06217193e-08, 3.06848412e-06, -9.93217814e-05,
51  1.80172797e-03, -2.01135480e-02, 1.42939448e-01,
52  -6.48348714e-01, 1.85227848e+00, -3.36450378e+00,
53  4.37785068e+00, -4.20557339e+00, 3.81679083e+00,
54  -2.34069784e-01 };
55  // fit from Meesungnoen, 2002
56 
57  const double
59  { 0.2, 0.5, 1, 2, 3, 4, 5, 6, 7,
60  // The two last are not in the dataset
61  8, 9}; // eV
62 
63  const double
65  { 17.68*CLHEP::angstrom,
66  22.3*CLHEP::angstrom,
67  28.49*CLHEP::angstrom,
68  45.35*CLHEP::angstrom,
69  70.03*CLHEP::angstrom,
70  98.05*CLHEP::angstrom,
71  120.56*CLHEP::angstrom,
72  132.73*CLHEP::angstrom,
73  142.60*CLHEP::angstrom,
74  // the above value as given in the paper's table does not match
75  // b=27.22 nm nor the mean value. 129.62*CLHEP::angstrom could be
76  // a better fit.
77  //
78  // The two last are made up
79  137.9*CLHEP::angstrom,
80  120.7*CLHEP::angstrom
81  }; // angstrom
82 
83  //----------------------------------------------------------------------------
84 
85  double Meesungnoen2002::GetRmean(double k){
86  G4double k_eV = k/eV;
87 
88  if(k_eV>0.1){ // data until 0.2 eV
89  G4double r_mean = 0;
90  for(int8_t i=12; i!=-1 ; --i){
91  r_mean+=gCoeff[12-i]*std::pow(k_eV,i);
92  }
93  r_mean*=CLHEP::nanometer;
94  return r_mean;
95  }
96  return 0;
97  }
98 
100  G4ThreeVector& displacement){
101  displacement=G4ThreeVector(0,0,0);
102  G4double k_eV = k/eV;
103 
104  if(k_eV>0.1){ // data until 0.2 eV
105  G4double r_mean = 0;
106  for(int8_t i=12; i!=-1 ; --i){
107  r_mean+=gCoeff[12-i]*std::pow(k_eV,i);
108  }
109 
110  r_mean*=nanometer;
111 
112  //G4cout << "rmean = " << r_mean << G4endl;
113 
114  static constexpr double r2s=0.62665706865775006; //sqrt(CLHEP::pi)/pow(2,3./2.)
115 
116  // Use r_mean to build a 3D gaussian
117  double sigma3D = r_mean*r2s;
118  double x = G4RandGauss::shoot(0,sigma3D);
119  double y = G4RandGauss::shoot(0,sigma3D);
120  double z = G4RandGauss::shoot(0,sigma3D);
121  displacement=G4ThreeVector(x,y,z);
122  }
123  else{
124  displacement=G4RandomDirection()*(1e-3*CLHEP::nanometer);
125  // rare events:
126  // prevent H2O and secondary electron to be at the spot
127  }
128  }
129 
130  //----------------------------------------------------------------------------
131 
133  G4double k_eV = energy/eV;
134  if(k_eV < 0.2) return 1e-3*CLHEP::nanometer;
135  // rare events:
136  // prevent H2O and secondary electron to be at the spot
137 
138  if(k_eV == 9.) return gStdDev_T1990[10];
139  // TODO if k_eV > 9
140 
141  size_t lowBin, upBin;
142 
143  if(k_eV >= 1.){
144  lowBin=floor(k_eV)+1;
145  upBin=std::min(lowBin+1, size_t(10));
146  }
147  else{
148  auto it=std::lower_bound(&gEnergies_T1990[0],
149  &gEnergies_T1990[2],
150  k_eV);
151  lowBin = it-&gEnergies_T1990[0];
152  upBin = lowBin+1;
153  }
154 
155  double lowE = gEnergies_T1990[lowBin];
156  double upE = gEnergies_T1990[upBin];
157 
158  // G4cout << lowE << " " << upE << G4endl;
159 
160  double lowS = gStdDev_T1990[lowBin];
161  double upS = gStdDev_T1990[upBin];
162 
163  double tanA = (lowS-upS)/(lowE-upE);
164  double sigma3D = lowS + (k_eV-lowE)*tanA;
165  return sigma3D;
166  }
167 
169  double sigma3D=Get3DStdDeviation(energy);
170 
171  static constexpr double s2r=1.595769121605731;
172  // pow(2,3./2.)/sqrt(CLHEP::pi)
173 
174  double r_mean=sigma3D*s2r;
175  return r_mean;
176  }
177 
179  G4ThreeVector& displacement){
180  double sigma3D=Get3DStdDeviation(energy);
181  // G4cout << "sigma3D = " << sigma3D/CLHEP::nanometer << G4endl;
182 
183  static constexpr double factor = 2.20496999539;
184  // 1./(3. - 8./CLHEP::pi);
185 
186  double sigma1D = sqrt(pow(sigma3D, 2.)*factor);
187 
188  // G4cout << "sigma1D = " << sigma1D/CLHEP::nanometer << G4endl;
189 
190  double x = G4RandGauss::shoot(0.,sigma1D);
191  double y = G4RandGauss::shoot(0.,sigma1D);
192  double z = G4RandGauss::shoot(0.,sigma1D);
193  displacement=G4ThreeVector(x,y,z);
194  // G4cout << "displacement[nm]: "
195  // << displacement.mag()/CLHEP::nanometer << G4endl;
196  }
197 }}
ThreeVector shoot(const G4int Ap, const G4int Af)
CLHEP::Hep3Vector G4ThreeVector
G4ThreeVector G4RandomDirection()
static constexpr double nanometer
Definition: G4SIunits.hh:101
static constexpr double eV
Definition: G4SIunits.hh:215
static void GetPenetration(G4double energy, G4ThreeVector &displacement)
static void GetPenetration(G4double energy, G4ThreeVector &displacement)
G4double energy(const ThreeVector &p, const G4double m)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
static constexpr double nanometer
Definition: SystemOfUnits.h:81
double G4double
Definition: G4Types.hh:76
static double Get3DStdDeviation(double energy)
static constexpr double angstrom
Definition: SystemOfUnits.h:82