Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
genie::flux::GAstroFlux Class Reference

A base class for the concrete astrophysical neutrino flux drivers. More...

#include <GAstroFlux.h>

Inheritance diagram for genie::flux::GAstroFlux:
genie::GFluxI genie::flux::GDiffuseAstroFlux genie::flux::GPointSourceAstroFlux

Classes

class  NuGenerator
 
class  NuPropagator
 

Public Member Functions

virtual ~GAstroFlux ()
 
virtual const PDGCodeListFluxParticles (void)
 declare list of flux neutrinos that can be generated (for init. purposes) More...
 
virtual double MaxEnergy (void)
 declare the max flux neutrino energy that can be generated (for init. purposes) More...
 
virtual bool GenerateNext (void)
 generate the next flux neutrino (return false in err) More...
 
virtual int PdgCode (void)
 returns the flux neutrino pdg code More...
 
virtual double Weight (void)
 returns the flux neutrino weight (if any) More...
 
virtual const TLorentzVector & Momentum (void)
 returns the flux neutrino 4-momentum More...
 
virtual const TLorentzVector & Position (void)
 returns the flux neutrino 4-position (note: expect SI rather than physical units) More...
 
virtual bool End (void)
 true if no more flux nu's can be thrown (eg reaching end of beam sim ntuples) More...
 
virtual long int Index (void)
 returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current entry number) More...
 
virtual void Clear (Option_t *opt)
 reset state variables based on opt More...
 
virtual void GenerateWeighted (bool gen_weighted)
 set whether to generate weighted or unweighted neutrinos More...
 
void ForceMinEnergy (double emin)
 
void ForceMaxEnergy (double emax)
 
void SetDetectorPosition (double latitude, double longitude, double depth, double size)
 
void SetRelNuPopulations (double nnue=1, double nnumu=2, double nnutau=0, double nnuebar=1, double nnumubar=2, double nnutaubar=0)
 
void SetEnergyPowLawIdx (double n)
 
void SetUserCoordSystem (TRotation &rotation)
 rotation Topocentric Horizontal -> User-defined Topocentric Coord System More...
 
- Public Member Functions inherited from genie::GFluxI
virtual ~GFluxI ()
 

Protected Member Functions

 GAstroFlux ()
 
void Initialize (void)
 
void CleanUp (void)
 
void ResetSelection (void)
 
- Protected Member Functions inherited from genie::GFluxI
 GFluxI ()
 

Protected Attributes

PDGCodeListfPdgCList
 declared list of neutrino pdg-codes that can be thrown by current instance More...
 
int fgPdgC
 (current) generated nu pdg-code More...
 
TLorentzVector fgP4
 (current) generated nu 4-momentum More...
 
TLorentzVector fgX4
 (current) generated nu 4-position More...
 
double fgWeight
 (current) generated nu weight More...
 
double fMaxEvCut
 (config) user-defined maximum energy cut More...
 
double fMinEvCut
 (config) user-defined minimum energy cut More...
 
bool fGenWeighted
 (config) generate a weighted or unweighted flux? More...
 
double fDetGeoLatitude
 (config) detector: geographic latitude More...
 
double fDetGeoLongitude
 (config) detector: geographic longitude More...
 
double fDetGeoDepth
 (config) detector: depth from surface More...
 
double fDetSize
 (config) detector: size (detector should be enclosed in sphere of this radius) More...
 
map< int, double > fRelNuPopulations
 (config) relative neutrino populations More...
 
TRotation fRotGEF2THz
 (config) coord. system rotation: GEF translated to detector centre -> THZ More...
 
TRotation fRotTHz2User
 (config) coord. system rotation: THZ -> Topocentric user-defined More...
 
TVector3 fDetCenter
 
TH1D * fEnergySpectrum
 
TH2D * fSolidAngleAcceptance
 
NuGeneratorfNuGen
 
NuPropagatorfNuPropg
 

