GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PhotonRESPXSec.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2024, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Alfonso Garcia <aagarciasoto \at km3net.de>
7  IFIC & Harvard University
8 */
9 //____________________________________________________________________________
10 
21 
22 using namespace genie;
23 using namespace genie::constants;
24 
25 //____________________________________________________________________________
27 XSecAlgorithmI("genie::PhotonRESPXSec")
28 {
29  born = new Born();
30 }
31 //____________________________________________________________________________
33 XSecAlgorithmI("genie::PhotonRESPXSec", config)
34 {
35 
36 }
37 //____________________________________________________________________________
39 {
40 
41 }
42 //____________________________________________________________________________
44  const Interaction * interaction, KinePhaseSpace_t kps) const
45 {
46 
47  if(! this -> ValidProcess (interaction) ) return 0.;
48 
49  // Load SF tables
51 
52  const InitialState & init_state = interaction -> InitState();
53  const Kinematics & kinematics = interaction -> Kine();
54  const XclsTag & xclstag = interaction -> ExclTag();
55 
56  int probepdg = init_state.ProbePdg();
57  int loutpdg = xclstag.FinalLeptonPdg();
58  int tgtpdg = init_state.Tgt().HitNucPdg();
59 
60  double mlout = interaction->FSPrimLepton()->Mass(); //mass of charged lepton
61 
62  double Mnuc = init_state.Tgt().HitNucMass();
63 
64  double Enuin = init_state.ProbeE(kRfLab);
65  double s = born->GetS(Mnuc,Enuin);
66 
67  double n1 = kinematics.GetKV(kKVn1);
68  double n2 = kinematics.GetKV(kKVn2);
69 
70  double xmin = fQ2PDFmin/2./Enuin/Mnuc;
71  double x = TMath::Exp( TMath::Log(xmin) + (TMath::Log(1.0)-TMath::Log(xmin))*n2 );
72 
73  if (x<fxPDFmin) return 0.;
74 
75  double s_r = x*s;
76  double t_r = born->GetT(0.,mlout,s_r,n1);
77 
78  double xsec = kPi/4./(s_r-Mnuc*Mnuc) * sf_tbl->EvalSF(tgtpdg,probepdg,x) * (TMath::Log(1.0)-TMath::Log(xmin)) ;
79 
80  if ( pdg::IsPion(loutpdg) ) {
81  if ( TMath::Sqrt(s_r)<fWmin ) return 0.; // The W limit is because hadronization might have issues at low W (as in PYTHIA6).
82  xsec *= 64.41/10.63;
83  }
84 
85  double ME = 0.;
86  if ( TMath::Abs(loutpdg)+1 == TMath::Abs(probepdg) ) ME = born->PXSecCCRNC(s_r,t_r,0.,mlout);
87  else ME = born->PXSecCCR (s_r,t_r,0.,mlout);
88  xsec *= TMath::Max(0.,ME);
89 
90  if(kps!=kPSn1n2fE) {
91  LOG("PhotonRESPXSec", pWARN)
92  << "Doesn't support transformation from "
95  xsec = 0;
96  }
97 
98  // If requested return the free nucleon xsec even for input nuclear tgt
99  if( interaction->TestBit(kIAssumeFreeNucleon) ) return xsec;
100 
101  // Compute nuclear cross section (simple scaling here, corrections must have been included in the structure functions)
102  int NNucl = (pdg::IsProton(tgtpdg)) ? init_state.Tgt().Z() : init_state.Tgt().N();
103  xsec *= NNucl;
104 
105  LOG("PhotonRESPXSec", pINFO) << "dxsec/dn1dn2 (E= " << Enuin << ", n1= " << n1 << ", n2=" << n2 << ") = " << xsec;
106 
107  return xsec;
108 
109 }
110 //____________________________________________________________________________
111 double PhotonRESPXSec::Integral(const Interaction * interaction) const
112 {
113  double xsec = fXSecIntegrator->Integrate(this,interaction);
114  return xsec;
115 }
116 //____________________________________________________________________________
117 bool PhotonRESPXSec::ValidProcess(const Interaction* interaction) const
118 {
119  if(interaction->TestBit(kISkipProcessChk)) return true;
120 
121  const ProcessInfo & proc_info = interaction->ProcInfo();
122  if(!proc_info.IsPhotonResonance()) return false;
123 
124  const InitialState & init_state = interaction -> InitState();
125  if(!pdg::IsLepton(init_state.ProbePdg())) return false;
126 
127  if(! init_state.Tgt().HitNucIsSet()) return false;
128 
129  int hitnuc_pdg = init_state.Tgt().HitNucPdg();
130  if(!pdg::IsNeutronOrProton(hitnuc_pdg)) return false;
131 
132  return true;
133 }
134 //____________________________________________________________________________
135 
136 
137 //____________________________________________________________________________
139 {
140  Algorithm::Configure(config);
141  this->LoadConfig();
142 }
143 //____________________________________________________________________________
144 void PhotonRESPXSec::Configure(string config)
145 {
146  Algorithm::Configure(config);
147  this->LoadConfig();
148 }
149 //____________________________________________________________________________
151 {
152 
153  //-- load the differential cross section integrator
154  fXSecIntegrator = dynamic_cast<const XSecIntegratorI *> (this->SubAlg("XSec-Integrator"));
155  assert(fXSecIntegrator);
156 
157  GetParam( "Xsec-Wmin", fWmin ) ;
158 
159  GetParam("Q2Grid-Min", fQ2PDFmin );
160  GetParam("XGrid-Min", fxPDFmin );
161 
162 }
Cross Section Calculation Interface.
bool ValidProcess(const Interaction *i) const
Can this cross section algorithm handle the input process?
double Integral(const Interaction *i) const
bool IsPhotonResonance(void) const
bool IsPion(int pdgc)
Definition: PDGUtils.cxx:326
int FinalLeptonPdg(void) const
Definition: XclsTag.h:74
double GetT(double mlin, double mlout, double s, double costhCM)
Definition: Born.cxx:200
double fWmin
Minimum value of W.
Cross Section Integrator Interface.
int HitNucPdg(void) const
Definition: Target.cxx:304
void Configure(const Registry &config)
double HitNucMass(void) const
Definition: Target.cxx:233
double XSec(const Interaction *i, KinePhaseSpace_t k) const
Compute the cross section for the input interaction.
static constexpr double s
Definition: Units.h:95
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
enum genie::EKinePhaseSpace KinePhaseSpace_t
Structure function using photon PDFs of nucleons.
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
Summary information for an interaction.
Definition: Interaction.h:56
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:336
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
static string AsString(KinePhaseSpace_t kps)
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
int ProbePdg(void) const
Definition: InitialState.h:64
int Z(void) const
Definition: Target.h:68
double PXSecCCR(double s, double t, double mlin, double mlout)
Definition: Born.cxx:58
double GetKV(KineVar_t kv) const
Definition: Kinematics.cxx:323
#define pINFO
Definition: Messenger.h:62
double GetS(double mlin, double Enuin)
Definition: Born.cxx:195
static PhotonStrucFunc * Instance(void)
#define pWARN
Definition: Messenger.h:60
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
double PXSecCCRNC(double s, double t, double mlin, double mlout)
Definition: Born.cxx:76
const XSecIntegratorI * fXSecIntegrator
diff. xsec integrator
Born level nu-electron cross section.
Definition: Born.h:26
int N(void) const
Definition: Target.h:69
bool HitNucIsSet(void) const
Definition: Target.cxx:283
double EvalSF(int hitnuc, int hitlep, double x)
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
const UInt_t kIAssumeFreeNucleon
Definition: Interaction.h:49
bool IsNeutronOrProton(int pdgc)
Definition: PDGUtils.cxx:351
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const Target & Tgt(void) const
Definition: InitialState.h:66
virtual double Integrate(const XSecAlgorithmI *model, const Interaction *interaction) const =0
double ProbeE(RefFrame_t rf) const
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
bool IsLepton(int pdgc)
Definition: PDGUtils.cxx:86
const UInt_t kISkipProcessChk
if set, skip process validity checks
Definition: Interaction.h:47
Initial State information.
Definition: InitialState.h:48
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345