Geant4  10.02
G4DNAElectronHoleRecombination.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 /*
27  * G4DNAElectronHoleRecombination.cc
28  *
29  * Created on: Jun 17, 2015
30  * Author: mkaramit
31  */
32 
34 #include <G4MoleculeFinder.hh>
35 #include "G4PhysicalConstants.hh"
36 #include "G4Electron_aq.hh"
37 #include "G4MoleculeTable.hh"
39 #include "G4H2.hh"
40 #include "G4H2O.hh"
42 #include "G4MoleculeTable.hh"
45 #include "G4SystemOfUnits.hh"
46 #include "G4MoleculeCounter.hh"
47 
48 static double onsager_constant = e_squared / (4. * pi * epsilon0 * k_Boltzmann);
49 
50 //------------------------------------------------------------------------------
51 
52 // Parameterisation of dielectric constant vs temperature and density
53 
54 double Y(double density)
55 {
56  return 1. / (1. + 0.0012 / (density * density));
57 }
58 
59 double A(double temperature)
60 {
61  double temp_inverse = 1 / temperature;
62  return 0.7017
63  + 642.0 * temp_inverse
64  - 1.167e5 * temp_inverse * temp_inverse
65  + 9.190e6 * temp_inverse * temp_inverse * temp_inverse;
66 }
67 
68 double B(double temperature)
69 {
70  double temp_inverse = 1 / temperature;
71  return -2.71
72  + 275.4 * temp_inverse
73  + 0.3245e5 * temp_inverse * temp_inverse;
74 }
75 
76 double S(double temp)
77 {
78  double temp_inverse = 1 / temp;
79 
80  return 1.667
81  - 11.41 * temp_inverse
82  - 35260.0 * temp_inverse * temp_inverse;
83 }
84 
85 double C(double temp)
86 {
87  return A(temp) - B(temp) - 3;
88 }
89 
90 double D(double temp)
91 {
92  return B(temp) + 3;
93 }
94 
95 double epsilon(double density, double temperature)
96 {
97  return 1 + std::exp(std::log(10.)*
98  (Y(density) *
99  (C(temperature) + (S(temperature) - 1)*std::log(density)/std::log(10.))
100  + D(temperature) + std::log(density)/std::log(10.)));
101 }
102 
103 //------------------------------------------------------------------------------
104 
106  G4VITRestDiscreteProcess("G4DNAElectronHoleRecombination", fElectromagnetic)
107 {
108  Create();
109 // G4cout << epsilon(1.0095, 298.) << G4endl;
110 // G4cout << epsilon(1., 293.15) << G4endl;
111 // G4cout << epsilon(0.9277, 423.) << G4endl;
112 // G4cout << epsilon(0.816, 523.) << G4endl;
113 // G4cout << epsilon(0.6, 623) << G4endl;
114 }
115 
117 {
118 }
119 
121 {
123  enableAtRestDoIt = true;
124  enableAlongStepDoIt = false;
125  enablePostStepDoIt = true;
126 
127  SetProcessSubType(60);
128 
130  // ie G4DNAElectronHoleRecombination uses a state class
131  // inheriting from G4ProcessState
132 
133  fIsInitialized = false;
134  fProposesTimeStep = true;
135  fpMoleculeDensity = 0;
136 
137  verboseLevel = 0;
138 }
139 
140 //______________________________________________________________________________
141 
144  const G4Step& /*stepData*/)
145 {
149  MakeReaction(track);
150  return &fParticleChange;
151 }
152 
153 //______________________________________________________________________________
154 
156 {
158  G4VITProcess::fpState.reset(new State());
160 }
161 
162 //______________________________________________________________________________
163 
165 {
167  State* state = fpState->GetState<State>();
168  double random = state->fSampleProba;
169  std::vector<ReactionProfile>& reactants = state->fReactants;
170 
171  G4Track* selected_reactant = 0;
172 
173  for(size_t i = 0; i < reactants.size(); ++i)
174  {
175  if(reactants[i].fElectron->GetTrackStatus() != fAlive) continue;
176  if(reactants[i].fProbability > random)
177  {
178  selected_reactant = reactants[i].fElectron;
179  }
180  break;
181  }
182 
183  // G4cout << "MakeReaction with charge ="
184  // << GetMolecule(track)->GetCharge() << G4endl;
185 
186  if(selected_reactant)
187  {
188  // G4cout << " Will react with TID = " << selected_reactant->GetTrackID()
189  // << G4endl;
190 
193  RemoveAMoleculeAtTime(GetMolecule(track)->GetMolecularConfiguration(),
194  track.GetGlobalTime());
195  GetMolecule(track)->ChangeConfigurationToLabel("H2Ovib");
196 
199  AddAMoleculeAtTime(GetMolecule(track)->GetMolecularConfiguration(),
200  track.GetGlobalTime());
201 
202  // fParticleChange.ProposeTrackStatus(fStopAndKill);
204 
205  selected_reactant->SetTrackStatus(fStopAndKill);
206  // G4TrackList::Pop(selected_reactant);
207  // G4ITTrackHolder::Instance()->PushToKill(selected_reactant);
208 
209  }
210  else
211  {
213  }
214 }
215 
216 //______________________________________________________________________________
217 
219 {
220  if(GetMolecule(track)->GetCharge() <= 0)
221  {
222  // G4cout << "La charge est negative ou nulle !! " << G4endl;
223  return false;
224  }
225 
226  const std::vector<double>* densityTable =
228 
229  double temperature = track.GetMaterial()->GetTemperature();
230  double density = (*densityTable)[track.GetMaterial()->GetIndex()] /
231  ( g/(1e-2*m*1e-2*m*1e-2*m) );
232  double eps = epsilon(density, temperature);
233 
234  // G4cout << " temperature = " << temperature << G4endl;
235  // G4cout << " density = " << density << G4endl;
236  // G4cout << " eps = " << eps << G4endl;
237 
238  double onsager_radius = onsager_constant * 1. / (temperature * eps);
239 
241 
244  e_aq.GetMoleculeID(),
245  10. * onsager_radius);
246 
247  // double distance = -1.;
248  // double probability = -1.;
249 
250  if(results == 0 || results->GetSize() == 0)
251  {
252  // G4cout << "rien trouve a moins de 10 rc" << G4endl;
253  return false;
254  }
255 
256  results->Sort();
257 
258  State* state = fpState->GetState<State>();
259  std::vector<ReactionProfile>& reactants = state->fReactants;
260  state->fSampleProba = G4UniformRand();
261 
262  reactants.resize(results->GetSize());
263 
264  for(size_t i = 0; results->End() == false; results->Next(), ++i)
265  {
266  reactants[i].fElectron = results->GetItem<G4IT>()->GetTrack();
267  reactants[i].fDistance = std::sqrt(results->GetDistanceSqr());
268 
269  if(reactants[i].fDistance != 0)
270  {
271  reactants[i].fProbability = 1.
272  - std::exp(-onsager_radius / reactants[i].fDistance);
273  }
274  else
275  {
276  reactants[i].fProbability = 1.;
277  }
278 
279  // G4cout << "dis = "
280  // << reactants[i].fDistance << " prob = " << reactants[i].fProbability << G4endl;
281  }
282 
283  if(results->GetSize() != 0 && reactants.empty())
284  {
285  G4cout << "Size is = " << results->GetSize() << G4endl;
286  abort();
287  }
288 
289  if(reactants.empty()) return false;
290 
291  // G4cout << " reactants[0].fDistance =" << reactants[0].fDistance
292  // << " onsager_radius = " << onsager_radius << "\t";
293  //
294  // G4cout << " reactants[0].fProbability =" << reactants[0].fProbability
295  // << "state->fSampleProba = " << state->fSampleProba << "\t";
296 
297  if(reactants[0].fProbability > state->fSampleProba) return true;
298  return false;
299 }
300 
301 //______________________________________________________________________________
302 
303 G4bool
306 {
308  {
310  ->GetMoleculeDefinition("H2O", false);
311 
312  if(H2O) // if this condition does not hold => process cannot be applied
313  {
315  G4H2O::Definition()->NewConfiguration("H2Ovib");
316 
317  assert(vib != 0);
318 
320  ->GetConfiguration("H2", false);
322  ->GetConfiguration("OH", false);
324  ->GetConfiguration("H", false);
325 
326  double probaRemaining = 1.;
327 
328  if(OH || H2)
329  {
331  new G4MolecularDissociationChannel("H2Ovib_DissociativeDecay1");
332  if(H2)
333  {
334  diss2->AddProduct(H2);
335  }
336  if(OH)
337  {
338  diss2->AddProduct(OH);
339  diss2->AddProduct(OH);
340  }
341 
342  double proba = 0.15;
343  diss2->SetProbability(proba);
344  probaRemaining -= proba;
346  B1A1_DissociationDecay);
347  G4H2O::Definition()->AddDecayChannel(vib, diss2);
348  }
349 
350  if(OH || H)
351  {
353  new G4MolecularDissociationChannel("H2Ovib_DissociativeDecay2");
354  if(OH)
355  {
356  diss3->AddProduct(OH);
357  }
358  if(H)
359  {
360  diss3->AddProduct(H);
361  }
362  double proba = 0.55;
363  diss3->SetProbability(proba);
364  probaRemaining -= proba;
366  A1B1_DissociationDecay);
367  G4H2O::Definition()->AddDecayChannel(vib, diss3);
368  }
369 
371  new G4MolecularDissociationChannel("H2Ovib_NonDissociative");
372  channel1->SetProbability(probaRemaining);
373  G4H2O::Definition()->AddDecayChannel(vib, channel1);
374  }
375  }
376 
377  if(particle.GetParticleName() == "H2O") return true;
378  return false;
379 }
380 
381 //______________________________________________________________________________
382 
384  G4double,
386 {
387  // G4cout << "track ID = " << track.GetTrackID()
388  // << " G4DNAElectronHoleRecombination --> ";
389  if(FindReactant(track))
390  {
391  // G4cout << " SELECTED " ;
392  // G4cout << G4endl;
393  return 0;
394  }
395 
396  // G4cout << " NOT SELECTED " << G4endl;
397  return DBL_MAX;
398 }
399 
400 //______________________________________________________________________________
401 
404 {
405 // G4cout << "track ID = " << track.GetTrackID()
406 // << " G4DNAElectronHoleRecombination --> ";
407  if(FindReactant(track))
408  {
409 // G4cout << " SELECTED " ;
410 // G4cout << G4endl;
411  return 0;
412  }
413 
414 // G4cout << " NOT SELECTED " << G4endl;
415  return DBL_MAX;
416 }
417 
419  const G4Step& step)
420 {
421  return AtRestDoIt(track, step);
422 }
The pointer G4MolecularConfiguration will be shared by all the molecules having the same molecule def...
void SetTrackStatus(const G4TrackStatus aTrackStatus)
static double onsager_constant
const std::vector< double > * GetDensityTableFor(const G4Material *) const
static G4Electron_aq * Definition()
virtual void ClearNumberOfInteractionLengthLeft()
double Y(double density)
Identical to G4VRestDiscreteProcess with dependency from G4VITProcess.
const std::vector< double > * fpMoleculeDensity
G4MoleculeDefinition * GetMoleculeDefinition(const G4String &, bool mustExist=true)
G4int verboseLevel
Definition: G4VProcess.hh:368
static G4H2O * Definition()
Definition: G4H2O.cc:46
double S(double temp)
void AddDecayChannel(const G4MolecularConfiguration *molConf, const G4MolecularDissociationChannel *channel)
size_t GetIndex() const
Definition: G4Material.hh:262
G4KDTreeResultHandle FindNearestInRange(const T *point, int key, G4double)
const G4ThreeVector & GetPosition() const
#define State(X)
static const G4double eps
double C(double temp)
double B(double temperature)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
G4bool enableAtRestDoIt
Definition: G4VProcess.hh:350
const G4String & GetParticleName() const
void SetInstantiateProcessState(G4bool flag)
void ChangeConfigurationToLabel(const G4String &label)
Definition: G4Molecule.cc:600
virtual void ClearInteractionTimeLeft()
G4MolecularConfiguration * NewConfiguration(const G4String &excitedStateLabel)
virtual void StartTracking(G4Track *)
Definition: G4VProcess.cc:101
G4double density
Definition: TRTMaterials.hh:39
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
static G4bool InUse()
void AddProduct(const G4Molecule *, G4double=0)
static G4MoleculeCounter * Instance()
bool G4bool
Definition: G4Types.hh:79
virtual G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
static G4MoleculeTable * Instance()
virtual void StartTracking(G4Track *)
Definition: G4VITProcess.cc:86
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:432
G4shared_ptr< G4ProcessState > fpState
Definition: G4Step.hh:76
G4bool enablePostStepDoIt
Definition: G4VProcess.hh:352
G4double GetGlobalTime() const
G4Molecule * GetMolecule(const G4Track &track)
Definition: G4Molecule.cc:69
G4Material * GetMaterial() const
virtual G4double GetMeanFreePath(const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)
virtual void Initialize(const G4Track &)
static G4DNAMolecularMaterial * Instance()
static G4ITFinder * Instance()
static const double pi
Definition: G4SIunits.hh:74
static const double g
Definition: G4SIunits.hh:180
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
virtual G4double GetMeanLifeTime(const G4Track &aTrack, G4ForceCondition *condition)
double D(double temp)
G4bool fProposesTimeStep
G4double GetTemperature() const
Definition: G4Material.hh:182
#define G4endl
Definition: G4ios.hh:61
G4bool enableAlongStepDoIt
Definition: G4VProcess.hh:351
static const double m
Definition: G4SIunits.hh:128
G4bool IsMasterThread()
Definition: G4Threading.cc:130
Class Description The dynamic molecule holds all the data that change for a molecule It has a pointer...
Definition: G4Molecule.hh:94
double G4double
Definition: G4Types.hh:76
void ProposeTrackStatus(G4TrackStatus status)
G4ForceCondition
#define DBL_MAX
Definition: templates.hh:83
{ Class description:
double epsilon(double density, double temperature)
G4int GetMoleculeID() const
Definition: G4Molecule.cc:472
G4MolecularConfiguration * GetConfiguration(const G4String &, bool mustExist=true)