25 using namespace genie;
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;
326 <<
"Doesn't support transformation from " 331 else if ( kps ==
kPSWQ2fE && xsec != 0. ) {
352 if (!proc_info.
IsMEC()) {
372 bool good_config =
true;
379 good_config = false ;
380 LOG(
"NievesSimoVacasMECPXSec2016",
pERROR) <<
"The required HadronTensorAlg does not exist. AlgID is : " <<
SubAlg(
"HadronTensorAlg")->
Id() ;
385 good_config = false ;
386 LOG(
"NievesSimoVacasMECPXSec2016",
pERROR) <<
"The required NumericalIntegrationAlg does not exist. AlgID is : " <<
SubAlg(
"NumericalIntegrationAlg")->
Id();
391 if(
GetConfig().Exists(
"QvalueShifterAlg") ) {
394 good_config = false ;
395 LOG(
"NievesSimoVacasMECPXSec2016",
pERROR) <<
"The required QvalueShifterAlg does not exist. AlgID is : " <<
SubAlg(
"QvalueShifterAlg")->
Id() ;
401 if(
GetConfig().Exists(
"MECScaleAlg") ) {
404 good_config = false ;
405 LOG(
"NievesSimoVacasMECPXSec2016",
pERROR) <<
"The required MECScaleAlg cannot be casted. AlgID is : " <<
SubAlg(
"MECScaleAlg")->
Id() ;
409 if( ! good_config ) {
410 LOG(
"NievesSimoVacasMECPXSec2016",
pERROR) <<
"Configuration has failed.";
Cross Section Calculation Interface.
double J(double q0, double q3, double Enu, double ml)
THE MAIN GENIE PROJECT NAMESPACE
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)
virtual double dSigma_dT_dCosTheta(const Interaction *interaction, double Q_value) const =0
TParticlePDG * Probe(void) const
Abstract interface for an object that computes the elements ( , , etc.) and structure functions ( ...
std::pair< float, std::string > P
double XSec(const Interaction *i, KinePhaseSpace_t k) const
Compute the cross section for the input interaction.
virtual double qMagMin() const =0
enum genie::EKinePhaseSpace KinePhaseSpace_t
#define MAXLOG(s, l, c)
Similar to LOG(stream,priority) but quits after "maxcount" messages.
virtual const HadronTensorI * GetTensor(int tensor_pdg, HadronTensorType_t type) const =0
virtual const Registry & GetConfig(void) const
double fXSecScale
external xsec scaling factor
NievesSimoVacasMECPXSec2016()
double Qvalue(int targetpdg, int nupdg)
Summary information for an interaction.
const TLorentzVector & HitNucP4(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
virtual double q0Min() const =0
virtual double GetScaling(const Interaction &) const =0
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
static int max(int a, int b)
virtual ~NievesSimoVacasMECPXSec2016()
const QvalueShifter * fQvalueShifter
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 Integrate(const XSecAlgorithmI *model, const Interaction *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
virtual double qMagMax() const =0
Creates hadron tensor objects for use in cross section calculations.
int IonPdgCodeToZ(int pdgc)
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const Target & Tgt(void) const
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
virtual double q0Max() const =0
Initial State information.
const Algorithm * SubAlg(const RgKey ®istry_key) const