Geant4  10.02.p01
G4DNAWaterDissociationDisplacer.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: G4DNAWaterDissociationDisplacer.cc 94289 2015-11-11 08:33:40Z gcosmo $
27 //
28 // Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
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 
40 #include "G4PhysicalConstants.hh"
41 #include "G4SystemOfUnits.hh"
42 #include "G4H2O.hh"
43 #include "G4H2.hh"
44 #include "G4Hydrogen.hh"
45 #include "G4OH.hh"
46 #include "G4H3O.hh"
47 #include "G4Electron_aq.hh"
48 #include "G4H2O2.hh"
49 #include "Randomize.hh"
50 #include "G4Molecule.hh"
52 #include "G4RandomDirection.hh"
53 
54 using namespace std;
55 
66 
67 //------------------------------------------------------------------------------
68 
70 {
71  return (2*r+1)*exp(-2*r);
72 }
73 
74 //------------------------------------------------------------------------------
75 
78  fFastElectronDistrib(0, 10, 0.001)
79 {
81  std::bind((G4double(*)(G4double))
83  std::placeholders::_1);
84 
85  size_t nBins = 100;
86 
87  fElectronThermalization.reserve(nBins);
88 
89  double eps = 1./((int)nBins);
90 
91  // G4cout << "eps = " << eps << G4endl;
92 
93  double proba = eps;
94 
95  fElectronThermalization.push_back(0.);
96 
97  for(size_t i = 1 ; i < nBins ; ++i)
98  {
99  double r = fFastElectronDistrib.Revert(proba, fProba1DFunction);
100  fElectronThermalization.push_back(r);
101  proba+=eps;
102  }
103 }
104 
105 //------------------------------------------------------------------------------
106 
108 {
109  ;
110 }
111 
112 //------------------------------------------------------------------------------
113 
117 {
118  G4int decayType = theDecayChannel->GetDisplacementType();
119 
120  G4double RMSMotherMoleculeDisplacement = 0;
121 
122  if (decayType == Ionisation_DissociationDecay)
123  {
124  RMSMotherMoleculeDisplacement = 2.0 * nanometer;
125  }
126  else if (decayType == A1B1_DissociationDecay)
127  {
128  RMSMotherMoleculeDisplacement = 0. * nanometer;
129  }
130  else if (decayType == B1A1_DissociationDecay)
131  {
132  RMSMotherMoleculeDisplacement = 0. * nanometer;
133  }
134  else if (decayType == AutoIonisation)
135  {
136  RMSMotherMoleculeDisplacement = 2.0 * nanometer;
137  }
138  else if (decayType == DissociativeAttachment)
139  {
140  RMSMotherMoleculeDisplacement = 0. * nanometer;
141  }
142 
143  if (RMSMotherMoleculeDisplacement == 0)
144  {
145  return G4ThreeVector(0, 0, 0);
146  }
147  auto RandDirection = radialDistributionOfProducts(
148  RMSMotherMoleculeDisplacement);
149 
150  return RandDirection;
151 }
152 
153 //------------------------------------------------------------------------------
154 
155 vector<G4ThreeVector>
158 {
159  G4int nbProducts = theDecayChannel->GetNbProducts();
160  vector<G4ThreeVector> theProductDisplacementVector(nbProducts);
161 
162  typedef map<const G4MoleculeDefinition*, G4double> RMSmap;
163  RMSmap theRMSmap;
164 
165  G4int decayType = theDecayChannel->GetDisplacementType();
166 
167  if (decayType == Ionisation_DissociationDecay)
168  {
169  if (fVerbose) G4cout << "Ionisation_DissociationDecay" << G4endl;
170  G4double RdmValue = G4UniformRand();
171 
172  if(RdmValue< 0.5)
173  {
174  // H3O
175  theRMSmap[G4H3O::Definition()] = 0.* nanometer;
176  // OH
177  theRMSmap[G4OH::Definition()] = 0.8* nanometer;
178  }
179  else
180  {
181  // H3O
182  theRMSmap[G4H3O::Definition()] = 0.8* nanometer;
183  // OH
184  theRMSmap[G4OH::Definition()] = 0.* nanometer;
185  }
186 
187  for(int i = 0; i < nbProducts; i++)
188  {
189  G4double theRMSDisplacement;
190  G4MolecularConfiguration* product = theDecayChannel->GetProduct(i);
191  theRMSDisplacement = theRMSmap[product->GetDefinition()];
192 
193  if(theRMSDisplacement==0)
194  {
195  theProductDisplacementVector[i] = G4ThreeVector();
196  }
197  else
198  {
199  auto RandDirection = radialDistributionOfProducts(theRMSDisplacement);
200  theProductDisplacementVector[i] = RandDirection;
201  }
202  }
203  }
204  else if(decayType == A1B1_DissociationDecay)
205  {
206  if(fVerbose)
207  G4cout<<"A1B1_DissociationDecay"<<G4endl;
208  G4double theRMSDisplacement = 2.4 * nanometer;
209  auto RandDirection =
210  radialDistributionOfProducts(theRMSDisplacement);
211 
212  for(G4int i =0; i < nbProducts; i++)
213  {
214  G4MolecularConfiguration* product = theDecayChannel->GetProduct(i);
215 
216  if(product->GetDefinition()== G4OH::Definition())
217  {
218  theProductDisplacementVector[i] = -1./18.*RandDirection;
219  }
220  else if(product->GetDefinition() == G4Hydrogen::Definition())
221  {
222  theProductDisplacementVector[i] = +17./18.*RandDirection;
223  }
224  }
225  }
226  else if(decayType == B1A1_DissociationDecay)
227  {
228  if(fVerbose)
229  G4cout<<"B1A1_DissociationDecay"<<G4endl;
230  G4double theRMSDisplacement = 0.8 * nanometer;
231  auto RandDirection =
232  radialDistributionOfProducts(theRMSDisplacement);
233 
234  G4int NbOfOH = 0;
235  for(G4int i =0; i < nbProducts; i++)
236  {
237  G4MolecularConfiguration* product = theDecayChannel->GetProduct(i);
238  if(product->GetDefinition() == G4H2::Definition())
239  {
240  theProductDisplacementVector[i] = -2./18.*RandDirection;
241  }
242  else if(product->GetDefinition() == G4OH::Definition())
243  {
244  G4ThreeVector OxygenDisplacement = +16./18.*RandDirection;
245  G4double OHRMSDisplacement = 1.1 * nanometer;
246 
247  auto OHDisplacement =
248  radialDistributionOfProducts(OHRMSDisplacement);
249 
250  if(NbOfOH==0)
251  {
252  OHDisplacement = 1./2.*OHDisplacement;
253  }
254  else
255  {
256  OHDisplacement = -1./2.*OHDisplacement;
257  }
258 
259  theProductDisplacementVector[i] =
260  OHDisplacement + OxygenDisplacement;
261 
262  NbOfOH ++;
263  }
264  }
265  }
266  else if(decayType == AutoIonisation)
267  {
268  if(fVerbose)
269  G4cout<<"AutoIonisation"<<G4endl;
270  G4double RdmValue = G4UniformRand();
271 
272  if(RdmValue< 0.5)
273  {
274  // H3O
275  theRMSmap[G4H3O::Definition()] = 0.* nanometer;
276  // OH
277  theRMSmap[G4OH::Definition()] = 0.8* nanometer;
278  }
279  else
280  {
281  // H3O
282  theRMSmap[G4H3O::Definition()] = 0.8* nanometer;
283  // OH
284  theRMSmap[G4OH::Definition()] = 0.* nanometer;
285  }
286 
287  for(G4int i =0; i < nbProducts; i++)
288  {
289  G4MolecularConfiguration* product = theDecayChannel->GetProduct(i);
290  auto theRMSDisplacement = theRMSmap[product->GetDefinition()];
291 
292  if(theRMSDisplacement==0)
293  {
294  theProductDisplacementVector[i] = G4ThreeVector();
295  }
296  else
297  {
298  auto RandDirection =
299  radialDistributionOfProducts(theRMSDisplacement);
300  theProductDisplacementVector[i] = RandDirection;
301  }
302  if(product->GetDefinition() == G4Electron_aq::Definition())
303  {
304  theProductDisplacementVector[i]=radialDistributionOfElectron();
305  }
306  }
307  }
308  else if(decayType == DissociativeAttachment)
309  {
310  if(fVerbose)
311  G4cout<<"DissociativeAttachment"<<G4endl;
312  G4double theRMSDisplacement = 0.8 * nanometer;
313  auto RandDirection =
314  radialDistributionOfProducts(theRMSDisplacement);
315 
316  G4int NbOfOH = 0;
317  for(G4int i =0; i < nbProducts; i++)
318  {
319  G4MolecularConfiguration* product = theDecayChannel->GetProduct(i);
320  if(product->GetDefinition() == G4H2::Definition())
321  {
322  theProductDisplacementVector[i] = -2./18.*RandDirection;
323  }
324  else if(product->GetDefinition() == G4OH::Definition())
325  {
326  G4ThreeVector OxygenDisplacement = +16./18.*RandDirection;
327  G4double OHRMSDisplacement = 1.1 * nanometer;
328 
329  auto OHDisplacement =
330  radialDistributionOfProducts(OHRMSDisplacement);
331 
332  if(NbOfOH==0)
333  {
334  OHDisplacement = 1./2.*OHDisplacement;
335  }
336  else
337  {
338  OHDisplacement = -1./2.*OHDisplacement;
339  }
340 
341  theProductDisplacementVector[i] = OHDisplacement + OxygenDisplacement;
342 
343  NbOfOH ++;
344  }
345  }
346  }
347 
348  return theProductDisplacementVector;
349 }
350 
351 //------------------------------------------------------------------------------
352 
356 {
357  static const double inverse_sqrt_3 = 1./sqrt(3.);
358  double sigma = Rrms*inverse_sqrt_3;
359  double x = G4RandGauss::shoot(0.,sigma);
360  double y = G4RandGauss::shoot(0.,sigma);
361  double z = G4RandGauss::shoot(0.,sigma);
362  return G4ThreeVector(x,y,z);
363 }
364 
365 //------------------------------------------------------------------------------
366 
369 {
370  G4double rand_value = G4UniformRand();
371  size_t nBins = fElectronThermalization.size();
372  size_t bin = size_t(rand_value*nBins);
374 }
The pointer G4MolecularConfiguration will be shared by all the molecules having the same molecule def...
ThreeVector shoot(const G4int Ap, const G4int Af)
static G4DLLIMPORT const DisplacementType AutoIonisation
static G4DLLIMPORT const DisplacementType B1A1_DissociationDecay
static G4Electron_aq * Definition()
static G4DLLIMPORT const DisplacementType A1B1_DissociationDecay
CLHEP::Hep3Vector G4ThreeVector
static G4DLLIMPORT const DisplacementType Ionisation_DissociationDecay
G4double z
Definition: TRTMaterials.hh:39
static const double nanometer
Definition: G4SIunits.hh:100
std::function< G4double(G4double)> fProba1DFunction
G4ThreeVector G4RandomDirection()
static const G4double eps
int G4int
Definition: G4Types.hh:78
static G4DLLIMPORT const DisplacementType DissociativeAttachment
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
static G4double ElectronProbaDistribution(G4double r)
G4MolecularConfiguration * GetProduct(int) const
static G4H3O * Definition()
Definition: G4H3O.cc:47
const G4double x[NPOINTSGL]
double Revert(double probaForSearchedTime, std::function< double(double)> &funct)
const G4MoleculeDefinition * GetDefinition() const
#define G4endl
Definition: G4ios.hh:61
static G4OH * Definition()
Definition: G4OH.cc:46
double G4double
Definition: G4Types.hh:76
static G4H2 * Definition()
Definition: G4H2.cc:46
virtual G4ThreeVector GetMotherMoleculeDisplacement(const G4MolecularDissociationChannel *) const
G4ThreeVector radialDistributionOfProducts(G4double r_rms) const
virtual std::vector< G4ThreeVector > GetProductsDisplacement(const G4MolecularDissociationChannel *) const
static G4Hydrogen * Definition()
Definition: G4Hydrogen.cc:46