Import Geant4 9.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:15:05 +02:00
parent b79225fb37
commit 74cad5e589
3877 changed files with 234205 additions and 167127 deletions
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.6 2006/07/20 12:48:28 grichine Exp $
# $Id: GNUmakefile,v 1.10 2009/11/17 08:55:50 gcosmo Exp $
# ----------------------------------------------------------------
# GNUmakefile for hadronic management library. G.Folger 10-Dec-97
# ----------------------------------------------------------------
@@ -14,7 +14,112 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
01 December 2008 Vladimir Ivantchenko (hadr-cross-V09-01-07)
9 Dec 2009 Gunter Folger (hadr-cross-V09-02-18)
------------------------------------------------------------
- G4TripathiLightCrossSection.cc modified by Macrus Mendenhall:
- re-enable low energy check code, but without creating new instances of
G4TripathiLightCrossSection
2 Dec 2009 Vladimir Ivanchenko (hadr-cross-V09-02-17)
------------------------------------------------------------
- G4CrossSectionDataSetRegistry - more accurate cross section deletion
25 Nov 2009 Gunter Folger (hadr-cross-V09-02-16)
------------------------------------------------------------
- modify upper limit of validity to 100 TeV in
G4NeutronInelasticCrossSection, G4ProtonInelasticCrossSection,
and G4PiNuclearCrossSection
Use constant cross section above original range
23 Nov 2009 Vladimir Ivanchenko (hadr-cross-V09-02-15)
------------------------------------------------------------
- fixed mistake in previous tag
20 Nov 2009 Vladimir Ivanchenko (hadr-cross-V09-02-14)
------------------------------------------------------------
- use as a default hadron-nucleon cross section parameterisation
of Nikolay Starkov in G4GlauberGribovCrossSection,
G4GGNuclNuclCrossSection, G4NeutronElasticXS, G4NeutronInelasticXS,
G4BGGNucleonElasticXS, G4BGGNucleonInelasticXS, G4BGGPionElasticXS,
G4BGGPionInelasticXS
19 Nov 2009 Vladimir Ivanchenko (hadr-cross-V09-02-13)
------------------------------------------------------------
- restored head version of hadr-cross-V09-02-06 for all files, added
bug fixes for G4BGGXX classes and added back new G4NeutronXXXS
cross sections
17 Nov 2009 Mikhail Kosov (hadr-cross-V09-02-12)
------------------------------------------------------------
- CHIPS-cross_sections dependent classes are temporary moved to
source/processes/hadronic/models/chiral_inv_phase_space/xs_dependent
directory (till the beter place for CHIPS physics package is found)
16 Nov 2009 Mikhail Kosov (hadr-cross-V09-02-11)
------------------------------------------------------------
- dependency on CHIPS-cross_sections
12 Nov 2009 Vladimir Ivanchenko (hadr-cross-V09-02-10)
------------------------------------------------------------
- added G4NeutronElasticXS, G4NeutronInelasticXS, G4NeutronCaptureXS
11 Nov 2009 Mikhail Kosov (hadr-cross-V09-02-09)
------------------------------------------------------------
- CHIPS inelastic XS implementation in a form of G4VCrossSectionDataSet
4 Nov 2009 Mikhail Kosov (hadr-cross-V09-02-08)
------------------------------------------------------------
- Resolving of the circular dependency with CHIPS for the previous tag
23 Oct 2009 Mikhail Kosov (hadr-cross-V09-02-07)
------------------------------------------------------------
- in G4GlauberGribovCrossSection, G4GGNuclNuclCrossSection, G4HadronNucleonXsc
the CHIPS hN cross-sections are used directly instead of three times replication
12 Aug 2009 Vladimir Ivanchenko (hadr-cross-V09-02-06)
------------------------------------------------------------
- G4CrossSectionDataSetRegistry - return to more simple variant of
deletion, because of problem for
specific PhysicsLists
08 Aug 2009 Vladimir Ivanchenko (hadr-cross-V09-02-05)
------------------------------------------------------------
- G4TripathiLightIonCrossSection - add simple check that X-section is
positive and remove not optimal control
- G4TripathiCrossSection - added constructor and destructor
- G4CrossSectionDataSetRegistry - use pure stl commands to remove elements
of stl vector
21 March 2009 Vladimir Ivanchenko (hadr-cross-V09-02-04)
------------------------------------------------------------
- G4IonsKoxCrossSection, G4IonsShenCrossSection, G4TripathiCrossSection,
G4TripathiLightCrossSection - added protections against numerical
exceptions (V.Grichine)
- G4GGNuclNuclCrossSection - Glauber-Gribov new cross section for ions
(V.Grichine)
25 February 2009 Vladimir Ivanchenko (hadr-cross-V09-02-03)
------------------------------------------------------------
- G4CrossSectionDataStore - added protection to the Clean method
14 February 2009 Vladimir Ivanchenko (hadr-cross-V09-02-02)
------------------------------------------------------------
- G4CrossSectionDataStore - added Clean method
06 February 2009 Vladimir Ivanchenko (hadr-cross-V09-02-01)
------------------------------------------------------------
24 January 2009 Vladimir Ivanchenko (hadr-cross-V09-02-00)
------------------------------------------------------------
- G4CrossSectionDataStore - moved constructor and destructor to source,
added destruction of data sets, use STL
vector instead of C-array
- G4CrossSectionDataSetRegistry - new singleton to keep pointers to
cross section data sets
- G4VCrossSectiondataSet - constructor and detructor moved to source and
registration/deregistration added
01 December 2008 Vladimir Ivanchenko (hadr-cross-V09-01-07)
------------------------------------------------------------
G4BGGPionElasticXS, G4BGGPionInelasticXS, G4BGGNucleonInelasticXS,
G4BGGNucleonElasticXS, G4UPiNuclearCrossSection - added proper
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGNucleonElasticXS.hh,v 1.2 2008/12/01 16:50:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4BGGNucleonElasticXS.hh,v 1.5 2009/11/19 11:41:30 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGNucleonInelasticXS.hh,v 1.2 2008/12/01 16:50:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4BGGNucleonInelasticXS.hh,v 1.6 2009/11/19 11:44:46 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
@@ -124,7 +124,7 @@ inline
G4bool G4BGGNucleonInelasticXS::IsZAApplicable(const G4DynamicParticle*,
G4double /*Z*/, G4double/* A*/)
{
return true;
return false;
// return (dp->GetDefinition() == particle);
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGPionElasticXS.hh,v 1.2 2008/12/01 16:50:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4BGGPionElasticXS.hh,v 1.5 2009/11/19 11:46:13 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
@@ -124,7 +124,7 @@ inline
G4bool G4BGGPionElasticXS::IsZAApplicable(const G4DynamicParticle*,
G4double /*Z*/, G4double/* A*/)
{
return true;
return false;
// return (dp->GetDefinition() == particle);
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGPionInelasticXS.hh,v 1.2 2008/12/01 16:50:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4BGGPionInelasticXS.hh,v 1.5 2009/11/19 11:47:19 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
@@ -124,7 +124,7 @@ inline
G4bool G4BGGPionInelasticXS::IsZAApplicable(const G4DynamicParticle*,
G4double /*Z*/, G4double/* A*/)
{
return true;
return false;
// return (dp->GetDefinition() == particle);
}
@@ -0,0 +1,82 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4CrossSectionDataSetRegistry.hh,v 1.3 2009/08/08 16:21:31 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4CrossSectionDataSetRegistry
//
// Author V.Ivanchenko 24.01.2009
//
// Modifications:
//
//
// Class Description
// This is a singleton keeping pointers to all cross section data sets
// Class Description - End
#ifndef G4CrossSectionDataSetRegistry_h
#define G4CrossSectionDataSetRegistry_h 1
#include <vector>
#include "globals.hh"
class G4VCrossSectionDataSet;
class G4CrossSectionDataSetRegistry
{
public:
static G4CrossSectionDataSetRegistry* Instance();
// access
~G4CrossSectionDataSetRegistry();
void Register(G4VCrossSectionDataSet*);
//register new cross section
void DeRegister(G4VCrossSectionDataSet*);
//deregister cross section
void Clean();
//clean the store
private:
G4CrossSectionDataSetRegistry();
static G4CrossSectionDataSetRegistry* theInstance;
std::vector <G4VCrossSectionDataSet*> xSections;
};
#endif
@@ -23,6 +23,22 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CrossSectionDataStore.hh,v 1.14 2009/01/24 11:54:47 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4CrossSectionDataStore
//
//
// Modifications:
// 23.01.2009 V.Ivanchenko move constructor and destructor to source,
// use STL vector instead of C-array
//
// Class Description
// This is the class to which cross section data sets may be registered.
// An instance of it is contained in each hadronic process, allowing
@@ -39,6 +55,7 @@
#include "G4Element.hh"
#include "G4Material.hh"
#include "G4VCrossSectionDataSet.hh"
#include <vector>
class G4Nucleus;
@@ -46,57 +63,52 @@ class G4CrossSectionDataStore
{
public:
G4CrossSectionDataStore() :
NDataSetList(0), verboseLevel(0)
{}
G4CrossSectionDataStore();
~G4CrossSectionDataStore()
{}
~G4CrossSectionDataStore();
G4double GetCrossSection(const G4DynamicParticle*,
const G4Element*, G4double aTemperature);
G4double GetCrossSection(const G4DynamicParticle*,
const G4Element*, G4double aTemperature);
G4double GetCrossSection(const G4DynamicParticle*,
const G4Isotope*, G4double aTemperature);
G4double GetCrossSection(const G4DynamicParticle*,
const G4Isotope*, G4double aTemperature);
G4double GetCrossSection(const G4DynamicParticle*,
G4double Z, G4double A, G4double aTemperature);
G4double GetCrossSection(const G4DynamicParticle*,
G4double Z, G4double A, G4double aTemperature);
// to replace GetMicroscopicCrossSection
G4double GetCrossSection(const G4DynamicParticle*, const G4Material*);
// to replace GetMicroscopicCrossSection
G4double GetCrossSection(const G4DynamicParticle*, const G4Material*);
std::pair<G4double/*Z*/, G4double/*A*/>
SelectRandomIsotope(const G4DynamicParticle*, const G4Material*);
//std::pair<G4double/*Z*/, G4double/*A*/>
// SelectRandomIsotope(const G4DynamicParticle*, const G4Material*);
G4Element* SampleZandA(const G4DynamicParticle*, const G4Material*,
G4Nucleus& target);
G4Element* SampleZandA(const G4DynamicParticle*, const G4Material*,
G4Nucleus& target);
void AddDataSet(G4VCrossSectionDataSet*);
void AddDataSet(G4VCrossSectionDataSet*);
void BuildPhysicsTable(const G4ParticleDefinition&);
void BuildPhysicsTable(const G4ParticleDefinition&);
void DumpPhysicsTable(const G4ParticleDefinition&);
void DumpPhysicsTable(const G4ParticleDefinition&);
void SetVerboseLevel(G4int value)
{
verboseLevel = value;
}
inline void SetVerboseLevel(G4int value)
{
verboseLevel = value;
}
G4int GetVerboseLevel()
{
return verboseLevel;
}
inline G4int GetVerboseLevel()
{
return verboseLevel;
}
private:
G4VCrossSectionDataSet* whichDataSetInCharge(const G4DynamicParticle*,
const G4Element*);
G4VCrossSectionDataSet* whichDataSetInCharge(const G4DynamicParticle*,
const G4Element*);
enum { NDataSetMax = 100 };
G4VCrossSectionDataSet* DataSetList[NDataSetMax];
G4int NDataSetList;
G4int verboseLevel;
std::vector<G4VCrossSectionDataSet*> DataSetList;
G4int NDataSetList;
G4int verboseLevel;
};
#endif
@@ -71,6 +71,9 @@ public:
G4double Z, G4double A,
G4double aTemperature = 0.0);
G4double GetCoulombBarier(const G4DynamicParticle*,
G4double Z, G4double A, G4double pR, G4double tR);
virtual
void BuildPhysicsTable(const G4ParticleDefinition&)
{}
@@ -88,31 +91,16 @@ public:
G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, const G4Element*);
G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, G4double At, G4double Zt);
// G4double GetHadronNucleonXscNS(const G4DynamicParticle*, const G4Element*);
// G4double GetHadronNucleonXscNS(const G4DynamicParticle*,G4double At, G4double Zt);
G4double GetHadronNucleonXscNS(G4ParticleDefinition*,G4double pTkin, G4ParticleDefinition*);
// G4double GetHNinelasticXsc(const G4DynamicParticle*, const G4Element*);
// G4double GetHNinelasticXsc(const G4DynamicParticle*, G4double At, G4double Zt);
G4double GetHNinelasticXscVU(const G4DynamicParticle*, G4double At, G4double Zt);
G4double GetHadronNucleonXscMK(G4ParticleDefinition* pParticle, G4double pTkin,
G4ParticleDefinition* nucleon );
G4double CalculateEcmValue ( const G4double , const G4double , const G4double );
G4double CalcMandelstamS( const G4double , const G4double , const G4double );
@@ -97,8 +97,6 @@ public:
G4double GetHNinelasticXsc(const G4DynamicParticle*, const G4Element*);
G4double GetHNinelasticXsc(const G4DynamicParticle*, G4double At, G4double Zt);
G4double GetHNinelasticXscVU(const G4DynamicParticle*, G4double At, G4double Zt);
G4double GetHadronNucleonXscMK(const G4DynamicParticle* aParticle,
const G4ParticleDefinition* nucleon );
G4double CalculateEcmValue ( const G4double , const G4double , const G4double );
@@ -60,9 +60,6 @@ public:
virtual
G4bool IsZAApplicable(const G4DynamicParticle* aDP, G4double Z, G4double A);
virtual
void DumpPhysicsTable(const G4ParticleDefinition&)
{G4cout << "G4HadronNucleonXsc: uses parametrisation"<<G4endl;}
@@ -77,8 +74,6 @@ public:
G4double GetHadronNucleonXscVU(const G4DynamicParticle*, const G4ParticleDefinition*);
G4double GetHadronNucleonXscMK(const G4DynamicParticle*, const G4ParticleDefinition*);
// kinematics and set/get
G4double CalculateEcmValue ( const G4double , const G4double , const G4double );
@@ -0,0 +1,107 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4NeutronCaptureXS.hh,v 1.1 2009/11/12 00:36:01 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4NeutronCaptureXS
//
// Author Ivantchenko, Geant4, 3-AUG-09
//
// Modifications:
//
#ifndef G4NeutronCaptureXS_h
#define G4NeutronCaptureXS_h 1
#include "G4VCrossSectionDataSet.hh"
#include "globals.hh"
class G4DynamicParticle;
class G4ParticleDefinition;
class G4Element;
class G4PhysicsVector;
class G4NeutronCaptureXS : public G4VCrossSectionDataSet
{
public: // With Description
G4int Z;
G4NeutronCaptureXS();
virtual ~G4NeutronCaptureXS();
// The following methods need to be implemented for each new data set.
virtual
G4bool IsApplicable(const G4DynamicParticle*, const G4Element*);
virtual
G4bool IsZAApplicable(const G4DynamicParticle*,
G4double /*Z*/, G4double /*A*/);
virtual
G4double GetCrossSection(const G4DynamicParticle*,
const G4Element*,
G4double aTemperature = 0.);
virtual
void BuildPhysicsTable(const G4ParticleDefinition&);
virtual
void DumpPhysicsTable(const G4ParticleDefinition&);
public: // Without Description
inline void SetVerboseLevel(G4int value)
{
verboseLevel = value;
}
inline G4int GetVerboseLevel()
{
return verboseLevel;
}
private: // Without Description
void Initialise(G4int Z, const char* = 0);
G4NeutronCaptureXS & operator=(const G4NeutronCaptureXS &right);
G4NeutronCaptureXS(const G4NeutronCaptureXS&);
G4double emax;
G4PhysicsVector* data[93];
G4bool isInitialized;
};
#endif
@@ -0,0 +1,109 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4NeutronElasticXS.hh,v 1.3 2009/11/19 11:51:46 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4NeutronElasticXS
//
// Author Ivantchenko, Geant4, 3-AUG-09
//
// Modifications:
//
#ifndef G4NeutronElasticXS_h
#define G4NeutronElasticXS_h 1
#include "G4VCrossSectionDataSet.hh"
#include "globals.hh"
class G4DynamicParticle;
class G4ParticleDefinition;
class G4Element;
class G4PhysicsVector;
class G4GlauberGribovCrossSection;
class G4NeutronElasticXS : public G4VCrossSectionDataSet
{
public: // With Description
G4int Z;
G4NeutronElasticXS();
virtual ~G4NeutronElasticXS();
// The following methods need to be implemented for each new data set.
virtual
G4bool IsApplicable(const G4DynamicParticle*, const G4Element*);
virtual
G4bool IsZAApplicable(const G4DynamicParticle*,
G4double /*Z*/, G4double /*A*/);
virtual
G4double GetCrossSection(const G4DynamicParticle*,
const G4Element*,
G4double aTemperature = 0.);
virtual
void BuildPhysicsTable(const G4ParticleDefinition&);
virtual
void DumpPhysicsTable(const G4ParticleDefinition&);
public: // Without Description
inline void SetVerboseLevel(G4int value)
{
verboseLevel = value;
}
inline G4int GetVerboseLevel()
{
return verboseLevel;
}
private: // Without Description
void Initialise(G4int Z, G4DynamicParticle* dp = 0, const char* = 0);
G4NeutronElasticXS & operator=(const G4NeutronElasticXS &right);
G4NeutronElasticXS(const G4NeutronElasticXS&);
G4GlauberGribovCrossSection* ggXsection;
G4PhysicsVector* data[93];
G4double coeff[93];
G4bool isInitialized;
};
#endif
@@ -25,6 +25,7 @@
//
// 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
//
#ifndef G4NeutronInelasticCrossSection_h
@@ -50,7 +51,7 @@ class G4NeutronInelasticCrossSection : public G4VCrossSectionDataSet
{
G4bool result = false;
if(( aPart->GetDefinition()==G4Neutron::Neutron()) &&
( aPart->GetKineticEnergy()<20*GeV) &&
( aPart->GetKineticEnergy()<100*TeV) &&
aPart->GetKineticEnergy()>19.9*MeV) result = true;
if(aEle->GetZ()<2) result = false;
return result;
@@ -61,7 +62,7 @@ class G4NeutronInelasticCrossSection : public G4VCrossSectionDataSet
{
G4bool result = false;
if(( aPart->GetDefinition() == G4Neutron::Neutron()) &&
( aPart->GetKineticEnergy() < 20*GeV) &&
( aPart->GetKineticEnergy() < 100*TeV) &&
aPart->GetKineticEnergy() > 19.9*MeV) result = true;
if(ZZ < 2) result = false;
return result;
@@ -0,0 +1,109 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4NeutronInelasticXS.hh,v 1.3 2009/11/19 11:52:27 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4NeutronInelasticXS
//
// Author Ivantchenko, Geant4, 3-AUG-09
//
// Modifications:
//
#ifndef G4NeutronInelasticXS_h
#define G4NeutronInelasticXS_h 1
#include "G4VCrossSectionDataSet.hh"
#include "globals.hh"
class G4DynamicParticle;
class G4ParticleDefinition;
class G4Element;
class G4PhysicsVector;
class G4GlauberGribovCrossSection;
class G4NeutronInelasticXS : public G4VCrossSectionDataSet
{
public: // With Description
G4int Z;
G4NeutronInelasticXS();
virtual ~G4NeutronInelasticXS();
// The following methods need to be implemented for each new data set.
virtual
G4bool IsApplicable(const G4DynamicParticle*, const G4Element*);
virtual
G4bool IsZAApplicable(const G4DynamicParticle*,
G4double /*Z*/, G4double /*A*/);
virtual
G4double GetCrossSection(const G4DynamicParticle*,
const G4Element*,
G4double aTemperature = 0.);
virtual
void BuildPhysicsTable(const G4ParticleDefinition&);
virtual
void DumpPhysicsTable(const G4ParticleDefinition&);
public: // Without Description
inline void SetVerboseLevel(G4int value)
{
verboseLevel = value;
}
inline G4int GetVerboseLevel()
{
return verboseLevel;
}
private: // Without Description
void Initialise(G4int Z, G4DynamicParticle* dp = 0, const char* = 0);
G4NeutronInelasticXS & operator=(const G4NeutronInelasticXS &right);
G4NeutronInelasticXS(const G4NeutronInelasticXS&);
G4GlauberGribovCrossSection* ggXsection;
G4PhysicsVector* data[93];
G4double coeff[93];
G4bool isInitialized;
};
#endif
@@ -47,7 +47,7 @@ class G4PiNuclearCrossSection : public G4VCrossSectionDataSet
if(aParticle->GetDefinition() == G4PionMinus::PionMinus()) result=true;
if(aParticle->GetDefinition() == G4PionPlus::PionPlus()) result=true;
if(G4lrint(anElement->GetZ()) == 1) result = false;
if(aParticle->GetKineticEnergy() > 999.9*GeV) result=false;
if(aParticle->GetKineticEnergy() > 99.9*TeV) result=false;
return result;
}
@@ -58,7 +58,7 @@ class G4PiNuclearCrossSection : public G4VCrossSectionDataSet
if(particle->GetDefinition() == G4PionMinus::PionMinus()) result=true;
if(particle->GetDefinition() == G4PionPlus::PionPlus()) result=true;
if(G4lrint(ZZ) == 1) result = false;
if(particle->GetKineticEnergy() > 999.9*GeV) result=false;
if(particle->GetKineticEnergy() > 99.9*TeV) result=false;
return result;
}
@@ -26,6 +26,7 @@
// 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
//
#ifndef G4ProtonInelasticCrossSection_h
@@ -55,7 +56,7 @@ class G4ProtonInelasticCrossSection : public G4VCrossSectionDataSet
{
G4bool result = false;
if(( aPart->GetDefinition()==G4Proton::Proton()) &&
( aPart->GetKineticEnergy()<1*TeV) ) result = true;
( aPart->GetKineticEnergy()<100*TeV) ) result = true;
if(aEle->GetZ()<3) result = false;
return result;
}
@@ -65,7 +66,7 @@ class G4ProtonInelasticCrossSection : public G4VCrossSectionDataSet
{
G4bool result = false;
if (( aParticle->GetDefinition() == G4Proton::Proton()) &&
( aParticle->GetKineticEnergy() < 1*TeV) ) result = true;
( aParticle->GetKineticEnergy() < 100*TeV) ) result = true;
if (ZZ < 3) result = false;
return result;
}
@@ -42,6 +42,9 @@ class G4TripathiCrossSection : public G4VCrossSectionDataSet
{
public:
G4TripathiCrossSection();
~G4TripathiCrossSection();
virtual
G4bool IsApplicable(const G4DynamicParticle* aPart, const G4Element*)
{
@@ -23,9 +23,22 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VCrossSectionDataSet.hh,v 1.13 2009/01/24 11:54:47 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// GEANT4 physics abstract class: G4VCrossSectionData -- header file
// F.W. Jones, TRIUMF, 20-JAN-97
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4VCrossSectionDataSet
//
// Author F.W. Jones, TRIUMF, 20-JAN-97
//
// Modifications:
// 23.01.2009 V.Ivanchenko move constructor and destructor to source
//
//
// Class Description
// This is a base class for hadronic cross section data sets. Users may
@@ -42,58 +55,53 @@
class G4VCrossSectionDataSet
{
public:
G4VCrossSectionDataSet() :
verboseLevel(0)
{}
virtual ~G4VCrossSectionDataSet()
{}
public: //with description
// The following methods need to be implemented for each new data set.
virtual
G4bool IsApplicable(const G4DynamicParticle*, const G4Element*) = 0;
G4VCrossSectionDataSet();
virtual
G4bool IsZAApplicable(const G4DynamicParticle*, G4double /*Z*/, G4double /*A*/);
virtual ~G4VCrossSectionDataSet();
virtual
G4double GetCrossSection(const G4DynamicParticle*,
const G4Element*,
G4double aTemperature = 0.) = 0;
// The following methods need to be implemented for each new data set.
virtual
G4bool IsApplicable(const G4DynamicParticle*, const G4Element*) = 0;
virtual
G4double GetIsoCrossSection(const G4DynamicParticle*, const G4Isotope*,
G4double aTemperature = 0.);
virtual
G4bool IsZAApplicable(const G4DynamicParticle*, G4double /*Z*/, G4double /*A*/);
virtual
G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double /*Z*/,
G4double /*A*/, G4double aTemperature = 0.);
virtual
G4double GetCrossSection(const G4DynamicParticle*,
const G4Element*,
G4double aTemperature = 0.) = 0;
virtual
void BuildPhysicsTable(const G4ParticleDefinition&) = 0;
virtual
G4double GetIsoCrossSection(const G4DynamicParticle*, const G4Isotope*,
G4double aTemperature = 0.);
virtual
void DumpPhysicsTable(const G4ParticleDefinition&) = 0;
virtual
G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double /*Z*/,
G4double /*A*/, G4double aTemperature = 0.);
virtual
void BuildPhysicsTable(const G4ParticleDefinition&) = 0;
virtual
void DumpPhysicsTable(const G4ParticleDefinition&) = 0;
public: // Without Description
void SetVerboseLevel(G4int value)
{
verboseLevel = value;
}
inline void SetVerboseLevel(G4int value)
{
verboseLevel = value;
}
G4int GetVerboseLevel()
{
return verboseLevel;
}
inline G4int GetVerboseLevel()
{
return verboseLevel;
}
protected:
G4int verboseLevel;
G4int verboseLevel;
};
#endif
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGNucleonElasticXS.cc,v 1.3 2008/12/01 16:50:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4BGGNucleonElasticXS.cc,v 1.7 2009/11/19 19:40:45 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
@@ -92,15 +92,12 @@ G4double G4BGGNucleonElasticXS::GetIsoZACrossSection(const G4DynamicParticle* dp
} else if(iz == 1) {
if( A < 1.5) {
//fHadron->GetHadronNucleonXscPDG(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscEL(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
fHadron->GetHadronNucleonXscMK(dp, G4Proton::Proton());
fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
cross = fHadron->GetElasticHadronNucleonXsc();
} else {
fHadron->GetHadronNucleonXscMK(dp, G4Proton::Proton());
fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
cross = fHadron->GetElasticHadronNucleonXsc();
fHadron->GetHadronNucleonXscMK(dp, G4Neutron::Neutron());
fHadron->GetHadronNucleonXscNS(dp, G4Neutron::Neutron());
cross += fHadron->GetElasticHadronNucleonXsc();
}
} else if(ekin > fGlauberEnergy) {
@@ -179,7 +176,7 @@ void G4BGGNucleonElasticXS::Initialise()
<< " factor= " << theGlauberFac[iz] << G4endl;
}
dp.SetKineticEnergy(fLowEnergy);
fHadron->GetHadronNucleonXscMK(&dp, G4Proton::Proton());
fHadron->GetHadronNucleonXscNS(&dp, G4Proton::Proton());
theCoulombFac[1] = fHadron->GetElasticHadronNucleonXsc();
if(isProton) { theCoulombFac[1] /= CoulombFactor(fLowEnergy, 1.0); }
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGNucleonInelasticXS.cc,v 1.3 2008/12/01 16:50:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4BGGNucleonInelasticXS.cc,v 1.7 2009/11/19 19:40:45 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
@@ -90,16 +90,12 @@ G4double G4BGGNucleonInelasticXS::GetIsoZACrossSection(const G4DynamicParticle*
cross = theCoulombFac[iz]*CoulombFactor(ekin, A);
} else if(iz == 1) {
if( A < 1.5) {
//fHadron->GetHadronNucleonXscPDG(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscEL(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscVU(dp, G4Proton::Proton());
fHadron->GetHadronNucleonXscMK(dp, G4Proton::Proton());
fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
cross = fHadron->GetInelasticHadronNucleonXsc();
} else {
fHadron->GetHadronNucleonXscMK(dp, G4Proton::Proton());
fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
cross = fHadron->GetInelasticHadronNucleonXsc();
fHadron->GetHadronNucleonXscMK(dp, G4Neutron::Neutron());
fHadron->GetHadronNucleonXscNS(dp, G4Neutron::Neutron());
cross += fHadron->GetInelasticHadronNucleonXsc();
}
} else if(ekin > fGlauberEnergy) {
@@ -179,7 +175,7 @@ void G4BGGNucleonInelasticXS::Initialise()
<< " factor= " << theGlauberFac[iz] << G4endl;
}
dp.SetKineticEnergy(fLowEnergy);
fHadron->GetHadronNucleonXscMK(&dp, G4Proton::Proton());
fHadron->GetHadronNucleonXscNS(&dp, G4Proton::Proton());
theCoulombFac[1] =
fHadron->GetInelasticHadronNucleonXsc()/CoulombFactor(fLowEnergy,1.0);
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGPionElasticXS.cc,v 1.3 2008/12/01 16:50:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4BGGPionElasticXS.cc,v 1.7 2009/11/19 19:40:45 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
@@ -92,11 +92,7 @@ G4double G4BGGPionElasticXS::GetIsoZACrossSection(const G4DynamicParticle* dp,
} else if(iz == 1) {
if( A < 1.5) {
//fHadron->GetHadronNucleonXscPDG(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscEL(dp, G4Proton::Proton());
fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscVU(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscMK(dp, G4Proton::Proton());
cross = fHadron->GetElasticHadronNucleonXsc();
} else {
fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGPionInelasticXS.cc,v 1.3 2008/12/01 16:50:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4BGGPionInelasticXS.cc,v 1.8 2009/11/19 19:40:45 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
@@ -93,11 +93,7 @@ G4double G4BGGPionInelasticXS::GetIsoZACrossSection(const G4DynamicParticle* dp,
} else if(iz == 1) {
if( A < 1.5) {
//fHadron->GetHadronNucleonXscPDG(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscEL(dp, G4Proton::Proton());
fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscVU(dp, G4Proton::Proton());
//fHadron->GetHadronNucleonXscMK(dp, G4Proton::Proton());
cross = fHadron->GetInelasticHadronNucleonXsc();
} else {
fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
@@ -0,0 +1,106 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4CrossSectionDataSetRegistry.cc,v 1.6 2009/12/02 15:59:59 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4CrossSectionDataSetRegistry
//
// Author V.Ivanchenko 24.01.2009
//
// Modifications:
//
#include "G4CrossSectionDataSetRegistry.hh"
#include "G4VCrossSectionDataSet.hh"
G4CrossSectionDataSetRegistry* G4CrossSectionDataSetRegistry::theInstance = 0;
G4CrossSectionDataSetRegistry* G4CrossSectionDataSetRegistry::Instance()
{
if(0 == theInstance) {
static G4CrossSectionDataSetRegistry manager;
theInstance = &manager;
}
return theInstance;
}
G4CrossSectionDataSetRegistry::G4CrossSectionDataSetRegistry()
{}
G4CrossSectionDataSetRegistry::~G4CrossSectionDataSetRegistry()
{
Clean();
}
void G4CrossSectionDataSetRegistry::Clean()
{
size_t n = xSections.size();
if(n > 0) {
for (size_t i=0; i<n; ++i) {
if(xSections[i]) {
G4VCrossSectionDataSet* p = xSections[i];
xSections[i] = 0;
delete p;
}
}
xSections.clear();
}
}
void G4CrossSectionDataSetRegistry::Register(G4VCrossSectionDataSet* p)
{
if(!p) return;
size_t n = xSections.size();
if(n > 0) {
for (size_t i=0; i<n; ++i) {
if(xSections[i] == p) { return; }
}
}
xSections.push_back(p);
}
void G4CrossSectionDataSetRegistry::DeRegister(G4VCrossSectionDataSet* p)
{
if(!p) return;
size_t n = xSections.size();
if(n > 0) {
for (size_t i=0; i<n; ++i) {
if(xSections[i] == p) {
xSections[i] = 0;
if(i == n-1) { xSections.pop_back(); }
return;
}
}
}
}
@@ -23,6 +23,20 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CrossSectionDataStore.cc,v 1.16 2009/01/24 11:54:47 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4CrossSectionDataStore
//
//
// Modifications:
// 23.01.2009 V.Ivanchenko add destruction of data sets
//
//
#include "G4CrossSectionDataStore.hh"
@@ -32,6 +46,12 @@
#include "Randomize.hh"
#include "G4Nucleus.hh"
G4CrossSectionDataStore::G4CrossSectionDataStore() :
NDataSetList(0), verboseLevel(0)
{}
G4CrossSectionDataStore::~G4CrossSectionDataStore()
{}
G4double
G4CrossSectionDataStore::GetCrossSection(const G4DynamicParticle* aParticle,
@@ -391,7 +411,6 @@ G4Element* G4CrossSectionDataStore::SampleZandA(const G4DynamicParticle* particl
target.SetParameters(AA, ZZ);
return anElement;
}
*/
std::pair<G4double, G4double>
G4CrossSectionDataStore::SelectRandomIsotope(const G4DynamicParticle* particle,
@@ -512,35 +531,24 @@ G4CrossSectionDataStore::SelectRandomIsotope(const G4DynamicParticle* particle,
}
return std::pair<G4double, G4double>(ZZ, AA);
}
*/
void
G4CrossSectionDataStore::AddDataSet(G4VCrossSectionDataSet* aDataSet)
{
if (NDataSetList == NDataSetMax) {
G4cout << "WARNING: G4CrossSectionDataStore::AddDataSet: "<<G4endl;
G4cout << " reached maximum number of data sets";
G4cout << " data set not added !!!!!!!!!!!!!!!!";
return;
}
DataSetList[NDataSetList] = aDataSet;
NDataSetList++;
DataSetList.push_back(aDataSet);
NDataSetList++;
}
void
G4CrossSectionDataStore::
BuildPhysicsTable(const G4ParticleDefinition& aParticleType)
{
if (NDataSetList == 0)
{
G4Exception("G4CrossSectionDataStore", "007", FatalException,
"BuildPhysicsTable: no data sets registered");
return;
}
for (G4int i = NDataSetList-1; i >= 0; i--) {
if(NDataSetList > 0) {
for (G4int i=0; i<NDataSetList; i++) {
DataSetList[i]->BuildPhysicsTable(aParticleType);
}
}
}
}
@@ -548,11 +556,12 @@ void
G4CrossSectionDataStore::
DumpPhysicsTable(const G4ParticleDefinition& aParticleType)
{
if (NDataSetList == 0) {
G4cout << "WARNING - G4CrossSectionDataStore::DumpPhysicsTable: no data sets registered"<<G4endl;
return;
}
for (G4int i = NDataSetList-1; i >= 0; i--) {
DataSetList[i]->DumpPhysicsTable(aParticleType);
}
if (NDataSetList == 0) {
G4cout << "WARNING - G4CrossSectionDataStore::DumpPhysicsTable: "
<< " no data sets registered"<<G4endl;
return;
}
for (G4int i = NDataSetList-1; i >= 0; i--) {
DataSetList[i]->DumpPhysicsTable(aParticleType);
}
}
@@ -41,7 +41,7 @@
G4GGNuclNuclCrossSection::G4GGNuclNuclCrossSection()
: fUpperLimit( 100000 * GeV ),
fLowerLimit( 0.1 * GeV ),
fLowerLimit( 0.1 * MeV ),
fRadiusConst( 1.08*fermi ) // 1.1, 1.3 ?
{
theProton = G4Proton::Proton();
@@ -114,7 +114,7 @@ GetCrossSection(const G4DynamicParticle* aParticle, const G4Element* anElement,
G4double G4GGNuclNuclCrossSection::
GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double tZ, G4double tA, G4double)
{
G4double xsection, sigma, cofInelastic = 2.4, cofTotal = 2.0, nucleusSquare, ratio;
G4double xsection, sigma, cofInelastic = 2.4, cofTotal = 2.0, nucleusSquare, cB, ratio;
G4double pZ = aParticle->GetDefinition()->GetPDGCharge();
G4double pA = aParticle->GetDefinition()->GetBaryonNumber();
@@ -131,39 +131,100 @@ GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double tZ, G4double t
G4double tR = GetNucleusRadius(tA);
G4double pR = GetNucleusRadius(pA);
sigma = (pZ*tZ+pN*tN)*GetHadronNucleonXscNS(theProton, pTkin, theProton) +
cB = GetCoulombBarier(aParticle, tZ, tA, pR, tR);
if(cB > 0.)
{
sigma = (pZ*tZ+pN*tN)*GetHadronNucleonXscNS(theProton, pTkin, theProton) +
(pZ*tN+pN*tZ)*GetHadronNucleonXscNS(theProton, pTkin, theNeutron);
nucleusSquare = cofTotal*pi*( pR*pR + tR*tR ); // basically 2piRR
nucleusSquare = cofTotal*pi*( pR*pR + tR*tR ); // basically 2piRR
ratio = sigma/nucleusSquare;
ratio = sigma/nucleusSquare;
xsection = nucleusSquare*std::log( 1. + ratio );
xsection = nucleusSquare*std::log( 1. + ratio );
fTotalXsc = xsection;
fTotalXsc = xsection;
fInelasticXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fTotalXsc *= cB;
fElasticXsc = fTotalXsc - fInelasticXsc;
G4double difratio = ratio/(1.+ratio);
fInelasticXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fDiffractionXsc = 0.5*nucleusSquare*( difratio - std::log( 1. + difratio ) );
fInelasticXsc *= cB;
// production to be checked !!! edit MK xsc
fElasticXsc = fTotalXsc - fInelasticXsc;
sigma = (pZ*tZ+pN*tN)*GetHadronNucleonXscMK(theProton, pTkin, theProton) +
(pZ*tN+pN*tZ)*GetHadronNucleonXscMK(theProton, pTkin, theNeutron);
// if (fElasticXsc < DBL_MIN) fElasticXsc = DBL_MIN;
/*
G4double difratio = ratio/(1.+ratio);
fDiffractionXsc = 0.5*nucleusSquare*( difratio - std::log( 1. + difratio ) );
*/
// production to be checked !!! edit MK xsc
//sigma = (pZ*tZ+pN*tN)*GetHadronNucleonXscMK(theProton, pTkin, theProton) +
// (pZ*tN+pN*tZ)*GetHadronNucleonXscMK(theProton, pTkin, theNeutron);
sigma = (pZ*tZ+pN*tN)*GetHadronNucleonXscNS(theProton, pTkin, theProton) +
(pZ*tN+pN*tZ)*GetHadronNucleonXscNS(theProton, pTkin, theNeutron);
ratio = sigma/nucleusSquare;
ratio = sigma/nucleusSquare;
fProductionXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fProductionXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
if (fElasticXsc < 0.) fElasticXsc = 0.;
return xsection;
if (fElasticXsc < 0.) fElasticXsc = 0.;
}
else
{
fInelasticXsc = 0.;
fTotalXsc = 0.;
fElasticXsc = 0.;
fProductionXsc = 0.;
}
return fInelasticXsc; // xsection;
}
////////////////////////////////////////////////////////////////////////////////////////
//
//
G4double G4GGNuclNuclCrossSection::
GetCoulombBarier(const G4DynamicParticle* aParticle, G4double tZ, G4double tA, G4double pR, G4double tR)
{
G4double ratio;
G4double pZ = aParticle->GetDefinition()->GetPDGCharge();
G4double pTkin = aParticle->GetKineticEnergy();
// G4double pPlab = aParticle->GetTotalMomentum();
G4double pM = aParticle->GetDefinition()->GetPDGMass();
// G4double tM = tZ*proton_mass_c2 + (tA-tZ)*neutron_mass_c2; // ~ 1% accuracy
G4double tM = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass( G4int(tZ), G4int(tA) );
G4double pElab = pTkin + pM;
G4double totEcm = std::sqrt(pM*pM + tM*tM + 2.*pElab*tM);
// G4double pPcm = pPlab*tM/totEcm;
// G4double pTcm = std::sqrt(pM*pM + pPcm*pPcm) - pM;
G4double totTcm = totEcm - pM -tM;
G4double bC = fine_structure_const*hbarc*pZ*tZ;
bC /= pR + tR;
bC /= 2.; // 4., 2. parametrisation cof ??? vmg
// G4cout<<"pTkin = "<<pTkin/GeV<<"; pPlab = "
// <<pPlab/GeV<<"; bC = "<<bC/GeV<<"; pTcm = "<<pTcm/GeV<<G4endl;
if( totTcm <= bC ) ratio = 0.;
else ratio = 1. - bC/totTcm;
// if(ratio < DBL_MIN) ratio = DBL_MIN;
if( ratio < 0.) ratio = 0.;
// G4cout <<"ratio = "<<ratio<<G4endl;
return ratio;
}
//////////////////////////////////////////////////////////////////////////
//
// Return single-diffraction/inelastic cross-section ratio
@@ -529,8 +590,8 @@ G4GGNuclNuclCrossSection::GetHNinelasticXsc(const G4DynamicParticle* aParticle,
if(Nt < 0.) Nt = 0.;
sumInelastic = Zt*GetHadronNucleonXscMK(aParticle, theProton);
sumInelastic += Nt*GetHadronNucleonXscMK(aParticle, theNeutron);
sumInelastic = Zt*GetHadronNucleonXscNS(aParticle, theProton);
sumInelastic += Nt*GetHadronNucleonXscNS(aParticle, theNeutron);
return sumInelastic;
}
@@ -595,136 +656,6 @@ G4GGNuclNuclCrossSection::GetHNinelasticXscVU(const G4DynamicParticle* aParticle
return Xinelastic*= millibarn;
}
/////////////////////////////////////////////////////////////////////////////////////
//
// Returns hadron-nucleon cross-section based on Mikhail Kossov CHIPS parametrisation of
// data from G4QuasiFreeRatios class
G4double
G4GGNuclNuclCrossSection::GetHadronNucleonXscMK(G4ParticleDefinition* pParticle, G4double pTkin,
G4ParticleDefinition* nucleon )
{
G4int I = -1;
G4int PDG = pParticle->GetPDGEncoding();
G4double totalXsc = 0;
G4double elasticXsc = 0;
G4double inelasticXsc;
// G4int absPDG = std::abs(PDG);
G4double pM = pParticle->GetPDGMass();
G4double p = std::sqrt(pTkin*(pTkin+2*pM))/GeV;
G4bool F = false;
if(nucleon == theProton) F = true;
else if(nucleon == theNeutron) F = false;
else
{
G4cout << "nucleon is not proton or neutron, return xsc for proton" << G4endl;
F = true;
}
G4bool kfl = true; // Flag of K0/aK0 oscillation
G4bool kf = false;
if( PDG == 130 || PDG == 310 )
{
kf = true;
if( G4UniformRand() > .5 ) kfl = false;
}
if ( (PDG == 2212 && F) || (PDG == 2112 && !F) ) I = 0; // pp/nn
else if( (PDG == 2112 && F) || (PDG == 2212 && !F) ) I = 1; // np/pn
else
{
G4cout<<"MK PDG = "<<PDG
<<", while it is defined only for p,n,hyperons,anti-baryons,pi,K/antiK"<<G4endl;
G4Exception("G4QuasiFreeRatio::FetchElTot:","22",FatalException,"CHIPScrash");
}
// Each parameter set can have not more than nPoints = 128 parameters
static const G4double lmi = 3.5; // min of (lnP-lmi)^2 parabola
static const G4double pbe = .0557; // elastic (lnP-lmi)^2 parabola coefficient
static const G4double pbt = .3; // total (lnP-lmi)^2 parabola coefficient
static const G4double pmi = .1; // Below that fast LE calculation is made
static const G4double pma = 1000.; // Above that fast HE calculation is made
if( p <= 0.)
{
G4cout<<" p = "<<p<<" is zero or negative"<<G4endl;
elasticXsc = 0.;
inelasticXsc = 0.;
totalXsc = 0.;
return totalXsc;
}
if (!I) // pp/nn
{
if( p < pmi )
{
G4double p2 = p*p;
elasticXsc = 1./(.00012 + p2*.2);
totalXsc = elasticXsc;
}
else if(p>pma)
{
G4double lp = std::log(p)-lmi;
G4double lp2 = lp*lp;
elasticXsc = pbe*lp2 + 6.72;
totalXsc = pbt*lp2 + 38.2;
}
else
{
G4double p2 = p*p;
G4double LE = 1./( .00012 + p2*.2);
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
G4double rp2 = 1./p2;
elasticXsc = LE + ( pbe*lp2 + 6.72+32.6/p)/( 1. + rp2/p);
totalXsc = LE + ( pbt*lp2 + 38.2+52.7*rp2)/( 1. + 2.72*rp2*rp2);
}
}
else if( I==1 ) // np/pn
{
if( p < pmi )
{
G4double p2 = p*p;
elasticXsc = 1./( .00012 + p2*( .051 + .1*p2));
totalXsc = elasticXsc;
}
else if( p > pma )
{
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
elasticXsc = pbe*lp2 + 6.72;
totalXsc = pbt*lp2 + 38.2;
}
else
{
G4double p2 = p*p;
G4double LE = 1./( .00012 + p2*( .051 + .1*p2 ) );
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
G4double rp2 = 1./p2;
elasticXsc = LE + (pbe*lp2 + 6.72 + 30./p)/( 1. + .49*rp2/p);
totalXsc = LE + (pbt*lp2 + 38.2)/( 1. + .54*rp2*rp2);
}
}
else
{
G4cout<<"PDG incoding = "<<I<<" is not defined (0-1)"<<G4endl;
}
if( elasticXsc > totalXsc ) elasticXsc = totalXsc;
totalXsc *= millibarn;
elasticXsc *= millibarn;
inelasticXsc = totalXsc - elasticXsc;
if (inelasticXsc < 0.) inelasticXsc = 0.;
return inelasticXsc;
}
////////////////////////////////////////////////////////////////////////////////////
//
//
@@ -881,16 +812,9 @@ G4GGNuclNuclCrossSection::GetNucleusRadiusDE(G4double A)
R = r0*std::pow(A, 0.27);
}
return R;
}
////////////////////////////////////////////////////////////////////////////////////
//
//
@@ -354,7 +354,7 @@ GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double Z, G4double A,
}
else
{
sigma = GetHadronNucleonXscPDG(aParticle, A, Z);
sigma = GetHadronNucleonXscNS(aParticle, A, Z);
cofInelastic = 2.2;
cofTotal = 2.0;
}
@@ -417,7 +417,7 @@ GetRatioSD(const G4DynamicParticle* aParticle, G4double A, G4double Z)
}
else
{
sigma = GetHadronNucleonXscPDG(aParticle, A, Z);
sigma = GetHadronNucleonXscNS(aParticle, A, Z);
cofInelastic = 2.2;
cofTotal = 2.0;
}
@@ -459,7 +459,7 @@ GetRatioQE(const G4DynamicParticle* aParticle, G4double A, G4double Z)
}
else
{
sigma = GetHadronNucleonXscPDG(aParticle, A, Z);
sigma = GetHadronNucleonXscNS(aParticle, A, Z);
cofInelastic = 2.2;
cofTotal = 2.0;
}
@@ -1069,8 +1069,10 @@ G4GlauberGribovCrossSection::GetHNinelasticXsc(const G4DynamicParticle* aParticl
}
else
{
sumInelastic = Zt*GetHadronNucleonXscMK(aParticle, theProton);
sumInelastic += Nt*GetHadronNucleonXscMK(aParticle, theNeutron);
//sumInelastic = Zt*GetHadronNucleonXscMK(aParticle, theProton);
// sumInelastic += Nt*GetHadronNucleonXscMK(aParticle, theNeutron);
sumInelastic = Zt*GetHadronNucleonXscNS(aParticle, 1.0, 1.0);
sumInelastic += Nt*GetHadronNucleonXscNS(aParticle, 1.0, 0.0);
}
return sumInelastic;
}
@@ -1288,324 +1290,6 @@ G4GlauberGribovCrossSection::GetHNinelasticXscVU(const G4DynamicParticle* aParti
return Xinelastic*= millibarn;
}
/////////////////////////////////////////////////////////////////////////////////////
//
// Returns hadron-nucleon cross-section based on Mikhail Kossov CHIPS parametrisation of
// data from G4QuasiFreeRatios class
G4double
G4GlauberGribovCrossSection::GetHadronNucleonXscMK(const G4DynamicParticle* aParticle,
const G4ParticleDefinition* nucleon )
{
G4int I = -1;
G4int PDG = aParticle->GetDefinition()->GetPDGEncoding();
G4double totalXsc = 0;
G4double elasticXsc = 0;
G4double inelasticXsc;
// G4int absPDG = std::abs(PDG);
G4double p = aParticle->GetMomentum().mag()/GeV;
G4bool F = false;
if(nucleon == theProton) F = true;
else if(nucleon == theNeutron) F = false;
else
{
G4cout << "nucleon is not proton or neutron, return xsc for proton" << G4endl;
F = true;
}
G4bool kfl = true; // Flag of K0/aK0 oscillation
G4bool kf = false;
if( PDG == 130 || PDG == 310 )
{
kf = true;
if( G4UniformRand() > .5 ) kfl = false;
}
if ( (PDG == 2212 && F) || (PDG == 2112 && !F) ) I = 0; // pp/nn
else if( (PDG == 2112 && F) || (PDG == 2212 && !F) ) I = 1; // np/pn
else if( (PDG == -211 && F) || (PDG == 211 && !F) ) I = 2; // pimp/pipn
else if( (PDG == 211 && F) || (PDG ==-211 && !F) ) I = 3; // pipp/pimn
else if( PDG == -321 || PDG == -311 || ( kf && !kfl ) ) I = 4; // KmN/K0N
else if( PDG == 321 || PDG == 311 || ( kf && kfl ) ) I = 5; // KpN/aK0N
else if( PDG > 3000 && PDG < 3335) I = 6; // @@ for all hyperons - take Lambda
else if( PDG < -2000 && PDG > -3335) I = 7; // @@ for all anti-baryons - anti-p/anti-n
else
{
G4cout<<"MK PDG = "<<PDG
<<", while it is defined only for p,n,hyperons,anti-baryons,pi,K/antiK"<<G4endl;
G4Exception("G4QuasiFreeRatio::FetchElTot:","22",FatalException,"CHIPScrash");
}
// Each parameter set can have not more than nPoints = 128 parameters
static const G4double lmi = 3.5; // min of (lnP-lmi)^2 parabola
static const G4double pbe = .0557; // elastic (lnP-lmi)^2 parabola coefficient
static const G4double pbt = .3; // total (lnP-lmi)^2 parabola coefficient
static const G4double pmi = .1; // Below that fast LE calculation is made
static const G4double pma = 1000.; // Above that fast HE calculation is made
if( p <= 0.)
{
G4cout<<" p = "<<p<<" is zero or negative"<<G4endl;
elasticXsc = 0.;
inelasticXsc = 0.;
totalXsc = 0.;
return totalXsc;
}
if (!I) // pp/nn
{
if( p < pmi )
{
G4double p2 = p*p;
elasticXsc = 1./(.00012 + p2*.2);
totalXsc = elasticXsc;
}
else if(p>pma)
{
G4double lp = std::log(p)-lmi;
G4double lp2 = lp*lp;
elasticXsc = pbe*lp2 + 6.72;
totalXsc = pbt*lp2 + 38.2;
}
else
{
G4double p2 = p*p;
G4double LE = 1./( .00012 + p2*.2);
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
G4double rp2 = 1./p2;
elasticXsc = LE + ( pbe*lp2 + 6.72+32.6/p)/( 1. + rp2/p);
totalXsc = LE + ( pbt*lp2 + 38.2+52.7*rp2)/( 1. + 2.72*rp2*rp2);
}
}
else if( I==1 ) // np/pn
{
if( p < pmi )
{
G4double p2 = p*p;
elasticXsc = 1./( .00012 + p2*( .051 + .1*p2));
totalXsc = elasticXsc;
}
else if( p > pma )
{
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
elasticXsc = pbe*lp2 + 6.72;
totalXsc = pbt*lp2 + 38.2;
}
else
{
G4double p2 = p*p;
G4double LE = 1./( .00012 + p2*( .051 + .1*p2 ) );
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
G4double rp2 = 1./p2;
elasticXsc = LE + (pbe*lp2 + 6.72 + 30./p)/( 1. + .49*rp2/p);
totalXsc = LE + (pbt*lp2 + 38.2)/( 1. + .54*rp2*rp2);
}
}
else if( I == 2 ) // pimp/pipn
{
G4double lp = std::log(p);
if(p<pmi)
{
G4double lr = lp + 1.27;
elasticXsc = 1.53/( lr*lr + .0676);
totalXsc = elasticXsc*3;
}
else if( p > pma )
{
G4double ld = lp - lmi;
G4double ld2 = ld*ld;
G4double sp = std::sqrt(p);
elasticXsc = pbe*ld2 + 2.4 + 7./sp;
totalXsc = pbt*ld2 + 22.3 + 12./sp;
}
else
{
G4double lr = lp + 1.27;
G4double LE = 1.53/( lr*lr + .0676);
G4double ld = lp - lmi;
G4double ld2 = ld*ld;
G4double p2 = p*p;
G4double p4 = p2*p2;
G4double sp = std::sqrt(p);
G4double lm = lp + .36;
G4double md = lm*lm + .04;
G4double lh = lp - .017;
G4double hd = lh*lh + .0025;
elasticXsc = LE + (pbe*ld2 + 2.4 + 7./sp)/( 1. + .7/p4) + .6/md + .05/hd;
totalXsc = LE*3 + (pbt*ld2 + 22.3 + 12./sp)/(1. + .4/p4) + 1./md + .06/hd;
}
}
else if( I == 3 ) // pipp/pimn
{
G4double lp = std::log(p);
if( p < pmi )
{
G4double lr = lp + 1.27;
G4double lr2 = lr*lr;
elasticXsc = 13./( lr2 + lr2*lr2 + .0676);
totalXsc = elasticXsc;
}
else if( p > pma )
{
G4double ld = lp - lmi;
G4double ld2 = ld*ld;
G4double sp = std::sqrt(p);
elasticXsc = pbe*ld2 + 2.4 + 6./sp;
totalXsc = pbt*ld2 + 22.3 + 5./sp;
}
else
{
G4double lr = lp + 1.27;
G4double lr2 = lr*lr;
G4double LE = 13./(lr2 + lr2*lr2 + .0676);
G4double ld = lp - lmi;
G4double ld2 = ld*ld;
G4double p2 = p*p;
G4double p4 = p2*p2;
G4double sp = std::sqrt(p);
G4double lm = lp - .32;
G4double md = lm*lm + .0576;
elasticXsc = LE + (pbe*ld2 + 2.4 + 6./sp)/(1. + 3./p4) + .7/md;
totalXsc = LE + (pbt*ld2 + 22.3 + 5./sp)/(1. + 1./p4) + .8/md;
}
}
else if( I == 4 ) // Kmp/Kmn/K0p/K0n
{
if( p < pmi)
{
G4double psp = p*std::sqrt(p);
elasticXsc = 5.2/psp;
totalXsc = 14./psp;
}
else if( p > pma )
{
G4double ld = std::log(p) - lmi;
G4double ld2 = ld*ld;
elasticXsc = pbe*ld2 + 2.23;
totalXsc = pbt*ld2 + 19.5;
}
else
{
G4double ld = std::log(p) - lmi;
G4double ld2 = ld*ld;
G4double sp = std::sqrt(p);
G4double psp = p*sp;
G4double p2 = p*p;
G4double p4 = p2*p2;
G4double lm = p - .39;
G4double md = lm*lm + .000156;
G4double lh = p - 1.;
G4double hd = lh*lh + .0156;
elasticXsc = 5.2/psp + (pbe*ld2 + 2.23)/(1. - .7/sp + .075/p4) + .004/md + .15/hd;
totalXsc = 14./psp + (pbt*ld2 + 19.5)/(1. - .21/sp + .52/p4) + .006/md + .30/hd;
}
}
else if( I == 5 ) // Kpp/Kpn/aKp/aKn
{
if( p < pmi )
{
G4double lr = p - .38;
G4double lm = p - 1.;
G4double md = lm*lm + .372;
elasticXsc = .7/(lr*lr + .0676) + 2./md;
totalXsc = elasticXsc + .6/md;
}
else if( p > pma )
{
G4double ld = std::log(p) - lmi;
G4double ld2 = ld*ld;
elasticXsc = pbe*ld2 + 2.23;
totalXsc = pbt*ld2 + 19.5;
}
else
{
G4double ld = std::log(p) - lmi;
G4double ld2 = ld*ld;
G4double lr = p - .38;
G4double LE = .7/(lr*lr + .0676);
G4double sp = std::sqrt(p);
G4double p2 = p*p;
G4double p4 = p2*p2;
G4double lm = p - 1.;
G4double md = lm*lm + .372;
elasticXsc = LE + (pbe*ld2 + 2.23)/(1. - .7/sp + .1/p4) + 2./md;
totalXsc = LE + (pbt*ld2 + 19.5)/(1. + .46/sp + 1.6/p4) + 2.6/md;
}
}
else if( I == 6 ) // hyperon-N
{
if( p < pmi )
{
G4double p2 = p*p;
elasticXsc = 1./(.002 + p2*(.12 + p2));
totalXsc = elasticXsc;
}
else if( p > pma )
{
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
G4double sp = std::sqrt(p);
elasticXsc = (pbe*lp2 + 6.72)/(1. + 2./sp);
totalXsc = (pbt*lp2 + 38.2 + 900./sp)/(1. + 27./sp);
}
else
{
G4double p2 = p*p;
G4double LE = 1./(.002 + p2*(.12 + p2));
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
G4double p4 = p2*p2;
G4double sp = std::sqrt(p);
elasticXsc = LE + (pbe*lp2 + 6.72 + 99./p2)/(1. + 2./sp + 2./p4);
totalXsc = LE + (pbt*lp2 + 38.2 + 900./sp)/(1. + 27./sp + 3./p4);
}
}
else if( I == 7 ) // antibaryon-N
{
if( p > pma )
{
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
elasticXsc = pbe*lp2 + 6.72;
totalXsc = pbt*lp2 + 38.2;
}
else
{
G4double ye = std::pow(p, 1.25);
G4double yt = std::pow(p, .35);
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
elasticXsc = 80./(ye + 1.) + pbe*lp2 + 6.72;
totalXsc = (80./yt + .3)/yt +pbt*lp2 + 38.2;
}
}
else
{
G4cout<<"PDG incoding = "<<I<<" is not defined (0-7)"<<G4endl;
}
if( elasticXsc > totalXsc ) elasticXsc = totalXsc;
totalXsc *= millibarn;
elasticXsc *= millibarn;
inelasticXsc = totalXsc - elasticXsc;
if (inelasticXsc < 0.) inelasticXsc = 0.;
return inelasticXsc;
}
////////////////////////////////////////////////////////////////////////////////////
//
//
@@ -1618,7 +1302,6 @@ G4GlauberGribovCrossSection::GetNucleusRadius( const G4DynamicParticle* ,
G4double oneThird = 1.0/3.0;
G4double cubicrAt = std::pow (At, oneThird);
G4double R; // = fRadiusConst*cubicrAt;
/*
G4double tmp = std::pow( cubicrAt-1., 3.);
@@ -1637,10 +1320,6 @@ G4GlauberGribovCrossSection::GetNucleusRadius( const G4DynamicParticle* ,
R = fRadiusConst*cubicrAt;
// return R; // !!!!
G4double meanA = 21.;
G4double tauA1 = 40.;
@@ -1678,7 +1357,6 @@ G4GlauberGribovCrossSection::GetNucleusRadius(G4double At)
G4double oneThird = 1.0/3.0;
G4double cubicrAt = std::pow (At, oneThird);
G4double R; // = fRadiusConst*cubicrAt;
/*
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// GEANT4 tag $Name: geant4-09-02 $
// GEANT4 tag $Name: geant4-09-03 $
//
//
// G4 Hadron Physics class G4HadronCrossSections
@@ -882,327 +882,6 @@ G4HadronNucleonXsc::GetHadronNucleonXscVU(const G4DynamicParticle* aParticle,
return fTotalXsc;
}
/////////////////////////////////////////////////////////////////////////////////////
//
// Returns hadron-nucleon cross-section based on Mikhail Kossov parametrisation of
// data from G4QuasiFreeRatios class
G4double
G4HadronNucleonXsc::GetHadronNucleonXscMK(const G4DynamicParticle* aParticle,
const G4ParticleDefinition* nucleon )
{
G4int I = -1;
G4int PDG = aParticle->GetDefinition()->GetPDGEncoding();
// G4int absPDG = std::abs(PDG);
G4double p = aParticle->GetMomentum().mag()/GeV;
G4bool F = false;
if(nucleon == theProton) F = true;
else if(nucleon == theNeutron) F = false;
else
{
G4cout << "nucleon is not proton or neutron, return xsc for proton" << G4endl;
F = true;
}
G4bool kfl = true; // Flag of K0/aK0 oscillation
G4bool kf = false;
if( PDG == 130 || PDG == 310 )
{
kf = true;
if( G4UniformRand() > .5 ) kfl = false;
}
if ( (PDG == 2212 && F) || (PDG == 2112 && !F) ) I = 0; // pp/nn
else if( (PDG == 2112 && F) || (PDG == 2212 && !F) ) I = 1; // np/pn
else if( (PDG == -211 && F) || (PDG == 211 && !F) ) I = 2; // pimp/pipn
else if( (PDG == 211 && F) || (PDG ==-211 && !F) ) I = 3; // pipp/pimn
else if( PDG == -321 || PDG == -311 || ( kf && !kfl ) ) I = 4; // KmN/K0N
else if( PDG == 321 || PDG == 311 || ( kf && kfl ) ) I = 5; // KpN/aK0N
else if( PDG > 3000 && PDG < 3335) I = 6; // @@ for all hyperons - take Lambda
else if( PDG < -2000 && PDG > -3335) I = 7; // @@ for all anti-baryons - anti-p/anti-n
else
{
G4cout<<"MK PDG = "<<PDG
<<", while it is defined only for p,n,hyperons,anti-baryons,pi,K/antiK"<<G4endl;
G4Exception("G4QuasiFreeRatio::FetchElTot:","22",FatalException,"CHIPScrash");
}
// Each parameter set can have not more than nPoints = 128 parameters
static const G4double lmi = 3.5; // min of (lnP-lmi)^2 parabola
static const G4double pbe = .0557; // elastic (lnP-lmi)^2 parabola coefficient
static const G4double pbt = .3; // total (lnP-lmi)^2 parabola coefficient
static const G4double pmi = .1; // Below that fast LE calculation is made
static const G4double pma = 1000.; // Above that fast HE calculation is made
if( p <= 0.)
{
G4cout<<" p = "<<p<<" is zero or negative"<<G4endl;
fElasticXsc = 0.;
fInelasticXsc = 0.;
fTotalXsc = 0.;
return fTotalXsc;
}
if (!I) // pp/nn
{
if( p < pmi )
{
G4double p2 = p*p;
fElasticXsc = 1./(.00012 + p2*.2);
fTotalXsc = fElasticXsc;
}
else if(p>pma)
{
G4double lp = std::log(p)-lmi;
G4double lp2 = lp*lp;
fElasticXsc = pbe*lp2 + 6.72;
fTotalXsc = pbt*lp2 + 38.2;
}
else
{
G4double p2 = p*p;
G4double LE = 1./( .00012 + p2*.2);
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
G4double rp2 = 1./p2;
fElasticXsc = LE + ( pbe*lp2 + 6.72+32.6/p)/( 1. + rp2/p);
fTotalXsc = LE + ( pbt*lp2 + 38.2+52.7*rp2)/( 1. + 2.72*rp2*rp2);
}
}
else if( I==1 ) // np/pn
{
if( p < pmi )
{
G4double p2 = p*p;
fElasticXsc = 1./( .00012 + p2*( .051 + .1*p2));
fTotalXsc = fElasticXsc;
}
else if( p > pma )
{
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
fElasticXsc = pbe*lp2 + 6.72;
fTotalXsc = pbt*lp2 + 38.2;
}
else
{
G4double p2 = p*p;
G4double LE = 1./( .00012 + p2*( .051 + .1*p2 ) );
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
G4double rp2 = 1./p2;
fElasticXsc = LE + (pbe*lp2 + 6.72 + 30./p)/( 1. + .49*rp2/p);
fTotalXsc = LE + (pbt*lp2 + 38.2)/( 1. + .54*rp2*rp2);
}
}
else if( I == 2 ) // pimp/pipn
{
G4double lp = std::log(p);
if(p<pmi)
{
G4double lr = lp + 1.27;
fElasticXsc = 1.53/( lr*lr + .0676);
fTotalXsc = fElasticXsc*3;
}
else if( p > pma )
{
G4double ld = lp - lmi;
G4double ld2 = ld*ld;
G4double sp = std::sqrt(p);
fElasticXsc = pbe*ld2 + 2.4 + 7./sp;
fTotalXsc = pbt*ld2 + 22.3 + 12./sp;
}
else
{
G4double lr = lp + 1.27;
G4double LE = 1.53/( lr*lr + .0676);
G4double ld = lp - lmi;
G4double ld2 = ld*ld;
G4double p2 = p*p;
G4double p4 = p2*p2;
G4double sp = std::sqrt(p);
G4double lm = lp + .36;
G4double md = lm*lm + .04;
G4double lh = lp - .017;
G4double hd = lh*lh + .0025;
fElasticXsc = LE + (pbe*ld2 + 2.4 + 7./sp)/( 1. + .7/p4) + .6/md + .05/hd;
fTotalXsc = LE*3 + (pbt*ld2 + 22.3 + 12./sp)/(1. + .4/p4) + 1./md + .06/hd;
}
}
else if( I == 3 ) // pipp/pimn
{
G4double lp = std::log(p);
if( p < pmi )
{
G4double lr = lp + 1.27;
G4double lr2 = lr*lr;
fElasticXsc = 13./( lr2 + lr2*lr2 + .0676);
fTotalXsc = fElasticXsc;
}
else if( p > pma )
{
G4double ld = lp - lmi;
G4double ld2 = ld*ld;
G4double sp = std::sqrt(p);
fElasticXsc = pbe*ld2 + 2.4 + 6./sp;
fTotalXsc = pbt*ld2 + 22.3 + 5./sp;
}
else
{
G4double lr = lp + 1.27;
G4double lr2 = lr*lr;
G4double LE = 13./(lr2 + lr2*lr2 + .0676);
G4double ld = lp - lmi;
G4double ld2 = ld*ld;
G4double p2 = p*p;
G4double p4 = p2*p2;
G4double sp = std::sqrt(p);
G4double lm = lp - .32;
G4double md = lm*lm + .0576;
fElasticXsc = LE + (pbe*ld2 + 2.4 + 6./sp)/(1. + 3./p4) + .7/md;
fTotalXsc = LE + (pbt*ld2 + 22.3 + 5./sp)/(1. + 1./p4) + .8/md;
}
}
else if( I == 4 ) // Kmp/Kmn/K0p/K0n
{
if( p < pmi)
{
G4double psp = p*std::sqrt(p);
fElasticXsc = 5.2/psp;
fTotalXsc = 14./psp;
}
else if( p > pma )
{
G4double ld = std::log(p) - lmi;
G4double ld2 = ld*ld;
fElasticXsc = pbe*ld2 + 2.23;
fTotalXsc = pbt*ld2 + 19.5;
}
else
{
G4double ld = std::log(p) - lmi;
G4double ld2 = ld*ld;
G4double sp = std::sqrt(p);
G4double psp = p*sp;
G4double p2 = p*p;
G4double p4 = p2*p2;
G4double lm = p - .39;
G4double md = lm*lm + .000156;
G4double lh = p - 1.;
G4double hd = lh*lh + .0156;
fElasticXsc = 5.2/psp + (pbe*ld2 + 2.23)/(1. - .7/sp + .075/p4) + .004/md + .15/hd;
fTotalXsc = 14./psp + (pbt*ld2 + 19.5)/(1. - .21/sp + .52/p4) + .006/md + .30/hd;
}
}
else if( I == 5 ) // Kpp/Kpn/aKp/aKn
{
if( p < pmi )
{
G4double lr = p - .38;
G4double lm = p - 1.;
G4double md = lm*lm + .372;
fElasticXsc = .7/(lr*lr + .0676) + 2./md;
fTotalXsc = fElasticXsc + .6/md;
}
else if( p > pma )
{
G4double ld = std::log(p) - lmi;
G4double ld2 = ld*ld;
fElasticXsc = pbe*ld2 + 2.23;
fTotalXsc = pbt*ld2 + 19.5;
}
else
{
G4double ld = std::log(p) - lmi;
G4double ld2 = ld*ld;
G4double lr = p - .38;
G4double LE = .7/(lr*lr + .0676);
G4double sp = std::sqrt(p);
G4double p2 = p*p;
G4double p4 = p2*p2;
G4double lm = p - 1.;
G4double md = lm*lm + .372;
fElasticXsc = LE + (pbe*ld2 + 2.23)/(1. - .7/sp + .1/p4) + 2./md;
fTotalXsc = LE + (pbt*ld2 + 19.5)/(1. + .46/sp + 1.6/p4) + 2.6/md;
}
}
else if( I == 6 ) // hyperon-N
{
if( p < pmi )
{
G4double p2 = p*p;
fElasticXsc = 1./(.002 + p2*(.12 + p2));
fTotalXsc = fElasticXsc;
}
else if( p > pma )
{
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
G4double sp = std::sqrt(p);
fElasticXsc = (pbe*lp2 + 6.72)/(1. + 2./sp);
fTotalXsc = (pbt*lp2 + 38.2 + 900./sp)/(1. + 27./sp);
}
else
{
G4double p2 = p*p;
G4double LE = 1./(.002 + p2*(.12 + p2));
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
G4double p4 = p2*p2;
G4double sp = std::sqrt(p);
fElasticXsc = LE + (pbe*lp2 + 6.72 + 99./p2)/(1. + 2./sp + 2./p4);
fTotalXsc = LE + (pbt*lp2 + 38.2 + 900./sp)/(1. + 27./sp + 3./p4);
}
}
else if( I == 7 ) // antibaryon-N
{
if( p > pma )
{
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
fElasticXsc = pbe*lp2 + 6.72;
fTotalXsc = pbt*lp2 + 38.2;
}
else
{
G4double ye = std::pow(p, 1.25);
G4double yt = std::pow(p, .35);
G4double lp = std::log(p) - lmi;
G4double lp2 = lp*lp;
fElasticXsc = 80./(ye + 1.) + pbe*lp2 + 6.72;
fTotalXsc = (80./yt + .3)/yt +pbt*lp2 + 38.2;
}
}
else
{
G4cout<<"PDG incoding = "<<I<<" is not defined (0-7)"<<G4endl;
}
if( fElasticXsc > fTotalXsc ) fElasticXsc = fTotalXsc;
fTotalXsc *= millibarn;
fElasticXsc *= millibarn;
fInelasticXsc = fTotalXsc - fElasticXsc;
if (fInelasticXsc < 0.) fInelasticXsc = 0.;
return fTotalXsc;
}
////////////////////////////////////////////////////////////////////////////////////
//
//
@@ -43,8 +43,7 @@ GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double ZZ,
G4double ke_per_N = aParticle->GetKineticEnergy() / Ap;
// Apply energy check, if less than lower limit then 0 value is returned
if ( ke_per_N < lowerLimit )
return xsection;
// if ( ke_per_N < lowerLimit ) return xsection;
G4int At = int (AA + 0.5);
G4int Zt = int (ZZ + 0.5 );
@@ -56,6 +55,12 @@ GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double ZZ,
G4double Bc = Zt * Zp / ( ( rc / fermi ) * ( cubicrAp + cubicrAt ) ); // rc divide fermi
G4double targ_mass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass( Zt , At );
G4double proj_mass = aParticle->GetMass();
G4double proj_momentum = aParticle->GetMomentum().mag();
G4double Ecm = calEcm ( proj_mass , targ_mass , proj_momentum );
if( Ecm <= Bc) return xsection;
G4double Rvol = r0 * ( cubicrAp + cubicrAt );
@@ -69,12 +74,6 @@ GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double ZZ,
G4double Rint = Rvol + Rsurf;
G4double targ_mass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass( Zt , At );
G4double proj_mass = aParticle->GetMass();
G4double proj_momentum = aParticle->GetMomentum().mag();
G4double Ecm = calEcm ( proj_mass , targ_mass , proj_momentum );
xsection = pi * Rint * Rint * ( 1 - Bc / ( Ecm / MeV ) );
return xsection;
@@ -46,8 +46,7 @@ GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double ZZ,
if ( ke_per_N > 10*GeV ) ke_per_N = 10*GeV;
// Apply energy check, if less than lower limit then 0 value is returned
if ( ke_per_N < lowerLimit )
return xsection;
// if ( ke_per_N < lowerLimit ) return xsection;
G4int At = G4int(AA);
G4int Zt = G4int(ZZ);
@@ -62,9 +61,14 @@ GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double ZZ,
G4double r = Rt + Rp + 3.2; // in fm
G4double b = 1.0; // in MeV/fm
G4double targ_mass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass( Zt , At );
G4double proj_mass = aParticle->GetMass();
G4double proj_momentum = aParticle->GetMomentum().mag();
G4double Ecm = calEcmValue ( proj_mass , targ_mass , proj_momentum );
G4double B = 1.44 * Zt * Zp / r - b * Rt * Rp / ( Rt + Rp );
if(Ecm <= B) return xsection;
//G4double ke_per_N = aParticle->GetKineticEnergy() / Ap;
G4double c = calCeValue ( ke_per_N / MeV );
@@ -73,11 +77,6 @@ GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double ZZ,
G4double R2 = 1.0 * ( At - 2 * Zt ) * Zp / ( Ap * At );
G4double targ_mass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass( Zt , At );
G4double proj_mass = aParticle->GetMass();
G4double proj_momentum = aParticle->GetMomentum().mag();
G4double Ecm = calEcmValue ( proj_mass , targ_mass , proj_momentum );
G4double R3 = 0.176 / std::pow ( G4double(Ecm) , G4double(one_third) ) * cubicrAt * cubicrAp / ( cubicrAt + cubicrAp );
@@ -0,0 +1,188 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4NeutronCaptureXS.cc,v 1.2 2009/11/19 12:36:53 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4NeutronCaptureXS
//
// Author Ivantchenko, Geant4, 3-Aug-09
//
// Modifications:
//
#include "G4NeutronCaptureXS.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
#include "G4PhysicsLogVector.hh"
#include "G4PhysicsVector.hh"
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
G4NeutronCaptureXS::G4NeutronCaptureXS()
{
verboseLevel = 0;
emax = 20.*MeV;
G4cout << "G4NeutronCaptureXS::G4NeutronCaptureXS: Initialise " << G4endl;
for(G4int i=0; i<93; ++i) {
data[i] = 0;
}
isInitialized = false;
}
G4NeutronCaptureXS::~G4NeutronCaptureXS()
{
for(G4int i=0; i<92; ++i) {
delete data[i];
}
}
G4bool
G4NeutronCaptureXS::IsApplicable(const G4DynamicParticle*,
const G4Element*)
{
return true;
}
G4bool
G4NeutronCaptureXS::IsZAApplicable(const G4DynamicParticle*,
G4double /*ZZ*/, G4double /*AA*/)
{
return false;
}
G4double
G4NeutronCaptureXS::GetCrossSection(const G4DynamicParticle* aParticle,
const G4Element* elm,
G4double)
{
G4double xs = 0.0;
G4double ekin = aParticle->GetKineticEnergy();
if(ekin > emax) return xs;
G4int Z = G4int(elm->GetZ());
G4PhysicsVector* pv = data[Z];
// element was not initialised
if(!pv) {
Initialise(Z);
pv = data[Z];
if(!pv) return xs;
}
G4int n = pv->GetVectorLength() - 1;
G4double e1 = pv->Energy(0);
G4double e2 = pv->Energy(n);
if(ekin < e1) { xs = (*pv)[0]*std::sqrt(e1/ekin); }
else if(ekin <= e2) { xs = pv->Value(ekin); }
if(verboseLevel > 0){
G4cout << "ekin= " << ekin << ", xs= " << xs << G4endl;
}
return xs;
}
void
G4NeutronCaptureXS::BuildPhysicsTable(const G4ParticleDefinition& p)
{
G4cout << "G4NeutronCaptureXS::BuildPhysicsTable: " << G4endl;
G4cout << p.GetParticleName() << G4endl;
if(p.GetParticleName() != "neutron") {
return;
}
if(isInitialized) return;
isInitialized = true;
// check environment variable
// Build the complete string identifying the file with the data set
char* path = getenv("G4NEUTRONXS");
if (!path){
G4cout << "G4NEUTRONXS environment variable not set" << G4endl;
}
// Access to elements
const G4ElementTable* theElmTable = G4Element::GetElementTable();
size_t numOfElm = G4Element::GetNumberOfElements();
if(numOfElm > 0) {
for(size_t i=0; i<numOfElm; ++i) {
G4int Z = G4int(((*theElmTable)[i])->GetZ());
if(Z < 1) Z = 1;
else if(Z > 92) Z = 92;
//G4cout << "Z= " << Z << G4endl;
// Initialisation
if(!data[Z]) { Initialise(Z, path); }
}
}
}
void
G4NeutronCaptureXS::DumpPhysicsTable(const G4ParticleDefinition&)
{
}
void
G4NeutronCaptureXS::Initialise(G4int Z, const char* p)
{
if(data[Z]) return;
const char* path = p;
if(!p) {
// check environment variable
// Build the complete string identifying the file with the data set
path = getenv("G4NEUTRONXS");
if (!path) {
if(verboseLevel > 1) {
G4cout << "G4NEUTRONXS environment variable not set" << G4endl;
}
return;
}
}
// upload data from file
data[Z] = new G4PhysicsLogVector();
std::ostringstream ost;
ost << path << "/cap" << Z ;
std::ifstream filein(ost.str().c_str());
if (!(filein)) {
G4cout << " file " << ost << " is not opened" << G4endl;
}else{
if(verboseLevel > 1) {
G4cout << ost << " is opened" << G4endl;
}
// retrieve data from DB
data[Z]->Retrieve(filein, true);
}
}
@@ -0,0 +1,222 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4NeutronElasticXS.cc,v 1.3 2009/11/19 12:01:54 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4NeutronElasticXS
//
// Author Ivantchenko, Geant4, 3-Aug-09
//
// Modifications:
//
#include "G4NeutronElasticXS.hh"
#include "G4Neutron.hh"
#include "G4DynamicParticle.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
#include "G4PhysicsLogVector.hh"
#include "G4PhysicsVector.hh"
#include "G4GlauberGribovCrossSection.hh"
#include "G4NistManager.hh"
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
G4NeutronElasticXS::G4NeutronElasticXS()
{
verboseLevel = 0;
G4cout << "G4NeutronElasticXS::G4NeutronElasticXS: Initialise " << G4endl;
for(G4int i=0; i<93; ++i) {
data[i] = 0;
coeff[i]= 1.0;
}
ggXsection = new G4GlauberGribovCrossSection();
isInitialized = false;
}
G4NeutronElasticXS::~G4NeutronElasticXS()
{
for(G4int i=0; i<92; ++i) {
delete data[i];
}
}
G4bool
G4NeutronElasticXS::IsApplicable(const G4DynamicParticle*,
const G4Element*)
{
return true;
}
G4bool
G4NeutronElasticXS::IsZAApplicable(const G4DynamicParticle*,
G4double /*ZZ*/, G4double /*AA*/)
{
return false;
}
G4double
G4NeutronElasticXS::GetCrossSection(const G4DynamicParticle* aParticle,
const G4Element* elm,
G4double)
{
G4double xs = 0.0;
G4double ekin = aParticle->GetKineticEnergy();
G4int Z = G4int(elm->GetZ());
G4PhysicsVector* pv = data[Z];
// G4cout << "G4NeutronElasticXS::GetCrossSection e= " << ekin << " Z= " << Z << G4endl;
// element was not initialised
if(!pv) {
Initialise(Z);
pv = data[Z];
if(!pv) return xs;
}
G4double e1 = pv->Energy(0);
if(ekin <= e1) return (*pv)[0];
G4int n = pv->GetVectorLength() - 1;
G4double e2 = pv->Energy(n);
if(ekin <= e2) {
xs = pv->Value(ekin);
} else {
ggXsection->GetCrossSection(aParticle, elm);
xs = coeff[Z]*ggXsection->GetElasticGlauberGribovXsc();
}
if(verboseLevel > 0){
G4cout << "ekin= " << ekin << ", XSinel= " << xs << G4endl;
}
return xs;
}
void
G4NeutronElasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
{
G4cout << "G4NeutronElasticXS::BuildPhysicsTable: " << G4endl;
G4cout << p.GetParticleName() << G4endl;
if(p.GetParticleName() != "neutron") {
return;
}
if(isInitialized) return;
isInitialized = true;
// check environment variable
// Build the complete string identifying the file with the data set
char* path = getenv("G4NEUTRONXS");
if (!path){
G4cout << "G4NEUTRONXS environment variable not set" << G4endl;
}
G4DynamicParticle* dynParticle =
new G4DynamicParticle(G4Neutron::Neutron(),G4ThreeVector(1,0,0),1);
// Access to elements
const G4ElementTable* theElmTable = G4Element::GetElementTable();
size_t numOfElm = G4Element::GetNumberOfElements();
if(numOfElm > 0) {
for(size_t i=0; i<numOfElm; ++i) {
G4int Z = G4int(((*theElmTable)[i])->GetZ());
if(Z < 1) Z = 1;
else if(Z > 92) Z = 92;
//G4cout << "Z= " << Z << G4endl;
// Initialisation
if(!data[Z]) { Initialise(Z, dynParticle, path); }
}
}
delete dynParticle;
}
void
G4NeutronElasticXS::DumpPhysicsTable(const G4ParticleDefinition&)
{
}
void
G4NeutronElasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
const char* p)
{
if(data[Z]) return;
const char* path = p;
if(!p) {
// check environment variable
// Build the complete string identifying the file with the data set
path = getenv("G4NEUTRONXS");
if (!path) {
if(verboseLevel > 1) {
G4cout << "G4NEUTRONXS environment variable not set" << G4endl;
}
return;
}
}
G4DynamicParticle* dynParticle = dp;
if(!dp) {
dynParticle =
new G4DynamicParticle(G4Neutron::Neutron(),G4ThreeVector(1,0,0),1);
}
const G4Element* Elem =
G4NistManager::Instance()->FindOrBuildElement(Z, true);
// upload data from file
data[Z] = new G4PhysicsLogVector();
std::ostringstream ost;
ost << path << "/elast" << Z ;
std::ifstream filein(ost.str().c_str());
if (!(filein)) {
G4cout << " file " << ost << " is not opened" << G4endl;
}else{
if(verboseLevel > 1) {
G4cout << ost << " is opened" << G4endl;
}
// retrieve data from DB
data[Z]->Retrieve(filein, true);
// smooth transition
size_t n = data[Z]->GetVectorLength() - 1;
G4double emax = data[Z]->Energy(n);
G4double sig1 = (*data[Z])[n];
dynParticle->SetKineticEnergy(emax);
ggXsection->GetCrossSection(dynParticle, Elem);
G4double sig2 = ggXsection->GetElasticGlauberGribovXsc();
if(sig2 > 0.) coeff[Z] = sig1/sig2;
}
if(!dp) delete dynParticle;
}
@@ -25,6 +25,7 @@
//
// By JPW, working, but to be cleaned up. @@@
// 22 Dec 2006 - DHW added isotope dependence
// G.Folger, 25-Nov-2009: extend to 100TeV, using a constant above 20GeV
//
#include "G4NeutronInelasticCrossSection.hh"
@@ -63,6 +64,10 @@ GetCrossSection(const G4DynamicParticle* aPart,
G4double G4NeutronInelasticCrossSection::
GetCrossSection(G4double anEnergy, G4double atomicNumber, G4double nOfProtons)
{
if (anEnergy > 19.9*GeV )
{ // constant cross section above ~20GeV.
return GetCrossSection(19.8*GeV,atomicNumber,nOfProtons);
}
G4double kineticEnergy = std::log10(DBL_MIN/MeV);
if (anEnergy > DBL_MIN/MeV) kineticEnergy = std::log10(anEnergy/MeV);
G4double nOfNeutrons = atomicNumber-nOfProtons;
@@ -0,0 +1,222 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4NeutronInelasticXS.cc,v 1.3 2009/11/19 12:00:40 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4NeutronInelasticXS
//
// Author Ivantchenko, Geant4, 3-Aug-09
//
// Modifications:
//
#include "G4NeutronInelasticXS.hh"
#include "G4Neutron.hh"
#include "G4DynamicParticle.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
#include "G4PhysicsLogVector.hh"
#include "G4PhysicsVector.hh"
#include "G4GlauberGribovCrossSection.hh"
#include "G4NistManager.hh"
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
G4NeutronInelasticXS::G4NeutronInelasticXS()
{
verboseLevel = 0;
G4cout << "G4NeutronInelasticXS::G4NeutronInelasticXS: Initialise " << G4endl;
for(G4int i=0; i<93; ++i) {
data[i] = 0;
coeff[i]= 1.0;
}
ggXsection = new G4GlauberGribovCrossSection();
isInitialized = false;
}
G4NeutronInelasticXS::~G4NeutronInelasticXS()
{
for(G4int i=0; i<92; ++i) {
delete data[i];
}
}
G4bool
G4NeutronInelasticXS::IsApplicable(const G4DynamicParticle*,
const G4Element*)
{
return true;
}
G4bool
G4NeutronInelasticXS::IsZAApplicable(const G4DynamicParticle*,
G4double /*ZZ*/, G4double /*AA*/)
{
return false;
}
G4double
G4NeutronInelasticXS::GetCrossSection(const G4DynamicParticle* aParticle,
const G4Element* elm,
G4double)
{
G4double xs = 0.0;
G4double ekin = aParticle->GetKineticEnergy();
G4int Z = G4int(elm->GetZ());
G4PhysicsVector* pv = data[Z];
// G4cout << "G4NeutronInelasticXS::GetCrossSection e= " << ekin << " Z= " << Z << G4endl;
// element was not initialised
if(!pv) {
Initialise(Z);
pv = data[Z];
if(!pv) return xs;
}
G4double e1 = pv->Energy(0);
if(ekin <= e1) return xs;
G4int n = pv->GetVectorLength() - 1;
G4double e2 = pv->Energy(n);
if(ekin <= e2) {
xs = pv->Value(ekin);
} else {
ggXsection->GetCrossSection(aParticle, elm);
xs = coeff[Z]*ggXsection->GetInelasticGlauberGribovXsc();
}
if(verboseLevel > 0){
G4cout << "ekin= " << ekin << ", XSinel= " << xs << G4endl;
}
return xs;
}
void
G4NeutronInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
{
G4cout << "G4NeutronInelasticXS::BuildPhysicsTable: " << G4endl;
G4cout << p.GetParticleName() << G4endl;
if(p.GetParticleName() != "neutron") {
return;
}
if(isInitialized) return;
isInitialized = true;
// check environment variable
// Build the complete string identifying the file with the data set
char* path = getenv("G4NEUTRONXS");
if (!path){
G4cout << "G4NEUTRONXS environment variable not set" << G4endl;
}
G4DynamicParticle* dynParticle =
new G4DynamicParticle(G4Neutron::Neutron(),G4ThreeVector(1,0,0),1);
// Access to elements
const G4ElementTable* theElmTable = G4Element::GetElementTable();
size_t numOfElm = G4Element::GetNumberOfElements();
if(numOfElm > 0) {
for(size_t i=0; i<numOfElm; ++i) {
G4int Z = G4int(((*theElmTable)[i])->GetZ());
if(Z < 1) Z = 1;
else if(Z > 92) Z = 92;
//G4cout << "Z= " << Z << G4endl;
// Initialisation
if(!data[Z]) { Initialise(Z, dynParticle, path); }
}
}
delete dynParticle;
}
void
G4NeutronInelasticXS::DumpPhysicsTable(const G4ParticleDefinition&)
{
}
void
G4NeutronInelasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
const char* p)
{
if(data[Z]) return;
const char* path = p;
if(!p) {
// check environment variable
// Build the complete string identifying the file with the data set
path = getenv("G4NEUTRONXS");
if (!path) {
if(verboseLevel > 1) {
G4cout << "G4NEUTRONXS environment variable not set" << G4endl;
}
return;
}
}
G4DynamicParticle* dynParticle = dp;
if(!dp) {
dynParticle =
new G4DynamicParticle(G4Neutron::Neutron(),G4ThreeVector(1,0,0),1);
}
const G4Element* Elem =
G4NistManager::Instance()->FindOrBuildElement(Z, true);
// upload data from file
data[Z] = new G4PhysicsLogVector();
std::ostringstream ost;
ost << path << "/inelast" << Z ;
std::ifstream filein(ost.str().c_str());
if (!(filein)) {
G4cout << " file " << ost << " is not opened" << G4endl;
}else{
if(verboseLevel > 1) {
G4cout << ost << " is opened" << G4endl;
}
// retrieve data from DB
data[Z]->Retrieve(filein, true);
// smooth transition
size_t n = data[Z]->GetVectorLength() - 1;
G4double emax = data[Z]->Energy(n);
G4double sig1 = (*data[Z])[n];
dynParticle->SetKineticEnergy(emax);
ggXsection->GetCrossSection(dynParticle, Elem);
G4double sig2 = ggXsection->GetInelasticGlauberGribovXsc();
if(sig2 > 0.) coeff[Z] = sig1/sig2;
}
if(!dp) delete dynParticle;
}
@@ -31,14 +31,12 @@
//
// Modified:
// 05.03.07 V.Ivanchenko - add IfZAApplicable, remove "debug"
// 11.09.09 V.Ivanchenko - fixed bug in interpolation
//
#include "G4NucleonNuclearCrossSection.hh"
//#include "G4HadronicException.hh"
//#include "G4HadTmpUtil.hh"
#include "G4Neutron.hh"
#include "G4Proton.hh"
//#include "G4ping.hh"
// Group 1: He, Be, C for 44 energies
@@ -601,9 +599,8 @@ GetIsoZACrossSection( const G4DynamicParticle* aParticle,
size_t it = 0;
while( it < theZ.size() && Z > theZ[it] ) it++;
// if( Z == 29 ) tuning=.96;
while( it < theZ.size() && Z > theZ[it] ) {++it;}
if(it >= theZ.size()) it = theZ.size() - 1;
if( Z > theZ[it] ) Z = theZ[it];
G4int Z1, Z2;
@@ -720,8 +717,8 @@ Interpolate(G4int Z1, G4int Z2, G4int Z, G4double x1, G4double x2)
// More precise average
if(Z1 != Z2) {
G4double alp1 = G4double(Z - Z1);
G4double alp2 = G4double(Z2 - Z);
G4double alp1 = (A[Z-1] - A[Z1-1]);
G4double alp2 = (A[Z2-1] - A[Z-1]);
result = (r1*alp2 + r2*alp1)/(alp1 + alp2);
}
// G4cout << "x1/2, z1/2 z" <<x1<<" "<<x2<<" "<<Z1<<" "<<Z2<<" "<<Z<<G4endl;
@@ -42,7 +42,7 @@
const G4double G4PiNuclearCrossSection::e1[38] = {
.02, .04, .06, .08, .1, .12, .13, .14, .15, .16, .17, .18, .19, .20,
.22, .24, .26, .28, .30, .35, .40, .45, 0.5, 0.55, 0.6, 0.7, 0.8, 0.9,
1, 2, 3, 5, 10, 20, 50, 100, 500, 1000};
1, 2, 3, 5, 10, 20, 50, 100, 500, 100000};
const G4double G4PiNuclearCrossSection::he_t[38] = {
40, 70, 108, 152, 208, 276, 300, 320, 329, 333, 332, 328, 322, 310, 288,
@@ -75,7 +75,7 @@
const G4double G4PiNuclearCrossSection::e2[39] = {
.02, .04, .06, .08, .10, .11, .12, .13, .14, .15, .16, .17, .18, .20, .22,
.24, .26, .28, .30, .35, .40, .45, .50, .55, .575, .60, .70, .80, .90, 1,
2, 3, 5, 10, 20, 50, 100, 500, 1000};
2, 3, 5, 10, 20, 50, 100, 500, 100000};
const G4double G4PiNuclearCrossSection::c_m_t[39] = {
204, 260, 366, 517, 630, 673, 694, 704, 710, 711, 706, 694, 676, 648, 616,
@@ -116,7 +116,7 @@
const G4double G4PiNuclearCrossSection::e3[31] = {
.02, .04, .06, .08, .10, .12, .14, .16, .18, .20, .22, .25, .30, .35, .40,
.45, .50, .60, .70, .80, .90, 1, 2, 3, 5, 10, 20, 50, 100, 500,
1000};
100000};
const G4double G4PiNuclearCrossSection::o_m_t[31] = {
280, 360, 500, 685, 812, 861, 870, 865, 835, 800, 755, 700, 600, 537, 493,
@@ -157,7 +157,7 @@
const G4double G4PiNuclearCrossSection::e3_1[31] = {
0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.25, 0.30, 0.35, 0.40,
0.45, 0.50, 0.60, 0.70, 0.80, 0.90, 1, 2, 3, 5, 10, 20, 50, 100, 500,
1000};
100000};
const G4double G4PiNuclearCrossSection::al_m_t[31] = {
532, 637, 832, 1057, 1207, 1230, 1210, 1174, 1133, 1095, 1038, 970, 890, 807, 750,
@@ -199,7 +199,7 @@
const G4double G4PiNuclearCrossSection::e4[32] = {
0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.25, 0.30, 0.35, 0.40,
0.45, 0.50, 0.55, 0.60, 0.70, 0.80, 0.90, 1, 2, 3, 5, 10, 20, 50, 100,
500, 1000};
500, 100000};
const G4double G4PiNuclearCrossSection::fe_m_t[32] = {1175, 1363, 1670, 1950, 2050, 2040, 1975, 1886, 1834, 1773, 1720, 1635, 1474, 1380, 1269, 1225, 1182, 1162, 1159, 1162, 1178, 1190, 1197, 1102, 1135, 975, 945, 925, 905, 905, 905, 905};
const G4double G4PiNuclearCrossSection::fe_m_in[32] = {625, 725, 910, 1180, 1275, 1250, 1200, 1150, 1100, 1040, 995, 925, 825, 810, 780, 760, 745, 740, 740, 740, 750, 760, 765, 690, 660, 635, 615, 600, 585, 585, 585, 585};
@@ -213,7 +213,7 @@
const G4double G4PiNuclearCrossSection::e5[34] = {
0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.25,
0.30, 0.35, 0.40, 0.45, 0.50, 0.60, 0.70, 0.80, 0.90, 1, 2, 3, 5, 10, 20,
50, 100, 500, 1000};
50, 100, 500, 100000};
const G4double G4PiNuclearCrossSection::mo_m_t[34] = {2430, 2610, 2710, 2790, 2880, 2940, 2965, 2970, 2970, 2920, 2840, 2720, 2570, 2500, 2365, 2200, 2050, 1926, 1825, 1768, 1749, 1750, 1778, 1789, 1808, 1690, 1645, 1530, 1492, 1450, 1425, 1425, 1425, 1425};
const G4double G4PiNuclearCrossSection::mo_m_in[34] = {925, 1125, 1250, 1375, 1500, 1600, 1680, 1750, 1770, 1730, 1660, 1580, 1500, 1450, 1330, 1250, 1190, 1140, 1100, 1075, 1075, 1070, 1088, 1095, 1110, 1035, 1005, 940, 917, 880, 860, 860, 860, 860};
@@ -227,7 +227,7 @@
const G4double G4PiNuclearCrossSection::e6[35] = {
0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.25,
0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.70, 0.80, 0.90, 1, 2, 3, 5, 10,
20, 50, 100, 500, 1000};
20, 50, 100, 500, 100000};
const G4double G4PiNuclearCrossSection::sn_m_t[35] = {3000, 3180, 3250, 3300, 3300, 3410, 3470, 3450, 3410, 3350, 3280, 3200, 3120, 3050, 2900, 2630, 2500, 2325, 2190, 2100, 2060, 2055, 2055, 2055, 2067, 2085, 2000, 1900, 1835, 1770, 1720, 1700, 1695, 1695, 1695};
const G4double G4PiNuclearCrossSection::sn_m_in[35] = {1050, 1350, 1520, 1650, 1800, 1980, 2070, 2120, 2090, 2050, 1980, 1920, 1830, 1770, 1670, 1500, 1435, 1350, 1300, 1230, 1220, 1235, 1235, 1235, 1237, 1240, 1160, 1120, 1090, 1065, 1040, 1020, 1015, 1015, 1015};
@@ -241,7 +241,7 @@
const G4double G4PiNuclearCrossSection::e7[35] = {
0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.25,
0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.70, 0.80, 0.90, 1, 2, 3, 5, 10,
20, 50, 100, 500, 1000};
20, 50, 100, 500, 100000};
const G4double G4PiNuclearCrossSection::pb_m_t[35] = {
5890, 5700, 5610, 5580, 5550, 5480, 5400, 5300, 5100, 4930, 4750, 4600, 4400, 4280, 4170,
@@ -26,6 +26,7 @@
// By JPW, working, but to be cleaned up. @@@
// G.Folger, 29-sept-2006: extend to 1TeV, using a constant above 20GeV
// 22 Dec 2006 - DHW added isotope dependence
// G.Folger, 25-Nov-2009: extend to 100TeV, using a constant above 20GeV
//
#include "G4ProtonInelasticCrossSection.hh"
@@ -34,11 +34,18 @@
#include "G4IonTable.hh"
#include "G4HadTmpUtil.hh"
G4TripathiCrossSection::G4TripathiCrossSection()
{
// G4cout <<"New G4TripathiCrossSection " << this << G4endl;
}
G4TripathiCrossSection::~G4TripathiCrossSection()
{}
G4double G4TripathiCrossSection::
GetIsoZACrossSection(const G4DynamicParticle* aPart, G4double ZZ, G4double AA,
G4double /*temperature*/)
{
G4double result = 0;
G4double result = 0.;
const G4double targetAtomicNumber = AA;
const G4double nTargetProtons = ZZ;
@@ -59,7 +66,7 @@ GetIsoZACrossSection(const G4DynamicParticle* aPart, G4double ZZ, G4double AA,
G4LorentzVector pProjectile(aPart->Get4Momentum());
pTarget = pTarget+pProjectile;
G4double E_cm = (pTarget.mag()-targetMass-pProjectile.m())/MeV;
if(E_cm <= DBL_MIN) return result;
// done
G4double r_rms_p = 0.6 * myNuleonRadius *
std::pow(projectileAtomicNumber, 1./3.);
@@ -77,7 +84,7 @@ GetIsoZACrossSection(const G4DynamicParticle* aPart, G4double ZZ, G4double AA,
//done
G4double B = 1.44*nProjProtons*nTargetProtons/Radius;
if(E_cm <= B) return result;
// done
G4double Energy = kineticEnergy/projectileAtomicNumber;
@@ -132,7 +139,7 @@ GetIsoZACrossSection(const G4DynamicParticle* aPart, G4double ZZ, G4double AA,
std::pow(projectileAtomicNumber, 1./3.) + deltaE),2.) *
(1-B/E_cm);
if(result < 0) result = 0;
if(result < 0.) result = 0.;
return result*m2;
}
@@ -295,11 +295,13 @@ G4double G4TripathiLightCrossSection::GetIsoZACrossSection
G4double f = 0.95;
G4DynamicParticle slowerProjectile = *theProjectile;
slowerProjectile.SetKineticEnergy(f * EA * MeV);
G4TripathiLightCrossSection theTripathiLightCrossSection;
theTripathiLightCrossSection.SetLowEnergyCheck(true);
// G4TripathiLightCrossSection theTripathiLightCrossSection; // MHM 20090824 Not needed
// theTripathiLightCrossSection.SetLowEnergyCheck(true);
G4bool savelowenergy=lowEnergyCheck;
SetLowEnergyCheck(true);
G4double resultp =
theTripathiLightCrossSection.GetIsoZACrossSection
(&slowerProjectile, ZZ, AA, 0.0);
GetIsoZACrossSection(&slowerProjectile, ZZ, AA, 0.0);
SetLowEnergyCheck(savelowenergy);
if (resultp >result) result = 0.0;
}
}
@@ -32,6 +32,7 @@
// 22.01.07 V.Ivanchenko - add cross section interfaces with Z and A
// 05.03.07 V.Ivanchenko - fix weight for interpolation
// 13.03.07 V.Ivanchenko - cleanup at low energies
// 11.09.09 V.Ivanchenko - fixed bug in interpolation
//
#include "G4UPiNuclearCrossSection.hh"
@@ -98,7 +99,6 @@ G4double G4UPiNuclearCrossSection::Interpolate(
G4double Z, G4double A, G4double ekin, G4PhysicsTable* table)
{
G4double res = 0.0;
G4bool b;
G4int idx;
G4int iz = G4int(Z + 0.5);
if(iz > 92) iz = 92;
@@ -106,7 +106,7 @@ G4double G4UPiNuclearCrossSection::Interpolate(
if(idx >= NZ) idx = NZ - 1;
G4int iz2 = theZ[idx];
G4double x2 = (((*table)[idx])->GetValue(ekin, b))*APower[iz]/APower[iz2];
G4double x2 = (((*table)[idx])->Value(ekin))*APower[iz]/APower[iz2];
// use only one Z
if(iz >= theZ[idx] || idx == 0) {
@@ -116,10 +116,10 @@ G4double G4UPiNuclearCrossSection::Interpolate(
} else {
G4int iz1 = theZ[idx-1];
G4double x1 = (((*table)[idx-1])->GetValue(ekin, b))*APower[iz]/APower[iz1];
G4double x1 = (((*table)[idx-1])->Value(ekin))*APower[iz]/APower[iz1];
G4double w1 = A - theA[idx-1];
G4double w2 = theA[idx] - A;
res = (w1*x1 + w2*x2)/(w1 + w2);
res = (w1*x2 + w2*x1)/(w1 + w2);
}
return res;
}
@@ -131,9 +131,9 @@ void G4UPiNuclearCrossSection::AddDataSet(const G4String& p,
G4int n)
{
G4LPhysicsFreeVector* pvin = new G4LPhysicsFreeVector(n,e[0]*GeV,e[n-1]*GeV);
//pvin->SetSpline(true);
pvin->SetSpline(true);
G4LPhysicsFreeVector* pvel = new G4LPhysicsFreeVector(n,e[0]*GeV,e[n-1]*GeV);
//pvel->SetSpline(true);
pvel->SetSpline(true);
for(G4int i=0; i<n; i++) {
pvin->PutValues(i,e[i]*GeV,in[i]*millibarn);
pvel->PutValues(i,e[i]*GeV,std::max(0.0,(tot[i]-in[i])*millibarn));
@@ -23,10 +23,35 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VCrossSectionDataSet.cc,v 1.7 2006/12/29 02:05:48 dennis Exp $
//
// $Id: G4VCrossSectionDataSet.cc,v 1.8 2009/01/24 11:54:47 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4VCrossSectionDataSet
//
// Author F.W. Jones, TRIUMF, 20-JAN-97
//
// Modifications:
// 23.01.2009 V.Ivanchenko move constructor and destructor to source
//
#include "G4VCrossSectionDataSet.hh"
#include "G4CrossSectionDataSetRegistry.hh"
G4VCrossSectionDataSet::G4VCrossSectionDataSet() :
verboseLevel(0)
{
G4CrossSectionDataSetRegistry::Instance()->Register(this);
}
G4VCrossSectionDataSet::~G4VCrossSectionDataSet()
{
G4CrossSectionDataSetRegistry::Instance()->DeRegister(this);
}
// Override this method to test for particle and isotope applicability