Detailed Description

A base class for the concrete astrophysical neutrino flux drivers.

<<<< NOTE: CODE UNDER DEVELOPMENT >>>>

COORDINATE SYSTEMS / NEUTRINO GENERATION & PROPAGATION :

Neutrinos are generated on a sphere with radius R_{earth}. Especially,

Initially, neutrino coordinates are generated in the Geocentric Earth- Fixed (GEF) Coordinate System (later to be converted to the appropriate detector coordinate system - See further below).

Definition: Geocentric Earth-Fixed (GEF) Coordinate System +z: Points to North Pole. xy: Equatorial plane. +x: Points to the Prime Meridian. +y: As needed to make a right-handed coordinate system.

Neutrinos are then propagated towards the detector. The Earth opaqueness to ultra high energy neutrinos is taken into account. The Earth density profile is modelled using the PREM (Preliminary Earth Model, The Encyclopedia of Solid Earth Geophysics, David E. James, ed., Van Nostrand Reinhold, New York, 1989, p.331).

The detector position is determined in the Spherical/Geographic System by its geographic latitude (angle relative to Equator), its geographic longitude (angle relative to Prime Meridian) and its depth from the surface.

The generated flux neutrinos, propagated through the Earth towards the detector) are then positioned on the surface of a sphere with radius Rd which should fully enclose the neutrino detector. The centre of that sphere is taken to be the origin of the detector coordinate system. The transverse coords are appropriately randomized so that neutrinos from any given direction bath the entire sphere enclosing the detector.

The final flux neutrino coordinates are given in the detector coordinate system. The default detector coordinate system is the Topocentric Horizontal (THZ) Coordinate System. Alternative user-defined topocentric systems can be defined by specifying the appropriate rotation from THZ.

Definition: Topocentric Horizontal (THZ) Coordinate System (default detector coordinate system) +z: Points towards the local zenith. +x: On same plane as local meridian, pointing south. +y: As needed to make a right-handed coordinate system. origin: detector centre

WEIGHTING SCHEMES:

For a detector with geometrical cross section ~ 1km^2, the solid angle acceptance changes by ~10 orders of magnitude across the surface of the Earth.

The driver supports both weighted and un-weighted flux generation schemes. However, because of the enormous changes in solid angle acceptance and energy, only the weighted scheme is practical.

PHYSICS:

The relative neutrino population needs to be set by the user using the SetRelNuPopulations() method. If run without arguments, the following relative populations are set: nue:numu:nutau:nuebar:numubar:nutaubar = 1:2:0:1:2:0

The energy spectrum is follows a power law. The user needs to specify the power-law index by calling SetEnergyPowLawIdx().

Author
Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

March 27, 2010

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 126 of file GAstroFlux.h.

Constructor & Destructor Documentation

GAstroFlux::~GAstroFlux ( )
virtual

Definition at line 37 of file GAstroFlux.cxx.

38 {
39  this->CleanUp();
40 }
GAstroFlux::GAstroFlux ( )
protected

Definition at line 32 of file GAstroFlux.cxx.

33 {
34  this->Initialize();
35 }

Member Function Documentation

void GAstroFlux::CleanUp ( void  )
protected

Definition at line 342 of file GAstroFlux.cxx.

343 {
344  LOG("Flux", pNOTICE) << "Cleaning up...";
345 
346  fRelNuPopulations.clear();
347  fPdgCList->clear();
348 
349  delete fPdgCList;
350  if(fEnergySpectrum) delete fEnergySpectrum;
352 
353  delete fNuGen;
354  delete fNuPropg;
355 }
map< int, double > fRelNuPopulations
(config) relative neutrino populations
Definition: GAstroFlux.h:186
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
NuGenerator * fNuGen
Definition: GAstroFlux.h:193
PDGCodeList * fPdgCList
declared list of neutrino pdg-codes that can be thrown by current instance
Definition: GAstroFlux.h:173
#define pNOTICE
Definition: Messenger.h:61
NuPropagator * fNuPropg
Definition: GAstroFlux.h:194
void GAstroFlux::Clear ( Option_t *  opt)
virtual

