24 using namespace genie;
50 <<
"Generating kinematics uniformly over the allowed phase space";
74 double dy = ymax-ymin;
80 unsigned int iter = 0;
86 <<
"*** Could not select a valid y after " 87 << iter <<
" iterations";
90 exception.
SetReason(
"Couldn't select kinematics");
95 double y = ymin + dy * rnd->
RndKine().Rndm();
98 LOG(
"NuEKinematics",
pINFO) <<
"Trying: y = " <<
y;
107 double t = xsec_max * rnd->
RndKine().Rndm();
108 LOG(
"NuEKinematics",
pDEBUG) <<
"xsec= "<< xsec<<
", J= 1, Rnd= "<<
t;
117 LOG(
"NuEKinematics",
pINFO) <<
"Selected: y = " <<
y;
126 double totxsec = evrec->
XSec();
127 double wght = (vol/totxsec)*xsec;
128 LOG(
"NuEKinematics",
pNOTICE) <<
"Kinematics wght = "<< wght;
132 LOG(
"NuEKinematics",
pNOTICE) <<
"Current event wght = " << wght;
161 const double ymin = yl.
min;
162 const double ymax = yl.
max;
164 double max_xsec = -1.0;
166 double dy = (ymax-ymin)/(N-1);
170 for(
int i=0; i<
N; i++) {
171 double y = ymin + i * dy;
175 SLOG(
"NuEKinematics",
pDEBUG) <<
"xsec(y = " << y <<
") = " << xsec;
176 max_xsec = TMath::Max(xsec, max_xsec);
204 SLOG(
"NuEKinematics",
pDEBUG) <<
"Max xsec in phase space = " << max_xsec;
virtual double MaxXSec(GHepRecord *evrec) const
const KPhaseSpace & PhaseSpace(void) const
virtual void SetWeight(double wght)
~NuEKinematicsGenerator()
bool fGenerateUniformly
uniform over allowed phase space + event weight?
THE MAIN GENIE PROJECT NAMESPACE
void Configure(const Registry &config)
virtual Interaction * Summary(void) const
static RandomGen * Instance()
Access instance.
Kinematics * KinePtr(void) const
double fSafetyFactor
maxxsec -> maxxsec * safety_factor
virtual double XSec(const Interaction *i, KinePhaseSpace_t k=kPSfE) const =0
Compute the cross section for the input interaction.
double ComputeMaxXSec(const Interaction *in) const
A simple [min,max] interval for doubles.
virtual void AssertXSecLimits(const Interaction *in, double xsec, double xsec_max) const
double fMaxXSecDiffTolerance
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
Defines the EventGeneratorI interface.
void ProcessEventRecord(GHepRecord *event_rec) const
virtual double Weight(void) const
Abstract class. Provides a data caching mechanism for for concrete implementations of the EventRecord...
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Range1D_t Limits(KineVar_t kvar) const
Return the kinematical variable limits.
string AsString(void) const
const XSecAlgorithmI * fXSecModel
double PhaseSpaceVolume(const Interaction *const i, KinePhaseSpace_t ps)
Summary information for an interaction.
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
virtual void Configure(const Registry &config)
TRandom3 & RndKine(void) const
rnd number generator used by kinematics generators
Misc GENIE control constants.
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
static RunningThreadInfo * Instance(void)
void SwitchOnFastForward(void)
void SetReason(string reason)
virtual TBits * EventFlags(void) const
A registry. Provides the container for algorithm configuration parameters.
void Sety(double y, bool selected=false)
double fEMin
min E for which maxxsec is cached - forcing explicit calc.
virtual double XSec(void) const
const InitialState & InitState(void) const
void ClearRunningValues(void)
bool GetParamDef(const RgKey &name, T &p, const T &def) const
static const unsigned int kRjMaxIterations
const EventGeneratorI * RunningThread(void)
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
double ProbeE(RefFrame_t rf) const
GENIE's GHEP MC event record.
Keep info on the event generation thread currently on charge. This is used so that event generation m...
Root of GENIE utility namespaces.
cet::coded_exception< error, detail::translate > exception
virtual void SetDiffXSec(double xsec, KinePhaseSpace_t ps)
double Energy(const Interaction *in) const
Initial State information.