/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/gen/include/RAT/Decay0.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/gen/include/RAT/Decay0.hh Source File
Ratpac-two
Decay0.hh
1 
60 #ifndef __RAT_Decay0__
61 #define __RAT_Decay0__
62 
63 #include <complex>
64 #include <iostream>
65 
66 #include "G4ParticleDefinition.hh"
67 #include "G4ParticleTable.hh"
68 #include "RAT/DB.hh"
69 #include "Randomize.hh"
70 #include "TF1.h"
71 
72 /***************
73  GEANT number for particle identification:
74  1 - gamma 2 - positron 3 - electron 47 - alpha
75 **************/
76 
77 namespace RAT {
78 
79 class Decay0 {
80  public:
81  Decay0();
82  Decay0(const std::string isotope, const int level, const int mode, const double lE, const double hE);
83  Decay0(const std::string isotope);
84  ~Decay0();
85 
86  void GenBBTest();
87  void GenBackgTest();
88  void GenBBDeex();
89  void GenEvent();
90  double GetRandom();
91  G4ParticleDefinition *fPartDef;
92  double GetMass(int pdg); // get mass of particle from GEANT
93 
97  void bb();
100  void particle(int np, double E1, double E2, double teta1, double teta2, double phi1, double phi2, double tclev,
101  double thlev);
105  void pair(double Epair);
107  double fe1_mod();
108  double fe2_mod();
111  double fermi(const double &Z, const double &E);
114  void beta(double Qbeta, double tcnuc, double thnuc);
115  void beta1f(double Qbeta, double tcnuc, double thnuc, double c1, double c2, double c3, double c4);
116  void beta1fu(double Qbeta, double tcnuc, double thnuc, double c1, double c2, double c3, double c4);
117  void beta2f(double Qbeta, double tcnuc, double thnuc, int kf, double c1, double c2, double c3, double c4);
120  void tgold(double a, double b, TF1 &f, double eps, int nmin, double &xextt, double &fextr);
122 
127  void Ti48low();
128  void Fe58low();
129  void Se76low();
130  void Ge74low();
131  void Kr82low();
132  void Mo96low();
133  void Zr92low();
134  void Ru100low();
135  void Pd106low();
136  void Sn116low();
137  void Cd112low();
138  void Te124low();
139  void Xe130low();
140  void Ba136low();
141  void Sm148low();
142  void Sm150low();
143 
145  void As79();
146  void At214();
147  void Ac228();
148  void Bi207();
149  void Bi210();
150  void Bi212();
151  void Bi214();
152  void Co60();
153  void Cs136();
154  void Eu147();
155  void Eu152();
156  void Eu154();
157  void Gd146();
158  void I126();
159  void I133();
160  void I134();
161  void I135();
162  void K40();
163  void K42();
164  void Pa234m();
165  void Pb211();
166  void Pb212();
167  void Pb214();
168  void Po214();
169  void Rn218();
170  void Ra222();
171  void Ra228();
172  void Rh106();
173  void Sb125();
174  void Sb126();
175  void Sb133();
176  void Sc48();
177  void Ta182();
178  void Te133();
179  void Te133m();
180  void Te134();
181  void Th234();
182  void Tl208();
183  void Xe133();
184  void Xe135();
185  void Y88();
186  void Zn65();
187  void Nb96();
188  void Be11();
189 
192  void PbAtShell(int KLMenergy);
194 
195  //************************************************/
196  // chooses one of the three concurrent processes by which the transition
197  // from one nuclear state to another occurs:
198  // gamma-ray emission, internal conversion and internal pair creation.
199  // Conversion electrons are emitted only with one fixed energy
200  // (usually with Egamma-E(K)_binding_energy)
201  void nucltransK(double Egamma, double Ebinde, double conve, double convp);
202  void nucltransKL(double Egamma, double EbindeK, double conveK, double EbindeL, double conveL, double convp);
203  void nucltransKLM(double Egamma, double EbindeK, double conveK, double EbindeL, double conveL, double EbindeM,
204  double conveM, double convp);
205  void nucltransKLM_Pb(double Egamma, double EbindeK, double conveK, double EbindeL, double conveL, double EbindeM,
206  double conveM, double convp);
208  Double_t funbeta(Double_t *x, Double_t *par);
209  Double_t funbeta1fu(Double_t *x, Double_t *par);
210  Double_t funbeta1f(Double_t *x, Double_t *par);
211  Double_t funbeta2f(Double_t *x, Double_t *par);
212  //************************************************/
213  // cernlib functions:
214  std::complex<double> cgamma(std::complex<double> z);
215  double divdif(double xtab[50], double xval);
217 
218  inline int GetNbPart() { return fNbPart; };
219  inline double GetPmoment(int i, int j) { return fPmoment[i][j]; };
220  inline double GetPtime(int i) { return fPtime[i]; };
221  inline int GetNpGeant(int i) { return fNpGeant[i]; };
222 
223  void SetCutoffWindow(double time) { fCutoffWindow = time; };
224  double GetCutoffWindow() { return fCutoffWindow; };
225 
226  void SetTimeCutoff(bool status) { fHasTimeCutoff = status; }
227  bool GetTimeCutoff() { return fHasTimeCutoff; };
228 
229  void SetAlphaCut(bool status) { fHasAlphaCut = status; }
230  bool GetAlphaCut() { return fHasAlphaCut; }
231 
232  inline unsigned int GetParentIdx(unsigned int i) { return fPparent.at(i); }
233 
234  private:
235  double fCutoffWindow; // Time window to restrict coincidence backgrounds
236  bool fHasTimeCutoff; // Flag to indicate if there is a time cutoff for
237  // coincidences (-timecut)
238  bool fHasAlphaCut; // Flag to indicate if the first alpha should be cut out
239  // (-pure)
240  std::string fIsotope; // parent isotope
241  int fLevel; // daughter energy level
242  int fMode; // decay mode
243  int fModebb; // decay mode number inside code (fMode!=fModebb for few modes)
244  int fZdbb; // atomic number of daughter nucleus (Z>0 for b-b- and Z<0 for b+b+
245  // and eb+ processes);
246  int fZdtr; // atomic number of daughter nucleus (Zdtr>0 for e- and Zdtr<0
247  // for e+ particles);
248  double fEbindeK; // binding energy of electron on K-shell (MeV)
249  double fEbindeL; // binding energy of electron on L-shell (MeV)
250  double fEbindeM; // binding energy of electron on M-shell (MeV)
251  double fEbindeK2; // binding energy of electron on K-shell (MeV) (second decay)
252  double fEbindeL2; // binding energy of electron on L-shell (MeV) (second decay)
253  double fEbindeM2; // binding energy of electron on M-shell (MeV) (second decay)
254  double fLoE, fHiE; // limit for spectrum
255  double fTdlev; // time of decay of level (sec);
256  double fTdnuc; // time of decay of nucleus (sec);
257  double fTclev; // time of creation of level from which particle will be emitted
258  // (sec);
259  double fThlev; // level halflife (sec).
260  double fThnuc; // nucleus halflife (sec);
261  double fEgamma; // gamma-ray energy (MeV) [=difference in state energies];
262  double fTevst; // time of event's start (sec);
263  double fQbb; // energy release in double beta process: difference between
264  // masses of parent and daughter atoms (MeV);
265  double fQbeta; // beta energy endpoint (MeV; Qbeta>50 eV);
266  double fEK; // binding energy of electron on K shell of parent atom (MeV)
267  int fStartbb; // must be 0 for first call of bb function for a given mode
268 
269  double fEbb1, fEbb2; // left and right energy limits for sum of energies of
270  // emitted e-/e+; other events will be thrown away
271 
273  DBLinkPtr fLdecay;
274  std::vector<int> fLevelE;
275  std::vector<int> fTrans;
276  std::vector<int> fDaughterZ;
277  std::vector<double> fHLifeTime;
278  std::vector<double> fProbDecay;
279  std::vector<double> fProbBeta;
280  std::vector<double> fEndPoint;
281  std::vector<double> fProbAlpha;
282  std::vector<double> fEnAlpha;
283  std::vector<double> fProbEC;
284  std::vector<double> fEnGamma;
285  std::vector<double> fShCorrFactor;
286 
287  double fSpthe1[4300], fSpthe2[4300], fSpmax, fFe2m;
288  double fE0; // possible amount of energy released
289  double fE1, fE2; // energy of first and second beta
290  public:
291  double fSl[48];
292  int fSlSize;
293  double fC1, fC2, fC3, fC4; // shape correction factors
294  double fKf; // degree of forbiddeness for unique spectra
295  int fNbPart; // current number of last particle in event;
296  double fPmoment[3][100]; // x,y,z components of particle momentum (MeV);
297  double fPtime[100]; // time shift from previous particle time
298  int fNpGeant[100]; // GEANT number for particle identification see above (line
299  // 23)
300 
301  unsigned int fCurParentIdx; // Index of the current parent for each particle
302  std::vector<unsigned int> fPparent; // Index of the parent for each particle.
303 
304  /************************************************/
305  double operator()(double *x, double *par) {
306  // to use with GaussLegendreIntegrator
307  // function implementation using class data members
308  double fe1mod = 0.;
309  double xx; // e2
310 
311  xx = x[0]; // e2
312  // double yy = x[1];//fE1
313  par[0] = fE1;
314  par[1] = fE0;
315  par[2] = GetMass(3);
316  par[3] = fZdbb;
317 
318  if (fModebb == 4 && xx < (par[1] - par[0]))
319  fe1mod = (par[0] + par[2]) * sqrt(par[0] * (par[0] + 2. * par[2])) * fermi(par[3], par[0]) * (xx + par[2]) *
320  sqrt(xx * (xx + 2. * par[2])) * fermi(par[3], xx) * pow(par[1] - par[0] - xx, 5);
321 
322  if (fModebb == 5 && xx < (par[1] - par[0]))
323  fe1mod = (par[0] + par[2]) * sqrt(par[0] * (par[0] + 2. * par[2])) * fermi(par[3], par[0]) * (xx + par[2]) *
324  sqrt(xx * (xx + 2. * par[2])) * fermi(par[3], xx) * (par[1] - par[0] - xx);
325 
326  if (fModebb == 6 && xx < (par[1] - par[0]))
327  fe1mod = (par[0] + par[2]) * sqrt(par[0] * (par[0] + 2. * par[2])) * fermi(par[3], par[0]) * (xx + par[2]) *
328  sqrt(xx * (xx + 2. * par[2])) * fermi(par[3], xx) * pow(par[1] - par[0] - xx, 3);
329 
330  if (fModebb == 8 && xx < (par[1] - par[0]))
331  fe1mod = (par[0] + par[2]) * sqrt(par[0] * (par[0] + 2. * par[2])) * fermi(par[3], par[0]) * (xx + par[2]) *
332  sqrt(xx * (xx + 2. * par[2])) * fermi(par[3], xx) * pow(par[1] - par[0] - xx, 7) * pow(par[0] - xx, 2);
333 
334  if (fModebb == 13 && xx < (par[1] - par[0]))
335  fe1mod = (par[0] + par[2]) * sqrt(par[0] * (par[0] + 2. * par[2])) * fermi(par[3], par[0]) * (xx + par[2]) *
336  sqrt(xx * (xx + 2. * par[2])) * fermi(par[3], xx) * pow(par[1] - par[0] - xx, 7);
337  if (fModebb == 14 && xx < (par[1] - par[0]))
338  fe1mod = (par[0] + par[2]) * sqrt(par[0] * (par[0] + 2. * par[2])) * fermi(par[3], par[0]) * (xx + par[2]) *
339  sqrt(xx * (xx + 2. * par[2])) * fermi(par[3], xx) * pow(par[1] - par[0] - xx, 2);
340 
341  if (fModebb == 15 && xx < (par[1] - par[0]))
342  fe1mod = (par[0] + par[2]) * sqrt(par[0] * (par[0] + 2. * par[2])) * fermi(par[3], par[0]) * (xx + par[2]) *
343  sqrt(xx * (xx + 2. * par[2])) * fermi(par[3], xx) * pow(par[1] - par[0] - xx, 5) *
344  (9 * pow(par[1] - par[0] - xx, 2) + 21 * pow(xx - par[0], 2));
345 
346  if (fModebb == 16 && xx < (par[1] - par[0]))
347  fe1mod = (par[0] + par[2]) * sqrt(par[0] * (par[0] + 2. * par[2])) * fermi(par[3], par[0]) * (xx + par[2]) *
348  sqrt(xx * (xx + 2. * par[2])) * fermi(par[3], xx) * pow(par[1] - par[0] - xx, 5) * pow(xx - par[0], 2);
349 
350  return fe1mod;
351  }
352  /************************************************/
353 };
354 } // namespace RAT
355 
356 #endif
The Decay0 Generator for Initial Kinematics in Alpha, Beta and Double Beta Decays.
Definition: Decay0.hh:79
void particle(int np, double E1, double E2, double teta1, double teta2, double phi1, double phi2, double tclev, double thlev)
Definition: Decay0.cc:10911
void Zr92low()
Definition: Decay0.cc:1414
void Mo96low()
Definition: Decay0.cc:1258
void Pd106low()
Definition: Decay0.cc:1538
void I134()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:6538
Double_t funbeta(Double_t *x, Double_t *par)
‍************************************************‍/
Definition: Decay0.cc:53
void I126()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:6262
void Sn116low()
Definition: Decay0.cc:1603
void beta1f(double Qbeta, double tcnuc, double thnuc, double c1, double c2, double c3, double c4)
‍************************************************‍/
Definition: Decay0.cc:11143
void Te134()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:10194
void Xe130low()
Definition: Decay0.cc:1870
void pair(double Epair)
‍************************************************‍/
Definition: Decay0.cc:11416
void Te133()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:8582
void K40()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:7226
void Po214()
Definition: Decay0.cc:2125
void Ti48low()
‍************************************************‍/
Definition: Decay0.cc:1082
void Eu147()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:4782
double GetRandom()
‍************************************************‍/
Definition: Decay0.cc:11619
void Te124low()
Definition: Decay0.cc:1750
Double_t funbeta1fu(Double_t *x, Double_t *par)
‍************************************************‍/
Definition: Decay0.cc:76
void bb()
‍************************************************‍/
Definition: Decay0.cc:922
void GenBackgTest()
‍************************************************‍/
Definition: Decay0.cc:255
void Kr82low()
Definition: Decay0.cc:1234
void Gd146()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:6204
double divdif(double xtab[50], double xval)
‍************************************************‍/
Definition: Decay0.cc:11531
void Tl208()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:10387
void Pb211()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:7455
void Ba136low()
Definition: Decay0.cc:1915
void Bi212()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:3444
void Co60()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:4574
void beta2f(double Qbeta, double tcnuc, double thnuc, int kf, double c1, double c2, double c3, double c4)
‍************************************************‍/
Definition: Decay0.cc:11262
void Sb125()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:7844
void Ra222()
Definition: Decay0.cc:2160
void Eu152()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:4941
void I135()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:6838
Decay0()
‍************************************************‍/
Definition: Decay0.cc:125
void tgold(double a, double b, TF1 &f, double eps, int nmin, double &xextt, double &fextr)
‍************************************************‍/
Definition: Decay0.cc:11430
void Sb133()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:8192
void Rn218()
Definition: Decay0.cc:2142
void beta1fu(double Qbeta, double tcnuc, double thnuc, double c1, double c2, double c3, double c4)
‍************************************************‍/
Definition: Decay0.cc:11176
void Nb96()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:10742
void Ra228()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:7732
void GenBBDeex()
‍************************************************‍/
Definition: Decay0.cc:827
void Zn65()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:10715
void GenBBTest()
‍************************************************‍/
Definition: Decay0.cc:161
double fe2_mod()
‍************************************************‍/
Definition: Decay0.cc:11059
void Bi207()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:3211
void nucltransKLM(double Egamma, double EbindeK, double conveK, double EbindeL, double conveL, double EbindeM, double conveM, double convp)
‍************************************************‍/
Definition: Decay0.cc:11344
void PbAtShell(int KLMenergy)
‍************************************************‍/
Definition: Decay0.cc:10961
void Fe58low()
Definition: Decay0.cc:1108
void Ta182()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:8379
void Y88()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:10659
void K42()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:7248
void Cd112low()
Definition: Decay0.cc:1656
void Bi214()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:3574
void Sm148low()
Definition: Decay0.cc:1999
void Pb212()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:7575
void nucltransKL(double Egamma, double EbindeK, double conveK, double EbindeL, double conveL, double convp)
‍************************************************‍/
Definition: Decay0.cc:11320
std::complex< double > cgamma(std::complex< double > z)
‍************************************************‍/
Definition: Decay0.cc:11469
void Pb214()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:7615
void Pa234m()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:7320
void Xe135()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:10582
double GetMass(int pdg)
‍************************************************‍/
Definition: Decay0.cc:11621
~Decay0()
‍************************************************‍/
Definition: Decay0.cc:159
void Ac228()
Definition: Decay0.cc:2219
Double_t funbeta2f(Double_t *x, Double_t *par)
‍************************************************‍/
Definition: Decay0.cc:102
void beta(double Qbeta, double tcnuc, double thnuc)
‍************************************************‍/
Definition: Decay0.cc:11115
Double_t funbeta1f(Double_t *x, Double_t *par)
‍************************************************‍/
Definition: Decay0.cc:63
double fermi(const double &Z, const double &E)
‍************************************************‍/
Definition: Decay0.cc:11088
void Sb126()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:8031
void Ru100low()
Definition: Decay0.cc:1432
int GetNbPart()
‍************************************************‍/
Definition: Decay0.hh:218
void Bi210()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:3420
void I133()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:6341
void Eu154()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:5530
double fe1_mod()
probability distribution for energy of e-/e+ in doublebeta decay
Definition: Decay0.cc:11025
void Cs136()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:4670
void GenEvent()
‍************************************************‍/
Definition: Decay0.cc:360
void Th234()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:10320
void Xe133()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:10535
void Se76low()
Definition: Decay0.cc:1133
void At214()
Definition: Decay0.cc:2098
void Sc48()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:4535
void nucltransK(double Egamma, double Ebinde, double conve, double convp)
‍************************************************‍/
Definition: Decay0.cc:11298
void Sm150low()
Definition: Decay0.cc:2023
void Rh106()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:7769
void As79()
functions for decays (alpha/beta)
Definition: Decay0.cc:3019
void Te133m()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Definition: Decay0.cc:9361
void Ge74low()
Definition: Decay0.cc:1210
void nucltransKLM_Pb(double Egamma, double EbindeK, double conveK, double EbindeL, double conveL, double EbindeM, double conveM, double convp)
‍************************************************‍/
Definition: Decay0.cc:11381
Definition: CCCrossSecMessenger.hh:29