LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
GPowerSpectrumAtmoFlux.h
Go to the documentation of this file.
1 //____________________________________________________________________________
15 //____________________________________________________________________________
16 
17 #pragma once
18 
19 #include <TLorentzVector.h>
20 
21 #include "GENIE/Tools/Flux/GAtmoFlux.h"
22 #include "GENIE/Framework/ParticleData/PDGCodeList.h"
23 #include "TH2D.h"
24 
25 namespace genie {
26 namespace flux {
27 
28 class GPowerSpectrumAtmoFlux: public GFluxI {
29 public:
32 
33  const PDGCodeList &FluxParticles(void) override;
34  double MaxEnergy(void) override;
35  bool GenerateNext(void) override;
36  int PdgCode(void) override;
37  double Weight(void) override;
38  const TLorentzVector& Momentum(void) override;
39  const TLorentzVector& Position(void) override;
40  bool End(void) override;
41  long int Index(void) override;
42  void Clear(Option_t *opt) override;
43  void GenerateWeighted(bool gen_weighted) override;
44 
45  double MinEnergy(void);
46  void SetSpectralIndex(double index);
47  void SetUserCoordSystem(TRotation &rotation);
48  void SetRadii(double Rlongitudinal, double Rtransverse);
49  void SetFlavors(std::vector<int> flavors);
50  void SetMinEnergy(double Emin);
51  void SetMaxEnergy(double Emax);
52  long int NFluxNeutrinos(void) const;
53  void ResetNFluxNeutrinos(void);
54  void AddFluxFile(int neutrino_pdg, string filename);
55  bool LoadFluxData(void);
56 
57  double GetFlux(int flavour, double energy, double costh, double phi);
58  double ComputeWeight(int flavour, double energy, double costh, double phi);
59  void InitializeWeight();
60 
61 
62 private:
63  PDGCodeList *fPdgCList;
64  double fMaxEvCut;
65  double fMinEvCut;
66  int fgPdgC;
67  TLorentzVector fgP4;
68  TLorentzVector fgX4;
69  double fWeight;
70  double fSpectralIndex;
71  double fRl;
72  double fRt;
74  double fAgen;
75  TRotation fRotTHz2User;
76  long int fNNeutrinos;
77  vector<int> fFluxFlavour;
78  vector<string> fFluxFile;
79  map<int, TH3D*> fRawFluxHistoMap;
80  map<int, TH2D*> fRawFluxHistoMap2D;
81 
82  bool FillFluxHisto(int nu_pdg, string filename);
83  void AddAllFluxes(void);
84  TH3D* CreateNormalisedFluxHisto( TH3D* hist); // normalise flux files
85  void ResetSelection(void);
86  void Initialize(void);
87  void CleanUp(void);
88 };
89 
90 
91 } // flux namespace
92 } // genie namespace
long int fNNeutrinos
number of flux neutrinos thrown so far
long int Index(void) override
returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current ent...
double fAgen
current generation area
GENIE neutrino interaction simulation objects.
Definition: GENIE2ART.h:19
map< int, TH3D * > fRawFluxHistoMap
flux = f(Ev,cos8,phi) for each neutrino species
TLorentzVector fgP4
current generated nu 4-momentum
const TLorentzVector & Position(void) override
returns the flux neutrino 4-position (note: expect SI rather than physical units) ...
const PDGCodeList & FluxParticles(void) override
declare list of flux neutrinos that can be generated (for init. purposes)
void GenerateWeighted(bool gen_weighted) override
set whether to generate weighted or unweighted neutrinos
A driver for a power spectrum atmospheric neutrino flux. Elements extensively reused from GAtmoFlux...
int PdgCode(void) override
returns the flux neutrino pdg code
double fSpectralIndex
power law function
bool GenerateNext(void) override
generate the next flux neutrino (return false in err)
double fRl
defining flux neutrino generation surface: longitudinal radius
double fRt
defining flux neutrino generation surface: transverse radius
bool FillFluxHisto(int nu_pdg, string filename)
void SetFlavors(std::vector< int > flavors)
void AddFluxFile(int neutrino_pdg, string filename)
TRotation fRotTHz2User
coord. system rotation: THZ -> Topocentric user-defined
double ComputeWeight(int flavour, double energy, double costh, double phi)
double fGlobalGenWeight
global generation weight to apply to all events
void Clear(Option_t *opt) override
reset state variables based on opt
double energy
Definition: plottest35.C:25
double fMinEvCut
user-defined cut: minimum energy
double Weight(void) override
returns the flux neutrino weight (if any)
vector< int > fFluxFlavour
input flux file for each neutrino species
int fgPdgC
current generated nu pdg-code
bool End(void) override
true if no more flux nu&#39;s can be thrown (eg reaching end of beam sim ntuples)
double fWeight
current generated nu weight
TH2F * hist
Definition: plot.C:134
map< int, TH2D * > fRawFluxHistoMap2D
flux = f(Ev,cos8) for each neutrino species
TLorentzVector fgX4
current generated nu 4-position
double MaxEnergy(void) override
declare the max flux neutrino energy that can be generated (for init. purposes)
PDGCodeList * fPdgCList
input list of neutrino pdg-codes
void SetRadii(double Rlongitudinal, double Rtransverse)
double fMaxEvCut
user-defined cut: maximum energy
vector< string > fFluxFile
input flux file for each neutrino species
const TLorentzVector & Momentum(void) override
returns the flux neutrino 4-momentum
double GetFlux(int flavour, double energy, double costh, double phi)
TH3D * CreateNormalisedFluxHisto(TH3D *hist)