reset state variables based on opt

Implements genie::GFluxI.

Definition at line 150 of file GAstroFlux.cxx.

151 {
152 // Dummy clear method needed to conform to GFluxI interface
153 //
154  LOG("Flux", pERROR) << "No clear method implemented for option:"<< opt;
155 }
#define pERROR
Definition: Messenger.h:59
opt
Definition: train.py:196
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
virtual bool genie::flux::GAstroFlux::End ( void  )
inlinevirtual

true if no more flux nu's can be thrown (eg reaching end of beam sim ntuples)

Implements genie::GFluxI.

Definition at line 141 of file GAstroFlux.h.

141 { return false; }
virtual const PDGCodeList& genie::flux::GAstroFlux::FluxParticles ( void  )
inlinevirtual

declare list of flux neutrinos that can be generated (for init. purposes)

Implements genie::GFluxI.

Definition at line 134 of file GAstroFlux.h.

134 { return *fPdgCList; }
PDGCodeList * fPdgCList
declared list of neutrino pdg-codes that can be thrown by current instance
Definition: GAstroFlux.h:173
void GAstroFlux::ForceMaxEnergy ( double  emax)

Definition at line 144 of file GAstroFlux.cxx.

145 {
146  emax = TMath::Max(0., emax/units::GeV);
147  fMaxEvCut = emax;
148 }
double fMaxEvCut
(config) user-defined maximum energy cut
Definition: GAstroFlux.h:179
static constexpr double GeV
Definition: Units.h:28
void GAstroFlux::ForceMinEnergy ( double  emin)

Definition at line 138 of file GAstroFlux.cxx.

139 {
140  emin = TMath::Max(0., emin/units::GeV);
141  fMinEvCut = emin;
142 }
double fMinEvCut
(config) user-defined minimum energy cut
Definition: GAstroFlux.h:180
static constexpr double GeV
Definition: Units.h:28
bool GAstroFlux::GenerateNext ( void  )
virtual

generate the next flux neutrino (return false in err)

Implements genie::GFluxI.

Reimplemented in genie::flux::GPointSourceAstroFlux.

Definition at line 47 of file GAstroFlux.cxx.

