28 using std::ostringstream;
31 using namespace genie;
60 <<
"Getting max. differential xsec for the rejection method";
66 <<
"Attempting to find a cached max{dxsec/dK} value";
68 if(xsec_max>0)
return xsec_max;
71 <<
"Attempting to compute the max{dxsec/dK} value";
74 LOG(
"Kinematics",
pINFO) <<
"max{dxsec/dK} = " << xsec_max;
80 <<
"Can not generate event kinematics {K} (max_xsec({K};E)<=0)";
90 exception.
SetReason(
"kinematics generation: max_xsec({K};E)<=0");
104 double E = this->
Energy(interaction);
109 <<
"Below minimum energy - Forcing explicit calculation";
122 <<
"\nInterpolated: max xsec (E=" << E <<
") = " << spl_max_xsec;
126 <<
"Outside spline boundaries - Forcing explicit calculation";
132 double dE = TMath::Min(0.25, 0.05*E);
133 const map<double,double> & fmap = cb->
Map();
135 if(iter != fmap.end()) {
136 if(TMath::Abs(E - iter->first) < dE)
return iter->second;
186 <<
"Adding the computed max{dxsec/dK} value to cache";
189 double E = this->
Energy(interaction);
190 if(max_xsec>0) cb->
AddValues(E,max_xsec);
223 string algkey = this->
Id().
Key();
224 string intkey = interaction->
AsString();
231 LOG(
"Kinematics",
pINFO) <<
"No Max d^nXSec/d{K}^n cache branch found";
232 LOG(
"Kinematics",
pINFO) <<
"Creating cache branch - key = " <<
key;
234 cache_branch =
new CacheBranchFx(
"max[d^nXSec/d^n{K}] over phase space");
237 assert(cache_branch);
249 double f = 200*(xsec-xsec_max)/(xsec_max+xsec);
252 <<
"xsec: (curr) = " << xsec
253 <<
" > (max) = " << xsec_max <<
"\n for " << *
interaction;
255 <<
"*** Exceeding estimated maximum differential cross section";
259 <<
"xsec: (curr) = " << xsec
260 <<
" > (max) = " << xsec_max <<
"\n for " << *
interaction;
262 <<
"*** The fractional deviation of " << f <<
" % was allowed";
269 <<
"Negative cross section for current kinematics!! \n" << *
interaction;
virtual double MaxXSec(GHepRecord *evrec) const
THE MAIN GENIE PROJECT NAMESPACE
virtual Interaction * Summary(void) const
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
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 Evaluate(double x) const
string AsString(void) const
void AddCacheBranch(string key, CacheBranchI *branch)
Summary information for an interaction.
void AddValues(double x, double y)
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...
string CacheBranchKey(string k0, string k1="", string k2="") const
virtual double ComputeMaxXSec(const Interaction *in) const =0
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
CacheBranchI * FindCacheBranch(string key)
finding/adding cache branches
virtual const AlgId & Id(void) const
Get algorithm ID.
void SwitchOnFastForward(void)
const map< double, double > & Map(void) const
void SetReason(string reason)
virtual TBits * EventFlags(void) const
double fEMin
min E for which maxxsec is cached - forcing explicit calc.
virtual double Energy(const Interaction *in) const
virtual CacheBranchFx * AccessCacheBranch(const Interaction *in) const
virtual void CacheMaxXSec(const Interaction *in, double xsec) const
const InitialState & InitState(void) const
static Cache * Instance(void)
A simple cache branch storing the cached data in a TNtuple.
double ProbeE(RefFrame_t rf) const
GENIE's GHEP MC event record.
~KineGeneratorWithCache()
cet::coded_exception< error, detail::translate > exception
virtual double FindMaxXSec(const Interaction *in) const
const UInt_t kISkipProcessChk
if set, skip process validity checks
virtual void SetDiffXSec(double xsec, KinePhaseSpace_t ps)
Initial State information.