Import Geant4 10.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 14:11:04 +02:00
parent c9b32a6c0a
commit d4af681f38
4886 changed files with 420149 additions and 1023309 deletions
@@ -1,358 +0,0 @@
//
// ********************************************************************
// * 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. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 19770/06/NL/JD (Technology Research Programme). *
// * *
// * 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. *
// ********************************************************************
//
/// \file hadronic/Hadr02/src/G4DPMJET2_5CrossSection.cc
/// \brief Implementation of the G4DPMJET2_5CrossSection class
//
// $Id: G4DPMJET2_5CrossSection.cc 81932 2014-06-06 15:39:45Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4DPMJET2_5CrossSection.cc
//
// Version: 0.A
// Date: 02/04/08
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 19770/06/NL/JD
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#ifdef G4_USE_DPMJET
#include "G4DPMJET2_5CrossSection.hh"
#include "G4DynamicParticle.hh"
#include "G4NucleiProperties.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4HadronicException.hh"
#include "globals.hh"
#include <iomanip>
#include <fstream>
#include <sstream>
#include "G4DynamicParticle.hh"
using namespace std;
///////////////////////////////////////////////////////////////////////////////
//
G4DPMJET2_5CrossSection::G4DPMJET2_5CrossSection ():
upperLimit ( 1000.0 * TeV ), lowerLimit ( 5.0 * GeV ), maxA(240)
{
theCrossSectionIndex.clear();
Initialise();
//
//
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// This next bit is provisional, stating that this cross-section estimator
// is applicable to hydrogen targets. However, the cross-section will be
// set to zero.
//
ATmin = 1;
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//
}
///////////////////////////////////////////////////////////////////////////////
//
G4DPMJET2_5CrossSection::~G4DPMJET2_5CrossSection ()
{
//
// Go through the list of cross-section fit parameters and delete the arrays.
//
G4cout << "G4DPMJET2_5CrossSection::~G4DPMJET2_5CrossSection" << G4endl;
G4cout << "Size: " << theCrossSectionIndex.size() << G4endl;
/*
if(theCrossSectionIndex.size() > 0) {
G4DPMJET2_5CrossSectionIndex::iterator it;
for (it=theCrossSectionIndex.begin(); it!=theCrossSectionIndex.end(); ++it)
{
G4DPMJET2_5CrossSectionParamSet *ptr = it->second;
for (G4DPMJET2_5CrossSectionParamSet *ptr1=ptr; ptr1<ptr+maxA; ptr1++)
{ delete ptr1; }
}
}
*/
}
///////////////////////////////////////////////////////////////////////////////
//
G4bool
G4DPMJET2_5CrossSection::IsIsoApplicable(const G4DynamicParticle* theProjectile,
G4int, G4int AT,
const G4Element*, const G4Material*)
{
G4bool result = false;
G4int AP = theProjectile->GetDefinition()->GetBaryonNumber();
if(AP >= 1) {
G4double EPN = theProjectile->GetKineticEnergy()/G4double(AP);
result = (EPN >= lowerLimit && EPN <= upperLimit &&
AT >= ATmin && AT <= ATmax &&
AP >= APmin && AP <= APmax);
}
return result;
}
///////////////////////////////////////////////////////////////////////////////
//
G4double
G4DPMJET2_5CrossSection::GetIsoCrossSection(
const G4DynamicParticle* theProjectile,
G4int ZZ, G4int AT, const G4Isotope*,
const G4Element*, const G4Material*)
{
//
// Initialise the result.
G4double result = 0.0;
//
//
// Get details of the projectile and target (nucleon number, atomic number,
// kinetic enery and energy/nucleon.
//
G4int AP = theProjectile->GetDefinition()->GetBaryonNumber();
G4double TP = theProjectile->GetKineticEnergy();
G4double EPN = TP /G4double(AP);
if (AT < ATmin || AT > ATmax || AP < APmin || AP > APmax ||
EPN < lowerLimit || EPN > upperLimit)
{
G4cout <<G4endl;
G4cout <<"ERROR IN G4DPMJET2_5CrossSection::GetIsoZACrossSection" <<G4endl;
G4cout <<"ATTEMPT TO USE CROSS-SECTION OUTSIDE OF RANGE" <<G4endl;
G4cout <<"NUCLEON NUMBER OF PROJECTILE = " <<AP <<G4endl;
G4cout <<"NUCLEON NUMBER OF TARGET = " <<AT <<G4endl;
G4cout <<"ENERGY PER NUCLEON = " <<EPN*MeV <<G4endl;
G4cout <<"ACCEPTABLE RANGE FOR AP = " <<APmin
<<" TO " <<APmax <<G4endl;
G4cout <<"ACCEPTABLE RANGE FOR AT = " <<ATmin
<<" TO " <<ATmax <<G4endl;
G4cout <<"ACCEPTABLE RANGE FOR ENERGY = " <<lowerLimit
<<" MeV/n TO " <<upperLimit
<<" MeV/n" <<G4endl;
G4cout <<G4endl;
return result;
}
//
//
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// This next bit is provisional, stating that this cross-section hydrogen
// targets is zero.
//
if ( AT == 1 ) return 0.0;
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//
//
//
// Results are parameterised as a function of the natural logarithm of the
// centre of mass energy of the projectile and target system.
//
G4double sigma = 0.0;
G4double mT = G4NucleiProperties::GetNuclearMass(AT, ZZ);
G4double EP = theProjectile->GetTotalEnergy();
G4double mP = theProjectile->GetDefinition()->GetPDGMass();
G4double lnECM = std::log(std::sqrt(mP*mP + mT*mT + 2.0*mT*EP));
G4DPMJET2_5CrossSectionIndex::iterator it = theCrossSectionIndex.find(AT);
if (it != theCrossSectionIndex.end())
{
G4DPMJET2_5CrossSectionParamSet *ptr = (it->second) + AP;
G4double cc0 = (*ptr)[0];
G4double cc1 = (*ptr)[1];
G4double cc2 = (*ptr)[2];
sigma = cc0 + cc1*lnECM + cc2*lnECM*lnECM;
sigma = sigma * millibarn;
if (verboseLevel >= 2) {
G4cout <<"***************************************************************"
<<G4endl;
G4cout <<"G4DPMJET2_5CrossSection::GetIsoCrossSection" <<G4endl;
G4cout <<"PROJECTILE = "
<<theProjectile->GetDefinition()->GetParticleName() <<G4endl;
G4cout <<"TARGET (A,Z) = (" <<AT <<"," <<ZZ <<")" <<G4endl;
G4cout <<"K. ENERGY/NUC = " <<EPN/MeV <<" MeV/n" <<G4endl;
G4cout <<"CROSS SECTION = " <<sigma/millibarn <<" MILLIBARNS" <<G4endl;
G4cout <<"***************************************************************"
<<G4endl;
}
}
else
{
G4cout <<G4endl;
G4cout <<"ERROR IN G4DPMJET2_5CrossSection::GetIsoCrossSection" <<G4endl;
G4cout <<"NO CROSS-SECTION FIT DATA LOADED FOR AT = " <<AT <<G4endl;
G4cout <<G4endl;
}
return sigma;
}
///////////////////////////////////////////////////////////////////////////////
//
void G4DPMJET2_5CrossSection::Initialise ()
{
//verboseLevel = 2;
//
//
// Determine first if the environment variable G4DPMJET2_5DATA is set. If not
// then ask for it to be set and call exception.
//
if ( !getenv("G4DPMJET2_5DATA") )
{
G4cout <<"ENVIRONMENT VARIABLE G4DPMJET2_5DATA NOT SET " <<G4endl;
throw G4HadronicException(__FILE__, __LINE__,
"Please setenv G4DPMJET2_5DATA to point to the dpmjet2.5 data files.");
}
G4String filename = G4String(getenv("G4DPMJET2_5DATA")) + "/" +
"GlauberCrossSections.dat";
std::ifstream glauberXSFile(filename);
if (glauberXSFile) {
//
//
// Glaubercross-section file does exist, so read in maximum and minimum A
// for target and projectile.
//
glauberXSFile >>APmin >>APmax >>ATmin >>ATmax;
//
//
// Determine the list of targets based on the G4ElementList. The list of
// target nucleon numbers is stored as a ket to the map theCrossSectionIndex.
// G4double[240][3] array objects are created to allow storage of the
// cross-section fit parameters.
//
const G4ElementTable *theElementTable = G4Element::GetElementTable();
G4ElementTable::const_iterator it;
for (it=theElementTable->begin(); it!=theElementTable->end(); it++)
{
G4int nIso = (*it)->GetNumberOfIsotopes();
G4IsotopeVector* isoVector = (*it)->GetIsotopeVector();
for (G4int i = 0; i < nIso; i++)
{
G4int AA = (*isoVector)[i]->GetN();
if (theCrossSectionIndex.count(AA) == 0 &&
AA >= ATmin && AA <= ATmax)
{
//
//
// Whilst the use of std::map should eliminate duplication of keys, we need to
// know whether isotope's with the same nucleon number have been declared before
// creating the large arrays, hence the use of the "count" member function.
//
G4DPMJET2_5CrossSectionParamSet *a =
new G4DPMJET2_5CrossSectionParamSet[maxA];
theCrossSectionIndex.insert(
G4DPMJET2_5CrossSectionIndex::value_type(AA,a));
}
}
}
//
//
// Now proceed to read in the remainder of the GlauberCrossSection.dat file,
// loading into theCrossSectionIndex any relevant fitting parameters to the
// target nuclei.
//
char inputChars[80]={' '};
G4String inputLine;
while (-glauberXSFile.getline(inputChars, 80).eof() != EOF)
{
inputLine = inputChars;
if (inputLine.length() != 0)
{
std::istringstream tmpStream(inputLine);
G4int AP, AT;
G4double cc0, cc1, cc2;
tmpStream >>AP >>AT >>cc0 >>cc1 >>cc2;
G4DPMJET2_5CrossSectionIndex::iterator IT =
theCrossSectionIndex.find(AT);
if (IT != theCrossSectionIndex.end())
{
G4DPMJET2_5CrossSectionParamSet *ptr = (IT->second) + AP;
*ptr = G4DPMJET2_5CrossSectionParamSet(cc0,cc1,cc2);
}
}
}
glauberXSFile.close();
G4cout << "G4DPMJET2_5CrossSection::Initialise () done!" << G4endl;
} else {
G4cout <<"GlauberCrossSections.dat DOES NOT EXIST" <<G4endl;
throw G4HadronicException(__FILE__, __LINE__,
"GlauberCrossSections.dat should be located in $G4DPMJET2_5DATA directory.");
}
}
///////////////////////////////////////////////////////////////////////////////
//
void G4DPMJET2_5CrossSection::BuildPhysicsTable(const G4ParticleDefinition&)
{;}
///////////////////////////////////////////////////////////////////////////////
//
void G4DPMJET2_5CrossSection::DumpPhysicsTable(const G4ParticleDefinition
&theProjectile)
{
const G4int AP = G4lrint(theProjectile.GetBaryonNumber());
G4cout <<G4endl;
G4cout <<"G4DPMJET2_5CrossSection::DumpPhysicsTable" <<G4endl;
G4cout <<"DUMPING CROSS-SECTION FITTING COEFFICIENTS FOR AP = "
<<AP <<G4endl;
G4cout <<G4endl;
G4cout <<" AT"
<<" c0"
<<" c1"
<<" c2"
<<G4endl;
G4DPMJET2_5CrossSectionIndex::iterator it;
for (it=theCrossSectionIndex.begin(); it!=theCrossSectionIndex.end(); it++)
{
G4cout.unsetf(std::ios::scientific);
G4cout.setf(std::ios::fixed|std::ios::right|std::ios::adjustfield);
G4cout.precision(0);
G4cout <<std::setw(5) <<it->first;
G4cout.unsetf(std::ios::fixed);
G4cout.setf(std::ios::scientific|std::ios::right|std::ios::adjustfield);
G4cout.precision(7);
G4DPMJET2_5CrossSectionParamSet *ptr = (it->second) + AP;
G4cout <<std::setw(15) <<(*ptr)[0]
<<std::setw(15) <<(*ptr)[1]
<<std::setw(15) <<(*ptr)[2]
<<G4endl;
}
G4cout.setf(std::ios::fixed);
}
#endif
File diff suppressed because it is too large Load Diff
@@ -1,96 +0,0 @@
//
// ********************************************************************
// * 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. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 19770/06/NL/JD (Technology Research Programme). *
// * *
// * 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. *
// ********************************************************************
//
/// \file hadronic/Hadr02/src/G4DPMJET_modb_.cc
/// \brief Implementation of the G4DPMJET_modb_ class
//
// $Id: G4DPMJET_modb_.cc 77519 2013-11-25 10:54:57Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4DPMJET_modb_.cc
//
// Version: 0.B
// Date: 02/04/08
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 19770/06/NL/JD
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#ifdef G4_USE_DPMJET
#include "globals.hh"
#include "G4GlaubAADataSetHandler.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
extern "C" void g4dpmjet_modb_ (G4double &v, G4double &b)
{
G4GlaubAADataSetHandler *theGlauberDataSetHandler =
G4GlaubAADataSetHandler::getInstance();
G4ParamType1GlaubAADataSet *theCurrentGlauberDataSet =
(G4ParamType1GlaubAADataSet*)
theGlauberDataSetHandler->GetCurrentGlauberDataSet();
G4double i = theGlauberDataSetHandler->GetValueN(v);
b = i * theCurrentGlauberDataSet->bstep;
//
//
// The following lines if you require information about the
// impact parameter sampled by theGlauberDataSetHandler.
//
#ifdef G4DPMJET25GDSHDEBUG
if (theGlauberDataSetHandler->GetVerboseLevel()>=2) {
G4cout <<"****************************************"
<<"****************************************"
<<G4endl;
G4cout <<"IN G4DPMJET_modb_" <<G4endl;
G4cout <<"PROJECTILE A = " <<theCurrentGlauberDataSet->GetAP()
<<" & TARGET A = " <<theCurrentGlauberDataSet->GetAT() <<G4endl;
G4cout <<"RANDOM NUMBER = " <<v <<G4endl;
G4cout <<"IMPACT PARAMETER = " <<b <<G4endl;
G4cout <<"****************************************"
<<"****************************************"
<<G4endl;
}
#endif
}
#endif
@@ -1,304 +0,0 @@
//
// ********************************************************************
// * 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. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 19770/06/NL/JD (Technology Research Programme). *
// * *
// * 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. *
// ********************************************************************
//
/// \file hadronic/Hadr02/src/G4FullGlaubAADataSet.cc
/// \brief Implementation of the G4FullGlaubAADataSet class
//
// $Id: G4FullGlaubAADataSet.cc 77519 2013-11-25 10:54:57Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4FullGlaubAADataSet.cc
//
// Version: 0.B
// Date: 02/04/08
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 19770/06/NL/JD
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#ifdef G4_USE_DPMJET
#include "G4FullGlaubAADataSet.hh"
#include "G4DPMJET2_5Interface.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include <iomanip>
///////////////////////////////////////////////////////////////////////////////
//
// G4FullGlaubAADataSet
//
// Constructor simply resets all variables to zero.
//
G4FullGlaubAADataSet::G4FullGlaubAADataSet()
{
baseArrayPtrn = &bsiten[0][0];
baseArrayPtrm = &bsitem[0][0];
arrayPtrn = baseArrayPtrn;
arrayPtrm = baseArrayPtrm;
for (G4int i=0; i<maxig; i++) {
for (G4int j=0; j<maxArray; j++) {
bsiten[i][j] = 0.0;
bsitem[i][j] = 0.0;
}
}
wu10 = std::sqrt(10.0); // WU10=SQRT(10.)
glauberDataSetType = 0;
}
///////////////////////////////////////////////////////////////////////////////
//
// G4FullGlaubAADataSet
//
// Constructor resets all variables to zero and creates data.
//
G4FullGlaubAADataSet::G4FullGlaubAADataSet(const G4int AP1, const G4int AT1)
{
baseArrayPtrn = &bsiten[0][0];
baseArrayPtrm = &bsitem[0][0];
arrayPtrn = baseArrayPtrn;
arrayPtrm = baseArrayPtrm;
for (G4int i=0; i<maxig; i++) {
for (G4int j=0; j<maxArray; j++) {
bsiten[i][j] = 0.0;
bsitem[i][j] = 0.0;
}
}
wu10 = std::sqrt(10.0); // WU10=SQRT(10.)
glauberDataSetType = 0;
CreateGlauberData (AP1, AT1);
}
///////////////////////////////////////////////////////////////////////////////
//
// ~G4FullGlaubAADataSet
//
// If you thought the contructor was boring, the destructor is even worse!.
// It doesn't do anything.
//
G4FullGlaubAADataSet::~G4FullGlaubAADataSet()
{}
////////////////////////////////////////////////////////////////////////////////
//
G4bool
G4FullGlaubAADataSet::CreateGlauberData (const G4int AP1, const G4int AT1)
{
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
G4cout <<"AT G4FullGlaubAADataSet::CreateGlauberData: BEFORE SHMAKI CALL"
<<G4endl;
}
#endif
AP = AP1;
AT = AT1;
nucc_.ijproj = 1; // IJPROJ=1
collis_.ijprox = 1; // IJPROX=1
nuccc_.jjproj = 1; // JJPROJ=1
G4int jjprox = 1; // JJPROX=1
G4int ishc = 0; // ISHC=0
G4int ZP1 = stabZ[AP];
G4int ZT1 = stabZ[AT];
for (G4int ig = 0; ig < maxig; ig++)
{
G4double ppn = std::pow(wu10,ig+2); // PPN = WU10**(IG+1)
shmaki_ (&AP, &ZP1, &AT, &ZT1, &rptshm_.rproj, &rptshm_.rtarg, &ppn);
for (G4int i=0; i<maxArray; i++)
{
bsiten[ig][i] = dshm_.bsite[i][1];
}
ishc++; // ISHC = ISHC + 1
if (ishc == 1) { // IF(ISHC.EQ.1)THEN
rproj = rptshm_.rproj; // RPROJJ(MATNUM) = RPROJ
rtarg = rptshm_.rtarg; // RTARGG(MATNUM) = RTARG
bmax = dshm_.bmax; // BMAXX(MATNUM) = BMAX
bstep = dshm_.bstep; // BSTEPP(MATNUM) = BSTEP
}
}
nucc_.ijproj = 13; // IJPROJ=13
collis_.ijprox = 13; // IJPROX=13
nuccc_.jjproj = 13; // JJPROJ=13
jjprox = 13; // JJPROX=13
for (G4int ig = 0; ig < maxig; ig++)
{
G4double ppn = std::pow(wu10,ig+2); // PPN = WU10**(IG+1)
shmaki_ (&AP, &ZP1, &AT, &ZT1, &rptshm_.rproj, &rptshm_.rtarg, &ppn);
for (G4int i=0; i<maxArray; i++)
{
bsitem[ig][i] = dshm_.bsite[i][1];
}
}
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
G4cout <<"AT G4FullGlaubAADataSet::CreateGlauberData: AFTER SHMAKI CALL"
<<G4endl;
}
#endif
return true;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double *G4FullGlaubAADataSet::GetArrayPointerN (const G4double ppn)
{
if (ppn < 1.0E-10) {
return baseArrayPtrn;
}
else {
G4int ig = G4int(2.0*std::log10(ppn)) - 2;
if (ig < 0) ig = 0;
for (G4int j=0; j<maxArray; j++) {
dtumat_.bsiten[0][ig][j] = bsiten[ig][j];
}
dtumat_.ntaxx[0] = AT;
dtumat_.nztaxx[0] = ZT;
dtumat_.nprxx[0] = AP;
dtumat_.nzprxx[0] = ZP;
dtumat_.rprojj[0] = rproj;
dtumat_.rtagg[0] = rtarg;
dtumat_.bstepp[0] = bstep;
dtumat_.bmaxx[0] = bmax;
arrayPtrn = baseArrayPtrn + maxArray*ig; //NOTE IS THIS A VALID OPERATION??
}
return arrayPtrn;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double *G4FullGlaubAADataSet::GetArrayPointerM (const G4double ppn)
{
if (ppn < 1.0E-10) {
return baseArrayPtrm;
}
else {
G4int ig = G4int(2.0*std::log10(ppn)) - 2;
if (ig < 0) ig = 0;
for (G4int j=0; j<maxArray; j++) {
dtumat_.bsitem[0][ig][j] = bsitem[ig][j];
}
dtumat_.ntaxx[0] = AT;
dtumat_.nztaxx[0] = ZT;
dtumat_.nprxx[0] = AP;
dtumat_.nzprxx[0] = ZP;
dtumat_.rprojj[0] = rproj;
dtumat_.rtagg[0] = rtarg;
dtumat_.bstepp[0] = bstep;
dtumat_.bmaxx[0] = bmax;
arrayPtrm = baseArrayPtrm + maxArray*ig; //NOTE IS THIS A VALID OPERATION??
}
return arrayPtrm;
}
////////////////////////////////////////////////////////////////////////////////
//
// WriteDataToFile
//
// This appends the Glauber data from the arrays to the output file stream.
// The format is intended to match the standard GLAUBER data file format.
//
std::ofstream &
G4FullGlaubAADataSet::WriteDataToFile (std::ofstream &File) const
{
File.unsetf(std::ios::fixed);
File.setf(std::ios::scientific|std::ios::right|std::ios::adjustfield);
for (G4int i=0; i<maxig; i++) {
for (G4int j=0; j<maxArray; j+=5) {
for (G4int k=j; k<j+5; k++) {
File <<std::setw(16) <<bsiten[i][k];
}
File <<G4endl;
}
}
for (G4int i=0; i<maxig; i++) {
for (G4int j=0; j<maxArray; j+=5) {
for (G4int k=j; k<j+5; k++) {
File <<std::setw(16) <<bsitem[i][k];
}
File <<G4endl;
}
}
return File;
}
////////////////////////////////////////////////////////////////////////////////
//
// DumpData
//
// This reads the Glauber data into the arrays from the input file stream.
// The format is intended to match the standard GLAUBER data file format.
//
std::ifstream & G4FullGlaubAADataSet::ReadDataFromFile (std::ifstream &File)
{
for (G4int i=0; i<maxig; i++) {
for (G4int j=0; j<maxArray; j+=5) {
File >>bsiten[i][j]
>>bsiten[i][j+1]
>>bsiten[i][j+2]
>>bsiten[i][j+3]
>>bsiten[i][j+4];
}
}
for (G4int i=0; i<maxig; i++) {
for (G4int j=0; j<maxArray; j+=5) {
File >>bsitem[i][j]
>>bsitem[i][j+1]
>>bsitem[i][j+2]
>>bsitem[i][j+3]
>>bsitem[i][j+4];
}
}
return File;
}
////////////////////////////////////////////////////////////////////////////////
//
#endif
@@ -1,314 +0,0 @@
//
// ********************************************************************
// * 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. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 19770/06/NL/JD (Technology Research Programme). *
// * *
// * 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. *
// ********************************************************************
//
/// \file hadronic/Hadr02/src/G4GlaubAADataSet.cc
/// \brief Implementation of the G4GlaubAADataSet class
//
// $Id: G4GlaubAADataSet.cc 77519 2013-11-25 10:54:57Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4GlaubAADataSet.cc
//
// Version: 0.B
// Date: 02/04/08
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 19770/06/NL/JD
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#ifdef G4_USE_DPMJET
#include "G4GlaubAADataSet.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4DPMJET2_5Interface.hh"
#include <iomanip>
#include <iostream>
///////////////////////////////////////////////////////////////////////////////
//
// G4GlaubAADataSet
//
// Constructor simply resets all variables to zero.
//
G4GlaubAADataSet::G4GlaubAADataSet() : G4VGlauberDataSet()
{
ZP = -1;
ZT = -1;
DefineAZStabilityLine();
}
///////////////////////////////////////////////////////////////////////////////
//
// ~G4GlaubAADataSet
//
// If you thought the contructor was boring, the destructor is even worse!.
// It doesn't do anything.
//
G4GlaubAADataSet::~G4GlaubAADataSet()
{}
////////////////////////////////////////////////////////////////////////////////
//
G4bool G4GlaubAADataSet::CreateGlauberData (const G4int , const G4int )
{
//
//
// Dummy member function.
//
return false;
}
void G4GlaubAADataSet::DefineAZStabilityLine ()
{
stabZ[0] = 0;
stabZ[1] = 1;
stabZ[2] = 1;
stabZ[3] = 2;
stabZ[4] = 2;
stabZ[5] = 3;
stabZ[6] = 3;
stabZ[7] = 3;
stabZ[8] = 3;
stabZ[9] = 4;
stabZ[10] = 5;
stabZ[11] = 5;
stabZ[12] = 6;
stabZ[13] = 6;
stabZ[14] = 7;
stabZ[15] = 7;
stabZ[16] = 8;
stabZ[17] = 8;
stabZ[18] = 8;
stabZ[19] = 9;
stabZ[20] = 10;
stabZ[21] = 10;
stabZ[22] = 10;
stabZ[23] = 11;
stabZ[24] = 12;
stabZ[25] = 12;
stabZ[26] = 12;
stabZ[27] = 13;
stabZ[28] = 13;
stabZ[29] = 14;
stabZ[30] = 14;
stabZ[31] = 15;
stabZ[32] = 16;
stabZ[33] = 16;
stabZ[34] = 16;
stabZ[35] = 17;
stabZ[36] = 17;
stabZ[37] = 17;
stabZ[38] = 18;
stabZ[39] = 19;
stabZ[40] = 19;
stabZ[41] = 19;
stabZ[42] = 20;
stabZ[43] = 20;
stabZ[44] = 20;
stabZ[45] = 21;
stabZ[46] = 21;
stabZ[47] = 22;
stabZ[48] = 21;
stabZ[49] = 22;
stabZ[50] = 23;
stabZ[51] = 23;
stabZ[52] = 24;
stabZ[53] = 24;
stabZ[54] = 25;
stabZ[55] = 25;
stabZ[56] = 26;
stabZ[57] = 26;
stabZ[58] = 27;
stabZ[59] = 27;
stabZ[60] = 28;
stabZ[61] = 28;
stabZ[62] = 28;
stabZ[63] = 29;
stabZ[64] = 29;
stabZ[65] = 29;
stabZ[66] = 30;
stabZ[67] = 30;
stabZ[68] = 30;
stabZ[69] = 31;
stabZ[70] = 31;
stabZ[71] = 31;
stabZ[72] = 32;
stabZ[73] = 32;
stabZ[74] = 32;
stabZ[75] = 33;
stabZ[76] = 33;
stabZ[77] = 34;
stabZ[78] = 35;
stabZ[79] = 35;
stabZ[80] = 35;
stabZ[81] = 35;
stabZ[82] = 35;
stabZ[83] = 36;
stabZ[84] = 37;
stabZ[85] = 37;
stabZ[86] = 37;
stabZ[87] = 37;
stabZ[88] = 38;
stabZ[89] = 39;
stabZ[90] = 40;
stabZ[91] = 40;
stabZ[92] = 41;
stabZ[93] = 41;
stabZ[94] = 41;
stabZ[95] = 42;
stabZ[96] = 42;
stabZ[97] = 42;
stabZ[98] = 43;
stabZ[99] = 44;
stabZ[100]= 43;
stabZ[101]= 44;
stabZ[102]= 45;
stabZ[103]= 45;
stabZ[104]= 45;
stabZ[105]= 46;
stabZ[106]= 47;
stabZ[107]= 47;
stabZ[108]= 47;
stabZ[109]= 47;
stabZ[110]= 47;
stabZ[111]= 48;
stabZ[112]= 49;
stabZ[113]= 49;
stabZ[114]= 49;
stabZ[115]= 49;
stabZ[116]= 49;
stabZ[117]= 50;
stabZ[118]= 50;
stabZ[119]= 50;
stabZ[120]= 51;
stabZ[121]= 51;
stabZ[122]= 51;
stabZ[123]= 51;
stabZ[124]= 52;
stabZ[125]= 52;
stabZ[126]= 53;
stabZ[127]= 53;
stabZ[128]= 53;
stabZ[129]= 54;
stabZ[130]= 54;
stabZ[131]= 54;
stabZ[132]= 55;
stabZ[133]= 55;
stabZ[134]= 55;
stabZ[135]= 56;
stabZ[136]= 55;
stabZ[137]= 56;
stabZ[138]= 57;
stabZ[139]= 57;
stabZ[140]= 58;
stabZ[141]= 59;
stabZ[142]= 59;
stabZ[143]= 60;
stabZ[144]= 61;
stabZ[145]= 60;
stabZ[146]= 60;
stabZ[147]= 62;
stabZ[148]= 61;
stabZ[149]= 62;
stabZ[150]= 61;
stabZ[151]= 63;
stabZ[152]= 63;
stabZ[153]= 63;
stabZ[154]= 63;
stabZ[155]= 64;
stabZ[156]= 64;
stabZ[157]= 64;
stabZ[158]= 65;
stabZ[159]= 65;
stabZ[160]= 65;
stabZ[161]= 66;
stabZ[162]= 67;
stabZ[163]= 66;
stabZ[164]= 67;
stabZ[165]= 67;
stabZ[166]= 68;
stabZ[167]= 68;
stabZ[168]= 69;
stabZ[169]= 69;
stabZ[170]= 69;
stabZ[171]= 70;
stabZ[172]= 70;
stabZ[173]= 70;
stabZ[174]= 70;
stabZ[175]= 71;
stabZ[176]= 71;
stabZ[177]= 72;
stabZ[178]= 72;
stabZ[179]= 72;
stabZ[180]= 73;
stabZ[181]= 73;
stabZ[182]= 74;
stabZ[183]= 74;
stabZ[184]= 75;
stabZ[185]= 75;
stabZ[186]= 75;
stabZ[187]= 76;
stabZ[188]= 76;
stabZ[189]= 76;
stabZ[190]= 77;
stabZ[191]= 77;
stabZ[192]= 77;
stabZ[193]= 77;
stabZ[194]= 78;
stabZ[195]= 78;
stabZ[196]= 79;
stabZ[197]= 79;
stabZ[198]= 79;
stabZ[199]= 80;
stabZ[200]= 80;
stabZ[201]= 80;
stabZ[202]= 80;
stabZ[203]= 81;
stabZ[204]= 81;
stabZ[205]= 81;
stabZ[206]= 82;
stabZ[207]= 82;
stabZ[208]= 82;
stabZ[209]= 83;
stabZ[210]= 83;
}
#endif
@@ -1,476 +0,0 @@
//
// ********************************************************************
// * 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. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 19770/06/NL/JD (Technology Research Programme). *
// * *
// * 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. *
// ********************************************************************
//
/// \file hadronic/Hadr02/src/G4GlaubAADataSetHandler.cc
/// \brief Implementation of the G4GlaubAADataSetHandler class
//
// $Id: G4GlaubAADataSetHandler.cc 77519 2013-11-25 10:54:57Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4GlaubAADataSetHandler.cc
//
// Version: 0.A
// Date: 02/04/08
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 19770/06/NL/JD
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#ifdef G4_USE_DPMJET
#include "G4GlaubAADataSetHandler.hh"
#include "G4FullGlaubAADataSet.hh"
#include "G4ParamType1GlaubAADataSet.hh"
#include "G4Isotope.hh"
#include "G4Element.hh"
#include "G4StableIsotopes.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4HadronicException.hh"
#include "G4DPMJET2_5Interface.hh"
#include <fstream>
#include <sstream>
#include <iomanip>
#include <iostream>
G4GlaubAADataSetHandler* G4GlaubAADataSetHandler::instance = 0;
////////////////////////////////////////////////////////////////////////////////
//
G4GlaubAADataSetHandler::G4GlaubAADataSetHandler ()
{
//
//
// theIndex is a std::map of the Glauber data loaded. It uses a unique
// identifier based on the projectile and target A & Z to point to each Glauber
// data set object.
//
theIndex.clear();
//
//
// By default, there is no limit on the number of datasets to load.
//
maxGlauberDataSets =-1;
cntGlauberDataSets = 0;
//
//
// The glauber data sets are assumed to be in Geant4 data directory for
// DPMJET II.5, defined by an environment variable.
//
if ( !getenv("G4DPMJET2_5DATA") )
{
G4cout <<"ENVIRONMENT VARIABLE G4DPMJET2_5DATA NOT SET " <<G4endl;
throw G4HadronicException(__FILE__, __LINE__,
"Please setenv G4DPMJET2_5DATA to point to the dpmjet2.5 data files.");
}
glauberDataSetDir = getenv("G4DPMJET2_5DATA");
//
//
// Initialise the local copy of the Glauber data.
//
theCurrentGlauberDataSet = 0;
ppnCurrent = 0.0;
usingLocalGlauberDataSet = false;
maxArray = 200;
//
//
// No verbose output by default.
//
SetVerboseLevel(0);
}
////////////////////////////////////////////////////////////////////////////////
//
G4GlaubAADataSetHandler::~G4GlaubAADataSetHandler ()
{
UnloadAllGlauberData ();
}
////////////////////////////////////////////////////////////////////////////////
//
G4GlaubAADataSetHandler* G4GlaubAADataSetHandler::getInstance ()
{
//
//
// THERE CAN BE ONLY ONE!! .... I mean, one G4GlaubAADataSetHandler.
//
if (instance == 0) instance = new G4GlaubAADataSetHandler();
return instance;
}
////////////////////////////////////////////////////////////////////////////////
//
G4int
G4GlaubAADataSetHandler::GetIndexID (const G4int AP, const G4int AT) const
{
return AP*1000 + AT;
}
////////////////////////////////////////////////////////////////////////////////
//
G4String
G4GlaubAADataSetHandler::GetProjectileStringID (const G4int AP) const
{
std::ostringstream os;
os <<"ap" <<AP;
return os.str();
}
////////////////////////////////////////////////////////////////////////////////
//
G4String G4GlaubAADataSetHandler::GetTargetStringID (const G4int AT) const
{
std::ostringstream os;
os <<"at" <<AT;
return os.str();
}
////////////////////////////////////////////////////////////////////////////////
//
G4String G4GlaubAADataSetHandler::GetStringID (const G4int AP, const G4int AT)
const
{
G4String ID = GetProjectileStringID(AP) + "_" + GetTargetStringID(AT);
return ID;
}
////////////////////////////////////////////////////////////////////////////////
//
// LoadGlauberDataRtnPtr
//
// Function LoadGlauberData to load data for a specific projectile AP and target
// AT. Note that, unlike in the previous implementation, there is no overwrite
// option since there is only one source of glaubAA data.
//
// Returns a pointer the the glauber data set object, if exists otherwise
// returns NULL.
//
G4VGlauberDataSet *G4GlaubAADataSetHandler::LoadGlauberDataReturnPtr
(const G4int AP, const G4int AT)
{
G4ParamType1GlaubAADataSet *glauberData = 0;
//
//
// Check whether an file with an appropriate name exists in the directory,
// which will probably contain the Glauber data.
//
G4String glauberID = GetStringID(AP,AT);
G4String filename = glauberDataSetDir + "/" + glauberID + ".glaubaadat";
std::ifstream glauberFile(filename);
if (glauberFile) {
//
//
// File exists, so read data into an appropriate object type. Do a double-
// check and make sure we want to retain Glauber data relating to this target.
// Note that this GDS handler only deals with parameterised sets (type 1). Also
// note that peek returns an ASCII charater code, and therefore since values of
// '0' to '9' and 'A' to 'Z' are acceptable, these must be decoded.
//
G4int i = -1;
G4int asci = glauberFile.peek();
if (asci >= 48 && asci <= 57) i = asci - 48;
else if (asci >= 65 && asci <= 90) i = asci - 55;
if (i!=1) {
G4cerr <<"ERROR IN G4GlaubAADataSetHandler::LoadGlauberDataReturnPtr"
<<G4endl;
G4cerr <<"GLAUBER FILE " <<filename <<G4endl;
G4cerr <<"IDENTIFIED AS GLAUBER FILE TYPE " <<i <<G4endl;
G4cerr <<"THIS IS NOT SUPPORTED" <<G4endl;
G4cerr <<G4endl;
}
else {
glauberData = new G4ParamType1GlaubAADataSet();
glauberFile >>(*glauberData);
//
//
// Here we check the A of the projectile and target...
//
G4int AP1 = glauberData->GetAP();
G4int AT1 = glauberData->GetAT();
G4bool found = AP1==AP && AT1==AT;
if (found) {
//
//
// Keep the object and record in the index, or if there is insufficient
// space, record it only locally and set the usingLocalGlauberDataSet
// flag. In the latter case, the object is deleted after the call to
// G4DPMJET2_5Model.
//
theCurrentGlauberDataSet = glauberData;
if (CheckIfSpace()) {
G4int n = GetIndexID(AP,AT);
theIndex.insert (G4GlaubAADataSetIndex::value_type(n,glauberData));
cntGlauberDataSets++;
usingLocalGlauberDataSet = false;
if (verboseLevel >=2) {
G4cout <<"****************************************"
<<"****************************************"
<<G4endl;
G4cout <<"In G4GlaubAADataSetHandler::LoadGlauberDataReturnPtr"
<<G4endl;
G4cout <<"LOADED GLAUBER DATA SET FOR PROJECTILE A = " <<AP
<<" & TARGET A = " <<AT <<G4endl;
G4cout <<"AS RECORD NUMBER = " <<theIndex.size() <<G4endl;
G4cout <<"****************************************"
<<"****************************************"
<<G4endl;
}
}
else {
usingLocalGlauberDataSet = true;
if (verboseLevel >=2) {
G4cout <<"****************************************"
<<"****************************************"
<<G4endl;
G4cout <<"In G4GlaubAADataSetHandler::LoadGlauberDataReturnPtr"
<<G4endl;
G4cout <<"LOADED GLAUBER DATA SET FOR PROJECTILE A = " <<AP
<<" & TARGET A = " <<AT <<" TEMPORARILY" <<G4endl;
G4cout <<"****************************************"
<<"****************************************"
<<G4endl;
}
}
}
else {
G4cerr <<"WARNING IN G4GlaubAADataSetHandler::LoadGlauberData"
<<G4endl;
G4cerr <<"GLAUBER FILE " <<filename <<" LOOKED LIKE IT SHOULD CONTAIN"
<<G4endl;
G4cerr <<"DATA FOR AP = " <<AP <<" AND AT = " <<AT <<G4endl;
G4cerr <<"BUT CONTAINED AP = " <<AP1 <<" AND AT = " <<AT1 <<G4endl;
G4cerr <<G4endl;
delete glauberData;
glauberData = 0;
}
}
glauberFile.close();
}
return glauberData;
}
////////////////////////////////////////////////////////////////////////////////
//
// UnloadAllGlauberData
//
// Member function to delete all objects containg Glauber data. This is very
// easy since all of the objects are pointed to in the map "theIndex".
//
// The value returned is the number of data sets removed.
//
G4int G4GlaubAADataSetHandler::UnloadAllGlauberData ()
{
G4int n = 0;
for (G4GlaubAADataSetIndex::iterator it=theIndex.begin(); it!=theIndex.end();
it++)
{
G4ParamType1GlaubAADataSet *glauberData = it->second;
cntGlauberDataSets--;
delete glauberData;
n++;
}
theIndex.clear();
return n;
}
////////////////////////////////////////////////////////////////////////////////
//
G4bool G4GlaubAADataSetHandler::IsGlauberDataSetAvailable (const G4int AP,
const G4int AT) const
{
G4int glauberID = GetIndexID (AP,AT);
G4GlaubAADataSetIndex::const_iterator it = theIndex.find(glauberID);
if (it == theIndex.end()) {
G4String glauberStrID = GetStringID(AP,AT);
G4String filename = glauberDataSetDir + "/" + glauberStrID +
".glaubaadat";
std::ifstream glauberFile;
glauberFile.open(filename);
if (glauberFile) {
glauberFile.close();
return true;
}
else {
return false;
}
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
//
// CheckIfSpace
//
// This member function reads the contents of the file GluaberIndex.dat,
// and then proceeds to read all Glauber functions. This can deal with both
// full Glauber data sets and parameterised data sets.
//
G4bool G4GlaubAADataSetHandler::CheckIfSpace () const
{
if ( maxGlauberDataSets >= 0 &&
( (G4int) theIndex.size() ) >= maxGlauberDataSets) {
G4cout <<"WARNING: G4GlaubAADataSetHandler::CheckIfSpace:"
<<G4endl;
G4cout <<"MAXIMUM NUMBER OF GLAUBER DATASETS REACHED : "
<<maxGlauberDataSets <<G4endl;;
return false;
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
//
// SetMaxGlauberDataSets
//
// This member function controls how many data sets are loaded, in order to
// avoid overloading the memory with data.
//
void G4GlaubAADataSetHandler::SetMaxGlauberDataSets (const G4int n)
{
if (n > -1 && cntGlauberDataSets > n) {
G4cerr <<"ERROR IN G4GlaubAADataSetHandler::SetMaxGlauberDataSets"
<<G4endl;
G4cerr <<"MAXIMUM NUMBER OF GLAUBER DATA SETS WOULD BE EXCEEDED IF YOU"
<<G4endl;
G4cerr <<"SET THIS VALUE. ATTEMPTED TO SET TO " <<n
<<"WHEN VALUE ALREADY" <<cntGlauberDataSets
<<G4endl;
G4cerr <<G4endl;
}
else {
maxGlauberDataSets = n;
}
}
////////////////////////////////////////////////////////////////////////////////
//
// SetCurrentGlauberDataSet
//
// Called from G4DPMJET2_5Model to identifies a pointer to the appropriate
// Glauber data set, based in the AP and AT provided. If the apprproate dataset
// is not already loaded, an attempt will be made to find it and load if there
// is space.
//
// true is returned if a data set has been found and loaded;
// false if returned otherwise.
//
G4bool G4GlaubAADataSetHandler::SetCurrentGlauberDataSet (const G4int AP,
const G4int AT, const G4double ppn)
{
G4int glauberID = GetIndexID (AP,AT);
G4GlaubAADataSetIndex::iterator it = theIndex.find(glauberID);
if (it == theIndex.end()) {
//
//
// Have we exceeded any limits for the maximum number of data sets loaded?
// If not, try to locate the data and load it.
//
theCurrentGlauberDataSet =
(G4ParamType1GlaubAADataSet*) LoadGlauberDataReturnPtr(AP,AT);
if (theCurrentGlauberDataSet != 0) {
ppnCurrent = ppn;
dtumat_.rprojj[0] = theCurrentGlauberDataSet->rproj;
dtumat_.rtagg[0] = theCurrentGlauberDataSet->rtarg;
dtumat_.bstepp[0] = theCurrentGlauberDataSet->bstep;
dtumat_.bmaxx[0] = theCurrentGlauberDataSet->bmax;
return true;
}
else {
return false;
}
}
else {
//
//
// The data are already loaded, so point to this.
//
theCurrentGlauberDataSet = it->second;
ppnCurrent = ppn;
dtumat_.rprojj[0] = theCurrentGlauberDataSet->rproj;
dtumat_.rtagg[0] = theCurrentGlauberDataSet->rtarg;
dtumat_.bstepp[0] = theCurrentGlauberDataSet->bstep;
dtumat_.bmaxx[0] = theCurrentGlauberDataSet->bmax;
return true;
}
}
////////////////////////////////////////////////////////////////////////////////
//
G4GlaubAADataSet *G4GlaubAADataSetHandler::GetCurrentGlauberDataSet () const
{
return theCurrentGlauberDataSet;
}
////////////////////////////////////////////////////////////////////////////////
//
void G4GlaubAADataSetHandler::ResetCurrentGlauberDataSet ()
{
if (usingLocalGlauberDataSet) delete theCurrentGlauberDataSet;
theCurrentGlauberDataSet = 0;
ppnCurrent = 0.0;
usingLocalGlauberDataSet = false;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4GlaubAADataSetHandler::GetValueN (const G4double v,
const G4double ppn1)
{
G4double ppn = 0.0;
if (ppn1*GeV > 1.0*eV) ppn = ppn1;
else if (ppnCurrent*GeV > 1.0*eV) ppn = ppnCurrent;
else return 0.0;
return
((G4ParamType1GlaubAADataSet*) theCurrentGlauberDataSet)->GetValueN(v,ppn);
}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4GlaubAADataSetHandler::GetValueM (const G4double v,
const G4double ppn1)
{
G4double ppn = 0.0;
if (ppn1*GeV > 1.0*eV) ppn = ppn1;
else if (ppnCurrent*GeV > 1.0*eV) ppn = ppnCurrent;
else return 0.0;
return
((G4ParamType1GlaubAADataSet*) theCurrentGlauberDataSet)->GetValueM(v,ppn);
}
////////////////////////////////////////////////////////////////////////////////
//
#endif
@@ -1,348 +0,0 @@
//
// ********************************************************************
// * 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. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 19770/06/NL/JD (Technology Research Programme). *
// * *
// * 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. *
// ********************************************************************
//
/// \file hadronic/Hadr02/src/G4ParamType1GlaubAADataSet.cc
/// \brief Implementation of the G4ParamType1GlaubAADataSet class
//
// $Id: G4ParamType1GlaubAADataSet.cc 77519 2013-11-25 10:54:57Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4ParamType1GlaubAADataSet.cc
//
// Version: 0.B
// Date: 02/04/08
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 19770/06/NL/JD
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#ifdef G4_USE_DPMJET
#include "G4ParamType1GlaubAADataSet.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
using namespace std;
#include "G4DPMJET2_5Interface.hh"
#include <iomanip>
///////////////////////////////////////////////////////////////////////////////
//
// G4ParamType1GlaubAADataSet
//
// Constructor simply resets all variables to zero.
//
G4ParamType1GlaubAADataSet::G4ParamType1GlaubAADataSet()
{
glauberDataSetType = 1;
}
///////////////////////////////////////////////////////////////////////////////
//
// G4ParamType1GlaubAADataSet
//
// Constructor instructing to generate Glauber data based on AP1 and AT1.
//
G4ParamType1GlaubAADataSet::G4ParamType1GlaubAADataSet(const G4int AP1,
const G4int AT1)
{
glauberDataSetType = 1;
CreateGlauberData (AP1,AT1);
}
///////////////////////////////////////////////////////////////////////////////
//
// G4ParamType1GlaubAADataSet
//
// Constructor instructing to generate Glauber data based full glauber set.
//
G4ParamType1GlaubAADataSet::G4ParamType1GlaubAADataSet
(G4FullGlaubAADataSet *fullGlauberDataSet)
{
glauberDataSetType = 1;
CreateGlauberData (fullGlauberDataSet);
AP = fullGlauberDataSet->AP;
AT = fullGlauberDataSet->AT;
rproj = fullGlauberDataSet->rproj;
rtarg = fullGlauberDataSet->rtarg;
bstep = fullGlauberDataSet->bstep;
bmax = fullGlauberDataSet->bmax;
}
///////////////////////////////////////////////////////////////////////////////
//
// ~G4ParamType1GlaubAADataSet
//
// If you thought the contructor was boring, the destructor is even worse!.
// It doesn't do anything.
//
G4ParamType1GlaubAADataSet::~G4ParamType1GlaubAADataSet()
{}
////////////////////////////////////////////////////////////////////////////////
//
G4bool G4ParamType1GlaubAADataSet::CreateGlauberData
(const G4int AP1, const G4int AT1)
{
//
//
// Create an full Glauber data set.
//
G4FullGlaubAADataSet *fullGlauberDataSet = new G4FullGlaubAADataSet();
if (fullGlauberDataSet->CreateGlauberData(AP1,AT1)) {
CreateGlauberData(fullGlauberDataSet);
AP = AP1;
AT = AT1;
rproj = fullGlauberDataSet->rproj;
rtarg = fullGlauberDataSet->rtarg;
bstep = fullGlauberDataSet->bstep;
bmax = fullGlauberDataSet->bmax;
return true;
}
else {
return false;
}
delete fullGlauberDataSet;
}
////////////////////////////////////////////////////////////////////////////////
//
G4bool G4ParamType1GlaubAADataSet::CreateGlauberData
(G4FullGlaubAADataSet *fullGlauberDataSet)
{
G4double *ptrArrayN = fullGlauberDataSet->GetArrayPointerN ();
G4double *ptrArrayM = fullGlauberDataSet->GetArrayPointerM ();
//
//
// Loop over the momenta. Create hit parameters using GetFitParameters member
// function, send a pointer to the relevant part of bsiten and bsitem array in
// fullGlauberData object. The parameters are automatically inserted into the
// calling parameters array by the calling routine.
//
for (G4int i=0; i<maxig; i++) {
GetFitParameters (ptrArrayN, &paramn[i][0]);
ptrArrayN += maxArray;
mun1[i] = paramn[i][5] / paramn[i][1];
mun2[i] = paramn[i][5] / paramn[i][3] - mun1[i];
G4double c1 = std::log(paramn[i][0]);
G4double c2 = std::log(paramn[i][2]);
cn[i] = std::exp((c2*paramn[i][1] - c1*paramn[i][3]) /
(paramn[i][3]-paramn[i][1]));
GetFitParameters (ptrArrayM, &paramm[i][0]);
ptrArrayM += maxArray;
mum1[i] = paramm[i][5] / paramm[i][1];
mum2[i] = paramm[i][5] / paramm[i][3] - mun1[i];
c1 = std::log(paramm[i][0]);
c2 = std::log(paramm[i][2]);
cm[i] = std::exp((c2*paramm[i][1] - c1*paramm[i][3]) /
(paramm[i][3]-paramm[i][1]));
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
//
/*G4double *G4ParamType1GlaubAADataSet::GetArrayPointerN (const G4double ppn)
{
G4int ig = 0;
if (ppn < 1.0E-10) {
return 0;
}
else {
ig = G4int(2.0*std::log10(ppn)) - 2;
}
if (ig > 23) ig = 23;
for (G4int j=0; j<maxArray; j++) {
bsiten[j] = GetInverseValueN(j,ig);
dtumat_.bsiten[0][ig][j] = bsiten[j];
}
dtumat_.ntaxx[0] = AT;
dtumat_.nztaxx[0] = ZT;
dtumat_.nprxx[0] = AP;
dtumat_.nzprxx[0] = ZP;
dtumat_.rprojj[0] = rproj;
dtumat_.rtagg[0] = rtarg;
dtumat_.bstepp[0] = bstep;
dtumat_.bmaxx[0] = bmax;
arrayPtrn = baseArrayPtrn;
return arrayPtrn;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double *G4ParamType1GlaubAADataSet::GetArrayPointerM (const G4double ppn)
{
G4int ig = 0;
if (ppn < 1.0E-10) {
return 0;
}
else {
ig = G4int(2.0*std::log10(ppn)) - 2;
}
if (ig > 23) ig = 23;
for (G4int j=0; j<maxArray; j++) {
bsitem[j] = GetInverseValueM(j,ig);
dtumat_.bsitem[0][ig][j] = bsitem[j];
}
dtumat_.ntaxx[0] = AT;
dtumat_.nztaxx[0] = ZT;
dtumat_.nprxx[0] = AP;
dtumat_.nzprxx[0] = ZP;
dtumat_.rprojj[0] = rproj;
dtumat_.rtagg[0] = rtarg;
dtumat_.bstepp[0] = bstep;
dtumat_.bmaxx[0] = bmax;
arrayPtrm = baseArrayPtrm;
return arrayPtrm;
}*/
////////////////////////////////////////////////////////////////////////////////
//
// WriteDataToFile
//
// This appends the Glauber data from the arrays to the output file stream.
// The format is intended to match the standard GLAUBER data file format.
//
std::ofstream &
G4ParamType1GlaubAADataSet::WriteDataToFile (std::ofstream &File) const
{
File.unsetf(std::ios::fixed);
File.setf(std::ios::scientific|std::ios::right|std::ios::adjustfield);
File <<" c1"
<<" m1"
<<" c2"
<<" m2"
<<" Itrans"
<<" gamma"
<<" d0"
<<" d1"
<<" d2"
<<" d3"
<<G4endl;
for (G4int i=0; i<maxig; i++) {
File <<std::setw(16) <<paramn[i][0]
<<std::setw(16) <<paramn[i][1]
<<std::setw(16) <<paramn[i][2]
<<std::setw(16) <<paramn[i][3]
<<std::setw(16) <<paramn[i][4]
<<std::setw(16) <<paramn[i][5]
<<std::setw(16) <<paramn[i][6]
<<std::setw(16) <<paramn[i][7]
<<std::setw(16) <<paramn[i][8]
<<std::setw(16) <<paramn[i][9]
<<G4endl;
}
for (G4int i=0; i<maxig; i++) {
File <<std::setw(16) <<paramm[i][0]
<<std::setw(16) <<paramm[i][1]
<<std::setw(16) <<paramm[i][2]
<<std::setw(16) <<paramm[i][3]
<<std::setw(16) <<paramm[i][4]
<<std::setw(16) <<paramm[i][5]
<<std::setw(16) <<paramm[i][6]
<<std::setw(16) <<paramm[i][7]
<<std::setw(16) <<paramm[i][8]
<<std::setw(16) <<paramm[i][9]
<<G4endl;
}
return File;
}
////////////////////////////////////////////////////////////////////////////////
//
// DumpData
//
// This reads the Glauber data into the arrays from the input file stream.
// The format is intended to match the standard GLAUBER data file format.
//
std::ifstream &
G4ParamType1GlaubAADataSet::ReadDataFromFile (std::ifstream &File)
{
G4String dummy[10];
File >>dummy[0]
>>dummy[1]
>>dummy[2]
>>dummy[3]
>>dummy[4]
>>dummy[5]
>>dummy[6]
>>dummy[7]
>>dummy[8]
>>dummy[9];
for (G4int i=0; i<maxig; i++) {
File >>paramn[i][0]
>>paramn[i][1]
>>paramn[i][2]
>>paramn[i][3]
>>paramn[i][4]
>>paramn[i][5]
>>paramn[i][6]
>>paramn[i][7]
>>paramn[i][8]
>>paramn[i][9];
}
for (G4int i=0; i<maxig; i++) {
File >>paramm[i][0]
>>paramm[i][1]
>>paramm[i][2]
>>paramm[i][3]
>>paramm[i][4]
>>paramm[i][5]
>>paramm[i][6]
>>paramm[i][7]
>>paramm[i][8]
>>paramm[i][9];
}
return File;
}
////////////////////////////////////////////////////////////////////////////////
//
#endif
@@ -1,370 +0,0 @@
//
// ********************************************************************
// * 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. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 19770/06/NL/JD (Technology Research Programme). *
// * *
// * 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. *
// ********************************************************************
//
/// \file hadronic/Hadr02/src/G4Type1GlauberParameterisation.cc
/// \brief Implementation of the G4Type1GlauberParameterisation class
//
// $Id: G4Type1GlauberParameterisation.cc 81932 2014-06-06 15:39:45Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4Type1GlauberParameterisation.cc
//
// Version: 0.B
// Date: 02/04/08
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 19770/06/NL/JD
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#ifdef G4_USE_DPMJET
#include "G4Type1GlauberParameterisation.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
using namespace std;
//
//
// The following function performs a polynomial least squares fit to double
// precision data. It forms part of the CERN mathlib. This is a really
// beyond standard policy and will eventually be changed to a C++ function.
//
extern "C" {void dlsqpm_ (int*,double*,double*,int*,double*,double*,int*);}
////////////////////////////////////////////////////////////////////////////////
//
G4Type1GlauberParameterisation::G4Type1GlauberParameterisation ()
{
limit1 = 0.1;
limit2 = 0.60;
limit3 = 0.95;
limit4 = 0.9999;
maxArrayp = 200;
maxigp = 24;
for (G4int ig=0; ig<maxigp; ig++) {
for (G4int j=0; j<10; j++) {
paramn[ig][j] = 0.0;
paramn[ig][j] = 0.0;
}
mun1[ig] = 0.0;
mun2[ig] = 0.0;
cn[ig] = 0.0;
mum1[ig] = 0.0;
mum2[ig] = 0.0;
cm[ig] = 0.0;
}
}
////////////////////////////////////////////////////////////////////////////////
//
G4Type1GlauberParameterisation::~G4Type1GlauberParameterisation ()
{;}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4Type1GlauberParameterisation::GetFitParameters
(const G4double *bsite, G4double *p) const
{
//
//
// Initialise parameters.
//
G4int pt1 = -1;
G4int pt2 = -1;
G4int pt3 = -1;
G4int pt4 = -1;
//
//
// Locate transitions between different parts of the curve where different
// fits are used.
//
G4double ib[200];
G4double lnib[200];
G4double lnbsite[200];
for (G4int i=0; i<maxArrayp; i++) {
ib[i] = (G4double) i;
lnib[i] = std::log(ib[i]);
if (bsite[i] < 1.0E-10) lnbsite[i] = -23.02585093;
else lnbsite[i] = std::log(bsite[i]);
if (pt1 == -1) {
if (bsite[i] >= limit1) pt1 = i;
}
else if (pt2 == -1) {
if (bsite[i] >= limit2) pt2 = i;
}
else if (pt3 == -1) {
if (bsite[i] >= limit3) pt3 = i;
}
else if (pt4 == -1) {
if (bsite[i] >= limit4) pt4 = i;
}
}
//
//
// First section determines the power-law fits for the low and intermediate b
// values;
//
G4int deltan = pt2 - pt1;
G4int M = 1;
G4double a1[2];
G4double sd;
G4int ifail;
dlsqpm_ (&deltan,&lnbsite[pt1],&lnib[pt1],&M,&a1[0],&sd,&ifail);
G4double c1 = a1[0];
G4double M1 = a1[1];
// G4double M2 = (lnib[3] - lnib[2]) / (lnbsite[3] - lnbsite[2]);
// G4double c2 = lnib[2] - M2*lnbsite[2];
deltan = 3;
dlsqpm_ (&deltan,&lnbsite[1],&lnib[1],&M,&a1[0],&sd,&ifail);
G4double c2 = a1[0];
G4double M2 = a1[1];
p[0] = std::exp(c2);
p[1] = M2;
p[2] = std::exp(c1);
p[3] = M1;
if (std::abs(M2-M1) > 1.0E-10) {
p[4] = exp(-(c2-c1)/(M2-M1));
}
else {
p[4] = limit2 / 2.0;
}
//
//
// This next bit solves for gamma to determine the inflection at high-b values.
// The algorthM used is EXTREEEEEMELY crude .... but practical and robust.
// It's a linear search.
//
G4double delta = 1.0E+99;
G4double gam = 0.0;
for (G4int ig = 120; ig < 1000; ig++) {
G4double DELTA = 0.0;
G4double GAMMA = (G4double) ig / 100.0;
G4double EXPON = p[3] / GAMMA;
for (G4int i = pt2; i<pt3; i++) {
G4double f = bsite[i];
G4double B = p[2] * std::pow(f,p[3]) /
std::pow((1.0-std::pow(f,GAMMA)),EXPON);
G4double epsilon = std::abs((ib[i]-B)/ib[i]);
if (epsilon > DELTA) DELTA = epsilon;
}
if (DELTA < delta) {
gam = GAMMA;
delta = DELTA;
}
}
p[5] = gam;
//
//
// For the final part of the curve, we use a cubic polynomial
// fit to -ln(1-bsite)
// versus ib. This does seem to work quite well.
//
G4double phi[200];
for (G4int i = pt3; i<pt4; i++) {
phi[i] = -std::log(1.0 - bsite[i]);
}
deltan = pt4-pt3;
M = 3;
G4double a2[4];
dlsqpm_ (&deltan,&phi[pt3],&ib[pt3],&M,&a2[0],&sd,&ifail);
p[6] = a2[0];
p[7] = a2[1];
p[8] = a2[2];
p[9] = a2[3];
return 0.0;
}
////////////////////////////////////////////////////////////////////////////////
//
// GetValueN
//
G4double
G4Type1GlauberParameterisation::GetParameterisedValueN(const G4double f,
const G4double ppn) const
{
G4int ig = 0;
if (ppn < 1.0E-10) {
return 0;
}
else {
ig = G4int(2.0*std::log10(ppn)) - 2;
}
if (ig < 0) ig = 0;
else if (ig > 23) ig = 23;
G4double v = 0.0;
if (f <= paramn[ig][4]) {
v = paramn[ig][0] * std::pow(f,paramn[ig][1]);
}
else if (f <= limit3) {
v = paramn[ig][2] * std::pow(f,paramn[ig][3]) /
std::pow((1.0 - std::pow(f,paramn[ig][5])),paramn[ig][3]/paramn[ig][5]);
}
else {
G4double l = -std::log(1.0-f);
v = paramn[ig][6] +
paramn[ig][7]*l +
paramn[ig][8]*l*l +
paramn[ig][9]*std::pow(l,3.0);
}
return v;
}
////////////////////////////////////////////////////////////////////////////////
//
// GetValueM
//
G4double
G4Type1GlauberParameterisation::GetParameterisedValueM(const G4double f,
const G4double ppn) const
{
G4int ig = 0;
if (ppn < 1.0E-10) {
return 0;
}
else {
ig = G4int(2.0*std::log10(ppn)) - 2;
}
if (ig < 0) ig = 0;
else if (ig > 23) ig = 23;
G4double v = 0.0;
if (f <= paramm[ig][4]) {
v = paramm[ig][0] * std::pow(f,paramm[ig][1]);
}
else if (f <= limit3) {
v = paramm[ig][2] * std::pow(f,paramm[ig][3]) /
std::pow((1.0 - std::pow(f,paramm[ig][5])),paramm[ig][3]/paramm[ig][5]);
}
else {
G4double l = -std::log(1.0-f);
v = paramn[ig][6] +
paramn[ig][7]*l +
paramn[ig][8]*l*l +
paramn[ig][9]*std::pow(l,3.0);
}
return v;
}
////////////////////////////////////////////////////////////////////////////////
//
// GetInverseValueN
//
/*G4double G4Type1GlauberParameterisation::GetInverseValueN (const G4int b,
const G4double ppn) const
{
G4int ig = 0;
if (ppn < 1.0E-10) {
return 0;
}
else {
ig = G4int(2.0*std::log10(ppn)) - 2;
}
if (ig > 23) ig = 23;
return GetInverseValueN(b,ig);
}*/
////////////////////////////////////////////////////////////////////////////////
//
// GetInverseValueM
//
/*G4double G4Type1GlauberParameterisation::GetInverseValueM (const G4int b,
const G4double ppn) const
{
G4int ig = 0;
if (ppn < 1.0E-10) {
return 0;
}
else {
ig = G4int(2.0*std::log10(ppn)) - 2;
}
if (ig > 23) ig = 23;
return GetInverseValueN(b,ig);
}*/
////////////////////////////////////////////////////////////////////////////////
//
// GetInverseValueN
//
/*G4double G4Type1GlauberParameterisation::GetInverseValueN (const G4int b,
const G4int ig) const
{
G4double v = 0.0;
G4double x = (G4double) b;
if (b <= 1) {
v = 0.0;
}
else {
G4double f1 = 1.0 + std::pow(paramn[ig][0]/x,mun1[ig]);
G4double f2 = 1.0 + std::pow(cn[ig]/x,mun2[ig]);
v = std::pow(f1*f2,1.0/paramn[ig][5]);
}
return v;
}*/
////////////////////////////////////////////////////////////////////////////////
//
// GetInverseValueM
//
/*G4double G4Type1GlauberParameterisation::GetInverseValueM (const G4int b,
const G4int ig) const
{
G4double v = 0.0;
G4double x = (G4double) b;
if (b <= 1) {
v = 0.0;
}
else {
G4double f1 = 1.0 + std::pow(paramm[ig][0]/x,mum1[ig]);
G4double f2 = 1.0 + std::pow(cm[ig]/x,mum2[ig]);
v = std::pow(f1*f2,1.0/paramm[ig][5]);
}
return v;
}*/
////////////////////////////////////////////////////////////////////////////////
//
#endif
@@ -1,235 +0,0 @@
//
// ********************************************************************
// * 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. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 19770/06/NL/JD (Technology Research Programme). *
// * *
// * 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. *
// ********************************************************************
//
/// \file hadronic/Hadr02/src/G4VGlauberDataSet.cc
/// \brief Implementation of the G4VGlauberDataSet class
//
// $Id: G4VGlauberDataSet.cc 77519 2013-11-25 10:54:57Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4VGlauberDataSet.cc
//
// Version: 0.B
// Date: 02/04/08
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 19770/06/NL/JD
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#ifdef G4_USE_DPMJET
#include "G4VGlauberDataSet.hh"
#include "G4DPMJET2_5Interface.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include <iomanip>
#include <iostream>
///////////////////////////////////////////////////////////////////////////////
//
// G4G4VGlauberDataSet
//
// Constructor simply resets all variables to zero.
//
G4VGlauberDataSet::G4VGlauberDataSet()
{
rproj = 0.0;
rtarg = 0.0;
bstep = 0.0;
bmax = 0.0;
AP = 0;
ZP = 0;
AT = 0;
ZT = 0;
maxArray = 200;
maxig = 24;
glauberDataSetType = -1;
verboseLevel = 0;
}
///////////////////////////////////////////////////////////////////////////////
//
// ~G4G4VGlauberDataSet
//
// If you thought the contructor was boring, the destructor is even worse!.
// It doesn't do anything.
//
G4VGlauberDataSet::~G4VGlauberDataSet()
{}
////////////////////////////////////////////////////////////////////////////////
//
G4int G4VGlauberDataSet::GetAP () const
{
return AP;
}
////////////////////////////////////////////////////////////////////////////////
//
G4int G4VGlauberDataSet::GetZP () const
{
return ZP;
}
////////////////////////////////////////////////////////////////////////////////
//
G4int G4VGlauberDataSet::GetAT () const
{
return AT;
}
////////////////////////////////////////////////////////////////////////////////
//
G4int G4VGlauberDataSet::GetZT () const
{
return ZT;
}
////////////////////////////////////////////////////////////////////////////////
//
void G4VGlauberDataSet::SetArrayPointer (const G4int i)
{
if (i<0 || i>=maxArray) {
G4cerr <<"WARNING G4G4VGlauberDataSet::SetArrayPointer" <<G4endl;
G4cerr <<"ATTEMPT TO SET POINTER TO VALUE OUTSIDE [0,"
<<maxArray-1
<<"]"
<<G4endl;
}
else {
arrayPtrn = baseArrayPtrn + i;
arrayPtrm = baseArrayPtrm + i;
}
}
////////////////////////////////////////////////////////////////////////////////
//
G4double * G4VGlauberDataSet::GetArrayPointerN (const G4double ppn)
{
if (ppn < 1.0E-10) return baseArrayPtrn;
else return arrayPtrn;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double * G4VGlauberDataSet::GetArrayPointerM (const G4double ppn)
{
if (ppn < 1.0E-10) return baseArrayPtrm;
else return arrayPtrm;
}
////////////////////////////////////////////////////////////////////////////////
//
G4int G4VGlauberDataSet::GetGlauberDataSetType () const
{
return glauberDataSetType;
}
////////////////////////////////////////////////////////////////////////////////
//
std::ofstream & G4VGlauberDataSet::WriteDataToFile (std::ofstream &File) const
{
//
//
// Dummy member function;
//
return File;
}
std::ifstream & G4VGlauberDataSet::ReadDataFromFile (std::ifstream &File)
{
//
//
// Dummy member function;
//
return File;
}
///////////////////////////////////////////////////////////////////////////////
//
// operator <<
//
// Output file-stream operator. This is intended to match the standard
// GLAUBER data file format.
//
std::ofstream & operator << (std::ofstream &File, const G4VGlauberDataSet &q)
{
File.unsetf(std::ios::scientific);
File.setf(std::ios::fixed|std::ios::right|std::ios::adjustfield);
File.precision(0);
File <<std::setw(1) <<q.glauberDataSetType
<<"NUCLEUS "
<<std::setw(10) <<q.AT
<<std::setw(10) <<q.ZT
<<std::setw(10) <<q.AP
<<std::setw(10) <<q.ZP
<<G4endl;
File.unsetf(std::ios::fixed);
File.setf(std::ios::fixed|std::ios::right|std::ios::adjustfield);
File.precision(5);
File <<std::setw(10) <<q.bmax
<<std::setw(10) <<q.bstep
<<std::setw(10) <<q.rproj
<<std::setw(10) <<q.rtarg
<<G4endl;
File.precision(8);
return q.WriteDataToFile (File);
}
///////////////////////////////////////////////////////////////////////////////
//
// operator >>
//
// Input file-stream operator. This is assumed to the format matches the
// standard GLAUBER data file format.
//
std::ifstream & operator >> (std::ifstream &File, G4VGlauberDataSet &q)
{
G4String dummy;
File >>dummy
>>q.AT
>>q.ZT
>>q.AP
>>q.ZP;
File >>q.bmax
>>q.bstep
>>q.rproj
>>q.rtarg;
return q.ReadDataFromFile (File);
}
#endif
@@ -26,7 +26,7 @@
/// \file hadronic/Hadr02/src/Histo.cc
/// \brief Implementation of the Histo class
//
// $Id: Histo.cc 81932 2014-06-06 15:39:45Z gcosmo $
// $Id: Histo.cc 88154 2015-02-02 12:25:20Z gcosmo $
//
//---------------------------------------------------------------------------
//
@@ -376,8 +376,8 @@ void Histo::SetFileType(const G4String& nam)
if(nam == "root" || nam == "ROOT" ) { fHistType = "root"; }
else if(nam == "xml" || nam == "XML") { fHistType = "xml"; }
else {
G4cerr<<"Sorry, format for output file: "<<nam
<<" not supported. Use \"root\" or \"xml\" (AIDA).";
G4cout<<"Histo::SetFileType: Sorry, format for output file: "<<nam
<<" not supported. Use \"root\" or \"xml\"" << G4endl;
}
}
@@ -26,7 +26,7 @@
/// \file hadronic/Hadr02/src/HistoManager.cc
/// \brief Implementation of the HistoManager class
//
// $Id: HistoManager.cc 81932 2014-06-06 15:39:45Z gcosmo $
// $Id: HistoManager.cc 88154 2015-02-02 12:25:20Z gcosmo $
//
//---------------------------------------------------------------------------
//
@@ -71,17 +71,16 @@
#include "globals.hh"
#include "G4VModularPhysicsList.hh"
#include "G4VPhysicsConstructor.hh"
#include "IonDPMJETPhysics.hh"
#include "G4IonPhysics.hh"
#include "G4RunManager.hh"
#include "DetectorConstruction.hh"
#include "G4NistManager.hh"
#include "G4Material.hh"
#include "G4BuilderType.hh"
#include "G4SystemOfUnits.hh"
//#ifdef G4_USE_URQMD
#include "IonUrQMDPhysics.hh"
//#endif
#include "IonHIJINGPhysics.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
HistoManager* HistoManager::fManager = 0;
@@ -456,18 +455,17 @@ void HistoManager::SetIonPhysics(const G4String& nam)
if(fIonPhysics) {
G4cout << "### HistoManager WARNING: Ion Physics is already defined: <"
<< nam << "> is ignored!" << G4endl;
} else if(nam == "DPMJET") {
fIonPhysics = new IonDPMJETPhysics(false);
fPhysList->ReplacePhysics(fIonPhysics);
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
G4cout << "### SetIonPhysics: Ion Physics DPMJET/Binary is added"
<< G4endl;
} else if(nam == "FTF") {
fIonPhysics = new G4IonPhysics();
} else if(nam == "HIJING") {
#ifdef G4_USE_HIJING
fIonPhysics = new IonHIJINGPhysics();
fPhysList->ReplacePhysics(fIonPhysics);
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
G4cout << "### SetIonPhysics: Ion Physics FTFP/Binary is added"
<< G4endl;
#else
G4cout << "Error: Ion Physics HIJING is requested but is not available"
<<G4endl;
#endif
} else if(nam == "UrQMD") {
#ifdef G4_USE_URQMD
fIonPhysics = new IonUrQMDPhysics(1);
@@ -26,7 +26,7 @@
/// \file hadronic/Hadr02/src/HistoMessenger.cc
/// \brief Implementation of the HistoMessenger class
//
// $Id: HistoMessenger.cc 81932 2014-06-06 15:39:45Z gcosmo $
// $Id: HistoMessenger.cc 88154 2015-02-02 12:25:20Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -61,7 +61,7 @@ HistoMessenger::HistoMessenger(Histo* hist)
fFactoryCmd->SetGuidance("set name for the histograms file");
fFileCmd = new G4UIcmdWithAString("/testhadr/histo/fileType",this);
fFileCmd->SetGuidance("set type (hbook, XML) for the histograms file");
fFileCmd->SetGuidance("set type (root, XML) for the histograms file");
fHistoCmd = new G4UIcommand("/testhadr/histo/setHisto",this);
fHistoCmd->SetGuidance("Set bining of the histo number ih :");
@@ -1,154 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file hadronic/Hadr02/src/IonDPMJETPhysics.cc
/// \brief Implementation of the IonDPMJETPhysics class
//
// $Id: IonABPhysics.cc,v 1.1 2006/10/28 16:00:25 vnivanch Exp $
// GRAS tag Name: gras-02-05-02
//
//---------------------------------------------------------------------------
//
// Class: IonDPMJETPhysics
//
// Author: A.Ivanchenko 26.08.2010
//
// This class was designed under ESA contracts
//
// Customer:
// Contract:
//
//
// Modified:
//
// ------------------------------------------------------------
//
#include "IonDPMJETPhysics.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4Deuteron.hh"
#include "G4Triton.hh"
#include "G4He3.hh"
#include "G4Alpha.hh"
#include "G4GenericIon.hh"
#include "G4HadronInelasticProcess.hh"
#include "G4BinaryLightIonReaction.hh"
#include "G4TripathiCrossSection.hh"
#include "G4TripathiLightCrossSection.hh"
#include "G4IonsShenCrossSection.hh"
#include "G4IonProtonCrossSection.hh"
#include "G4BuilderType.hh"
#ifdef G4_USE_DPMJET
#include "G4DPMJET2_5Model.hh"
#include "G4DPMJET2_5Interface.hh"
#include "G4DPMJET2_5CrossSection.hh"
#endif
#include "G4SystemOfUnits.hh"
using namespace std;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifdef G4_USE_DPMJET
IonDPMJETPhysics::IonDPMJETPhysics(G4bool val)
: G4VHadronPhysics("ionInelasticDPMJET"),fIonBC(0) ,fDPM(0),
fUseDPMJETXS(val)
#else
IonDPMJETPhysics::IonDPMJETPhysics(G4bool)
: G4VHadronPhysics("ionInelasticDPMJET"),fIonBC(0)
#endif
{
fTripathi = fTripathiLight = fShen = fIonH = 0;
SetPhysicsType(bIons);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
IonDPMJETPhysics::~IonDPMJETPhysics()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void IonDPMJETPhysics::ConstructProcess()
{
G4double emax = 1000.*TeV;
fIonBC = new G4BinaryLightIonReaction();
fIonBC->SetMinEnergy(0.0);
fIonBC->SetMaxEnergy(6*GeV);
fShen = new G4IonsShenCrossSection();
fTripathi = new G4TripathiCrossSection();
fTripathiLight = new G4TripathiLightCrossSection();
fIonH = new G4IonProtonCrossSection();
fShen->SetMaxKinEnergy(emax);
fTripathi->SetMaxKinEnergy(emax);
fTripathiLight->SetMaxKinEnergy(emax);
fIonH->SetMaxKinEnergy(emax);
#ifdef G4_USE_DPMJET
fDPM = new G4DPMJET2_5Model();
fDPM->SetMinEnergy(5*GeV);
fDPM->SetMaxEnergy(emax);
if(fUseDPMJETXS) { fDpmXS = new G4DPMJET2_5CrossSection; }
#endif
AddProcess("dInelastic", G4Deuteron::Deuteron(),false);
AddProcess("tInelastic",G4Triton::Triton(),false);
AddProcess("He3Inelastic",G4He3::He3(),true);
AddProcess("alphaInelastic", G4Alpha::Alpha(),true);
AddProcess("ionInelastic",G4GenericIon::GenericIon(),true);
G4cout << "IonDPMJETPhysics::ConstructProcess done! " << G4endl;
}
void IonDPMJETPhysics::AddProcess(const G4String& name,
G4ParticleDefinition* part,
G4bool isIon)
{
G4HadronInelasticProcess* hadi = new G4HadronInelasticProcess(name, part);
G4ProcessManager* pManager = part->GetProcessManager();
pManager->AddDiscreteProcess(hadi);
hadi->AddDataSet(fShen);
//hadi->AddDataSet(fTripathi);
//hadi->AddDataSet(fTripathiLight);
if(isIon) { hadi->AddDataSet(fIonH); }
hadi->RegisterMe(fIonBC);
#ifdef G4_USE_DPMJET
hadi->RegisterMe(fDPM);
if(fUseDPMJETXS) { hadi->AddDataSet(fDpmXS); }
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......