Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
genie::flux::GPointSourceAstroFlux Class Reference

#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::GPointSourceAstroFlux:
genie::flux::GAstroFlux genie::GFluxI

Public Member Functions

 GPointSourceAstroFlux ()
 
 ~GPointSourceAstroFlux ()
 
bool GenerateNext (void)
 generate the next flux neutrino (return false in err) More...
 
void AddPointSource (string name, double ra, double dec, double rel_intensity)
 
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 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

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
 

Private Member Functions

bool SelectSource (void)
 

Private Attributes

map< int, stringfPntSrcName
 point source name More...
 
map< int, double > fPntSrcRA
 right ascension More...
 
map< int, double > fPntSrcDec
 declination More...
 
map< int, double > fPntSrcRelI
 relative intensity More...
 
double fPntSrcTotI
 sum of all relative intensities More...
 
unsigned int fSelSourceId
 

Detailed Description

Definition at line 247 of file GAstroFlux.h.

Constructor & Destructor Documentation

GPointSourceAstroFlux::GPointSourceAstroFlux ( )

Definition at line 565 of file GAstroFlux.cxx.

References clear, fPntSrcDec, fPntSrcName, fPntSrcRA, fPntSrcRelI, and fPntSrcTotI.

565  :
566 GAstroFlux()
567 {
568  fPntSrcName.clear();
569  fPntSrcRA. clear();
570  fPntSrcDec. clear();
571  fPntSrcRelI.clear();
572 
573  fPntSrcTotI = 0;
574 }
vector< vector< double > > clear
map< int, double > fPntSrcRelI
relative intensity
Definition: GAstroFlux.h:265
map< int, string > fPntSrcName
point source name
Definition: GAstroFlux.h:262
double fPntSrcTotI
sum of all relative intensities
Definition: GAstroFlux.h:266
map< int, double > fPntSrcDec
declination
Definition: GAstroFlux.h:264
map< int, double > fPntSrcRA
right ascension
Definition: GAstroFlux.h:263
GPointSourceAstroFlux::~GPointSourceAstroFlux ( )

Definition at line 576 of file GAstroFlux.cxx.

577 {
578 
579 }

Member Function Documentation

void GPointSourceAstroFlux::AddPointSource ( string  name,
double  ra,
double  dec,
double  rel_intensity 
)

Definition at line 586 of file GAstroFlux.cxx.

References fPntSrcDec, fPntSrcName, fPntSrcRA, fPntSrcRelI, fPntSrcTotI, and kPi.

588 {
589  bool accept =
590  (ra >= 0. && ra < 2.*kPi) &&
591  (dec >= -kPi/2. && dec <= kPi/2.) &&
592  (rel_intensity > 0) &&
593  (name.size() > 0);
594 
595  if(accept) {
596  int id = fPntSrcName.size();
597 
598  fPntSrcName.insert( map<int, string>::value_type(id, name ) );
599  fPntSrcRA. insert( map<int, double>::value_type(id, ra ) );
600  fPntSrcDec. insert( map<int, double>::value_type(id, dec ) );
601  fPntSrcRelI.insert( map<int, double>::value_type(id, rel_intensity) );
602 
603  fPntSrcTotI += rel_intensity;
604  }
605 }
const double kPi
const XML_Char * name
Definition: expat.h:151
map< int, double > fPntSrcRelI
relative intensity
Definition: GAstroFlux.h:265
map< int, string > fPntSrcName
point source name
Definition: GAstroFlux.h:262
double fPntSrcTotI
sum of all relative intensities
Definition: GAstroFlux.h:266
map< int, double > fPntSrcDec
declination
Definition: GAstroFlux.h:264
map< int, double > fPntSrcRA
right ascension
Definition: GAstroFlux.h:263
void GAstroFlux::CleanUp ( void  )
protectedinherited

Definition at line 354 of file GAstroFlux.cxx.

References LOG, and pNOTICE.

Referenced by genie::flux::GAstroFlux::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)
virtualinherited

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 genie::flux::GAstroFlux::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  )
inlinevirtualinherited

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  )
inlinevirtualinherited

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

Implements genie::GFluxI.

Definition at line 137 of file GAstroFlux.h.

References genie::flux::GAstroFlux::fPdgCList, genie::flux::GAstroFlux::GenerateNext(), and genie::flux::GAstroFlux::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)
inherited

Definition at line 156 of file GAstroFlux.cxx.

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

