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