48 {
49  // Reset previously generated neutrino code / 4-p / 4-x
50  this->ResetSelection();
51 
52  if(!fEnergySpectrum) {
53  return false;
54  }
56  return false;
57  }
58  if(fRelNuPopulations.size() == 0) {
59  return false;
60  }
61 
62  //
63  // Generate neutrino energy & starting position at the Geocentric
64  // coordinate system
65  //
66 
67  double log10Emin = TMath::Log10(TMath::Max(kAstroDefMinEv,fMinEvCut));
68  double log10Emax = TMath::Log10(TMath::Min(kAstroDefMaxEv,fMaxEvCut));
69 
70  double wght_species = 1.;
71  double wght_energy = 1.;
72  double wght_origin = 1.;
73 
74  int nupdg = 0;
75  double log10E = -99999;
76  double phi = -999999;
77  double costheta = -999999;
78 
79  bool status = true;
80 
81  status = fNuGen->SelectNuPdg(
82  fGenWeighted, fRelNuPopulations, nupdg, wght_species);
83  if(!status) {
84  return false;
85  }
86 
87  status = fNuGen->SelectEnergy(
88  fGenWeighted, *fEnergySpectrum, log10Emin, log10Emax, log10E, wght_energy);
89  if(!status) {
90  return false;
91  }
92  double Ev = TMath::Power(10.,log10E);
93 
94  status = fNuGen->SelectOrigin(
95  fGenWeighted, *fSolidAngleAcceptance, phi, costheta, wght_origin);
96  if(!status) {
97  return false;
98  }
99 
100  //
101  // Propagate through the Earth: Get position, 4-momentum and neutrino
102  // pdg code at the boundary of the detector volume
103  //
104 
105  status = fNuPropg->Go(phi, costheta, fDetCenter, fDetSize, nupdg, Ev);
106  if(!status) {
107  return false;
108  }
109 
110  int pnupdg = fNuPropg->NuPdgAtDetVolBoundary();
111  TVector3 & px3 = fNuPropg->X3AtDetVolBoundary();
112  TVector3 & pp3 = fNuPropg->P3AtDetVolBoundary();
113 
114  //
115  // Rotate vectors:
116 
117  // GEF translated to detector centre -> THZ
118  px3 = fRotGEF2THz * px3;
119  pp3 = fRotGEF2THz * pp3;
120 
121  // THZ -> Topocentric user-defined detetor system
122  px3 = fRotTHz2User * px3;
123  pp3 = fRotTHz2User * pp3;
124 
125  //
126  // Set position, momentum, pdg code and weight variables reported back
127  //
128  fgWeight = wght_species * wght_energy * wght_origin;
129  fgPdgC = pnupdg;
130  fgX4.SetVect(px3*(units::m/units::km));
131  fgX4.SetT(0.);
132  fgP4.SetVect(pp3);
133  fgP4.SetE(pp3.Mag());
134 
135  return true;
136 }
TLorentzVector fgP4
(current) generated nu 4-momentum
Definition: GAstroFlux.h:175
double fDetSize
(config) detector: size (detector should be enclosed in sphere of this radius)
Definition: GAstroFlux.h:185
double fMinEvCut
(config) user-defined minimum energy cut
Definition: GAstroFlux.h:180
bool fGenWeighted
(config) generate a weighted or unweighted flux?
Definition: GAstroFlux.h:181
TRotation fRotTHz2User
(config) coord. system rotation: THZ -> Topocentric user-defined
Definition: GAstroFlux.h:188
double fMaxEvCut
(config) user-defined maximum energy cut
Definition: GAstroFlux.h:179
const double kAstroDefMaxEv
Definition: GAstroFlux.h:116
map< int, double > fRelNuPopulations
(config) relative neutrino populations
Definition: GAstroFlux.h:186
static constexpr double km
Definition: Units.h:64
bool SelectNuPdg(bool weighted, const map< int, double > &nupdgpdf, int &nupdg, double &wght)
Definition: GAstroFlux.cxx:363
TRotation fRotGEF2THz
(config) coord. system rotation: GEF translated to detector centre -> THZ
Definition: GAstroFlux.h:187
NuGenerator * fNuGen
Definition: GAstroFlux.h:193
bool SelectEnergy(bool weighted, TH1D &log10epdf, double log10emin, double log10emax, double &log10e, double &wght)
Definition: GAstroFlux.cxx:411
int fgPdgC
(current) generated nu pdg-code
Definition: GAstroFlux.h:174
bool SelectOrigin(bool weighted, TH2D &opdf, double &phi, double &costheta, double &wght)
Definition: GAstroFlux.cxx:446
bool Go(double phi_start, double costheta_start, const TVector3 &detector_centre, double detector_sz, int nu_pdg, double Ev)
Definition: GAstroFlux.cxx:473
TLorentzVector fgX4
(current) generated nu 4-position
Definition: GAstroFlux.h:176
NuPropagator * fNuPropg
Definition: GAstroFlux.h:194
const double kAstroDefMinEv
Definition: GAstroFlux.h:117
static constexpr double m
Definition: Units.h:71
double fgWeight
(current) generated nu weight
Definition: GAstroFlux.h:177
void GAstroFlux::GenerateWeighted ( bool  gen_weighted)
virtual

set whether to generate weighted or unweighted neutrinos

Implements genie::GFluxI.

Definition at line 157 of file GAstroFlux.cxx.