Referenced by genie::flux::GAstroFlux::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)
inherited

Definition at line 150 of file GAstroFlux.cxx.

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

Referenced by genie::flux::GAstroFlux::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 GPointSourceAstroFlux::GenerateNext ( void  )
virtual

generate the next flux neutrino (return false in err)

Reimplemented from genie::flux::GAstroFlux.

Definition at line 581 of file GAstroFlux.cxx.

582 {
583  return true;
584 }
void GAstroFlux::GenerateWeighted ( bool  gen_weighted)
virtualinherited

set whether to generate weighted or unweighted neutrinos

Implements genie::GFluxI.

Definition at line 169 of file GAstroFlux.cxx.

Referenced by genie::flux::GAstroFlux::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  )
inlinevirtualinherited
void GAstroFlux::Initialize ( void  )
protectedinherited

Definition at line 298 of file GAstroFlux.cxx.

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

Referenced by genie::flux::GAstroFlux::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  )
virtualinherited

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 genie::flux::GAstroFlux::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  )
inlinevirtualinherited

returns the flux neutrino 4-momentum

Implements genie::GFluxI.

Definition at line 142 of file GAstroFlux.h.

References genie::flux::GAstroFlux::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  )
inlinevirtualinherited

returns the flux neutrino pdg code

Implements genie::GFluxI.

Definition at line 140 of file GAstroFlux.h.

References genie::flux::GAstroFlux::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  )
inlinevirtualinherited

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 genie::flux::GAstroFlux::fgX4.

Referenced by main().

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

Definition at line 345 of file GAstroFlux.cxx.

Referenced by genie::flux::GAstroFlux::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
bool GPointSourceAstroFlux::SelectSource ( void  )
private

Definition at line 607 of file GAstroFlux.cxx.

References genie::flux::GAstroFlux::fGenWeighted, genie::flux::GAstroFlux::fgWeight, fPntSrcName, fPntSrcRelI, fPntSrcTotI, fSelSourceId, genie::RandomGen::Instance(), generate_hists::rnd, and genie::RandomGen::RndFlux().

608 {
609  if(fPntSrcRelI.size() == 0) {
610  return false;
611  }
612 
613  if(fPntSrcTotI <= 0.) {
614  return false;
615  }
616 
617  unsigned int srcid = 0;
618  double wght = 0;
619 
620  // Generate weighted flux:
621  //
622  if(fGenWeighted) {
624  unsigned int nsrc = fPntSrcName.size();
625  srcid = rnd->RndFlux().Integer(nsrc);
626  wght = fPntSrcRelI[srcid] / fPntSrcTotI;
627  }
628  // Generate un-weighted flux:
629  //
630  else {
631  RandomGen * rnd = RandomGen::Instance();
632  double xsum = 0.;
633  double xrnd = fPntSrcTotI * rnd->RndFlux().Uniform();
634  map<int,double>::const_iterator piter = fPntSrcRelI.begin();
635  for( ; piter != fPntSrcRelI.end(); ++piter) {
636  xsum += piter->second;
637  if(xrnd < xsum) {
638  srcid = piter->first;
639  break;
640  }
641  }
642  wght = 1.;
643  }
644 
645  //
646  fSelSourceId = srcid;
647 
648  //
649  fgWeight *= wght;
650 
651  return true;
652 }
bool fGenWeighted
(config) generate a weighted or unweighted flux?
Definition: GAstroFlux.h:184
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
map< int, double > fPntSrcRelI
relative intensity
Definition: GAstroFlux.h:265
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
map< int, string > fPntSrcName
point source name
Definition: GAstroFlux.h:262
double fPntSrcTotI
sum of all relative intensities
Definition: GAstroFlux.h:266
TRandom3 & RndFlux(void) const
rnd number generator used by flux drivers
Definition: RandomGen.h:72
double fgWeight
(current) generated nu weight
Definition: GAstroFlux.h:180
void GAstroFlux::SetDetectorPosition ( double  latitude,
double  longitude,
double  depth,
double  size 
)
inherited

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 genie::flux::GAstroFlux::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)
inherited

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 genie::flux::GAstroFlux::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 
)
inherited

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 genie::flux::GAstroFlux::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)
inherited

rotation Topocentric Horizontal -> User-defined Topocentric Coord System

Definition at line 293 of file GAstroFlux.cxx.

Referenced by genie::flux::GAstroFlux::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  )
inlinevirtualinherited

