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 "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Tools/Flux/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...
 

Protected Member Functions

 GAstroFlux ()
 
void Initialize (void)
 
void CleanUp (void)
 
void ResetSelection (void)
 

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,
      - For diffuse fluxes: 
        Neutrinos can be generated anywhere on that surface. 
      - For point sources: 
        Neutrinos are generated at fixed right ascension and declination. 
        Then time is randomized, to account for Earth's rotation, and the 
        Equatorial Coordinates are converted to GEF. So, neutrinos from each
        point source are generated on circles parallel to the Earth's Equator.

      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 <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

March 27, 2010

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

Definition at line 129 of file GAstroFlux.h.

Constructor & Destructor Documentation

GAstroFlux::~GAstroFlux ( )
virtual

Definition at line 49 of file GAstroFlux.cxx.

50 {
51  this->CleanUp();
52 }
GAstroFlux::GAstroFlux ( )
protected

Definition at line 44 of file GAstroFlux.cxx.

References TMVAGlob::Initialize().

Referenced by Index().

45 {
46  this->Initialize();
47 }

Member Function Documentation

void GAstroFlux::CleanUp ( void  )
protected

Definition at line 354 of file GAstroFlux.cxx.

References LOG, and pNOTICE.

Referenced by Index().

355 {
356  LOG("Flux", pNOTICE) << "Cleaning up...";
357 
358  fRelNuPopulations.clear();
359  fPdgCList->clear();
360 
361  delete fPdgCList;
362  if(fEnergySpectrum) delete fEnergySpectrum;
364 
365  delete fNuGen;
366  delete fNuPropg;
367 }
map< int, double > fRelNuPopulations
(config) relative neutrino populations
Definition: GAstroFlux.h:189
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
NuGenerator * fNuGen
Definition: GAstroFlux.h:196
PDGCodeList * fPdgCList
declared list of neutrino pdg-codes that can be thrown by current instance
Definition: GAstroFlux.h:176
#define pNOTICE
Definition: Messenger.h:62
NuPropagator * fNuPropg
Definition: GAstroFlux.h:197
void GAstroFlux::Clear ( Option_t *  opt)
virtual

reset state variables based on opt

Implements genie::GFluxI.

Definition at line 162 of file GAstroFlux.cxx.

References LOG, MECModelEnuComparisons::opt, and pERROR.

Referenced by Index().

163 {
164 // Dummy clear method needed to conform to GFluxI interface
165 //
166  LOG("Flux", pERROR) << "No clear method implemented for option:"<< opt;
167 }
#define pERROR
Definition: Messenger.h:60
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
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 144 of file GAstroFlux.h.

