25 using namespace genie;
26 using namespace genie::constants;
62 double mv = init_state.
Probe()->Mass();
64 double pv = std::sqrt( std::max(0., Ev*Ev - mv*mv) );
67 const TLorentzVector& hit_nuc_P4 = init_state.
Tgt().
HitNucP4();
68 double M = hit_nuc_P4.M();
72 double Tl = Ev - ml - ( (W*W + Q2 - M*M) / (2.*M) );
76 double pl = std::sqrt( std::max(0., El*El - ml*ml) );
77 double ctl = ( 2.*Ev*El - Q2 - mv*mv - ml*ml ) / ( 2. * pv * pl );
105 int tensor_pdg = target_pdg;
112 if ( A_request == 4 && Z_request == 2 ) {
121 else if (A_request < 9) {
125 <<
"Asked to scale to deuterium through boron "
126 << target_pdg <<
" nope, lets not do that.";
129 else if (A_request >= 9 && A_request < 15) {
136 else if (A_request >= 15 && A_request < 22) {
139 else if (A_request >= 22 && A_request < 33) {
141 tensor_pdg = 1000140280;
143 else if (A_request >= 33 && A_request < 50) {
147 else if (A_request >= 50 && A_request < 90) {
149 tensor_pdg = 1000280560;
151 else if (A_request >= 90 && A_request < 160) {
153 tensor_pdg = 1000561120;
155 else if (A_request >= 160) {
157 tensor_pdg = 1001042080;
161 <<
"Asked to scale to a nucleus "
162 << target_pdg <<
" which we don't know yet.";
182 LOG(
"NievesSimoVacasMEC",
pWARN) <<
"Failed to load a"
183 " hadronic tensor for the nuclide " << tensor_pdg;
191 double Q0min = tensor->
q0Min();
192 double Q0max = tensor->
q0Max();
193 double Q3min = tensor->
qMagMin();
194 double Q3max = tensor->
qMagMax();
195 if (Q0 < Q0min || Q0 > Q0max || Q3 < Q3min || Q3 > Q3max) {
216 double xsec_all = 0.;
224 if ( !tensor_delta_all ) {
225 LOG(
"NievesSimoVacasMEC",
pWARN) <<
"Failed to load a \"DeltaAll\""
226 <<
" hadronic tensor for nuclide " << tensor_pdg;
234 if ( !tensor_delta_pn ) {
235 LOG(
"NievesSimoVacasMEC",
pWARN) <<
"Failed to load a \"Deltapn\""
236 <<
" hadronic tensor for nuclide " << tensor_pdg;
250 if ( !tensor_full_all ) {
251 LOG(
"NievesSimoVacasMEC",
pWARN) <<
"Failed to load a \"FullAll\""
252 <<
" hadronic tensor for nuclide " << tensor_pdg;
260 if ( !tensor_full_pn ) {
261 LOG(
"NievesSimoVacasMEC",
pWARN) <<
"Failed to load a \"Fullpn\""
262 <<
" hadronic tensor for nuclide " << tensor_pdg;
273 bool need_to_scale = (target_pdg != tensor_pdg);
276 if ( need_to_scale ) {
278 double PP = Z_request;
279 double NN = A_request - PP;
283 double scale_pn = TMath::Sqrt( (PP*NN)/(P*N) );
284 double scale_pp = TMath::Sqrt( (PP * (PP - 1.)) / (P * (P - 1.)) );
285 double scale_nn = TMath::Sqrt( (NN * (NN - 1.)) / (N * (N - 1.)) );
288 <<
"Scale pn pp nn for (" << target_pdg <<
", " << tensor_pdg <<
")"
289 <<
" : " << scale_pn <<
" " << scale_pp <<
" " << scale_nn;
299 double temp_all = xsec_all;
300 double temp_pn = xsec_pn * scale_pn;
303 temp_all = xsec_pn * scale_pn + (xsec_all - xsec_pn) * scale_nn;
307 temp_all = xsec_pn * scale_pn + (xsec_all - xsec_pn) * scale_pp;
317 double xsec = (pn) ? xsec_pn : xsec_all;
328 <<
"Doesn't support transformation from "
333 else if ( kps ==
kPSWQ2fE && xsec != 0. ) {
354 if (!proc_info.
IsMEC()) {
374 bool good_config =
true;
382 good_config = false ;
383 LOG(
"NievesSimoVacasMECPXSec2016",
pERROR) <<
"The required HadronTensorAlg does not exist. AlgID is : " <<
SubAlg(
"HadronTensorAlg")->
Id() ;
388 good_config = false ;
389 LOG(
"NievesSimoVacasMECPXSec2016",
pERROR) <<
"The required NumericalIntegrationAlg does not exist. AlgID is : " <<
SubAlg(
"NumericalIntegrationAlg")->
Id();
394 if(
GetConfig().Exists(
"QvalueShifterAlg") ) {
397 good_config = false ;
398 LOG(
"NievesSimoVacasMECPXSec2016",
pERROR) <<
"The required QvalueShifterAlg does not exist. AlgID is : " <<
SubAlg(
"QvalueShifterAlg")->
Id() ;
404 if(
GetConfig().Exists(
"MECScaleAlg") ) {
407 good_config = false ;
408 LOG(
"NievesSimoVacasMECPXSec2016",
pERROR) <<
"The required MECScaleAlg cannot be casted. AlgID is : " <<
SubAlg(
"MECScaleAlg")->
Id() ;
412 if( ! good_config ) {
413 LOG(
"NievesSimoVacasMECPXSec2016",
pERROR) <<
"Configuration has failed.";
Cross Section Calculation Interface.
virtual double dSigma_dT_dCosTheta(const Interaction *interaction, double Q_value) const =0
virtual const HadronTensorI * GetTensor(int tensor_pdg, HadronTensorType_t type) const =0
bool IsWeakCC(void) const
double J(double q0, double q3, double Enu, double ml)
Cross Section Integrator Interface.
double Q2(const Interaction *const i)
int HitNucPdg(void) const
Kinematics * KinePtr(void) const
bool KnownResonance(void) const
This class is responsible to compute a scaling factor for the XSec.
int IonPdgCodeToA(int pdgc)
TParticlePDG * Probe(void) const
Abstract interface for an object that computes the elements ( , , etc.) and structure functions ( ...
double XSec(const Interaction *i, KinePhaseSpace_t k) const
Compute the cross section for the input interaction.
double fXSecCCScale
external xsec scaling factor
enum genie::EKinePhaseSpace KinePhaseSpace_t
virtual double q0Max() const =0
#define MAXLOG(s, l, c)
Similar to LOG(stream,priority) but quits after "maxcount" messages.
virtual const Registry & GetConfig(void) const
double fXSecNCScale
external xsec scaling factor
double W(const Interaction *const i)
NievesSimoVacasMECPXSec2016()
double Qvalue(int targetpdg, int nupdg)
Summary information for an interaction.
const TLorentzVector & HitNucP4(void) const
bool IsWeakNC(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static string AsString(KinePhaseSpace_t kps)
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
const Kinematics & Kine(void) const
virtual void Configure(const Registry &config)
double GetKV(KineVar_t kv) const
virtual ~NievesSimoVacasMECPXSec2016()
const QvalueShifter * fQvalueShifter
virtual double qMagMax() const =0
virtual double q0Min() const =0
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
void SetKV(KineVar_t kv, double value)
const HadronTensorModelI * fHadronTensorModel
double Integral(const Interaction *i) const
virtual const AlgId & Id(void) const
Get algorithm ID.
const XSecScaleI * fMECScaleAlg
void Configure(const Registry &config)
A registry. Provides the container for algorithm configuration parameters.
const XclsTag & ExclTag(void) const
virtual double GetScaling(const Interaction &) const =0
bool ValidProcess(const Interaction *i) const
Can this cross section algorithm handle the input process?
double Jacobian(const Interaction *const i, KinePhaseSpace_t f, KinePhaseSpace_t t)
const InitialState & InitState(void) const
const ProcessInfo & ProcInfo(void) const
Creates hadron tensor objects for use in cross section calculations.
int IonPdgCodeToZ(int pdgc)
virtual double qMagMin() const =0
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const Target & Tgt(void) const
virtual double Integrate(const XSecAlgorithmI *model, const Interaction *interaction) const =0
const XSecIntegratorI * fXSecIntegrator
double ProbeE(RefFrame_t rf) const
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
const UInt_t kISkipProcessChk
if set, skip process validity checks
Initial State information.
const Algorithm * SubAlg(const RgKey ®istry_key) const