returns the flux neutrino weight (if any)

Implements genie::GFluxI.

Definition at line 141 of file GAstroFlux.h.

References genie::flux::GAstroFlux::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
protectedinherited

Definition at line 193 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fDetGeoDepth
protectedinherited

(config) detector: depth from surface

Definition at line 187 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fDetGeoLatitude
protectedinherited

(config) detector: geographic latitude

Definition at line 185 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fDetGeoLongitude
protectedinherited

(config) detector: geographic longitude

Definition at line 186 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fDetSize
protectedinherited

(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
protectedinherited

Definition at line 194 of file GAstroFlux.h.

bool genie::flux::GAstroFlux::fGenWeighted
protectedinherited

(config) generate a weighted or unweighted flux?

Definition at line 184 of file GAstroFlux.h.

Referenced by SelectSource().

TLorentzVector genie::flux::GAstroFlux::fgP4
protectedinherited

(current) generated nu 4-momentum

Definition at line 178 of file GAstroFlux.h.

Referenced by genie::flux::GAstroFlux::Momentum().

int genie::flux::GAstroFlux::fgPdgC
protectedinherited

(current) generated nu pdg-code

Definition at line 177 of file GAstroFlux.h.

Referenced by genie::flux::GAstroFlux::PdgCode().

double genie::flux::GAstroFlux::fgWeight
protectedinherited

(current) generated nu weight

Definition at line 180 of file GAstroFlux.h.

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

TLorentzVector genie::flux::GAstroFlux::fgX4
protectedinherited

(current) generated nu 4-position

Definition at line 179 of file GAstroFlux.h.

Referenced by genie::flux::GAstroFlux::Position().

double genie::flux::GAstroFlux::fMaxEvCut
protectedinherited

(config) user-defined maximum energy cut

Definition at line 182 of file GAstroFlux.h.

double genie::flux::GAstroFlux::fMinEvCut
protectedinherited

(config) user-defined minimum energy cut

Definition at line 183 of file GAstroFlux.h.

NuGenerator* genie::flux::GAstroFlux::fNuGen
protectedinherited

Definition at line 196 of file GAstroFlux.h.

NuPropagator* genie::flux::GAstroFlux::fNuPropg
protectedinherited

Definition at line 197 of file GAstroFlux.h.

PDGCodeList* genie::flux::GAstroFlux::fPdgCList
protectedinherited

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

Definition at line 176 of file GAstroFlux.h.

Referenced by genie::flux::GAstroFlux::FluxParticles().

map<int, double> genie::flux::GPointSourceAstroFlux::fPntSrcDec
private

declination

Definition at line 264 of file GAstroFlux.h.

Referenced by AddPointSource(), and GPointSourceAstroFlux().

map<int, string> genie::flux::GPointSourceAstroFlux::fPntSrcName
private

point source name

Definition at line 262 of file GAstroFlux.h.

Referenced by AddPointSource(), GPointSourceAstroFlux(), and SelectSource().

map<int, double> genie::flux::GPointSourceAstroFlux::fPntSrcRA
private

right ascension

Definition at line 263 of file GAstroFlux.h.

Referenced by AddPointSource(), and GPointSourceAstroFlux().

map<int, double> genie::flux::GPointSourceAstroFlux::fPntSrcRelI
private

relative intensity

Definition at line 265 of file GAstroFlux.h.

Referenced by AddPointSource(), GPointSourceAstroFlux(), and SelectSource().

double genie::flux::GPointSourceAstroFlux::fPntSrcTotI
private

sum of all relative intensities

Definition at line 266 of file GAstroFlux.h.

Referenced by AddPointSource(), GPointSourceAstroFlux(), and SelectSource().

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

(config) relative neutrino populations

Definition at line 189 of file GAstroFlux.h.

TRotation genie::flux::GAstroFlux::fRotGEF2THz
protectedinherited

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

Definition at line 190 of file GAstroFlux.h.

TRotation genie::flux::GAstroFlux::fRotTHz2User
protectedinherited

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

Definition at line 191 of file GAstroFlux.h.

unsigned int genie::flux::GPointSourceAstroFlux::fSelSourceId
private

Definition at line 268 of file GAstroFlux.h.

Referenced by SelectSource().

TH2D* genie::flux::GAstroFlux::fSolidAngleAcceptance
protectedinherited

Definition at line 195 of file GAstroFlux.h.


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