158 {
159  fGenWeighted = gen_weighted;
160 }
bool fGenWeighted
(config) generate a weighted or unweighted flux?
Definition: GAstroFlux.h:181
virtual long int genie::flux::GAstroFlux::Index ( void  )
inlinevirtual

returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current entry number)

Implements genie::GFluxI.

Definition at line 142 of file GAstroFlux.h.

142 { return -1; }
void GAstroFlux::Initialize ( void  )
protected

Definition at line 286 of file GAstroFlux.cxx.

287 {
288  LOG("Flux", pNOTICE) << "Initializing flux driver";
289 
290  bool allow_dup = false;
291  fPdgCList = new PDGCodeList(allow_dup);
292 
293  // Default: No min/max energy cut
296 
297  // Generate weighted or un-weighted flux?
298  fGenWeighted = true;
299 
300  // Detector position & size
301  fDetGeoLatitude = -1.;
302  fDetGeoLongitude = -1.;
303  fDetGeoDepth = -1.;
304  fDetSize = -1.;
305  fDetCenter.SetXYZ(0,0,0); // in the geocentric coord system
306 
307  // Normalized 2-D histogram (phi,costheta): detector solid angle
308  // as seen from different positions across the face of the Earth
310 
311  // Neutrino energy spectrum
312  // To be set via SetEnergyPowLawIdx()
313  // Can be trivially modified to accomodate different spectra
314  fEnergySpectrum = 0;
315 
316  // Relative neutrino populations
317  // To be set via SetRelNuPopulations()
318  // Default nue:numu:nutau:nuebar:numubar:nutaubar = 1:2:0:1:2:0
319  fRelNuPopulations.clear();
320 
321  // Rotations
322  fRotGEF2THz.SetToIdentity();
323  fRotTHz2User.SetToIdentity();
324 
325  // Utility objects for generating and propagating neutrinos
326  fNuGen = new NuGenerator();
327  fNuPropg = new NuPropagator(1.0*units::km);
328 
329  // Reset `current' selected flux neutrino
330  this->ResetSelection();
331 }
void ForceMinEnergy(double emin)
Definition: GAstroFlux.cxx:138
double fDetSize
(config) detector: size (detector should be enclosed in sphere of this radius)
Definition: GAstroFlux.h:185
bool fGenWeighted
(config) generate a weighted or unweighted flux?
Definition: GAstroFlux.h:181
TRotation fRotTHz2User
(config) coord. system rotation: THZ -> Topocentric user-defined
Definition: GAstroFlux.h:188
const double kAstroDefMaxEv
Definition: GAstroFlux.h:116
void ForceMaxEnergy(double emax)
Definition: GAstroFlux.cxx:144
map< int, double > fRelNuPopulations
(config) relative neutrino populations
Definition: GAstroFlux.h:186
static constexpr double km
Definition: Units.h:64
A list of PDG codes.
Definition: PDGCodeList.h:32
double fDetGeoDepth
(config) detector: depth from surface
Definition: GAstroFlux.h:184
TRotation fRotGEF2THz
(config) coord. system rotation: GEF translated to detector centre -> THZ
Definition: GAstroFlux.h:187
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
NuGenerator * fNuGen
Definition: GAstroFlux.h:193
double fDetGeoLongitude
(config) detector: geographic longitude
Definition: GAstroFlux.h:183
double fDetGeoLatitude
(config) detector: geographic latitude
Definition: GAstroFlux.h:182
PDGCodeList * fPdgCList
declared list of neutrino pdg-codes that can be thrown by current instance
Definition: GAstroFlux.h:173
#define pNOTICE
Definition: Messenger.h:61
NuPropagator * fNuPropg
Definition: GAstroFlux.h:194
const double kAstroDefMinEv
Definition: GAstroFlux.h:117
double GAstroFlux::MaxEnergy ( void  )
virtual

declare the max flux neutrino energy that can be generated (for init. purposes)

