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

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/gen/include/RAT/IBDgen.hh Source File
Ratpac-two
IBDgen.hh
1 #ifndef __RAT_IBDgen__
2 #define __RAT_IBDgen__
3 
4 #include <CLHEP/Random/Randomize.h>
5 
6 #include <G4LorentzVector.hh>
7 #include <G4String.hh>
8 #include <G4ThreeVector.hh>
9 #include <RAT/LinearInterp.hh>
10 
11 namespace RAT {
12 
13 class IBDgenMessenger;
14 // Generate inverse beta decay event
15 class IBDgen {
16  public:
17  IBDgen();
18 
19  // Generate random event vectors
20  // Pass in the neutrino direction (unit vector)
21  // Returns 4-momentum vectors for neutrino and resulting positron
22  // and neutron. Neutrino energy and positron direction drawn from
23  // GenInteraction() distribution.
24  void GenEvent(const G4ThreeVector &nu_dir, G4LorentzVector &neutrino, G4LorentzVector &positron,
25  G4LorentzVector &neutron);
26 
27  // Generate random inverse beta decay interaction
28  //
29  // Selects neutrino energy and cos(theta) of the produced
30  // positron relative to neutrino direction. They are pulled
31  // from 2D distribution of reactor neutrinos which have interacted
32  // with a proton, so both the incident flux, and the (relative)
33  // differential cross-section are factored in.
34  void GenInteraction(double &E, double &CosThetaLab);
35 
36  // Differential cross section for inverse beta decay
37  static double CrossSection(double Enu, double CosThetaLab);
38  // dE/dCosT for inverse beta decay (E = first order positron energy)
39  static double dE1dCosT(double Enu, double CosThetaLab);
40  // Maximum of dE/dCosT
41  static double EvalMax(double Enu, double FluxMax);
42 
43  // Positron energy (first order)
44  static double PositronEnergy(double Enu, double CosThetaLab);
45 
46  // Flux as a function of energy. Interpolated from table in IBD RATDB table
47  double Flux(double E) const { return rmpflux(E); };
48 
49  // Spectrum index for ratdb
50  G4String GetSpectrumIndex() { return SpectrumIndex; };
51  void SetSpectrumIndex(G4String _specIndex);
52  // Enable neutrons
53  bool GetNeutronState() { return NeutronState; };
54  void SetNeutronState(bool _state) { NeutronState = _state; };
55  // Enable positrons
56  bool GetPositronState() { return PositronState; };
57  void SetPositronState(bool _state) { PositronState = _state; };
58 
59  void UpdateFromDatabaseIndex();
60 
61  protected:
62  LinearInterp<double> rmpflux;
63  double Emax;
64  double Emin;
65  double XCmax;
66  double FluxMax;
67 
68  bool NeutronState;
69  bool PositronState;
70  bool ApplyCrossSection;
71 
72  IBDgenMessenger *messenger;
73  G4String SpectrumIndex;
74 };
75 
76 } // namespace RAT
77 
78 #endif
Definition: IBDgenMessenger.hh:19
Definition: IBDgen.hh:15
Definition: CCCrossSecMessenger.hh:29