61 <<
"Generating kinematics uniformly over the allowed phase space";
85 double dy = ymax-ymin;
91 unsigned int iter = 0;
97 <<
"*** Could not select a valid y after "
98 << iter <<
" iterations";
101 exception.
SetReason(
"Couldn't select kinematics");
106 double y = ymin + dy * rnd->
RndKine().Rndm();
109 LOG(
"DMEKinematics",
pINFO) <<
"Trying: y = " << y;
118 double t = xsec_max * rnd->
RndKine().Rndm();
119 LOG(
"DMEKinematics",
pDEBUG) <<
"xsec= "<< xsec<<
", J= 1, Rnd= "<< t;
128 LOG(
"DMEKinematics",
pINFO) <<
"Selected: y = " << y;
137 double totxsec = evrec->
XSec();
138 double wght = (vol/totxsec)*xsec;
139 LOG(
"DMEKinematics",
pNOTICE) <<
"Kinematics wght = "<< wght;
143 LOG(
"DMEKinematics",
pNOTICE) <<
"Current event wght = " << wght;
172 const double ymin = yl.
min;
173 const double ymax = yl.
max;
175 double max_xsec = -1.0;
177 double dy = (ymax-ymin)/(N-1);
181 for(
int i=0; i<N; i++) {
182 double y = ymin + i * dy;
186 SLOG(
"DMEKinematics",
pDEBUG) <<
"xsec(y = " << y <<
") = " << xsec;
187 max_xsec = TMath::Max(xsec, max_xsec);
215 SLOG(
"DMEKinematics",
pDEBUG) <<
"Max xsec in phase space = " << max_xsec;
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
virtual void Configure(const Registry &config)
bool GetParamDef(const RgKey &name, T &p, const T &def) const
void ProcessEventRecord(GHepRecord *event_rec) const
~DMEKinematicsGenerator()
double Energy(const Interaction *in) const
double ComputeMaxXSec(const Interaction *in) const
void Configure(const Registry &config)
Defines the EventGeneratorI interface.
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
GENIE's GHEP MC event record.
virtual double Weight(void) const
virtual void SetDiffXSec(double xsec, KinePhaseSpace_t ps)
virtual double XSec(void) const
virtual Interaction * Summary(void) const
virtual TBits * EventFlags(void) const
virtual void SetWeight(double wght)
Initial State information.
double ProbeE(RefFrame_t rf) const
Summary information for an interaction.
string AsString(void) const
const KPhaseSpace & PhaseSpace(void) const
const InitialState & InitState(void) const
Kinematics * KinePtr(void) const
Range1D_t Limits(KineVar_t kvar) const
Return the kinematical variable limits.
virtual void AssertXSecLimits(const Interaction *in, double xsec, double xsec_max) const
bool fGenerateUniformly
uniform over allowed phase space + event weight?
double fMaxXSecDiffTolerance
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
double fEMin
min E for which maxxsec is cached - forcing explicit calc.
double fSafetyFactor
ComputeMaxXSec -> ComputeMaxXSec * fSafetyFactor.
virtual double MaxXSec(GHepRecord *evrec, const int nkey=0) const
const XSecAlgorithmI * fXSecModel
void ClearRunningValues(void)
void Sety(double y, bool selected=false)
A singleton holding random number generator classes. All random number generation in GENIE should tak...
static RandomGen * Instance()
Access instance.
TRandom3 & RndKine(void) const
rnd number generator used by kinematics generators
A simple [min,max] interval for doubles.
A registry. Provides the container for algorithm configuration parameters.
Keep info on the event generation thread currently on charge. This is used so that event generation m...
static RunningThreadInfo * Instance(void)
const EventGeneratorI * RunningThread(void)
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
void SwitchOnFastForward(void)
void SetReason(string reason)
Misc GENIE control constants.
static const unsigned int kRjMaxIterations
Simple functions for loading and reading nucleus dependent keys from config files.
double PhaseSpaceVolume(const Interaction *const i, KinePhaseSpace_t ps)
Root of GENIE utility namespaces.
THE MAIN GENIE PROJECT NAMESPACE