Implements genie::GFluxI.

Definition at line 42 of file GAstroFlux.cxx.

43 {
44  return TMath::Min(kAstroDefMaxEv, fMaxEvCut);
45 }
double fMaxEvCut
(config) user-defined maximum energy cut
Definition: GAstroFlux.h:179
const double kAstroDefMaxEv
Definition: GAstroFlux.h:116
virtual const TLorentzVector& genie::flux::GAstroFlux::Momentum ( void  )
inlinevirtual

returns the flux neutrino 4-momentum

Implements genie::GFluxI.

Definition at line 139 of file GAstroFlux.h.

139 { return fgP4; }
TLorentzVector fgP4
(current) generated nu 4-momentum
Definition: GAstroFlux.h:175
virtual int genie::flux::GAstroFlux::PdgCode ( void  )
inlinevirtual

returns the flux neutrino pdg code

Implements genie::GFluxI.

Definition at line 137 of file GAstroFlux.h.

137 { return fgPdgC; }
int fgPdgC
(current) generated nu pdg-code
Definition: GAstroFlux.h:174
virtual const TLorentzVector& genie::flux::GAstroFlux::Position ( void  )
inlinevirtual

returns the flux neutrino 4-position (note: expect SI rather than physical units)

Implements genie::GFluxI.

Definition at line 140 of file GAstroFlux.h.

140 { return fgX4; }
TLorentzVector fgX4
(current) generated nu 4-position
Definition: GAstroFlux.h:176
void GAstroFlux::ResetSelection ( void  )
protected

Definition at line 333 of file GAstroFlux.cxx.

334 {
335 // initializing running neutrino pdg-code, 4-position, 4-momentum
336 
337  fgPdgC = 0;
338  fgP4.SetPxPyPzE (0.,0.,0.,0.);
339  fgX4.SetXYZT (0.,0.,0.,0.);
340 }
TLorentzVector fgP4
(current) generated nu 4-momentum
Definition: GAstroFlux.h:175
int fgPdgC
(current) generated nu pdg-code
Definition: GAstroFlux.h:174
TLorentzVector fgX4
(current) generated nu 4-position
Definition: GAstroFlux.h:176
void GAstroFlux::SetDetectorPosition ( double  latitude,
double  longitude,
double  depth,
double  size 
)

Definition at line 162 of file GAstroFlux.cxx.

164 {
165  depth = TMath::Max(0., depth/units::km);
166  size = TMath::Max(0., size /units::km);
167 
168  assert(latitude >= -kPi/2. && latitude <= kPi/2.);
169  assert(longitude >= 0. && longitude < 2.*kPi );
170 
171  // set inputs
172  fDetGeoLatitude = latitude;
173  fDetGeoLongitude = longitude;
174  fDetGeoDepth = depth;
175  fDetSize = size;
176 
177  //
178  // Compute detector/topocentric coordinate system center in the
179  // geocentric coordinate system.
180  //
181 
182  double REarth = constants::kREarth/units::km;
183  double radius = REarth - fDetGeoDepth;
184 
185  double theta = kPi/2. - fDetGeoLatitude;
186  double phi = fDetGeoLongitude;
187 
188  double sintheta = TMath::Sin(theta);
189  double costheta = TMath::Cos(theta);
190  double sinphi = TMath::Sin(phi);
191  double cosphi = TMath::Cos(phi);
192 
193  double xdc = radius * sintheta * cosphi;
194  double ydc = radius * sintheta * sinphi;
195  double zdc = radius * costheta;
196 
197  fDetCenter.SetXYZ(xdc,ydc,zdc);
198 
199  //
200  // Coordinate System Rotation:
201  // GEF translated to detector centre -> THZ
202  //
203  // ...
204  // ... TODO
205  // ...
206 }
double fDetSize
(config) detector: size (detector should be enclosed in sphere of this radius)
Definition: GAstroFlux.h:185
static constexpr double km
Definition: Units.h:64
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
double fDetGeoDepth
(config) detector: depth from surface
Definition: GAstroFlux.h:184
double fDetGeoLongitude
(config) detector: geographic longitude
Definition: GAstroFlux.h:183
double fDetGeoLatitude
(config) detector: geographic latitude
Definition: GAstroFlux.h:182
static const double kREarth
Definition: Constants.h:110
static const double kPi
Definition: Constants.h:37
void GAstroFlux::SetEnergyPowLawIdx ( double  n)

