89 LOG(
"HEDISKinematics",
pNOTICE) <<
"x: [" << xl.
min <<
", " << xl.
max <<
"]";
90 LOG(
"HEDISKinematics",
pNOTICE) <<
"log10Q2: [" << Q2l.
min <<
", " << Q2l.
max <<
"]";
109 double xsec_max =
fSafetyFactor * TMath::Max(xsec_wide,xsec_fine);
112 double log10xmin = TMath::Log10(xl.
min);
113 double log10xmax = TMath::Log10(xl.
max);
114 double log10Q2min = TMath::Log10(Q2l.
min);
115 double log10Q2max = TMath::Log10(Q2l.
max);
117 double dlog10x = log10xmax - log10xmin;
118 double dlog10Q2 = log10Q2max - log10Q2min;
120 double gx=-1,
gQ2=-1, xsec=-1;
122 unsigned int iter = 0;
128 <<
" Couldn't select kinematics after " << iter <<
" iterations";
131 exception.
SetReason(
"Couldn't select kinematics");
136 gx = TMath::Power( 10., log10xmin + dlog10x * rnd->
RndKine().Rndm() );
137 gQ2 = TMath::Power( 10., log10Q2min + dlog10Q2 * rnd->
RndKine().Rndm() );
144 <<
"Trying: x = " << gx <<
", Q2 = " <<
gQ2
145 <<
" (W = " << interaction->
KinePtr()->
W() <<
","
146 <<
" y = " << interaction->
KinePtr()->
y() <<
")";
154 double t = xsec_max * rnd->
RndKine().Rndm();
156 LOG(
"HEDISKinematics",
pDEBUG) <<
"xsec= " << xsec <<
", Rnd= " << t;
163 <<
"Selected: x = " << gx <<
", Q2 = " <<
gQ2
164 <<
" (W = " << interaction->
KinePtr()->
W() <<
","
165 <<
" (Y = " << interaction->
KinePtr()->
y() <<
")";
188 double xsec_scan = 0.;
192 double stepQ2 = TMath::Power(Q2range.
max/Q2range.
min,1./(NKnotsQ2-1));
194 for (
int iq=0; iq<NKnotsQ2; iq++) {
195 double Q2_aux = Q2range.
min*TMath::Power(stepQ2,iq);
196 xrange.
min = TMath::Max(xrange.
min,Q2_aux/ME2);
197 double stepx = TMath::Power(xrange.
max/xrange.
min,1./(NKnotsX-1));
198 for (
int ix=0; ix<NKnotsX; ix++) {
199 double x_aux = xrange.
min*TMath::Power(stepx,ix);
204 LOG(
"HEDISKinematics",
pDEBUG) <<
"x = " << x_aux <<
" , Q2 = " << Q2_aux <<
", xsec = " << xsec_aux;
205 if (xsec_aux>xsec_scan) {
206 xsec_scan = xsec_aux;
213 LOG(
"HEDISKinematics",
pNOTICE) <<
"scan -> x = " << x_scan <<
" , Q2 = " << Q2_scan <<
", xsec = " << xsec_scan;
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
virtual void Configure(const Registry &config)
bool GetParamDef(const RgKey &name, T &p, const T &def) const
Defines the EventGeneratorI interface.
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
GENIE's GHEP MC event record.
virtual void SetDiffXSec(double xsec, KinePhaseSpace_t ps)
virtual Interaction * Summary(void) const
virtual TBits * EventFlags(void) const
double fSFXmin
minimum value of x for which SF tables are computed
double fSFQ2min
minimum value of Q2 for which SF tables are computed
double Scan(Interaction *interaction, Range1D_t xrange, Range1D_t Q2range, int NKnotsQ2, int NKnotsX, double ME2, double &x_scan, double &Q2_scan) const
HEDISKinematicsGenerator()
double ComputeMaxXSec(const Interaction *interaction) const
~HEDISKinematicsGenerator()
void Configure(const Registry &config)
void ProcessEventRecord(GHepRecord *event_rec) const
double fSFQ2max
maximum value of Q2 for which SF tables are computed
Initial State information.
const Target & Tgt(void) const
double ProbeE(RefFrame_t rf) const
Summary information for an interaction.
const KPhaseSpace & PhaseSpace(void) const
const InitialState & InitState(void) const
Kinematics * KinePtr(void) const
Range1D_t XLim(void) const
x limits
Range1D_t Q2Lim(void) const
Q2 limits.
virtual void AssertXSecLimits(const Interaction *in, double xsec, double xsec_max) const
double fMaxXSecDiffTolerance
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
double fSafetyFactor
ComputeMaxXSec -> ComputeMaxXSec * fSafetyFactor.
const XSecAlgorithmI * fXSecModel
void Setx(double x, bool selected=false)
void SetQ2(double Q2, bool selected=false)
double y(bool selected=false) const
double W(bool selected=false) const
void ClearRunningValues(void)
void Sety(double y, bool selected=false)
void SetW(double W, 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)
const TLorentzVector & HitNucP4(void) const
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.
void UpdateWYFromXQ2(const Interaction *in)
Root of GENIE utility namespaces.
THE MAIN GENIE PROJECT NAMESPACE
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
const UInt_t kISkipProcessChk
if set, skip process validity checks