37 using namespace genie;
38 using namespace genie::controls;
39 using namespace genie::utils;
89 LOG(
"HEDISKinematics",
pNOTICE) <<
"x: [" << xl.
min <<
", " << xl.
max <<
"]";
90 LOG(
"HEDISKinematics",
pNOTICE) <<
"log10Q2: [" << Q2l.
min <<
", " << Q2l.
max <<
"]";
103 Range1D_t Q2range_fine(TMath::Max(Q2_wide/fFineRange,Q2range_wide.
min),TMath::Min(Q2_wide*fFineRange,Q2range_wide.
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;
double W(bool selected=false) const
const KPhaseSpace & PhaseSpace(void) const
virtual Interaction * Summary(void) const
static RandomGen * Instance()
Access instance.
double ComputeMaxXSec(const Interaction *interaction) const
void SetQ2(double Q2, bool selected=false)
Kinematics * KinePtr(void) const
double Scan(Interaction *interaction, Range1D_t xrange, Range1D_t Q2range, int NKnotsQ2, int NKnotsX, double ME2, double &x_scan, double &Q2_scan) const
double fSafetyFactor
ComputeMaxXSec -> ComputeMaxXSec * fSafetyFactor.
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.
double fSFXmin
minimum value of x for which SF tables are computed
Range1D_t Q2Lim(void) const
Q2 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...
void UpdateWYFromXQ2(const Interaction *in)
const XSecAlgorithmI * fXSecModel
double y(bool selected=false) const
~HEDISKinematicsGenerator()
void Configure(const Registry &config)
Summary information for an interaction.
const TLorentzVector & HitNucP4(void) const
void ProcessEventRecord(GHepRecord *event_rec) 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...
double fSFQ2min
minimum value of Q2 for which SF tables are computed
HEDISKinematicsGenerator()
virtual void Configure(const Registry &config)
TRandom3 & RndKine(void) const
rnd number generator used by kinematics generators
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
virtual double XSec(const Interaction *i, KinePhaseSpace_t k=kPSfE) const =0
Compute the cross section for the input interaction.
void Setx(double x, bool selected=false)
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)
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
Range1D_t XLim(void) const
x limits
const InitialState & InitState(void) const
double fSFQ2max
maximum value of Q2 for which SF tables are computed
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
static const unsigned int kRjMaxIterations
const EventGeneratorI * RunningThread(void)
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...
const UInt_t kISkipProcessChk
if set, skip process validity checks
virtual void SetDiffXSec(double xsec, KinePhaseSpace_t ps)
Initial State information.