Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
@@ -46,7 +46,6 @@
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
#include "G4FastPathHadronicCrossSection.hh"
#include "G4DynamicParticle.hh"
#include "G4PhysicsVector.hh"
#include <vector>
@@ -68,7 +67,7 @@ public:
~G4CrossSectionDataStore();
// Cross section per unit volume is computed (inverse mean free path)
inline G4double GetCrossSection(const G4DynamicParticle*, const G4Material*);
G4double GetCrossSection(const G4DynamicParticle*, const G4Material*);
G4double ComputeCrossSection(const G4DynamicParticle*, const G4Material*);
// Cross section per element is computed
@@ -124,34 +123,8 @@ private:
G4int nDataSetList;
G4int verboseLevel;
//Fast path: caching
public:
inline const G4FastPathHadronicCrossSection::fastPathParameters&
GetFastPathParameters() const { return fastPathParams; }
inline const G4FastPathHadronicCrossSection::controlFlag&
GetFastPathControlFlags() const { return fastPathFlags; }
void DumpFastPath( const G4ParticleDefinition* , const G4Material* , std::ostream& os);
void ActivateFastPath( const G4ParticleDefinition*, const G4Material* , G4double);
private:
friend struct G4FastPathHadronicCrossSection::fastPathEntry;
//The following method is called by the public one GetCrossSection(const G4DynamicParticle*, const G4Material*)
//The third parameter is used to force the calculation of cross-sections skipping the fast-path mechanism
G4double GetCrossSection(const G4DynamicParticle*, const G4Material*, G4bool requiresSlowPath);
G4FastPathHadronicCrossSection::controlFlag fastPathFlags;
G4FastPathHadronicCrossSection::fastPathParameters fastPathParams;
//Counters
G4FastPathHadronicCrossSection::getCrossSectionCount counters;
//TODO: share this among threads
G4FastPathHadronicCrossSection::G4CrossSectionDataStore_Cache fastPathCache;
G4FastPathHadronicCrossSection::timing timing;
G4FastPathHadronicCrossSection::G4CrossSectionDataStore_Requests requests;
};
inline G4double G4CrossSectionDataStore::GetCrossSection(const G4DynamicParticle* particle , const G4Material* material ) {
//By default tries to use the fast-path mechanism
return GetCrossSection( particle , material , false);
}
inline void G4CrossSectionDataStore::SetVerboseLevel(G4int value)
{
verboseLevel = value;
@@ -1,88 +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. *
// ********************************************************************
//
//
// Class G4CrossSectionPairGG
//
// Extend a cross section to higher energies using
// G4ComponentGGHadronNucleusXsc at high energies.
// Smoothly join cross section sets by scaling GG at a given
// transition energy to match the given low energy cross section.
//
// Author: Gunter Folger
// November 2010
//
#ifndef G4CrossSectionPairGG_h
#define G4CrossSectionPairGG_h
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
#include "G4ParticleDefinition.hh"
#include <valarray>
#include <iostream>
class G4NistManager;
class G4ComponentGGHadronNucleusXsc;
class G4CrossSectionPairGG : public G4VCrossSectionDataSet
{
private:
public:
G4CrossSectionPairGG(G4VCrossSectionDataSet * low,
G4double Etransit);
virtual ~G4CrossSectionPairGG();
virtual void CrossSectionDescription(std::ostream&) const;
virtual
G4bool IsElementApplicable(const G4DynamicParticle*, G4int Z,
const G4Material* mat = 0);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*, G4int Z,
const G4Material* mat = 0);
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
virtual void DumpPhysicsTable(const G4ParticleDefinition&);
private:
G4CrossSectionPairGG();
G4CrossSectionPairGG(const G4CrossSectionPairGG&);
G4CrossSectionPairGG& operator=(const G4CrossSectionPairGG&);
G4NistManager* NistMan;
G4VCrossSectionDataSet * theLowX;
G4ComponentGGHadronNucleusXsc * theHighX;
G4double ETransition;
typedef std::valarray<G4double> XS_factors;
typedef std::pair<const G4ParticleDefinition *, XS_factors > ParticleXScale;
std::vector<ParticleXScale> scale_factors;
};
#endif
@@ -1,310 +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. *
// ********************************************************************
//
#ifndef G4FastPathHadronicCrossSection_hh
#define G4FastPathHadronicCrossSection_hh
#include "G4PhysicsFreeVector.hh"
#include "G4ParticleDefinition.hh"
#include "G4Material.hh"
#include <functional>
#include <utility>
#include <unordered_map>
#include <iostream>
#include <set>
#include <stdint.h>
class G4DynamicParticle;
class G4Material;
class G4CrossSectionDataStore;
//To measure performances and debug info on fast cross-section enable this
//#define FPDEBUG
//TODO: Move all logging and debug functionality to separate header
namespace G4FastPathHadronicCrossSection {
//This data type contains the simplified representation of the
//cross-section, by default it is a G4PhysicsVector type
using XSParam=G4PhysicsFreeVector;
//The key used to search in the cache.
using G4CrossSectionDataStore_Key=std::pair<const G4ParticleDefinition*,const G4Material*>;
//This represents the fast XS implementation.
struct fastPathEntry{
//fastPathEntry();
fastPathEntry(const G4ParticleDefinition *par,const G4Material* mat,G4double min_cutoff);
~fastPathEntry();
inline G4double GetCrossSection(G4double ene) const { return physicsVector->Value(ene); }
void Initialize(G4CrossSectionDataStore* );
const G4ParticleDefinition * const particle;
const G4Material * const material;
const G4double min_cutoff;
XSParam *physicsVector;
# ifdef FPDEBUG
//stats for debug
G4int count;
G4double slowpath_sum; //sum of all slowpath xs
G4double max_delta;
G4double min_delta;
G4double sum_delta;
G4double sum_delta_square;
# endif
};
//A cache entry.
struct cycleCountEntry{
cycleCountEntry(const G4String& pname , const G4Material* mat);
~cycleCountEntry();
const G4String& particle;
const G4Material * const material;
//optional fastPathEntry
fastPathEntry* fastPath;
//cache per element of material test
G4double energy;
G4double crossSection;
# ifdef FPDEBUG
uint64_t cacheHitCount;//
uint64_t initCyclesFastPath;
uint64_t invocationCountSlowPath;
uint64_t totalCyclesSlowPath;
uint64_t invocationCountFastPath;
uint64_t totalCyclesFastPath;
uint64_t invocationCountTriedOneLineCache;//
uint64_t invocationCountOneLineCache;//
# endif
};
struct timing {
unsigned long long rdtsc_start;
unsigned long long rdtsc_stop;
};
struct getCrossSectionCount {
getCrossSectionCount();
inline void MethodCalled();
inline void HitOneLine();
inline void FastPath();
inline void SlowPath();
inline void SampleZandA();
#ifdef FPDEBUG
uint64_t methodCalled;
uint64_t hitOneLineCache;
uint64_t fastPath;
uint64_t slowPath;
uint64_t sampleZandA;
#endif
};
//Hashing the key
struct G4CrossSectionDataStore_Key_Hash {
std::hash<uint64_t> hash_uint64_t;
inline size_t operator()(const G4CrossSectionDataStore_Key& x) const throw() {
return hash_uint64_t(hash_uint64_t( ((uint64_t)(x.first)) ) + hash_uint64_t(((uint64_t)(x.second))));
}
};
//Equality for two key elements
struct G4CrossSectionDataStore_Key_EqualTo {
inline bool operator()(const G4CrossSectionDataStore_Key& lhs, const G4CrossSectionDataStore_Key& rhs ) const {
//TODO: Verify this: particles are singletons, materials use operator==
//TODO: in ref-10, G4Material::operator== becomes deleted, investigating why
return (lhs.first==rhs.first)&&(lhs.second == rhs.second);
}
};
// The cache itself
using G4CrossSectionDataStore_Cache=std::unordered_map<G4CrossSectionDataStore_Key,cycleCountEntry*,
G4CrossSectionDataStore_Key_Hash,G4CrossSectionDataStore_Key_EqualTo>;
struct fastPathRequestConfig_t {
G4CrossSectionDataStore_Key part_mat;
G4double min_cutoff;
};
//Two of the elements are identical if the part_mat part is
struct fastPathRequestConfig_Less {
std::less<G4CrossSectionDataStore_Key> less;
inline bool operator()(const fastPathRequestConfig_t& lhs,const fastPathRequestConfig_t& rhs ) const {
return less(lhs.part_mat,rhs.part_mat);
}
};
using G4CrossSectionDataStore_Requests=std::set<fastPathRequestConfig_t,fastPathRequestConfig_Less>;
//Configure the caching mechanism
struct controlFlag {
G4bool prevCalcUsedFastPath;
G4bool useFastPathIfAvailable;
G4bool initializationPhase;
controlFlag() : prevCalcUsedFastPath(false),useFastPathIfAvailable(false),initializationPhase(false) {}
};
//Parameters to control sampling
struct fastPathParameters {
fastPathParameters() {
//default
//TODO: are these ok?
queryMax = 10000;
sampleMin = 0.0001;
sampleMax = 10000;
sampleCount = 200000;
dpTol = 0.01;
}
//PRUTH vars for sampling and surragate model
G4double queryMax;
G4double sampleMin;
G4double sampleMax;
G4int sampleCount;
G4double dpTol;
};
//Logging functionalities, disabled if not in FPDEBUG mode
static inline void logInvocationTriedOneLine( cycleCountEntry* );
static inline void logInvocationOneLine( cycleCountEntry* );
static inline void logHit(cycleCountEntry*);
static inline void logInvocationCountFastPath( cycleCountEntry* );
static inline void logInvocationCountSlowPAth( cycleCountEntry* );
#ifdef FPDEBUG
void logStartCountCycles( timing& );
void logStopCountCycles( timing& );
#else
inline void logStartCountCycles(timing&) {}
inline void logStopCountCycles(timing&) {}
#endif
static inline void logInitCyclesFastPath( cycleCountEntry* , timing& );
static inline void logTotalCyclesFastPath( cycleCountEntry* , timing& );
static inline void logTotalCyclesSlowPath( cycleCountEntry* , timing& );
static inline void logTiming( cycleCountEntry* , fastPathEntry* , timing& );
}
inline std::ostream& operator<<(std::ostream& os, const G4FastPathHadronicCrossSection::fastPathEntry& fp);
//Implementation of inline functions. Note the ifdef
namespace G4FastPathHadronicCrossSection {
#ifdef FPDEBUG
inline void logInvocationTriedOneLine(cycleCountEntry* cl ) {
if ( cl != nullptr ) ++(cl->invocationCountTriedOneLineCache);
}
inline void logInvocationOneLine( cycleCountEntry* cl ) {
if ( cl != nullptr ) ++(cl->invocationCountOneLineCache);
}
inline void logHit(cycleCountEntry* cl) {
if ( cl != nullptr ) ++(cl->cacheHitCount);
}
inline void logInvocationCountFastPath( cycleCountEntry* cl )
{
if ( cl != nullptr ) ++(cl->invocationCountFastPath);
}
inline void logInvocationCountSlowPAth( cycleCountEntry* cl)
{
if ( cl != nullptr ) ++(cl->invocationCountSlowPath);
}
inline void logInitCyclesFastPath(cycleCountEntry* cl,timing& tm)
{
if ( cl != nullptr ) cl->initCyclesFastPath = tm.rdtsc_stop - tm.rdtsc_start;
}
inline void logTotalCyclesFastPath( cycleCountEntry* cl,timing& tm)
{
if ( cl!=nullptr ) cl->totalCyclesFastPath = tm.rdtsc_stop - tm.rdtsc_start;
}
inline void logTotalCyclesSlowPath( cycleCountEntry* cl,timing& tm)
{
if ( cl!=nullptr ) cl->totalCyclesSlowPath = tm.rdtsc_stop - tm.rdtsc_start;
}
inline void logTiming( cycleCountEntry* entry , fastPathEntry* fast_entry, timing& timing)
{
if (fast_entry != nullptr ) {
if ( entry->invocationCountFastPath == 0 ) {
//PRUTH style initialization
G4FastPathHadronicCrossSection::logInitCyclesFastPath(entry,timing);
G4FastPathHadronicCrossSection::logInvocationCountFastPath(entry);
} else {
//PRUTH comment to understand:
//the first one includes the initialization... don't count it for now
G4FastPathHadronicCrossSection::logTotalCyclesFastPath(entry,timing);
G4FastPathHadronicCrossSection::logInvocationCountFastPath(entry);
}
} else {
G4FastPathHadronicCrossSection::logInvocationCountSlowPAth(entry);
G4FastPathHadronicCrossSection::logTotalCyclesSlowPath(entry,timing);
}
}
#else
inline void logInvocationTriedOneLine(cycleCountEntry*){}
inline void logInvocationOneLine( cycleCountEntry*){}
inline void logHit(cycleCountEntry*){}
inline void logInvocationCountFastPath( cycleCountEntry*){}
inline void logInvocationCountSlowPAth( cycleCountEntry*){}
inline void logInitCyclesFastPath( cycleCountEntry* , timing& ){}
inline void logTotalCyclesFastPath( cycleCountEntry* , timing& ){}
inline void logTotalCyclesSlowPath( cycleCountEntry* , timing& ){}
inline void logTiming( cycleCountEntry* , fastPathEntry* , timing& ) {}
#endif
inline void getCrossSectionCount::MethodCalled() {
#ifdef FPDEBUG
++methodCalled;
#endif
}
inline void getCrossSectionCount::HitOneLine() {
#ifdef FPDEBUG
++hitOneLineCache;
#endif
}
inline void getCrossSectionCount::FastPath() {
#ifdef FPDEBUG
++fastPath;
#endif
}
inline void getCrossSectionCount::SlowPath() {
#ifdef FPDEBUG
++slowPath;
#endif
}
inline void getCrossSectionCount::SampleZandA() {
#ifdef FPDEBUG
++sampleZandA;
#endif
}
}//namespace
inline std::ostream& operator<<(std::ostream& os, const G4FastPathHadronicCrossSection::fastPathEntry& fp) {
using CLHEP::MeV;
os<<"#Particle: "<<(fp.particle!=nullptr?fp.particle->GetParticleName():"UNDEFINED")<<"\n";
os<<"#Material: "<<(fp.material!=nullptr?fp.material->GetName():"UNDEFINED")<<"\n";
os<<"#min_cutoff(MeV): "<<fp.min_cutoff/MeV<<"\n";
#ifdef FPDEBUG
os<<"#DEBUG COUNTERS: count="<<fp.count<<" slowpath_sum="<<fp.slowpath_sum<<" max_delta="<<fp.max_delta;
os<<" min_delta="<<fp.min_delta<<" sum_delta="<<fp.sum_delta<<" sum_delta_square="<<fp.sum_delta_square<<"\n";
#endif
os<<*(fp.physicsVector)<<"\n";
return os;
}
#endif //G4FastPathHadronicCrossSection_hh
@@ -96,16 +96,16 @@ private:
inline G4PhysicsVector* GetPhysicsVector(G4int Z);
G4VCrossSectionDataSet* ggXsection;
G4VCrossSectionDataSet* ggXsection = nullptr;
const G4ParticleDefinition* gamma;
G4bool isMaster = false;
static const G4int MAXZGAMMAN = 93;
static G4PhysicsVector* data[MAXZGAMMAN];
static G4double coeff[MAXZGAMMAN];
static G4String gDataDirectory;
G4bool isMaster;
#ifdef G4MULTITHREADED
static G4Mutex gNuclearXSMutex;
#endif
@@ -1,114 +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 17191/03/NL/LvH (Aurora 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. *
// ********************************************************************
//
#ifndef G4GeneralSpaceNNCrossSection_h
#define G4GeneralSpaceNNCrossSection_h
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4TESAGeneralNNCrossSection.hh
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 6 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// 4 June 2004, J.P. Wellisch, CERN
// trivial porting issue to windows.
//
// 19 Aug 2011, V.Ivanchenko move to new design and make x-section per element
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// Class Description
//
//
// Class Description - End
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "G4VCrossSectionDataSet.hh"
#include "globals.hh"
class G4ProtonInelasticCrossSection;
class G4IonProtonCrossSection;
class G4TripathiLightCrossSection;
class G4TripathiCrossSection;
class G4IonsShenCrossSection;
class G4Proton;
////////////////////////////////////////////////////////////////////////////////
//
class G4GeneralSpaceNNCrossSection : public G4VCrossSectionDataSet
{
public:
G4GeneralSpaceNNCrossSection ();
~G4GeneralSpaceNNCrossSection ();
virtual G4bool IsElementApplicable(const G4DynamicParticle* theProjectile,
G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle* theProjectile,
G4int Z, const G4Material*);
virtual void CrossSectionDescription(std::ostream& outFile) const;
private:
G4ProtonInelasticCrossSection *protonInelastic;
G4IonProtonCrossSection *ionProton;
G4TripathiLightCrossSection *TripathiLight;
G4TripathiCrossSection *TripathiGeneral;
G4IonsShenCrossSection *Shen;
G4Proton *theProton;
};
#endif
@@ -1,70 +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. *
// ********************************************************************
//
// GEANT4 physics class: G4HadronCaptureDataSet -- header file
// F.W. Jones, TRIUMF, 19-MAY-98
//
// 19 Aug 2011, V.Ivanchenko move to new design and make x-section per element
//
// Class Description
// Baseline data-set for the cross-section of capture of neutroal hadrons on
// nuclei. This does not need to be registered, but provides part of the
// general cross-section baseline.
// Class Description - End
#ifndef G4HadronCaptureDataSet_h
#define G4HadronCaptureDataSet_h 1
#include "G4VCrossSectionDataSet.hh"
#include "G4HadronCrossSections.hh"
#include "G4DynamicParticle.hh"
#include "G4Element.hh"
class G4HadronCaptureDataSet : public G4VCrossSectionDataSet
{
public:
G4HadronCaptureDataSet(const G4String& name = "GheishaCaptureXS");
~G4HadronCaptureDataSet();
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool
IsElementApplicable(const G4DynamicParticle* aParticle, G4int /*Z*/,
const G4Material*);
virtual G4double
GetElementCrossSection(const G4DynamicParticle* aParticle, G4int Z,
const G4Material*);
private:
G4HadronCrossSections* theHadronCrossSections;
};
#endif
@@ -1,140 +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. *
// ********************************************************************
//
//
// GEANT4 Hadron physics class -- header file
// F.W. Jones, TRIUMF, 03-DEC-96
//
// This class encapsulates cross section data and interpolations
// from the Geant3/Gheisha routine GHESIG.
// For further comments see G4HadronCrossSections.cc.
//
// Note: this is implemented as a SINGLETON class
//
// 27-MAR-97 FWJ: first version for Alpha release
// 14-APR-97 FWJ: class name changed from G4LCrossSectionData
// to G4HadronicCrossSections
// 14-APR-98 FWJ: rewritten as class G4HadronCrossSections
// and adapted to G4CrossSectionDataSet/DataStore class design.
// 26-JUN-98 FWJ: added elastic/inelastic caching to improve performance.
// 06-NOV-98 FWJ: added first-order correction for low-energy
// inelastic cross sections
//
#ifndef G4HadronCrossSections_h
#define G4HadronCrossSections_h 1
#include "globals.hh"
#include "G4DynamicParticle.hh"
#include "G4ThreadLocalSingleton.hh"
enum { TSIZE=41, NPARTS=35, NELAB=17, NCNLW=15, NFISS=21 };
class G4Pow;
class G4HadronCrossSections
{
friend class G4ThreadLocalSingleton<G4HadronCrossSections>;
public:
static G4HadronCrossSections* Instance();
~G4HadronCrossSections();
G4bool IsApplicable(const G4DynamicParticle* aParticle);
G4double GetElasticCrossSection(const G4DynamicParticle*,
G4int /*ZZ*/, G4int /*AA*/);
G4double GetInelasticCrossSection(const G4DynamicParticle*,
G4int /*ZZ*/, G4int /*AA*/);
G4double GetCaptureCrossSection(const G4DynamicParticle*, G4int /*Z*/);
G4double GetFissionCrossSection(const G4DynamicParticle*, G4int /*ZZ*/,
G4int /*AA*/);
void SetVerboseLevel(G4int value) {verboseLevel = value;}
G4int GetVerboseLevel() {return verboseLevel;}
private:
G4HadronCrossSections();
G4int GetParticleCode(const G4DynamicParticle*);
void CalcScatteringCrossSections(const G4DynamicParticle*,
G4int /*ZZ*/, G4int /*AA*/);
static G4ThreadLocal G4HadronCrossSections* instance;
G4Pow* g4pow;
G4double sigelastic;
G4double siginelastic;
G4ParticleDefinition* prevParticleDefinition;
G4int prevZZ;
G4int prevAA;
G4double prevKineticEnergy;
G4double lastEkx, lastEkxPower;
G4bool correctInelasticNearZero;
G4int verboseLevel;
// The following arrays are declared static to allow the use of initializers.
// They are initialized in G4HadronCrossSections.cc, thus providing some
// data hiding.
static const G4float plab[TSIZE];
static const G4float csel[NPARTS][TSIZE];
static const G4float csin[NPARTS][TSIZE];
static const G4float cspiel[3][TSIZE];
static const G4float cspiin[3][TSIZE];
static const G4float cspnel[3][TSIZE];
static const G4float cspnin[3][TSIZE];
static const G4float elab[NELAB];
static const G4float cnlwat[NCNLW], cnlwel[NCNLW][NELAB], cnlwin[NCNLW][NELAB];
static const G4float cscap[100];
static const G4float ekfiss[NFISS], csfiss[4][NFISS];
static const G4float alpha[NPARTS], alphac[TSIZE];
static const G4float partel[35], partin[35];
static const G4int icorr[35], intrc[35];
static const G4float csa[4];
static const G4int ipart2[7];
};
#endif
@@ -1,73 +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. *
// ********************************************************************
//
// GEANT4 physics class: G4HadronElasticDataSet -- header file
// F.W. Jones, TRIUMF, 28-JAN-97
//
// Modified: V.Ivanchenko
//
// Class Description:
// Baseline data-set for hadron nucleaus elastic cross-section. This does not
// need to be registered, but provides part of the general cross-section
// baseline
#ifndef G4HadronElasticDataSet_h
#define G4HadronElasticDataSet_h 1
#include "G4VCrossSectionDataSet.hh"
class G4ParticleDefinition;
class G4NistManager;
class G4HadronCrossSections;
class G4HadronElasticDataSet : public G4VCrossSectionDataSet
{
public:
G4HadronElasticDataSet(const G4String& name = "GheishaElastic");
virtual ~G4HadronElasticDataSet();
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool
IsElementApplicable(const G4DynamicParticle* aParticle, G4int /*Z*/,
const G4Material*);
virtual G4double
GetElementCrossSection(const G4DynamicParticle* aParticle, G4int Z,
const G4Material*);
private:
G4int theZ;
G4double fElasticXS;
G4double fKinEnergy;
const G4ParticleDefinition* fParticle;
G4HadronCrossSections* fGheishaXS;
G4NistManager* fNIST;
};
#endif
@@ -1,67 +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. *
// ********************************************************************
//
// GEANT4 physics class: G4HadronFissionDataSet -- header file
// F.W. Jones, TRIUMF, 19-MAY-98
//
// Class Description
// Baseline data-set for induced fission cross-section. This does not need to
// be registered, but provides part of the general cross-section baseline
// Class Description - End
#ifndef G4HadronFissionDataSet_h
#define G4HadronFissionDataSet_h 1
#include "G4VCrossSectionDataSet.hh"
//#include "G4HadronCrossSections.hh"
#include "G4DynamicParticle.hh"
//#include "G4Element.hh"
class G4HadronFissionDataSet : public G4VCrossSectionDataSet
{
public:
G4HadronFissionDataSet(const G4String& name = "GheishaFissionXS");
virtual ~G4HadronFissionDataSet();
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool
IsElementApplicable(const G4DynamicParticle* aParticle, G4int /*Z*/,
const G4Material*);
virtual G4double
GetElementCrossSection(const G4DynamicParticle* aParticle, G4int Z,
const G4Material*);
private:
//G4HadronCrossSections* theHadronCrossSections;
};
#endif
@@ -1,72 +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. *
// ********************************************************************
//
// GEANT4 physics class: G4HadronInelasticDataSet -- header file
// F.W. Jones, TRIUMF, 19-MAY-98
//
// Modified: V.Ivanchenko
//
// Class Description:
// Baseline data-set for hadron inelastic cross-section. This does not need to
// be registered, but provides part of the general cross-section baseline
#ifndef G4HadronInelasticDataSet_h
#define G4HadronInelasticDataSet_h 1
#include "G4VCrossSectionDataSet.hh"
class G4ParticleDefinition;
class G4NistManager;
class G4HadronCrossSections;
class G4HadronInelasticDataSet : public G4VCrossSectionDataSet
{
public:
G4HadronInelasticDataSet(const G4String& name = "GheishaInelastic");
virtual ~G4HadronInelasticDataSet();
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool
IsElementApplicable(const G4DynamicParticle* aParticle, G4int /*Z*/,
const G4Material*);
virtual G4double
GetElementCrossSection(const G4DynamicParticle* aParticle, G4int Z,
const G4Material*);
private:
G4int theZ;
G4double fInelasticXS;
G4double fKinEnergy;
const G4ParticleDefinition* fParticle;
G4HadronCrossSections* fGheishaXS;
G4NistManager* fNIST;
};
#endif
@@ -1,107 +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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
// File name: G4IonProtonCrossSection
//
//
// Cross-sections for ion proton scattering up to 20 GeV, getting the low
// energy threshold behaviour right.
// H.P. Wellisch (TRIUMF), D. Axen (British Columbia U.). 1996.
// Published in Phys.Rev.C54:1329-1332,1996
//
// Original by H.P.Wellisch 28 June 2001
//
// Modifications:
// 30-07-2010 V.Ivanchenko move virtual methods to source,
// add constructor and destructor,
// make G4ProtonInelasticCrossSection class member,
// fix bug in kinematics
// 18.08.2011 V.Ivanchenko migration to new design
//
#ifndef G4IonProtonCrossSection_h
#define G4IonProtonCrossSection_h 1
#include "G4VCrossSectionDataSet.hh"
#include "globals.hh"
class G4ParticleInelasticXS;
class G4IonProtonCrossSection : public G4VCrossSectionDataSet
{
public:
explicit G4IonProtonCrossSection();
~G4IonProtonCrossSection() override;
G4double GetProtonCrossSection(const G4DynamicParticle*, G4int Z);
G4double GetDeuteronCrossSection(const G4DynamicParticle*, G4int Z);
G4double GetTritonCrossSection(const G4DynamicParticle*, G4int Z);
G4double GetHe3CrossSection(const G4DynamicParticle*, G4int Z);
G4double GetAlphaCrossSection(const G4DynamicParticle*, G4int Z);
G4bool IsElementApplicable(const G4DynamicParticle* aPart, G4int Z,
const G4Material*) override;
G4bool IsIsoApplicable(const G4DynamicParticle*, G4int Z, G4int A,
const G4Element* elm = nullptr,
const G4Material* mat = nullptr) override;
G4double GetElementCrossSection(const G4DynamicParticle* aPart,
G4int Z, const G4Material*) override;
G4double GetIsoCrossSection(const G4DynamicParticle*, G4int Z, G4int A,
const G4Isotope* iso = nullptr,
const G4Element* elm = nullptr,
const G4Material* mat = nullptr) override;
void BuildPhysicsTable(const G4ParticleDefinition&) override;
void CrossSectionDescription(std::ostream&) const override;
private: // Without Description
G4IonProtonCrossSection & operator=(const G4IonProtonCrossSection &right);
G4IonProtonCrossSection(const G4IonProtonCrossSection&);
G4ParticleInelasticXS* xsProton;
G4ParticleInelasticXS* xsDeuteron;
G4ParticleInelasticXS* xsTriton;
G4ParticleInelasticXS* xsHe3;
G4ParticleInelasticXS* xsAlpha;
};
#endif
@@ -1,75 +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. *
// ********************************************************************
//
#ifndef G4IonsKoxCrossSection_h
#define G4IonsKoxCrossSection_h
//
// Class Description
// Implementation of Kox formulas
// Kox et al. Phys. Rev. C 35 1678 (1987);
// Total Reaction Cross Section for Nucleus-nucles reactions.
//
// Class Description - End
// 18-Sep-2003 First version is written by T. Koi
// 12-Nov-2003 Set upper limit at 10 GeV/n
// 12-Nov-2003 Insted of the lower limit,
// 0 is returned to a partilce with energy lowae than 10 MeV/n
// 19-Aug-2011 V.Ivanchenko move to new design and make x-section per element
#include "globals.hh"
#include "G4Proton.hh"
#include "G4VCrossSectionDataSet.hh"
class G4IonsKoxCrossSection : public G4VCrossSectionDataSet
{
public:
G4IonsKoxCrossSection();
~G4IonsKoxCrossSection();
virtual
G4bool IsElementApplicable(const G4DynamicParticle* aDP,
G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*,
G4int Z, const G4Material*);
virtual void CrossSectionDescription(std::ostream&) const;
private:
G4double calEcm ( G4double , G4double , G4double );
G4double calCeValue ( G4double );
// G4double lowerLimit;
G4double r0;
G4double rc;
};
#endif
@@ -1,84 +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. *
// ********************************************************************
//
#ifndef G4IonsShenCrossSection_h
#define G4IonsShenCrossSection_h
//
// Class Description
// Implementation of formulas
// Shen et al. Nuc. Phys. A 491 130 (1989);
// Total Reaction Cross Section for Heavy-Ion Collisions
//
// Class Description - End
// 18-Sep-2003 First version is written by T. Koi
// 12-Nov-2003 Set upper limit at 10 GeV/n
// 12-Nov-2003 Insted of the lower limit,
// 0 is returned to a partilce with energy lowae than 10 MeV/n
// 15-Nov-2006 Change upper limit to 1 TeV/n
// However above 10GeV/n XS become constant.
// 23-Dec-2006 Isotope dependence added by D. Wright
// 19-Aug-2011 V.Ivanchenko move to new design and make x-section per element
//
#include "globals.hh"
#include "G4Proton.hh"
#include "G4VCrossSectionDataSet.hh"
class G4IonsShenCrossSection : public G4VCrossSectionDataSet
{
public:
G4IonsShenCrossSection();
virtual ~G4IonsShenCrossSection();
virtual
G4bool IsElementApplicable(const G4DynamicParticle* aDP,
G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*,
G4int Z, const G4Material*);
virtual
G4double GetIsoCrossSection(const G4DynamicParticle*, G4int Z, G4int A,
const G4Isotope* iso = 0,
const G4Element* elm = 0,
const G4Material* mat = 0);
virtual void CrossSectionDescription(std::ostream&) const;
private:
const G4double upperLimit;
// const G4double lowerLimit;
const G4double r0;
G4double calEcmValue(const G4double, const G4double, const G4double);
G4double calCeValue(const G4double);
};
#endif
@@ -1,69 +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. *
// ********************************************************************
//
#ifndef G4IonsSihverCrossSection_h
#define G4IonsSihverCrossSection_h
//
// Class Description
// Implementation of formulas
// Sihver et al. Phys. Rev. C 47 1225 (1993);
// Total Reaction Cross Section for Nucleus-nucles reactions.
// Energy independent
// Valid for 100>MeV/nucleon
// Class Description - End
//
// 23-Dec-2006 Isotope dependence added by D. Wright
// 19-Aug-2011 V.Ivanchenko move to new design and make x-section per element
//
#include "globals.hh"
#include "G4Proton.hh"
#include "G4VCrossSectionDataSet.hh"
class G4IonsSihverCrossSection : public G4VCrossSectionDataSet
{
public:
G4IonsSihverCrossSection();
virtual ~G4IonsSihverCrossSection();
virtual
G4bool IsElementApplicable(const G4DynamicParticle* aDP, G4int Z,
const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*,
G4int Z, const G4Material*);
virtual void CrossSectionDescription(std::ostream&) const;
private:
const G4double square_r0;
};
#endif
@@ -64,8 +64,8 @@ public:
const G4Material*);
G4int GetEnergyIndex(G4double energy);
G4double GetNuMuTotCsXsc(G4int index, G4double energy);
G4double GetANuMuTotCsXsc(G4int index, G4double energy);
G4double GetNuMuTotCsXsc(G4int index, G4double energy, G4int Z, G4int A);
G4double GetANuMuTotCsXsc(G4int index, G4double energy, G4int Z, G4int A);
G4double GetNuMuTotCsArray(G4int index);
G4double GetANuMuTotCsArray(G4int index);
@@ -78,6 +78,7 @@ public:
G4double GetTotXsc(){return fTotXsc;};
G4double GetCcTotRatio(){return fCcTotRatio;};
G4double GetQEratio(){return fQEratio;};
protected:
@@ -86,13 +87,15 @@ protected:
G4double fCofS, fCofL;
G4double fCutEnergy; // minimal recoil electron energy detected
G4double fBiasingFactor; // biasing xsc up
G4double fTotXsc, fCcTotRatio, fCcFactor, fNcFactor;
G4double fTotXsc, fCcTotRatio, fCcFactor, fNcFactor, fQEratio;
G4int fIndex;
static const G4double fNuMuEnergy[50];
static const G4double fNuMuTotXsc[50];
static const G4double fANuMuTotXsc[50];
static const G4double fNuMuInXsc[50];
static const G4double fNuMuQeXsc[50];
static const G4double fANuMuInXsc[50];
static const G4double fANuMuQeXsc[50];
G4ParticleDefinition* theMuonMinus;
G4ParticleDefinition* theMuonPlus;
@@ -109,7 +109,7 @@ private:
std::vector<G4double> temp;
G4bool isMaster;
G4bool isMaster = false;
static const G4int MAXZCAPTURE = 93;
static G4ElementData* data;
@@ -97,16 +97,16 @@ private:
inline G4PhysicsVector* GetPhysicsVector(G4int Z);
G4VComponentCrossSection* ggXsection;
G4VComponentCrossSection* ggXsection = nullptr;
const G4ParticleDefinition* neutron;
G4bool isMaster = false;
static const G4int MAXZEL = 93;
static G4PhysicsVector* data[MAXZEL];
static G4double coeff[MAXZEL];
static G4String gDataDirectory;
G4bool isMaster;
#ifdef G4MULTITHREADED
static G4Mutex neutronElasticXSMutex;
#endif
@@ -1,70 +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. *
// ********************************************************************
//
// by JPW, working, but to be cleaned up. @@@@
// D. Wright, 23-Dec-2006 Added isotope dependence
// G.Folger, 25-Nov-2009: extend to 100TeV, using a constant above 20GeV
// 19 Aug 2011, V.Ivanchenko move to new design and make x-section per element
//
#ifndef G4NeutronInelasticCrossSection_h
#define G4NeutronInelasticCrossSection_h
// Class Description
// Cross sections for neutron-nucleus scattering from 14 MeV up to 20 GeV,
// getting the low energy threshold behavior right.
// H.P. Wellisch (TRIUMF), M. Laidlaw (British Columbia U.). 1996.
// Class Description - End
#include "G4VCrossSectionDataSet.hh"
#include "globals.hh"
class G4NeutronInelasticCrossSection : public G4VCrossSectionDataSet
{
public:
G4NeutronInelasticCrossSection();
~G4NeutronInelasticCrossSection();
virtual
G4bool IsElementApplicable(const G4DynamicParticle* aPart,
G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*,
G4int Z, const G4Material*);
G4double GetCrossSection(G4double kineticEnergy, G4int Z, G4int A);
virtual void CrossSectionDescription(std::ostream&) const;
private:
G4double minEnergy;
G4double maxEnergy;
};
#endif
@@ -101,13 +101,13 @@ private:
G4PhysicsVector* RetrieveVector(std::ostringstream& in, G4bool warn);
G4VComponentCrossSection* ggXsection;
G4VComponentCrossSection* ggXsection = nullptr;
const G4ParticleDefinition* neutron;
std::vector<G4double> temp;
G4bool isMaster;
G4bool isMaster = false;
static const G4int MAXZINEL = 93;
static G4ElementData* data;
@@ -102,14 +102,13 @@ private:
G4PhysicsVector* RetrieveVector(std::ostringstream& in, G4bool warn);
G4VComponentCrossSection* highEnergyXsection;
G4VComponentCrossSection* highEnergyXsection = nullptr;
const G4ParticleDefinition* particle;
std::vector<G4double> temp;
G4int index;
G4bool isMaster;
G4int index = 0;
G4bool isMaster = false;
static const G4int MAXZINELP = 93;
static G4ElementData* data[5];
@@ -1,150 +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. *
// ********************************************************************
//
#ifndef G4PiNuclearCrossSection_h
#define G4PiNuclearCrossSection_h
#include "G4VCrossSectionDataSet.hh"
#include "globals.hh"
#include "G4PionMinus.hh"
#include "G4PionPlus.hh"
#include "G4PiData.hh"
#include "G4HadTmpUtil.hh"
class G4PiNuclearCrossSection : public G4VCrossSectionDataSet
{
public:
G4PiNuclearCrossSection();
virtual ~G4PiNuclearCrossSection();
static const char* Default_Name() {return "G4PiNuclearCrossSection";}
virtual
G4bool IsElementApplicable(const G4DynamicParticle* aParticle,
G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle* particle,
G4int Z, const G4Material*);
virtual
void BuildPhysicsTable(const G4ParticleDefinition&);
virtual void CrossSectionDescription(std::ostream&) const;
inline G4double GetTotalXsc() {return fTotalXsc;};
inline G4double GetElasticXsc() {return fElasticXsc;};
private:
G4double Interpolate(G4int Z1, G4int Z2, G4int Z, G4double x1, G4double x2);
// add Hydrogen from PDG group.
static const G4double e1[38];
static const G4double he_t[38];
static const G4double he_in[38];
static const G4double be_m_t[38];
static const G4double be_m_in[38];
static const G4double be_p_t[24];
static const G4double be_p_in[24];
static const G4double e2[39];
static const G4double c_m_t[39];
static const G4double c_m_in[39];
static const G4double c_p_t[24];
static const G4double c_p_in[24];
static const G4double n_m_t[39];
static const G4double n_m_in[39];
static const G4double n_p_t[27];
static const G4double n_p_in[27];
static const G4double e3[31];
static const G4double o_m_t[31];
static const G4double o_m_in[31];
static const G4double o_p_t[20];
static const G4double o_p_in[20];
static const G4double na_m_t[31];
static const G4double na_m_in[31];
static const G4double na_p_t[22];
static const G4double na_p_in[22];
static const G4double e3_1[31];
static const G4double al_m_t[31];
static const G4double al_m_in[31];
static const G4double al_p_t[21];
static const G4double al_p_in[21];
static const G4double ca_m_t[31];
static const G4double ca_m_in[31];
static const G4double ca_p_t[23];
static const G4double ca_p_in[23];
static const G4double e4[32];
static const G4double fe_m_t[32];
static const G4double fe_m_in[32];
static const G4double fe_p_t[25];
static const G4double fe_p_in[25];
static const G4double cu_m_t[32];
static const G4double cu_m_in[32];
static const G4double cu_p_t[25];
static const G4double cu_p_in[25];
static const G4double e5[34];
static const G4double mo_m_t[34];
static const G4double mo_m_in[34];
static const G4double mo_p_t[27];
static const G4double mo_p_in[27];
static const G4double cd_m_t[34];
static const G4double cd_m_in[34];
static const G4double cd_p_t[28];
static const G4double cd_p_in[28];
static const G4double e6[35];
static const G4double sn_m_t[35];
static const G4double sn_m_in[35];
static const G4double sn_p_t[29];
static const G4double sn_p_in[29];
static const G4double w_m_t[35];
static const G4double w_m_in[35];
static const G4double w_p_t[30];
static const G4double w_p_in[30];
static const G4double e7[35];
static const G4double pb_m_t[35];
static const G4double pb_m_in[35];
static const G4double pb_p_t[30];
static const G4double pb_p_in[30];
static const G4double u_m_t[35];
static const G4double u_m_in[35];
static const G4double u_p_t[30];
static const G4double u_p_in[30];
std::vector<G4int> theZ;
std::vector<G4PiData *> thePipData;
std::vector<G4PiData *> thePimData;
// cross sections
G4double fTotalXsc;
G4double fElasticXsc;
};
#endif
@@ -1,78 +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. *
// ********************************************************************
//
// by JPW, working, but to be cleaned up. @@@@
// G.Folger, 29-sept-2006: extend to 1TeV, using a constant above 20GeV
// D. Wright, 23-Dec-2006: added isotope dependence
// G.Folger, 25-Nov-2009: extend to 100TeV, using a constant above 20GeV
// V.Ivanchenko, 18-Aug-2011: migration to new design
//
#ifndef G4ProtonInelasticCrossSection_h
#define G4ProtonInelasticCrossSection_h
// Class Description
// Cross-sections for proton nuclear scattering up to 20 GeV, getting the low
// energy threshold behaviour right.
// H.P. Wellisch (TRIUMF), D. Axen (British Columbia U.). 1996.
// Published in Phys.Rev.C54:1329-1332,1996
// Implements corrected parameterization from
// http://laws.lanl.gov/XCI/PEOPLE/rep/pdf/RPS96.pdf
// Class Description - End
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
class G4NistManager;
class G4Proton;
class G4ProtonInelasticCrossSection : public G4VCrossSectionDataSet
{
public:
G4ProtonInelasticCrossSection();
~G4ProtonInelasticCrossSection();
virtual
G4bool IsElementApplicable(const G4DynamicParticle* aPart,
G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*,
G4int Z, const G4Material*);
G4double GetProtonCrossSection(G4double kineticEnergy, G4int Z);
private:
G4NistManager* nist;
G4Proton* theProton;
G4double thEnergy;
};
#endif
@@ -1,59 +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. *
// ********************************************************************
//
// by JPW, working, but to be cleaned up. @@@@
#ifndef G4TripathiCrossSection_h
#define G4TripathiCrossSection_h
// 19-Aug-2011 V.Ivanchenko move to new design and make x-section per element
// Class Description
// Implementation of formulas in analogy to NASA technical paper 3621 by
// Tripathi, et al.; Cross-sections for ion ion scattering.
// Class Description - End
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
class G4TripathiCrossSection : public G4VCrossSectionDataSet
{
public:
G4TripathiCrossSection();
~G4TripathiCrossSection();
virtual
G4bool IsElementApplicable(const G4DynamicParticle* aPart,
G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*,
G4int Z, const G4Material*);
};
#endif
@@ -1,112 +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 17191/03/NL/LvH (Aurora 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. *
// ********************************************************************
//
#ifndef G4TripathiLightCrossSection_h
#define G4TripathiLightCrossSection_h
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4TripathiLightCrossSection.hh
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 6 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// 26 Dec 2006, D. Wright - added isotope dependence
//
// 19 Aug 2011 V.Ivanchenko move to new design and make x-section per element
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// Class Description
// Implementation of formulas of Tripathi, Cucinotta and Wilson, NASA Technical
// Paper TP-1999-209726 to calculate cross-sections for nuclear-nuclear
// inelastic scattering for light nuclear systems.
//
// Class Description - End
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
#include "G4WilsonRadius.hh"
///////////////////////////////////////////////////////////////////////////////
//
class G4TripathiLightCrossSection : public G4VCrossSectionDataSet
{
public:
G4TripathiLightCrossSection();
~G4TripathiLightCrossSection();
virtual G4bool IsElementApplicable(const G4DynamicParticle* theProjectile,
G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle* theProjectile,
G4int Z, const G4Material* mat = 0);
inline void SetLowEnergyCheck(G4bool);
private:
G4WilsonRadius *theWilsonRadius;
G4double r_0;
G4bool lowEnergyCheck;
};
inline void
G4TripathiLightCrossSection::SetLowEnergyCheck (G4bool aLowEnergyCheck)
{
lowEnergyCheck = aLowEnergyCheck;
}
#endif
@@ -96,6 +96,7 @@ private:
G4double elow;
G4bool isMaster;
G4bool spline;
#ifdef G4MULTITHREADED
static G4Mutex pionUXSMutex;