LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
NueAr40CCGenerator.cxx
Go to the documentation of this file.
1 //=============================================================================
2 // NueAr40CCGenerator.cxx
3 //
4 // Gleb Sinev, Duke, 2015
5 //=============================================================================
6 
7 #include "NueAr40CCGenerator.h"
8 
9 // Framework includes
10 #include "cetlib/search_path.h"
11 #include "cetlib_except/exception.h"
12 #include "fhiclcpp/ParameterSet.h"
13 
14 // nusimdata includes
18 
19 // ROOT includes
20 #include "TFile.h"
21 #include "TGraph.h"
22 #include "TLorentzVector.h"
23 #include "TMath.h"
24 
25 #include "CLHEP/Random/RandFlat.h"
26 #include "CLHEP/Random/RandPoisson.h"
27 
28 // C++ includes
29 #include <cmath>
30 #include <string>
31 #include <vector>
32 
33 namespace evgen {
34 
35  //----------------------------------------------------------------------------
36  // Constructor
38  : fNumberOfLevels(73)
39  , fNumberOfStartLevels(21)
40  , fBranchingRatios(fNumberOfLevels)
41  , fDecayTo(fNumberOfLevels)
42  , fMonoenergeticNeutrinos(parameterSet.get<bool>("MonoenergeticNeutrinos"))
43  , fNeutrinoEnergy(parameterSet.get<double>("NeutrinoEnergy"))
44  , fEnergySpectrumFileName(parameterSet.get<std::string>("EnergySpectrumFileName"))
45  , fUsePoissonDistribution(parameterSet.get<bool>("UsePoissonDistribution"))
46  , fAllowZeroNeutrinos(parameterSet.get<bool>("AllowZeroNeutrinos"))
47  , fNumberOfNeutrinos(parameterSet.get<int>("NumberOfNeutrinos"))
48  , fNeutrinoTimeBegin(parameterSet.get<double>("NeutrinoTimeBegin"))
49  , fNeutrinoTimeEnd(parameterSet.get<double>("NeutrinoTimeEnd"))
50  {
51 
52  fActiveVolume.push_back(parameterSet.get<std::vector<double>>("ActiveVolume0"));
53  fActiveVolume.push_back(parameterSet.get<std::vector<double>>("ActiveVolume1"));
54 
56 
58  }
59 
60  //----------------------------------------------------------------------------
61  // Main routine
62  std::vector<simb::MCTruth> NueAr40CCGenerator::Generate(CLHEP::HepRandomEngine& engine)
63  {
64 
65  std::vector<simb::MCTruth> truths;
66 
67  int NumberOfNu = this->GetNumberOfNeutrinos(engine);
68  for (int i = 0; i < NumberOfNu; ++i) {
69 
70  simb::MCTruth truth;
72 
73  // Loop until at least one neutrino is simulated
74  while (!truth.NParticles()) {
75  CreateKinematicsVector(truth, engine);
76  }
77 
78  truths.push_back(truth);
79  }
80 
81  return truths;
82  }
83 
84  //----------------------------------------------------------------------------
85  // Return normalized direction cosines of isotropic vector
87  CLHEP::HepRandomEngine& engine) const
88  {
89 
90  CLHEP::RandFlat randFlat(engine);
91 
92  std::vector<double> isotropicDirection;
93 
94  double phi = 2 * TMath::Pi() * randFlat.fire();
95  double cosTheta = 2 * randFlat.fire() - 1;
96  double theta = TMath::ACos(cosTheta);
97 
98  // x, y, z
99  isotropicDirection.push_back(cos(phi) * sin(theta));
100  isotropicDirection.push_back(sin(phi) * sin(theta));
101  isotropicDirection.push_back(cosTheta);
102 
103  return isotropicDirection;
104  }
105 
106  //----------------------------------------------------------------------------
107  // Return a random vector with 3D coordinates inside the active LAr volume
108  std::vector<double> NueAr40CCGenerator::GetUniformPosition(CLHEP::HepRandomEngine& engine) const
109  {
110 
111  CLHEP::RandFlat randFlat(engine);
112 
113  std::vector<double> position;
114 
115  position.push_back(randFlat.fire(fActiveVolume.at(0).at(0), fActiveVolume.at(1).at(0)));
116  position.push_back(randFlat.fire(fActiveVolume.at(0).at(1), fActiveVolume.at(1).at(1)));
117  position.push_back(randFlat.fire(fActiveVolume.at(0).at(2), fActiveVolume.at(1).at(2)));
118 
119  return position;
120  }
121 
122  //----------------------------------------------------------------------------
123  // Get number of neutrinos to generate
124  int NueAr40CCGenerator::GetNumberOfNeutrinos(CLHEP::HepRandomEngine& engine) const
125  {
126 
128  CLHEP::RandPoisson randPoisson(engine);
129  int N = randPoisson.fire(fNumberOfNeutrinos);
130  if (N == 0 && !fAllowZeroNeutrinos) N = 1;
131  return N;
132  }
133 
134  return fNumberOfNeutrinos;
135  }
136 
137  //----------------------------------------------------------------------------
138  // Sample uniform distribution to get a neutrino interaction time
139  double NueAr40CCGenerator::GetNeutrinoTime(CLHEP::HepRandomEngine& engine) const
140  {
141 
142  CLHEP::RandFlat randFlat(engine);
143 
144  return randFlat.fire(fNeutrinoTimeBegin, fNeutrinoTimeEnd);
145  }
146 
147  //----------------------------------------------------------------------------
148  // Sample energy spectrum from fEnergyProbabilityMap
149  // or return a constant value
150  double NueAr40CCGenerator::GetNeutrinoEnergy(CLHEP::HepRandomEngine& engine) const
151  {
152 
154 
155  CLHEP::RandFlat randFlat(engine);
156 
157  double neutrinoEnergy = 0.0;
158 
159  double randomNumber = randFlat.fire();
160 
161  // We need this to get a previous entry in the map
162  std::pair<double, double> previousPair;
163 
164  for (std::map<double, double>::const_iterator energyProbability = fEnergyProbabilityMap.begin();
165  energyProbability != fEnergyProbabilityMap.end();
166  ++energyProbability) {
167  if (randomNumber < energyProbability->second) {
168  if (energyProbability != fEnergyProbabilityMap.begin()) {
169  neutrinoEnergy =
170  energyProbability->first - (energyProbability->second - randomNumber) *
171  (energyProbability->first - previousPair.first) /
172  (energyProbability->second - previousPair.second);
173  break;
174  }
175  else {
176  neutrinoEnergy = energyProbability->first;
177  break;
178  }
179  }
180  previousPair = *energyProbability;
181  }
182 
183  return neutrinoEnergy;
184  }
185 
186  //----------------------------------------------------------------------------
187  // Read a neutrino spectrum from a ROOT file
189  {
190 
191  cet::search_path searchPath("FW_SEARCH_PATH");
192  std::string directoryName = "SupernovaNeutrinos/" + fEnergySpectrumFileName;
193 
194  std::string fullName;
195  searchPath.find_file(directoryName, fullName);
196 
197  if (fullName.empty())
198  throw cet::exception("NueAr40CCGenerator")
199  << "Cannot find file with neutrino energy spectrum " << fullName << '\n';
200 
201  TFile energySpectrumFile(fullName.c_str(), "READ");
202 
203  std::string energySpectrumGraphName = "NueSpectrum";
204  TGraph* energySpectrumGraph =
205  dynamic_cast<TGraph*>(energySpectrumFile.Get(energySpectrumGraphName.c_str()));
206 
207  double integral = 0.0;
208  int numberOfPoints = energySpectrumGraph->GetN();
209  double* energyValues = energySpectrumGraph->GetX();
210  double* fluxValues = energySpectrumGraph->GetY();
211  for (int point = 0; point < numberOfPoints; ++point)
212  integral += fluxValues[point];
213 
214  double probability = 0.0;
215  for (int point = 0; point < numberOfPoints; ++point) {
216  probability += fluxValues[point] / integral;
217  fEnergyProbabilityMap.insert(std::make_pair(energyValues[point], probability));
218  }
219  }
220 
221  //----------------------------------------------------------------------------
222  // Fill vectors with quantities necessary to simulate gammas and electrons
224  {
225 
226  // The level data -- there's probably a better way to initialize
227  fBranchingRatios.at(0).push_back(1.00);
228  fDecayTo.at(0).push_back(1);
229 
230  fBranchingRatios.at(1).push_back(1.00);
231  fDecayTo.at(1).push_back(4);
232 
233  fBranchingRatios.at(2).push_back(0.133891);
234  fBranchingRatios.at(2).push_back(0.41841);
235  fBranchingRatios.at(2).push_back(0.351464);
236  fBranchingRatios.at(2).push_back(0.0962343);
237  fDecayTo.at(2).push_back(38);
238  fDecayTo.at(2).push_back(43);
239  fDecayTo.at(2).push_back(59);
240  fDecayTo.at(2).push_back(72);
241 
242  fBranchingRatios.at(3).push_back(0.391705);
243  fBranchingRatios.at(3).push_back(0.460829);
244  fBranchingRatios.at(3).push_back(0.147465);
245  fDecayTo.at(3).push_back(61);
246  fDecayTo.at(3).push_back(65);
247  fDecayTo.at(3).push_back(71);
248 
249  fBranchingRatios.at(4).push_back(0.358974);
250  fBranchingRatios.at(4).push_back(0.641026);
251  fDecayTo.at(4).push_back(13);
252  fDecayTo.at(4).push_back(58);
253 
254  fBranchingRatios.at(5).push_back(0.247808);
255  fBranchingRatios.at(5).push_back(0.0468929);
256  fBranchingRatios.at(5).push_back(0.213496);
257  fBranchingRatios.at(5).push_back(0.11056);
258  fBranchingRatios.at(5).push_back(0.381243);
259  fDecayTo.at(5).push_back(40);
260  fDecayTo.at(5).push_back(52);
261  fDecayTo.at(5).push_back(67);
262  fDecayTo.at(5).push_back(71);
263  fDecayTo.at(5).push_back(72);
264 
265  fBranchingRatios.at(6).push_back(0.361025);
266  fBranchingRatios.at(6).push_back(0.056677);
267  fBranchingRatios.at(6).push_back(0.194099);
268  fBranchingRatios.at(6).push_back(0.388199);
269  fDecayTo.at(6).push_back(52);
270  fDecayTo.at(6).push_back(55);
271  fDecayTo.at(6).push_back(63);
272  fDecayTo.at(6).push_back(68);
273 
274  fBranchingRatios.at(7).push_back(0.0300963);
275  fBranchingRatios.at(7).push_back(0.0613965);
276  fBranchingRatios.at(7).push_back(0.0152488);
277  fBranchingRatios.at(7).push_back(0.0321027);
278  fBranchingRatios.at(7).push_back(0.0513644);
279  fBranchingRatios.at(7).push_back(0.0682183);
280  fBranchingRatios.at(7).push_back(0.073435);
281  fBranchingRatios.at(7).push_back(0.0100321);
282  fBranchingRatios.at(7).push_back(0.0120385);
283  fBranchingRatios.at(7).push_back(0.0922953);
284  fBranchingRatios.at(7).push_back(0.152488);
285  fBranchingRatios.at(7).push_back(0.401284);
286  fDecayTo.at(7).push_back(17);
287  fDecayTo.at(7).push_back(25);
288  fDecayTo.at(7).push_back(27);
289  fDecayTo.at(7).push_back(32);
290  fDecayTo.at(7).push_back(49);
291  fDecayTo.at(7).push_back(54);
292  fDecayTo.at(7).push_back(56);
293  fDecayTo.at(7).push_back(62);
294  fDecayTo.at(7).push_back(63);
295  fDecayTo.at(7).push_back(67);
296  fDecayTo.at(7).push_back(68);
297  fDecayTo.at(7).push_back(70);
298 
299  fBranchingRatios.at(8).push_back(0.0089877);
300  fBranchingRatios.at(8).push_back(0.06386);
301  fBranchingRatios.at(8).push_back(0.13245);
302  fBranchingRatios.at(8).push_back(0.473037);
303  fBranchingRatios.at(8).push_back(0.321665);
304  fDecayTo.at(8).push_back(43);
305  fDecayTo.at(8).push_back(56);
306  fDecayTo.at(8).push_back(67);
307  fDecayTo.at(8).push_back(70);
308  fDecayTo.at(8).push_back(71);
309 
310  fBranchingRatios.at(9).push_back(0.16129);
311  fBranchingRatios.at(9).push_back(0.193548);
312  fBranchingRatios.at(9).push_back(0.645161);
313  fDecayTo.at(9).push_back(37);
314  fDecayTo.at(9).push_back(65);
315  fDecayTo.at(9).push_back(72);
316 
317  fBranchingRatios.at(10).push_back(0.245826);
318  fBranchingRatios.at(10).push_back(0.0816327);
319  fBranchingRatios.at(10).push_back(0.20872);
320  fBranchingRatios.at(10).push_back(0.463822);
321  fDecayTo.at(10).push_back(40);
322  fDecayTo.at(10).push_back(56);
323  fDecayTo.at(10).push_back(60);
324  fDecayTo.at(10).push_back(71);
325 
326  fBranchingRatios.at(11).push_back(0.170984);
327  fBranchingRatios.at(11).push_back(0.310881);
328  fBranchingRatios.at(11).push_back(0.518135);
329  fDecayTo.at(11).push_back(29);
330  fDecayTo.at(11).push_back(54);
331  fDecayTo.at(11).push_back(66);
332 
333  fBranchingRatios.at(12).push_back(0.242424);
334  fBranchingRatios.at(12).push_back(0.757576);
335  fDecayTo.at(12).push_back(54);
336  fDecayTo.at(12).push_back(62);
337 
338  fBranchingRatios.at(13).push_back(0.159664);
339  fBranchingRatios.at(13).push_back(0.840336);
340  fDecayTo.at(13).push_back(48);
341  fDecayTo.at(13).push_back(58);
342 
343  fBranchingRatios.at(14).push_back(0.288136);
344  fBranchingRatios.at(14).push_back(0.145763);
345  fBranchingRatios.at(14).push_back(0.118644);
346  fBranchingRatios.at(14).push_back(0.108475);
347  fBranchingRatios.at(14).push_back(0.338983);
348  fDecayTo.at(14).push_back(56);
349  fDecayTo.at(14).push_back(66);
350  fDecayTo.at(14).push_back(70);
351  fDecayTo.at(14).push_back(71);
352  fDecayTo.at(14).push_back(72);
353 
354  fBranchingRatios.at(15).push_back(0.00869263);
355  fBranchingRatios.at(15).push_back(0.087274);
356  fBranchingRatios.at(15).push_back(0.0973574);
357  fBranchingRatios.at(15).push_back(0.288595);
358  fBranchingRatios.at(15).push_back(0.347705);
359  fBranchingRatios.at(15).push_back(0.170376);
360  fDecayTo.at(15).push_back(40);
361  fDecayTo.at(15).push_back(64);
362  fDecayTo.at(15).push_back(65);
363  fDecayTo.at(15).push_back(68);
364  fDecayTo.at(15).push_back(70);
365  fDecayTo.at(15).push_back(71);
366 
367  fBranchingRatios.at(16).push_back(1);
368  fDecayTo.at(16).push_back(65);
369 
370  fBranchingRatios.at(17).push_back(0.341763);
371  fBranchingRatios.at(17).push_back(0.0567327);
372  fBranchingRatios.at(17).push_back(0.164046);
373  fBranchingRatios.at(17).push_back(0.239234);
374  fBranchingRatios.at(17).push_back(0.198223);
375  fDecayTo.at(17).push_back(35);
376  fDecayTo.at(17).push_back(39);
377  fDecayTo.at(17).push_back(51);
378  fDecayTo.at(17).push_back(67);
379  fDecayTo.at(17).push_back(69);
380 
381  fBranchingRatios.at(18).push_back(0.106406);
382  fBranchingRatios.at(18).push_back(0.254103);
383  fBranchingRatios.at(18).push_back(0.0465855);
384  fBranchingRatios.at(18).push_back(0.529381);
385  fBranchingRatios.at(18).push_back(0.0635257);
386  fDecayTo.at(18).push_back(60);
387  fDecayTo.at(18).push_back(61);
388  fDecayTo.at(18).push_back(63);
389  fDecayTo.at(18).push_back(70);
390  fDecayTo.at(18).push_back(72);
391 
392  fBranchingRatios.at(19).push_back(0.0905797);
393  fBranchingRatios.at(19).push_back(0.228261);
394  fBranchingRatios.at(19).push_back(0.181159);
395  fBranchingRatios.at(19).push_back(0.137681);
396  fBranchingRatios.at(19).push_back(0.362319);
397  fDecayTo.at(19).push_back(43);
398  fDecayTo.at(19).push_back(45);
399  fDecayTo.at(19).push_back(52);
400  fDecayTo.at(19).push_back(70);
401  fDecayTo.at(19).push_back(71);
402 
403  fBranchingRatios.at(20).push_back(0.0316414);
404  fBranchingRatios.at(20).push_back(0.0415293);
405  fBranchingRatios.at(20).push_back(0.0362558);
406  fBranchingRatios.at(20).push_back(0.0481213);
407  fBranchingRatios.at(20).push_back(0.0903098);
408  fBranchingRatios.at(20).push_back(0.0929466);
409  fBranchingRatios.at(20).push_back(0.659196);
410  fDecayTo.at(20).push_back(30);
411  fDecayTo.at(20).push_back(32);
412  fDecayTo.at(20).push_back(46);
413  fDecayTo.at(20).push_back(61);
414  fDecayTo.at(20).push_back(64);
415  fDecayTo.at(20).push_back(66);
416  fDecayTo.at(20).push_back(70);
417 
418  fBranchingRatios.at(21).push_back(0.310757);
419  fBranchingRatios.at(21).push_back(0.398406);
420  fBranchingRatios.at(21).push_back(0.290837);
421  fDecayTo.at(21).push_back(64);
422  fDecayTo.at(21).push_back(66);
423  fDecayTo.at(21).push_back(70);
424 
425  fBranchingRatios.at(22).push_back(0.152542);
426  fBranchingRatios.at(22).push_back(0.847458);
427  fDecayTo.at(22).push_back(67);
428  fDecayTo.at(22).push_back(71);
429 
430  fBranchingRatios.at(23).push_back(0.168367);
431  fBranchingRatios.at(23).push_back(0.321429);
432  fBranchingRatios.at(23).push_back(0.510204);
433  fDecayTo.at(23).push_back(52);
434  fDecayTo.at(23).push_back(70);
435  fDecayTo.at(23).push_back(71);
436 
437  fBranchingRatios.at(24).push_back(0.0276437);
438  fBranchingRatios.at(24).push_back(0.078982);
439  fBranchingRatios.at(24).push_back(0.0245722);
440  fBranchingRatios.at(24).push_back(0.162352);
441  fBranchingRatios.at(24).push_back(0.184291);
442  fBranchingRatios.at(24).push_back(0.438789);
443  fBranchingRatios.at(24).push_back(0.0833699);
444  fDecayTo.at(24).push_back(36);
445  fDecayTo.at(24).push_back(53);
446  fDecayTo.at(24).push_back(62);
447  fDecayTo.at(24).push_back(64);
448  fDecayTo.at(24).push_back(70);
449  fDecayTo.at(24).push_back(71);
450  fDecayTo.at(24).push_back(72);
451 
452  fBranchingRatios.at(25).push_back(0.0163934);
453  fBranchingRatios.at(25).push_back(0.336276);
454  fBranchingRatios.at(25).push_back(0.226986);
455  fBranchingRatios.at(25).push_back(0.420345);
456  fDecayTo.at(25).push_back(43);
457  fDecayTo.at(25).push_back(67);
458  fDecayTo.at(25).push_back(68);
459  fDecayTo.at(25).push_back(70);
460 
461  fBranchingRatios.at(26).push_back(0.184332);
462  fBranchingRatios.at(26).push_back(0.0460829);
463  fBranchingRatios.at(26).push_back(0.460829);
464  fBranchingRatios.at(26).push_back(0.078341);
465  fBranchingRatios.at(26).push_back(0.230415);
466  fDecayTo.at(26).push_back(53);
467  fDecayTo.at(26).push_back(54);
468  fDecayTo.at(26).push_back(60);
469  fDecayTo.at(26).push_back(61);
470  fDecayTo.at(26).push_back(71);
471 
472  fBranchingRatios.at(27).push_back(0.0147145);
473  fBranchingRatios.at(27).push_back(0.0170689);
474  fBranchingRatios.at(27).push_back(0.0500294);
475  fBranchingRatios.at(27).push_back(0.329606);
476  fBranchingRatios.at(27).push_back(0.588582);
477  fDecayTo.at(27).push_back(36);
478  fDecayTo.at(27).push_back(46);
479  fDecayTo.at(27).push_back(56);
480  fDecayTo.at(27).push_back(67);
481  fDecayTo.at(27).push_back(68);
482 
483  fBranchingRatios.at(28).push_back(1);
484  fDecayTo.at(28).push_back(70);
485 
486  fBranchingRatios.at(29).push_back(0.280702);
487  fBranchingRatios.at(29).push_back(0.0935673);
488  fBranchingRatios.at(29).push_back(0.0409357);
489  fBranchingRatios.at(29).push_back(0.584795);
490  fDecayTo.at(29).push_back(63);
491  fDecayTo.at(29).push_back(66);
492  fDecayTo.at(29).push_back(68);
493  fDecayTo.at(29).push_back(70);
494 
495  fBranchingRatios.at(30).push_back(0.393701);
496  fBranchingRatios.at(30).push_back(0.283465);
497  fBranchingRatios.at(30).push_back(0.188976);
498  fBranchingRatios.at(30).push_back(0.133858);
499  fDecayTo.at(30).push_back(61);
500  fDecayTo.at(30).push_back(67);
501  fDecayTo.at(30).push_back(71);
502  fDecayTo.at(30).push_back(72);
503 
504  fBranchingRatios.at(31).push_back(0.0477737);
505  fBranchingRatios.at(31).push_back(0.194805);
506  fBranchingRatios.at(31).push_back(0.0245826);
507  fBranchingRatios.at(31).push_back(0.269017);
508  fBranchingRatios.at(31).push_back(0.463822);
509  fDecayTo.at(31).push_back(45);
510  fDecayTo.at(31).push_back(60);
511  fDecayTo.at(31).push_back(65);
512  fDecayTo.at(31).push_back(71);
513  fDecayTo.at(31).push_back(72);
514 
515  fBranchingRatios.at(32).push_back(0.105769);
516  fBranchingRatios.at(32).push_back(0.129808);
517  fBranchingRatios.at(32).push_back(0.0528846);
518  fBranchingRatios.at(32).push_back(0.480769);
519  fBranchingRatios.at(32).push_back(0.230769);
520  fDecayTo.at(32).push_back(46);
521  fDecayTo.at(32).push_back(56);
522  fDecayTo.at(32).push_back(66);
523  fDecayTo.at(32).push_back(70);
524  fDecayTo.at(32).push_back(71);
525 
526  fBranchingRatios.at(33).push_back(0.21875);
527  fBranchingRatios.at(33).push_back(0.78125);
528  fDecayTo.at(33).push_back(67);
529  fDecayTo.at(33).push_back(71);
530 
531  fBranchingRatios.at(34).push_back(0.102011);
532  fBranchingRatios.at(34).push_back(0.179598);
533  fBranchingRatios.at(34).push_back(0.718391);
534  fDecayTo.at(34).push_back(43);
535  fDecayTo.at(34).push_back(61);
536  fDecayTo.at(34).push_back(66);
537 
538  fBranchingRatios.at(35).push_back(0.00826446);
539  fBranchingRatios.at(35).push_back(0.393546);
540  fBranchingRatios.at(35).push_back(0.334514);
541  fBranchingRatios.at(35).push_back(0.263676);
542  fDecayTo.at(35).push_back(64);
543  fDecayTo.at(35).push_back(67);
544  fDecayTo.at(35).push_back(68);
545  fDecayTo.at(35).push_back(70);
546 
547  fBranchingRatios.at(36).push_back(0.056338);
548  fBranchingRatios.at(36).push_back(0.704225);
549  fBranchingRatios.at(36).push_back(0.239437);
550  fDecayTo.at(36).push_back(51);
551  fDecayTo.at(36).push_back(70);
552  fDecayTo.at(36).push_back(71);
553 
554  fBranchingRatios.at(37).push_back(0.21875);
555  fBranchingRatios.at(37).push_back(0.78125);
556  fDecayTo.at(37).push_back(67);
557  fDecayTo.at(37).push_back(70);
558 
559  fBranchingRatios.at(38).push_back(0.181818);
560  fBranchingRatios.at(38).push_back(0.757576);
561  fBranchingRatios.at(38).push_back(0.0606061);
562  fDecayTo.at(38).push_back(66);
563  fDecayTo.at(38).push_back(71);
564  fDecayTo.at(38).push_back(72);
565 
566  fBranchingRatios.at(39).push_back(0.157258);
567  fBranchingRatios.at(39).push_back(0.403226);
568  fBranchingRatios.at(39).push_back(0.237903);
569  fBranchingRatios.at(39).push_back(0.201613);
570  fDecayTo.at(39).push_back(62);
571  fDecayTo.at(39).push_back(70);
572  fDecayTo.at(39).push_back(71);
573  fDecayTo.at(39).push_back(72);
574 
575  fBranchingRatios.at(40).push_back(0.0740741);
576  fBranchingRatios.at(40).push_back(0.925926);
577  fDecayTo.at(40).push_back(52);
578  fDecayTo.at(40).push_back(72);
579 
580  fBranchingRatios.at(41).push_back(0.0535714);
581  fBranchingRatios.at(41).push_back(0.35119);
582  fBranchingRatios.at(41).push_back(0.595238);
583  fDecayTo.at(41).push_back(67);
584  fDecayTo.at(41).push_back(68);
585  fDecayTo.at(41).push_back(70);
586 
587  fBranchingRatios.at(42).push_back(0.00816803);
588  fBranchingRatios.at(42).push_back(0.0583431);
589  fBranchingRatios.at(42).push_back(0.350058);
590  fBranchingRatios.at(42).push_back(0.583431);
591  fDecayTo.at(42).push_back(49);
592  fDecayTo.at(42).push_back(62);
593  fDecayTo.at(42).push_back(71);
594  fDecayTo.at(42).push_back(72);
595 
596  fBranchingRatios.at(43).push_back(0.0961538);
597  fBranchingRatios.at(43).push_back(0.423077);
598  fBranchingRatios.at(43).push_back(0.480769);
599  fDecayTo.at(43).push_back(66);
600  fDecayTo.at(43).push_back(67);
601  fDecayTo.at(43).push_back(68);
602 
603  fBranchingRatios.at(44).push_back(0.450549);
604  fBranchingRatios.at(44).push_back(0.549451);
605  fDecayTo.at(44).push_back(69);
606  fDecayTo.at(44).push_back(72);
607 
608  fBranchingRatios.at(45).push_back(0.469925);
609  fBranchingRatios.at(45).push_back(0.0836466);
610  fBranchingRatios.at(45).push_back(0.446429);
611  fDecayTo.at(45).push_back(61);
612  fDecayTo.at(45).push_back(65);
613  fDecayTo.at(45).push_back(72);
614 
615  fBranchingRatios.at(46).push_back(0.0408163);
616  fBranchingRatios.at(46).push_back(0.510204);
617  fBranchingRatios.at(46).push_back(0.44898);
618  fDecayTo.at(46).push_back(67);
619  fDecayTo.at(46).push_back(70);
620  fDecayTo.at(46).push_back(71);
621 
622  fBranchingRatios.at(47).push_back(1);
623  fDecayTo.at(47).push_back(72);
624 
625  fBranchingRatios.at(48).push_back(0.641026);
626  fBranchingRatios.at(48).push_back(0.358974);
627  fDecayTo.at(48).push_back(58);
628  fDecayTo.at(48).push_back(69);
629 
630  fBranchingRatios.at(49).push_back(0.0458015);
631  fBranchingRatios.at(49).push_back(0.954198);
632  fDecayTo.at(49).push_back(66);
633  fDecayTo.at(49).push_back(70);
634 
635  fBranchingRatios.at(50).push_back(0.401639);
636  fBranchingRatios.at(50).push_back(0.188525);
637  fBranchingRatios.at(50).push_back(0.409836);
638  fDecayTo.at(50).push_back(61);
639  fDecayTo.at(50).push_back(69);
640  fDecayTo.at(50).push_back(72);
641 
642  fBranchingRatios.at(51).push_back(0.0188679);
643  fBranchingRatios.at(51).push_back(0.173585);
644  fBranchingRatios.at(51).push_back(0.754717);
645  fBranchingRatios.at(51).push_back(0.0528302);
646  fDecayTo.at(51).push_back(61);
647  fDecayTo.at(51).push_back(67);
648  fDecayTo.at(51).push_back(71);
649  fDecayTo.at(51).push_back(72);
650 
651  fBranchingRatios.at(52).push_back(0.0100849);
652  fBranchingRatios.at(52).push_back(0.00796178);
653  fBranchingRatios.at(52).push_back(0.530786);
654  fBranchingRatios.at(52).push_back(0.451168);
655  fDecayTo.at(52).push_back(59);
656  fDecayTo.at(52).push_back(68);
657  fDecayTo.at(52).push_back(70);
658  fDecayTo.at(52).push_back(71);
659 
660  fBranchingRatios.at(53).push_back(0.0379902);
661  fBranchingRatios.at(53).push_back(0.0490196);
662  fBranchingRatios.at(53).push_back(0.612745);
663  fBranchingRatios.at(53).push_back(0.300245);
664  fDecayTo.at(53).push_back(67);
665  fDecayTo.at(53).push_back(70);
666  fDecayTo.at(53).push_back(71);
667  fDecayTo.at(53).push_back(72);
668 
669  fBranchingRatios.at(54).push_back(0.106557);
670  fBranchingRatios.at(54).push_back(0.819672);
671  fBranchingRatios.at(54).push_back(0.0737705);
672  fDecayTo.at(54).push_back(59);
673  fDecayTo.at(54).push_back(68);
674  fDecayTo.at(54).push_back(70);
675 
676  fBranchingRatios.at(55).push_back(0.699301);
677  fBranchingRatios.at(55).push_back(0.300699);
678  fDecayTo.at(55).push_back(64);
679  fDecayTo.at(55).push_back(70);
680 
681  fBranchingRatios.at(56).push_back(1);
682  fDecayTo.at(56).push_back(71);
683 
684  fBranchingRatios.at(57).push_back(1);
685  fDecayTo.at(57).push_back(72);
686 
687  fBranchingRatios.at(58).push_back(0.888099);
688  fBranchingRatios.at(58).push_back(0.111901);
689  fDecayTo.at(58).push_back(69);
690  fDecayTo.at(58).push_back(72);
691 
692  fBranchingRatios.at(59).push_back(0.00647298);
693  fBranchingRatios.at(59).push_back(0.752672);
694  fBranchingRatios.at(59).push_back(0.165588);
695  fBranchingRatios.at(59).push_back(0.0752672);
696  fDecayTo.at(59).push_back(65);
697  fDecayTo.at(59).push_back(70);
698  fDecayTo.at(59).push_back(71);
699  fDecayTo.at(59).push_back(72);
700 
701  fBranchingRatios.at(60).push_back(0.0708556);
702  fBranchingRatios.at(60).push_back(0.668449);
703  fBranchingRatios.at(60).push_back(0.260695);
704  fDecayTo.at(60).push_back(65);
705  fDecayTo.at(60).push_back(71);
706  fDecayTo.at(60).push_back(72);
707 
708  fBranchingRatios.at(61).push_back(0.166667);
709  fBranchingRatios.at(61).push_back(0.833333);
710  fDecayTo.at(61).push_back(69);
711  fDecayTo.at(61).push_back(72);
712 
713  fBranchingRatios.at(62).push_back(0.0898551);
714  fBranchingRatios.at(62).push_back(0.57971);
715  fBranchingRatios.at(62).push_back(0.330435);
716  fDecayTo.at(62).push_back(67);
717  fDecayTo.at(62).push_back(68);
718  fDecayTo.at(62).push_back(70);
719 
720  fBranchingRatios.at(63).push_back(0.813008);
721  fBranchingRatios.at(63).push_back(0.186992);
722  fDecayTo.at(63).push_back(71);
723  fDecayTo.at(63).push_back(72);
724 
725  fBranchingRatios.at(64).push_back(0.29078);
726  fBranchingRatios.at(64).push_back(0.70922);
727  fDecayTo.at(64).push_back(70);
728  fDecayTo.at(64).push_back(71);
729 
730  fBranchingRatios.at(65).push_back(0.05);
731  fBranchingRatios.at(65).push_back(0.08);
732  fBranchingRatios.at(65).push_back(0.5);
733  fBranchingRatios.at(65).push_back(0.37);
734  fDecayTo.at(65).push_back(69);
735  fDecayTo.at(65).push_back(70);
736  fDecayTo.at(65).push_back(71);
737  fDecayTo.at(65).push_back(72);
738 
739  fBranchingRatios.at(66).push_back(0.398406);
740  fBranchingRatios.at(66).push_back(0.310757);
741  fBranchingRatios.at(66).push_back(0.290837);
742  fDecayTo.at(66).push_back(70);
743  fDecayTo.at(66).push_back(71);
744  fDecayTo.at(66).push_back(72);
745 
746  fBranchingRatios.at(67).push_back(0.819672);
747  fBranchingRatios.at(67).push_back(0.180328);
748  fDecayTo.at(67).push_back(70);
749  fDecayTo.at(67).push_back(71);
750 
751  fBranchingRatios.at(68).push_back(0.186992);
752  fBranchingRatios.at(68).push_back(0.813008);
753  fDecayTo.at(68).push_back(70);
754  fDecayTo.at(68).push_back(71);
755 
756  fBranchingRatios.at(69).push_back(1);
757  fDecayTo.at(69).push_back(72);
758 
759  fBranchingRatios.at(70).push_back(1);
760  fDecayTo.at(70).push_back(71);
761 
762  fBranchingRatios.at(71).push_back(1);
763  fDecayTo.at(71).push_back(72);
764 
765  // Info from table VII (http://prc.aps.org/pdf/PRC/v58/i6/p3677_1)
766  // in MeV
767  double startEnergyLevels[] = {2.281, 2.752, 2.937, 3.143, 3.334, 3.569, 3.652,
768  3.786, 3.861, 4.067, 4.111, 4.267, 4.364, 4.522,
769  4.655, 4.825, 5.017, 5.080, 5.223, 5.696, 6.006};
770 
771  fStartEnergyLevels.insert(
772  fStartEnergyLevels.end(), &startEnergyLevels[0], &startEnergyLevels[fNumberOfStartLevels]);
773 
774  double b[] = {0.9, 1.5, 0.11, 0.06, 0.04, 0.01, 0.16, 0.26, 0.01, 0.05, 0.11,
775  0.29, 3.84, 0.31, 0.38, 0.47, 0.36, 0.23, 0.03, 0.11, 0.13};
776 
777  fB.insert(fB.end(), &b[0], &b[fNumberOfStartLevels]);
778 
779  double energyLevels[] = {
780  7.4724, 6.2270, 5.06347, 4.99294, 4.8756, 4.87255, 4.78865, 4.744093, 4.53706,
781  4.47299, 4.41936, 4.39588, 4.3840, 4.3656, 4.28052, 4.25362, 4.21307, 4.18003,
782  4.14901, 4.11084, 4.10446, 4.02035, 3.92390, 3.88792, 3.86866, 3.840228, 3.82143,
783  3.79757, 3.76779, 3.73848, 3.663739, 3.62995, 3.59924, 3.55697, 3.48621, 3.439144,
784  3.41434, 3.39363, 3.36803, 3.22867, 3.15381, 3.14644, 3.12836, 3.109721, 3.1002,
785  3.02795, 2.98587, 2.9508, 2.87901, 2.80788, 2.7874, 2.786644, 2.75672, 2.74691,
786  2.730372, 2.625990, 2.57593, 2.558, 2.54277, 2.419171, 2.397165, 2.290493, 2.289871,
787  2.26040, 2.103668, 2.069809, 2.047354, 1.959068, 1.643639, 0.891398, 0.8001427, 0.0298299,
788  0.0};
789 
790  fEnergyLevels.insert(fEnergyLevels.end(), &energyLevels[0], &energyLevels[fNumberOfLevels]);
791 
792  // I have to put checks that the arrays really
793  // have as many elements as they should
794  }
795 
796  //----------------------------------------------------------------------------
797  // Simulate particles and fill truth
799  CLHEP::HepRandomEngine& engine) const
800  {
801 
802  bool success = false;
803  while (!success) {
804  double neutrinoEnergy = GetNeutrinoEnergy(engine);
805  double neutrinoTime = GetNeutrinoTime(engine);
806  success = ProcessOneNeutrino(truth, neutrinoEnergy, neutrinoTime, engine);
807  }
808  }
809 
810  //----------------------------------------------------------------------------
811  // Simulate particles and fill truth
812  // Return true if one neutrino is processed, false otherwise
814  double neutrinoEnergy,
815  double neutrinoTime,
816  CLHEP::HepRandomEngine& engine) const
817  {
818 
819  CLHEP::RandFlat randFlat(engine);
820 
821  int highestLevel = 0;
822  std::vector<double> levelCrossSections = CalculateCrossSections(neutrinoEnergy, highestLevel);
823 
824  double totalCrossSection = 0;
825  // Calculating total cross section
826  for (std::vector<double>::iterator crossSection = levelCrossSections.begin();
827  crossSection != levelCrossSections.end();
828  ++crossSection)
829  totalCrossSection += *crossSection;
830 
831  if (totalCrossSection == 0) return false;
832 
833  std::vector<double> startLevelProbabilities;
834  // Calculating each level's probability
835  for (std::vector<double>::iterator crossSection = levelCrossSections.begin();
836  crossSection != levelCrossSections.end();
837  ++crossSection)
838  startLevelProbabilities.push_back((*crossSection) / totalCrossSection);
839 
840  double randomNumber = randFlat.fire();
841  double tprob = 0;
842  int chosenStartLevel = -1;
843  // Picking a starting level
844  for (int level = 0; level < highestLevel; ++level) {
845  if (randomNumber < (startLevelProbabilities.at(level) + tprob)) {
846  chosenStartLevel = level;
847  break;
848  }
849  tprob += startLevelProbabilities.at(level);
850  }
851 
852  int lastLevel = -1;
853  int level = -1;
854 
855  // Time delays
856  // Seems like this is not implemented yet
857  std::vector<double> levelDelay;
858  for (int n = 0; n < fNumberOfLevels; ++n)
859  levelDelay.push_back(0.0);
860 
861  // The highest n for which fStartEnergyLevels.at(chosenStartLevel)
862  // is higher than fEnergyLevels.at(n)
863  int highestHigher = 0;
864  // The lowest n for which fStartEnergyLevels.at(chosenStartLevel)
865  // is lower than fEnergyLevels.at(n)
866  int lowestLower = 0;
867 
868  // Finding lowestLower and highestHigher
869  for (int n = 0; n < fNumberOfLevels; ++n) {
870  if (fStartEnergyLevels.at(chosenStartLevel) < fEnergyLevels.at(n)) lowestLower = n;
871  if (fStartEnergyLevels.at(chosenStartLevel) > fEnergyLevels.at(n)) {
872  highestHigher = n;
873  break;
874  }
875  }
876 
877  if (std::abs(fStartEnergyLevels.at(chosenStartLevel) - fEnergyLevels.at(lowestLower)) <
878  std::abs(fStartEnergyLevels.at(chosenStartLevel) - fEnergyLevels.at(highestHigher))) {
879  lastLevel = lowestLower;
880  level = lowestLower;
881  }
882  // If the chosen start level energy is closest to the lowest level energy
883  // that it's lower than than the highest level energy
884  // that it's higher than, it starts at the level of
885  // the lowest level energy that it's lower than
886 
887  if (std::abs(fStartEnergyLevels.at(chosenStartLevel) - fEnergyLevels.at(highestHigher)) <
888  std::abs(fStartEnergyLevels.at(chosenStartLevel) - fEnergyLevels.at(lowestLower))) {
889  lastLevel = highestHigher;
890  level = highestHigher;
891  }
892  // If the chosen start level energy is closest to the highest level energy
893  // that it's higher than than the lowest level energy that it's lower than,
894  // it starts at the level of the highest level energy that it's higher than
895 
896  std::vector<double> vertex = GetUniformPosition(engine);
897 
898  std::vector<double> neutrinoDirection = GetIsotropicDirection(engine);
899 
900  //
901  // Add the first particle (the neutrino) to the truth list...
902  //
903 
904  // NOTE: all of the values below calculated for the neutrino should be checked!
905 
906  // Primary particles have negative IDs
907  int neutrinoTrackID = -1 * (truth.NParticles() + 1);
908  std::string primary("primary");
909 
910  int nuePDG = 12;
911  double neutrinoP = neutrinoEnergy / 1000.0; // use GeV...
912  double neutrinoPx = neutrinoDirection.at(0) * neutrinoP;
913  double neutrinoPy = neutrinoDirection.at(1) * neutrinoP;
914  double neutrinoPz = neutrinoDirection.at(2) * neutrinoP;
915 
916  // Create the neutrino:
917  // * set the mother to -1 since it is primary
918  // * set the mass to something < 0 so that the constructor looks up the mass from the pdg tables
919  // * set the status bit to 0 so that geant doesn't waste any CPU tracking the neutrino
920  simb::MCParticle neutrino(neutrinoTrackID, nuePDG, primary, -1, -1, 0);
921 
922  TLorentzVector neutrinoPosition(vertex.at(0), vertex.at(1), vertex.at(2), neutrinoTime);
923  TLorentzVector neutrinoMomentum(neutrinoPx, neutrinoPy, neutrinoPz, neutrinoEnergy / 1000.0);
924  neutrino.AddTrajectoryPoint(neutrinoPosition, neutrinoMomentum);
925 
926  truth.Add(neutrino);
927 
928  //
929  // Adding the electron to truth
930  //
931 
932  // In MeV
933  double electronEnergy = neutrinoEnergy - (fEnergyLevels.at(lastLevel) + 1.5);
934  double electronEnergyGeV = electronEnergy / 1000.0;
935 
936  double electronM = 0.000511;
937  double electronP = std::sqrt(std::pow(electronEnergyGeV, 2) - std::pow(electronM, 2));
938 
939  // For the moment, choose an isotropic direction for the electron.
940  std::vector<double> electronDirection = GetIsotropicDirection(engine);
941  double electronPx = electronDirection.at(0) * electronP;
942  double electronPy = electronDirection.at(1) * electronP;
943  double electronPz = electronDirection.at(2) * electronP;
944 
945  // Primary particles have negative IDs
946  int trackID = -1 * (truth.NParticles() + 1);
947  int electronPDG = 11;
948  simb::MCParticle electron(trackID, electronPDG, primary);
949 
950  TLorentzVector electronPosition(vertex.at(0), vertex.at(1), vertex.at(2), neutrinoTime);
951  TLorentzVector electronMomentum(electronPx, electronPy, electronPz, electronEnergyGeV);
952  electron.AddTrajectoryPoint(electronPosition, electronMomentum);
953 
954  truth.Add(electron);
955 
956  double ttime = neutrinoTime;
957  int noMoreDecay = 0;
958 
959  // Level loop
960  int groundLevel = fNumberOfLevels - 1;
961  while (level != groundLevel) {
962 
963  double rl = randFlat.fire();
964 
965  int decayNum = 0;
966 
967  tprob = 0; // Used this variable above for cross section
968 
969  // Decay loop
970  for (unsigned int iLevel = 0; iLevel < fBranchingRatios.at(level).size(); ++iLevel) {
971 
972  if (rl < (fBranchingRatios.at(level).at(iLevel) + tprob)) {
973 
974  // We have a decay
975 
976  level = fDecayTo.at(level).at(decayNum);
977 
978  // Really should be using a map
979  double gammaEnergy = fEnergyLevels.at(lastLevel) - fEnergyLevels.at(level);
980  double gammaEnergyGeV = gammaEnergy / 1000;
981 
982  std::vector<double> gammaDirection = GetIsotropicDirection(engine);
983  double gammaPx = gammaDirection.at(0) * gammaEnergyGeV;
984  double gammaPy = gammaDirection.at(1) * gammaEnergyGeV;
985  double gammaPz = gammaDirection.at(2) * gammaEnergyGeV;
986 
987  //double gammaM = 0.0; // unused
988 
989  double gammaTime =
990  (-TMath::Log(randFlat.fire()) / (1 / (levelDelay.at(lastLevel)))) + ttime;
991 
992  // Adding the gamma to truth
993 
994  // Primary particles have negative IDs
995  trackID = -1 * (truth.NParticles() + 1);
996  int gammaPDG = 22;
997  simb::MCParticle gamma(trackID, gammaPDG, primary); // NOTE: should the gammas be primary?
998 
999  TLorentzVector gammaPosition(vertex.at(0), vertex.at(1), vertex.at(2), neutrinoTime);
1000  TLorentzVector gammaMomentum(gammaPx, gammaPy, gammaPz, gammaEnergyGeV);
1001  gamma.AddTrajectoryPoint(gammaPosition, gammaMomentum);
1002 
1003  truth.Add(gamma);
1004 
1005  lastLevel = level;
1006  ttime = gammaTime;
1007 
1008  break;
1009  }
1010 
1011  if ((tprob + fBranchingRatios.at(level).at(iLevel)) > 1) {
1012  std::cout << "(tprob + *iLevel) > 1" << std::endl;
1013  noMoreDecay = 1; // If it doesn't do any more gamma decay
1014  break;
1015  }
1016 
1017  ++decayNum;
1018  tprob += fBranchingRatios.at(level).at(iLevel);
1019 
1020  } // End of decay loop
1021 
1022  if (noMoreDecay == 1) break;
1023 
1024  } // End of level loop
1025 
1026  if (level != 72) {
1027  std::cout << "level != 72" << std::endl;
1028  std::cout << "level = " << level << std::endl;
1029  }
1030 
1031  // Set the neutrino for the MCTruth object:
1032  // NOTE: currently these parameters are all pretty much a guess...
1033  truth.SetNeutrino(
1034  simb::kCC,
1035  simb::kQE, // not sure what the mode should be here, assumed that these are all QE???
1036  simb::kCCQE, // not sure what the int_type should be either...
1037  0, // target is AR40? not sure how to specify that...
1038  0, // nucleon pdg ???
1039  0, // quark pdg ???
1040  -1.0, // W ??? - not sure how to calculate this from the above
1041  -1.0, // X ??? - not sure how to calculate this from the above
1042  -1.0, // Y ??? - not sure how to calculate this from the above
1043  -1.0); // Qsqr ??? - not sure how to calculate this from the above
1044 
1045  return true;
1046  }
1047 
1048  //----------------------------------------------------------------------------
1049  // Calculate cross sections for neutrino with neutrinoEnergy to excite
1050  // the final nucleus with highestLevel being the highest possible level.
1051  // highestLevel is output, so, whatever integer was used as the argument,
1052  // it may have a different value after this function is executed
1053  std::vector<double> NueAr40CCGenerator::CalculateCrossSections(double neutrinoEnergy,
1054  int& highestLevel) const
1055  {
1056 
1057  highestLevel = 0;
1058  std::vector<double> levelCrossSections;
1059 
1060  // Loop through energy levels, if neutrino has enough energy,
1061  // calculate cross section
1062  for (int level = 0; level < fNumberOfStartLevels; ++level) {
1063  // Electron energy in keV
1064  double w = (neutrinoEnergy - (fStartEnergyLevels.at(level) + 1.5)) * 1000;
1065 
1066  double sigma = 0.0;
1067  if (neutrinoEnergy > (fStartEnergyLevels.at(level) + 1.5) && w >= 511.) {
1068  ++highestLevel;
1069  for (int n = 0; n <= level; ++n) {
1070  // Electron energy for level n to use in cross section
1071  w = (neutrinoEnergy - (fStartEnergyLevels.at(n) + 1.5)) * 1000;
1072  // Electron momentum in keV/c
1073  double p = std::sqrt(pow(w, 2) - pow(511.0, 2));
1074  // Fermi function approximation
1075  double f = std::sqrt(3.0634 + (0.6814 / (w - 1)));
1076  // In cm^2*10^-42
1077  sigma += 1.6e-8 * (p * w * f * fB.at(n));
1078  }
1079  }
1080  levelCrossSections.push_back(sigma);
1081  }
1082 
1083  return levelCrossSections;
1084  }
1085 
1086 }
intermediate_table::iterator iterator
void AddTrajectoryPoint(TLorentzVector const &position, TLorentzVector const &momentum)
Definition: MCParticle.h:258
std::vector< double > fB
bool ProcessOneNeutrino(simb::MCTruth &truth, double neutrinoEnergy, double neutrinoTime, CLHEP::HepRandomEngine &engine) const
void SetOrigin(simb::Origin_t origin)
Definition: MCTruth.h:82
std::vector< double > GetUniformPosition(CLHEP::HepRandomEngine &engine) const
constexpr auto abs(T v)
Returns the absolute value of the argument.
STL namespace.
intermediate_table::const_iterator const_iterator
void CreateKinematicsVector(simb::MCTruth &truth, CLHEP::HepRandomEngine &engine) const
int NParticles() const
Definition: MCTruth.h:75
void SetNeutrino(int CCNC, int mode, int interactionType, int target, int nucleon, int quark, double w, double x, double y, double qsqr)
Definition: MCTruth.cxx:30
charged current quasi-elastic
Definition: MCNeutrino.h:96
Particle class.
std::vector< double > GetIsotropicDirection(CLHEP::HepRandomEngine &engine) const
TFile f
Definition: plotHisto.C:6
std::vector< std::vector< double > > fBranchingRatios
double GetNeutrinoTime(CLHEP::HepRandomEngine &engine) const
std::vector< double > CalculateCrossSections(double neutrinoEnergy, int &highestLevel) const
int GetNumberOfNeutrinos(CLHEP::HepRandomEngine &engine) const
NueAr40CCGenerator(fhicl::ParameterSet const &parameterSet)
T get(std::string const &key) const
Definition: ParameterSet.h:314
std::vector< std::vector< int > > fDecayTo
std::vector< double > fStartEnergyLevels
double GetNeutrinoEnergy(CLHEP::HepRandomEngine &engine) const
void Add(simb::MCParticle const &part)
Definition: MCTruth.h:80
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
Definition: StdUtils.h:120
std::vector< std::vector< double > > fActiveVolume
std::map< double, double > fEnergyProbabilityMap
Supernova neutrinos.
Definition: MCTruth.h:25
std::vector< simb::MCTruth > Generate(CLHEP::HepRandomEngine &engine)
Char_t n[5]
Event generator information.
Definition: MCTruth.h:32
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:82
Float_t w
Definition: plot.C:20
Event Generation using GENIE, cosmics or single particles.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::vector< double > fEnergyLevels
vertex reconstruction