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

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/gen/include/RAT/VertexGen_SN.hh Source File
Ratpac-two
VertexGen_SN.hh
1 #ifndef __RAT_VertexGen_SN__
2 #define __RAT_VertexGen_SN__
3 
4 #include <G4Event.hh>
5 #include <G4ThreeVector.hh>
6 #include <RAT/GLG4VertexGen.hh>
7 #include <RAT/SNgen.hh>
8 #include <globals.hh>
9 
10 #include "RAT/DB.hh"
11 
12 // Calculates the cross-section for neutrino-elastic scattering
13 // as function of neutrino energy and the electron's recoil energy.
14 // Allow for variations in the weak mixing angle and the possibility
15 // of a neutrino magnetic moment
16 //
17 // J. Formaggio (UW) -02/09/2005
18 
19 // Converted to Geant4+GLG4Sim+RAT by Bill Seligman (21-Jan-2006).
20 
21 namespace RAT {
22 
23 class VertexGen_SN : public GLG4VertexGen {
24  public:
25  // Note that the database named is "ibd" by default in the
26  // constructor. In other words, we assume the anti-neutrino flux
27  // is the same for both inverse beta-decay (IBD) and elastic
28  // scattering (ES)... at least for now.
29 
30  VertexGen_SN(const char *arg_dbname = "supernova");
31  virtual ~VertexGen_SN();
32  virtual void GeneratePrimaryVertex(G4Event *argEvent, G4ThreeVector &dx, G4double dt);
33 
34  virtual void GenerateIBDVertex(G4Event *argEvent, G4ThreeVector &dx, G4double dt, G4double e_nu);
35 
36  virtual void GenerateESVertex(G4Event *argEvent, G4ThreeVector &dx, G4double dt, G4double e_nu);
37 
38  virtual void GenerateCCVertex(G4Event *argEvent, G4ThreeVector &dx, G4double dt, G4double e_nu);
39 
40  virtual void GenerateICCVertex(G4Event *argEvent, G4ThreeVector &dx, G4double dt, G4double e_nu);
41 
42  virtual void GenerateNCVertex(G4Event *argEvent, G4ThreeVector &dx, G4double dt, G4double e_nu);
43 
44  virtual void GenerateINCVertex(G4Event *argEvent, G4ThreeVector &dx, G4double dt, G4double e_nu);
45 
46  virtual CLHEP::HepLorentzVector GetEmomentum(G4double e_nu, G4double eelectron, G4ThreeVector neutrino_dir);
47  virtual G4double GetElectronEnergy(G4double nu_energy);
48 
49  virtual void Eval2BodyKinematicIBD(G4double enu, G4ThreeVector neutrino_dir);
50 
51  virtual void Eval2BodyKinematicCC(G4double enu, G4ThreeVector neutrino_dir);
52 
53  virtual void Eval2BodyKinematicICC(G4double enu, G4ThreeVector neutrino_dir);
54 
55  // Choose which interaction and evaluate the neutrino energy from the spectrum
56  virtual G4int ChooseInteraction();
57  // virtual G4double pickEnergyFromSpectrum();
58 
59  // generates a primary vertex with given particle type, direction, and energy.
60  virtual void SetState(G4String newValues);
61  // format: dir_x dir_y dir_z
62  // If dir_x==dir_y==dir_z==0, the directions are isotropic.
63  virtual G4String GetState();
64  // returns current state formatted as above
65 
66  // Differential cross section for inverse beta decay
67  // static double CrossSection(double Enu, double CosThetaLab);
68 
69  static double FindCosTheta(G4double Enu, G4double target_mass_c2, G4double recoil_mass_c2);
70 
71  private:
72  G4ParticleDefinition *electron, *nu, *n, *p, *eplus, *gamma;
73  G4ThreeVector nu_dir;
74 
75  G4String _particle; // name of the particle type
76  G4String _spectrum, specname; // name of the spectrum to use
77  DBLinkPtr _lspec; // link to spectrum entry in database
78  std::vector<double> spec_E; // spectrum energy values
79  std::vector<double> spec_mag;
80  CLHEP::HepLorentzVector primair;
81  CLHEP::HepLorentzVector secondaire;
82 
83  // Separate class to generate the elastic-scattering event.
84  // Concrete definition; will invoke the SNgen() constructor.
85  SNgen sngen;
86 
87  // Electron mass
88  G4double m_electron;
89 };
90 
91 } // namespace RAT
92 
93 #endif
Definition: GLG4VertexGen.hh:26
Definition: SNgen.hh:35
Definition: VertexGen_SN.hh:23
Definition: CCCrossSecMessenger.hh:29