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

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/gen/include/RAT/ESgen.hh Source File
Ratpac-two
ESgen.hh
1 #ifndef __RAT_ESgen__
2 #define __RAT_ESgen__
3 
75 
76 #include <CLHEP/Random/RandGeneral.h>
77 #include <CLHEP/Vector/LorentzVector.h>
78 
79 #include <G4LorentzVector.hh>
80 #include <G4ThreeVector.hh>
81 #include <RAT/LinearInterp.hh>
82 
84 class TGraph;
85 class RandGeneral;
86 
87 namespace RAT {
88 
90 class ESCrossSec;
91 
92 class ESgen {
93  public:
94  ESgen();
95  ~ESgen();
96 
97  // Generate random event vectors
98  // Pass in the neutrino direction (unit vector)
99  // Returns 4-momentum vectors for resulting electron.
109  void GenerateEvent(const G4ThreeVector &nu_dir, G4LorentzVector &neutrino, G4LorentzVector &electron);
110 
116  void SetNuType(const G4String &nutype);
117 
119  inline const G4String &GetNuType() const { return fNuFlavor; };
120 
132  void SetNuFlavor(const G4String &nuflavor);
134  inline const G4String &GetNuFlavor() const { return fNuFlavor; };
135 
140  inline G4double GetTotalFlux() {
141  // Return the neutrino flux as the value loaded from the database
142  return fTotalFlux;
143  }
144 
153  G4double GetRatePerTarget();
154 
159  const G4String GetDBName() const { return fDBName; }
160 
165  void SetDBName(const G4String name);
166 
167  private:
169  void LoadGenerator();
170 
172  void GenInteraction(double &Enu, double &CosThetaLab);
173 
175  void Reset();
177  void Show();
178 
180  G4double SampleNuEnergy();
181 
183  G4double SampleRecoilEnergy(G4double Enu);
184 
185  protected:
187  inline G4bool GetGenLoaded() { return fGenLoaded; };
188 
190  G4String fGenType;
192  G4String fNuType;
193 
195  G4String fNuFlavor;
196 
199 
205  TGraph *fNuSpectrum;
206 
208  std::vector<double> fEnuTbl;
209 
211  std::vector<double> fFluxTbl;
212 
214  G4double fEmax;
216  G4double fEmin;
217 
219  G4double fEnuMax;
221  G4double fEnuMin;
222 
224  G4double fFluxMax;
225 
227  G4bool fGenLoaded;
228 
230  G4double fMassElectron;
231 
233  G4double fTotalFlux;
234 
236  CLHEP::RandGeneral *fSpectrumRndm;
237 
241  G4String fDBName;
242 };
243 
244 } // namespace RAT
245 
246 #endif
Calculates neutrino-electron elastic scattering. (based on original QSNO code by F....
Definition: ESCrossSec.hh:61
Implements the generation of a neutrino-electron elastic scattering event.
Definition: ESgen.hh:92
void GenerateEvent(const G4ThreeVector &nu_dir, G4LorentzVector &neutrino, G4LorentzVector &electron)
Definition: ESgen.cc:159
G4double GetRatePerTarget()
Getter for the SSM event rate per target for this flux.
Definition: ESgen.cc:325
G4double fEmax
Definition: ESgen.hh:214
ESCrossSec * fXS
Definition: ESgen.hh:198
CLHEP::RandGeneral * fSpectrumRndm
Definition: ESgen.hh:236
G4double GetTotalFlux()
Getter for the total neutrino flux.
Definition: ESgen.hh:140
G4String fNuFlavor
Definition: ESgen.hh:195
const G4String & GetNuType() const
Definition: ESgen.hh:119
G4double fMassElectron
Definition: ESgen.hh:230
G4double fFluxMax
Definition: ESgen.hh:224
G4bool fGenLoaded
Definition: ESgen.hh:227
G4String fNuType
Definition: ESgen.hh:192
void SetNuFlavor(const G4String &nuflavor)
Definition: ESgen.cc:259
G4String fDBName
Definition: ESgen.hh:241
G4double fEnuMax
Definition: ESgen.hh:219
G4double fEnuMin
Definition: ESgen.hh:221
G4double fEmin
Definition: ESgen.hh:216
void SetNuType(const G4String &nutype)
Definition: ESgen.cc:247
std::vector< double > fFluxTbl
Definition: ESgen.hh:211
std::vector< double > fEnuTbl
Definition: ESgen.hh:208
const G4String & GetNuFlavor() const
Definition: ESgen.hh:134
void SetDBName(const G4String name)
Definition: ESgen.cc:268
G4double fTotalFlux
Definition: ESgen.hh:233
const G4String GetDBName() const
Definition: ESgen.hh:159
TGraph * fNuSpectrum
Spectrum shape to be sampled.
Definition: ESgen.hh:205
G4bool GetGenLoaded()
Definition: ESgen.hh:187
G4String fGenType
Definition: ESgen.hh:187
Definition: CCCrossSecMessenger.hh:29