Definition at line 258 of file GAstroFlux.cxx.

259 {
260  if(fEnergySpectrum) delete fEnergySpectrum;
261 
262  double log10Emin = TMath::Log10(kAstroDefMinEv);
263  double log10Emax = TMath::Log10(kAstroDefMaxEv);
264 
266  new TH1D("fEnergySpectrum","",kAstroNlog10EvBins,log10Emin,log10Emax);
267  fEnergySpectrum->SetDirectory(0);
268 
269  for(int i=1; i<=kAstroNlog10EvBins; i++) {
270  double log10E = fEnergySpectrum->GetBinCenter(i);
271  double Ev = TMath::Power(10., log10E);
272  double flux = TMath::Power(Ev, -1*n);
273  fEnergySpectrum->SetBinContent(i,flux);
274  }
275 
276  // normalize
277  double max = fEnergySpectrum->GetMaximum();
278  fEnergySpectrum->Scale(1./max);
279 }
const double kAstroDefMaxEv
Definition: GAstroFlux.h:116
std::void_t< T > n
static int max(int a, int b)
const int kAstroNlog10EvBins
Definition: GAstroFlux.h:118
const double kAstroDefMinEv
Definition: GAstroFlux.h:117
void GAstroFlux::SetRelNuPopulations ( double  nnue = 1,
double  nnumu = 2,
double  nnutau = 0,
double  nnuebar = 1,
double  nnumubar = 2,
double  nnutaubar = 0 
)

Definition at line 208 of file GAstroFlux.cxx.

211 {
212  fRelNuPopulations.clear();
213  fPdgCList->clear();
214 
215  if(nnue>0.) {
216  fRelNuPopulations.insert(
217  map<int,double>::value_type(kPdgNuE, nnue));
219  }
220  if(nnumu>0.) {
221  fRelNuPopulations.insert(
222  map<int,double>::value_type(kPdgNuMu, nnumu));
224  }
225  if(nnutau>0.) {
226  fRelNuPopulations.insert(
227  map<int,double>::value_type(kPdgNuTau, nnutau));
229  }
230  if(nnuebar>0.) {
231  fRelNuPopulations.insert(
232  map<int,double>::value_type(kPdgAntiNuE, nnuebar));
234  }
235  if(nnumubar>0.) {
236  fRelNuPopulations.insert(
237  map<int,double>::value_type(kPdgAntiNuMu, nnumubar));
239  }
240  if(nnutaubar>0.) {
241  fRelNuPopulations.insert(
242  map<int,double>::value_type(kPdgAntiNuTau, nnutaubar));
244  }
245 
246  double tot = nnue + nnumu + nnutau + nnuebar + nnumubar + nnutaubar;
247  assert(tot>0.);
248 
249  // normalize to 1.
251  for ( ; iter != fRelNuPopulations.end(); ++iter) {
252  double fraction = iter->second;
253  double norm_fraction = fraction/tot;
254  fRelNuPopulations[iter->first] = norm_fraction;
255  }
256 }
intermediate_table::iterator iterator
const int kPdgNuE
Definition: PDGCodes.h:28
const int kPdgAntiNuE
Definition: PDGCodes.h:29
const int kPdgNuMu
Definition: PDGCodes.h:30
map< int, double > fRelNuPopulations
(config) relative neutrino populations
Definition: GAstroFlux.h:186
const int kPdgAntiNuTau
Definition: PDGCodes.h:33
const int kPdgAntiNuMu
Definition: PDGCodes.h:31
PDGCodeList * fPdgCList
declared list of neutrino pdg-codes that can be thrown by current instance
Definition: GAstroFlux.h:173
const int kPdgNuTau
Definition: PDGCodes.h:32
void push_back(int pdg_code)
Definition: PDGCodeList.cxx:58
void GAstroFlux::SetUserCoordSystem ( TRotation &  rotation)

