23 using namespace genie;
24 using namespace genie::constants;
25 using namespace genie::flux;
35 GPowerLawFlux::GPowerLawFlux(
double alpha,
double emin,
double emax,
int pdg) :
42 double alpha,
double emin,
double emax,
const map<int,double> & numap) :
58 map<int,double>::const_iterator iter;
59 for(iter =
fProb.begin(); iter !=
fProb.end(); ++iter) {
60 int nupdgc = iter->first;
61 double prob = iter->second;
76 fgP4.SetPxPyPzE (0.,0.,Ev,Ev);
79 <<
"Generated neutrino: "
80 <<
"\n pdg-code: " <<
fgPdgC
92 "No Clear(Option_t * opt) method implemented for opt: "<< opt;
100 "No GenerateWeighted(bool gen_weighted) method implemented for " <<
101 "gen_weighted: " << gen_weighted;
106 map<int,double> numap;
107 numap.insert( map<int, double>::value_type(pdg, 1.) );
114 LOG(
"Flux",
pNOTICE) <<
"Initializing GPowerLawFlux driver";
129 map<int,double>::const_iterator iter;
130 for(iter = numap.begin(); iter != numap.end(); ++iter) {
131 int nupdgc = iter->first;
132 double nuwgt = iter->second;
141 fgX4.SetXYZT (0.,0.,0.,0.);
153 TVector3 dircos1 = TVector3(dx,dy,dz).Unit();
157 fgP4.SetVect(E*dircos1);
void SetRayOrigin(double x, double y, double z)
string P4AsShortString(const TLorentzVector *p)
static RandomGen * Instance()
Access instance.
string P3AsString(const TVector3 *vec)
map< int, double > fProb
cumulative probability of neutrino types
A simple GENIE flux driver for neutrinos following a power law spectrum. Can handle a mix of neutrino...
PDGCodeList * fPdgCList
list of neutrino pdg-codes
A singleton holding random number generator classes. All random number generation in GENIE should tak...
double fSpectralIndex
spectral index (E^{-alpha})
TLorentzVector fgX4
running generated nu 4-position
void Clear(Option_t *opt)
reset state variables based on opt
double fMaxEv
maximum energy
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
bool GenerateNext(void)
generate the next flux neutrino (return false in err)
void SetNuDirection(const TVector3 &direction)
void SetDirectionCos(double dx, double dy, double dz)
int fgPdgC
running generated nu pdg-code
void GenerateWeighted(bool gen_weighted)
set whether to generate weighted or unweighted neutrinos
void SetBeamSpot(const TVector3 &spot)
TRandom3 & RndFlux(void) const
rnd number generator used by flux drivers
string X4AsString(const TLorentzVector *x)
void Initialize(double alpha, double emin, double emax, int pdg)
#define FLUXDRIVERREG4(_nsa, _nsb, _name, _fqname)
string Vec3AsString(const TVector3 *vec)
double fMinEv
minimum energy
void push_back(int pdg_code)
GENIE Interface for user-defined flux classes.
TLorentzVector fgP4
running generated nu 4-momentum