Import Geant4 10.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2017-06-30 10:49:55 +02:00
parent 3a5407696b
commit 1a1316fea4
2180 changed files with 237880 additions and 59109 deletions
@@ -14,6 +14,55 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
13 Jun 2017 - Alberto Ribon (hadr-cross-V10-03-08)
----------------------------------------------------
- G4NeutronElectronElXsc, G4ComponentGGHadronNucleusXsc : Coverity fixes.
29 May 2017 - Alberto Ribon (hadr-cross-V10-03-07)
----------------------------------------------------
- Proposing the same tag as before, which was wrongly rejected.
29 May 2017 - Alberto Ribon (hadr-cross-V10-03-06)
----------------------------------------------------
- G4NeutrinoElectronNcXsc, G4NeutrinoElectronCcXsc, G4NeutronElectronElXsc :
added possibility of biasing these cross sections.
23 May 2017 - Alberto Ribon (hadr-cross-V10-03-05)
----------------------------------------------------
- G4NeutronElectronElXsc : fixed declaration of variables
(double wrongly declared as integer).
23 May 2017 - Alberto Ribon (hadr-cross-V10-03-04)
----------------------------------------------------
- G4NeutronElectronElXsc : added new class by Vladimir Grichine
for the cross section of neutrons on atomic electrons.
Ultra-relativistic approximation of the Rosenbluth formula is used,
since this is more relevant for detector applications. In particular,
for dark matter searches, this process can produce elctrons with high
energy, if there are high energy neutrons (more than 10 GeV).
28 April 2017 - Alberto Ribon (hadr-cross-V10-03-03)
----------------------------------------------------
- G4NeutrinoElectronCcXsc : added new class by Vladimir Grichine
for the cross section of neutrino-electron inelastic interaction
(charge current).
18 April 2017 - Alberto Ribon (hadr-cross-V10-03-02)
----------------------------------------------------
- G4NeutrinoElectronNcXsc : corrected name anti_nu_mu .
11 April 2017 - Alberto Ribon (hadr-cross-V10-03-01)
----------------------------------------------------
- Forgot to add the (new) class G4NeutrinoElectronNcXsc in the sources.cmake.
11 April 2017 - Alberto Ribon (hadr-cross-V10-03-00)
----------------------------------------------------
- G4NeutrinoElectronNcXsc : added new class by Vladimir Grichine
for the cross section of elastic neutrino-electron scattering.
This class is useful for dark matter and neutrino experiments.
Note that the cross section is small : ~10^-44 - 10^-42 cm^2
in the neutrino energy range 1-100 GeV.
12 August 2016 - Alberto Ribon (hadr-cross-V10-02-04)
-----------------------------------------------------
- G4CrossSectionDataStore : added "throw" to hadronic exception;
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Neutrino electron elastic (neutral current) cross sections
//
// 02.04.17 V. Grichine
//
//
#ifndef G4NeutrinoElectronCcXsc_h
#define G4NeutrinoElectronCcXsc_h
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
class G4ParticleDefinition;
class G4NeutrinoElectronCcXsc : public G4VCrossSectionDataSet
{
public:
G4NeutrinoElectronCcXsc();
~G4NeutrinoElectronCcXsc();
virtual
G4bool IsElementApplicable(const G4DynamicParticle*, G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*,
G4int Z, const G4Material*);
void SetCutEnergy(G4double ec){fCutEnergy=ec;};
G4double GetCutEnergy(){return fCutEnergy;};
void SetBiasingFactor(G4double bf){fBiasingFactor=bf;};
protected:
G4double fCofXsc; // 2*Gf*Gf*MeC2/pi
G4double fSin2tW; // sin^2theta_Weinberg
G4double fCutEnergy; // minimal recoil electron energy detected
G4double fBiasingFactor; // biasing xsc up
G4ParticleDefinition* theMuonMinus;
G4ParticleDefinition* theTauMinus;
};
#endif
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Neutrino electron elastic (neutral current) cross sections
//
// 02.04.17 V. Grichine
//
//
#ifndef G4NeutrinoElectronNcXsc_h
#define G4NeutrinoElectronNcXsc_h
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
class G4NeutrinoElectronNcXsc : public G4VCrossSectionDataSet
{
public:
G4NeutrinoElectronNcXsc();
~G4NeutrinoElectronNcXsc();
virtual
G4bool IsElementApplicable(const G4DynamicParticle*, G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*,
G4int Z, const G4Material*);
void SetCutEnergy(G4double ec){fCutEnergy=ec;};
G4double GetCutEnergy(){return fCutEnergy;};
void SetBiasingFactor(G4double bf){fBiasingFactor=bf;};
protected:
G4double fCofXsc; // 2*Gf*Gf*MeC2/pi
G4double fSin2tW; // sin^2theta_Weinberg
G4double fCutEnergy; // minimal recoil electron energy detected
G4double fBiasingFactor; // biasing xsc up
};
#endif
@@ -0,0 +1,132 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Neutron-electron elastic cross section base on the integration of
// the Rosenbluth differential xsc
//
// 16.05.17 V. Grichine
//
//
#ifndef G4NeutronElectronElXsc_h
#define G4NeutronElectronElXsc_h
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
#include "G4DynamicParticle.hh"
using namespace std;
using namespace CLHEP;
// class G4ParticleDefinition;
class G4PhysicsLogVector;
class G4PhysicsTable;
class G4NeutronElectronElXsc : public G4VCrossSectionDataSet
{
public:
G4NeutronElectronElXsc();
~G4NeutronElectronElXsc();
void Initialise();
virtual
G4bool IsElementApplicable(const G4DynamicParticle*, G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*,
G4int Z, const G4Material*);
G4double GetRosenbluthXsc(const G4DynamicParticle*,
G4int Z, const G4Material*);
G4double XscIntegrand(G4double x);
G4double GetElementNonRelXsc(const G4DynamicParticle*,
G4int Z, const G4Material*);
G4double CalculateAm( G4double momentum);
inline G4double GetAm(){return fAm;};
void SetCutEnergy(G4double ec){fCutEnergy=ec;};
G4double GetCutEnergy(){return fCutEnergy;};
void SetBiasingFactor(G4double bf){fBiasingFactor=bf;};
protected:
G4double fM, fM2, fMv2, fme, fme2, fee, fee2;
G4double fCofXsc; //
G4double fAm; //
G4int fEnergyBin;
G4double fMinEnergy, fMaxEnergy, fCutEnergy; // minimal recoil electron energy detected
G4double fBiasingFactor; // biasing xsc up
G4PhysicsLogVector* fEnergyXscVector;
static const G4double fXscArray[200];
};
////////////////////////////////////////////////////////////////////
//
// return Wentzel atom screening correction for neutron-electron scattering
inline G4double G4NeutronElectronElXsc::CalculateAm( G4double momentum)
{
G4double k = momentum/CLHEP::hbarc;
G4double ch = 1.13;
G4double zn = 1.77*k*CLHEP::Bohr_radius;
G4double zn2 = zn*zn;
fAm = ch/zn2;
return fAm;
}
////////////////////////////////////////////////////
//
// Slow electron (Tkin << me_c2) in the neutron rest frame
inline G4double G4NeutronElectronElXsc::
GetElementNonRelXsc(const G4DynamicParticle* aPart, G4int ZZ,
const G4Material*)
{
G4double result(0.), te(0.), momentum(0.);
te = aPart->GetKineticEnergy()*fme/fM;
momentum = sqrt( te*(te + 2.*fme) );
fAm = CalculateAm(momentum);
result = 1. + log(1. +1./fAm);
result *= fCofXsc; //*energy;
result *= ZZ; // incoherent sum over all element electrons
return result;
}
#endif
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 94008 2015-11-05 10:06:41Z gcosmo $
# $Id: sources.cmake 104263 2017-05-23 12:13:24Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -93,8 +93,11 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_xsect
G4IonsShenCrossSection.hh
G4IonsSihverCrossSection.hh
G4KokoulinMuonNuclearXS.hh
G4NeutrinoElectronCcXsc.hh
G4NeutrinoElectronNcXsc.hh
G4NeutronCaptureXS.hh
G4NeutronElasticXS.hh
G4NeutronElectronElXsc.hh
G4NeutronInelasticCrossSection.hh
G4NeutronInelasticXS.hh
G4NucleonNuclearCrossSection.hh
@@ -162,8 +165,11 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_xsect
G4IonsShenCrossSection.cc
G4IonsSihverCrossSection.cc
G4KokoulinMuonNuclearXS.cc
G4NeutrinoElectronCcXsc.cc
G4NeutrinoElectronNcXsc.cc
G4NeutronCaptureXS.cc
G4NeutronElasticXS.cc
G4NeutronElectronElXsc.cc
G4NeutronInelasticCrossSection.cc
G4NeutronInelasticXS.cc
G4NucleonNuclearCrossSection.cc
@@ -49,7 +49,7 @@ G4ComponentGGHadronNucleusXsc::G4ComponentGGHadronNucleusXsc()
fLowerLimit(10.*MeV),// fLowerLimit(3*GeV),
fRadiusConst(1.08*fermi), // 1.1, 1.3 ?
fTotalXsc(0.0), fElasticXsc(0.0), fInelasticXsc(0.0), fProductionXsc(0.0),
fDiffractionXsc(0.0)
fDiffractionXsc(0.0), fAxsc2piR2(0.0),fModelInLog(0.0)
// , fHadronNucleonXsc(0.0)
{
theGamma = G4Gamma::Gamma();
@@ -0,0 +1,155 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#include "G4NeutrinoElectronCcXsc.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4DynamicParticle.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "G4HadTmpUtil.hh"
#include "G4NistManager.hh"
#include "G4MuonMinus.hh"
#include "G4TauMinus.hh"
using namespace std;
using namespace CLHEP;
G4NeutrinoElectronCcXsc::G4NeutrinoElectronCcXsc()
: G4VCrossSectionDataSet("NuElectronCcXsc")
{
// PDG2016: Gf=1.1663787(6)e-5*(hc)^3/GeV^2
// fCofXsc = Gf*Gf*MeC2*2/pi
fCofXsc = 1.36044e-22;
fCofXsc *= hbarc*hbarc*electron_mass_c2;
fCofXsc /= halfpi;
// G4cout<<"fCofXsc = "<<fCofXsc*GeV/cm2<<" cm2/GeV"<<G4endl;
// G4cout<<"hbarc = "<<hbarc/MeV/fermi<<" MeV*fermi"<<G4endl;
// PDG2016: sin^2 theta Weinberg
fSin2tW = 0.23129; // 0.2312;
fCutEnergy = 0.; // default value
fBiasingFactor = 1.; // default as physics
theMuonMinus = G4MuonMinus::MuonMinus();
theTauMinus = G4TauMinus::TauMinus();
}
G4NeutrinoElectronCcXsc::~G4NeutrinoElectronCcXsc()
{}
//////////////////////////////////////////////////////
G4bool
G4NeutrinoElectronCcXsc::IsElementApplicable( const G4DynamicParticle* aPart, G4int, const G4Material*)
{
G4bool result = false;
G4String pName = aPart->GetDefinition()->GetParticleName();
G4double minEnergy = 0., energy = aPart->GetTotalEnergy();
G4double fmass, emass = electron_mass_c2;
if( pName == "nu_mu" || pName == "anti_nu_mu" ) fmass = theMuonMinus->GetPDGMass();
else if( pName == "nu_tau" || pName == "anti_nu_tau" ) fmass = theTauMinus->GetPDGMass();
else fmass = emass;
minEnergy = (fmass-emass)*(fmass+emass)/emass;
if( ( pName == "nu_mu" || pName == "anti_nu_mu" ||
pName == "nu_tau" || pName == "anti_nu_tau" ) &&
energy > minEnergy )
{
result = true;
}
return result;
}
////////////////////////////////////////////////////
G4double G4NeutrinoElectronCcXsc::
GetElementCrossSection(const G4DynamicParticle* aPart, G4int ZZ,
const G4Material*)
{
G4double result = 0., totS, fmass, fmass2, emass=electron_mass_c2, emass2;
G4double energy = aPart->GetTotalEnergy();
G4String pName = aPart->GetDefinition()->GetParticleName();
emass2 = emass*emass;
totS = 2.*energy*emass + emass2;
if( pName == "nu_mu")
{
fmass = theMuonMinus->GetPDGMass();
fmass2 = fmass*fmass;
result = (1. - fmass2/totS)*(1. - fmass2/totS);
}
else if( pName == "anti_nu_mu")
{
fmass = theMuonMinus->GetPDGMass();
fmass2 = fmass*fmass;
result = (1.+ emass2/totS)*(1.+ fmass2/totS);
result += (1.- emass2/totS)*(1.- fmass2/totS)/3.;
result *= 0.25*(1. - fmass2/totS)*(1. - fmass2/totS);
}
else if( pName == "nu_tau")
{
fmass = theTauMinus->GetPDGMass();
fmass2 = fmass*fmass;
result = (1. - fmass2/totS)*(1. - fmass2/totS);
}
else if( pName == "anti_nu_tau")
{
fmass = theTauMinus->GetPDGMass();
fmass2 = fmass*fmass;
result = (1.+ emass2/totS)*(1.+ fmass2/totS);
result += (1.- emass2/totS)*(1.- fmass2/totS)/3.;
result *= 0.25*(1. - fmass2/totS)*(1. - fmass2/totS);
}
else
{
return result;
}
// if( energy <= electron_mass_c2 ) return result;
result *= fCofXsc; //*energy;
result *= energy + 0.5*emass;
result *= ZZ; // incoherent sum over all element electrons
result *= fBiasingFactor; // biasing up, if set >1
return result;
}
@@ -0,0 +1,173 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#include "G4NeutrinoElectronNcXsc.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4DynamicParticle.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "G4HadTmpUtil.hh"
#include "G4Proton.hh"
#include "G4NistManager.hh"
using namespace std;
using namespace CLHEP;
G4NeutrinoElectronNcXsc::G4NeutrinoElectronNcXsc()
: G4VCrossSectionDataSet("NuElectronNcXsc")
{
// PDG2016: Gf=1.1663787(6)e-5*(hc)^3/GeV^2
// fCofXsc = Gf*Gf*MeC2*2/pi
fCofXsc = 1.36044e-22;
fCofXsc *= hbarc*hbarc*electron_mass_c2;
fCofXsc /= halfpi;
// G4cout<<"hbarc = "<<hbarc/MeV/fermi<<" MeV*fermi"<<G4endl;
// PDG2016: sin^2 theta Weinberg
fSin2tW = 0.23129; // 0.2312;
fCutEnergy = 0.; // default value
fBiasingFactor = 1.;
}
G4NeutrinoElectronNcXsc::~G4NeutrinoElectronNcXsc()
{}
//////////////////////////////////////////////////////
G4bool
G4NeutrinoElectronNcXsc::IsElementApplicable( const G4DynamicParticle* aPart, G4int, const G4Material*)
{
G4bool result = false;
G4String pName = aPart->GetDefinition()->GetParticleName();
G4double minEnergy = 0., energy = aPart->GetTotalEnergy();
// Z *= 1;
if( fCutEnergy > 0. ) // min detected recoil electron energy
{
minEnergy = 0.5*(fCutEnergy+sqrt(fCutEnergy*(fCutEnergy+2.*electron_mass_c2)));
}
if( ( pName == "nu_e" || pName == "anti_nu_e" ||
pName == "nu_mu" || pName == "anti_nu_mu" ||
pName == "nu_tau" || pName == "anti_nu_tau" ) &&
energy > minEnergy )
{
result = true;
}
return result;
}
////////////////////////////////////////////////////
G4double G4NeutrinoElectronNcXsc::
GetElementCrossSection(const G4DynamicParticle* aPart, G4int ZZ,
const G4Material*)
{
G4double result = 0., cofL, cofR, cofL2, cofR2, cofLR;
G4double energy = aPart->GetTotalEnergy();
G4String pName = aPart->GetDefinition()->GetParticleName();
if( pName == "nu_e")
{
cofL = 0.5 + fSin2tW;
cofR = fSin2tW;
}
else if( pName == "anti_nu_e")
{
cofL = fSin2tW;
cofR = 0.5 + fSin2tW;
}
else if( pName == "nu_mu")
{
cofL = -0.5 + fSin2tW;
cofR = fSin2tW;
}
else if( pName == "anti_nu_mu")
{
cofL = fSin2tW;
cofR = -0.5 + fSin2tW;
}
else if( pName == "nu_tau") // vmg: nu_tau as nu_mu ???
{
cofL = -0.5 + fSin2tW;
cofR = fSin2tW;
}
else if( pName == "anti_nu_tau")
{
cofL = fSin2tW;
cofR = -0.5 + fSin2tW;
}
else
{
return result;
}
// if( energy <= electron_mass_c2 ) return result;
cofL2 = cofL*cofL;
cofR2 = cofR*cofR;
cofLR = cofL*cofR;
if( fCutEnergy > 0. )
{
G4double tM = 2.*energy*energy/(electron_mass_c2 + 2.*energy);
G4double tM2 = tM*tM;
G4double tM3 = tM*tM2;
G4double tC = fCutEnergy;
G4double tC2 = tC*tC;
G4double tC3 = tC*tC2;
result = (cofL2+cofR2)*(tM-tC);
result -= (cofR2+cofLR*0.5*electron_mass_c2/energy)*(tM2-tC2)/energy;
result += cofR2*(tM3-tC3)/energy/energy/3.;
}
else
{
G4double rtM = 2.*energy/(electron_mass_c2 + 2.*energy);
G4double rtM2 = rtM*rtM;
G4double rtM3 = rtM*rtM2;
result = (cofL2+cofR2)*rtM*energy;
result -= (cofR2*energy+cofLR*0.5*electron_mass_c2)*rtM2;
result += cofR2*rtM3*energy/3.;
}
// result = cofL*cofL + cofR*cofR/3.;
// G4cout<<"cofL2 + cofR2/3. = "<<result<<G4endl;
// result -= 0.5*cofL*cofR*electron_mass_c2/energy;
result *= fCofXsc; //*energy;
result *= ZZ; // incoherent sum over all element electrons
result *= fBiasingFactor;
return result;
}
@@ -0,0 +1,236 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// 16.05.17 V. Grichine first implementation
#include "G4NeutronElectronElXsc.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4DynamicParticle.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "G4HadTmpUtil.hh"
#include "G4NistManager.hh"
// #include "G4Integrator.hh"
#include "G4PhysicsLogVector.hh"
#include "G4PhysicsTable.hh"
#include "G4Neutron.hh"
#include "G4Electron.hh"
using namespace std;
using namespace CLHEP;
G4NeutronElectronElXsc::G4NeutronElectronElXsc()
: G4VCrossSectionDataSet("NuElectronCcXsc")
{
// neutron magneton squared
fM = neutron_mass_c2; // neutron mass
fM2 = fM*fM;
fme = electron_mass_c2;
fme2 = fme*fme;
fMv2 = 0.7056*GeV*GeV;
fee = fme;
fee2 = fee*fee;
fAm = 0.001;
fCofXsc = pi*fine_structure_const*fine_structure_const*hbarc*hbarc;
fCofXsc *= 3.6481; // neutron Fm^2(0)
fCofXsc /= fM*fM;
// G4cout<<"fCofXsc = "<<fCofXsc*GeV/cm2<<" cm2/GeV"<<G4endl;
// G4cout<<"hbarc = "<<hbarc/MeV/fermi<<" MeV*fermi"<<G4endl;
fCutEnergy = 0.; // default value
fEnergyBin = 200;
fMinEnergy = 1.*MeV;
fMaxEnergy = 10000.*GeV;
fEnergyXscVector = new G4PhysicsLogVector(fMinEnergy, fMaxEnergy, fEnergyBin);
for( G4int iTkin = 0; iTkin < fEnergyBin; iTkin++) fEnergyXscVector->PutValue(iTkin, fXscArray[iTkin]*microbarn);
fBiasingFactor = 1.;
// Initialise();
}
G4NeutronElectronElXsc::~G4NeutronElectronElXsc()
{
if( fEnergyXscVector )
{
delete fEnergyXscVector;
fEnergyXscVector = 0;
}
}
//////////////////////////////////////////////////////
//
// For neutrons in the precalculated energy interval
G4bool
G4NeutronElectronElXsc::IsElementApplicable( const G4DynamicParticle* aPart, G4int, const G4Material*)
{
G4bool result = false;
G4String pName = aPart->GetDefinition()->GetParticleName();
G4double Tkin = aPart->GetKineticEnergy();
if( pName == "neutron" &&
Tkin >= fMinEnergy &&
Tkin <= fMaxEnergy ) result = true;
return result;
}
//////////////////////////////////////////////////
void G4NeutronElectronElXsc::Initialise()
{
G4int iTkin;
G4double Tkin, rosxsc, xsc, delta, err=1.e-5;
const G4ThreeVector mDir = G4ThreeVector(0.,0.,1.);
const G4ParticleDefinition* pD = G4Neutron::Neutron();
G4Material* mat = G4NistManager::Instance()->FindOrBuildMaterial("G4_H");
G4DynamicParticle dP;
for( iTkin = 0; iTkin < fEnergyBin; iTkin++)
{
Tkin = fEnergyXscVector->GetLowEdgeEnergy(iTkin);
dP = G4DynamicParticle(pD, mDir, Tkin);
rosxsc = GetRosenbluthXsc(&dP, 1, mat);
fEnergyXscVector->PutValue(iTkin, rosxsc); // xscV.PutValue(evt, rosxsc); //
xsc= fEnergyXscVector->Value(Tkin); // xsc= xscV.GetLowEdgeEnergy(evt); //
delta = 0.5*std::abs( (rosxsc-xsc) )/(rosxsc+xsc);
if(delta > err) G4cout<<Tkin/GeV<<" GeV, rosxsc = "<<rosxsc/microbarn<<"umb, v-xsc = "<<xsc<<" umb"<<G4endl;
}
return;
}
////////////////////////////////////////////////////
G4double G4NeutronElectronElXsc::
GetElementCrossSection(const G4DynamicParticle* aPart, G4int ZZ,
const G4Material*)
{
G4double result = 0., Tkin;
Tkin = aPart->GetKineticEnergy();
result = fEnergyXscVector->Value(Tkin);
result *= ZZ; // incoherent sum over all element electrons
result *= fBiasingFactor;
return result;
}
////////////////////////////////////////////////////
//
// Integration of the Rosenbluth differential xsc
G4double G4NeutronElectronElXsc::
GetRosenbluthXsc(const G4DynamicParticle* aPart, G4int ZZ,
const G4Material*)
{
G4double result = 0., momentum;
fee = aPart->GetTotalEnergy()*fme/fM;
fee2 = fee*fee;
momentum = sqrt( fee2 - fme2 );
fAm = CalculateAm(momentum);
// G4Integrator<G4NeutronElectronElXsc, G4double(G4NeutronElectronElXsc::*)(G4double)> integral;
// result = integral.Legendre96( this, &G4NeutronElectronElXsc::XscIntegrand, 0., 1. );
result *= fCofXsc;
result *= ZZ; // incoherent sum over all element electrons
return result;
}
/////////////////////////////////////////
//
// Rosenbluth relation in the neutron rest frame,
// x = sin^2(theta/2), theta is the electron scattering angle
// Magnetic form factor in the dipole approximation.
G4double G4NeutronElectronElXsc::XscIntegrand(G4double x)
{
G4double result = 1., q2, znq2, znf, znf2, znf4;
znq2 = 1. + 2.*fee*x/fM;
q2 = 4.*fee2*x/znq2;
znf = 1 + q2/fMv2;
znf2 = znf*znf;
znf4 = znf2*znf2;
result /= ( x + fAm )*znq2*znq2*znf4;
result *= ( 1 - x )/( 1 + q2/4./fM2 ) + 2.*x;
return result;
}
//////////////////////////////////////////////////////////
//
// Rosenbluth xsc in microbarn from 1*MeV to 10*Tev, 200 points
const G4double G4NeutronElectronElXsc::fXscArray[200] = {
1.52681, 1.54903, 1.57123, 1.59341, 1.61556, 1.63769, 1.6598, 1.68189, 1.70396,
1.72601, 1.74805, 1.77007, 1.79208, 1.81407, 1.83605, 1.85801, 1.87997, 1.90192,
1.92385, 1.94578, 1.96771, 1.98962, 2.01154, 2.03345, 2.05535, 2.07725, 2.09915,
2.12105, 2.14295, 2.16485, 2.18675, 2.20865, 2.23055, 2.25244, 2.27433, 2.29621,
2.31807, 2.33992, 2.36173, 2.38351, 2.40524, 2.42691, 2.4485, 2.47, 2.49138,
2.51262, 2.53369, 2.55457, 2.57524, 2.59565, 2.61577, 2.63559, 2.65505, 2.67414,
2.69281, 2.71104, 2.72881, 2.74607, 2.76282, 2.77903, 2.79467, 2.80974, 2.82422,
2.83811, 2.85139, 2.86408, 2.87616, 2.88764, 2.89854, 2.90885, 2.91859, 2.92777,
2.93641, 2.94453, 2.95213, 2.95924, 2.96588, 2.97207, 2.97782, 2.98316, 2.98811,
2.99268, 2.9969, 3.00078, 3.00435, 3.00761, 3.01059, 3.01331, 3.01578, 3.01801,
3.02003, 3.02185, 3.02347, 3.02491, 3.02619, 3.02732, 3.0283, 3.02915, 3.02988,
3.03049, 3.03099, 3.03139, 3.03169, 3.03191, 3.03203, 3.03208, 3.03205, 3.03195,
3.03177, 3.03152, 3.0312, 3.03081, 3.03034, 3.0298, 3.02919, 3.02849, 3.02771,
3.02684, 3.02588, 3.02482, 3.02365, 3.02237, 3.02097, 3.01943, 3.01775, 3.0159,
3.01389, 3.01169, 3.00929, 3.00666, 3.00379, 3.00065, 2.99722, 2.99347, 2.98936,
2.98487, 2.97996, 2.97459, 2.9687, 2.96226, 2.9552, 2.94748, 2.93903, 2.92977,
2.91965, 2.90858, 2.89649, 2.88329, 2.86889, 2.85321, 2.83615, 2.81764, 2.7976,
2.77594, 2.7526, 2.72754, 2.70071, 2.67209, 2.64171, 2.60957, 2.57575, 2.54031,
2.50336, 2.46504, 2.42548, 2.38484, 2.34328, 2.30099, 2.2581, 2.21478, 2.17115,
2.12735, 2.08345, 2.03954, 1.99569, 1.95191, 1.90825, 1.86471, 1.82129, 1.77799,
1.7348, 1.69171, 1.64869, 1.60575, 1.56286, 1.52, 1.47718, 1.43437, 1.39157,
1.34877, 1.30596, 1.26314, 1.22031, 1.17746, 1.13459, 1.0917, 1.04879, 1.00585,
0.962892, 0.919908 };