rotation Topocentric Horizontal -> User-defined Topocentric Coord System

Definition at line 281 of file GAstroFlux.cxx.

282 {
283  fRotTHz2User = rotation;
284 }
TRotation fRotTHz2User
(config) coord. system rotation: THZ -> Topocentric user-defined
Definition: GAstroFlux.h:188
virtual double genie::flux::GAstroFlux::Weight ( void  )
inlinevirtual

returns the flux neutrino weight (if any)

Implements genie::GFluxI.

Definition at line 138 of file GAstroFlux.h.

138 { return fgWeight; }
double fgWeight
(current) generated nu weight
Definition: GAstroFlux.h:177

Member Data Documentation

TVector3 genie::flux::GAstroFlux::fDetCenter
protected

Definition at line 190 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fDetGeoDepth
protected

(config) detector: depth from surface

Definition at line 184 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fDetGeoLatitude
protected

(config) detector: geographic latitude

Definition at line 182 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fDetGeoLongitude
protected

(config) detector: geographic longitude

Definition at line 183 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fDetSize
protected

(config) detector: size (detector should be enclosed in sphere of this radius)

Definition at line 185 of file GAstroFlux.h.

TH1D* genie::flux::GAstroFlux::fEnergySpectrum
protected

Definition at line 191 of file GAstroFlux.h.

bool genie::flux::GAstroFlux::fGenWeighted
protected

(config) generate a weighted or unweighted flux?

Definition at line 181 of file GAstroFlux.h.

TLorentzVector genie::flux::GAstroFlux::fgP4
protected

(current) generated nu 4-momentum

Definition at line 175 of file GAstroFlux.h.

int genie::flux::GAstroFlux::fgPdgC
protected

(current) generated nu pdg-code

Definition at line 174 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fgWeight
protected

(current) generated nu weight

Definition at line 177 of file GAstroFlux.h.

TLorentzVector genie::flux::GAstroFlux::fgX4
protected

(current) generated nu 4-position

Definition at line 176 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fMaxEvCut
protected

(config) user-defined maximum energy cut

Definition at line 179 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fMinEvCut
protected

(config) user-defined minimum energy cut

Definition at line 180 of file GAstroFlux.h.

NuGenerator* genie::flux::GAstroFlux::fNuGen
protected

Definition at line 193 of file GAstroFlux.h.

NuPropagator* genie::flux::GAstroFlux::fNuPropg
protected

Definition at line 194 of file GAstroFlux.h.

PDGCodeList* genie::flux::GAstroFlux::fPdgCList
protected

declared list of neutrino pdg-codes that can be thrown by current instance

Definition at line 173 of file GAstroFlux.h.

map<int,double> genie::flux::GAstroFlux::fRelNuPopulations
protected

(config) relative neutrino populations

Definition at line 186 of file GAstroFlux.h.

TRotation genie::flux::GAstroFlux::fRotGEF2THz
protected

(config) coord. system rotation: GEF translated to detector centre -> THZ

Definition at line 187 of file GAstroFlux.h.

TRotation genie::flux::GAstroFlux::fRotTHz2User
protected

(config) coord. system rotation: THZ -> Topocentric user-defined

Definition at line 188 of file GAstroFlux.h.

TH2D* genie::flux::GAstroFlux::fSolidAngleAcceptance
protected

Definition at line 192 of file GAstroFlux.h.


The documentation for this class was generated from the following files: