Geant4  10.02.p03
G4DNAElectronHoleRecombination Class Reference

#include <G4DNAElectronHoleRecombination.hh>

Inheritance diagram for G4DNAElectronHoleRecombination:
Collaboration diagram for G4DNAElectronHoleRecombination:

Classes

struct  ReactionProfile
 
struct  State
 

Public Member Functions

 G4DNAElectronHoleRecombination ()
 
virtual ~G4DNAElectronHoleRecombination ()
 
void Create ()
 
void StartTracking (G4Track *)
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual G4VParticleChange * AtRestDoIt (const G4Track &, const G4Step &)
 
virtual G4VParticleChange * PostStepDoIt (const G4Track &, const G4Step &)
 
virtual G4double GetMeanFreePath (const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4double GetMeanLifeTime (const G4Track &aTrack, G4ForceCondition *condition)
 

Private Member Functions

G4bool FindReactant (const G4Track &track)
 
void MakeReaction (const G4Track &track)
 

Private Attributes

const std::vector< double > * fpMoleculeDensity
 
G4ParticleChange fParticleChange
 
G4bool fIsInitialized
 
std::map< int, std::pair< double, double > > fOnsagerRadiusPerMaterial
 

Detailed Description

Definition at line 38 of file G4DNAElectronHoleRecombination.hh.

Constructor & Destructor Documentation

◆ G4DNAElectronHoleRecombination()

G4DNAElectronHoleRecombination::G4DNAElectronHoleRecombination ( )

Definition at line 105 of file G4DNAElectronHoleRecombination.cc.

105  :
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 }
Here is the call graph for this function:

◆ ~G4DNAElectronHoleRecombination()

G4DNAElectronHoleRecombination::~G4DNAElectronHoleRecombination ( )
virtual

Definition at line 116 of file G4DNAElectronHoleRecombination.cc.

117 {
118 }

Member Function Documentation

◆ AtRestDoIt()

G4VParticleChange * G4DNAElectronHoleRecombination::AtRestDoIt ( const G4Track &  track,
const G4Step &   
)
virtual

Definition at line 143 of file G4DNAElectronHoleRecombination.cc.

145 {
146  fParticleChange.Initialize(track);
147  ClearInteractionTimeLeft();
148  ClearNumberOfInteractionLengthLeft();
150  return &fParticleChange;
151 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildPhysicsTable()

virtual void G4DNAElectronHoleRecombination::BuildPhysicsTable ( const G4ParticleDefinition )
inlinevirtual

Definition at line 49 of file G4DNAElectronHoleRecombination.hh.

49 {}
Here is the call graph for this function:

◆ Create()

void G4DNAElectronHoleRecombination::Create ( )

Definition at line 120 of file G4DNAElectronHoleRecombination.cc.

121 {
122  pParticleChange = &fParticleChange;
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 }
const std::vector< double > * fpMoleculeDensity
void SetInstantiateProcessState(G4bool flag)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindReactant()

G4bool G4DNAElectronHoleRecombination::FindReactant ( const G4Track &  track)
private

Definition at line 218 of file G4DNAElectronHoleRecombination.cc.

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 
243  ->FindNearestInRange(track.GetPosition(),
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 }
static double onsager_constant
static G4Electron_aq * Definition()
#define State(X)
static G4ITFinder * Instance()
static const G4double eps
G4KDTreeResultHandle FindNearestInRange(const T *point, int key, G4double)
G4double density
Definition: TRTMaterials.hh:39
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
const std::vector< double > * GetDensityTableFor(const G4Material *) const
G4Molecule * GetMolecule(const G4Track &track)
Definition: G4Molecule.cc:69
static G4DNAMolecularMaterial * Instance()
#define G4endl
Definition: G4ios.hh:61
static const double m
Definition: G4SIunits.hh:128
{ Class description:
double epsilon(double density, double temperature)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMeanFreePath()

G4double G4DNAElectronHoleRecombination::GetMeanFreePath ( const G4Track &  aTrack,
G4double  previousStepSize,
G4ForceCondition *  condition 
)
virtual

Definition at line 383 of file G4DNAElectronHoleRecombination.cc.

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 }
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMeanLifeTime()

G4double G4DNAElectronHoleRecombination::GetMeanLifeTime ( const G4Track &  aTrack,
G4ForceCondition *  condition 
)
virtual

Definition at line 402 of file G4DNAElectronHoleRecombination.cc.

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 }
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsApplicable()