144 { 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 137 of file GAstroFlux.h.

References fPdgCList, GenerateNext(), and MaxEnergy().

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

Definition at line 156 of file GAstroFlux.cxx.

References emax, and genie::units::GeV.

Referenced by Index(), and main().

157 {
158  emax = TMath::Max(0., emax/units::GeV);
159  fMaxEvCut = emax;
160 }
double fMaxEvCut
(config) user-defined maximum energy cut
Definition: GAstroFlux.h:182
const double emax
static const double GeV
Definition: Units.h:29
void GAstroFlux::ForceMinEnergy ( double  emin)

Definition at line 150 of file GAstroFlux.cxx.

References emin, and genie::units::GeV.

Referenced by Index(), and main().

151 {
152  emin = TMath::Max(0., emin/units::GeV);
153  fMinEvCut = emin;
154 }
double fMinEvCut
(config) user-defined minimum energy cut
Definition: GAstroFlux.h:183
const double emin
static const double GeV
Definition: Units.h:29
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 59 of file GAstroFlux.cxx.

References genie::flux::kAstroDefMaxEv, genie::flux::kAstroDefMinEv, genie::units::km, genie::units::m, and fabricate::status.

Referenced by FluxParticles(), and main().

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

set whether to generate weighted or unweighted neutrinos

Implements genie::GFluxI.

Definition at line 169 of file GAstroFlux.cxx.

Referenced by Index(), and main().

170 {
171  fGenWeighted = gen_weighted;
172 }
bool fGenWeighted
(config) generate a weighted or unweighted flux?
Definition: GAstroFlux.h:184
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 145 of file GAstroFlux.h.

References CleanUp(), Clear(), emax, emin, ForceMaxEnergy(), ForceMinEnergy(), GAstroFlux(), GenerateWeighted(), Initialize(), getGoodRuns4SAM::n, nnue, MECModelEnuComparisons::opt, ResetSelection(), SetDetectorPosition(), SetEnergyPowLawIdx(), SetRelNuPopulations(), SetUserCoordSystem(), and gen_flatrecord::size.

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

Definition at line 298 of file GAstroFlux.cxx.

References genie::flux::kAstroDefMaxEv, genie::flux::kAstroDefMinEv, genie::units::km, LOG, and pNOTICE.

Referenced by Index().

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

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

Implements genie::GFluxI.

Definition at line 54 of file GAstroFlux.cxx.

References genie::flux::kAstroDefMaxEv.

Referenced by FluxParticles().

55 {
56  return TMath::Min(kAstroDefMaxEv, fMaxEvCut);
57 }
double fMaxEvCut
(config) user-defined maximum energy cut
Definition: GAstroFlux.h:182
const double kAstroDefMaxEv
Definition: GAstroFlux.h:119
virtual const TLorentzVector& genie::flux::GAstroFlux::Momentum ( void  )
inlinevirtual

returns the flux neutrino 4-momentum

Implements genie::GFluxI.

Definition at line 142 of file GAstroFlux.h.

References fgP4.

Referenced by main().

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

returns the flux neutrino pdg code

Implements genie::GFluxI.

Definition at line 140 of file GAstroFlux.h.

References fgPdgC.

Referenced by main().

140 { return fgPdgC; }
int fgPdgC
(current) generated nu pdg-code
Definition: GAstroFlux.h:177
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 143 of file GAstroFlux.h.

References fgX4.

Referenced by main().

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

Definition at line 345 of file GAstroFlux.cxx.

Referenced by Index().

346 {
347 // initializing running neutrino pdg-code, 4-position, 4-momentum
348 
349  fgPdgC = 0;
350  fgP4.SetPxPyPzE (0.,0.,0.,0.);
351  fgX4.SetXYZT (0.,0.,0.,0.);
352 }
TLorentzVector fgP4
(current) generated nu 4-momentum
Definition: GAstroFlux.h:178
int fgPdgC
(current) generated nu pdg-code
Definition: GAstroFlux.h:177
TLorentzVector fgX4
(current) generated nu 4-position
Definition: GAstroFlux.h:179
void GAstroFlux::SetDetectorPosition ( double  latitude,
double  longitude,
double  depth,
double  size 
)

Definition at line 174 of file GAstroFlux.cxx.

References ana::assert(), genie::units::km, kPi, genie::constants::kREarth, radius, gen_flatrecord::size, and chisquared::theta.

Referenced by Index(), and main().

176 {
177  depth = TMath::Max(0., depth/units::km);
178  size = TMath::Max(0., size /units::km);
179 
180  assert(latitude >= -kPi/2. && latitude <= kPi/2.);
181  assert(longitude >= 0. && longitude < 2.*kPi );
182 
183  // set inputs
184  fDetGeoLatitude = latitude;
185  fDetGeoLongitude = longitude;
186  fDetGeoDepth = depth;
187  fDetSize = size;
188 
189  //
190  // Compute detector/topocentric coordinate system center in the
191  // geocentric coordinate system.
192  //
193 
194  double REarth = constants::kREarth/units::km;
195  double radius = REarth - fDetGeoDepth;
196 
197  double theta = kPi/2. - fDetGeoLatitude;
198  double phi = fDetGeoLongitude;
199 
200  double sintheta = TMath::Sin(theta);
201  double costheta = TMath::Cos(theta);
202  double sinphi = TMath::Sin(phi);
203  double cosphi = TMath::Cos(phi);
204 
205  double xdc = radius * sintheta * cosphi;
206  double ydc = radius * sintheta * sinphi;
207  double zdc = radius * costheta;
208 
209  fDetCenter.SetXYZ(xdc,ydc,zdc);
210 
211  //
212  // Coordinate System Rotation:
213  // GEF translated to detector centre -> THZ
214  //
215  // ...
216  // ... TODO
217  // ...
218 }
const double kPi
double fDetSize
(config) detector: size (detector should be enclosed in sphere of this radius)
Definition: GAstroFlux.h:188
static const double km
Definition: Units.h:72
double fDetGeoDepth
(config) detector: depth from surface
Definition: GAstroFlux.h:187
double fDetGeoLongitude
(config) detector: geographic longitude
Definition: GAstroFlux.h:186
Double_t radius
double fDetGeoLatitude
(config) detector: geographic latitude
Definition: GAstroFlux.h:185
static const double kREarth
Definition: Constants.h:111
assert(nhit_max >=nhit_nbins)
void GAstroFlux::SetEnergyPowLawIdx ( double  n)

Definition at line 270 of file GAstroFlux.cxx.

References flux, MECModelEnuComparisons::i, genie::flux::kAstroDefMaxEv, genie::flux::kAstroDefMinEv, genie::flux::kAstroNlog10EvBins, and cet::sqlite::max().

Referenced by Index(), and main().

271 {
272  if(fEnergySpectrum) delete fEnergySpectrum;
273 
274  double log10Emin = TMath::Log10(kAstroDefMinEv);
275  double log10Emax = TMath::Log10(kAstroDefMaxEv);
276 
277  fEnergySpectrum =
278  new TH1D("fEnergySpectrum","",kAstroNlog10EvBins,log10Emin,log10Emax);
279  fEnergySpectrum->SetDirectory(0);
280 
281  for(int i=1; i<=kAstroNlog10EvBins; i++) {
282  double log10E = fEnergySpectrum->GetBinCenter(i);
283  double Ev = TMath::Power(10., log10E);
284  double flux = TMath::Power(Ev, -1*n);
285  fEnergySpectrum->SetBinContent(i,flux);
286  }
287 
288  // normalize
289  double max = fEnergySpectrum->GetMaximum();
290  fEnergySpectrum->Scale(1./max);
291 }
const double kAstroDefMaxEv
Definition: GAstroFlux.h:119
Loaders::FluxType flux
const int kAstroNlog10EvBins
Definition: GAstroFlux.h:121
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
const double kAstroDefMinEv
Definition: GAstroFlux.h:120
void GAstroFlux::SetRelNuPopulations ( double  nnue = 1,
double  nnumu = 2,
double  nnutau = 0,
double  nnuebar = 1,
double  nnumubar = 2,
double  nnutaubar = 0 
)

Definition at line 220 of file GAstroFlux.cxx.

References ana::assert(), genie::kPdgAntiNuE, genie::kPdgAntiNuMu, genie::kPdgAntiNuTau, genie::kPdgNuE, genie::kPdgNuMu, genie::kPdgNuTau, and PandAna.Demos.pi0_spectra::tot.

Referenced by Index(), and main().

223 {
224  fRelNuPopulations.clear();
225  fPdgCList->clear();
226 
227  if(nnue>0.) {
228  fRelNuPopulations.insert(
229  map<int,double>::value_type(kPdgNuE, nnue));
231  }
232  if(nnumu>0.) {
233  fRelNuPopulations.insert(
234  map<int,double>::value_type(kPdgNuMu, nnumu));
236  }
237  if(nnutau>0.) {
238  fRelNuPopulations.insert(
239  map<int,double>::value_type(kPdgNuTau, nnutau));
241  }
242  if(nnuebar>0.) {
243  fRelNuPopulations.insert(
244  map<int,double>::value_type(kPdgAntiNuE, nnuebar));
246  }
247  if(nnumubar>0.) {
248  fRelNuPopulations.insert(
249  map<int,double>::value_type(kPdgAntiNuMu, nnumubar));
251  }
252  if(nnutaubar>0.) {
253  fRelNuPopulations.insert(
254  map<int,double>::value_type(kPdgAntiNuTau, nnutaubar));
256  }
257 
258  double tot = nnue + nnumu + nnutau + nnuebar + nnumubar + nnutaubar;
259  assert(tot>0.);
260 
261  // normalize to 1.
262  map<int,double>::iterator iter = fRelNuPopulations.begin();
263  for ( ; iter != fRelNuPopulations.end(); ++iter) {
264  double fraction = iter->second;
265  double norm_fraction = fraction/tot;
266  fRelNuPopulations[iter->first] = norm_fraction;
267  }
268 }
const int kPdgNuE
Definition: PDGCodes.h:28
const int kPdgAntiNuE
Definition: PDGCodes.h:29
const int kPdgNuMu
Definition: PDGCodes.h:30
unsigned int nnue
Definition: runWimpSim.h:90
map< int, double > fRelNuPopulations
(config) relative neutrino populations
Definition: GAstroFlux.h:189
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:176
const int kPdgNuTau
Definition: PDGCodes.h:32
assert(nhit_max >=nhit_nbins)
void push_back(int pdg_code)
Definition: PDGCodeList.cxx:67
void GAstroFlux::SetUserCoordSystem ( TRotation &  rotation)

rotation Topocentric Horizontal -> User-defined Topocentric Coord System

Definition at line 293 of file GAstroFlux.cxx.

Referenced by Index().

294 {
295  fRotTHz2User = rotation;
296 }
TRotation fRotTHz2User
(config) coord. system rotation: THZ -> Topocentric user-defined
Definition: GAstroFlux.h:191
virtual double genie::flux::GAstroFlux::Weight ( void  )
inlinevirtual

returns the flux neutrino weight (if any)

Implements genie::GFluxI.

Definition at line 141 of file GAstroFlux.h.

References fgWeight.

Referenced by main().

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

Member Data Documentation

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

Definition at line 193 of file GAstroFlux.h.

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

(config) detector: depth from surface

Definition at line 187 of file GAstroFlux.h.

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

(config) detector: geographic latitude

Definition at line 185 of file GAstroFlux.h.

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

(config) detector: geographic longitude

Definition at line 186 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 188 of file GAstroFlux.h.

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

Definition at line 194 of file GAstroFlux.h.

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

(config) generate a weighted or unweighted flux?

Definition at line 184 of file GAstroFlux.h.

Referenced by genie::flux::GPointSourceAstroFlux::SelectSource().

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

(current) generated nu 4-momentum

Definition at line 178 of file GAstroFlux.h.

Referenced by Momentum().

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

(current) generated nu pdg-code

Definition at line 177 of file GAstroFlux.h.

Referenced by PdgCode().

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

(current) generated nu weight

Definition at line 180 of file GAstroFlux.h.

Referenced by genie::flux::GPointSourceAstroFlux::SelectSource(), and Weight().

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

(current) generated nu 4-position

Definition at line 179 of file GAstroFlux.h.

Referenced by Position().

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

(config) user-defined maximum energy cut

Definition at line 182 of file GAstroFlux.h.

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

(config) user-defined minimum energy cut

Definition at line 183 of file GAstroFlux.h.

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

Definition at line 196 of file GAstroFlux.h.

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

Definition at line 197 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 176 of file GAstroFlux.h.

Referenced by FluxParticles().

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

(config) relative neutrino populations

Definition at line 189 of file GAstroFlux.h.

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

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

Definition at line 190 of file GAstroFlux.h.

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

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

Definition at line 191 of file GAstroFlux.h.

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

Definition at line 195 of file GAstroFlux.h.


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