GLRESPXSec.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
7  University of Liverpool & STFC Rutherford Appleton Laboratory
8 */
9 //____________________________________________________________________________
10 
11 #include <TMath.h>
12 
22 
23 using namespace genie;
24 using namespace genie::constants;
25 
26 //____________________________________________________________________________
28 XSecAlgorithmI("genie::GLRESPXSec")
29 {
30 
31 }
32 //____________________________________________________________________________
34 XSecAlgorithmI("genie::GLRESPXSec", config)
35 {
36 
37 }
38 //____________________________________________________________________________
40 {
41 
42 }
43 //____________________________________________________________________________
45  const Interaction * interaction, KinePhaseSpace_t kps) const
46 {
47 
48  if(! this -> ValidProcess (interaction) ) return 0.;
49  if(! this -> ValidKinematics (interaction) ) return 0.;
50 
51  const InitialState & init_state = interaction -> InitState();
52 
53  double E = init_state.ProbeE(kRfLab);
54  double s = 2 * kElectronMass * E + kElectronMass2;
55 
56  // The W limit is because hadronization might have issues at low W (as in PYTHIA6).
57  // To be consistent the cross section must be computed in the W range where the events are generated.
58  if ( TMath::Sqrt(s)<fWmin ) return 0.;
59 
60  const Kinematics & kinematics = interaction -> Kine();
61  const XclsTag & xclstag = interaction -> ExclTag();
62  int final_lepton = xclstag.FinalLeptonPdg();
63 
64  double y = kinematics.y();
65  double s0 = 2 * kElectronMass * E;
66 
67  double Gw = PDGLibrary::Instance()->Find(kPdgWM)->Width(); //PDGLibrary::Instance()->Find(kPdgWM)->Width() //genhen=2.124
68  double gf = kGF2/kPi; //kGF2/kPi //genhen=1.16637e-05*1.16637e-05/3.141592653589793
69  double m_w = kMw; //kMw //genhen=80.425
70  double m_z = kMz; //kMz //genhen=91.1876
71  double Sin2thw = 1 - kMw2 / kMz2; //1 - kMw2 / kMz2 //genhen=0.2312
72  double branch = 64.41/10.63; //branching ratio hadrons/muons //genhen=67.96/10.57
73 
74  double Gw2 = TMath::Power(Gw, 2);
75  double m_w2 = TMath::Power(m_w,2);
76  double m_z2 = TMath::Power(m_z,2);
77  double Sin4thw = TMath::Power(Sin2thw,2);
78 
79  double prop = TMath::Power(1-s/m_w2, 2) + Gw2/m_w2;
80 
81  double xsec = 0;
82  if ( pdg::IsMuon(final_lepton) ) {
83  double ml2 = kMuonMass2;
84  xsec = s0*TMath::Power(1-y, 2) + (3*kElectronMass2+ml2)*(1-y) + kElectronMass*(kElectronMass2+ml2)/E;
85  xsec *= gf/prop;
86  }
87  else if ( pdg::IsTau(final_lepton) ) {
88  double ml2 = kTauMass2;
89  xsec = s0*TMath::Power(1-y, 2) + (3*kElectronMass2+ml2)*(1-y) + kElectronMass*(kElectronMass2+ml2)/E;
90  xsec *= gf/prop;
91  }
92  else if ( pdg::IsPion(final_lepton) ) {
93  double ml2 = kMuonMass2;
94  xsec = ( s0*TMath::Power(1-y, 2) + (3*kElectronMass2+ml2)*(1-y) + kElectronMass*(kElectronMass2+ml2)/E ) * branch;
95  xsec *= gf/prop;
96  }
97  else if ( pdg::IsElectron(final_lepton) ) {
98  double u = 2 * kElectronMass2 - 2 * kElectronMass * E * y;
99  double t = 2 * kElectronMass2 - s - u;
100  double L = Sin2thw - 1./2.;
101 
102  double x1 = L*m_z2*(s-m_w2) + m_w2*(u-m_z2);
103  double y1 = L * m_z2 * Gw * m_w;
104  double x2 = (u - m_z2) * (s - m_w2);
105  double y2 = (u - m_z2) * Gw * m_w;
106  double y3 = ( x1*x2 + y1*y2 ) / ( TMath::Power(x2,2) + TMath::Power(y2,2) );
107  double x3 = ( x2*y1 - x1*y2 ) / ( TMath::Power(x2,2) + TMath::Power(y2,2) );
108 
109  xsec = gf * s0 * ( Sin4thw/TMath::Power(u/m_z2-1,2) + (TMath::Power(x3,2)+TMath::Power(y3,2))*TMath::Power(t-kElectronMass2,2)/TMath::Power(s0,2) );
110  }
111 
112 
113  LOG("GLRESPXSec", pINFO) << "dxsec/dy (E= " << E << ", y= " << y << ") = " << xsec;
114 
115  //----- The algorithm computes dxsec/dy
116  // Check whether variable tranformation is needed
117  if(kps!=kPSyfE) {
118  double J = utils::kinematics::Jacobian(interaction,kPSyfE,kps);
119  xsec *= J;
120  }
121 
122  //----- If requested return the free electron xsec even for nuclear target
123  if( interaction->TestBit(kIAssumeFreeElectron) ) return xsec;
124 
125  //----- Scale for the number of scattering centers at the target
126  int Ne = init_state.Tgt().Z(); // num of scattering centers
127  xsec *= Ne;
128 
129  return xsec;
130 
131 }
132 //____________________________________________________________________________
134 {
135  double xsec = fXSecIntegrator->Integrate(this,interaction);
136 
137  return xsec;
138 }
139 //____________________________________________________________________________
141 {
142  if(interaction->TestBit(kISkipProcessChk)) return true;
143 
144  const InitialState & init_state = interaction->InitState();
145  const ProcessInfo & proc_info = interaction->ProcInfo();
146 
147  bool nuok = pdg::IsAntiNuE(init_state.ProbePdg());
148  bool nucok = !(init_state.Tgt().HitNucIsSet());
149  bool ccprcok = proc_info.IsWeakCC();
150 
151  if ( !nuok ) return false;
152  if ( !nucok ) return false;
153  if ( !ccprcok ) return false;
154 
155  return true;
156 }
157 //____________________________________________________________________________
159 {
160 
161  Algorithm::Configure(config);
162  this->LoadConfig();
163 }
164 //____________________________________________________________________________
166 {
167  Algorithm::Configure(config);
168  this->LoadConfig();
169 }
170 //____________________________________________________________________________
172 {
173 
174  //-- load the differential cross section integrator
175  fXSecIntegrator = dynamic_cast<const XSecIntegratorI *> (this->SubAlg("XSec-Integrator"));
176  assert(fXSecIntegrator);
177 
178  GetParam( "Xsec-Wmin", fWmin ) ;
179 
180 
181 }
Cross Section Calculation Interface.
bool IsPion(int pdgc)
Definition: PDGUtils.cxx:323
Basic constants.
bool IsWeakCC(void) const
int FinalLeptonPdg(void) const
Definition: XclsTag.h:74
static const double kMw2
Definition: Constants.h:93
double J(double q0, double q3, double Enu, double ml)
Definition: MECUtils.cxx:147
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
Cross Section Integrator Interface.
const int kPdgWM
Definition: PDGCodes.h:192
static const double kMz2
Definition: Constants.h:94
double fWmin
Minimum value of W.
Definition: GLRESPXSec.h:52
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
enum genie::EKinePhaseSpace KinePhaseSpace_t
static const double kElectronMass
Definition: Constants.h:70
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
virtual ~GLRESPXSec()
Definition: GLRESPXSec.cxx:39
double y(bool selected=false) const
Definition: Kinematics.cxx:112
Summary information for an interaction.
Definition: Interaction.h:56
virtual bool ValidKinematics(const Interaction *i) const
Is the input kinematical point a physically allowed one?
static const double kMz
Definition: Constants.h:92
bool ValidProcess(const Interaction *i) const
Can this cross section algorithm handle the input process?
Definition: GLRESPXSec.cxx:140
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
static const double kElectronMass2
Definition: Constants.h:83
double XSec(const Interaction *i, KinePhaseSpace_t k) const
Compute the cross section for the input interaction.
Definition: GLRESPXSec.cxx:44
static Config * config
Definition: config.cpp:1054
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
static const double kTauMass2
Definition: Constants.h:85
static const double kMuonMass2
Definition: Constants.h:84
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
int ProbePdg(void) const
Definition: InitialState.h:64
bool IsTau(int pdgc)
Definition: PDGUtils.cxx:205
void Configure(const Registry &config)
Definition: GLRESPXSec.cxx:158
int Z(void) const
Definition: Target.h:68
#define pINFO
Definition: Messenger.h:62
bool IsMuon(int pdgc)
Definition: PDGUtils.cxx:195
static const double kMw
Definition: Constants.h:91
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
const XSecIntegratorI * fXSecIntegrator
diff. xsec integrator
Definition: GLRESPXSec.h:50
bool HitNucIsSet(void) const
Definition: Target.cxx:283
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
genFinder * gf
E
Definition: 018_def.c:13
virtual double Integrate(const XSecAlgorithmI *model, const Interaction *interaction) const =0
double Integral(const Interaction *i) const
Definition: GLRESPXSec.cxx:133
double Jacobian(const Interaction *const i, KinePhaseSpace_t f, KinePhaseSpace_t t)
Definition: KineUtils.cxx:130
const InitialState & InitState(void) const
Definition: Interaction.h:69
void LoadConfig(void)
Definition: GLRESPXSec.cxx:171
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const Target & Tgt(void) const
Definition: InitialState.h:66
static const double kGF2
Definition: Constants.h:59
double ProbeE(RefFrame_t rf) const
static const double kPi
Definition: Constants.h:37
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
static QCString * s
Definition: config.cpp:1042
bool IsAntiNuE(int pdgc)
Definition: PDGUtils.cxx:170
bool IsElectron(int pdgc)
Definition: PDGUtils.cxx:185
const UInt_t kISkipProcessChk
if set, skip process validity checks
Definition: Interaction.h:47
Initial State information.
Definition: InitialState.h:48
const UInt_t kIAssumeFreeElectron
Definition: Interaction.h:50
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345