36 using namespace genie;
63 <<
"Generating kinematics uniformly over the allowed phase space";
92 const double dy = ymax - ymin;
95 unsigned int iter = 0;
97 double xsec=-1, gy=-1;
103 <<
"*** Could not select a valid y after " << iter <<
" iterations";
106 exception.
SetReason(
"Couldn't select kinematics");
111 gy = ymin + dy * rnd->
RndKine().Rndm();
112 LOG(
"COHElKinematics",
pINFO) <<
"Trying: y = " << gy;
121 double t = xsec_max * rnd->
RndKine().Rndm();
123 LOG(
"COHElKinematics",
pINFO) <<
"xsec= " << xsec <<
", J= 1, Rnd= " <<
t;
132 LOG(
"COHElKinematics",
pNOTICE) <<
"Selected: y = " << gy;
138 double totxsec = evrec->
XSec();
139 double wght = (vol/totxsec)*xsec;
140 LOG(
"COHElKinematics",
pNOTICE) <<
"Kinematics wght = "<< wght;
144 LOG(
"COHElKinematics",
pNOTICE) <<
"Current event wght = " << wght;
180 <<
"Scanning the allowed phase space {K} for the max(dxsec/d{K})";
182 double max_xsec = 0.;
188 const double logymin = TMath::Log10(yr.
min);
189 const double logymax = TMath::Log10(yr.
max);
190 const double dlogy = (logymax - logymin) /(N-1);
192 for(
int i=0; i<
N; i++) {
193 double y = TMath::Power(10, logymin+i*dlogy);
197 LOG(
"COHElKinematics",
pDEBUG) <<
"xsec(y= " << y <<
") = " << xsec;
198 max_xsec = TMath::Max(max_xsec, xsec);
206 SLOG(
"COHElKinematics",
pDEBUG) <<
"Max xsec in phase space = " << max_xsec;
virtual double MaxXSec(GHepRecord *evrec) const
const KPhaseSpace & PhaseSpace(void) const
virtual void SetWeight(double wght)
void ProcessEventRecord(GHepRecord *event_rec) const
bool fGenerateUniformly
uniform over allowed phase space + event weight?
THE MAIN GENIE PROJECT NAMESPACE
static const double kNucleonMass
double Q2(const Interaction *const i)
virtual Interaction * Summary(void) const
static RandomGen * Instance()
Access instance.
void SetQ2(double Q2, bool selected=false)
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.
A simple [min,max] interval for doubles.
virtual void AssertXSecLimits(const Interaction *in, double xsec, double xsec_max) const
COHElKinematicsGenerator()
double fMaxXSecDiffTolerance
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
Defines the EventGeneratorI interface.
~COHElKinematicsGenerator()
virtual double Weight(void) const
Range1D_t YLim(void) const
y limits
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...
string AsString(void) const
double ComputeMaxXSec(const Interaction *in) const
const XSecAlgorithmI * fXSecModel
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)
void Sett(double t, bool selected=false)
static const double kASmallNum
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)
static RunningThreadInfo * Instance(void)
virtual const AlgId & Id(void) const
Get algorithm ID.
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)
void Configure(const Registry &config)
double fEMin
min E for which maxxsec is cached - forcing explicit calc.
double Energy(const Interaction *in) const
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
const UInt_t kISkipProcessChk
if set, skip process validity checks
virtual void SetDiffXSec(double xsec, KinePhaseSpace_t ps)
Initial State information.