G4bool G4DNAElectronHoleRecombination::IsApplicable ( const G4ParticleDefinition particle)
virtual

Definition at line 305 of file G4DNAElectronHoleRecombination.cc.

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 }
G4MoleculeDefinition * GetMoleculeDefinition(const G4String &, bool mustExist=true)
static G4H2O * Definition()
Definition: G4H2O.cc:46
void AddDecayChannel(const G4MolecularConfiguration *molConf, const G4MolecularDissociationChannel *channel)
G4MolecularConfiguration * NewConfiguration(const G4String &excitedStateLabel)
const G4String & GetParticleName() const
void AddProduct(const G4Molecule *, G4double=0)
static G4MoleculeTable * Instance()
G4bool IsMasterThread()
Definition: G4Threading.cc:136
G4MolecularConfiguration * GetConfiguration(const G4String &, bool mustExist=true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeReaction()

void G4DNAElectronHoleRecombination::MakeReaction ( const G4Track &  track)
private

Definition at line 164 of file G4DNAElectronHoleRecombination.cc.

165 {
166  fParticleChange.Initialize(track);
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());
196 
199  AddAMoleculeAtTime(GetMolecule(track)->GetMolecularConfiguration(),
200  track.GetGlobalTime());
201 
202  // fParticleChange.ProposeTrackStatus(fStopAndKill);
203  fParticleChange.ProposeTrackStatus(fStopButAlive);
204 
205  selected_reactant->SetTrackStatus(fStopAndKill);
206  // G4TrackList::Pop(selected_reactant);
207  // G4ITTrackHolder::Instance()->PushToKill(selected_reactant);
208 
209  }
210  else
211  {
212  fParticleChange.ProposeTrackStatus(fStopButAlive);
213  }
214 }
#define State(X)
void ChangeConfigurationToLabel(const G4String &label)
Definition: G4Molecule.cc:600
static G4bool InUse()
static G4MoleculeCounter * Instance()
G4Molecule * GetMolecule(const G4Track &track)
Definition: G4Molecule.cc:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PostStepDoIt()

G4VParticleChange * G4DNAElectronHoleRecombination::PostStepDoIt ( const G4Track &  track,
const G4Step &  step 
)
virtual

Definition at line 418 of file G4DNAElectronHoleRecombination.cc.

420 {
421  return AtRestDoIt(track, step);
422 }
virtual G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartTracking()

void G4DNAElectronHoleRecombination::StartTracking ( G4Track *  track)

Definition at line 155 of file G4DNAElectronHoleRecombination.cc.

156 {
158  G4VITProcess::fpState.reset(new State());
160 }
#define State(X)
virtual void StartTracking(G4Track *)
Definition: G4VProcess.cc:101
virtual void StartTracking(G4Track *)
Definition: G4VITProcess.cc:86
G4shared_ptr< G4ProcessState > fpState
Here is the call graph for this function:

Member Data Documentation

◆ fIsInitialized

G4bool G4DNAElectronHoleRecombination::fIsInitialized
private

Definition at line 107 of file G4DNAElectronHoleRecombination.hh.

◆ fOnsagerRadiusPerMaterial

std::map<int, std::pair<double, double> > G4DNAElectronHoleRecombination::fOnsagerRadiusPerMaterial
private

Definition at line 108 of file G4DNAElectronHoleRecombination.hh.

◆ fParticleChange

G4ParticleChange G4DNAElectronHoleRecombination::fParticleChange
private

Definition at line 106 of file G4DNAElectronHoleRecombination.hh.

◆ fpMoleculeDensity

const std::vector<double>* G4DNAElectronHoleRecombination::fpMoleculeDensity
private

Definition at line 105 of file G4DNAElectronHoleRecombination.hh.


The documentation for this class was generated from the following files: