Geant4  10.00.p02
G4AntiNeutronAnnihilationAtRest.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: G4AntiNeutronAnnihilationAtRest.cc 81888 2014-06-06 13:17:25Z gcosmo $
27 // G4AntiNeutronAnnihilationAtRest physics process
28 // Larry Felawka (TRIUMF), April 1998
29 //---------------------------------------------------------------------
30 
31 //#include <string.h>
32 //#include <cmath>
33 //#include <stdio.h>
34 
36 #include "G4SystemOfUnits.hh"
37 #include "G4DynamicParticle.hh"
38 #include "G4ParticleTypes.hh"
40 #include "G4HadronicDeprecate.hh"
41 #include "Randomize.hh"
42 
43 #define MAX_SECONDARIES 100
44 
45 // constructor
46 
48  G4ProcessType aType) :
49  G4VRestProcess (processName, aType), // initialization
50  massPionMinus(G4PionMinus::PionMinus()->GetPDGMass()/GeV),
51  massPionZero(G4PionZero::PionZero()->GetPDGMass()/GeV),
52  massPionPlus(G4PionPlus::PionPlus()->GetPDGMass()/GeV),
53  massGamma(G4Gamma::Gamma()->GetPDGMass()/GeV),
54  massAntiNeutron(G4AntiNeutron::AntiNeutron()->GetPDGMass()/GeV),
55  massNeutron(G4Neutron::Neutron()->GetPDGMass()/GeV),
56  pdefGamma(G4Gamma::Gamma()),
57  pdefPionPlus(G4PionPlus::PionPlus()),
58  pdefPionZero(G4PionZero::PionZero()),
59  pdefPionMinus(G4PionMinus::PionMinus()),
60  pdefProton(G4Proton::Proton()),
61  pdefNeutron(G4Neutron::Neutron()),
62  pdefAntiNeutron(G4AntiNeutron::AntiNeutron()),
63  pdefDeuteron(G4Deuteron::Deuteron()),
64  pdefTriton(G4Triton::Triton()),
65  pdefAlpha(G4Alpha::Alpha())
66 {
67  G4HadronicDeprecate("G4AntiNeutronAnnihilationAtRest");
68  if (verboseLevel>0) {
69  G4cout << GetProcessName() << " is created "<< G4endl;
70  }
75 
78  = evapEnergy3 = 0.0;
79  ngkine = ntot = 0;
80 }
81 
82 // destructor
83 
85 {
87  delete [] pv;
88  delete [] eve;
89  delete [] gkin;
90 }
91 
93 {
95 }
96 
98 {
100 }
101 
102 // methods.............................................................................
103 
105  const G4ParticleDefinition& particle
106  )
107 {
108  return ( &particle == pdefAntiNeutron );
109 
110 }
111 
112 // Warning - this method may be optimized away if made "inline"
114 {
115  return ( ngkine );
116 
117 }
118 
119 // Warning - this method may be optimized away if made "inline"
121 {
122  return ( &gkin[0] );
123 
124 }
125 
127  const G4Track& track,
129  )
130 {
131  // beggining of tracking
133 
134  // condition is set to "Not Forced"
135  *condition = NotForced;
136 
137  // get mean life time
138  currentInteractionLength = GetMeanLifeTime(track, condition);
139 
140  if ((currentInteractionLength <0.0) || (verboseLevel>2)){
141  G4cout << "G4AntiNeutronAnnihilationAtRestProcess::AtRestGetPhysicalInteractionLength ";
142  G4cout << "[ " << GetProcessName() << "]" <<G4endl;
143  track.GetDynamicParticle()->DumpInfo();
144  G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl;
145  G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl;
146  }
147 
149 
150 }
151 
153  const G4Track& track,
154  const G4Step&
155  )
156 //
157 // Handles AntiNeutrons at rest; an AntiNeutron can either create secondaries
158 // or do nothing (in which case it should be sent back to decay-handling
159 // section
160 //
161 {
162 
163 // Initialize ParticleChange
164 // all members of G4VParticleChange are set to equal to
165 // corresponding member in G4Track
166 
168 
169 // Store some global quantities that depend on current material and particle
170 
171  globalTime = track.GetGlobalTime()/s;
172  G4Material * aMaterial = track.GetMaterial();
173  const G4int numberOfElements = aMaterial->GetNumberOfElements();
174  const G4ElementVector* theElementVector = aMaterial->GetElementVector();
175 
176  const G4double* theAtomicNumberDensity = aMaterial->GetAtomicNumDensityVector();
177  G4double normalization = 0;
178  for ( G4int i1=0; i1 < numberOfElements; i1++ )
179  {
180  normalization += theAtomicNumberDensity[i1] ; // change when nucleon specific
181  // probabilities are included.
182  }
183  G4double runningSum= 0.;
184  G4double random = G4UniformRand()*normalization;
185  for ( G4int i2=0; i2 < numberOfElements; i2++ )
186  {
187  runningSum += theAtomicNumberDensity[i2]; // change when nucleon specific
188  // probabilities are included.
189  if (random<=runningSum)
190  {
191  targetCharge = G4double( ((*theElementVector)[i2])->GetZ());
192  targetAtomicMass = (*theElementVector)[i2]->GetN();
193  }
194  }
195  if (random>runningSum)
196  {
197  targetCharge = G4double( ((*theElementVector)[numberOfElements-1])->GetZ());
198  targetAtomicMass = (*theElementVector)[numberOfElements-1]->GetN();
199  }
200 
201  if (verboseLevel>1) {
202  G4cout << "G4AntiNeutronAnnihilationAtRest::AtRestDoIt is invoked " <<G4endl;
203  }
204 
205  G4ParticleMomentum momentum;
206  G4float localtime;
207 
209 
210  GenerateSecondaries(); // Generate secondaries
211 
213 
214  for ( G4int isec = 0; isec < ngkine; isec++ ) {
215  G4DynamicParticle* aNewParticle = new G4DynamicParticle;
216  aNewParticle->SetDefinition( gkin[isec].GetParticleDef() );
217  aNewParticle->SetMomentum( gkin[isec].GetMomentum() * GeV );
218 
219  localtime = globalTime + gkin[isec].GetTOF();
220 
221  G4Track* aNewTrack = new G4Track( aNewParticle, localtime*s, position );
222  aNewTrack->SetTouchableHandle(track.GetTouchableHandle());
223  aParticleChange.AddSecondary( aNewTrack );
224 
225  }
226 
228 
229  aParticleChange.ProposeTrackStatus(fStopAndKill); // Kill the incident AntiNeutron
230 
231 // clear InteractionLengthLeft
232 
234 
235  return &aParticleChange;
236 
237 }
238 
239 
241 {
242  static G4ThreadLocal G4int index;
243  static G4ThreadLocal G4int l;
244  static G4ThreadLocal G4int nopt;
245  static G4ThreadLocal G4int i;
246  // DHW 15 May 2011: unused: static G4ParticleDefinition* jnd;
247 
248  for (i = 1; i <= MAX_SECONDARIES; ++i) {
249  pv[i].SetZero();
250  }
251 
252 
253  ngkine = 0; // number of generated secondary particles
254  ntot = 0;
255  result.SetZero();
258  result.SetTOF( 0. );
260 
261  // *** SELECT PROCESS FOR CURRENT PARTICLE ***
262 
264 
265  // *** CHECK WHETHER THERE ARE NEW PARTICLES GENERATED ***
266  if (ntot != 0 || result.GetParticleDef() != pdefAntiNeutron) {
267  // *** CURRENT PARTICLE IS NOT THE SAME AS IN THE BEGINNING OR/AND ***
268  // *** ONE OR MORE SECONDARIES HAVE BEEN GENERATED ***
269 
270  // --- INITIAL PARTICLE TYPE HAS BEEN CHANGED ==> PUT NEW TYPE ON ---
271  // --- THE GEANT TEMPORARY STACK ---
272 
273  // --- PUT PARTICLE ON THE STACK ---
274  gkin[0] = result;
275  gkin[0].SetTOF( result.GetTOF() * 5e-11 );
276  ngkine = 1;
277 
278  // --- ALL QUANTITIES ARE TAKEN FROM THE GHEISHA STACK WHERE THE ---
279  // --- CONVENTION IS THE FOLLOWING ---
280 
281  // --- ONE OR MORE SECONDARIES HAVE BEEN GENERATED ---
282  for (l = 1; l <= ntot; ++l) {
283  index = l - 1;
284  // DHW 15 May 2011: unused: jnd = eve[index].GetParticleDef();
285 
286  // --- ADD PARTICLE TO THE STACK IF STACK NOT YET FULL ---
287  if (ngkine < MAX_SECONDARIES) {
288  gkin[ngkine] = eve[index];
289  gkin[ngkine].SetTOF( eve[index].GetTOF() * 5e-11 );
290  ++ngkine;
291  }
292  }
293  }
294  else {
295  // --- NO SECONDARIES GENERATED AND PARTICLE IS STILL THE SAME ---
296  // --- ==> COPY EVERYTHING BACK IN THE CURRENT GEANT STACK ---
297  ngkine = 0;
298  ntot = 0;
299  globalTime += result.GetTOF() * G4float(5e-11);
300  }
301 
302  // --- LIMIT THE VALUE OF NGKINE IN CASE OF OVERFLOW ---
304 
305 } // GenerateSecondaries
306 
307 
309 {
310  static G4ThreadLocal G4int i;
311  static G4ThreadLocal G4float r, p1, p2, p3;
312  static G4ThreadLocal G4int fivex;
313  static G4ThreadLocal G4float rr, ran, rrr, ran1;
314 
315  // *** GENERATION OF POISSON DISTRIBUTION ***
316  // *** NVE 16-MAR-1988 CERN GENEVA ***
317  // ORIGIN : H.FESEFELDT (27-OCT-1983)
318 
319  // --- USE NORMAL DISTRIBUTION FOR <X> > 9.9 ---
320  if (xav > G4float(9.9)) {
321  // ** NORMAL DISTRIBUTION WITH SIGMA**2 = <X>
322  Normal(&ran1);
323  ran1 = xav + ran1 * std::sqrt(xav);
324  *iran = G4int(ran1);
325  if (*iran < 0) {
326  *iran = 0;
327  }
328  }
329  else {
330  fivex = G4int(xav * G4float(5.));
331  *iran = 0;
332  if (fivex > 0) {
333  r = std::exp(-G4double(xav));
334  ran1 = G4UniformRand();
335  if (ran1 > r) {
336  rr = r;
337  for (i = 1; i <= fivex; ++i) {
338  ++(*iran);
339  if (i <= 5) {
340  rrr = std::pow(xav, G4float(i)) / NFac(i);
341  }
342  // ** STIRLING' S FORMULA FOR LARGE NUMBERS
343  if (i > 5) {
344  rrr = std::exp(i * std::log(xav) -
345  (i + G4float(.5)) * std::log(i * G4float(1.)) +
346  i - G4float(.9189385));
347  }
348  rr += r * rrr;
349  if (ran1 <= rr) {
350  break;
351  }
352  }
353  }
354  }
355  else {
356  // ** FOR VERY SMALL XAV TRY IRAN=1,2,3
357  p1 = xav * std::exp(-G4double(xav));
358  p2 = xav * p1 / G4float(2.);
359  p3 = xav * p2 / G4float(3.);
360  ran = G4UniformRand();
361  if (ran >= p3) {
362  if (ran >= p2) {
363  if (ran >= p1) {
364  *iran = 0;
365  }
366  else {
367  *iran = 1;
368  }
369  }
370  else {
371  *iran = 2;
372  }
373  }
374  else {
375  *iran = 3;
376  }
377  }
378  }
379 
380 } // Poisso
381 
382 
384 {
385  G4int ret_val;
386 
387  static G4ThreadLocal G4int i, j;
388 
389  // *** NVE 16-MAR-1988 CERN GENEVA ***
390  // ORIGIN : H.FESEFELDT (27-OCT-1983)
391 
392  ret_val = 1;
393  j = n;
394  if (j > 1) {
395  if (j > 10) {
396  j = 10;
397  }
398  for (i = 2; i <= j; ++i) {
399  ret_val *= i;
400  }
401  }
402  return ret_val;
403 
404 } // NFac
405 
406 
408 {
409  static G4ThreadLocal G4int i;
410 
411  // *** NVE 14-APR-1988 CERN GENEVA ***
412  // ORIGIN : H.FESEFELDT (27-OCT-1983)
413 
414  *ran = G4float(-6.);
415  for (i = 1; i <= 12; ++i) {
416  *ran += G4UniformRand();
417  }
418 
419 } // Normal
420 
421 
423 {
424  static G4ThreadLocal G4float brr[3] = { G4float(.125),G4float(.25),G4float(.5) };
425 
426  G4float r__1;
427 
428  static G4ThreadLocal G4int i, ii, kk;
429  static G4ThreadLocal G4int nt;
430  static G4ThreadLocal G4float cfa, eka;
431  static G4ThreadLocal G4int ika, nbl;
432  static G4ThreadLocal G4float ran, pcm;
433  static G4ThreadLocal G4int isw;
434  static G4ThreadLocal G4float tex;
435  static G4ThreadLocal G4ParticleDefinition* ipa1;
436  static G4ThreadLocal G4float ran1, ran2, ekin, tkin;
437  static G4ThreadLocal G4float targ;
438  static G4ThreadLocal G4ParticleDefinition* inve;
439  static G4ThreadLocal G4float ekin1, ekin2, black;
440  static G4ThreadLocal G4float pnrat, rmnve1, rmnve2;
441  static G4ThreadLocal G4float ek, en;
442 
443  // *** ANTI NEUTRON ANNIHILATION AT REST ***
444  // *** NVE 04-MAR-1988 CERN GENEVA ***
445  // ORIGIN : H.FESEFELDT (09-JULY-1987)
446 
447  // NOPT=0 NO ANNIHILATION
448  // NOPT=1 ANNIH.IN PI+ PI-
449  // NOPT=2 ANNIH.IN PI0 PI0
450  // NOPT=3 ANNIH.IN PI+ PI0
451  // NOPT=4 ANNIH.IN GAMMA GAMMA
452 
453  pv[1].SetZero();
454  pv[1].SetMass( massAntiNeutron );
455  pv[1].SetKineticEnergyAndUpdate( 0. );
456  pv[1].SetTOF( result.GetTOF() );
458  isw = 1;
459  ran = G4UniformRand();
460  if (ran > brr[0]) {
461  isw = 2;
462  }
463  if (ran > brr[1]) {
464  isw = 3;
465  }
466  if (ran > brr[2]) {
467  isw = 4;
468  }
469  *nopt = isw;
470  // **
471  // ** EVAPORATION
472  // **
473  rmnve1 = massPionPlus;
474  rmnve2 = massPionMinus;
475  if (isw == 2) {
476  rmnve1 = massPionZero;
477  }
478  if (isw == 2) {
479  rmnve2 = massPionZero;
480  }
481  if (isw == 3) {
482  rmnve2 = massPionZero;
483  }
484  if (isw == 4) {
485  rmnve1 = massGamma;
486  }
487  if (isw == 4) {
488  rmnve2 = massGamma;
489  }
490  ek = massNeutron + massAntiNeutron - rmnve1 - rmnve2;
491  tkin = ExNu(ek);
492  ek -= tkin;
493  if (ek < G4float(1e-4)) {
494  ek = G4float(1e-4);
495  }
496  ek /= G4float(2.);
497  en = ek + (rmnve1 + rmnve2) / G4float(2.);
498  r__1 = en * en - rmnve1 * rmnve2;
499  pcm = r__1 > 0 ? std::sqrt(r__1) : 0;
500  pv[2].SetZero();
501  pv[2].SetMass( rmnve1 );
502  pv[3].SetZero();
503  pv[3].SetMass( rmnve2 );
504  if (isw > 3) {
505  pv[2].SetMass( 0. );
506  pv[3].SetMass( 0. );
507  }
508  pv[2].SetEnergyAndUpdate( std::sqrt(pv[2].GetMass()*pv[2].GetMass()+pcm*pcm) );
509  pv[2].SetTOF( result.GetTOF() );
510  pv[3].SetEnergy( std::sqrt(pv[3].GetMass()*pv[3].GetMass()+pcm*pcm) );
511  pv[3].SetMomentumAndUpdate( -pv[2].GetMomentum().x(), -pv[2].GetMomentum().y(), -pv[2].GetMomentum().z() );
512  pv[3].SetTOF( result.GetTOF() );
513  switch ((int)isw) {
514  case 1:
517  break;
518  case 2:
521  break;
522  case 3:
525  break;
526  case 4:
529  break;
530  default:
531  break;
532  }
533  nt = 3;
534  if (targetAtomicMass >= G4float(1.5)) {
535  cfa = (targetAtomicMass - G4float(1.)) / G4float(120.) *
536  G4float(.025) * std::exp(-G4double(targetAtomicMass - G4float(1.)) /
537  G4float(120.));
538  targ = G4float(1.);
539  tex = evapEnergy1;
540  if (tex >= G4float(.001)) {
541  black = (targ * G4float(1.25) +
543  Poisso(black, &nbl);
544  if (G4float(G4int(targ) + nbl) > targetAtomicMass) {
545  nbl = G4int(targetAtomicMass - targ);
546  }
547  if (nt + nbl > (MAX_SECONDARIES - 2)) {
548  nbl = (MAX_SECONDARIES - 2) - nt;
549  }
550  if (nbl > 0) {
551  ekin = tex / nbl;
552  ekin2 = G4float(0.);
553  for (i = 1; i <= nbl; ++i) {
554  if (nt == (MAX_SECONDARIES - 2)) {
555  continue;
556  }
557  if (ekin2 > tex) {
558  break;
559  }
560  ran1 = G4UniformRand();
561  Normal(&ran2);
562  ekin1 = -G4double(ekin) * std::log(ran1) -
563  cfa * (ran2 * G4float(.5) + G4float(1.));
564  if (ekin1 < G4float(0.)) {
565  ekin1 = std::log(ran1) * G4float(-.01);
566  }
567  ekin1 *= G4float(1.);
568  ekin2 += ekin1;
569  if (ekin2 > tex) {
570  ekin1 = tex - (ekin2 - ekin1);
571  }
572  if (ekin1 < G4float(0.)) {
573  ekin1 = G4float(.001);
574  }
575  ipa1 = pdefNeutron;
576  pnrat = G4float(1.) - targetCharge / targetAtomicMass;
577  if (G4UniformRand() > pnrat) {
578  ipa1 = pdefProton;
579  }
580  ++nt;
581  pv[nt].SetZero();
582  pv[nt].SetMass( ipa1->GetPDGMass()/GeV );
583  pv[nt].SetKineticEnergyAndUpdate( ekin1 );
584  pv[nt].SetTOF( result.GetTOF() );
585  pv[nt].SetParticleDef( ipa1 );
586  }
587  if (targetAtomicMass >= G4float(230.) && ek <= G4float(2.)) {
588  ii = nt + 1;
589  kk = 0;
590  eka = ek;
591  if (eka > G4float(1.)) {
592  eka *= eka;
593  }
594  if (eka < G4float(.1)) {
595  eka = G4float(.1);
596  }
597  ika = G4int(G4float(3.6) / eka);
598  for (i = 1; i <= nt; ++i) {
599  --ii;
600  if (pv[ii].GetParticleDef() != pdefProton) {
601  continue;
602  }
603  ipa1 = pdefNeutron;
604  pv[ii].SetMass( ipa1->GetPDGMass()/GeV );
605  pv[ii].SetParticleDef( ipa1 );
606  ++kk;
607  if (kk > ika) {
608  break;
609  }
610  }
611  }
612  }
613  }
614  // **
615  // ** THEN ALSO DEUTERONS, TRITONS AND ALPHAS
616  // **
617  tex = evapEnergy3;
618  if (tex >= G4float(.001)) {
619  black = (targ * G4float(1.25) + G4float(1.5)) * evapEnergy3 /
621  Poisso(black, &nbl);
622  if (nt + nbl > (MAX_SECONDARIES - 2)) {
623  nbl = (MAX_SECONDARIES - 2) - nt;
624  }
625  if (nbl > 0) {
626  ekin = tex / nbl;
627  ekin2 = G4float(0.);
628  for (i = 1; i <= nbl; ++i) {
629  if (nt == (MAX_SECONDARIES - 2)) {
630  continue;
631  }
632  if (ekin2 > tex) {
633  break;
634  }
635  ran1 = G4UniformRand();
636  Normal(&ran2);
637  ekin1 = -G4double(ekin) * std::log(ran1) -
638  cfa * (ran2 * G4float(.5) + G4float(1.));
639  if (ekin1 < G4float(0.)) {
640  ekin1 = std::log(ran1) * G4float(-.01);
641  }
642  ekin1 *= G4float(1.);
643  ekin2 += ekin1;
644  if (ekin2 > tex) {
645  ekin1 = tex - (ekin2 - ekin1);
646  }
647  if (ekin1 < G4float(0.)) {
648  ekin1 = G4float(.001);
649  }
650  ran = G4UniformRand();
651  inve = pdefDeuteron;
652  if (ran > G4float(.6)) {
653  inve = pdefTriton;
654  }
655  if (ran > G4float(.9)) {
656  inve = pdefAlpha;
657  }
658  ++nt;
659  pv[nt].SetZero();
660  pv[nt].SetMass( inve->GetPDGMass()/GeV );
661  pv[nt].SetKineticEnergyAndUpdate( ekin1 );
662  pv[nt].SetTOF( result.GetTOF() );
663  pv[nt].SetParticleDef( inve );
664  }
665  }
666  }
667  }
668  result = pv[2];
669  if (nt == 2) {
670  return;
671  }
672  for (i = 3; i <= nt; ++i) {
673  if (ntot >= MAX_SECONDARIES) {
674  return;
675  }
676  eve[ntot++] = pv[i];
677  }
678 
679 } // AntiNeutronAnnihilation
680 
681 
683 {
684  G4float ret_val, r__1;
685 
686  static G4ThreadLocal G4float cfa, gfa, ran1, ran2, ekin1, atno3;
687  static G4ThreadLocal G4int magic;
688  static G4ThreadLocal G4float fpdiv;
689 
690  // *** NUCLEAR EVAPORATION AS FUNCTION OF ATOMIC NUMBER ATNO ***
691  // *** AND KINETIC ENERGY EKIN OF PRIMARY PARTICLE ***
692  // *** NVE 04-MAR-1988 CERN GENEVA ***
693  // ORIGIN : H.FESEFELDT (10-DEC-1986)
694 
695  ret_val = G4float(0.);
696  if (targetAtomicMass >= G4float(1.5)) {
697  magic = 0;
698  if (G4int(targetCharge + G4float(.1)) == 82) {
699  magic = 1;
700  }
701  ekin1 = ek1;
702  if (ekin1 < G4float(.1)) {
703  ekin1 = G4float(.1);
704  }
705  if (ekin1 > G4float(4.)) {
706  ekin1 = G4float(4.);
707  }
708  // ** 0.35 VALUE AT 1 GEV
709  // ** 0.05 VALUE AT 0.1 GEV
710  cfa = G4float(.13043478260869565);
711  cfa = cfa * std::log(ekin1) + G4float(.35);
712  if (cfa < G4float(.15)) {
713  cfa = G4float(.15);
714  }
715  ret_val = cfa * G4float(7.716) * std::exp(-G4double(cfa));
716  atno3 = targetAtomicMass;
717  if (atno3 > G4float(120.)) {
718  atno3 = G4float(120.);
719  }
720  cfa = (atno3 - G4float(1.)) /
721  G4float(120.) * std::exp(-G4double(atno3 - G4float(1.)) / G4float(120.));
722  ret_val *= cfa;
723  r__1 = ekin1;
724  fpdiv = G4float(1.) - r__1 * r__1 * G4float(.25);
725  if (fpdiv < G4float(.5)) {
726  fpdiv = G4float(.5);
727  }
728  gfa = (targetAtomicMass - G4float(1.)) /
729  G4float(70.) * G4float(2.) *
730  std::exp(-G4double(targetAtomicMass - G4float(1.)) / G4float(70.));
731  evapEnergy1 = ret_val * fpdiv;
732  evapEnergy3 = ret_val - evapEnergy1;
733  Normal(&ran1);
734  Normal(&ran2);
735  if (magic == 1) {
736  ran1 = G4float(0.);
737  ran2 = G4float(0.);
738  }
739  evapEnergy1 *= ran1 * gfa + G4float(1.);
740  if (evapEnergy1 < G4float(0.)) {
741  evapEnergy1 = G4float(0.);
742  }
743  evapEnergy3 *= ran2 * gfa + G4float(1.);
744  if (evapEnergy3 < G4float(0.)) {
745  evapEnergy3 = G4float(0.);
746  }
747  while ((ret_val = evapEnergy1 + evapEnergy3) >= ek1) {
748  evapEnergy1 *= G4float(1.) - G4UniformRand() * G4float(.5);
749  evapEnergy3 *= G4float(1.) - G4UniformRand() * G4float(.5);
750  }
751  }
752  return ret_val;
753 
754 } // ExNu
G4double condition(const G4ErrorSymMatrix &m)
void DeRegisterExtraProcess(G4VProcess *)
G4double GetMeanLifeTime(const G4Track &, G4ForceCondition *)
void SetParticleDef(G4ParticleDefinition *c)
void SetMomentum(const G4ThreeVector &momentum)
G4int verboseLevel
Definition: G4VProcess.hh:368
std::vector< G4Element * > G4ElementVector
G4AntiNeutronAnnihilationAtRest(const G4AntiNeutronAnnihilationAtRest &)
CLHEP::Hep3Vector G4ThreeVector
static G4HadronicProcessStore * Instance()
const G4DynamicParticle * GetDynamicParticle() const
G4double z
Definition: TRTMaterials.hh:39
G4ParticleDefinition * GetParticleDef()
const G4String & GetName() const
Definition: G4Material.hh:176
float G4float
Definition: G4Types.hh:77
const G4ThreeVector & GetPosition() const
void DumpInfo(G4int mode=0) const
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
void SetTouchableHandle(const G4TouchableHandle &apValue)
void BuildPhysicsTable(const G4ParticleDefinition &)
virtual void ResetNumberOfInteractionLengthLeft()
Definition: G4VProcess.cc:95
#define G4ThreadLocal
Definition: tls.hh:52
#define G4HadronicDeprecate(name)
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:188
int G4int
Definition: G4Types.hh:78
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetKineticEnergyAndUpdate(G4double ekin)
static const double s
Definition: G4SIunits.hh:150
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
void RegisterParticleForExtraProcess(G4VProcess *, const G4ParticleDefinition *)
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
#define MAX_SECONDARIES
bool G4bool
Definition: G4Types.hh:79
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
G4double currentInteractionLength
Definition: G4VProcess.hh:297
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:432
static const double GeV
Definition: G4SIunits.hh:196
Definition: G4Step.hh:76
const G4int n
G4double GetGlobalTime() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4double * GetAtomicNumDensityVector() const
Definition: G4Material.hh:214
const G4TouchableHandle & GetTouchableHandle() const
G4Material * GetMaterial() const
void SetEnergyAndUpdate(G4double e)
void RegisterExtraProcess(G4VProcess *)
G4bool IsApplicable(const G4ParticleDefinition &)
void PreparePhysicsTable(const G4ParticleDefinition &)
virtual void Initialize(const G4Track &)
void SetMomentumAndUpdate(G4ParticleMomentum mom)
void SetNumberOfSecondaries(G4int totSecondaries)
int position
Definition: filter.cc:7
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:289
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void AddSecondary(G4Track *aSecondary)
#define G4endl
Definition: G4ios.hh:61
size_t GetNumberOfElements() const
Definition: G4Material.hh:184
double G4double
Definition: G4Types.hh:76
void ProposeTrackStatus(G4TrackStatus status)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ForceCondition
G4ThreeVector G4ParticleMomentum
#define ns
Definition: xmlparse.cc:597
void PrintInfo(const G4ParticleDefinition *)
G4ProcessType