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
@@ -43,12 +43,13 @@ using namespace std;
G4int G4BoldyshevTripletModel::maxZ = 99;
G4LPhysicsFreeVector* G4BoldyshevTripletModel::data[] = {0};
G4BoldyshevTripletModel::G4BoldyshevTripletModel (const G4ParticleDefinition*, const G4String& nam)
:G4VEmModel(nam),isInitialised(false),smallEnergy(4.*MeV)
G4BoldyshevTripletModel::G4BoldyshevTripletModel(const G4ParticleDefinition*, const G4String& nam)
:G4VEmModel(nam),smallEnergy(4.*MeV)
{
fParticleChange = 0;
fParticleChange = nullptr;
lowEnergyLimit = 4.0*electron_mass_c2;
momentumThreshold_c = energyThreshold = xb = xn = lowEnergyLimit;
verboseLevel= 0;
// Verbosity scale for debugging purposes:
@@ -70,7 +71,7 @@ G4BoldyshevTripletModel::~G4BoldyshevTripletModel()
for(G4int i=0; i<maxZ; ++i) {
if(data[i]) {
delete data[i];
data[i] = 0;
data[i] = nullptr;
}
}
}
@@ -78,9 +79,8 @@ G4BoldyshevTripletModel::~G4BoldyshevTripletModel()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4BoldyshevTripletModel::Initialise(
const G4ParticleDefinition* particle,
const G4DataVector& cuts)
void G4BoldyshevTripletModel::Initialise(const G4ParticleDefinition*,
const G4DataVector&)
{
if (verboseLevel > 1)
{
@@ -88,19 +88,30 @@ void G4BoldyshevTripletModel::Initialise(
<< G4endl
<< "Energy range: "
<< LowEnergyLimit() / MeV << " MeV - "
<< HighEnergyLimit() / GeV << " GeV"
<< HighEnergyLimit() / GeV << " GeV isMaster: " << IsMaster()
<< G4endl;
}
// compute values only once
energyThreshold = 1.1*electron_mass_c2;
momentumThreshold_c = std::sqrt(energyThreshold * energyThreshold
- electron_mass_c2*electron_mass_c2);
G4double momentumThreshold_N = momentumThreshold_c/electron_mass_c2;
G4double t = 0.5*G4Log(momentumThreshold_N +
std::sqrt(momentumThreshold_N*momentumThreshold_N + 1.0));
//G4cout << 0.5*asinh(momentumThreshold_N) << " " << t << G4endl;
G4double sinht = std::sinh(t);
G4double cosht = std::cosh(t);
G4double logsinht = G4Log(2.*sinht);
G4double J1 = 0.5*(t*cosht/sinht - logsinht);
G4double J2 = (-2./3.)*logsinht + t*cosht/sinht
+ (sinht - t*cosht*cosht*cosht)/(3.*sinht*sinht*sinht);
xb = 2.*(J1-J2)/J1;
xn = 1. - xb/6.;
if(IsMaster())
{
// Initialise element selector
InitialiseElementSelectors(particle, cuts);
// Access to elements
// Access to elements
char* path = getenv("G4LEDATA");
G4ProductionCutsTable* theCoupleTable =
@@ -117,32 +128,22 @@ void G4BoldyshevTripletModel::Initialise(
for (G4int j=0; j<nelm; ++j)
{
G4int Z = (G4int)(*theElementVector)[j]->GetZ();
if(Z < 1) { Z = 1; }
else if(Z > maxZ) { Z = maxZ; }
G4int Z = std::min((*theElementVector)[j]->GetZasInt(), maxZ);
if(!data[Z]) { ReadData(Z, path); }
}
}
}
if(isInitialised) { return; }
fParticleChange = GetParticleChangeForGamma();
isInitialised = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4BoldyshevTripletModel::InitialiseLocal(
const G4ParticleDefinition*, G4VEmModel* masterModel)
{
SetElementSelectors(masterModel->GetElementSelectors());
if(!fParticleChange) {
fParticleChange = GetParticleChangeForGamma();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double
G4BoldyshevTripletModel::MinPrimaryEnergy(const G4Material*,
const G4ParticleDefinition*,
G4double)
const G4ParticleDefinition*,
G4double)
{
return lowEnergyLimit;
}
@@ -172,15 +173,10 @@ void G4BoldyshevTripletModel::ReadData(size_t Z, const char* path)
return;
}
}
//
data[Z] = new G4LPhysicsFreeVector();
//
std::ostringstream ost;
ost << datadir << "livermore/tripdata/pp-trip-cs-" << Z <<".dat";
ost << datadir << "/livermore/tripdata/pp-trip-cs-" << Z <<".dat";
std::ifstream fin(ost.str().c_str());
if( !fin.is_open())
@@ -204,17 +200,14 @@ void G4BoldyshevTripletModel::ReadData(size_t Z, const char* path)
}
// Activation of spline interpolation
data[Z] ->SetSpline(true);
data[Z]->SetSpline(true);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double
G4BoldyshevTripletModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
G4double GammaEnergy,
G4double Z, G4double,
G4double, G4double)
G4double G4BoldyshevTripletModel::ComputeCrossSectionPerAtom(
const G4ParticleDefinition* part,
G4double GammaEnergy, G4double Z, G4double, G4double, G4double)
{
if (verboseLevel > 1)
{
@@ -224,38 +217,27 @@ G4BoldyshevTripletModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
if (GammaEnergy < lowEnergyLimit) { return 0.0; }
G4double xs = 0.0;
G4int intZ=G4int(Z);
if(intZ < 1 || intZ > maxZ) { return xs; }
G4double xs = 0.0;
G4int intZ = std::max(1, std::min(G4lrint(Z), maxZ));
G4LPhysicsFreeVector* pv = data[intZ];
// if element was not initialised
// do initialisation safely for MT mode
if(!pv)
{
InitialiseForElement(0, intZ);
InitialiseForElement(part, intZ);
pv = data[intZ];
if(!pv) { return xs; }
}
// x-section is taken from the table
xs = pv->Value(GammaEnergy);
if(verboseLevel > 0)
if(verboseLevel > 1)
{
G4int n = pv->GetVectorLength() - 1;
G4cout << "****** DEBUG: tcs value for Z=" << Z << " at energy (MeV)="
<< GammaEnergy/MeV << G4endl;
G4cout << " cs (Geant4 internal unit)=" << xs << G4endl;
G4cout << " -> first cs value in EADL data file (iu) =" << (*pv)[0] << G4endl;
G4cout << " -> last cs value in EADL data file (iu) =" << (*pv)[n] << G4endl;
G4cout << "*********************************************************" << G4endl;
G4cout << "*** Triplet conversion xs for Z=" << Z << " at energy E(MeV)="
<< GammaEnergy/MeV << " cs=" << xs/millibarn << " mb" << G4endl;
}
return xs;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -267,8 +249,8 @@ void G4BoldyshevTripletModel::SampleSecondaries(
G4double, G4double)
{
// The energies of the secondary particles are sampled using // a modified Wheeler-Lamb model (see PhysRevD 7 (1973), 26)
// The energies of the secondary particles are sampled using
// a modified Wheeler-Lamb model (see PhysRevD 7 (1973), 26)
if (verboseLevel > 1) {
G4cout << "Calling SampleSecondaries() of G4BoldyshevTripletModel"
<< G4endl;
@@ -277,183 +259,124 @@ void G4BoldyshevTripletModel::SampleSecondaries(
G4double photonEnergy = aDynamicGamma->GetKineticEnergy();
G4ParticleMomentum photonDirection = aDynamicGamma->GetMomentumDirection();
G4double epsilon ;
// G4double epsilon0Local = electron_mass_c2 / photonEnergy ;
G4double epsilon;
G4double p0 = electron_mass_c2;
G4double positronTotEnergy, electronTotEnergy, thetaEle, thetaPos;
G4double ener_re=0., theta_re, phi_re, phi;
// Calculo de theta - elecron de recoil
G4double energyThreshold = sqrt(2.)*electron_mass_c2; // -> momentumThreshold_N = 1
energyThreshold = 1.1*electron_mass_c2;
// G4cout << energyThreshold << G4endl;
G4double momentumThreshold_c = sqrt(energyThreshold * energyThreshold - electron_mass_c2*electron_mass_c2); // momentun in MeV/c unit
G4double momentumThreshold_N = momentumThreshold_c/electron_mass_c2; // momentun in mc unit
CLHEP::HepRandomEngine* rndmEngine = G4Random::getTheEngine();
// Calculation of recoil electron production
// recoil electron thould be 3d particle
G4DynamicParticle* particle3 = nullptr;
static const G4double costlim = std::cos(4.47*CLHEP::pi/180.);
G4double SigmaTot = (28./9.) * std::log ( 2.* photonEnergy / electron_mass_c2 ) - 218. / 27. ;
G4double X_0 = 2. * ( sqrt(momentumThreshold_N*momentumThreshold_N + 1) -1 );
G4double SigmaQ = (82./27. - (14./9.) * log (X_0) + 4./15.*X_0 - 0.0348 * X_0 * X_0);
G4double recoilProb = G4UniformRand();
//G4cout << "SIGMA TOT " << SigmaTot << " " << "SigmaQ " << SigmaQ << " " << SigmaQ/SigmaTot << " " << recoilProb << G4endl;
if (recoilProb >= SigmaQ/SigmaTot) // create electron recoil
G4double loga, f1_re, greject, cost;
G4double cosThetaMax = (energyThreshold - electron_mass_c2
+ electron_mass_c2*(energyThreshold + electron_mass_c2)/photonEnergy )
/momentumThreshold_c;
if (cosThetaMax > 1.) {
//G4cout << "G4BoldyshevTripletModel::SampleSecondaries: ERROR cosThetaMax= "
// << cosThetaMax << G4endl;
cosThetaMax = 1.0;
}
G4double logcostm = G4Log(cosThetaMax);
G4int nn = 0;
do {
cost = G4Exp(logcostm*rndmEngine->flat());
G4double are = 1./(14.*cost*cost);
G4double bre = (1.-5.*cost*cost)/(2.*cost);
loga = G4Log((1.+ cost)/(1.- cost));
f1_re = 1. - bre*loga;
greject = (cost < costlim) ? are*f1_re : 1.0;
// G4cout << nn << ". step of the 1st loop greject= " << greject << G4endl;
++nn;
} while(greject < rndmEngine->flat());
// Calculo de phi - elecron de recoil
G4double sint2 = (1. - cost)*(1. + cost);
G4double fp = 1. - sint2*loga/(2.*cost) ;
G4double rt, phi_re;
nn = 0;
do {
phi_re = twopi*rndmEngine->flat();
rt = (1. - std::cos(2.*phi_re)*fp/f1_re)/twopi;
//G4cout << nn << ". step of the 2nd loop greject= " << rt << G4endl;
++nn;
} while(rt < rndmEngine->flat());
// Calculo de la energia - elecron de recoil - relacion momento maximo <-> angulo
G4double S = electron_mass_c2*(2.* photonEnergy + electron_mass_c2);
G4double P2 = S - electron_mass_c2*electron_mass_c2;
G4double D2 = 4.*S * electron_mass_c2*electron_mass_c2 + P2*P2*sint2;
G4double ener_re = electron_mass_c2 * (S + electron_mass_c2*electron_mass_c2)/sqrt(D2);
if(ener_re >= energyThreshold)
{
G4double cosThetaMax = ( ( energyThreshold - electron_mass_c2 ) / (momentumThreshold_c) + electron_mass_c2*
( energyThreshold + electron_mass_c2 ) / (photonEnergy*momentumThreshold_c) );
if (cosThetaMax > 1) G4cout << "ERRORE " << G4endl;
G4double r1;
G4double r2;
G4double are, bre, loga, f1_re, greject, cost;
do {
r1 = G4UniformRand();
r2 = G4UniformRand();
// cost = (pow(4./enern,0.5*r1)) ;
cost = pow(cosThetaMax,r1);
theta_re = acos(cost);
are = 1./(14.*cost*cost);
bre = (1.-5.*cost*cost)/(2.*cost);
loga = log((1.+ cost)/(1.- cost));
f1_re = 1. - bre*loga;
if ( theta_re >= 4.47*CLHEP::pi/180.)
{
greject = are*f1_re;
} else {
greject = 1. ;
}
} while(greject < r2);
// Calculo de phi - elecron de recoil
G4double r3, r4, rt;
do {
r3 = G4UniformRand();
r4 = G4UniformRand();
phi_re = twopi*r3 ;
G4double sint2 = 1. - cost*cost ;
G4double fp = 1. - sint2*loga/(2.*cost) ;
rt = (1.-cos(2.*phi_re)*fp/f1_re)/(2.*pi) ;
} while(rt < r4);
// Calculo de la energia - elecron de recoil - relacion momento maximo <-> angulo
G4double S = electron_mass_c2*(2.* photonEnergy + electron_mass_c2);
G4double D2 = 4.*S * electron_mass_c2*electron_mass_c2
+ (S - electron_mass_c2*electron_mass_c2)
*(S - electron_mass_c2*electron_mass_c2)*sin(theta_re)*sin(theta_re);
ener_re = electron_mass_c2 * (S + electron_mass_c2*electron_mass_c2)/sqrt(D2);
// New Recoil energy calculation
G4double momentum_recoil = 2* (electron_mass_c2) * (std::cos(theta_re)/(std::sin(phi_re)*std::sin(phi_re)));
G4double ener_recoil = sqrt( momentum_recoil*momentum_recoil + electron_mass_c2*electron_mass_c2);
ener_re = ener_recoil;
// G4cout << "electron de retroceso " << ener_re << " " << theta_re << " " << phi_re << G4endl;
// Recoil electron creation
G4double dxEle_re=sin(theta_re)*std::cos(phi_re),dyEle_re=sin(theta_re)*std::sin(phi_re), dzEle_re=cos(theta_re);
G4double electronRKineEnergy = std::max(0.,ener_re - electron_mass_c2) ;
G4ThreeVector electronRDirection (dxEle_re, dyEle_re, dzEle_re);
G4double electronRKineEnergy = ener_re - electron_mass_c2;
G4double sint = std::sqrt(sint2);
G4ThreeVector electronRDirection (sint*std::cos(phi_re), sint*std::sin(phi_re), cost);
electronRDirection.rotateUz(photonDirection);
G4DynamicParticle* particle3 = new G4DynamicParticle (G4Electron::Electron(),
electronRDirection,
electronRKineEnergy);
fvect->push_back(particle3);
particle3 = new G4DynamicParticle (G4Electron::Electron(),
electronRDirection,
electronRKineEnergy);
}
else
{
// deposito la energia ener_re - electron_mass_c2
// G4cout << "electron de retroceso " << ener_re << G4endl;
fParticleChange->ProposeLocalEnergyDeposit(ener_re - electron_mass_c2);
// deposito la energia ener_re - electron_mass_c2
// G4cout << "electron de retroceso " << ener_re << G4endl;
fParticleChange->ProposeLocalEnergyDeposit(std::max(0.0, ener_re - electron_mass_c2));
ener_re = 0.0;
}
// Depaola (2004) suggested distribution for e+e- energy
// VI: very suspect that 1 random number is not enough
// and sampling below is not correct - should be fixed
G4double re = rndmEngine->flat();
// Depaola (2004) suggested distribution for e+e- energy
G4double a = std::sqrt(16./xb - 3. - 36.*re*xn + 36.*re*re*xn*xn + 6.*xb*re*xn);
G4double c1 = G4Exp(G4Log((-6. + 12.*re*xn + xb + 2*a)*xb*xb)/3.);
epsilon = c1/(2.*xb) + (xb - 4.)/(2.*c1) + 0.5;
G4double photonEnergy1 = photonEnergy - ener_re ;
// resto al foton la energia del electron de retro.
G4double positronTotEnergy = std::max(epsilon*photonEnergy1, electron_mass_c2);
G4double electronTotEnergy = std::max(photonEnergy1 - positronTotEnergy, electron_mass_c2);
static const G4double a1 = 1.6;
static const G4double a2 = 0.5333333333;
G4double uu = -G4Log(rndmEngine->flat()*rndmEngine->flat());
G4double u = (0.25 > rndmEngine->flat()) ? uu*a1 : uu*a2;
// G4double t = 0.5*asinh(momentumThreshold_N);
G4double t = 0.5*log(momentumThreshold_N + sqrt(momentumThreshold_N*momentumThreshold_N+1));
//G4cout << 0.5*asinh(momentumThreshold_N) << " " << t << G4endl;
G4double J1 = 0.5*(t*cosh(t)/sinh(t) - log(2.*sinh(t)));
G4double J2 = (-2./3.)*log(2.*sinh(t)) + t*cosh(t)/sinh(t) + (sinh(t)-t*pow(cosh(t),3))/(3.*pow(sinh(t),3));
G4double b = 2.*(J1-J2)/J1;
G4double n = 1 - b/6.;
G4double re=0.;
re = G4UniformRand();
G4double a = 0.;
G4double b1 = 16. - 3.*b - 36.*b*re*n + 36.*b*pow(re,2.)*pow(n,2.) +
6.*pow(b,2.)*re*n;
a = pow((b1/b),0.5);
G4double c1 = (-6. + 12.*re*n + b + 2*a)*pow(b,2.);
epsilon = (pow(c1,1./3.))/(2.*b) + (b-4.)/(2.*pow(c1,1./3.))+0.5;
G4double photonEnergy1 = photonEnergy - ener_re ; // resto al foton la energia del electron de retro.
positronTotEnergy = epsilon*photonEnergy1;
electronTotEnergy = photonEnergy1 - positronTotEnergy; // temporarly
G4double momento_e = sqrt(electronTotEnergy*electronTotEnergy -
electron_mass_c2*electron_mass_c2) ;
G4double momento_p = sqrt(positronTotEnergy*positronTotEnergy -
electron_mass_c2*electron_mass_c2) ;
G4double thetaEle = u*electron_mass_c2/electronTotEnergy;
G4double sinte = std::sin(thetaEle);
G4double coste = std::cos(thetaEle);
thetaEle = acos((sqrt(p0*p0/(momento_e*momento_e) +1.)- p0/momento_e)) ;
thetaPos = acos((sqrt(p0*p0/(momento_p*momento_p) +1.)- p0/momento_p)) ;
phi = twopi * G4UniformRand();
G4double dxEle= std::sin(thetaEle)*std::cos(phi),dyEle= std::sin(thetaEle)*std::sin(phi),dzEle=std::cos(thetaEle);
G4double dxPos=-std::sin(thetaPos)*std::cos(phi),dyPos=-std::sin(thetaPos)*std::sin(phi),dzPos=std::cos(thetaPos);
// Kinematics of the created pair:
// the electron and positron are assumed to have a symetric angular
// distribution with respect to the Z axis along the parent photon
G4double thetaPos = u*electron_mass_c2/positronTotEnergy;
G4double sintp = std::sin(thetaPos);
G4double costp = std::cos(thetaPos);
G4double electronKineEnergy = std::max(0.,electronTotEnergy - electron_mass_c2) ;
G4double phi = twopi * rndmEngine->flat();
G4double sinp = std::sin(phi);
G4double cosp = std::cos(phi);
// Kinematics of the created pair:
// the electron and positron are assumed to have a symetric angular
// distribution with respect to the Z axis along the parent photon
G4ThreeVector electronDirection (dxEle, dyEle, dzEle);
G4double electronKineEnergy = electronTotEnergy - electron_mass_c2;
G4ThreeVector electronDirection (sinte*cosp, sinte*sinp, coste);
electronDirection.rotateUz(photonDirection);
G4DynamicParticle* particle1 = new G4DynamicParticle (G4Electron::Electron(),
electronDirection,
electronKineEnergy);
// The e+ is always created (even with kinetic energy = 0) for further annihilation
G4double positronKineEnergy = std::max(0.,positronTotEnergy - electron_mass_c2) ;
G4double positronKineEnergy = positronTotEnergy - electron_mass_c2;
G4ThreeVector positronDirection (dxPos, dyPos, dzPos);
G4ThreeVector positronDirection (-sintp*cosp, -sintp*sinp, costp);
positronDirection.rotateUz(photonDirection);
// Create G4DynamicParticle object for the particle2
G4DynamicParticle* particle2 = new G4DynamicParticle(G4Positron::Positron(),
positronDirection, positronKineEnergy);
// Fill output vector
@@ -461,13 +384,11 @@ void G4BoldyshevTripletModel::SampleSecondaries(
fvect->push_back(particle1);
fvect->push_back(particle2);
if(particle3) { fvect->push_back(particle3); }
// kill incident photon
// kill incident photon
fParticleChange->SetProposedKineticEnergy(0.);
fParticleChange->ProposeTrackStatus(fStopAndKill);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -476,12 +397,11 @@ void G4BoldyshevTripletModel::SampleSecondaries(
namespace { G4Mutex BoldyshevTripletModelMutex = G4MUTEX_INITIALIZER; }
void G4BoldyshevTripletModel::InitialiseForElement(
const G4ParticleDefinition*,
G4int Z)
const G4ParticleDefinition*, G4int Z)
{
G4AutoLock l(&BoldyshevTripletModelMutex);
// G4cout << "G4BoldyshevTripletModel::InitialiseForElement Z= "
// << Z << G4endl;
// G4cout << "G4BoldyshevTripletModel::InitialiseForElement Z= "
// << Z << G4endl;
if(!data[Z]) { ReadData(Z); }
l.unlock();
}
@@ -25,7 +25,7 @@
//
//
// $Id: G4CrossSectionDataSet.cc 66241 2012-12-13 18:34:42Z gunter $
// $Id: G4CrossSectionDataSet.cc 104080 2017-05-10 14:52:27Z gcosmo $
//
// Author: Riccardo Capra <capra@ge.infn.it>
// Code review by MGP October 2007: removed inheritance from concrete class
@@ -166,25 +166,17 @@ G4bool G4CrossSectionDataSet::LoadData(const G4String & argFileName)
break;
case '\t':
c=' ';
case ' ':
if (space)
break;
space = true;
break;
default:
if (comment)
break;
if (c==' ')
space=true;
else
{
if (space && (!first))
(*stream) << ' ';
first=false;
(*stream) << c;
space=false;
}
if (comment) { break; }
if (space && (!first)) { (*stream) << ' '; }
first=false;
(*stream) << c;
space=false;
}
}
}
@@ -324,25 +316,17 @@ G4bool G4CrossSectionDataSet::LoadNonLogData(const G4String & argFileName)
break;
case '\t':
c=' ';
case ' ':
if (space)
break;
space = true;
break;
default:
if (comment)
break;
if (c==' ')
space=true;
else
{
if (space && (!first))
(*stream) << ' ';
first=false;
(*stream) << c;
space=false;
}
if (comment) { break; }
if (space && (!first)) { (*stream) << ' '; }
first=false;
(*stream) << c;
space=false;
}
}
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4Generator2BS.cc 66241 2012-12-13 18:34:42Z gunter $
// $Id: G4Generator2BS.cc 104410 2017-05-30 07:17:09Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -93,9 +93,6 @@ G4ThreeVector& G4Generator2BS::SampleDirection(const G4DynamicParticle* dp,
G4double gamma = energy/electron_mass_c2;
G4double beta = std::sqrt((gamma - 1)*(gamma + 1))/gamma;
//G4double Zeff = std::sqrt(static_cast<G4double>(Z) * (static_cast<G4double>(Z) + 1.0));
//z = (0.00008116224*(std::pow(Zeff,0.3333333)));
// VI speadup
fz = 0.00008116224*g4pow->Z13(Z)*g4pow->Z13(Z+1);
@@ -29,29 +29,33 @@
// and G4LivermoreRayleighModel (MT version)
#include "G4LivermoreGammaConversionModel.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4EmParameters.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4LPhysicsFreeVector.hh"
#include "G4PhysicsLogVector.hh"
#include "G4ProductionCutsTable.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4LivermoreGammaConversionModel::lowEnergyLimit = 2.*CLHEP::electron_mass_c2;
G4double G4LivermoreGammaConversionModel::tripletLowEnergy = 0.0;
G4double G4LivermoreGammaConversionModel::tripletHighEnergy = 100.0*CLHEP::GeV;
G4int G4LivermoreGammaConversionModel::verboseLevel = 0;
G4int G4LivermoreGammaConversionModel::nbinsTriplet = 0;
G4int G4LivermoreGammaConversionModel::maxZ = 99;
G4LPhysicsFreeVector* G4LivermoreGammaConversionModel::data[] = {nullptr};
G4PhysicsLogVector* G4LivermoreGammaConversionModel::probTriplet[] = {nullptr};
G4LivermoreGammaConversionModel::G4LivermoreGammaConversionModel
(const G4ParticleDefinition*, const G4String& nam)
:G4VEmModel(nam),isInitialised(false),smallEnergy(2.*MeV)
: G4VEmModel(nam),fParticleChange(nullptr)
{
fParticleChange = nullptr;
lowEnergyLimit = 2.0*electron_mass_c2;
verboseLevel= 0;
// Verbosity scale for debugging purposes:
// 0 = nothing
// 1 = calculation of cross sections, file openings...
@@ -71,7 +75,11 @@ G4LivermoreGammaConversionModel::~G4LivermoreGammaConversionModel()
for(G4int i=0; i<maxZ; ++i) {
if(data[i]) {
delete data[i];
data[i] = 0;
data[i] = nullptr;
}
if(probTriplet[i]) {
delete probTriplet[i];
probTriplet[i] = nullptr;
}
}
}
@@ -89,10 +97,18 @@ void G4LivermoreGammaConversionModel::Initialise(
<< G4endl
<< "Energy range: "
<< LowEnergyLimit() / MeV << " MeV - "
<< HighEnergyLimit() / GeV << " GeV"
<< HighEnergyLimit() / GeV << " GeV isMater: " << IsMaster()
<< G4endl;
}
if(!fParticleChange) {
fParticleChange = GetParticleChangeForGamma();
if(GetTripletModel()) {
GetTripletModel()->SetParticleChange(fParticleChange);
}
}
if(GetTripletModel()) { GetTripletModel()->Initialise(particle, cuts); }
if(IsMaster())
{
// Initialise element selector
@@ -108,23 +124,20 @@ void G4LivermoreGammaConversionModel::Initialise(
for(G4int i=0; i<numOfCouples; ++i)
{
const G4Material* material =
theCoupleTable->GetMaterialCutsCouple(i)->GetMaterial();
const G4ElementVector* theElementVector = material->GetElementVector();
G4int nelm = material->GetNumberOfElements();
const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
SetCurrentCouple(couple);
const G4Material* mat = couple->GetMaterial();
const G4ElementVector* theElementVector = mat->GetElementVector();
G4int nelm = mat->GetNumberOfElements();
for (G4int j=0; j<nelm; ++j)
{
G4int Z = (G4int)(*theElementVector)[j]->GetZ();
if(Z < 1) { Z = 1; }
else if(Z > maxZ) { Z = maxZ; }
G4int Z = std::min((*theElementVector)[j]->GetZasInt(), maxZ);
if(!data[Z]) { ReadData(Z, path); }
if(GetTripletModel()) { InitialiseProbability(particle, Z); }
}
}
}
if(isInitialised) { return; }
fParticleChange = GetParticleChangeForGamma();
isInitialised = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -170,13 +183,7 @@ void G4LivermoreGammaConversionModel::ReadData(size_t Z, const char* path)
return;
}
}
//
data[Z] = new G4LPhysicsFreeVector();
//
std::ostringstream ost;
ost << datadir << "/livermore/pair/pp-cs-" << Z <<".dat";
std::ifstream fin(ost.str().c_str());
@@ -190,43 +197,36 @@ void G4LivermoreGammaConversionModel::ReadData(size_t Z, const char* path)
"em0003",FatalException,
ed,"G4LEDATA version should be G4EMLOW6.27 or later.");
return;
}
}
else
{
if(verboseLevel > 3) { G4cout << "File " << ost.str()
if(verboseLevel > 1) { G4cout << "File " << ost.str()
<< " is opened by G4LivermoreGammaConversionModel" << G4endl;}
data[Z]->Retrieve(fin, true);
}
// Activation of spline interpolation
data[Z] ->SetSpline(true);
data[Z] ->SetSpline(true);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double
G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
G4double GammaEnergy,
G4double Z, G4double,
G4double, G4double)
G4double G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom(
const G4ParticleDefinition* particle,
G4double GammaEnergy, G4double Z, G4double, G4double, G4double)
{
if (verboseLevel > 1)
{
G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermoreGammaConversionModel"
<< G4endl;
G4cout << "G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom() Z= "
<< Z << G4endl;
}
if (GammaEnergy < lowEnergyLimit) { return 0.0; }
G4double xs = 0.0;
G4int intZ=G4int(Z);
if(intZ < 1 || intZ > maxZ) { return xs; }
G4int intZ = std::max(1, std::min(G4lrint(Z), maxZ));
G4LPhysicsFreeVector* pv = data[intZ];
@@ -234,7 +234,7 @@ G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom(const G4ParticleDefi
// do initialisation safely for MT mode
if(!pv)
{
InitialiseForElement(0, intZ);
InitialiseForElement(particle, intZ);
pv = data[intZ];
if(!pv) { return xs; }
}
@@ -243,13 +243,8 @@ G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom(const G4ParticleDefi
if(verboseLevel > 0)
{
G4int n = pv->GetVectorLength() - 1;
G4cout << "****** DEBUG: tcs value for Z=" << Z << " at energy (MeV)="
<< GammaEnergy/MeV << G4endl;
G4cout << " cs (Geant4 internal unit)=" << xs << G4endl;
G4cout << " -> first cs value in EADL data file (iu) =" << (*pv)[0] << G4endl;
G4cout << " -> last cs value in EADL data file (iu) =" << (*pv)[n] << G4endl;
G4cout << "*********************************************************" << G4endl;
G4cout << "*** Gamma conversion xs for Z=" << Z << " at energy E(MeV)="
<< GammaEnergy/MeV << " cs=" << xs/millibarn << " mb" << G4endl;
}
return xs;
@@ -265,15 +260,15 @@ void G4LivermoreGammaConversionModel::SampleSecondaries(
G4double, G4double)
{
// The energies of the e+ e- secondaries are sampled using the Bethe - Heitler
// cross sections with Coulomb correction. A modified version of the random
// number techniques of Butcher & Messel is used (Nuc Phys 20(1960),15).
// Note 1 : Effects due to the breakdown of the Born approximation at low
// energy are ignored.
// Note 2 : The differential cross section implicitly takes account of
// pair creation in both nuclear and atomic electron fields. However triplet
// prodution is not generated.
// The energies of the e+ e- secondaries are sampled using the Bethe - Heitler
// cross sections with Coulomb correction. A modified version of the random
// number techniques of Butcher & Messel is used (Nuc Phys 20(1960),15).
// Note 1 : Effects due to the breakdown of the Born approximation at low
// energy are ignored.
// Note 2 : The differential cross section implicitly takes account of
// pair creation in both nuclear and atomic electron fields. However triplet
// prodution is not generated.
if (verboseLevel > 1) {
G4cout << "Calling SampleSecondaries() of G4LivermoreGammaConversionModel"
@@ -286,10 +281,13 @@ void G4LivermoreGammaConversionModel::SampleSecondaries(
G4double epsilon ;
G4double epsilon0Local = electron_mass_c2 / photonEnergy ;
CLHEP::HepRandomEngine* rndmEngine = G4Random::getTheEngine();
// Do it fast if photon energy < 2. MeV
static const G4double smallEnergy = 2.*CLHEP::MeV;
if (photonEnergy < smallEnergy )
{
epsilon = epsilon0Local + (0.5 - epsilon0Local) * G4UniformRand();
epsilon = epsilon0Local + (0.5 - epsilon0Local) * rndmEngine->flat();
}
else
{
@@ -297,29 +295,34 @@ void G4LivermoreGammaConversionModel::SampleSecondaries(
const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition();
const G4Element* element = SelectRandomAtom(couple,particle,photonEnergy);
G4int Z = element->GetZasInt();
if (element == 0)
{
G4cout << "G4LivermoreGammaConversionModel::SampleSecondaries - element = 0"
<< G4endl;
// triplet production
if(GetTripletModel()) {
if(!probTriplet[Z]) { InitialiseForElement(particle, Z); }
/*
G4cout << "Liv: E= " << photonEnergy
<< " prob= " << probTriplet[Z]->Value(photonEnergy)
<< G4endl;
*/
if(probTriplet[Z] &&
rndmEngine->flat() < probTriplet[Z]->Value(photonEnergy)) {
GetTripletModel()->SampleSecondaries(fvect, couple, aDynamicGamma);
return;
}
}
G4IonisParamElm* ionisation = element->GetIonisation();
if (ionisation == 0)
{
G4cout << "G4LivermoreGammaConversionModel::SampleSecondaries - ionisation = 0"
<< G4endl;
return;
}
// Extract Coulomb factor for this Element
G4double fZ = 8. * (ionisation->GetlogZ3());
if (photonEnergy > 50. * MeV) fZ += 8. * (element->GetfCoulomb());
static const G4double midEnergy = 50.*CLHEP::MeV;
if (photonEnergy > midEnergy) { fZ += 8. * (element->GetfCoulomb()); }
// Limits of the screening variable
G4double screenFactor = 136. * epsilon0Local / (element->GetIonisation()->GetZ3()) ;
G4double screenMax = G4Exp ((42.24 - fZ)/8.368) - 0.952 ;
G4double screenMin = std::min(4.*screenFactor,screenMax) ;
G4double screenFactor = 136. * epsilon0Local / (element->GetIonisation()->GetZ3());
G4double screenMax = G4Exp((42.24 - fZ)/8.368) + 0.952;
G4double screenMin = std::min(4.*screenFactor,screenMax);
// Limits of the energy sampling
G4double epsilon1 = 0.5 - 0.5 * std::sqrt(1. - screenMin / screenMax) ;
@@ -328,7 +331,7 @@ void G4LivermoreGammaConversionModel::SampleSecondaries(
// Sample the energy rate of the created electron (or positron)
G4double screen;
G4double gReject ;
G4double gReject;
G4double f10 = ScreenFunction1(screenMin) - fZ;
G4double f20 = ScreenFunction2(screenMin) - fZ;
@@ -337,19 +340,19 @@ void G4LivermoreGammaConversionModel::SampleSecondaries(
do
{
if (normF1 / (normF1 + normF2) > G4UniformRand() )
if (normF1 > (normF1 + normF2)*rndmEngine->flat() )
{
epsilon = 0.5 - epsilonRange * std::pow(G4UniformRand(), 0.333333) ;
epsilon = 0.5 - epsilonRange *G4Exp(G4Log(rndmEngine->flat())/3.);
screen = screenFactor / (epsilon * (1. - epsilon));
gReject = (ScreenFunction1(screen) - fZ) / f10 ;
}
else
{
epsilon = epsilonMin + epsilonRange * G4UniformRand();
epsilon = epsilonMin + epsilonRange * rndmEngine->flat();
screen = screenFactor / (epsilon * (1 - epsilon));
gReject = (ScreenFunction2(screen) - fZ) / f20 ;
}
} while ( gReject < G4UniformRand() );
} while ( gReject < rndmEngine->flat() );
} // End of epsilon sampling
@@ -358,7 +361,7 @@ void G4LivermoreGammaConversionModel::SampleSecondaries(
G4double electronTotEnergy;
G4double positronTotEnergy;
if (G4UniformRand() > 0.5)
if (rndmEngine->flat() > 0.5)
{
electronTotEnergy = (1. - epsilon) * photonEnergy;
positronTotEnergy = epsilon * photonEnergy;
@@ -373,28 +376,22 @@ void G4LivermoreGammaConversionModel::SampleSecondaries(
// Universal distribution suggested by L. Urban (Geant3 manual (1993) Phys211),
// derived from Tsai distribution (Rev. Mod. Phys. 49, 421 (1977)
G4double u;
const G4double a1 = 0.625;
G4double a2 = 3. * a1;
// G4double d = 27. ;
// if (9. / (9. + d) > G4UniformRand())
if (0.25 > G4UniformRand())
{
u = - G4Log(G4UniformRand() * G4UniformRand()) / a1 ;
}
else
{
u = - G4Log(G4UniformRand() * G4UniformRand()) / a2 ;
}
static const G4double a1 = 1.6;
static const G4double a2 = 0.5333333333;
G4double uu = -G4Log(rndmEngine->flat()*rndmEngine->flat());
G4double u = (0.25 > rndmEngine->flat()) ? uu*a1 : uu*a2;
G4double thetaEle = u*electron_mass_c2/electronTotEnergy;
G4double thetaPos = u*electron_mass_c2/positronTotEnergy;
G4double phi = twopi * G4UniformRand();
G4double sinte = std::sin(thetaEle);
G4double coste = std::cos(thetaEle);
G4double dxEle= std::sin(thetaEle)*std::cos(phi),dyEle= std::sin(thetaEle)*std::sin(phi),dzEle=std::cos(thetaEle);
G4double dxPos=-std::sin(thetaPos)*std::cos(phi),dyPos=-std::sin(thetaPos)*std::sin(phi),dzPos=std::cos(thetaPos);
G4double thetaPos = u*electron_mass_c2/positronTotEnergy;
G4double sintp = std::sin(thetaPos);
G4double costp = std::cos(thetaPos);
G4double phi = twopi * rndmEngine->flat();
G4double sinp = std::sin(phi);
G4double cosp = std::cos(phi);
// Kinematics of the created pair:
// the electron and positron are assumed to have a symetric angular
@@ -402,7 +399,7 @@ void G4LivermoreGammaConversionModel::SampleSecondaries(
G4double electronKineEnergy = std::max(0.,electronTotEnergy - electron_mass_c2) ;
G4ThreeVector electronDirection (dxEle, dyEle, dzEle);
G4ThreeVector electronDirection (sinte*cosp, sinte*sinp, coste);
electronDirection.rotateUz(photonDirection);
G4DynamicParticle* particle1 = new G4DynamicParticle (G4Electron::Electron(),
@@ -412,7 +409,7 @@ void G4LivermoreGammaConversionModel::SampleSecondaries(
// The e+ is always created
G4double positronKineEnergy = std::max(0.,positronTotEnergy - electron_mass_c2) ;
G4ThreeVector positronDirection (dxPos, dyPos, dzPos);
G4ThreeVector positronDirection (-sintp*cosp, -sintp*sinp, costp);
positronDirection.rotateUz(photonDirection);
// Create G4DynamicParticle object for the particle2
@@ -429,54 +426,62 @@ void G4LivermoreGammaConversionModel::SampleSecondaries(
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double
G4LivermoreGammaConversionModel::ScreenFunction1(G4double screenVariable)
{
// Compute the value of the screening function 3*phi1 - phi2
G4double value;
if (screenVariable > 1.)
value = 42.24 - 8.368 * G4Log(screenVariable + 0.952);
else
value = 42.392 - screenVariable * (7.796 - 1.961 * screenVariable);
return value;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double
G4LivermoreGammaConversionModel::ScreenFunction2(G4double screenVariable)
{
// Compute the value of the screening function 1.5*phi1 - 0.5*phi2
G4double value;
if (screenVariable > 1.)
value = 42.24 - 8.368 * G4Log(screenVariable + 0.952);
else
value = 41.405 - screenVariable * (5.828 - 0.8945 * screenVariable);
return value;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4AutoLock.hh"
namespace { G4Mutex LivermoreGammaConversionModelMutex = G4MUTEX_INITIALIZER; }
void G4LivermoreGammaConversionModel::InitialiseForElement(
const G4ParticleDefinition*,
const G4ParticleDefinition* part,
G4int Z)
{
if(GetTripletModel()) { GetTripletModel()->InitialiseForElement(part, Z); }
G4AutoLock l(&LivermoreGammaConversionModelMutex);
// G4cout << "G4LivermoreGammaConversionModel::InitialiseForElement Z= "
// << Z << G4endl;
if(!data[Z]) { ReadData(Z); }
if(GetTripletModel() && !probTriplet[Z]) { InitialiseProbability(part, Z); }
l.unlock();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4LivermoreGammaConversionModel::InitialiseProbability(
const G4ParticleDefinition* part, G4int Z)
{
if(!probTriplet[Z]) {
const G4Material* mat = (CurrentCouple()) ? CurrentCouple()->GetMaterial()
: nullptr;
if(0 == nbinsTriplet) {
tripletLowEnergy = GetTripletModel()->MinPrimaryEnergy(mat, part, 0.0);
tripletHighEnergy =
std::max(GetTripletModel()->HighEnergyLimit(), 10*tripletLowEnergy);
G4int nbins = G4EmParameters::Instance()->NumberOfBinsPerDecade();
nbinsTriplet = std::max(3,
(G4int)(nbins*G4Log(tripletHighEnergy/tripletLowEnergy)/(6*G4Log(10.))));
}
/*
G4cout << "G4LivermoreGammaConversionModel::InitialiseProbability Z= "
<< Z << " Nbin= " << nbinsTriplet
<< " Emin(MeV)= " << tripletLowEnergy
<< " Emax(MeV)= " << tripletHighEnergy << G4endl;
*/
probTriplet[Z] =
new G4PhysicsLogVector(tripletLowEnergy,tripletHighEnergy,nbinsTriplet);
probTriplet[Z]->SetSpline(true);
G4double zz = (G4double)Z;
// loop over bins
for(G4int j=0; j<=nbinsTriplet; ++j) {
G4double e = (probTriplet[Z])->Energy(j);
SetupForMaterial(part, mat, e);
G4double cross = ComputeCrossSectionPerAtom(part, e, zz);
G4double tcross =
GetTripletModel()->ComputeCrossSectionPerAtom(part, e, zz);
tcross = (0.0 < cross) ? tcross/cross : 0.0;
(probTriplet[Z])->PutValue(j, tcross);
//G4cout << j << ". E= " << e << " prob= " << tcross << G4endl;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -183,7 +183,7 @@ void G4LivermoreNuclearGammaConversionModel::ReadData(size_t Z, const char* path
//
std::ostringstream ost;
ost << datadir << "livermore/pairdata/pp-pair-cs-" << Z <<".dat";
ost << datadir << "/livermore/pairdata/pp-pair-cs-" << Z <<".dat";
std::ifstream fin(ost.str().c_str());
if( !fin.is_open())
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4LivermorePhotoElectricModel.cc 94854 2015-12-11 13:54:09Z gcosmo $
// $Id: G4LivermorePhotoElectricModel.cc 104801 2017-06-19 07:10:39Z gcosmo $
//
//
// Author: Sebastien Incerti
@@ -63,7 +63,7 @@ using namespace std;
G4LivermorePhotoElectricModel::G4LivermorePhotoElectricModel(
const G4String& nam)
: G4VEmModel(nam),fParticleChange(nullptr),maxZ(99),
: G4VEmModel(nam),fParticleChange(nullptr),maxZ(98),
nShellLimit(100),fDeexcitationActive(false),isInitialised(false),
fAtomDeexcitation(nullptr)
{
@@ -98,13 +98,14 @@ G4LivermorePhotoElectricModel::~G4LivermorePhotoElectricModel()
{
if(IsMaster()) {
delete fShellCrossSection;
for(G4int i=0; i<maxZ; ++i) {
fShellCrossSection = nullptr;
for(G4int i=0; i<=maxZ; ++i) {
delete fParam[i];
fParam[i] = 0;
fParam[i] = nullptr;
delete fCrossSection[i];
fCrossSection[i] = 0;
fCrossSection[i] = nullptr;
delete fCrossSectionLE[i];
fCrossSectionLE[i] = 0;
fCrossSectionLE[i] = nullptr;
}
}
}
@@ -142,9 +143,7 @@ G4LivermorePhotoElectricModel::Initialise(const G4ParticleDefinition*,
G4int nelm = material->GetNumberOfElements();
for (G4int j=0; j<nelm; ++j) {
G4int Z = (G4int)(*theElementVector)[j]->GetZ();
if(Z < 1) { Z = 1; }
else if(Z > maxZ) { Z = maxZ; }
G4int Z = std::min((*theElementVector)[j]->GetZasInt(), maxZ);
if(!fCrossSection[Z]) { ReadData(Z, path); }
}
}
@@ -213,8 +212,8 @@ G4double G4LivermorePhotoElectricModel::ComputeCrossSectionPerAtom(
<< " Z= " << ZZ << " R(keV)= " << energy/keV << G4endl;
}
G4double cs = 0.0;
G4int Z = G4lrint(ZZ);
if(Z < 1 || Z >= maxZ) { return cs; }
G4int Z = std::min(G4lrint(ZZ), maxZ);
if(Z < 1) { return cs; }
// if element was not initialised
// do initialisation safely for MT mode
@@ -224,7 +223,7 @@ G4double G4LivermorePhotoElectricModel::ComputeCrossSectionPerAtom(
}
G4int idx = fNShells[Z]*6 - 4;
if (energy < (*(fParam[Z]))[idx-1]) { energy = (*(fParam[Z]))[idx-1]; }
energy = std::max(energy, (*(fParam[Z]))[idx-1]);
G4double x1 = 1.0/energy;
G4double x2 = x1*x1;
@@ -287,13 +286,7 @@ G4LivermorePhotoElectricModel::SampleSecondaries(
// Select randomly one element in the current material
//G4cout << "Select random atom Egamma(keV)= " << gammaEnergy/keV << G4endl;
const G4Element* elm = SelectRandomAtom(material, theGamma, gammaEnergy);
G4int Z = G4lrint(elm->GetZ());
// Select the ionised shell in the current atom according to shell
// cross sections
// G4cout << "Select random shell Z= " << Z << G4endl;
if(Z >= maxZ) { Z = maxZ-1; }
G4int Z = std::min(elm->GetZasInt(), maxZ);
// element was not initialised gamma should be absorbed
if(!fCrossSection[Z]) {
@@ -358,7 +351,7 @@ G4LivermorePhotoElectricModel::SampleSecondaries(
// << " Ebind(keV)= " << bindingEnergy/keV
// << " Egamma(keV)= " << gammaEnergy/keV << G4endl;
const G4AtomicShell* shell = 0;
const G4AtomicShell* shell = nullptr;
// no de-excitation from the last shell
if(fDeexcitationActive && shellIdx + 1 < nn) {
@@ -258,6 +258,7 @@ void G4LivermoreRayleighModel::SampleSecondaries(
G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy();
// absorption of low-energy gamma
/*
if (photonEnergy0 <= lowEnergyLimit)
{
fParticleChange->ProposeTrackStatus(fStopAndKill);
@@ -265,7 +266,7 @@ void G4LivermoreRayleighModel::SampleSecondaries(
fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0);
return ;
}
*/
// Select randomly one element in the current material
const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition();
const G4Element* elm = SelectRandomAtom(couple,particle,photonEnergy0);
@@ -45,7 +45,7 @@
// | |
// | The author acknowledges the work of the Geant4 collaboration |
// | in developing the following algorithms that have been employed |
// | or adapeted for the present software: |
// | or adapeted for the present software: |
// | |
// | # sampling of photon scattering angle, |
// | # target element selection in composite materials, |
@@ -57,14 +57,17 @@
// | History: |
// | -------- |
// | |
// | Jan. 2015 JMCB - 1st Version based on G4LowEPPComptonModel |
// | Jan. 2015 JMCB - 1st Version based on G4LowEPPComptonModel |
// | Feb. 2016 JMCB - Geant4 10.2 FPE fix for bug 1676 |
// | Nov. 2016 JMCB - Polarisation tracking fix in collaboration |
// | of Dr. Merlin Reynaard Kole, |
// | University of Geneva |
// | |
// *********************************************************************
#include "G4LowEPPolarizedComptonModel.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Exp.hh"
//****************************************************************************
@@ -83,8 +86,8 @@ G4LowEPPolarizedComptonModel::G4LowEPPolarizedComptonModel(const G4ParticleDefin
{
verboseLevel=1 ;
// Verbosity scale:
// 0 = nothing
// 1 = warning for energy non-conservation
// 0 = nothing
// 1 = warning for energy non-conservation
// 2 = details of energy budget
// 3 = calculation of cross sections, file openings, sampling of atoms
// 4 = entering in methods
@@ -173,7 +176,7 @@ void G4LowEPPolarizedComptonModel::Initialise(const G4ParticleDefinition* partic
}
if(isInitialised) { return; }
fParticleChange = GetParticleChangeForGamma();
fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
isInitialised = true;
@@ -242,7 +245,7 @@ void G4LowEPPolarizedComptonModel::ReadData(size_t Z, const char* path)
//****************************************************************************
G4double
G4double
G4LowEPPolarizedComptonModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
G4double GammaEnergy,
G4double Z, G4double,
@@ -323,7 +326,7 @@ void G4LowEPPolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicPartic
G4double e0m = photonEnergy0 / electron_mass_c2 ;
G4ParticleMomentum photonDirection0 = aDynamicGamma->GetMomentumDirection();
// Polarisation: check orientation of photon propagation direction and polarisation
// Fix if needed
@@ -440,7 +443,7 @@ void G4LowEPPolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicPartic
// ******************************************
// | Determine scatter photon energy |
// ******************************************
// ******************************************
do
{
@@ -460,18 +463,18 @@ void G4LowEPPolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicPartic
// Randomly sample bound electron momentum (memento: the data set is in Atomic Units)
ePAU = profileData->RandomSelectMomentum(Z,shellIdx);
// Convert to SI units
// Convert to SI units
G4double ePSI = ePAU * momentum_au_to_nat;
//Calculate bound electron velocity and normalise to natural units
u_temp = sqrt( ((ePSI*ePSI)*(vel_c*vel_c)) / ((e_mass_kg*e_mass_kg)*(vel_c*vel_c)+(ePSI*ePSI)) )/vel_c;
// Sample incident electron direction, amorphous material, to scattering photon scattering plane
// Sample incident electron direction, amorphous material, to scattering photon scattering plane
e_alpha = pi*G4UniformRand();
e_beta = twopi*G4UniformRand();
// Total energy of system
// Total energy of system
G4double eEIncident = electron_mass_c2 / sqrt( 1 - (u_temp*u_temp));
G4double systemE = eEIncident + pEIncident;
@@ -493,14 +496,14 @@ void G4LowEPPolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicPartic
// *******************************************************
// | Determine ejected Compton electron direction |
// *******************************************************
// *******************************************************
// Calculate velocity of ejected Compton electron
// Calculate velocity of ejected Compton electron
G4double a_temp = eERecoil / electron_mass_c2;
G4double u_p_temp = sqrt(1 - (1 / (a_temp*a_temp)));
// Coefficients and terms from simulatenous equations
// Coefficients and terms from simulatenous equations
G4double sinAlpha = std::sin(e_alpha);
G4double cosAlpha = std::cos(e_alpha);
@@ -548,7 +551,7 @@ void G4LowEPPolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicPartic
// Check if diff is less than zero, if so ensure it is due to FPE
//Confirm that diff less than zero is due FPE, i.e if abs of diff / diff1 and diff/ diff2 is less
//Confirm that diff less than zero is due FPE, i.e if abs of diff / diff1 and diff/ diff2 is less
//than 10^(-g4d_order), then set diff to zero
if ((diff < 0.0) && (abs(diff / diff1) < g4d_limit) && (abs(diff / diff2) < g4d_limit) )
@@ -556,19 +559,29 @@ void G4LowEPPolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicPartic
diff = 0.0;
}
// Plus and minus of quadratic
G4double X_p = (-var_Y + sqrt (diff))/(2*var_W);
G4double X_m = (-var_Y - sqrt (diff))/(2*var_W);
// Randomly sample one of the two possible solutions and determin theta angle of ejected Compton electron
// Floating point precision protection
// Check if X_p and X_m are greater than or less than 1 or -1, if so clean up FPE
// Issue due to propagation of FPE and only impacts 8th sig fig onwards
if(X_p >1){X_p=1;} if(X_p<-1){X_p=-1;}
if(X_m >1){X_m=1;} if(X_m<-1){X_m=-1;}
// End of FP protection
G4double ThetaE = 0.;
G4double sol_select = G4UniformRand();
// Randomly sample one of the two possible solutions and determin theta angle of ejected Compton electron
G4double sol_select = G4UniformRand();
if (sol_select < 0.5)
{
ThetaE = std::acos(X_p);
ThetaE = std::acos(X_p);
}
if (sol_select > 0.5)
{
@@ -592,7 +605,7 @@ void G4LowEPPolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicPartic
} while ( (iteration <= maxDopplerIterations) && (abs(cosPhiE) > 1));
// Revert to original if maximum number of iterations threshold has been reached
// Revert to original if maximum number of iterations threshold has been reached
if (iteration >= maxDopplerIterations)
{
pERecoil = photonEnergy0 ;
@@ -605,8 +618,10 @@ void G4LowEPPolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicPartic
// Set "scattered" photon direction and energy
G4ThreeVector photonDirection1(dirx,diry,dirz);
photonDirection1.rotateUz(photonDirection0);
photonPolarization1.rotateUz(photonDirection0);
SystemOfRefChange(photonDirection0,photonDirection1,
photonPolarization0,photonPolarization1);
if (pERecoil > 0.)
{
fParticleChange->SetProposedKineticEnergy(pERecoil) ;
@@ -622,7 +637,9 @@ void G4LowEPPolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicPartic
G4double eKineticEnergy = pEIncident - pERecoil - bindingE;
G4ThreeVector eDirection(eDirX,eDirY,eDirZ);
eDirection.rotateUz(photonDirection0);
SystemOfRefChangeElect(photonDirection0,eDirection,
photonPolarization0);
G4DynamicParticle* dp = new G4DynamicParticle (G4Electron::Electron(),
eDirection,eKineticEnergy) ;
fvect->push_back(dp);
@@ -651,7 +668,7 @@ void G4LowEPPolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicPartic
size_t nafter = fvect->size();
if(nafter > nbefore) {
for (size_t i=nbefore; i<nafter; ++i) {
//Check if there is enough residual energy
//Check if there is enough residual energy
if (bindingE >= ((*fvect)[i])->GetKineticEnergy())
{
//Ok, this is a valid secondary: keep it
@@ -716,7 +733,7 @@ G4LowEPPolarizedComptonModel::InitialiseForElement(const G4ParticleDefinition*,
//****************************************************************************
//Fitting data to compute scattering function
//Fitting data to compute scattering function
const G4double G4LowEPPolarizedComptonModel::ScatFuncFitParam[101][9] = {
{ 0, 0., 0., 0., 0., 0., 0., 0., 0.},
@@ -902,7 +919,7 @@ G4ThreeVector G4LowEPPolarizedComptonModel::GetPerpendicularPolarization
(const G4ThreeVector& photonDirection, const G4ThreeVector& photonPolarization) const
{
//
//
// The polarization of a photon is always perpendicular to its momentum direction.
// Therefore this function removes those vector component of photonPolarization, which
// points in direction of photonDirection
@@ -936,7 +953,7 @@ G4ThreeVector G4LowEPPolarizedComptonModel::SetNewPolarization(G4double LowEPPCe
// "Detection of Gamma Ray Polarization Using a 3-D Position Sensitive CdZnTe Detector"
// IEEE TNS, Vol. 52(4), 1160-1164, 2005.
// Determination of Theta
// Determination of Theta
G4double theta;
@@ -980,3 +997,48 @@ G4ThreeVector G4LowEPPolarizedComptonModel::SetNewPolarization(G4double LowEPPCe
return photonPolarization1;
}
void G4LowEPPolarizedComptonModel::SystemOfRefChange(G4ThreeVector& direction0,
G4ThreeVector& direction1,
G4ThreeVector& polarization0,
G4ThreeVector& polarization1)
{
// direction0 is the original photon direction ---> z
// polarization0 is the original photon polarization ---> x
// need to specify y axis in the real reference frame ---> y
G4ThreeVector Axis_Z0 = direction0.unit();
G4ThreeVector Axis_X0 = polarization0.unit();
G4ThreeVector Axis_Y0 = (Axis_Z0.cross(Axis_X0)).unit(); // to be confirmed;
G4double direction_x = direction1.getX();
G4double direction_y = direction1.getY();
G4double direction_z = direction1.getZ();
direction1 = (direction_x*Axis_X0 + direction_y*Axis_Y0 + direction_z*Axis_Z0).unit();
G4double polarization_x = polarization1.getX();
G4double polarization_y = polarization1.getY();
G4double polarization_z = polarization1.getZ();
polarization1 = (polarization_x*Axis_X0 + polarization_y*Axis_Y0 + polarization_z*Axis_Z0).unit();
}
void G4LowEPPolarizedComptonModel::SystemOfRefChangeElect(G4ThreeVector& pdirection,
G4ThreeVector& edirection,
G4ThreeVector& ppolarization)
{
// direction0 is the original photon direction ---> z
// polarization0 is the original photon polarization ---> x
// need to specify y axis in the real reference frame ---> y
G4ThreeVector Axis_Z0 = pdirection.unit();
G4ThreeVector Axis_X0 = ppolarization.unit();
G4ThreeVector Axis_Y0 = (Axis_Z0.cross(Axis_X0)).unit(); // to be confirmed;
G4double direction_x = edirection.getX();
G4double direction_y = edirection.getY();
G4double direction_z = edirection.getZ();
edirection = (direction_x*Axis_X0 + direction_y*Axis_Y0 + direction_z*Axis_Z0).unit();
}
@@ -1,3 +1,4 @@
//
// ********************************************************************
// * License and Disclaimer *
@@ -134,31 +135,23 @@ G4bool G4MicroElecCrossSectionDataSet::LoadData(const G4String & argFileName)
comment=false;
space=true;
break;
case '#':
comment=true;
break;
case '\t':
c=' ';
case ' ':
if (space)
break;
space = true;
break;
default:
if (comment)
break;
if (c==' ')
space=true;
else
{
if (space && (!first))
(*stream) << ' ';
first=false;
(*stream) << c;
space=false;
}
if (comment) { break; }
if (space && (!first)) { (*stream) << ' '; }
first=false;
(*stream) << c;
space=false;
}
}
}
@@ -298,25 +291,17 @@ G4bool G4MicroElecCrossSectionDataSet::LoadNonLogData(const G4String & argFileNa
break;
case '\t':
c=' ';
case ' ':
if (space)
break;
space = true;
break;
default:
if (comment)
break;
if (c==' ')
space=true;
else
{
if (space && (!first))
(*stream) << ' ';
first=false;
(*stream) << c;
space=false;
}
if (comment) { break; }
if (space && (!first)) { (*stream) << ' '; }
first=false;
(*stream) << c;
space=false;
}
}
}
@@ -27,7 +27,6 @@
// Based on G4DNACrossSectionDataSet
//
#include "G4MuElecCrossSectionDataSet.hh"
#include "G4VDataSetAlgorithm.hh"
#include "G4EMDataSet.hh"
@@ -35,7 +34,6 @@
#include <fstream>
#include <sstream>
G4MuElecCrossSectionDataSet::G4MuElecCrossSectionDataSet(G4VDataSetAlgorithm* argAlgorithm,
G4double argUnitEnergies,
G4double argUnitData)
@@ -43,10 +41,8 @@ G4MuElecCrossSectionDataSet::G4MuElecCrossSectionDataSet(G4VDataSetAlgorithm* ar
algorithm(argAlgorithm), unitEnergies(argUnitEnergies), unitData(argUnitData)
{
z = 0;
}
G4MuElecCrossSectionDataSet::~G4MuElecCrossSectionDataSet()
{
CleanUpComponents();
@@ -138,27 +134,19 @@ G4bool G4MuElecCrossSectionDataSet::LoadData(const G4String & argFileName)
case '#':
comment=true;
break;
case '\t':
c=' ';
case ' ':
if (space)
break;
space = true;
break;
default:
if (comment)
break;
if (c==' ')
space=true;
else
{
if (space && (!first))
(*stream) << ' ';
first=false;
(*stream) << c;
space=false;
}
if (comment) { break; }
if (space && (!first)) { (*stream) << ' '; }
first=false;
(*stream) << c;
space=false;
}
}
}
@@ -296,27 +284,19 @@ G4bool G4MuElecCrossSectionDataSet::LoadNonLogData(const G4String & argFileName)
case '#':
comment=true;
break;
case '\t':
c=' ';
case ' ':
if (space)
break;
space = true;
break;
default:
if (comment)
break;
if (c==' ')
space=true;
else
{
if (space && (!first))
(*stream) << ' ';
first=false;
(*stream) << c;
space=false;
}
if (comment) { break; }
if (space && (!first)) { (*stream) << ' '; }
first=false;
(*stream) << c;
space=false;
}
}
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4RayleighAngularGenerator.cc 74822 2013-10-22 14:42:13Z gcosmo $
// $Id: G4RayleighAngularGenerator.cc 104410 2017-05-30 07:17:09Z gcosmo $
// GEANT4 tag $Name: not supported by svn $
//
// -------------------------------------------------------------------
@@ -32,7 +32,7 @@
//
// File name: G4RayleighAngularGenerator
//
// Author: Ivanchenko using design of existing
// Author: V. Ivanchenko using design of existing
// interface
//
// Creation date: 31 May 2012
@@ -84,7 +84,6 @@ G4RayleighAngularGenerator::SampleDirection(const G4DynamicParticle* dp,
{
G4double ekin = dp->GetKineticEnergy();
G4double xx = fFactor*ekin*ekin;
G4double cost;
G4double n0 = PP6[Z] - 1.0;
G4double n1 = PP7[Z] - 1.0;
@@ -92,30 +91,25 @@ G4RayleighAngularGenerator::SampleDirection(const G4DynamicParticle* dp,
G4double b0 = PP3[Z];
G4double b1 = PP4[Z];
G4double b2 = PP5[Z];
G4double w0 = 0.0;
G4double w1 = 0.0;
G4double w2 = 0.0;
const G4double numlim = 0.02;
G4double x = 2*xx*b0;
if(x < numlim) { w0 = n0*x*(1 - 0.5*(n0 - 1)*x*(1 - (n0 - 2)*x/3.)); }
else { w0 = 1 - G4Exp(-n0*G4Log(1 + x)); }
static const G4double numlim = 0.02;
G4double x = 2.*xx*b0;
G4double w0 = (x < numlim) ? n0*x*(1.0 - 0.5*(n0 - 1.0)*x*(1.0 - (n0 - 2.0)*x/3.))
: 1.0 - G4Exp(-n0*G4Log(1.0 + x));
if(PP1[Z] > 0.0) {
x = 2*xx*b1;
if(x < numlim) { w1 = n1*x*(1 - 0.5*(n1 - 1)*x*(1 - (n1 - 2)*x/3.)); }
else { w1 = 1 - G4Exp(-n1*G4Log(1 + x)); }
}
if(PP2[Z] > 0.0) {
x = 2*xx*b2;
if(x < numlim) { w2 = n2*x*(1 - 0.5*(n2 - 1)*x*(1 - (n2 - 2)*x/3.)); }
else { w2 = 1 - G4Exp(-n2*G4Log(1 + x)); }
}
x = 2.*xx*b1;
G4double w1 = (x < numlim) ? n1*x*(1.0 - 0.5*(n1 - 1.0)*x*(1.0 - (n1 - 2.0)*x/3.))
: 1.0 - G4Exp(-n1*G4Log(1.0 + x));
x = 2.*xx*b2;
G4double w2 = (x < numlim) ? n2*x*(1.0 - 0.5*(n2 - 1.0)*x*(1.0 - (n2 - 2.0)*x/3.))
: 1.0 - G4Exp(-n2*G4Log(1.0 + x));
G4double x0= w0*PP0[Z]/(b0*n0);
G4double x1= w1*PP1[Z]/(b1*n1);
G4double x2= w2*PP2[Z]/(b2*n2);
G4double cost;
do {
G4double w = w0;
@@ -139,9 +133,9 @@ G4RayleighAngularGenerator::SampleDirection(const G4DynamicParticle* dp,
// sampling of angle
G4double y = w*G4UniformRand();
if(y < numlim) { x = y*n*( 1 + 0.5*(n + 1)*y*(1 - (n + 2)*y/3.)); }
if(y < numlim) { x = y*n*( 1. + 0.5*(n + 1.)*y*(1. - (n + 2.)*y/3.)); }
//else { x = 1.0/std::pow(1 - y, n) - 1.0; }
else { x = G4Exp(-n*G4Log(1 - y)) - 1.0; }
else { x = G4Exp(-n*G4Log(1. - y)) - 1.0; }
cost = 1.0 - x/(b*xx);
//G4cout << "cost = " << cost << " w= " << w << " n= " << n
// << " b= " << b << " x= " << x << " xx= " << xx << G4endl;
@@ -54,16 +54,16 @@ G4ecpssrFormFactorKxsModel::G4ecpssrFormFactorKxsModel()
{
interpolation = new G4LogLogInterpolation();
for (G4int i=6; i<93; i++)
for (G4int i=3; i<93; i++)
{
protonDataSetMap[i] = new G4EMDataSet(i,interpolation);
protonDataSetMap[i]->LoadData("pixe/ecpssr/proton/k-");
protonDataSetMap[i]->LoadData("pixe/ecpssr/proton/k-i01m001c01-");
}
for (G4int i=6; i<93; i++)
for (G4int i=3; i<93; i++)
{
alphaDataSetMap[i] = new G4EMDataSet(i,interpolation);
alphaDataSetMap[i]->LoadData("pixe/ecpssr/alpha/k-");
alphaDataSetMap[i]->LoadData("pixe/ecpssr/alpha/k-i02m004c02-");
}
}
@@ -85,7 +85,7 @@ G4double G4ecpssrFormFactorKxsModel::CalculateCrossSection(G4int zTarget,G4doubl
G4Alpha* aAlpha = G4Alpha::Alpha();
G4double sigma = 0;
if (energyIncident > 0.1*MeV && energyIncident < 100.*MeV && zTarget < 93 && zTarget > 5) {
if (energyIncident > 0.1*MeV && energyIncident < 100.*MeV && zTarget < 93 && zTarget > 2) {
if (massIncident == aProton->GetPDGMass())
{
@@ -54,28 +54,28 @@ G4ecpssrFormFactorLixsModel::G4ecpssrFormFactorLixsModel()
{
interpolation = new G4LinInterpolation();
for (G4int i=6; i<93; i++)
for (G4int i=11; i<93; i++)
{
protonL1DataSetMap[i] = new G4EMDataSet(i,interpolation);
protonL1DataSetMap[i]->LoadData("pixe/ecpssr/proton/l1-");
protonL1DataSetMap[i]->LoadData("pixe/ecpssr/proton/l1-i01m001c01-");
protonL2DataSetMap[i] = new G4EMDataSet(i,interpolation);
protonL2DataSetMap[i]->LoadData("pixe/ecpssr/proton/l2-");
protonL2DataSetMap[i]->LoadData("pixe/ecpssr/proton/l2-i01m001c01-");
protonL3DataSetMap[i] = new G4EMDataSet(i,interpolation);
protonL3DataSetMap[i]->LoadData("pixe/ecpssr/proton/l3-");
protonL3DataSetMap[i]->LoadData("pixe/ecpssr/proton/l3-i01m001c01-");
}
for (G4int i=6; i<93; i++)
for (G4int i=11; i<93; i++)
{
alphaL1DataSetMap[i] = new G4EMDataSet(i,interpolation);
alphaL1DataSetMap[i]->LoadData("pixe/ecpssr/alpha/l1-");
alphaL1DataSetMap[i]->LoadData("pixe/ecpssr/alpha/l1-i02m004c02-");
alphaL2DataSetMap[i] = new G4EMDataSet(i,interpolation);
alphaL2DataSetMap[i]->LoadData("pixe/ecpssr/alpha/l2-");
alphaL2DataSetMap[i]->LoadData("pixe/ecpssr/alpha/l2-i02m004c02-");
alphaL3DataSetMap[i] = new G4EMDataSet(i,interpolation);
alphaL3DataSetMap[i]->LoadData("pixe/ecpssr/alpha/l3-");
alphaL3DataSetMap[i]->LoadData("pixe/ecpssr/alpha/l3-i02m004c02-");
}
}
@@ -104,7 +104,7 @@ G4double G4ecpssrFormFactorLixsModel::CalculateL1CrossSection(G4int zTarget,G4do
G4Alpha* aAlpha = G4Alpha::Alpha();
G4double sigma = 0;
if (energyIncident > 0.1*MeV && energyIncident < 100.*MeV && zTarget < 93 && zTarget > 5) {
if (energyIncident > 0.1*MeV && energyIncident < 100.*MeV && zTarget < 93 && zTarget > 10) {
if (massIncident == aProton->GetPDGMass())
{
@@ -135,7 +135,7 @@ G4double G4ecpssrFormFactorLixsModel::CalculateL2CrossSection(G4int zTarget,G4do
G4Alpha* aAlpha = G4Alpha::Alpha();
G4double sigma = 0;
if (energyIncident > 0.1*MeV && energyIncident < 100.*MeV && zTarget < 93 && zTarget > 5) {
if (energyIncident > 0.1*MeV && energyIncident < 100.*MeV && zTarget < 93 && zTarget > 10) {
if (massIncident == aProton->GetPDGMass())
{
@@ -166,7 +166,7 @@ G4double G4ecpssrFormFactorLixsModel::CalculateL3CrossSection(G4int zTarget,G4do
G4Alpha* aAlpha = G4Alpha::Alpha();
G4double sigma = 0;
if (energyIncident > 0.1*MeV && energyIncident < 100.*MeV && zTarget < 93 && zTarget > 5) {
if (energyIncident > 0.1*MeV && energyIncident < 100.*MeV && zTarget < 93 && zTarget > 10) {
if (massIncident == aProton->GetPDGMass())
{
@@ -54,22 +54,22 @@ G4ecpssrFormFactorMixsModel::G4ecpssrFormFactorMixsModel()
{
interpolation = new G4LinInterpolation();
for (G4int i=62; i<93; i++)
for (G4int i=29; i<93; i++)
{
protonM1DataSetMap[i] = new G4EMDataSet(i,interpolation);
protonM1DataSetMap[i]->LoadData("pixe/ecpssr/proton/m1-");
protonM1DataSetMap[i]->LoadData("pixe/ecpssr/proton/m1-i01m001c01-");
protonM2DataSetMap[i] = new G4EMDataSet(i,interpolation);
protonM2DataSetMap[i]->LoadData("pixe/ecpssr/proton/m2-");
protonM2DataSetMap[i]->LoadData("pixe/ecpssr/proton/m2-i01m001c01-");
protonM3DataSetMap[i] = new G4EMDataSet(i,interpolation);
protonM3DataSetMap[i]->LoadData("pixe/ecpssr/proton/m3-");
protonM3DataSetMap[i]->LoadData("pixe/ecpssr/proton/m3-i01m001c01-");
protonM4DataSetMap[i] = new G4EMDataSet(i,interpolation);
protonM4DataSetMap[i]->LoadData("pixe/ecpssr/proton/m4-");
protonM4DataSetMap[i]->LoadData("pixe/ecpssr/proton/m4-i01m001c01-");
protonM5DataSetMap[i] = new G4EMDataSet(i,interpolation);
protonM5DataSetMap[i]->LoadData("pixe/ecpssr/proton/m5-");
protonM5DataSetMap[i]->LoadData("pixe/ecpssr/proton/m5-i01m001c01-");
}
protonMiXsVector.push_back(protonM1DataSetMap);
@@ -79,22 +79,22 @@ G4ecpssrFormFactorMixsModel::G4ecpssrFormFactorMixsModel()
protonMiXsVector.push_back(protonM5DataSetMap);
for (G4int i=62; i<93; i++)
for (G4int i=29; i<93; i++)
{
alphaM1DataSetMap[i] = new G4EMDataSet(i,interpolation);
alphaM1DataSetMap[i]->LoadData("pixe/ecpssr/alpha/m1-");
alphaM1DataSetMap[i]->LoadData("pixe/ecpssr/alpha/m1-i02m004c02-");
alphaM2DataSetMap[i] = new G4EMDataSet(i,interpolation);
alphaM2DataSetMap[i]->LoadData("pixe/ecpssr/alpha/m2-");
alphaM2DataSetMap[i]->LoadData("pixe/ecpssr/alpha/m2-i02m004c02-");
alphaM3DataSetMap[i] = new G4EMDataSet(i,interpolation);
alphaM3DataSetMap[i]->LoadData("pixe/ecpssr/alpha/m3-");
alphaM3DataSetMap[i]->LoadData("pixe/ecpssr/alpha/m3-i02m004c02-");
alphaM4DataSetMap[i] = new G4EMDataSet(i,interpolation);
alphaM4DataSetMap[i]->LoadData("pixe/ecpssr/alpha/m4-");
alphaM4DataSetMap[i]->LoadData("pixe/ecpssr/alpha/m4-i02m004c02-");
alphaM5DataSetMap[i] = new G4EMDataSet(i,interpolation);
alphaM5DataSetMap[i]->LoadData("pixe/ecpssr/alpha/m5-");
alphaM5DataSetMap[i]->LoadData("pixe/ecpssr/alpha/m5-i02m004c02-");
}
@@ -139,7 +139,7 @@ G4double G4ecpssrFormFactorMixsModel::CalculateMiCrossSection(G4int zTarget,G4do
G4double sigma = 0;
G4int mShellIndex = mShellId -1;
if (energyIncident > 0.1*MeV && energyIncident < 10*MeV && zTarget < 93 && zTarget > 61) {
if (energyIncident > 0.1*MeV && energyIncident < 100*MeV && zTarget < 93 && zTarget > 28) {
if (massIncident == aProton->GetPDGMass())
{