44 using namespace genie;
71 <<
"Generating kinematics uniformly over the allowed phase space";
136 double gx=-1, gy=-1,
gt=-1, gW=-1,
gQ2=-1,
xsec=-1;
138 unsigned int iter = 0;
144 <<
" Couldn't select kinematics after " << iter <<
" iterations";
147 exception.
SetReason(
"Couldn't select kinematics");
162 <<
"Trying: x = " << gx <<
", y = " << gy <<
", t = " <<
gt;
170 double n = xsec_max * rnd->
RndKine().Rndm();
173 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 175 <<
"xsec= " <<
xsec <<
", J= " << J <<
", Rnd= " <<
n;
177 accept = (n < J*
xsec);
193 double totxsec = evrec->
XSec();
194 double wght = (vol/totxsec)*
xsec;
195 LOG(
"DFRKinematics",
pNOTICE) <<
"Kinematics wght = "<< wght;
199 LOG(
"DFRKinematics",
pNOTICE) <<
"Current event wght = " << wght;
207 <<
"Selected x,y => W = " << gW <<
", Q2 = " <<
gQ2;
272 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 274 <<
"Computing max xsec in allowed phase space";
276 double max_xsec = 0.0;
290 double dx = (xmax-
xmin)/(Nx-1);
291 double dy = (ymax-
ymin)/(Ny-1);
294 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 296 <<
"Searching max. in x [" << xmin <<
", " << xmax
297 <<
"], y [" << ymin <<
", " << ymax <<
"], z [" << zmin <<
", " <<
zmax <<
"]";
299 double xseclast_y = -1;
302 for(
int i=0;
i<Ny;
i++) {
303 double gy = ymin +
i*
dy;
306 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 307 LOG(
"DFRKinematics",
pDEBUG) <<
"y = " << gy;
309 for(
int j=0;
j<Nx;
j++) {
310 double gx = xmin +
j*
dx;
325 double tmin = tl.
min;
326 double tmax = tl.
max;
327 double dt = (tmax-tmin)/(Nt-1);
328 for(
int k=0; k<Nt; k++) {
329 double gt = tmin + k*
dt;
333 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 335 <<
"xsec(y=" << gy <<
", x=" << gx <<
", t=" << gt <<
") = " <<
xsec;
338 max_xsec = TMath::Max(xsec, max_xsec);
341 increasing_y = max_xsec-xseclast_y>=0;
342 xseclast_y = max_xsec;
344 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 346 <<
"d2xsec/dxdy stopped increasing. Exiting y loop";
356 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 358 SLOG(
"DFRKinematics",
pDEBUG) <<
"Max xsec in phase space = " << max_xsec;
virtual double MaxXSec(GHepRecord *evrec) const
double W(bool selected=false) const
const KPhaseSpace & PhaseSpace(void) const
virtual void SetWeight(double wght)
std::map< std::string, double > xmax
bool fGenerateUniformly
uniform over allowed phase space + event weight?
double J(double q0, double q3, double Enu, double ml)
THE MAIN GENIE PROJECT NAMESPACE
virtual Interaction * Summary(void) const
static RandomGen * Instance()
Access instance.
void SetQ2(double Q2, bool selected=false)
Kinematics * KinePtr(void) const
double ComputeMaxXSec(const Interaction *interaction) 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.
A simple [min,max] interval for doubles.
virtual void AssertXSecLimits(const Interaction *in, double xsec, double xsec_max) const
bool IsWithinLimits(double x, Range1D_t range)
double fMaxXSecDiffTolerance
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
Defines the EventGeneratorI interface.
virtual double Weight(void) const
::xsd::cxx::tree::exception< char > exception
Range1D_t YLim(void) const
y limits
Range1D_t Q2Lim_W(void) const
Q2 limits @ fixed W.
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
static double GetTMaxDFR()
double PhaseSpaceVolume(const Interaction *const i, KinePhaseSpace_t ps)
void Configure(const Registry &config)
Summary information for an interaction.
const TLorentzVector & HitNucP4(void) const
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...
void XYtoWQ2(double Ev, double M, double &W, double &Q2, double x, double y)
virtual void Configure(const Registry &config)
void Sett(double t, bool selected=false)
TRandom3 & RndKine(void) const
rnd number generator used by kinematics generators
Misc GENIE control constants.
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
void Setx(double x, bool selected=false)
void UpdateWQ2FromXY(const Interaction *in)
static RunningThreadInfo * Instance(void)
void SetW(double W, bool selected=false)
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.
assert(nhit_max >=nhit_nbins)
virtual double XSec(void) const
Range1D_t XLim(void) const
x limits
const InitialState & InitState(void) const
double Q2(bool selected=false) const
void ClearRunningValues(void)
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const Target & Tgt(void) const
Range1D_t TLim(void) const
t limits
static const unsigned int kRjMaxIterations
bool gt(unsigned short int a, unsigned short int b)
const EventGeneratorI * RunningThread(void)
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
void ProcessEventRecord(GHepRecord *event_rec) const
~DFRKinematicsGenerator()
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.
Range1D_t WLim(void) const
W limits.
const UInt_t kISkipProcessChk
if set, skip process validity checks
virtual void SetDiffXSec(double xsec, KinePhaseSpace_t ps)
Initial State information.