Import Geant4 10.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 14:11:04 +02:00
parent c9b32a6c0a
commit d4af681f38
4886 changed files with 420149 additions and 1023309 deletions
+1 -3
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile 82626 2014-07-01 09:32:09Z gcosmo $
# $Id: GNUmakefile 94123 2015-11-06 09:45:13Z gcosmo $
# ----------------------------------------------------------------
# GNUmakefile for hadronic processes library. G.Folger 10-Dec-97.
# ----------------------------------------------------------------
@@ -36,7 +36,6 @@ SUBDIRS += models/inclxx/interface
SUBDIRS += models/lend
SUBDIRS += models/lepto_nuclear
SUBDIRS += models/management
SUBDIRS += models/neutron_hp
SUBDIRS += models/particle_hp
SUBDIRS += models/parton_string/diffraction
SUBDIRS += models/parton_string/hadronization
@@ -63,7 +62,6 @@ SUBLIBS += G4had_im_r_matrix
SUBLIBS += G4hadronic_RPG
SUBLIBS += G4hadronic_qmd
SUBLIBS += G4had_mod_man
SUBLIBS += G4had_neu_hp
SUBLIBS += G4had_part_hp
SUBLIBS += G4had_lend
SUBLIBS += G4had_fission
+12
View File
@@ -17,6 +17,18 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
November 6, 2015 G.Cosmo (hadr-V10-01-01)
- Added missing tags: hadr-cross-V10-01-33, hadr-hpp-V10-01-29.
November 6, 2015 G.Cosmo (hadr-V10-01-00)
- Including tags on top of tag "geant4-10-01-ref-10":
hadr-cross-V10-01-33, hadr-man-V10-01-06, hadr-abla-V10-01-01,
hadr-cohe-V10-01-16, hadr-deex-V10-01-54, hadr-fission-V10-01-07,
had-im_r-V10-01-03, hadr-lend-V10-01-07, hadr-modman-V10-01-07,
hadr-hpp-V10-01-29, hadr-qmd-V10-01-09, hadr-qelastic-V10-01-03,
radioactive_decay-V10-01-21, hadr-mod-util-V10-01-10, hadr-util-V10-01-02.
- Removed module 'neutron_hp', now merged in 'particle_hp'.
November 8, 2013 G.Cosmo (hadr-V09-06-00)
- Including tags on top of tag "geant4-09-06-ref-10":
hadr-gmk-V09-06-04, hadr-proc-mod-cmk-V09-06-00, hadr-proc-mod-gmk-V09-06-00,
@@ -14,11 +14,188 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
23 November 2015 - G.Folger (hadr-cross-V10-01-37)
-------------------------------------------------
- G4HadronCrossSections: Revert cross section data back to float, add f in
initialisation.
12 November 2015 - A.Dotti (hadr-cross-V10-01-36)
-------------------------------------------------
- Disabling profiling functions of fast-cross-sections
12 November 2015 - G.Folger (hadr-cross-V10-01-35)
-------------------------------------------------
- G4HadronCrossSections: change float cross sections data to be double.
07 November 2014 V.Ivanchenko (hadr-cross-V10-00-17)
6 November 2015 - A. Ribon (hadr-cross-V10-01-34)
-------------------------------------------------
- G4HadronNucleonXsc, G4ComponentGGHadronNucleusXsc : Grichine's clean up
of kaon-nucleon xsc vector-arrays (which are not used).
5 November 2015 - A. Dotti (hadr-cross-V10-01-33)
-------------------------------------------------
- Again WIN fix: adding define to have M_LN10 math definition
5 November 2015 - G. Cosmo (hadr-cross-V10-01-32)
-------------------------------------------------
- Replaced use of variable 'L' in G4ElectroNuclearCrossSection.cc to avoid
shadowing of new volumetric units.
4 November 2015 - A. Dotti (hadr-cross-V10-01-31)
-------------------------------------------------
- Attempt fix error reported in tag -29 on WIN systems (adding stdint.h)
- Attempt fix warning in WIN for G4HadronCrossSection double->float conversions for 0.E+00
3 November 2015 - V. Ivanchenko (hadr-cross-V10-01-30)
-----------------------------------------------------------
- Take only G4CrossSectionDataSetRegistry modification and not fast-path
2 November 2015 - Tatsumi Koi (hadr-cross-V10-01-29)
-----------------------------------------------------------
- G4CrossSectionDataSetRegistry - adding same ad-hoc trick of NeutronHP to ParticleHP models to prevent problem at termination
1 November 2015 A. Dotti
------------------------------------------------
- First import of fast-path (ASCR style) cross-section feature
(OFF by default, but code is there)
27 October 2015 A. Ribon (hadr-cross-V10-01-28)
------------------------------------------------
- Exactly the same tag as the previous one, with a fix in another category
to overcome a compilation error.
27 October 2015 A. Ribon (hadr-cross-V10-01-27)
------------------------------------------------
- Deleted the old classes G4GlauberGribovCrossSection and
G4GGNuclNuclCrossSection, and replaced them with the new, recommended ones
G4ComponentGGHadronNucleusXsc and G4ComponentGGNuclNuclXsc, respectively.
26 October 2015 T.Koi (hadr-cross-V10-01-26)
------------------------------------------------
- G4ZeroXS: Adding an artificial cross section data set which always replys zero
24 October 2015 V.Ivanchenko (hadr-cross-V10-01-25)
------------------------------------------------
- G4HadronNucleonXsc - V.Grichine fix energies for K-p data
in order to avoid crash when bound check is applied
22 October 2015 A. Ribon (hadr-cross-V10-01-24)
------------------------------------------------
- G4ComponentGGHadronNucleusXsc : added Default_Name() method.
12 October 2015 W. Pokorski (hadr-cross-V10-01-23)
------------------------------------------------
- removing G4Pow, G4Exp and G4Log from Chips Kaon cross sections because they cause FPEs to occur
8 October 2015 W. Pokorski (hadr-cross-V10-01-22)
------------------------------------------------
- further removal of G4Pow, G4Exp and G4Log from the crosse sections where FPEs occur
7 October 2015 W. Pokorski (hadr-cross-V10-01-21)
------------------------------------------------
- slowly removing just introduced powA and G4Log which cause FPEs
6 October 2015 W. Pokorski (hadr-cross-V10-01-20)
------------------------------------------------
- trying to fix the previous tag, removing powA with 0 exponent
2 October 2015 W. Pokorski (hadr-cross-V10-01-19)
------------------------------------------------
- migrating to G4Exp, G4Log and G4Pow
10 August 2015 V.Ivanchenko (hadr-cross-V10-01-18)
-----------------------------------------------
- G4NeutronCaptureXS - fixed Coverity warning
18 July 2015 V.Ivanchenko (hadr-cross-V10-01-17)
-----------------------------------------------
Fix previous tag and removed debug cout
18 July 2015 V.Ivanchenko (hadr-cross-V10-01-14)
-----------------------------------------------
Cleanup previous tag
18 July 2015 V.Ivanchenko (hadr-cross-V10-01-13)
-----------------------------------------------
- G4NeutronInelasticXS, G4NeutronCaptureXS - fixed isotope cross
including retrieve, data management, isotope x-section and
isotope selection (the problem was reported by Steve Quillin
and analyzed by Tatsumi Koi).
13 July 2015 A. Dotti (hadr-cross-V10-01-12)
-----------------------------------------------
- Fixing coverity issues
2 June 2015 W. Pokorski (hadr-cross-V10-01-11)
------------------------------------------------
- add description method to all the CHIPS cross sections
1 June 2015 D.H. Wright (hadr-cross-V10-01-10)
------------------------------------------------
- add description method to G4KokoulinMuonNuclearXS and
G4ChipsKaonMinusInelasticXS
28 May 2015 A.Ribon (hadr-cross-V10-01-09)
---------------------------------------------------
07 November 2014 V.Grichine class managing single diffraction to
elastic cross section ratio G4DiffElasticRatio
- Added description of the classes G4IonProtonCrossSection and
G4GeneralSpaceNNCrossSection
27 May 2015 A.Ribon (hadr-cross-V10-01-08)
---------------------------------------------------
- G4ComponentGGHadronNucleusXsc : Grichine's extension of applicability
for kaons down to 0.1*MeV
- G4DiffElasticRatio : Grichine's addition of energy threshols to skip
the treatment of low-energy particles
27 May 2015 G.Folger (hadr-cross-V10-01-07)
---------------------------------------------------
- G4CrossSectionDataStore: Additions to print Html documentation
18 March 2015 V.Ivanchenko (hadr-cross-V10-01-06)
---------------------------------------------------
- G4KokoulinMuonNuclearXS - removed debug cout
17 March 2015 V.Ivanchenko (hadr-cross-V10-01-05)
---------------------------------------------------
- G4CrossSectionDataSetRegistry - protect deletion of NeutronHP
- G4KokoulinMuonNuclearXS - fixed initialisation for the case of
multiple runs
- G4DiffElasticRatio (V.Grichine) added protection for hydrogen
13 March 2015 V.Ivanchenko (hadr-cross-V10-01-04)
---------------------------------------------------
- G4CrossSectionDataSetRegistry, G4VCrossSectionDataSet - use
G4ThreadLocalSingletone; delete all x-sections at exit except HP
06 February 2015 W.Pokorski (hadr-cross-V10-01-03)
------------------------------------------------
- reverting back previous tag (causing FPE)
- including V.Grishine change in G4ComponentGGHadronNucleusXsc to work for H target
04 February 2015 W.Pokorski (hadr-cross-V10-01-02)
------------------------------------------------
- changing std::log and exp to G4Log and G4Exp
07 January 2015 W.Pokorski (hadr-cross-V10-01-01)
------------------------------------------------
- removing obsolete (wrong) checks for particle types in IsIsoApplicable
in Chips cross sections
12 December 2014 G.Cosmo (hadr-cross-V10-01-00)
---------------------------------------------------
- Workaround in G4CrossSectionFactory<T,2>::Instantiate() to allow for
compilation on clang-3.5 on Linux, for initialisation of TLS pointer.
18 November 2014 V.Ivanchenko (hadr-cross-V10-00-18)
---------------------------------------------------
- G4CrossSectionDataSetRegistry, G4CrossSectionFactoryRegistry,
G4HadronCrossSections - use thread local singletone for
proper deletion of cross sections end of run
07 November 2014 V.Grichine (hadr-cross-V10-00-17)
---------------------------------------------------
- Class managing single diffraction to elastic cross section ratio
G4DiffElasticRatio
30 October 2014 V.Ivanchenko (hadr-cross-V10-00-16)
---------------------------------------------------
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGNucleonElasticXS.hh 76889 2013-11-18 13:01:55Z gcosmo $
// $Id: G4BGGNucleonElasticXS.hh 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -54,7 +54,7 @@
#include "G4ParticleDefinition.hh"
#include "G4Element.hh"
class G4GlauberGribovCrossSection;
class G4ComponentGGHadronNucleusXsc;
class G4NucleonNuclearCrossSection;
class G4HadronNucleonXsc;
class G4ComponentSAIDTotalXS;
@@ -115,7 +115,7 @@ private:
const G4ParticleDefinition* particle;
const G4ParticleDefinition* theProton;
G4GlauberGribovCrossSection* fGlauber;
G4ComponentGGHadronNucleusXsc* fGlauber;
G4NucleonNuclearCrossSection* fNucleon;
G4HadronNucleonXsc* fHadron;
G4ComponentSAIDTotalXS* fSAID;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGNucleonInelasticXS.hh 76889 2013-11-18 13:01:55Z gcosmo $
// $Id: G4BGGNucleonInelasticXS.hh 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -53,7 +53,7 @@
#include "G4VCrossSectionDataSet.hh"
#include "G4ParticleDefinition.hh"
class G4GlauberGribovCrossSection;
class G4ComponentGGHadronNucleusXsc;
class G4NucleonNuclearCrossSection;
class G4HadronNucleonXsc;
class G4ComponentSAIDTotalXS;
@@ -114,7 +114,7 @@ private:
const G4ParticleDefinition* particle;
const G4ParticleDefinition* theProton;
G4GlauberGribovCrossSection* fGlauber;
G4ComponentGGHadronNucleusXsc* fGlauber;
G4NucleonNuclearCrossSection* fNucleon;
G4HadronNucleonXsc* fHadron;
G4ComponentSAIDTotalXS* fSAID;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGPionElasticXS.hh 66241 2012-12-13 18:34:42Z gunter $
// $Id: G4BGGPionElasticXS.hh 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -53,7 +53,7 @@
#include "G4VCrossSectionDataSet.hh"
#include "G4ParticleDefinition.hh"
class G4GlauberGribovCrossSection;
class G4ComponentGGHadronNucleusXsc;
class G4UPiNuclearCrossSection;
class G4HadronNucleonXsc;
class G4ComponentSAIDTotalXS;
@@ -107,7 +107,7 @@ private:
const G4ParticleDefinition* particle;
const G4ParticleDefinition* theProton;
G4GlauberGribovCrossSection* fGlauber;
G4ComponentGGHadronNucleusXsc* fGlauber;
G4UPiNuclearCrossSection* fPion;
G4HadronNucleonXsc* fHadron;
G4ComponentSAIDTotalXS* fSAID;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGPionInelasticXS.hh 70848 2013-06-06 12:00:02Z gcosmo $
// $Id: G4BGGPionInelasticXS.hh 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -56,7 +56,7 @@
#include "G4HadTmpUtil.hh"
class G4GlauberGribovCrossSection;
class G4ComponentGGHadronNucleusXsc;
class G4UPiNuclearCrossSection;
class G4HadronNucleonXsc;
class G4Pow;
@@ -116,7 +116,7 @@ private:
G4Pow* fG4pow;
G4GlauberGribovCrossSection* fGlauber;
G4ComponentGGHadronNucleusXsc* fGlauber;
G4UPiNuclearCrossSection* fPion;
G4HadronNucleonXsc* fHadron;
G4ComponentSAIDTotalXS* fSAID;
@@ -54,6 +54,8 @@ public:
static const char* Default_Name() {return "ChipsAntiBaryonElasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -51,6 +51,8 @@ public:
static const char* Default_Name() {return "ChipsAntiBaryonInelasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -53,6 +53,8 @@ public:
static const char* Default_Name() {return "ChipsHyperonElasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -53,6 +53,8 @@ public:
static const char* Default_Name() {return "ChipsHyperonInelasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -54,6 +54,8 @@ public:
static const char* Default_Name() {return "ChipsKaonMinusElasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -25,7 +25,6 @@
//
//
//
//
// GEANT4 physics class: G4ChipsKaonMinusInelasticXS -- header file
// Created: M.V. Kossov, CERN/ITEP(Moscow), 20-Dec-01
// The last update: M.V. Kossov, CERN/ITEP (Moscow) 17-May-02
@@ -54,6 +53,7 @@ public:
static const char* Default_Name() {return "ChipsKaonMinusInelasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
@@ -53,6 +53,8 @@ public:
static const char* Default_Name() {return "ChipsKaonPlusElasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -55,6 +55,8 @@ public:
static const char* Default_Name() {return "ChipsKaonPlusInelasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -58,6 +58,8 @@ public:
static const char* Default_Name() {return "ChipsKaonZeroElasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -58,6 +58,8 @@ public:
static const char* Default_Name() {return "ChipsKaonZeroInelasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -54,6 +54,8 @@ public:
static const char* Default_Name() {return "ChipsNeutronElasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -54,6 +54,8 @@ public:
static const char* Default_Name() {return "ChipsNeutronInelasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
// At present momentum (pMom) in MeV/c, CS in mb (@@ Units)
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
@@ -54,6 +54,8 @@ public:
static const char* Default_Name() {return "ChipsPionMinusElasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -54,6 +54,8 @@ public:
static const char* Default_Name() {return "ChipsPionMinusInelasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -53,6 +53,8 @@ public:
static const char* Default_Name() {return "ChipsPionPlusElasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -56,6 +56,8 @@ public:
static const char* Default_Name() {return "ChipsPionPlusInelasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -52,6 +52,8 @@ public:
static const char* Default_Name() {return "ChipsProtonElasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -52,6 +52,8 @@ public:
static const char* Default_Name() {return "ChipsProtonInelasticXS";}
virtual void CrossSectionDescription(std::ostream&) const;
virtual G4bool IsIsoApplicable(const G4DynamicParticle* Pt, G4int Z, G4int A,
const G4Element* elm,
const G4Material* mat );
@@ -55,6 +55,7 @@ public:
G4ComponentGGHadronNucleusXsc ();
virtual ~G4ComponentGGHadronNucleusXsc ();
static const char* Default_Name() { return "Glauber-Gribov"; }
// virtual interface methods
@@ -125,7 +126,8 @@ virtual
G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetHadronNucleonXscNS(const G4DynamicParticle*, const G4Element*);
G4double GetHadronNucleonXscNS(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetKaonNucleonXscVector(const G4DynamicParticle*, G4int At, G4int Zt);
// G4double GetKaonNucleonXscVector(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetHNinelasticXsc(const G4DynamicParticle*, const G4Element*);
G4double GetHNinelasticXsc(const G4DynamicParticle*, G4int At, G4int Zt);
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CrossSectionDataSetRegistry.hh 68777 2013-04-05 12:52:17Z gcosmo $
// $Id: G4CrossSectionDataSetRegistry.hh 89024 2015-03-18 08:17:25Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -48,13 +48,15 @@
#include <vector>
#include <map>
#include "globals.hh"
#include "G4ThreadLocalSingleton.hh"
class G4VCrossSectionDataSet;
//class G4VBaseXSFactory; //AND
class G4CrossSectionDataSetRegistry
{
friend class G4ThreadLocalSingleton<G4CrossSectionDataSetRegistry>;
public:
static G4CrossSectionDataSetRegistry* Instance();
@@ -73,13 +75,14 @@ public:
//void AddFactory(G4String, G4VBaseXSFactory*);//AND
G4VCrossSectionDataSet* GetCrossSectionDataSet(const G4String& name, G4bool warning=true);
G4VCrossSectionDataSet* GetCrossSectionDataSet(const G4String& name,
G4bool warning=true);
private:
G4CrossSectionDataSetRegistry();
static G4ThreadLocal G4CrossSectionDataSetRegistry* theInstance;
static G4ThreadLocal G4CrossSectionDataSetRegistry* instance;
std::vector <G4VCrossSectionDataSet*> xSections;
@@ -47,10 +47,13 @@
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
#include "G4FastPathHadronicCrossSection.hh"
#include "G4DynamicParticle.hh"
#include "G4PhysicsVector.hh"
#include <vector>
#include <iostream>
class G4Nucleus;
class G4DynamicParticle;
class G4ParticleDefinition;
class G4Isotope;
class G4Element;
@@ -66,7 +69,7 @@ public:
~G4CrossSectionDataStore();
// Cross section per unit volume is computed (inverse mean free path)
G4double GetCrossSection(const G4DynamicParticle*, const G4Material*);
inline G4double GetCrossSection(const G4DynamicParticle*, const G4Material*);
// Cross section per element is computed
G4double GetCrossSection(const G4DynamicParticle*,
@@ -88,8 +91,9 @@ public:
void DumpPhysicsTable(const G4ParticleDefinition&);
// Dump store as html
void DumpHtml(const G4ParticleDefinition&, std::ofstream&);
void DumpHtml(const G4ParticleDefinition&, std::ofstream&) const;
void PrintCrossSectionHtml(const G4VCrossSectionDataSet *cs) const;
inline void AddDataSet(G4VCrossSectionDataSet*);
inline void SetVerboseLevel(G4int value);
@@ -104,6 +108,8 @@ private:
G4CrossSectionDataStore & operator=(const G4CrossSectionDataStore &right);
G4CrossSectionDataStore(const G4CrossSectionDataStore&);
G4String HtmlFileName(const G4String & in) const;
G4NistManager* nist;
std::vector<G4VCrossSectionDataSet*> dataSetList;
@@ -123,8 +129,34 @@ private:
G4int nDataSetList;
G4int verboseLevel;
//Fast path: caching
public:
inline const G4FastPathHadronicCrossSection::fastPathParameters&
GetFastPathParameters() const { return fastPathParams; }
inline const G4FastPathHadronicCrossSection::controlFlag&
GetFastPathControlFlags() const { return fastPathFlags; }
void DumpFastPath( const G4ParticleDefinition* , const G4Material* , std::ostream& os);
void ActivateFastPath( const G4ParticleDefinition*, const G4Material* , G4double);
private:
friend struct G4FastPathHadronicCrossSection::fastPathEntry;
//The following method is called by the public one GetCrossSection(const G4DynamicParticle*, const G4Material*)
//The third parameter is used to force the calculation of cross-sections skipping the fast-path mechanism
G4double GetCrossSection(const G4DynamicParticle*, const G4Material*, G4bool requiresSlowPath);
G4FastPathHadronicCrossSection::controlFlag fastPathFlags;
G4FastPathHadronicCrossSection::fastPathParameters fastPathParams;
//Counters
G4FastPathHadronicCrossSection::getCrossSectionCount counters;
//TODO: share this among threads
G4FastPathHadronicCrossSection::G4CrossSectionDataStore_Cache fastPathCache;
G4FastPathHadronicCrossSection::timing timing;
G4FastPathHadronicCrossSection::G4CrossSectionDataStore_Requests requests;
};
inline G4double G4CrossSectionDataStore::GetCrossSection(const G4DynamicParticle* particle , const G4Material* material ) {
//By default tries to use the fast-path mechanism
return GetCrossSection( particle , material , false);
}
inline void G4CrossSectionDataStore::AddDataSet(G4VCrossSectionDataSet* p)
{
dataSetList.push_back(p);
@@ -105,7 +105,8 @@ template <typename T> class G4CrossSectionFactory<T,2> : public G4VBaseXSFactory
virtual G4VCrossSectionDataSet* Instantiate()
{
static G4ThreadLocal T* shared = new T();
static G4ThreadLocal T* shared = 0;
if (!shared) { shared = new T(); }
return shared;
}
};
@@ -23,13 +23,13 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CrossSectionPairGG.hh 79981 2014-03-27 15:24:11Z gcosmo $
// $Id: G4CrossSectionPairGG.hh 93682 2015-10-28 10:09:49Z gcosmo $
// $ GEANT4 tag $Name: not supported by cvs2svn $
//
// Class G4CrossSectionPairGG
//
// Extend a cross section to higher energies using
// G4GlauberGribovCrossSection at high energies.
// G4ComponentGGHadronNucleusXsc at high energies.
// Smoothly join cross section sets by scaling GG at a given
// transition energy to match the given low energy cross section.
//
@@ -42,11 +42,11 @@
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
#include "G4ParticleDefinition.hh"
#include "G4GlauberGribovCrossSection.hh"
#include <valarray>
#include <iostream>
class G4NistManager;
class G4ComponentGGHadronNucleusXsc;
class G4CrossSectionPairGG : public G4VCrossSectionDataSet
{
@@ -80,7 +80,7 @@ class G4CrossSectionPairGG : public G4VCrossSectionDataSet
G4NistManager* NistMan;
G4VCrossSectionDataSet * theLowX;
G4GlauberGribovCrossSection * theHighX;
G4ComponentGGHadronNucleusXsc * theHighX;
G4double ETransition;
typedef std::valarray<G4double> XS_factors;
typedef std::pair<const G4ParticleDefinition *, XS_factors > ParticleXScale;
@@ -65,7 +65,8 @@ public:
G4double kinEnergy,
G4int Z, G4int A);
void SetEnergyThreshold(G4double e){fDDthreshold=e;};
G4double GetEnergyThreshold(){return fDDthreshold;};
private:
@@ -73,6 +74,7 @@ private:
G4DiffElasticRatio(const G4DiffElasticRatio&);
G4ComponentGGHadronNucleusXsc* fGGXsc;
G4double fDDthreshold;
};
#endif
@@ -0,0 +1,310 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef G4FastPathHadronicCrossSection_hh
#define G4FastPathHadronicCrossSection_hh
#include "G4PhysicsFreeVector.hh"
#include "G4ParticleDefinition.hh"
#include "G4Material.hh"
#include <functional>
#include <utility>
#include <unordered_map>
#include <iostream>
#include <set>
#include <stdint.h>
class G4DynamicParticle;
class G4Material;
class G4CrossSectionDataStore;
//To measure performances and debug info on fast cross-section enable this
//#define FPDEBUG
//TODO: Move all logging and debug functionality to separate header
namespace G4FastPathHadronicCrossSection {
//This data type contains the simplified representation of the
//cross-section, by default it is a G4PhysicsVector type
using XSParam=G4PhysicsFreeVector;
//The key used to search in the cache.
using G4CrossSectionDataStore_Key=std::pair<const G4ParticleDefinition*,const G4Material*>;
//This represents the fast XS implementation.
struct fastPathEntry{
//fastPathEntry();
fastPathEntry(const G4ParticleDefinition *par,const G4Material* mat,G4double min_cutoff);
~fastPathEntry();
inline G4double GetCrossSection(G4double ene) const { return physicsVector->Value(ene); }
void Initialize(G4CrossSectionDataStore* );
const G4ParticleDefinition * const particle;
const G4Material * const material;
const G4double min_cutoff;
XSParam *physicsVector;
# ifdef FPDEBUG
//stats for debug
G4int count;
G4double slowpath_sum; //sum of all slowpath xs
G4double max_delta;
G4double min_delta;
G4double sum_delta;
G4double sum_delta_square;
# endif
};
//A cache entry.
struct cycleCountEntry{
cycleCountEntry(const G4String& pname , const G4Material* mat);
~cycleCountEntry();
const G4String& particle;
const G4Material * const material;
//optional fastPathEntry
fastPathEntry* fastPath;
//cache per element of material test
G4double energy;
G4double crossSection;
# ifdef FPDEBUG
uint64_t cacheHitCount;//
uint64_t initCyclesFastPath;
uint64_t invocationCountSlowPath;
uint64_t totalCyclesSlowPath;
uint64_t invocationCountFastPath;
uint64_t totalCyclesFastPath;
uint64_t invocationCountTriedOneLineCache;//
uint64_t invocationCountOneLineCache;//
# endif
};
struct timing {
unsigned long long rdtsc_start;
unsigned long long rdtsc_stop;
};
struct getCrossSectionCount {
getCrossSectionCount();
inline void MethodCalled();
inline void HitOneLine();
inline void FastPath();
inline void SlowPath();
inline void SampleZandA();
#ifdef FPDEBUG
uint64_t methodCalled;
uint64_t hitOneLineCache;
uint64_t fastPath;
uint64_t slowPath;
uint64_t sampleZandA;
#endif
};
//Hashing the key
struct G4CrossSectionDataStore_Key_Hash {
std::hash<uint64_t> hash_uint64_t;
inline size_t operator()(const G4CrossSectionDataStore_Key& x) const throw() {
return hash_uint64_t(hash_uint64_t( ((uint64_t)(x.first)) ) + hash_uint64_t(((uint64_t)(x.second))));
}
};
//Equality for two key elements
struct G4CrossSectionDataStore_Key_EqualTo {
inline bool operator()(const G4CrossSectionDataStore_Key& lhs, const G4CrossSectionDataStore_Key& rhs ) const {
//TODO: Verify this: particles are singletons, materials use operator==
//TODO: in ref-10, G4Material::operator== becomes deleted, investigating why
return (lhs.first==rhs.first)&&(lhs.second == rhs.second);
}
};
// The cache itself
using G4CrossSectionDataStore_Cache=std::unordered_map<G4CrossSectionDataStore_Key,cycleCountEntry*,
G4CrossSectionDataStore_Key_Hash,G4CrossSectionDataStore_Key_EqualTo>;
struct fastPathRequestConfig_t {
G4CrossSectionDataStore_Key part_mat;
G4double min_cutoff;
};
//Two of the elements are identical if the part_mat part is
struct fastPathRequestConfig_Less {
std::less<G4CrossSectionDataStore_Key> less;
inline bool operator()(const fastPathRequestConfig_t& lhs,const fastPathRequestConfig_t& rhs ) const {
return less(lhs.part_mat,rhs.part_mat);
}
};
using G4CrossSectionDataStore_Requests=std::set<fastPathRequestConfig_t,fastPathRequestConfig_Less>;
//Configure the caching mechanism
struct controlFlag {
G4bool prevCalcUsedFastPath;
G4bool useFastPathIfAvailable;
G4bool initializationPhase;
controlFlag() : prevCalcUsedFastPath(false),useFastPathIfAvailable(false),initializationPhase(false) {}
};
//Parameters to control sampling
struct fastPathParameters {
fastPathParameters() {
//default
//TODO: are these ok?
queryMax = 10000;
sampleMin = 0.0001;
sampleMax = 10000;
sampleCount = 200000;
dpTol = 0.01;
}
//PRUTH vars for sampling and surragate model
G4double queryMax;
G4double sampleMin;
G4double sampleMax;
G4int sampleCount;
G4double dpTol;
};
//Logging functionalities, disabled if not in FPDEBUG mode
static inline void logInvocationTriedOneLine( cycleCountEntry* );
static inline void logInvocationOneLine( cycleCountEntry* );
static inline void logHit(cycleCountEntry*);
static inline void logInvocationCountFastPath( cycleCountEntry* );
static inline void logInvocationCountSlowPAth( cycleCountEntry* );
#ifdef FPDEBUG
void logStartCountCycles( timing& );
void logStopCountCycles( timing& );
#else
inline void logStartCountCycles(timing&) {}
inline void logStopCountCycles(timing&) {}
#endif
static inline void logInitCyclesFastPath( cycleCountEntry* , timing& );
static inline void logTotalCyclesFastPath( cycleCountEntry* , timing& );
static inline void logTotalCyclesSlowPath( cycleCountEntry* , timing& );
static inline void logTiming( cycleCountEntry* , fastPathEntry* , timing& );
}
inline std::ostream& operator<<(std::ostream& os, const G4FastPathHadronicCrossSection::fastPathEntry& fp);
//Implementation of inline functions. Note the ifdef
namespace G4FastPathHadronicCrossSection {
#ifdef FPDEBUG
inline void logInvocationTriedOneLine(cycleCountEntry* cl ) {
if ( cl != nullptr ) ++(cl->invocationCountTriedOneLineCache);
}
inline void logInvocationOneLine( cycleCountEntry* cl ) {
if ( cl != nullptr ) ++(cl->invocationCountOneLineCache);
}
inline void logHit(cycleCountEntry* cl) {
if ( cl != nullptr ) ++(cl->cacheHitCount);
}
inline void logInvocationCountFastPath( cycleCountEntry* cl )
{
if ( cl != nullptr ) ++(cl->invocationCountFastPath);
}
inline void logInvocationCountSlowPAth( cycleCountEntry* cl)
{
if ( cl != nullptr ) ++(cl->invocationCountSlowPath);
}
inline void logInitCyclesFastPath(cycleCountEntry* cl,timing& tm)
{
if ( cl != nullptr ) cl->initCyclesFastPath = tm.rdtsc_stop - tm.rdtsc_start;
}
inline void logTotalCyclesFastPath( cycleCountEntry* cl,timing& tm)
{
if ( cl!=nullptr ) cl->totalCyclesFastPath = tm.rdtsc_stop - tm.rdtsc_start;
}
inline void logTotalCyclesSlowPath( cycleCountEntry* cl,timing& tm)
{
if ( cl!=nullptr ) cl->totalCyclesSlowPath = tm.rdtsc_stop - tm.rdtsc_start;
}
inline void logTiming( cycleCountEntry* entry , fastPathEntry* fast_entry, timing& timing)
{
if (fast_entry != nullptr ) {
if ( entry->invocationCountFastPath == 0 ) {
//PRUTH style initialization
G4FastPathHadronicCrossSection::logInitCyclesFastPath(entry,timing);
G4FastPathHadronicCrossSection::logInvocationCountFastPath(entry);
} else {
//PRUTH comment to understand:
//the first one includes the initialization... don't count it for now
G4FastPathHadronicCrossSection::logTotalCyclesFastPath(entry,timing);
G4FastPathHadronicCrossSection::logInvocationCountFastPath(entry);
}
} else {
G4FastPathHadronicCrossSection::logInvocationCountSlowPAth(entry);
G4FastPathHadronicCrossSection::logTotalCyclesSlowPath(entry,timing);
}
}
#else
inline void logInvocationTriedOneLine(cycleCountEntry*){}
inline void logInvocationOneLine( cycleCountEntry*){}
inline void logHit(cycleCountEntry*){}
inline void logInvocationCountFastPath( cycleCountEntry*){}
inline void logInvocationCountSlowPAth( cycleCountEntry*){}
inline void logInitCyclesFastPath( cycleCountEntry* , timing& ){}
inline void logTotalCyclesFastPath( cycleCountEntry* , timing& ){}
inline void logTotalCyclesSlowPath( cycleCountEntry* , timing& ){}
inline void logTiming( cycleCountEntry* , fastPathEntry* , timing& ) {}
#endif
inline void getCrossSectionCount::MethodCalled() {
#ifdef FPDEBUG
++methodCalled;
#endif
}
inline void getCrossSectionCount::HitOneLine() {
#ifdef FPDEBUG
++hitOneLineCache;
#endif
}
inline void getCrossSectionCount::FastPath() {
#ifdef FPDEBUG
++fastPath;
#endif
}
inline void getCrossSectionCount::SlowPath() {
#ifdef FPDEBUG
++slowPath;
#endif
}
inline void getCrossSectionCount::SampleZandA() {
#ifdef FPDEBUG
++sampleZandA;
#endif
}
}//namespace
inline std::ostream& operator<<(std::ostream& os, const G4FastPathHadronicCrossSection::fastPathEntry& fp) {
using CLHEP::MeV;
os<<"#Particle: "<<(fp.particle!=nullptr?fp.particle->GetParticleName():"UNDEFINED")<<"\n";
os<<"#Material: "<<(fp.material!=nullptr?fp.material->GetName():"UNDEFINED")<<"\n";
os<<"#min_cutoff(MeV): "<<fp.min_cutoff/MeV<<"\n";
#ifdef FPDEBUG
os<<"#DEBUG COUNTERS: count="<<fp.count<<" slowpath_sum="<<fp.slowpath_sum<<" max_delta="<<fp.max_delta;
os<<" min_delta="<<fp.min_delta<<" sum_delta="<<fp.sum_delta<<" sum_delta_square="<<fp.sum_delta_square<<"\n";
#endif
os<<*(fp.physicsVector)<<"\n";
return os;
}
#endif //G4FastPathHadronicCrossSection_hh
@@ -1,153 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Calculation of the nucleus-nucleus total, inelastic, production,
// elastic and quasi-elastic cross-sections
// based on parametrisations of nucleon-nucleon
// cross-sections in
// the framework of simplified Glauber-Gribov approach
//
//
// 24.11.08 V. Grichine - first implementation based on G4GlauberGribovCrossSection
//
//
#ifndef G4GGNuclNuclCrossSection_h
#define G4GGNuclNuclCrossSection_h
#include "globals.hh"
#include "G4Proton.hh"
#include "G4Nucleus.hh"
#include "G4NistManager.hh"
#include "G4VCrossSectionDataSet.hh"
class G4ParticleDefinition;
class G4HadronNucleonXsc;
class G4GGNuclNuclCrossSection : public G4VCrossSectionDataSet
{
public:
G4GGNuclNuclCrossSection ();
virtual ~G4GGNuclNuclCrossSection ();
static const char* Default_Name() {return "Glauber-Gribov nucleus nucleus";}
virtual
G4bool IsElementApplicable(const G4DynamicParticle*,
G4int Z, const G4Material*);
virtual
G4double GetElementCrossSection(const G4DynamicParticle*,
G4int Z, const G4Material*);
G4double GetZandACrossSection(const G4DynamicParticle*,
G4int Z, G4int A);
G4double GetCoulombBarier(const G4DynamicParticle*,
G4double Z, G4double A, G4double pR, G4double tR);
virtual
void BuildPhysicsTable(const G4ParticleDefinition&)
{}
virtual
void DumpPhysicsTable(const G4ParticleDefinition&)
{G4cout << "G4NuclNuclCrossSection: uses Glauber-Gribov formula"<<G4endl;}
virtual void CrossSectionDescription(std::ostream&) const;
G4double GetRatioSD(const G4DynamicParticle*, G4double At, G4double Zt);
G4double GetRatioQE(const G4DynamicParticle*, G4double At, G4double Zt);
G4double GetHadronNucleonXsc(const G4DynamicParticle*, const G4Element*);
G4double GetHadronNucleonXsc(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetHadronNucleonXscPDG(const G4ParticleDefinition*,G4double sMand, const G4ParticleDefinition*);
G4double GetHadronNucleonXscNS(const G4ParticleDefinition*,G4double pTkin, const G4ParticleDefinition*);
G4double GetHNinelasticXscVU(const G4DynamicParticle*, G4int At, G4int Zt);
G4double CalculateEcmValue(const G4double, const G4double, const G4double);
G4double CalcMandelstamS( const G4double , const G4double , const G4double );
G4double GetElasticGlauberGribov(const G4DynamicParticle*,G4int Z, G4int A);
G4double GetInelasticGlauberGribov(const G4DynamicParticle*,G4int Z, G4int A);
G4double GetTotalGlauberGribovXsc() { return fTotalXsc; };
G4double GetElasticGlauberGribovXsc() { return fElasticXsc; };
G4double GetInelasticGlauberGribovXsc(){ return fInelasticXsc; };
G4double GetProductionGlauberGribovXsc(){ return fProductionXsc; };
G4double GetDiffractionGlauberGribovXsc(){ return fDiffractionXsc; };
G4double GetRadiusConst() { return fRadiusConst; };
G4double GetNucleusRadius(const G4DynamicParticle*, const G4Element*);
G4double GetNucleusRadius(G4double Zt, G4double At);
G4double GetNucleusRadiusGG(G4double At);
G4double GetNucleusRadiusDE(G4double Z, G4double A);
G4double GetNucleusRadiusRMS(G4double Z, G4double A);
inline void SetEnergyLowerLimit(G4double E ){fLowerLimit=E;};
private:
// const G4double fUpperLimit;
G4double fLowerLimit;
const G4double fRadiusConst;
G4double fTotalXsc, fElasticXsc, fInelasticXsc, fProductionXsc, fDiffractionXsc;
// G4double fHadronNucleonXsc;
const G4ParticleDefinition* theProton;
const G4ParticleDefinition* theNeutron;
G4HadronNucleonXsc* hnXsc;
};
////////////////////////////////////////////////////////////////
//
// Inlines
inline G4double
G4GGNuclNuclCrossSection::GetElasticGlauberGribov(const G4DynamicParticle* dp,
G4int Z, G4int A)
{
GetZandACrossSection(dp, Z, A);
return fElasticXsc;
}
/////////////////////////////////////////////////////////////////
inline G4double
G4GGNuclNuclCrossSection::GetInelasticGlauberGribov(const G4DynamicParticle* dp,
G4int Z, G4int A)
{
GetZandACrossSection(dp, Z, A);
return fInelasticXsc;
}
#endif
@@ -98,6 +98,8 @@ public:
G4double GetElementCrossSection(const G4DynamicParticle* theProjectile,
G4int Z, const G4Material*);
virtual void CrossSectionDescription(std::ostream& outFile) const;
private:
G4ProtonInelasticCrossSection *protonInelastic;
@@ -1,235 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * 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. *
// ********************************************************************
//
// Calculation of the total, elastic and inelastic cross-sections
// based on parametrisations of (proton, pion, kaon, photon) nucleon
// cross-sections and the hadron-nucleous cross-section model in
// the framework of Glauber-Gribov approach
//
//
//
//
//
// 17.07.06 V. Grichine - first implementation
// 22.01.07 V.Ivanchenko - add interface with Z and A
// 05.03.07 V.Ivanchenko - add IfZAApplicable
// 06.03.07 V.Ivanchenko - add GetElasticGlauberGribov and GetElasticGlauberGribov
// for combined dataset
//
//
#ifndef G4GlauberGribovCrossSection_h
#define G4GlauberGribovCrossSection_h 1
#include "globals.hh"
#include "G4Proton.hh"
#include "G4Nucleus.hh"
#include "G4VCrossSectionDataSet.hh"
class G4ParticleDefinition;
class G4HadronNucleonXsc;
class G4GlauberGribovCrossSection : public G4VCrossSectionDataSet
{
public:
G4GlauberGribovCrossSection ();
virtual ~G4GlauberGribovCrossSection ();
static const char* Default_Name() {return "Glauber-Gribov";}
virtual
G4bool IsIsoApplicable(const G4DynamicParticle* aDP, G4int Z, G4int A,
const G4Element* elm = 0,
const G4Material* mat = 0);
virtual
G4double GetIsoCrossSection(const G4DynamicParticle*, G4int Z, G4int A,
const G4Isotope* iso = 0,
const G4Element* elm = 0,
const G4Material* mat = 0);
G4double GetRatioSD(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetRatioQE(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetHadronNucleonXsc(const G4DynamicParticle*, const G4Element*);
G4double GetHadronNucleonXsc(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, const G4Element*);
G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetHadronNucleonXscNS(const G4DynamicParticle*, const G4Element*);
G4double GetHadronNucleonXscNS(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetKaonNucleonXscVector(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetHNinelasticXsc(const G4DynamicParticle*, const G4Element*);
G4double GetHNinelasticXsc(const G4DynamicParticle*, G4int At, G4int Zt);
G4double GetHNinelasticXscVU(const G4DynamicParticle*, G4int At, G4int Zt);
G4double CalculateEcmValue ( const G4double , const G4double , const G4double );
G4double CalcMandelstamS( const G4double , const G4double , const G4double );
G4double GetNucleusRadius(const G4DynamicParticle*, const G4Element*);
G4double GetNucleusRadius(G4int At);
virtual void CrossSectionDescription(std::ostream&) const;
inline G4double GetElasticGlauberGribov(const G4DynamicParticle*, G4int Z, G4int A);
inline G4double GetInelasticGlauberGribov(const G4DynamicParticle*, G4int Z, G4int A);
inline G4double GetTotalGlauberGribovXsc() { return fTotalXsc; };
inline G4double GetElasticGlauberGribovXsc() { return fElasticXsc; };
inline G4double GetInelasticGlauberGribovXsc(){ return fInelasticXsc; };
inline G4double GetProductionGlauberGribovXsc(){ return fProductionXsc; };
inline G4double GetDiffractionGlauberGribovXsc(){ return fDiffractionXsc; };
inline G4double GetRadiusConst() { return fRadiusConst; };
inline G4double GetParticleBarCorTot(const G4ParticleDefinition* theParticle, G4int Z);
inline G4double GetParticleBarCorIn(const G4ParticleDefinition* theParticle, G4int Z);
inline void SetEnergyLowerLimit(G4double E ){fLowerLimit=E;};
private:
// const G4double fUpperLimit;
G4double fLowerLimit;
const G4double fRadiusConst;
static const G4double fNeutronBarCorrectionTot[93];
static const G4double fNeutronBarCorrectionIn[93];
static const G4double fProtonBarCorrectionTot[93];
static const G4double fProtonBarCorrectionIn[93];
static const G4double fPionPlusBarCorrectionTot[93];
static const G4double fPionPlusBarCorrectionIn[93];
static const G4double fPionMinusBarCorrectionTot[93];
static const G4double fPionMinusBarCorrectionIn[93];
G4double fTotalXsc, fElasticXsc, fInelasticXsc, fProductionXsc, fDiffractionXsc;
// G4double fHadronNucleonXsc;
G4ParticleDefinition* theGamma;
G4ParticleDefinition* theProton;
G4ParticleDefinition* theNeutron;
G4ParticleDefinition* theAProton;
G4ParticleDefinition* theANeutron;
G4ParticleDefinition* thePiPlus;
G4ParticleDefinition* thePiMinus;
G4ParticleDefinition* thePiZero;
G4ParticleDefinition* theKPlus;
G4ParticleDefinition* theKMinus;
G4ParticleDefinition* theK0S;
G4ParticleDefinition* theK0L;
G4ParticleDefinition* theL;
G4ParticleDefinition* theAntiL;
G4ParticleDefinition* theSPlus;
G4ParticleDefinition* theASPlus;
G4ParticleDefinition* theSMinus;
G4ParticleDefinition* theASMinus;
G4ParticleDefinition* theS0;
G4ParticleDefinition* theAS0;
G4ParticleDefinition* theXiMinus;
G4ParticleDefinition* theXi0;
G4ParticleDefinition* theAXiMinus;
G4ParticleDefinition* theAXi0;
G4ParticleDefinition* theOmega;
G4ParticleDefinition* theAOmega;
G4ParticleDefinition* theD;
G4ParticleDefinition* theT;
G4ParticleDefinition* theA;
G4ParticleDefinition* theHe3;
G4HadronNucleonXsc* hnXsc;
};
////////////////////////////////////////////////////////////////
//
// Inlines
inline
G4double
G4GlauberGribovCrossSection::GetElasticGlauberGribov(const G4DynamicParticle* dp,
G4int Z, G4int A)
{
GetIsoCrossSection(dp, Z, A);
return fElasticXsc;
}
/////////////////////////////////////////////////////////////////
inline
G4double
G4GlauberGribovCrossSection::GetInelasticGlauberGribov(const G4DynamicParticle* dp,
G4int Z, G4int A)
{
GetIsoCrossSection(dp, Z, A);
return fInelasticXsc;
}
/////////////////////////////////////////////////////////////////////
//
// return correction at Tkin = 90*GeV GG -> Barashenkov tot xsc, when it
// is available, else return 1.0
inline G4double G4GlauberGribovCrossSection::GetParticleBarCorTot(
const G4ParticleDefinition* theParticle, G4int Z)
{
if(Z >= 2 && Z <= 92)
{
if( theParticle == theProton ) return fProtonBarCorrectionTot[Z];
else if( theParticle == theNeutron) return fNeutronBarCorrectionTot[Z];
else if( theParticle == thePiPlus ) return fPionPlusBarCorrectionTot[Z];
else if( theParticle == thePiMinus) return fPionMinusBarCorrectionTot[Z];
else return 1.0;
}
else return 1.0;
}
/////////////////////////////////////////////////////////////////////
//
// return correction at Tkin = 90*GeV GG -> Barashenkov in xsc, when it
// is available, else return 1.0
inline G4double G4GlauberGribovCrossSection::GetParticleBarCorIn(
const G4ParticleDefinition* theParticle, G4int Z)
{
if(Z >= 2 && Z <= 92)
{
if( theParticle == theProton ) return fProtonBarCorrectionIn[Z];
else if( theParticle == theNeutron) return fNeutronBarCorrectionIn[Z];
else if( theParticle == thePiPlus ) return fPionPlusBarCorrectionIn[Z];
else if( theParticle == thePiMinus) return fPionMinusBarCorrectionIn[Z];
else return 1.0;
}
else return 1.0;
}
#endif
@@ -91,12 +91,13 @@ public:
G4double GetElasticHadronNucleonXsc() { return fElasticXsc; };
G4double GetInelasticHadronNucleonXsc(){ return fInelasticXsc; };
/*
void InitialiseKaonNucleonTotXsc();
G4double GetKpProtonTotXscVector(G4double logEnergy){ return fKpProtonTotXscVector.Value(logEnergy); };
G4double GetKpNeutronTotXscVector(G4double logEnergy){ return fKpNeutronTotXscVector.Value(logEnergy); };
G4double GetKmProtonTotXscVector(G4double logEnergy){ return fKmProtonTotXscVector.Value(logEnergy); };
G4double GetKmNeutronTotXscVector(G4double logEnergy){ return fKmNeutronTotXscVector.Value(logEnergy); };
*/
private:
@@ -105,7 +106,7 @@ private:
G4double fTotalXsc, fElasticXsc, fInelasticXsc;
// G4double fHadronNucleonXsc;
/*
// K-nucleon tot xsc (mb) fit data, std::log(Tkin(MeV))
static const G4double fKpProtonTotXsc[66];
@@ -124,7 +125,7 @@ private:
G4LPhysicsFreeVector fKpNeutronTotXscVector;
G4LPhysicsFreeVector fKmProtonTotXscVector;
G4LPhysicsFreeVector fKmNeutronTotXscVector;
*/
G4ParticleDefinition* theGamma;
G4ParticleDefinition* theProton;
G4ParticleDefinition* theNeutron;
@@ -57,6 +57,9 @@ public:
G4KokoulinMuonNuclearXS();
virtual ~G4KokoulinMuonNuclearXS();
static const char* Default_Name() {return "KokoulinMuonNuclearXS";}
virtual void CrossSectionDescription(std::ostream&) const;
G4bool IsElementApplicable(const G4DynamicParticle* particle,
G4int Z, const G4Material*);
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NeutronCaptureXS.hh 83697 2014-09-10 07:15:29Z gcosmo $
// $Id: G4NeutronCaptureXS.hh 91580 2015-07-27 12:55:01Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -110,9 +110,7 @@ private:
G4bool isMaster;
static G4ElementData* data;
std::vector<G4PhysicsVector*> work;
std::vector<G4double> temp;
std::vector<G4double> temp;
static const G4int amin[MAXZCAPTURE];
static const G4int amax[MAXZCAPTURE];
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NeutronElasticXS.hh 83697 2014-09-10 07:15:29Z gcosmo $
// $Id: G4NeutronElasticXS.hh 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -55,7 +55,7 @@ class G4DynamicParticle;
class G4ParticleDefinition;
class G4Element;
class G4PhysicsVector;
class G4GlauberGribovCrossSection;
class G4ComponentGGHadronNucleusXsc;
class G4HadronNucleonXsc;
class G4NeutronElasticXS : public G4VCrossSectionDataSet
@@ -88,7 +88,7 @@ private:
G4NeutronElasticXS & operator=(const G4NeutronElasticXS &right);
G4NeutronElasticXS(const G4NeutronElasticXS&);
G4GlauberGribovCrossSection* ggXsection;
G4ComponentGGHadronNucleusXsc* ggXsection;
G4HadronNucleonXsc* fNucleon;
const G4ParticleDefinition* proton;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NeutronInelasticXS.hh 83697 2014-09-10 07:15:29Z gcosmo $
// $Id: G4NeutronInelasticXS.hh 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -56,7 +56,7 @@ class G4DynamicParticle;
class G4ParticleDefinition;
class G4Element;
class G4PhysicsVector;
class G4GlauberGribovCrossSection;
class G4ComponentGGHadronNucleusXsc;
class G4HadronNucleonXsc;
class G4NeutronInelasticXS : public G4VCrossSectionDataSet
@@ -105,7 +105,7 @@ private:
G4NeutronInelasticXS & operator=(const G4NeutronInelasticXS &right);
G4NeutronInelasticXS(const G4NeutronInelasticXS&);
G4GlauberGribovCrossSection* ggXsection;
G4ComponentGGHadronNucleusXsc* ggXsection;
G4HadronNucleonXsc* fNucleon;
const G4ParticleDefinition* proton;
@@ -113,8 +113,7 @@ private:
G4bool isMaster;
static G4ElementData* data;
std::vector<G4PhysicsVector*> work;
std::vector<G4double> temp;
std::vector<G4double> temp;
static G4double coeff[MAXZINEL];
@@ -29,6 +29,9 @@
#include <cmath>
#include <iostream>
#include "G4Exp.hh"
#include "G4Log.hh"
#include "G4Pow.hh"
// Implements Physical Review C61, 034607 (2000)
// Rewrite starting from EPAX Version 2
@@ -75,25 +78,25 @@ class G4ProjectileFragmentCrossSection
inline G4double doit(G4double Ap, G4double Zp, G4double At, G4double Zt, G4double A, G4double Z)
{
// calculate mass yield
G4double Ap13 = std::pow(Ap, 1./3.);
G4double At13 = std::pow(At, 1./3.);
G4double Ap13 = G4Pow::GetInstance()->powA(Ap, 1./3.);
G4double At13 = G4Pow::GetInstance()->powA(At, 1./3.);
G4double S = p_S[2] * (At13 + Ap13 + p_S[1]);
// cout << "debug0 "<<S<<" "<<At13<<" "<<Ap13<<" "<<p_S[1]<<" "<<p_S[2]<<endl;
G4double p = std::exp(p_P[2]*Ap + p_P[1]);
G4double yield_a = p * S * std::exp(-p * (Ap - A));
G4double p = G4Exp(p_P[2]*Ap + p_P[1]);
G4double yield_a = p * S * G4Exp(-p * (Ap - A));
cout << "debug1 "<<yield_a<<endl;
// modification close to projectile
G4double f_mod_y=1.0;
if (A/Ap > corr_y[2])
{
f_mod_y=corr_y[1]*std::pow(A/Ap-corr_y[2], 2) + 1.0;
f_mod_y=corr_y[1]*G4Pow::GetInstance()->powN(A/Ap-corr_y[2], 2) + 1.0;
}
yield_a= yield_a * f_mod_y;
cout << "debug1 "<<yield_a<<endl;
// calculate maximum of charge dispersion zprob
G4double zbeta = A/(1.98+0.0155*std::pow(A, (2./3.)));
G4double zbeta_p = Ap/(1.98+0.0155*std::pow(Ap, (2./3.)));
G4double zbeta = A/(1.98+0.0155*G4Pow::GetInstance()->powA(A, (2./3.)));
G4double zbeta_p = Ap/(1.98+0.0155*G4Pow::GetInstance()->powA(Ap, (2./3.)));
G4double delta;
if(A > p_Delta[4])
{
@@ -108,7 +111,7 @@ class G4ProjectileFragmentCrossSection
G4double f_mod=1.0;
if(A/Ap > corr_d[2])
{
f_mod = corr_d[1]*std::pow(A/Ap-corr_d[2], 2) + 1.0;
f_mod = corr_d[1]*G4Pow::GetInstance()->powN(A/Ap-corr_d[2], 2) + 1.0;
}
delta = delta*f_mod;
G4double zprob = zbeta+delta;
@@ -117,13 +120,13 @@ class G4ProjectileFragmentCrossSection
G4double dq;
if((Zp-zbeta_p)>0)
{
dq = std::exp(p_mp[1] + G4double(A)/G4double(Ap)*p_mp[2]);
dq = G4Exp(p_mp[1] + G4double(A)/G4double(Ap)*p_mp[2]);
cout << "dq "<<A<<" "<<Ap<<" "<<p_mp[1]
<<" "<<p_mp[2]<<" "<<dq<<" "<<p_mp[1] + A/Ap*p_mp[2]<<endl;
}
else
{
dq = p_mn[1]*std::pow(A/Ap, 2.0) + p_mn[2]*std::pow(A/Ap, 4.0);
dq = p_mn[1]*G4Pow::GetInstance()->powN(A/Ap, 2) + p_mn[2]*G4Pow::GetInstance()->powN(A/Ap, 4);
}
zprob = zprob + dq * (Zp-zbeta_p);
@@ -133,13 +136,13 @@ class G4ProjectileFragmentCrossSection
<<" "<<zbeta<<" "<<delta<<endl;
// calculate width parameter R
G4double r = std::exp(p_R[1] + p_R[2]*A);
G4double r = G4Exp(p_R[1] + p_R[2]*A);
// modification close to projectile
f_mod=1.0;
if (A/Ap > corr_r[2])
{
f_mod = corr_r[1]*Ap*std::pow(A/Ap-corr_r[2], 4.0)+1.0;
f_mod = corr_r[1]*Ap*G4Pow::GetInstance()->powN(A/Ap-corr_r[2], 4)+1.0;
}
r = r*f_mod;
@@ -158,23 +161,23 @@ class G4ProjectileFragmentCrossSection
if((zprob-Z) > 0)
{
// neutron-rich
expo = -r*std::pow(std::abs(zprob-Z), u_n);
fract = std::exp(expo)*std::sqrt(r/3.14159);
expo = -r*G4Pow::GetInstance()->powA(std::abs(zprob-Z), u_n);
fract = G4Exp(expo)*std::sqrt(r/3.14159);
}
else
{
// proton-rich
expo = -r*std::pow(std::abs(zprob-Z), u_p);
fract = std::exp(expo)*std::sqrt(r/3.14159);
expo = -r*G4Pow::GetInstance()->powA(std::abs(zprob-Z), u_p);
fract = G4Exp(expo)*std::sqrt(r/3.14159);
cout << "1 "<<expo<<" "<<r<<" "<<zprob<<" "<<Z<<" "<<u_p<<endl;
// go to exponential slope
G4double dfdz = 1.2 + 0.647*std::pow(A/2.,0.3);
G4double z_exp = zprob + dfdz * std::log(10.) / (2.*r);
G4double dfdz = 1.2 + 0.647*G4Pow::GetInstance()->powA(A/2.,0.3);
G4double z_exp = zprob + dfdz * G4Log(10.) / (2.*r);
if( Z>z_exp )
{
expo = -r*std::pow(std::abs(zprob-z_exp), u_p);
fract = std::exp(expo)*std::sqrt(r/3.14159)
/ std::pow(std::pow(10, dfdz), Z-z_exp);
expo = -r*G4Pow::GetInstance()->powA(std::abs(zprob-z_exp), u_p);
fract = G4Exp(expo)*std::sqrt(r/3.14159)
/ G4Pow::GetInstance()->powA(G4Pow::GetInstance()->powA(10, dfdz), Z-z_exp);
}
}
@@ -66,6 +66,7 @@
class G4DynamicParticle;
class G4Isotope;
class G4Material;
class G4CrossSectionDataSetRegistry;
class G4VCrossSectionDataSet
{
@@ -170,6 +171,8 @@ private:
G4VCrossSectionDataSet & operator=(const G4VCrossSectionDataSet &right);
G4VCrossSectionDataSet(const G4VCrossSectionDataSet&);
G4CrossSectionDataSetRegistry* registry;
G4double minKinEnergy;
G4double maxKinEnergy;
@@ -23,62 +23,58 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ZeroXS.hh 76889 2013-11-18 13:01:55Z gcosmo $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4NeutronHPBGGNucleonInelasticXS
// File name: G4ZeroXS
//
// Author: KOI, Tatsumi
// Author: Tatsumi Koi
//
// Creation date: 26.10.2015
// Modifications:
//
//
// Class Description:
//
// Wrapper of proton and neutron inelastic cross-sections using Barashenkov
// parametersation below 100 GeV and Glauber-Gribov model above
// An artificial cross section data set which always replys zero
//
// -------------------------------------------------------------------
//
#ifndef G4NeutronHPBGGNucleonInelasticXS_h
#define G4NeutronHPBGGNucleonInelasticXS_h
#ifndef G4ZeroXS_h
#define G4ZeroXS_h 1
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
#include "G4ParticleDefinition.hh"
#include "G4BGGNucleonInelasticXS.hh"
/*
class G4GlauberGribovCrossSection;
class G4NucleonNuclearCrossSection;
class G4HadronNucleonXsc;
class G4HadronInelasticDataSet;
*/
class G4Material;
class G4Element;
class G4Isotope;
class G4NeutronHPBGGNucleonInelasticXS : public G4BGGNucleonInelasticXS
class G4ZeroXS : public G4VCrossSectionDataSet
{
public:
G4NeutronHPBGGNucleonInelasticXS (const G4ParticleDefinition*);
G4ZeroXS ();
virtual ~G4NeutronHPBGGNucleonInelasticXS();
virtual ~G4ZeroXS();
virtual
G4bool IsElementApplicable(const G4DynamicParticle*, G4int Z,
G4bool IsElementApplicable(const G4DynamicParticle*, G4int ,
const G4Material* mat = 0);
virtual
G4bool IsIsoApplicable(const G4DynamicParticle*, G4int Z, G4int A,
const G4Element* elm = 0,
const G4Material* mat = 0);
G4double GetElementCrossSection(const G4DynamicParticle*, G4int ,
const G4Material* mat = 0);
virtual void CrossSectionDescription(std::ostream&) const;
private:
G4double fLowEnergyLimitForHPN;
G4ZeroXS & operator=(const G4ZeroXS &right);
G4ZeroXS(const G4ZeroXS&);
};
#endif
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 86167 2014-11-07 14:04:12Z gcosmo $
# $Id: sources.cmake 94008 2015-11-05 10:06:41Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -82,8 +82,6 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_xsect
G4EMDissociationCrossSection.hh
G4EMDissociationSpectrum.hh
G4GeneralSpaceNNCrossSection.hh
G4GGNuclNuclCrossSection.hh
G4GlauberGribovCrossSection.hh
G4HadronCaptureDataSet.hh
G4HadronCrossSections.hh
G4HadronElasticDataSet.hh
@@ -111,7 +109,9 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_xsect
G4VComponentCrossSection.hh
G4VCrossSectionDataSet.hh
G4VCrossSectionRatio.hh
G4ZeroXS.hh
G4CrossSectionFactoryRegistry.hh
G4FastPathHadronicCrossSection.hh
SOURCES
G4BGGNucleonElasticXS.cc
G4BGGNucleonInelasticXS.cc
@@ -151,8 +151,6 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_xsect
G4EMDissociationCrossSection.cc
G4EMDissociationSpectrum.cc
G4GeneralSpaceNNCrossSection.cc
G4GGNuclNuclCrossSection.cc
G4GlauberGribovCrossSection.cc
G4HadronCaptureDataSet.cc
G4HadronCrossSections.cc
G4HadronElasticDataSet.cc
@@ -179,7 +177,9 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_xsect
G4VComponentCrossSection.cc
G4VCrossSectionDataSet.cc
G4VCrossSectionRatio.cc
G4ZeroXS.cc
G4CrossSectionFactoryRegistry.cc
G4FastPathHadronicCrossSection.cc
GRANULAR_DEPENDENCIES
G4baryons
G4bosons
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGNucleonElasticXS.cc 79981 2014-03-27 15:24:11Z gcosmo $
// $Id: G4BGGNucleonElasticXS.cc 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -43,7 +43,7 @@
#include "G4BGGNucleonElasticXS.hh"
#include "G4SystemOfUnits.hh"
#include "G4GlauberGribovCrossSection.hh"
#include "G4ComponentGGHadronNucleusXsc.hh"
#include "G4NucleonNuclearCrossSection.hh"
#include "G4HadronNucleonXsc.hh"
#include "G4ComponentSAIDTotalXS.hh"
@@ -86,8 +86,10 @@ G4BGGNucleonElasticXS::G4BGGNucleonElasticXS(const G4ParticleDefinition* p)
G4BGGNucleonElasticXS::~G4BGGNucleonElasticXS()
{
delete fHadron;
delete fSAID;
delete fHadron;
// The cross section registry will delete fNucleon
delete fGlauber;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -209,12 +211,13 @@ void G4BGGNucleonElasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
isInitialized = true;
fNucleon = (G4NucleonNuclearCrossSection*)G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(G4NucleonNuclearCrossSection::Default_Name());
fGlauber = (G4GlauberGribovCrossSection*)G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(G4GlauberGribovCrossSection::Default_Name());
fGlauber = new G4ComponentGGHadronNucleusXsc();
fHadron = new G4HadronNucleonXsc();
fSAID = new G4ComponentSAIDTotalXS();
fNucleon->BuildPhysicsTable(*particle);
fGlauber->BuildPhysicsTable(*particle);
if(particle == theProton) {
isProton = true;
fSAIDHighEnergyLimit = 3*GeV;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGNucleonInelasticXS.cc 79981 2014-03-27 15:24:11Z gcosmo $
// $Id: G4BGGNucleonInelasticXS.cc 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -43,7 +43,7 @@
#include "G4BGGNucleonInelasticXS.hh"
#include "G4SystemOfUnits.hh"
#include "G4GlauberGribovCrossSection.hh"
#include "G4ComponentGGHadronNucleusXsc.hh"
#include "G4NucleonNuclearCrossSection.hh"
#include "G4HadronNucleonXsc.hh"
#include "G4ComponentSAIDTotalXS.hh"
@@ -91,8 +91,10 @@ G4BGGNucleonInelasticXS::G4BGGNucleonInelasticXS(const G4ParticleDefinition* p)
G4BGGNucleonInelasticXS::~G4BGGNucleonInelasticXS()
{
delete fHadron;
delete fSAID;
delete fHadron;
// The cross section registry will delete fNucleon
delete fGlauber;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -213,8 +215,7 @@ void G4BGGNucleonInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
isInitialized = true;
fNucleon = (G4NucleonNuclearCrossSection*)G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(G4NucleonNuclearCrossSection::Default_Name());
fGlauber = (G4GlauberGribovCrossSection*)G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(G4GlauberGribovCrossSection::Default_Name());
fGlauber = new G4ComponentGGHadronNucleusXsc();
fHadron = new G4HadronNucleonXsc();
fSAID = new G4ComponentSAIDTotalXS();
@@ -349,7 +350,7 @@ void G4BGGNucleonInelasticXS::CrossSectionDescription(std::ostream& outFile) con
<< "Barashenkov parameterization below 91 GeV and the Glauber-Gribov\n"
<< "parameterization above 91 GeV. It uses the G4HadronNucleonXsc\n"
<< "cross section component for hydrogen targets, and the\n"
<< "G4GlauberGribovCrossSection component for other targets.\n";
<< "G4ComponentGGHadronNucleusXsc component for other targets.\n";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGPionElasticXS.cc 79981 2014-03-27 15:24:11Z gcosmo $
// $Id: G4BGGPionElasticXS.cc 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -42,7 +42,7 @@
#include "G4BGGPionElasticXS.hh"
#include "G4SystemOfUnits.hh"
#include "G4GlauberGribovCrossSection.hh"
#include "G4ComponentGGHadronNucleusXsc.hh"
#include "G4UPiNuclearCrossSection.hh"
#include "G4HadronNucleonXsc.hh"
#include "G4ComponentSAIDTotalXS.hh"
@@ -82,10 +82,10 @@ G4BGGPionElasticXS::G4BGGPionElasticXS(const G4ParticleDefinition*)
G4BGGPionElasticXS::~G4BGGPionElasticXS()
{
delete fGlauber;
delete fPion;
delete fHadron;
delete fSAID;
delete fHadron;
delete fPion;
delete fGlauber;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -205,11 +205,13 @@ void G4BGGPionElasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
isInitialized = true;
fPion = new G4UPiNuclearCrossSection();
fGlauber = new G4GlauberGribovCrossSection();
fGlauber = new G4ComponentGGHadronNucleusXsc();
fHadron = new G4HadronNucleonXsc();
fSAID = new G4ComponentSAIDTotalXS();
fPion->BuildPhysicsTable(*particle);
fGlauber->BuildPhysicsTable(*particle);
if(particle == G4PionPlus::PionPlus()) { isPiplus = true; }
G4ThreeVector mom(0.0,0.0,1.0);
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BGGPionInelasticXS.cc 79981 2014-03-27 15:24:11Z gcosmo $
// $Id: G4BGGPionInelasticXS.cc 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -42,7 +42,7 @@
#include "G4BGGPionInelasticXS.hh"
#include "G4SystemOfUnits.hh"
#include "G4GlauberGribovCrossSection.hh"
#include "G4ComponentGGHadronNucleusXsc.hh"
#include "G4UPiNuclearCrossSection.hh"
#include "G4HadronNucleonXsc.hh"
#include "G4ComponentSAIDTotalXS.hh"
@@ -84,10 +84,10 @@ G4BGGPionInelasticXS::G4BGGPionInelasticXS(const G4ParticleDefinition* p)
G4BGGPionInelasticXS::~G4BGGPionInelasticXS()
{
delete fGlauber;
delete fPion;
delete fHadron;
delete fSAID;
delete fHadron;
delete fPion;
delete fGlauber;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -198,12 +198,13 @@ void G4BGGPionInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
isInitialized = true;
fPion = new G4UPiNuclearCrossSection();
fGlauber = new G4GlauberGribovCrossSection();
fGlauber = new G4ComponentGGHadronNucleusXsc();
fHadron = new G4HadronNucleonXsc();
fSAID = new G4ComponentSAIDTotalXS();
fPion->BuildPhysicsTable(*particle);
fGlauber->BuildPhysicsTable(*particle);
if(particle == G4PionPlus::PionPlus()) { isPiplus = true; }
G4ThreeVector mom(0.0,0.0,1.0);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ChipsAntiBaryonElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
// $Id: G4ChipsAntiBaryonElasticXS.cc 93260 2015-10-14 08:37:04Z gcosmo $
//
//
// G4 Physics class: G4ChipsAntiBaryonElasticXS for pA elastic cross sections
@@ -47,6 +47,9 @@
#include "G4ParticleTable.hh"
#include "G4NucleiProperties.hh"
#include "G4IonTable.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
#include "G4Pow.hh"
// factory
#include "G4CrossSectionFactory.hh"
@@ -131,13 +134,21 @@ G4ChipsAntiBaryonElasticXS::~G4ChipsAntiBaryonElasticXS()
B4T.clear();
}
void
G4ChipsAntiBaryonElasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsAntiBaryonElasticXS provides the elastic cross\n"
<< "section for anti-baryon nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsAntiBaryonElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
G4bool G4ChipsAntiBaryonElasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
/*
if(particle == G4AntiNeutron::AntiNeutron())
{
return true;
@@ -174,7 +185,8 @@ G4bool G4ChipsAntiBaryonElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt,
{
return true;
}
return false;
*/
return true;
}
// The main member function giving the collision cross section (P is in IU, CS is in mb)
@@ -265,7 +277,7 @@ G4double G4ChipsAntiBaryonElasticXS::CalculateCrossSection(G4bool CS,G4int F,G4i
{
G4double pMom=pIU/GeV; // All calculations are in GeV
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
lastLP=G4Log(pMom); // Make a logarithm of the momentum for calculation
if(F) // This isotope was found in AMDB =>RETRIEVE/UPDATE
{
if(F<0) // the AMDB must be loded
@@ -487,10 +499,10 @@ G4double G4ChipsAntiBaryonElasticXS::GetPTables(G4double LP, G4double ILP, G4int
lastPAR[36]=4.; // p3
lastPAR[37]=64./a3; // p4
// The gloria pre-exponent (pel_us)
lastPAR[38]=1.e8*std::exp(.32*asa); // p1
lastPAR[39]=20.*std::exp(.45*asa); // p2
lastPAR[38]=1.e8*G4Exp(.32*asa); // p1
lastPAR[39]=20.*G4Exp(.45*asa); // p2
lastPAR[40]=7.e3+2.4e6/a5; // p3
lastPAR[41]=2.5e5*std::exp(.085*a3); // p4
lastPAR[41]=2.5e5*G4Exp(.085*a3); // p4
lastPAR[42]=2.5*a; // p5
// The gloria slope (pel_ub)
lastPAR[43]=920.+.03*a8*a3; // p1
@@ -504,8 +516,8 @@ G4double G4ChipsAntiBaryonElasticXS::GetPTables(G4double LP, G4double ILP, G4int
// a24
// a36
// The main pre-exponent (peh_sg)
lastPAR[ 9]=4.5*std::pow(a,1.15); // p1
lastPAR[10]=.06*std::pow(a,.6); // p2
lastPAR[ 9]=4.5*G4Pow::GetInstance()->powA(a,1.15); // p1
lastPAR[10]=.06*G4Pow::GetInstance()->powA(a,.6); // p2
lastPAR[11]=.6*a/(1.+2.e15/a16); // p3
lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32); // p4
lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5); // p5
@@ -527,8 +539,8 @@ G4double G4ChipsAntiBaryonElasticXS::GetPTables(G4double LP, G4double ILP, G4int
lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12); // p3
lastPAR[27]=.016*asa/(1.+5.e16/a16); // p4
// The 1st max slope (peh_qs)
lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11); // p2
lastPAR[28]=.002*a4/(1.+7.e7/G4Pow::GetInstance()->powA(a-6.83,14)); // p1
lastPAR[29]=2.e6/a6+7.2/G4Pow::GetInstance()->powA(a,.11); // p2
lastPAR[30]=11.*a3/(1.+7.e23/a16/a8); // p3
lastPAR[31]=100./asa; // p4
// The 2nd max pre-exponent (peh_ss)
@@ -643,11 +655,11 @@ G4double G4ChipsAntiBaryonElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PD
if(tgZ==1 && tgN==0) // ===> p+p=p+p
{
G4double E1=lastTM*theB1;
G4double R1=(1.-std::exp(-E1));
G4double R1=(1.-G4Exp(-E1));
G4double E2=lastTM*theB2;
G4double R2=(1.-std::exp(-E2*E2*E2));
G4double R2=(1.-G4Exp(-E2*E2*E2));
G4double E3=lastTM*theB3;
G4double R3=(1.-std::exp(-E3));
G4double R3=(1.-G4Exp(-E3));
G4double I1=R1*theS1/theB1;
G4double I2=R2*theS2;
G4double I3=R3*theS3;
@@ -657,38 +669,38 @@ G4double G4ChipsAntiBaryonElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PD
{
G4double ran=R1*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB1;
q2=-G4Log(1.-ran)/theB1;
}
else if(rand<I12)
{
G4double ran=R2*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran);
q2=-G4Log(1.-ran);
if(q2<0.) q2=0.;
q2=std::pow(q2,third)/theB2;
q2=G4Pow::GetInstance()->powA(q2,third)/theB2;
}
else
{
G4double ran=R3*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB3;
q2=-G4Log(1.-ran)/theB3;
}
}
else
{
G4double a=tgZ+tgN;
G4double E1=lastTM*(theB1+lastTM*theSS);
G4double R1=(1.-std::exp(-E1));
G4double R1=(1.-G4Exp(-E1));
G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
G4double tm2=lastTM*lastTM;
G4double E2=lastTM*tm2*theB2; // power 3 for lowA, 5 for HighA (1st)
if(a>6.5)E2*=tm2; // for heavy nuclei
G4double R2=(1.-std::exp(-E2));
G4double R2=(1.-G4Exp(-E2));
G4double E3=lastTM*theB3;
if(a>6.5)E3*=tm2*tm2*tm2; // power 1 for lowA, 7 (2nd) for HighA
G4double R3=(1.-std::exp(-E3));
G4double R3=(1.-G4Exp(-E3));
G4double E4=lastTM*theB4;
G4double R4=(1.-std::exp(-E4));
G4double R4=(1.-G4Exp(-E4));
G4double I1=R1*theS1;
G4double I2=R2*theS2;
G4double I3=R3*theS3;
@@ -700,31 +712,31 @@ G4double G4ChipsAntiBaryonElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PD
{
G4double ran=R1*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB1;
q2=-G4Log(1.-ran)/theB1;
if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
}
else if(rand<I12)
{
G4double ran=R2*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB2;
q2=-G4Log(1.-ran)/theB2;
if(q2<0.) q2=0.;
if(a<6.5) q2=std::pow(q2,third);
else q2=std::pow(q2,fifth);
if(a<6.5) q2=G4Pow::GetInstance()->powA(q2,third);
else q2=G4Pow::GetInstance()->powA(q2,fifth);
}
else if(rand<I13)
{
G4double ran=R3*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB3;
q2=-G4Log(1.-ran)/theB3;
if(q2<0.) q2=0.;
if(a>6.5) q2=std::pow(q2,sevth);
if(a>6.5) q2=G4Pow::GetInstance()->powA(q2,sevth);
}
else
{
G4double ran=R4*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB4;
q2=-G4Log(1.-ran)/theB4;
if(a<6.5) q2=lastTM-q2; // u reduced for lightA (starts from 0)
}
}
@@ -783,7 +795,7 @@ G4double G4ChipsAntiBaryonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int
tgZ=1;
tgN=0;
}
G4double p=std::exp(lp); // momentum
G4double p=G4Exp(lp); // momentum
G4double sp=std::sqrt(p); // sqrt(p)
G4double p2=p*p;
G4double p3=p2*p;
@@ -794,7 +806,7 @@ G4double G4ChipsAntiBaryonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int
theSS=lastPAR[29];
theS1=(lastPAR[7]+lastPAR[8]*dl2*dl2)/(1.+lastPAR[9]/p4/p)+
(lastPAR[10]/p2+lastPAR[11]*p)/(p4+lastPAR[12]*sp);
theB1=lastPAR[13]*std::pow(p,lastPAR[14])/(1.+lastPAR[15]/p3);
theB1=lastPAR[13]*G4Pow::GetInstance()->powA(p,lastPAR[14])/(1.+lastPAR[15]/p3);
theS2=lastPAR[16]+lastPAR[17]/(p4+lastPAR[18]*p);
theB2=lastPAR[19]+lastPAR[20]/(p4+lastPAR[21]/sp);
theS3=lastPAR[22]+lastPAR[23]/(p4*p4+lastPAR[24]*p2+lastPAR[25]);
@@ -802,7 +814,7 @@ G4double G4ChipsAntiBaryonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int
theS4=0.;
theB4=0.;
// Returns the total elastic pim-p cross-section (to avoid spoiling lastSIG)
G4double ye=std::exp(lp*lastPAR[0]);
G4double ye=G4Exp(lp*lastPAR[0]);
G4double dp=lp-lastPAR[1];
return lastPAR[2]/(ye+lastPAR[3])+lastPAR[4]*dp*dp+lastPAR[5];
}
@@ -817,7 +829,7 @@ G4double G4ChipsAntiBaryonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int
//G4double p24=p16*p8;
G4double dl=lp-5.;
G4double a=tgZ+tgN;
G4double pah=std::pow(p,a/2);
G4double pah=G4Pow::GetInstance()->powA(p,a/2);
G4double pa=pah*pah;
G4double pa2=pa*pa;
if(a<6.5)
@@ -827,23 +839,23 @@ G4double G4ChipsAntiBaryonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int
theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
theB2=lastPAR[27]*G4Pow::GetInstance()->powA(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
theS4=p2*(pah*lastPAR[38]*G4Exp(-pah*lastPAR[39])+
lastPAR[40]/(1.+lastPAR[41]*G4Pow::GetInstance()->powA(p,lastPAR[42])));
theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
}
else
{
theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
lastPAR[13]/(p5+lastPAR[14]/p16);
theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/G4Pow::GetInstance()->powA(p,lastPAR[20]))+
lastPAR[17]/(1.+lastPAR[18]/p4);
theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
theSS=lastPAR[21]/(p4/G4Pow::GetInstance()->powA(p,lastPAR[23])+lastPAR[22]/p4);
theS2=lastPAR[24]/p4/(G4Pow::GetInstance()->powA(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
theB2=lastPAR[28]/G4Pow::GetInstance()->powA(p,lastPAR[29])+lastPAR[30]/G4Pow::GetInstance()->powA(p,lastPAR[31]);
theS3=lastPAR[32]/G4Pow::GetInstance()->powA(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
lastPAR[33]/(1.+lastPAR[34]/p6);
theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
@@ -50,6 +50,9 @@
#include "G4AntiXiMinus.hh"
#include "G4AntiXiZero.hh"
#include "G4AntiOmegaMinus.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
#include "G4Pow.hh"
// factory
#include "G4CrossSectionFactory.hh"
@@ -80,10 +83,20 @@ G4ChipsAntiBaryonInelasticXS::~G4ChipsAntiBaryonInelasticXS()
delete HEN;
}
G4bool G4ChipsAntiBaryonInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void G4ChipsAntiBaryonInelasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsAntiBaryonInelasticXS provides the inelastic cross\n"
<< "section for anti-baryon nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsAntiBaryonInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
/*
const G4ParticleDefinition* particle = Pt->GetDefinition();
if(particle == G4AntiNeutron::AntiNeutron())
@@ -122,7 +135,8 @@ G4bool G4ChipsAntiBaryonInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt
{
return true;
}
return false;
*/
return true;
}
// The main member function giving the collision cross section (P is in IU, CS is in mb)
@@ -221,10 +235,10 @@ G4double G4ChipsAntiBaryonInelasticXS::CalculateCrossSection(G4int F, G4int I,
static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
static const G4double Pmax=227000.; // maxP for the HEN (High ENergy) part 227 GeV
static const G4int nH=224; // A#of HEN points in lnE
static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double milP=G4Log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=G4Log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
static const G4double milPG=G4Log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
G4double sigma=0.;
if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
//G4double A=targN+targZ; // A of the target
@@ -275,13 +289,13 @@ G4double G4ChipsAntiBaryonInelasticXS::CalculateCrossSection(G4int F, G4int I,
}
else if (Momentum<Pmax) // High Energy region
{
G4double lP=std::log(Momentum);
G4double lP=G4Log(Momentum);
sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
}
else // UHE region (calculation, not frequent)
{
G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
sigma=CrossSectionFormula(targZ, targN, P, G4Log(P));
}
if(sigma<0.) return 0.;
return sigma;
@@ -290,14 +304,14 @@ G4double G4ChipsAntiBaryonInelasticXS::CalculateCrossSection(G4int F, G4int I,
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) (P in GeV/c)
G4double G4ChipsAntiBaryonInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double P)
{
G4double lP=std::log(P);
G4double lP=G4Log(P);
return CrossSectionFormula(tZ, tN, P, lP);
}
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
G4double G4ChipsAntiBaryonInelasticXS::CrossSectionLog(G4int tZ, G4int tN, G4double lP)
{
G4double P=std::exp(lP);
G4double P=G4Exp(lP);
return CrossSectionFormula(tZ, tN, P, lP);
}
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
@@ -309,8 +323,8 @@ G4double G4ChipsAntiBaryonInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
{
G4double ld=lP-3.5;
G4double ld2=ld*ld;
G4double ye=std::exp(lP*1.25);
G4double yt=std::exp(lP*0.35);
G4double ye=G4Exp(lP*1.25);
G4double yt=G4Exp(lP*0.35);
G4double El=80./(ye+1.);
G4double To=(80./yt+.3)/yt;
sigma=(To-El)+.2443*ld2+31.48;
@@ -318,7 +332,7 @@ G4double G4ChipsAntiBaryonInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
else if(tZ==1 && tN==1)
{
G4double r=lP-3.7;
sigma=0.6*r*r+67.+90.*std::exp(-lP*.666);
sigma=0.6*r*r+67.+90.*G4Exp(-lP*.666);
}
else if(tZ<97 && tN<152) // General solution
{
@@ -329,7 +343,7 @@ G4double G4ChipsAntiBaryonInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
G4double a2=a*a;
G4double a3=a2*a;
G4double a2s=a2*sa;
G4double c=(170.+3600./a2s)/(1.+65./a2s)+40.*std::pow(a,0.712)/(1.+12.2/a)/(1.+34./a2);
G4double c=(170.+3600./a2s)/(1.+65./a2s)+40.*G4Pow::GetInstance()->powA(a,0.712)/(1.+12.2/a)/(1.+34./a2);
G4double r=(170.+0.01*a3)/(1.+a3/28000.);
sigma=c+d*d+r/sp;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ChipsHyperonElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
// $Id: G4ChipsHyperonElasticXS.cc 93260 2015-10-14 08:37:04Z gcosmo $
//
//
// G4 Physics class: G4ChipsHyperonElasticXS for pA elastic cross sections
@@ -52,6 +52,9 @@
#include "G4ParticleTable.hh"
#include "G4NucleiProperties.hh"
#include "G4IonTable.hh"
#include "G4Exp.hh"
#include "G4Log.hh"
#include "G4Pow.hh"
// factory
#include "G4CrossSectionFactory.hh"
@@ -136,40 +139,20 @@ G4ChipsHyperonElasticXS::~G4ChipsHyperonElasticXS()
B4T.clear();
}
G4bool G4ChipsHyperonElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsHyperonElasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsHyperonElasticXS provides the elastic cross\n"
<< "section for hyperon nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsHyperonElasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4Lambda::Lambda())
{
return true;
}
else if(particle == G4SigmaPlus::SigmaPlus())
{
return true;
}
else if(particle == G4SigmaMinus::SigmaMinus())
{
return true;
}
else if(particle == G4SigmaZero::SigmaZero())
{
return true;
}
else if(particle == G4XiMinus::XiMinus())
{
return true;
}
else if(particle == G4XiZero::XiZero())
{
return true;
}
else if(particle == G4OmegaMinus::OmegaMinus())
{
return true;
}
return false;
return true;
}
// The main member function giving the collision cross section (P is in IU, CS is in mb)
@@ -261,7 +244,7 @@ G4double G4ChipsHyperonElasticXS::CalculateCrossSection(G4bool CS,G4int F,G4int
{
G4double pMom=pIU/GeV; // All calculations are in GeV
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
lastLP=G4Log(pMom); // Make a logarithm of the momentum for calculation
if(F) // This isotope was found in AMDB =>RETRIEVE/UPDATE
{
if(F<0) // the AMDB must be loded
@@ -484,10 +467,10 @@ G4double G4ChipsHyperonElasticXS::GetPTables(G4double LP, G4double ILP, G4int PD
lastPAR[36]=4.; // p3
lastPAR[37]=64./a3; // p4
// The gloria pre-exponent (pel_us)
lastPAR[38]=1.e8*std::exp(.32*asa); // p1
lastPAR[39]=20.*std::exp(.45*asa); // p2
lastPAR[38]=1.e8*G4Exp(.32*asa); // p1
lastPAR[39]=20.*G4Exp(.45*asa); // p2
lastPAR[40]=7.e3+2.4e6/a5; // p3
lastPAR[41]=2.5e5*std::exp(.085*a3); // p4
lastPAR[41]=2.5e5*G4Exp(.085*a3); // p4
lastPAR[42]=2.5*a; // p5
// The gloria slope (pel_ub)
lastPAR[43]=920.+.03*a8*a3; // p1
@@ -501,8 +484,8 @@ G4double G4ChipsHyperonElasticXS::GetPTables(G4double LP, G4double ILP, G4int PD
// a24
// a36
// The main pre-exponent (peh_sg)
lastPAR[ 9]=4.5*std::pow(a,1.15); // p1
lastPAR[10]=.06*std::pow(a,.6); // p2
lastPAR[ 9]=4.5*G4Pow::GetInstance()->powA(a,1.15); // p1
lastPAR[10]=.06*G4Pow::GetInstance()->powA(a,.6); // p2
lastPAR[11]=.6*a/(1.+2.e15/a16); // p3
lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32); // p4
lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5); // p5
@@ -524,8 +507,8 @@ G4double G4ChipsHyperonElasticXS::GetPTables(G4double LP, G4double ILP, G4int PD
lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12); // p3
lastPAR[27]=.016*asa/(1.+5.e16/a16); // p4
// The 1st max slope (peh_qs)
lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11); // p2
lastPAR[28]=.002*a4/(1.+7.e7/G4Pow::GetInstance()->powA(a-6.83,14)); // p1
lastPAR[29]=2.e6/a6+7.2/G4Pow::GetInstance()->powA(a,.11); // p2
lastPAR[30]=11.*a3/(1.+7.e23/a16/a8); // p3
lastPAR[31]=100./asa; // p4
// The 2nd max pre-exponent (peh_ss)
@@ -638,11 +621,11 @@ G4double G4ChipsHyperonElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
if(tgZ==1 && tgN==0) // ===> p+p=p+p
{
G4double E1=lastTM*theB1;
G4double R1=(1.-std::exp(-E1));
G4double R1=(1.-G4Exp(-E1));
G4double E2=lastTM*theB2;
G4double R2=(1.-std::exp(-E2*E2*E2));
G4double R2=(1.-G4Exp(-E2*E2*E2));
G4double E3=lastTM*theB3;
G4double R3=(1.-std::exp(-E3));
G4double R3=(1.-G4Exp(-E3));
G4double I1=R1*theS1/theB1;
G4double I2=R2*theS2;
G4double I3=R3*theS3;
@@ -652,38 +635,38 @@ G4double G4ChipsHyperonElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
{
G4double ran=R1*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB1;
q2=-G4Log(1.-ran)/theB1;
}
else if(rand<I12)
{
G4double ran=R2*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran);
q2=-G4Log(1.-ran);
if(q2<0.) q2=0.;
q2=std::pow(q2,third)/theB2;
q2=G4Pow::GetInstance()->powA(q2,third)/theB2;
}
else
{
G4double ran=R3*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB3;
q2=-G4Log(1.-ran)/theB3;
}
}
else
{
G4double a=tgZ+tgN;
G4double E1=lastTM*(theB1+lastTM*theSS);
G4double R1=(1.-std::exp(-E1));
G4double R1=(1.-G4Exp(-E1));
G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
G4double tm2=lastTM*lastTM;
G4double E2=lastTM*tm2*theB2; // power 3 for lowA, 5 for HighA (1st)
if(a>6.5)E2*=tm2; // for heavy nuclei
G4double R2=(1.-std::exp(-E2));
G4double R2=(1.-G4Exp(-E2));
G4double E3=lastTM*theB3;
if(a>6.5)E3*=tm2*tm2*tm2; // power 1 for lowA, 7 (2nd) for HighA
G4double R3=(1.-std::exp(-E3));
G4double R3=(1.-G4Exp(-E3));
G4double E4=lastTM*theB4;
G4double R4=(1.-std::exp(-E4));
G4double R4=(1.-G4Exp(-E4));
G4double I1=R1*theS1;
G4double I2=R2*theS2;
G4double I3=R3*theS3;
@@ -695,31 +678,31 @@ G4double G4ChipsHyperonElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
{
G4double ran=R1*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB1;
q2=-G4Log(1.-ran)/theB1;
if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
}
else if(rand<I12)
{
G4double ran=R2*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB2;
q2=-G4Log(1.-ran)/theB2;
if(q2<0.) q2=0.;
if(a<6.5) q2=std::pow(q2,third);
else q2=std::pow(q2,fifth);
if(a<6.5) q2=G4Pow::GetInstance()->powA(q2,third);
else q2=G4Pow::GetInstance()->powA(q2,fifth);
}
else if(rand<I13)
{
G4double ran=R3*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB3;
q2=-G4Log(1.-ran)/theB3;
if(q2<0.) q2=0.;
if(a>6.5) q2=std::pow(q2,sevth);
if(a>6.5) q2=G4Pow::GetInstance()->powA(q2,sevth);
}
else
{
G4double ran=R4*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB4;
q2=-G4Log(1.-ran)/theB4;
if(a<6.5) q2=lastTM-q2; // u reduced for lightA (starts from 0)
}
}
@@ -780,7 +763,7 @@ G4double G4ChipsHyperonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tgZ
tgZ=1;
tgN=0;
}
G4double p=std::exp(lp); // momentum
G4double p=G4Exp(lp); // momentum
G4double sp=std::sqrt(p); // sqrt(p)
G4double p2=p*p;
G4double p3=p2*p;
@@ -791,7 +774,7 @@ G4double G4ChipsHyperonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tgZ
theSS=lastPAR[32];
theS1=(lastPAR[10]+lastPAR[11]*dl2*dl2)/(1.+lastPAR[12]/p4/p)+
(lastPAR[13]/p2+lastPAR[14]*p)/(p4+lastPAR[15]*sp);
theB1=lastPAR[16]*std::pow(p,lastPAR[17])/(1.+lastPAR[18]/p3);
theB1=lastPAR[16]*G4Pow::GetInstance()->powA(p,lastPAR[17])/(1.+lastPAR[18]/p3);
theS2=lastPAR[19]+lastPAR[20]/(p4+lastPAR[21]*p);
theB2=lastPAR[22]+lastPAR[23]/(p4+lastPAR[24]/sp);
theS3=lastPAR[25]+lastPAR[26]/(p4*p4+lastPAR[27]*p2+lastPAR[28]);
@@ -814,7 +797,7 @@ G4double G4ChipsHyperonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tgZ
//G4double p24=p16*p8;
G4double dl=lp-5.;
G4double a=tgZ+tgN;
G4double pah=std::pow(p,a/2);
G4double pah=G4Pow::GetInstance()->powA(p,a/2);
G4double pa=pah*pah;
G4double pa2=pa*pa;
if(a<6.5)
@@ -824,23 +807,23 @@ G4double G4ChipsHyperonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tgZ
theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
theB2=lastPAR[27]*G4Pow::GetInstance()->powA(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
theS4=p2*(pah*lastPAR[38]*G4Exp(-pah*lastPAR[39])+
lastPAR[40]/(1.+lastPAR[41]*G4Pow::GetInstance()->powA(p,lastPAR[42])));
theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
}
else
{
theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
lastPAR[13]/(p5+lastPAR[14]/p16);
theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/G4Pow::GetInstance()->powA(p,lastPAR[20]))+
lastPAR[17]/(1.+lastPAR[18]/p4);
theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
theSS=lastPAR[21]/(p4/G4Pow::GetInstance()->powA(p,lastPAR[23])+lastPAR[22]/p4);
theS2=lastPAR[24]/p4/(G4Pow::GetInstance()->powA(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
theB2=lastPAR[28]/G4Pow::GetInstance()->powA(p,lastPAR[29])+lastPAR[30]/G4Pow::GetInstance()->powA(p,lastPAR[31]);
theS3=lastPAR[32]/G4Pow::GetInstance()->powA(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
lastPAR[33]/(1.+lastPAR[34]/p6);
theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
@@ -43,6 +43,8 @@
#include "G4XiMinus.hh"
#include "G4XiZero.hh"
#include "G4OmegaMinus.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
// factory
#include "G4CrossSectionFactory.hh"
@@ -75,10 +77,19 @@ G4ChipsHyperonInelasticXS::~G4ChipsHyperonInelasticXS()
delete HEN;
}
G4bool G4ChipsHyperonInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void G4ChipsHyperonInelasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsHyperonInelasticXS provides the inelastic cross\n"
<< "section for hyperon nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsHyperonInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
/*
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4Lambda::Lambda())
{
@@ -108,7 +119,8 @@ G4bool G4ChipsHyperonInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G
{
return true;
}
return false;
*/
return true;
}
// The main member function giving the collision cross section (P is in IU, CS is in mb)
@@ -210,10 +222,10 @@ G4double G4ChipsHyperonInelasticXS::CalculateCrossSection(G4int F, G4int I,
static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
static const G4double Pmax=227000.; // maxP for the HEN (High ENergy) part 227 GeV
static const G4int nH=224; // A#of HEN points in lnE
static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double milP=G4Log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=G4Log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
static const G4double milPG=G4Log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
G4double sigma=0.;
if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
//G4double A=targN+targZ; // A of the target
@@ -264,13 +276,13 @@ G4double G4ChipsHyperonInelasticXS::CalculateCrossSection(G4int F, G4int I,
}
else if (Momentum<Pmax) // High Energy region
{
G4double lP=std::log(Momentum);
G4double lP=G4Log(Momentum);
sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
}
else // UHE region (calculation, not frequent)
{
G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
sigma=CrossSectionFormula(targZ, targN, P, G4Log(P));
}
if(sigma<0.) return 0.;
return sigma;
@@ -279,14 +291,14 @@ G4double G4ChipsHyperonInelasticXS::CalculateCrossSection(G4int F, G4int I,
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) (P in GeV/c)
G4double G4ChipsHyperonInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double P)
{
G4double lP=std::log(P);
G4double lP=G4Log(P);
return CrossSectionFormula(tZ, tN, P, lP);
}
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
G4double G4ChipsHyperonInelasticXS::CrossSectionLog(G4int tZ, G4int tN, G4double lP)
{
G4double P=std::exp(lP);
G4double P=G4Exp(lP);
return CrossSectionFormula(tZ, tN, P, lP);
}
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
@@ -313,14 +325,14 @@ G4double G4ChipsHyperonInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
G4double sp=std::sqrt(P);
G4double ssp=std::sqrt(sp);
G4double a=tN+tZ; // A of the target
G4double al=std::log(a);
G4double al=G4Log(a);
G4double sa=std::sqrt(a);
G4double a2=a*a;
G4double a2s=a2*sa;
G4double a4=a2*a2;
G4double a8=a4*a4;
G4double c=(170.+3600./a2s)/(1.+65./a2s);
G4double gg=42.*(std::exp(al*0.8)+4.E-8*a4)/(1.+28./a)/(1.+5.E-5*a2);
G4double gg=42.*(G4Exp(al*0.8)+4.E-8*a4)/(1.+28./a)/(1.+5.E-5*a2);
G4double e=390.; // Defolt values for deutrons
G4double r=0.27;
G4double h=2.E-7;
@@ -332,7 +344,7 @@ G4double G4ChipsHyperonInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
h=1.E-8*a2/(1.+a2/17.)/(1.+3.E-20*a8);
t=(.2+.00056*a2)/(1.+a2*.0006);
}
sigma=(c+d*d)/(1.+t/ssp+r/p4)+(gg+e*std::exp(-6.*P))/(1.+h/p4/p4);
sigma=(c+d*d)/(1.+t/ssp+r/p4)+(gg+e*G4Exp(-6.*P))/(1.+h/p4/p4);
#ifdef pdebug
G4cout<<"G4QHyperonNucCS::CSForm: A="<<a<<",P="<<P<<",CS="<<sigma<<",c="<<c<<",g="<<gg
<<",d="<<d<<",r="<<r<<",e="<<e<<",h="<<h<<G4endl;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ChipsKaonMinusElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
// $Id: G4ChipsKaonMinusElasticXS.cc 93203 2015-10-12 07:42:34Z gcosmo $
//
//
// G4 Physics class: G4ChipsKaonMinusElasticXS for pA elastic cross sections
@@ -155,13 +155,20 @@ G4ChipsKaonMinusElasticXS::~G4ChipsKaonMinusElasticXS()
B4T.clear();
}
G4bool G4ChipsKaonMinusElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsKaonMinusElasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsKaonMinusElasticXS provides the elastic cross\n"
<< "section for K- nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsKaonMinusElasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4KaonMinus::KaonMinus() ) return true;
return false;
return true;
}
// The main member function giving the collision cross section (P is in IU, CS is in mb)
@@ -88,13 +88,20 @@ G4ChipsKaonMinusInelasticXS::~G4ChipsKaonMinusInelasticXS()
delete HEN;
}
G4bool G4ChipsKaonMinusInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsKaonMinusInelasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsKaonMinusInelasticXS provides the inelastic cross\n"
<< "section for K- nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsKaonMinusInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4KaonMinus::KaonMinus() ) return true;
return false;
return true;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ChipsKaonPlusElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
// $Id: G4ChipsKaonPlusElasticXS.cc 93260 2015-10-14 08:37:04Z gcosmo $
//
//
// G4 Physics class: G4ChipsKaonPlusElasticXS for pA elastic cross sections
@@ -47,7 +47,6 @@
#include "G4NucleiProperties.hh"
#include "G4IonTable.hh"
#include "G4AutoLock.hh"
// factory
#include "G4CrossSectionFactory.hh"
//
@@ -157,13 +156,21 @@ G4ChipsKaonPlusElasticXS::~G4ChipsKaonPlusElasticXS()
B4T.clear();
}
G4bool G4ChipsKaonPlusElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsKaonPlusElasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsKaonPlusElasticXS provides the elastic cross\n"
<< "section for K+ nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsKaonPlusElasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4KaonPlus::KaonPlus() ) return true;
return false;
return true;
}
// The main member function giving the collision cross section (P is in IU, CS is in mb)
@@ -104,14 +104,20 @@ G4ChipsKaonPlusInelasticXS::~G4ChipsKaonPlusInelasticXS()
delete HEN;
}
void
G4ChipsKaonPlusInelasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsKaonPlusInelasticXS provides the inelastic cross\n"
<< "section for K+ nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsKaonPlusInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
G4bool G4ChipsKaonPlusInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4KaonPlus::KaonPlus() ) return true;
return false;
return true;
}
@@ -74,20 +74,20 @@ G4ChipsKaonZeroElasticXS::~G4ChipsKaonZeroElasticXS()
{
}
G4bool G4ChipsKaonZeroElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsKaonZeroElasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsKaonZeroElasticXS provides the elastic cross\n"
<< "section for K0 nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsKaonZeroElasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if(particle == G4KaonZeroLong::KaonZeroLong() ||
particle == G4KaonZeroShort::KaonZeroShort() ||
particle == G4KaonZero::KaonZero() ||
particle == G4AntiKaonZero::AntiKaonZero() )
{
return true;
}
return false;
return true;
}
@@ -71,20 +71,20 @@ G4ChipsKaonZeroInelasticXS::~G4ChipsKaonZeroInelasticXS()
{
}
G4bool G4ChipsKaonZeroInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsKaonZeroInelasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsKaonZeroInelasticXS provides the inelastic cross\n"
<< "section for K0 nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsKaonZeroInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if(particle == G4KaonZeroLong::KaonZeroLong() ||
particle == G4KaonZeroShort::KaonZeroShort() ||
particle == G4KaonZero::KaonZero() ||
particle == G4AntiKaonZero::AntiKaonZero() )
{
return true;
}
return false;
return true;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ChipsNeutronElasticXS.cc 84714 2014-10-20 07:37:24Z gcosmo $
// $Id: G4ChipsNeutronElasticXS.cc 93080 2015-10-02 14:45:31Z gcosmo $
//
//
// G4 Physics class: G4ChipsNeutronElasticXS for nA elastic cross sections
@@ -141,13 +141,20 @@ G4ChipsNeutronElasticXS::~G4ChipsNeutronElasticXS()
B4T.clear();
}
G4bool G4ChipsNeutronElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsNeutronElasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsNeutronElasticXS provides the elastic cross\n"
<< "section for neutron nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsNeutronElasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4Proton::Proton() ) return true;
return false;
return true;
}
G4double G4ChipsNeutronElasticXS::GetIsoCrossSection(const G4DynamicParticle* Pt, G4int tgZ, G4int A,
@@ -42,6 +42,9 @@
#include "G4DynamicParticle.hh"
#include "G4ParticleDefinition.hh"
#include "G4Neutron.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
// factory
#include "G4CrossSectionFactory.hh"
@@ -75,13 +78,20 @@ G4ChipsNeutronInelasticXS::~G4ChipsNeutronInelasticXS()
delete HEN;
}
G4bool G4ChipsNeutronInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsNeutronInelasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsNeutronInelasticXS provides the inelastic cross\n"
<< "section for neutron nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsNeutronInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4Neutron::Neutron() ) return true;
return false;
return true;
}
@@ -180,10 +190,10 @@ G4double G4ChipsNeutronInelasticXS::CalculateCrossSection(G4int F, G4int I,
static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
static const G4double Pmax=227000.; // maxP for the HEN (High ENergy) part 227 GeV
static const G4int nH=224; // A#of HEN points in lnE
static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double milP=G4Log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=G4Log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
static const G4double milPG=G4Log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
//
// Associative memory for acceleration
//static std::vector <G4double> spA; // shadowing coefficients (A-dependent)
@@ -237,13 +247,13 @@ G4double G4ChipsNeutronInelasticXS::CalculateCrossSection(G4int F, G4int I,
}
else if (Momentum<Pmax) // High Energy region
{
G4double lP=std::log(Momentum);
G4double lP=G4Log(Momentum);
sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
}
else // UHE region (calculation, not frequent)
{
G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
sigma=CrossSectionFormula(targZ, targN, P, G4Log(P));
}
if(sigma<0.) return 0.;
return sigma;
@@ -1195,7 +1205,7 @@ G4double G4ChipsNeutronInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double
//G4double par=Pars[1][0].second[1];
//G4cout<<"-Warning-G4ChipsNeutronInelasticXS::CSLin: N="<<curN<<", P="<<par<<G4endl;
G4double sigma=0.;
G4double lP=std::log(P);
G4double lP=G4Log(P);
if( (tZ==1 && !tN) || (!tZ && tN==1)){if(P>.35) sigma=CrossSectionFormula(tZ,tN,P,lP);}
else if(tZ<97 && tN<152) // General solution (*** Z/A limits ***)
{
@@ -1225,7 +1235,7 @@ G4double G4ChipsNeutronInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double
if(pex>0.)
{
G4double dp=P-pos;
sigma+=pex*std::exp(-dp*dp/wid);
sigma+=pex*G4Exp(-dp*dp/wid);
}
}
else
@@ -1240,7 +1250,7 @@ G4double G4ChipsNeutronInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double
// Calculation formula for proton-nuclear inelastic cross-section (mb) log(P in GeV/c)
G4double G4ChipsNeutronInelasticXS::CrossSectionLog(G4int tZ, G4int tN, G4double lP)
{
G4double P=std::exp(lP);
G4double P=G4Exp(lP);
return CrossSectionFormula(tZ, tN, P, lP);
}
// Calculation formula for proton-nuclear inelastic cross-section (mb) log(P in GeV/c)
@@ -1260,7 +1270,7 @@ G4double G4ChipsNeutronInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
}
else if(P>1000.)
{
G4double lp=std::log(P)-3.5;
G4double lp=G4Log(P)-3.5;
G4double lp2=lp*lp;
El=0.0557*lp2+6.72;
To=0.3 *lp2+38.2;
@@ -1269,7 +1279,7 @@ G4double G4ChipsNeutronInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
{
G4double p2=P*P;
G4double LE=1./(0.00012+p2*(0.051+0.1*p2));
G4double lp=std::log(P)-3.5;
G4double lp=G4Log(P)-3.5;
G4double lp2=lp*lp;
G4double rp2=1./p2;
El=LE+(0.0557*lp2+6.72+30./P)/(1.+0.49*rp2/P);
@@ -1288,12 +1298,12 @@ G4double G4ChipsNeutronInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
}
else if(tZ<97 && tN<152) // General solution
{
//G4double lP=std::log(P); // Already calculated
//G4double lP=G4Log(P); // Already calculated
G4double d=lP-4.2; //
G4double p2=P*P; //
G4double p4=p2*p2; //
G4double a=tN+tZ; // A of the target
G4double al=std::log(a); //
G4double al=G4Log(a); //
G4double sa=std::sqrt(a); //
G4double a2=a*a; //
G4double sa2=sa*a2; //
@@ -1309,14 +1319,14 @@ G4double G4ChipsNeutronInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
G4double dl=al-3.;
G4double dl2=dl*dl;
G4double r=.21+.62*dl2/(1.+.5*dl2);
G4double gg=42.*(std::exp(al*0.8)+4.E-8*a4)/(1.+28./a)/(1.+5.E-5*a2);
G4double gg=42.*(G4Exp(al*0.8)+4.E-8*a4)/(1.+28./a)/(1.+5.E-5*a2);
G4double e=5.*((a6+.021*a8)/(1.+.0013*a7)+.001*a3)/(1.+.0007*a2);
G4double ss=5./(1.+144./a8);
G4double h=HEthresh; // Individual
//G4double h=(.01/a4+2.5e-6/a)*(1.+7.e-8*a4)/(1.+6.e7/a12/a2);
//sigma=(c+d*d)/(1.+r/p4)+(gg+e*std::exp(-ss*P))/(1.+h/p4/p4);
sigma=(c+d*d)/(1+r/p4)+(gg+e*std::exp(-ss*P))/(1+h/p4/p4);
//sigma=(c+d*d)/(1.+r/p4)+(gg+e*G4Exp(-ss*P))/(1.+h/p4/p4);
sigma=(c+d*d)/(1+r/p4)+(gg+e*G4Exp(-ss*P))/(1+h/p4/p4);
}
else
{
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ChipsPionMinusElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
// $Id: G4ChipsPionMinusElasticXS.cc 93260 2015-10-14 08:37:04Z gcosmo $
//
//
// G4 Physics class: G4ChipsPionMinusElasticXS for pA elastic cross sections
@@ -47,6 +47,10 @@
#include "G4NucleiProperties.hh"
#include "G4IonTable.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
#include "G4Pow.hh"
// factory
#include "G4CrossSectionFactory.hh"
//
@@ -130,14 +134,21 @@ G4ChipsPionMinusElasticXS::~G4ChipsPionMinusElasticXS()
B4T.clear();
}
void
G4ChipsPionMinusElasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsPionMinusElasticXS provides the elastic cross\n"
<< "section for pion- nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsPionMinusElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
G4bool G4ChipsPionMinusElasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4PionMinus::PionMinus() ) return true;
return false;
return true;
}
// The main member function giving the collision cross section (P is in IU, CS is in mb)
@@ -227,7 +238,7 @@ G4double G4ChipsPionMinusElasticXS::CalculateCrossSection(G4bool CS, G4int F,G4i
{
G4double pMom=pIU/GeV; // All calculations are in GeV
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
lastLP=G4Log(pMom); // Make a logarithm of the momentum for calculation
if(F) // This isotope was found in AMDB =>RETRIEVE/UPDATE
{
if(F<0) // the AMDB must be loded
@@ -400,9 +411,9 @@ G4double G4ChipsPionMinusElasticXS::GetPTables(G4double LP, G4double ILP, G4int
// Reaction cross-section parameters (pel=peh_fit.f)
lastPAR[0]=(.95*sa+2.E5/a16)/(1.+17/a); // p1
lastPAR[1]=a/(1./4.4+1./a); // p2
lastPAR[2]=.22/std::pow(a,.33); // p3
lastPAR[2]=.22/G4Pow::GetInstance()->powA(a,.33); // p3
lastPAR[3]=.5*a/(1.+3./a+1800./a8); // p4
lastPAR[4]=3.E-4*std::pow(a,.32)/(1.+14./a2); // p5
lastPAR[4]=3.E-4*G4Pow::GetInstance()->powA(a,.32)/(1.+14./a2); // p5
lastPAR[5]=0.; // p6 not used
lastPAR[6]=(.55+.001*a2)/(1.+4.E-4*a2); // p7
lastPAR[7]=(.0002/asa+4.E-9*a)/(1.+9./a4); // p8
@@ -448,10 +459,10 @@ G4double G4ChipsPionMinusElasticXS::GetPTables(G4double LP, G4double ILP, G4int
lastPAR[36]=4.; // p3
lastPAR[37]=64./a3; // p4
// The gloria pre-exponent (pel_us)
lastPAR[38]=1.e8*std::exp(.32*asa); // p1
lastPAR[39]=20.*std::exp(.45*asa); // p2
lastPAR[38]=1.e8*G4Exp(.32*asa); // p1
lastPAR[39]=20.*G4Exp(.45*asa); // p2
lastPAR[40]=7.e3+2.4e6/a5; // p3
lastPAR[41]=2.5e5*std::exp(.085*a3); // p4
lastPAR[41]=2.5e5*G4Exp(.085*a3); // p4
lastPAR[42]=2.5*a; // p5
// The gloria slope (pel_ub)
lastPAR[43]=920.+.03*a8*a3; // p1
@@ -465,8 +476,8 @@ G4double G4ChipsPionMinusElasticXS::GetPTables(G4double LP, G4double ILP, G4int
// a24
// a36
// The main pre-exponent (peh_sg)
lastPAR[ 9]=4.5*std::pow(a,1.15); // p1
lastPAR[10]=.06*std::pow(a,.6); // p2
lastPAR[ 9]=4.5*G4Pow::GetInstance()->powA(a,1.15); // p1
lastPAR[10]=.06*G4Pow::GetInstance()->powA(a,.6); // p2
lastPAR[11]=.6*a/(1.+2.e15/a16); // p3
lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32); // p4
lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5); // p5
@@ -488,8 +499,8 @@ G4double G4ChipsPionMinusElasticXS::GetPTables(G4double LP, G4double ILP, G4int
lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12); // p3
lastPAR[27]=.016*asa/(1.+5.e16/a16); // p4
// The 1st max slope (peh_qs)
lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11); // p2
lastPAR[28]=.002*a4/(1.+7.e7/G4Pow::GetInstance()->powA(a-6.83,14)); // p1
lastPAR[29]=2.e6/a6+7.2/G4Pow::GetInstance()->powA(a,.11); // p2
lastPAR[30]=11.*a3/(1.+7.e23/a16/a8); // p3
lastPAR[31]=100./asa; // p4
// The 2nd max pre-exponent (peh_ss)
@@ -603,11 +614,11 @@ G4double G4ChipsPionMinusElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG
if(tgZ==1 && tgN==0) // ===> p+p=p+p
{
G4double E1=lastTM*theB1;
G4double R1=(1.-std::exp(-E1));
G4double R1=(1.-G4Exp(-E1));
G4double E2=lastTM*theB2;
G4double R2=(1.-std::exp(-E2*E2*E2));
G4double R2=(1.-G4Exp(-E2*E2*E2));
G4double E3=lastTM*theB3;
G4double R3=(1.-std::exp(-E3));
G4double R3=(1.-G4Exp(-E3));
G4double I1=R1*theS1/theB1;
G4double I2=R2*theS2;
G4double I3=R3*theS3;
@@ -617,38 +628,38 @@ G4double G4ChipsPionMinusElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG
{
G4double ran=R1*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB1;
q2=-G4Log(1.-ran)/theB1;
}
else if(rand<I12)
{
G4double ran=R2*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran);
q2=-G4Log(1.-ran);
if(q2<0.) q2=0.;
q2=std::pow(q2,third)/theB2;
q2=G4Pow::GetInstance()->powA(q2,third)/theB2;
}
else
{
G4double ran=R3*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB3;
q2=-G4Log(1.-ran)/theB3;
}
}
else
{
G4double a=tgZ+tgN;
G4double E1=lastTM*(theB1+lastTM*theSS);
G4double R1=(1.-std::exp(-E1));
G4double R1=(1.-G4Exp(-E1));
G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
G4double tm2=lastTM*lastTM;
G4double E2=lastTM*tm2*theB2; // power 3 for lowA, 5 for HighA (1st)
if(a>6.5)E2*=tm2; // for heavy nuclei
G4double R2=(1.-std::exp(-E2));
G4double R2=(1.-G4Exp(-E2));
G4double E3=lastTM*theB3;
if(a>6.5)E3*=tm2*tm2*tm2; // power 1 for lowA, 7 (2nd) for HighA
G4double R3=(1.-std::exp(-E3));
G4double R3=(1.-G4Exp(-E3));
G4double E4=lastTM*theB4;
G4double R4=(1.-std::exp(-E4));
G4double R4=(1.-G4Exp(-E4));
G4double I1=R1*theS1;
G4double I2=R2*theS2;
G4double I3=R3*theS3;
@@ -660,31 +671,31 @@ G4double G4ChipsPionMinusElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG
{
G4double ran=R1*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB1;
q2=-G4Log(1.-ran)/theB1;
if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
}
else if(rand<I12)
{
G4double ran=R2*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB2;
q2=-G4Log(1.-ran)/theB2;
if(q2<0.) q2=0.;
if(a<6.5) q2=std::pow(q2,third);
else q2=std::pow(q2,fifth);
if(a<6.5) q2=G4Pow::GetInstance()->powA(q2,third);
else q2=G4Pow::GetInstance()->powA(q2,fifth);
}
else if(rand<I13)
{
G4double ran=R3*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB3;
q2=-G4Log(1.-ran)/theB3;
if(q2<0.) q2=0.;
if(a>6.5) q2=std::pow(q2,sevth);
if(a>6.5) q2=G4Pow::GetInstance()->powA(q2,sevth);
}
else
{
G4double ran=R4*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB4;
q2=-G4Log(1.-ran)/theB4;
if(a<6.5) q2=lastTM-q2; // u reduced for lightA (starts from 0)
}
}
@@ -743,7 +754,7 @@ G4double G4ChipsPionMinusElasticXS::GetTabValues(G4double lp, G4int PDG, G4int t
tgZ=1;
tgN=0;
}
G4double p=std::exp(lp); // momentum
G4double p=G4Exp(lp); // momentum
G4double sp=std::sqrt(p); // sqrt(p)
G4double p2=p*p;
G4double p3=p2*p;
@@ -754,7 +765,7 @@ G4double G4ChipsPionMinusElasticXS::GetTabValues(G4double lp, G4int PDG, G4int t
theSS=lastPAR[37];
theS1=(lastPAR[15]+lastPAR[16]*dl2*dl2)/(1.+lastPAR[17]/p4/p)+
(lastPAR[18]/p2+lastPAR[19]*p)/(p4+lastPAR[20]*sp);
theB1=lastPAR[21]*std::pow(p,lastPAR[22])/(1.+lastPAR[23]/p3);
theB1=lastPAR[21]*G4Pow::GetInstance()->powA(p,lastPAR[22])/(1.+lastPAR[23]/p3);
theS2=lastPAR[24]+lastPAR[25]/(p4+lastPAR[26]*p);
theB2=lastPAR[27]+lastPAR[28]/(p4+lastPAR[29]/sp);
theS3=lastPAR[30]+lastPAR[31]/(p4*p4+lastPAR[32]*p2+lastPAR[33]);
@@ -782,7 +793,7 @@ G4double G4ChipsPionMinusElasticXS::GetTabValues(G4double lp, G4int PDG, G4int t
//G4double p24=p16*p8;
G4double dl=lp-5.;
G4double a=tgZ+tgN;
G4double pah=std::pow(p,a/2);
G4double pah=G4Pow::GetInstance()->powA(p,a/2);
G4double pa=pah*pah;
G4double pa2=pa*pa;
if(a<6.5)
@@ -792,23 +803,23 @@ G4double G4ChipsPionMinusElasticXS::GetTabValues(G4double lp, G4int PDG, G4int t
theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
theB2=lastPAR[27]*G4Pow::GetInstance()->powA(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
theS4=p2*(pah*lastPAR[38]*G4Exp(-pah*lastPAR[39])+
lastPAR[40]/(1.+lastPAR[41]*G4Pow::GetInstance()->powA(p,lastPAR[42])));
theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
}
else
{
theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
lastPAR[13]/(p5+lastPAR[14]/p16);
theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/G4Pow::GetInstance()->powA(p,lastPAR[20]))+
lastPAR[17]/(1.+lastPAR[18]/p4);
theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
theSS=lastPAR[21]/(p4/G4Pow::GetInstance()->powA(p,lastPAR[23])+lastPAR[22]/p4);
theS2=lastPAR[24]/p4/(G4Pow::GetInstance()->powA(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
theB2=lastPAR[28]/G4Pow::GetInstance()->powA(p,lastPAR[29])+lastPAR[30]/G4Pow::GetInstance()->powA(p,lastPAR[31]);
theS3=lastPAR[32]/G4Pow::GetInstance()->powA(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
lastPAR[33]/(1.+lastPAR[34]/p6);
theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
@@ -44,6 +44,9 @@
#include "G4ParticleDefinition.hh"
#include "G4PionMinus.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
// factory
#include "G4CrossSectionFactory.hh"
//
@@ -74,14 +77,20 @@ G4ChipsPionMinusInelasticXS::~G4ChipsPionMinusInelasticXS()
delete HEN;
}
void
G4ChipsPionMinusInelasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsPionMinusInelasticXS provides the inelastic cross\n"
<< "section for pion- nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsPionMinusInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
G4bool G4ChipsPionMinusInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4PionMinus::PionMinus() ) return true;
return false;
return true;
}
// The main member function giving the collision cross section (P is in IU, CS is in mb)
@@ -179,10 +188,10 @@ G4double G4ChipsPionMinusInelasticXS::CalculateCrossSection(G4int F, G4int I,
static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
static const G4double Pmax=227000.; // maxP for the HEN (High ENergy) part 227 GeV
static const G4int nH=224; // A#of HEN points in lnE
static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double milP=G4Log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=G4Log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
static const G4double milPG=G4Log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
G4double sigma=0.;
if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
//G4double A=targN+targZ; // A of the target
@@ -233,13 +242,13 @@ G4double G4ChipsPionMinusInelasticXS::CalculateCrossSection(G4int F, G4int I,
}
else if (Momentum<Pmax) // High Energy region
{
G4double lP=std::log(Momentum);
G4double lP=G4Log(Momentum);
sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
}
else // UHE region (calculation, not frequent)
{
G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
sigma=CrossSectionFormula(targZ, targN, P, G4Log(P));
}
if(sigma<0.) return 0.;
return sigma;
@@ -248,14 +257,14 @@ G4double G4ChipsPionMinusInelasticXS::CalculateCrossSection(G4int F, G4int I,
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) (P in GeV/c)
G4double G4ChipsPionMinusInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double P)
{
G4double lP=std::log(P);
G4double lP=G4Log(P);
return CrossSectionFormula(tZ, tN, P, lP);
}
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
G4double G4ChipsPionMinusInelasticXS::CrossSectionLog(G4int tZ, G4int tN, G4double lP)
{
G4double P=std::exp(lP);
G4double P=G4Exp(lP);
return CrossSectionFormula(tZ, tN, P, lP);
}
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
@@ -295,11 +304,11 @@ G4double G4ChipsPionMinusInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
G4double p2=P*P;
G4double p4=p2*p2;
G4double a=tN+tZ; // A of the target
G4double al=std::log(a);
G4double al=G4Log(a);
G4double sa=std::sqrt(a);
G4double ssa=std::sqrt(sa);
G4double a2=a*a;
G4double c=41.*std::exp(al*.68)*(1.+44./a2)/(1.+8./a)/(1.+200./a2/a2);
G4double c=41.*G4Exp(al*.68)*(1.+44./a2)/(1.+8./a)/(1.+200./a2/a2);
G4double f=120*sa/(1.+24./a/ssa);
G4double gg=-1.32-al*.043;
G4double u=lP-gg;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ChipsPionPlusElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
// $Id: G4ChipsPionPlusElasticXS.cc 93260 2015-10-14 08:37:04Z gcosmo $
//
//
// G4 Physics class: G4ChipsPionPlusElasticXS for pA elastic cross sections
@@ -46,6 +46,9 @@
#include "G4ParticleTable.hh"
#include "G4NucleiProperties.hh"
#include "G4IonTable.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
#include "G4Pow.hh"
// factory
#include "G4CrossSectionFactory.hh"
@@ -130,13 +133,20 @@ G4ChipsPionPlusElasticXS::~G4ChipsPionPlusElasticXS()
B4T.clear();
}
G4bool G4ChipsPionPlusElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsPionPlusElasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsPionPlusElasticXS provides the elastic cross\n"
<< "section for pion+ nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsPionPlusElasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4PionPlus::PionPlus() ) return true;
return false;
return true;
}
// The main member function giving the collision cross section (P is in IU, CS is in mb)
@@ -226,7 +236,7 @@ G4double G4ChipsPionPlusElasticXS::CalculateCrossSection(G4bool CS, G4int F, G4i
{
G4double pMom=pIU/GeV; // All calculations are in GeV
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
lastLP=G4Log(pMom); // Make a logarithm of the momentum for calculation
if(F) // This isotope was found in AMDB =>RETRIEVE/UPDATE
{
if(F<0) // the AMDB must be loded
@@ -399,9 +409,9 @@ G4double G4ChipsPionPlusElasticXS::GetPTables(G4double LP, G4double ILP, G4int P
// Reaction cross-section parameters (pel=peh_fit.f)
lastPAR[0]=(.95*sa+2.E5/a16)/(1.+17/a); // p1
lastPAR[1]=a/(1./4.4+1./a); // p2
lastPAR[2]=.22/std::pow(a,.33); // p3
lastPAR[2]=.22/G4Pow::GetInstance()->powA(a,.33); // p3
lastPAR[3]=.5*a/(1.+3./a+1800./a8); // p4
lastPAR[4]=3.E-4*std::pow(a,.32)/(1.+14./a2); // p5
lastPAR[4]=3.E-4*G4Pow::GetInstance()->powA(a,.32)/(1.+14./a2); // p5
lastPAR[5]=0.; // p6 not used
lastPAR[6]=(.55+.001*a2)/(1.+4.E-4*a2); // p7
lastPAR[7]=(.0002/asa+4.E-9*a)/(1.+9./a4); // p8
@@ -447,10 +457,10 @@ G4double G4ChipsPionPlusElasticXS::GetPTables(G4double LP, G4double ILP, G4int P
lastPAR[36]=4.; // p3
lastPAR[37]=64./a3; // p4
// The gloria pre-exponent (pel_us)
lastPAR[38]=1.e8*std::exp(.32*asa); // p1
lastPAR[39]=20.*std::exp(.45*asa); // p2
lastPAR[38]=1.e8*G4Exp(.32*asa); // p1
lastPAR[39]=20.*G4Exp(.45*asa); // p2
lastPAR[40]=7.e3+2.4e6/a5; // p3
lastPAR[41]=2.5e5*std::exp(.085*a3); // p4
lastPAR[41]=2.5e5*G4Exp(.085*a3); // p4
lastPAR[42]=2.5*a; // p5
// The gloria slope (pel_ub)
lastPAR[43]=920.+.03*a8*a3; // p1
@@ -464,8 +474,8 @@ G4double G4ChipsPionPlusElasticXS::GetPTables(G4double LP, G4double ILP, G4int P
// a24
// a36
// The main pre-exponent (peh_sg)
lastPAR[ 9]=4.5*std::pow(a,1.15); // p1
lastPAR[10]=.06*std::pow(a,.6); // p2
lastPAR[ 9]=4.5*G4Pow::GetInstance()->powA(a,1.15); // p1
lastPAR[10]=.06*G4Pow::GetInstance()->powA(a,.6); // p2
lastPAR[11]=.6*a/(1.+2.e15/a16); // p3
lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32); // p4
lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5); // p5
@@ -487,8 +497,8 @@ G4double G4ChipsPionPlusElasticXS::GetPTables(G4double LP, G4double ILP, G4int P
lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12); // p3
lastPAR[27]=.016*asa/(1.+5.e16/a16); // p4
// The 1st max slope (peh_qs)
lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11); // p2
lastPAR[28]=.002*a4/(1.+7.e7/G4Pow::GetInstance()->powA(a-6.83,14)); // p1
lastPAR[29]=2.e6/a6+7.2/G4Pow::GetInstance()->powA(a,.11); // p2
lastPAR[30]=11.*a3/(1.+7.e23/a16/a8); // p3
lastPAR[31]=100./asa; // p4
// The 2nd max pre-exponent (peh_ss)
@@ -602,11 +612,11 @@ G4double G4ChipsPionPlusElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
if(tgZ==1 && tgN==0) // ===> p+p=p+p
{
G4double E1=lastTM*theB1;
G4double R1=(1.-std::exp(-E1));
G4double R1=(1.-G4Exp(-E1));
G4double E2=lastTM*theB2;
G4double R2=(1.-std::exp(-E2*E2*E2));
G4double R2=(1.-G4Exp(-E2*E2*E2));
G4double E3=lastTM*theB3;
G4double R3=(1.-std::exp(-E3));
G4double R3=(1.-G4Exp(-E3));
G4double I1=R1*theS1/theB1;
G4double I2=R2*theS2;
G4double I3=R3*theS3;
@@ -616,38 +626,38 @@ G4double G4ChipsPionPlusElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
{
G4double ran=R1*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB1;
q2=-G4Log(1.-ran)/theB1;
}
else if(rand<I12)
{
G4double ran=R2*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran);
q2=-G4Log(1.-ran);
if(q2<0.) q2=0.;
q2=std::pow(q2,third)/theB2;
q2=G4Pow::GetInstance()->powA(q2,third)/theB2;
}
else
{
G4double ran=R3*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB3;
q2=-G4Log(1.-ran)/theB3;
}
}
else
{
G4double a=tgZ+tgN;
G4double E1=lastTM*(theB1+lastTM*theSS);
G4double R1=(1.-std::exp(-E1));
G4double R1=(1.-G4Exp(-E1));
G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
G4double tm2=lastTM*lastTM;
G4double E2=lastTM*tm2*theB2; // power 3 for lowA, 5 for HighA (1st)
if(a>6.5)E2*=tm2; // for heavy nuclei
G4double R2=(1.-std::exp(-E2));
G4double R2=(1.-G4Exp(-E2));
G4double E3=lastTM*theB3;
if(a>6.5)E3*=tm2*tm2*tm2; // power 1 for lowA, 7 (2nd) for HighA
G4double R3=(1.-std::exp(-E3));
G4double R3=(1.-G4Exp(-E3));
G4double E4=lastTM*theB4;
G4double R4=(1.-std::exp(-E4));
G4double R4=(1.-G4Exp(-E4));
G4double I1=R1*theS1;
G4double I2=R2*theS2;
G4double I3=R3*theS3;
@@ -659,31 +669,31 @@ G4double G4ChipsPionPlusElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
{
G4double ran=R1*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB1;
q2=-G4Log(1.-ran)/theB1;
if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
}
else if(rand<I12)
{
G4double ran=R2*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB2;
q2=-G4Log(1.-ran)/theB2;
if(q2<0.) q2=0.;
if(a<6.5) q2=std::pow(q2,third);
else q2=std::pow(q2,fifth);
if(a<6.5) q2=G4Pow::GetInstance()->powA(q2,third);
else q2=G4Pow::GetInstance()->powA(q2,fifth);
}
else if(rand<I13)
{
G4double ran=R3*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB3;
q2=-G4Log(1.-ran)/theB3;
if(q2<0.) q2=0.;
if(a>6.5) q2=std::pow(q2,sevth);
if(a>6.5) q2=G4Pow::GetInstance()->powA(q2,sevth);
}
else
{
G4double ran=R4*G4UniformRand();
if(ran>1.) ran=1.;
q2=-std::log(1.-ran)/theB4;
q2=-G4Log(1.-ran)/theB4;
if(a<6.5) q2=lastTM-q2; // u reduced for lightA (starts from 0)
}
}
@@ -742,7 +752,7 @@ G4double G4ChipsPionPlusElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tg
tgZ=1;
tgN=0;
}
G4double p=std::exp(lp); // momentum
G4double p=G4Exp(lp); // momentum
G4double sp=std::sqrt(p); // sqrt(p)
G4double p2=p*p;
G4double p3=p2*p;
@@ -753,7 +763,7 @@ G4double G4ChipsPionPlusElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tg
theSS=lastPAR[34];
theS1=(lastPAR[12]+lastPAR[13]*dl2*dl2)/(1.+lastPAR[14]/p4/p)+
(lastPAR[15]/p2+lastPAR[16]*p)/(p4+lastPAR[17]*sp);
theB1=lastPAR[18]*std::pow(p,lastPAR[19])/(1.+lastPAR[20]/p3);
theB1=lastPAR[18]*G4Pow::GetInstance()->powA(p,lastPAR[19])/(1.+lastPAR[20]/p3);
theS2=lastPAR[21]+lastPAR[22]/(p4+lastPAR[23]*p);
theB2=lastPAR[24]+lastPAR[25]/(p4+lastPAR[26]/sp);
theS3=lastPAR[27]+lastPAR[28]/(p4*p4+lastPAR[29]*p2+lastPAR[30]);
@@ -779,7 +789,7 @@ G4double G4ChipsPionPlusElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tg
//G4double p24=p16*p8;
G4double dl=lp-5.;
G4double a=tgZ+tgN;
G4double pah=std::pow(p,a/2);
G4double pah=G4Pow::GetInstance()->powA(p,a/2);
G4double pa=pah*pah;
G4double pa2=pa*pa;
if(a<6.5)
@@ -789,23 +799,23 @@ G4double G4ChipsPionPlusElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tg
theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
theB2=lastPAR[27]*G4Pow::GetInstance()->powA(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
theS4=p2*(pah*lastPAR[38]*G4Exp(-pah*lastPAR[39])+
lastPAR[40]/(1.+lastPAR[41]*G4Pow::GetInstance()->powA(p,lastPAR[42])));
theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
}
else
{
theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
lastPAR[13]/(p5+lastPAR[14]/p16);
theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/G4Pow::GetInstance()->powA(p,lastPAR[20]))+
lastPAR[17]/(1.+lastPAR[18]/p4);
theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
theSS=lastPAR[21]/(p4/G4Pow::GetInstance()->powA(p,lastPAR[23])+lastPAR[22]/p4);
theS2=lastPAR[24]/p4/(G4Pow::GetInstance()->powA(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
theB2=lastPAR[28]/G4Pow::GetInstance()->powA(p,lastPAR[29])+lastPAR[30]/G4Pow::GetInstance()->powA(p,lastPAR[31]);
theS3=lastPAR[32]/G4Pow::GetInstance()->powA(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
lastPAR[33]/(1.+lastPAR[34]/p6);
theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
@@ -43,6 +43,10 @@
#include "G4ParticleDefinition.hh"
#include "G4PionPlus.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
#include "G4Pow.hh"
// factory
#include "G4CrossSectionFactory.hh"
//
@@ -74,13 +78,20 @@ G4ChipsPionPlusInelasticXS::~G4ChipsPionPlusInelasticXS()
delete HEN;
}
G4bool G4ChipsPionPlusInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsPionPlusInelasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsPionPlusInelasticXS provides the inelastic cross\n"
<< "section for pion+ nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsPionPlusInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4PionPlus::PionPlus() ) return true;
return false;
return true;
}
// The main member function giving the collision cross section (P is in IU, CS is in mb)
@@ -179,10 +190,10 @@ G4double G4ChipsPionPlusInelasticXS::CalculateCrossSection(G4int F, G4int I,
static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
static const G4double Pmax=227000.; // maxP for the HEN (High ENergy) part 227 GeV
static const G4int nH=224; // A#of HEN points in lnE
static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double milP=G4Log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=G4Log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
static const G4double milPG=G4Log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
G4double sigma=0.;
if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
//G4double A=targN+targZ; // A of the target
@@ -233,13 +244,13 @@ G4double G4ChipsPionPlusInelasticXS::CalculateCrossSection(G4int F, G4int I,
}
else if (Momentum<Pmax) // High Energy region
{
G4double lP=std::log(Momentum);
G4double lP=G4Log(Momentum);
sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
}
else // UHE region (calculation, not frequent)
{
G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
sigma=CrossSectionFormula(targZ, targN, P, G4Log(P));
}
if(sigma<0.) return 0.;
return sigma;
@@ -254,8 +265,8 @@ G4double G4ChipsPionPlusInelasticXS::ThresholdMomentum(G4int tZ, G4int tN)
G4double tA=tZ+tN;
if(tZ<.99 || tN<0.) return 0.;
else if(tZ==1 && tN==0) return 300.; // A threshold on the free proton
//G4double dE=1.263*tZ/(1.+std::pow(tA,third));
G4double dE=tZ/(1.+std::pow(tA,third)); // Safety for diffused edge of the nucleus (QE)
//G4double dE=1.263*tZ/(1.+G4Pow::GetInstance()->powA(tA,third));
G4double dE=tZ/(1.+G4Pow::GetInstance()->powA(tA,third)); // Safety for diffused edge of the nucleus (QE)
G4double tM=931.5*tA;
G4double T=dE+dE*(dE/2+pM)/tM;
return std::sqrt(T*(tpM+T));
@@ -264,14 +275,14 @@ G4double G4ChipsPionPlusInelasticXS::ThresholdMomentum(G4int tZ, G4int tN)
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) (P in GeV/c)
G4double G4ChipsPionPlusInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double P)
{
G4double lP=std::log(P);
G4double lP=G4Log(P);
return CrossSectionFormula(tZ, tN, P, lP);
}
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
G4double G4ChipsPionPlusInelasticXS::CrossSectionLog(G4int tZ, G4int tN, G4double lP)
{
G4double P=std::exp(lP);
G4double P=G4Exp(lP);
return CrossSectionFormula(tZ, tN, P, lP);
}
// Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
@@ -306,11 +317,11 @@ G4double G4ChipsPionPlusInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
G4double p2=P*P;
G4double p4=p2*p2;
G4double a=tN+tZ; // A of the target
G4double al=std::log(a);
G4double al=G4Log(a);
G4double sa=std::sqrt(a);
G4double ssa=std::sqrt(sa);
G4double a2=a*a;
G4double c=41.*std::exp(al*.68)*(1.+44./a2)/(1.+8./a)/(1.+200./a2/a2);
G4double c=41.*G4Exp(al*.68)*(1.+44./a2)/(1.+8./a)/(1.+200./a2/a2);
G4double f=290.*ssa/(1.+34./a/ssa);
G4double gg=-1.32-al*.043;
G4double u=lP-gg;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ChipsProtonElasticXS.cc 84714 2014-10-20 07:37:24Z gcosmo $
// $Id: G4ChipsProtonElasticXS.cc 93080 2015-10-02 14:45:31Z gcosmo $
//
//
// G4 Physics class: G4ChipsProtonElasticXS for pA elastic cross sections
@@ -143,13 +143,20 @@ G4ChipsProtonElasticXS::~G4ChipsProtonElasticXS()
}
G4bool G4ChipsProtonElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsProtonElasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsProtonElasticXS provides the elastic cross\n"
<< "section for proton nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsProtonElasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4Proton::Proton() ) return true;
return false;
return true;
}
@@ -44,6 +44,10 @@
#include "G4DynamicParticle.hh"
#include "G4ParticleDefinition.hh"
#include "G4Proton.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
#include "G4Pow.hh"
// factory
#include "G4CrossSectionFactory.hh"
@@ -76,13 +80,20 @@ G4ChipsProtonInelasticXS::~G4ChipsProtonInelasticXS()
delete HEN;
}
G4bool G4ChipsProtonInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
void
G4ChipsProtonInelasticXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4ChipsProtonInelasticXS provides the inelastic cross\n"
<< "section for proton nucleus scattering as a function of incident\n"
<< "momentum. The cross section is calculated using M. Kossov's\n"
<< "CHIPS parameterization of cross section data.\n";
}
G4bool G4ChipsProtonInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,
const G4Element*,
const G4Material*)
{
const G4ParticleDefinition* particle = Pt->GetDefinition();
if (particle == G4Proton::Proton() ) return true;
return false;
return true;
}
@@ -181,10 +192,10 @@ G4double G4ChipsProtonInelasticXS::CalculateCrossSection(G4int F, G4int I,
static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
static const G4double Pmax=227000.; // maxP for the HEN (High ENergy) part 227 GeV
static const G4int nH=224; // A#of HEN points in lnE
static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double milP=G4Log(Pmin);// Low logarithm energy for the HEN part
static const G4double malP=G4Log(Pmax);// High logarithm energy (each 2.75 percent)
static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
static const G4double milPG=G4Log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
G4double sigma=0.;
if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
//G4double A=targN+targZ; // A of the target
@@ -235,13 +246,13 @@ G4double G4ChipsProtonInelasticXS::CalculateCrossSection(G4int F, G4int I,
}
else if (Momentum<Pmax) // High Energy region
{
G4double lP=std::log(Momentum);
G4double lP=G4Log(Momentum);
sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
}
else // UHE region (calculation, not frequent)
{
G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
sigma=CrossSectionFormula(targZ, targN, P, G4Log(P));
}
if(sigma<0.) return 0.;
return sigma;
@@ -257,8 +268,8 @@ G4double G4ChipsProtonInelasticXS::ThresholdMomentum(G4int tZ, G4int tN)
G4double tA=tZ+tN;
if(tZ<.99 || tN<0.) return 0.;
else if(tZ==1 && tN==0) return 800.; // A threshold on the free proton
//G4double dE=1.263*tZ/(1.+std::pow(tA,third));
G4double dE=tZ/(1.+std::pow(tA,third)); // Safety for diffused edge of the nucleus (QE)
//G4double dE=1.263*tZ/(1.+G4Pow::GetInstance()->powA(tA,third));
G4double dE=tZ/(1.+G4Pow::GetInstance()->powA(tA,third)); // Safety for diffused edge of the nucleus (QE)
G4double tM=931.5*tA;
G4double T=dE+dE*(dE/2+pM)/tM;
return std::sqrt(T*(tpM+T));
@@ -269,7 +280,7 @@ G4double G4ChipsProtonInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double
{
G4double sigma=0.;
if(P<ThresholdMomentum(tZ,tN)*.001) return sigma;
G4double lP=std::log(P);
G4double lP=G4Log(P);
if(tZ==1&&!tN){if(P>.35) sigma=CrossSectionFormula(tZ,tN,P,lP);}// s(pp)=0 below 350Mev/c
else if(tZ<97 && tN<152) // General solution
{
@@ -325,7 +336,7 @@ G4double G4ChipsProtonInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double
if(pex>0.)
{
G4double dp=P-pos;
sigma+=pex*std::exp(-dp*dp/wid);
sigma+=pex*G4Exp(-dp*dp/wid);
}
}
else
@@ -340,7 +351,7 @@ G4double G4ChipsProtonInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double
// Calculation formula for proton-nuclear inelastic cross-section (mb) log(P in GeV/c)
G4double G4ChipsProtonInelasticXS::CrossSectionLog(G4int tZ, G4int tN, G4double lP)
{
G4double P=std::exp(lP);
G4double P=G4Exp(lP);
return CrossSectionFormula(tZ, tN, P, lP);
}
// Calculation formula for proton-nuclear inelastic cross-section (mb) log(P in GeV/c)
@@ -359,7 +370,7 @@ G4double G4ChipsProtonInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
}
else if(P>1000.)
{
G4double lp=std::log(P)-3.5;
G4double lp=G4Log(P)-3.5;
G4double lp2=lp*lp;
El=0.0557*lp2+6.72;
To=0.3*lp2+38.2;
@@ -368,7 +379,7 @@ G4double G4ChipsProtonInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
{
G4double p2=P*P;
G4double LE=1./(0.00012+p2*0.2);
G4double lp=std::log(P)-3.5;
G4double lp=G4Log(P)-3.5;
G4double lp2=lp*lp;
G4double rp2=1./p2;
El=LE+(0.0557*lp2+6.72+32.6/P)/(1.+rp2/P);
@@ -388,12 +399,12 @@ G4double G4ChipsProtonInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
}
else if(tZ<97 && tN<152) // General solution
{
//G4double lP=std::log(P); // Already calculated
//G4double lP=G4Log(P); // Already calculated
G4double d=lP-4.2;
G4double p2=P*P;
G4double p4=p2*p2;
G4double a=tN+tZ; // A of the target
G4double al=std::log(a);
G4double al=G4Log(a);
G4double sa=std::sqrt(a);
G4double a2=a*a;
G4double a2s=a2*sa;
@@ -405,12 +416,12 @@ G4double G4ChipsProtonInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
G4double dl=al-3.;
G4double dl2=dl*dl;
G4double r=.21+.62*dl2/(1.+.5*dl2);
G4double gg=40.*std::exp(al*0.712)/(1.+12.2/a)/(1.+34./a2);
G4double e=318.+a4/(1.+.0015*a4/std::exp(al*0.09))/(1.+4.e-28*a12)+
G4double gg=40.*G4Exp(al*0.712)/(1.+12.2/a)/(1.+34./a2);
G4double e=318.+a4/(1.+.0015*a4/G4Exp(al*0.09))/(1.+4.e-28*a12)+
8.e-18/(1./a16+1.3e-20)/(1.+1.e-21*a12);
G4double ss=3.57+.009*a2/(1.+.0001*a2*a);
G4double h=(.01/a4+2.5e-6/a)*(1.+6.e-6*a2*a)/(1.+6.e7/a12/a2);
sigma=(c+d*d)/(1.+r/p4)+(gg+e*std::exp(-ss*P))/(1.+h/p4/p4);
sigma=(c+d*d)/(1.+r/p4)+(gg+e*G4Exp(-ss*P))/(1.+h/p4/p4);
}
else
{
@@ -41,6 +41,7 @@
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4Pow.hh"
///////////////////////////////////////////////////////////////////////////////
@@ -107,7 +108,7 @@ G4double G4ComponentAntiNuclNuclearXS::GetTotalElementCrossSection
{ fTotalXsc = sigmaTotal * millibarn;
return fTotalXsc; }
fRadiusEff = 1.34*std::pow(A,0.23)+1.35/std::pow(A,1./3.); //fm
fRadiusEff = 1.34*G4Pow::GetInstance()->powA(A,0.23)+1.35/G4Pow::GetInstance()->powA(A,1./3.); //fm
if( (Z==1) && (A==2) ) fRadiusEff = 3.800; //fm
if( (Z==1) && (A==3) ) fRadiusEff = 3.300;
@@ -117,7 +118,7 @@ G4double G4ComponentAntiNuclNuclearXS::GetTotalElementCrossSection
//calculation of effective nuclear radius for AntiDeuteron interaction (can be changed)
if (theParticle == theADeuteron)
{ fRadiusEff = 1.46 * std::pow(A,0.21) + 1.45 / std::pow(A,1./3.);
{ fRadiusEff = 1.46 * G4Pow::GetInstance()->powA(A,0.21) + 1.45 / G4Pow::GetInstance()->powA(A,1./3.);
if( (Z==1) && (A==2) ) fRadiusEff = 3.238; //fm
if( (Z==1) && (A==3) ) fRadiusEff = 3.144;
@@ -127,7 +128,7 @@ G4double G4ComponentAntiNuclNuclearXS::GetTotalElementCrossSection
// calculation of effective nuclear radius for AntiHe3 interaction (can be changed)
if( (theParticle ==theAHe3) || (theParticle ==theATriton) )
{ fRadiusEff = 1.40* std::pow(A,0.21)+1.63/std::pow(A,1./3.);
{ fRadiusEff = 1.40* G4Pow::GetInstance()->powA(A,0.21)+1.63/G4Pow::GetInstance()->powA(A,1./3.);
if( (Z==1) && (A==2) ) fRadiusEff = 3.144; //fm
if( (Z==1) && (A==3) ) fRadiusEff = 3.075;
@@ -139,7 +140,7 @@ G4double G4ComponentAntiNuclNuclearXS::GetTotalElementCrossSection
if (theParticle == theAAlpha)
{
fRadiusEff = 1.35* std::pow(A,0.21)+1.1/std::pow(A,1./3.);
fRadiusEff = 1.35* G4Pow::GetInstance()->powA(A,0.21)+1.1/G4Pow::GetInstance()->powA(A,1./3.);
if( (Z==1) && (A==2) ) fRadiusEff = 2.544; //fm
if( (Z==1) && (A==3) ) fRadiusEff = 2.589;
@@ -152,7 +153,7 @@ G4double G4ComponentAntiNuclNuclearXS::GetTotalElementCrossSection
G4double REf2 = R2+fRadiusNN2;
G4double ApAt = std::abs(theParticle->GetBaryonNumber()) * A;
xsection = 2*pi*REf2*10.*std::log(1+(ApAt*sigmaTotal/(2*pi*REf2*10.))); //mb
xsection = 2*pi*REf2*10.*G4Log(1+(ApAt*sigmaTotal/(2*pi*REf2*10.))); //mb
xsection =xsection *millibarn;
fTotalXsc = xsection;
@@ -196,7 +197,7 @@ G4double G4ComponentAntiNuclNuclearXS::GetInelasticElementCrossSection
{ fInelasticXsc = (sigmaTotal - sigmaElastic) * millibarn;
return fInelasticXsc;
}
fRadiusEff = 1.31*std::pow(A, 0.22)+0.9/std::pow(A, 1./3.); //fm
fRadiusEff = 1.31*G4Pow::GetInstance()->powA(A, 0.22)+0.9/G4Pow::GetInstance()->powA(A, 1./3.); //fm
if( (Z==1) && (A==2) ) fRadiusEff = 3.582; //fm
if( (Z==1) && (A==3) ) fRadiusEff = 3.105;
@@ -208,7 +209,7 @@ G4double G4ComponentAntiNuclNuclearXS::GetInelasticElementCrossSection
if (theParticle ==theADeuteron)
{
fRadiusEff = 1.38*std::pow(A, 0.21)+1.55/std::pow(A, 1./3.);
fRadiusEff = 1.38*G4Pow::GetInstance()->powA(A, 0.21)+1.55/G4Pow::GetInstance()->powA(A, 1./3.);
if( (Z==1) && (A==2) ) fRadiusEff = 3.169; //fm
if( (Z==1) && (A==3) ) fRadiusEff = 3.066;
@@ -220,7 +221,7 @@ G4double G4ComponentAntiNuclNuclearXS::GetInelasticElementCrossSection
if( (theParticle ==theAHe3) || (theParticle ==theATriton) )
{
fRadiusEff = 1.34 * std::pow(A, 0.21)+1.51/std::pow(A, 1./3.);
fRadiusEff = 1.34 * G4Pow::GetInstance()->powA(A, 0.21)+1.51/G4Pow::GetInstance()->powA(A, 1./3.);
if( (Z==1) && (A==2) ) fRadiusEff = 3.066; //fm
if( (Z==1) && (A==3) ) fRadiusEff = 2.973;
@@ -233,7 +234,7 @@ G4double G4ComponentAntiNuclNuclearXS::GetInelasticElementCrossSection
if (theParticle == theAAlpha)
{
fRadiusEff = 1.3*std::pow(A, 0.21)+1.05/std::pow(A, 1./3.);
fRadiusEff = 1.3*G4Pow::GetInstance()->powA(A, 0.21)+1.05/G4Pow::GetInstance()->powA(A, 1./3.);
if( (Z==1) && (A==2) ) fRadiusEff = 2.498; //fm
if( (Z==1) && (A==3) ) fRadiusEff = 2.508;
@@ -244,7 +245,7 @@ G4double G4ComponentAntiNuclNuclearXS::GetInelasticElementCrossSection
G4double REf2 = R2+fRadiusNN2;
G4double ApAt= std::abs(theParticle->GetBaryonNumber()) * A;
inelxsection = pi*REf2 *10* std::log(1+(ApAt*sigmaTotal/(pi*REf2*10.))); //mb
inelxsection = pi*REf2 *10* G4Log(1+(ApAt*sigmaTotal/(pi*REf2*10.))); //mb
inelxsection = inelxsection * millibarn;
fInelasticXsc = inelxsection;
return fInelasticXsc;
@@ -304,16 +305,16 @@ G4double G4ComponentAntiNuclNuclearXS::GetAntiHadronNucleonTotCrSc
S = 2.*Mn*Mn + 2. *Mn*Elab; // GeV^2
SqrtS = std::sqrt(S); // GeV
B = b0+b2*std::log(SqrtS/SqrtS0)*std::log(SqrtS/SqrtS0); //GeV^(-2)
SigAss = 36.04 +0.304*std::log(S/S0)*std::log(S/S0); //mb
B = b0+b2*G4Log(SqrtS/SqrtS0)*G4Log(SqrtS/SqrtS0); //GeV^(-2)
SigAss = 36.04 +0.304*G4Log(S/S0)*G4Log(S/S0); //mb
R0 = std::sqrt(0.40874044*SigAss - B); //GeV^(-2)
C = 13.55;
d1 = -4.47;
d2 = 12.38;
d3 = -12.43;
xsection = SigAss*(1 + 1./(std::sqrt(S-4.*Mn*Mn)) / (std::pow(R0, 3.))
*C* (1+d1/SqrtS+d2/(std::pow(SqrtS,2.))+d3/(std::pow(SqrtS,3.)) ));
xsection = SigAss*(1 + 1./(std::sqrt(S-4.*Mn*Mn)) / (G4Pow::GetInstance()->powA(R0, 3.))
*C* (1+d1/SqrtS+d2/(G4Pow::GetInstance()->powA(SqrtS,2.))+d3/(G4Pow::GetInstance()->powA(SqrtS,3.)) ));
// xsection *= millibarn;
@@ -336,15 +337,15 @@ GetAntiHadronNucleonElCrSc(const G4ParticleDefinition* aParticle, G4double kinEn
GetAntiHadronNucleonTotCrSc(aParticle,kinEnergy);
SigAss = 4.5 + 0.101*std::log(S/S0)*std::log(S/S0); //mb
SigAss = 4.5 + 0.101*G4Log(S/S0)*G4Log(S/S0); //mb
C = 59.27;
d1 = -6.95;
d2 = 23.54;
d3 = -25.34;
xsection = SigAss* (1 + 1. / (std::sqrt(S-4.*Mn*Mn)) / (std::pow(R0, 3.))
*C* ( 1+d1/SqrtS+d2/(std::pow(SqrtS,2.))+d3/(std::pow(SqrtS,3.)) ));
xsection = SigAss* (1 + 1. / (std::sqrt(S-4.*Mn*Mn)) / (G4Pow::GetInstance()->powA(R0, 3.))
*C* ( 1+d1/SqrtS+d2/(G4Pow::GetInstance()->powA(SqrtS,2.))+d3/(G4Pow::GetInstance()->powA(SqrtS,3.)) ));
// xsection *= millibarn;
@@ -36,6 +36,7 @@
#include "G4DynamicParticle.hh"
#include "G4Neutron.hh"
#include "G4Proton.hh"
#include "G4Pow.hh"
// Group 1: He, Be, C for 44 energies
@@ -726,7 +727,7 @@ Interpolate(G4int Z1, G4int Z2, G4int Z, G4double x1, G4double x2)
{
for (G4int i=0; i<92; ++i)
{
A75[i] = std::pow(A[i], alpha); // interpolate by square ~ A^(2/3)
A75[i] = G4Pow::GetInstance()->powA(A[i], alpha); // interpolate by square ~ A^(2/3)
}
NeedInit=false;
}
@@ -36,13 +36,15 @@
#include "G4ParticleDefinition.hh"
#include "G4DynamicParticle.hh"
#include "G4HadronNucleonXsc.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
#include "G4Pow.hh"
//////////////////////////////////////////////////////////////////////////////
//
G4ComponentGGHadronNucleusXsc::G4ComponentGGHadronNucleusXsc()
: G4VComponentCrossSection("Glauber-Gribov"),
: G4VComponentCrossSection(Default_Name()),
// fUpperLimit(100000*GeV),
fLowerLimit(10.*MeV),// fLowerLimit(3*GeV),
fRadiusConst(1.08*fermi), // 1.1, 1.3 ?
@@ -242,19 +244,41 @@ G4ComponentGGHadronNucleusXsc::IsIsoApplicable(const G4DynamicParticle* aDP,
const G4ParticleDefinition* theParticle = aDP->GetDefinition();
if ( ( kineticEnergy >= fLowerLimit &&
Z > 1 && // >= He
( theParticle == theAProton ||
theParticle == theGamma ||
theParticle == theKPlus ||
theParticle == theKMinus ||
theParticle == theK0L ||
theParticle == theK0S ||
theParticle == theSMinus ||
theParticle == theProton ||
theParticle == theNeutron ||
theParticle == thePiPlus ||
theParticle == thePiMinus ) ) ) applicable = true;
if (
Z >= 1 // >= H for kaons
&&
(
kineticEnergy >= fLowerLimit
&&
// Z > 1 && // >= He
(
theParticle == theAProton ||
theParticle == theGamma ||
theParticle == theSMinus ||
theParticle == theProton ||
theParticle == theNeutron ||
theParticle == thePiPlus ||
theParticle == thePiMinus
)
)
)
applicable = true;
if (
Z >= 1 // >= H for kaons
&&
(
kineticEnergy >= 0.01*fLowerLimit
&&
(
theParticle == theKPlus ||
theParticle == theKMinus ||
theParticle == theK0L ||
theParticle == theK0S
)
)
)
applicable = true;
return applicable;
}
@@ -276,7 +300,7 @@ G4ComponentGGHadronNucleusXsc::GetIsoCrossSection(const G4DynamicParticle* aPart
G4double xsection, sigma, cofInelastic, cofTotal, nucleusSquare, ratio;
G4double hpInXsc(0.), hnInXsc(0.);
G4double R = GetNucleusRadius(A);
G4int N = A - Z; // number of neutrons
if (N < 0) N = 0;
@@ -318,7 +342,7 @@ G4ComponentGGHadronNucleusXsc::GetIsoCrossSection(const G4DynamicParticle* aPart
cofInelastic = 2.2;
cofTotal = 2.0;
R = 1.3*fermi;
R *= std::pow(G4double(A), 0.3333);
R *= G4Pow::GetInstance()->powA(G4double(A), 0.3333);
}
else
{
@@ -333,7 +357,7 @@ G4ComponentGGHadronNucleusXsc::GetIsoCrossSection(const G4DynamicParticle* aPart
nucleusSquare = cofTotal*pi*R*R; // basically 2piRR
ratio = sigma/nucleusSquare;
xsection = nucleusSquare*std::log( 1. + ratio );
xsection = nucleusSquare*G4Log( 1. + ratio );
xsection *= GetParticleBarCorTot(theParticle, Z);
@@ -341,7 +365,7 @@ G4ComponentGGHadronNucleusXsc::GetIsoCrossSection(const G4DynamicParticle* aPart
fInelasticXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fInelasticXsc = nucleusSquare*G4Log( 1. + cofInelastic*ratio )/cofInelastic;
fInelasticXsc *= GetParticleBarCorIn(theParticle, Z);
@@ -351,7 +375,7 @@ G4ComponentGGHadronNucleusXsc::GetIsoCrossSection(const G4DynamicParticle* aPart
G4double difratio = ratio/(1.+ratio);
fDiffractionXsc = 0.5*nucleusSquare*( difratio - std::log( 1. + difratio ) );
fDiffractionXsc = 0.5*nucleusSquare*( difratio - G4Log( 1. + difratio ) );
// sigma = GetHNinelasticXsc(aParticle, A, Z);
@@ -360,7 +384,7 @@ G4ComponentGGHadronNucleusXsc::GetIsoCrossSection(const G4DynamicParticle* aPart
ratio = sigma/nucleusSquare;
fProductionXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fProductionXsc = nucleusSquare*G4Log( 1. + cofInelastic*ratio )/cofInelastic;
fProductionXsc *= GetParticleBarCorIn(theParticle, Z);
@@ -370,15 +394,28 @@ G4ComponentGGHadronNucleusXsc::GetIsoCrossSection(const G4DynamicParticle* aPart
{
fTotalXsc = sigma;
xsection = sigma;
fInelasticXsc = hnXsc->GetInelasticHadronNucleonXsc();
if ( theParticle != theAProton )
{
sigma = GetHNinelasticXsc(aParticle, A, Z);
fInelasticXsc = sigma;
fElasticXsc = fTotalXsc - fInelasticXsc;
fElasticXsc = hnXsc->GetElasticHadronNucleonXsc();
// sigma = GetHNinelasticXsc(aParticle, A, Z);
// fInelasticXsc = sigma;
// fElasticXsc = fTotalXsc - fInelasticXsc;
}
else if( theParticle == theKPlus ||
theParticle == theKMinus ||
theParticle == theK0S ||
theParticle == theK0L )
{
fInelasticXsc = hpInXsc;
fElasticXsc = fTotalXsc - fInelasticXsc;
}
else
{
fInelasticXsc = hpInXsc;
fElasticXsc = fTotalXsc - fInelasticXsc;
}
if (fElasticXsc < 0.) fElasticXsc = 0.;
@@ -417,11 +454,11 @@ GetRatioSD(const G4DynamicParticle* aParticle, G4int A, G4int Z)
nucleusSquare = cofTotal*pi*R*R; // basically 2piRR
ratio = sigma/nucleusSquare;
fInelasticXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fInelasticXsc = nucleusSquare*G4Log( 1. + cofInelastic*ratio )/cofInelastic;
G4double difratio = ratio/(1.+ratio);
fDiffractionXsc = 0.5*nucleusSquare*( difratio - std::log( 1. + difratio ) );
fDiffractionXsc = 0.5*nucleusSquare*( difratio - G4Log( 1. + difratio ) );
if (fInelasticXsc > 0.) ratio = fDiffractionXsc/fInelasticXsc;
else ratio = 0.;
@@ -459,12 +496,12 @@ GetRatioQE(const G4DynamicParticle* aParticle, G4int A, G4int Z)
nucleusSquare = cofTotal*pi*R*R; // basically 2piRR
ratio = sigma/nucleusSquare;
fInelasticXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fInelasticXsc = nucleusSquare*G4Log( 1. + cofInelastic*ratio )/cofInelastic;
sigma = GetHNinelasticXsc(aParticle, A, Z);
ratio = sigma/nucleusSquare;
fProductionXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fProductionXsc = nucleusSquare*G4Log( 1. + cofInelastic*ratio )/cofInelastic;
if (fInelasticXsc > fProductionXsc) ratio = (fInelasticXsc-fProductionXsc)/fInelasticXsc;
else ratio = 0.;
@@ -520,42 +557,42 @@ G4ComponentGGHadronNucleusXsc::GetHadronNucleonXsc(const G4DynamicParticle* aPar
if(theParticle == theGamma)
{
xsection = aa*(0.0677*std::pow(sMand,0.0808) + 0.129*std::pow(sMand,-0.4525));
xsection = aa*(0.0677*G4Pow::GetInstance()->powA(sMand,0.0808) + 0.129*G4Pow::GetInstance()->powA(sMand,-0.4525));
}
else if(theParticle == theNeutron) // as proton ???
{
xsection = aa*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
xsection = aa*(21.70*G4Pow::GetInstance()->powA(sMand,0.0808) + 56.08*G4Pow::GetInstance()->powA(sMand,-0.4525));
}
else if(theParticle == theProton)
{
xsection = aa*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
// xsection = At*( 49.51*std::pow(sMand,-0.097) + 0.314*std::log(sMand)*std::log(sMand) );
// xsection = At*( 38.4 + 0.85*std::abs(std::pow(log(sMand),1.47)) );
xsection = aa*(21.70*G4Pow::GetInstance()->powA(sMand,0.0808) + 56.08*G4Pow::GetInstance()->powA(sMand,-0.4525));
// xsection = At*( 49.51*G4Pow::GetInstance()->powA(sMand,-0.097) + 0.314*G4Log(sMand)*G4Log(sMand) );
// xsection = At*( 38.4 + 0.85*std::abs(G4Pow::GetInstance()->powA(log(sMand),1.47)) );
}
else if(theParticle == theAProton)
{
xsection = aa*( 21.70*std::pow(sMand,0.0808) + 98.39*std::pow(sMand,-0.4525));
xsection = aa*( 21.70*G4Pow::GetInstance()->powA(sMand,0.0808) + 98.39*G4Pow::GetInstance()->powA(sMand,-0.4525));
}
else if(theParticle == thePiPlus)
{
xsection = aa*(13.63*std::pow(sMand,0.0808) + 27.56*std::pow(sMand,-0.4525));
xsection = aa*(13.63*G4Pow::GetInstance()->powA(sMand,0.0808) + 27.56*G4Pow::GetInstance()->powA(sMand,-0.4525));
}
else if(theParticle == thePiMinus)
{
// xsection = At*( 55.2*std::pow(sMand,-0.255) + 0.346*std::log(sMand)*std::log(sMand) );
xsection = aa*(13.63*std::pow(sMand,0.0808) + 36.02*std::pow(sMand,-0.4525));
// xsection = At*( 55.2*G4Pow::GetInstance()->powA(sMand,-0.255) + 0.346*G4Log(sMand)*G4Log(sMand) );
xsection = aa*(13.63*G4Pow::GetInstance()->powA(sMand,0.0808) + 36.02*G4Pow::GetInstance()->powA(sMand,-0.4525));
}
else if(theParticle == theKPlus)
{
xsection = aa*(11.82*std::pow(sMand,0.0808) + 8.15*std::pow(sMand,-0.4525));
xsection = aa*(11.82*G4Pow::GetInstance()->powA(sMand,0.0808) + 8.15*G4Pow::GetInstance()->powA(sMand,-0.4525));
}
else if(theParticle == theKMinus)
{
xsection = aa*(11.82*std::pow(sMand,0.0808) + 26.36*std::pow(sMand,-0.4525));
xsection = aa*(11.82*G4Pow::GetInstance()->powA(sMand,0.0808) + 26.36*G4Pow::GetInstance()->powA(sMand,-0.4525));
}
else // as proton ???
{
xsection = aa*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
xsection = aa*(21.70*G4Pow::GetInstance()->powA(sMand,0.0808) + 56.08*G4Pow::GetInstance()->powA(sMand,-0.4525));
}
xsection *= millibarn;
return xsection;
@@ -624,72 +661,72 @@ G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscPDG(const G4DynamicParticle* a
if(theParticle == theNeutron) // proton-neutron fit
{
xsection = zz*( 35.80 + B*std::pow(std::log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
xsection += nn*( 35.45 + B*std::pow(std::log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2)); // pp for nn
xsection = zz*( 35.80 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 40.15*G4Pow::GetInstance()->powA(sMand,-eta1) - 30.*G4Pow::GetInstance()->powA(sMand,-eta2));
xsection += nn*( 35.45 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 42.53*G4Pow::GetInstance()->powA(sMand,-eta1) - 33.34*G4Pow::GetInstance()->powA(sMand,-eta2)); // pp for nn
}
else if(theParticle == theProton)
{
xsection = zz*( 35.45 + B*std::pow(std::log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
xsection = zz*( 35.45 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 42.53*G4Pow::GetInstance()->powA(sMand,-eta1) - 33.34*G4Pow::GetInstance()->powA(sMand,-eta2));
xsection += nn*( 35.80 + B*std::pow(std::log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
xsection += nn*( 35.80 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 40.15*G4Pow::GetInstance()->powA(sMand,-eta1) - 30.*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else if(theParticle == theAProton)
{
xsection = zz*( 35.45 + B*std::pow(std::log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) + 33.34*std::pow(sMand,-eta2));
xsection = zz*( 35.45 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 42.53*G4Pow::GetInstance()->powA(sMand,-eta1) + 33.34*G4Pow::GetInstance()->powA(sMand,-eta2));
xsection += nn*( 35.80 + B*std::pow(std::log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) + 30.*std::pow(sMand,-eta2));
xsection += nn*( 35.80 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 40.15*G4Pow::GetInstance()->powA(sMand,-eta1) + 30.*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else if(theParticle == thePiPlus)
{
xsection = aa*( 20.86 + B*std::pow(std::log(sMand/s0),2.)
+ 19.24*std::pow(sMand,-eta1) - 6.03*std::pow(sMand,-eta2));
xsection = aa*( 20.86 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 19.24*G4Pow::GetInstance()->powA(sMand,-eta1) - 6.03*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else if(theParticle == thePiMinus)
{
xsection = aa*( 20.86 + B*std::pow(std::log(sMand/s0),2.)
+ 19.24*std::pow(sMand,-eta1) + 6.03*std::pow(sMand,-eta2));
xsection = aa*( 20.86 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 19.24*G4Pow::GetInstance()->powA(sMand,-eta1) + 6.03*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else if(theParticle == theKPlus || theParticle == theK0L )
{
xsection = zz*( 17.91 + B*std::pow(std::log(sMand/s0),2.)
+ 7.14*std::pow(sMand,-eta1) - 13.45*std::pow(sMand,-eta2));
xsection = zz*( 17.91 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 7.14*G4Pow::GetInstance()->powA(sMand,-eta1) - 13.45*G4Pow::GetInstance()->powA(sMand,-eta2));
xsection += nn*( 17.87 + B*std::pow(std::log(sMand/s0),2.)
+ 5.17*std::pow(sMand,-eta1) - 7.23*std::pow(sMand,-eta2));
xsection += nn*( 17.87 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 5.17*G4Pow::GetInstance()->powA(sMand,-eta1) - 7.23*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else if(theParticle == theKMinus || theParticle == theK0S )
{
xsection = zz*( 17.91 + B*std::pow(std::log(sMand/s0),2.)
+ 7.14*std::pow(sMand,-eta1) + 13.45*std::pow(sMand,-eta2));
xsection = zz*( 17.91 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 7.14*G4Pow::GetInstance()->powA(sMand,-eta1) + 13.45*G4Pow::GetInstance()->powA(sMand,-eta2));
xsection += nn*( 17.87 + B*std::pow(std::log(sMand/s0),2.)
+ 5.17*std::pow(sMand,-eta1) + 7.23*std::pow(sMand,-eta2));
xsection += nn*( 17.87 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 5.17*G4Pow::GetInstance()->powA(sMand,-eta1) + 7.23*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else if(theParticle == theSMinus)
{
xsection = aa*( 35.20 + B*std::pow(std::log(sMand/s0),2.)
- 199.*std::pow(sMand,-eta1) + 264.*std::pow(sMand,-eta2));
xsection = aa*( 35.20 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
- 199.*G4Pow::GetInstance()->powA(sMand,-eta1) + 264.*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else if(theParticle == theGamma) // modify later on
{
xsection = aa*( 0.0 + B*std::pow(std::log(sMand/s0),2.)
+ 0.032*std::pow(sMand,-eta1) - 0.0*std::pow(sMand,-eta2));
xsection = aa*( 0.0 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 0.032*G4Pow::GetInstance()->powA(sMand,-eta1) - 0.0*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else // as proton ???
{
xsection = zz*( 35.45 + B*std::pow(std::log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
xsection = zz*( 35.45 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 42.53*G4Pow::GetInstance()->powA(sMand,-eta1) - 33.34*G4Pow::GetInstance()->powA(sMand,-eta2));
xsection += nn*( 35.80 + B*std::pow(std::log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
xsection += nn*( 35.80 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 40.15*G4Pow::GetInstance()->powA(sMand,-eta1) - 30.*G4Pow::GetInstance()->powA(sMand,-eta2));
}
xsection *= millibarn; // parametrised in mb
return xsection;
@@ -778,10 +815,10 @@ G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aP
if(proj_momentum >= 10.)
{
B0 = 7.5;
A0 = 100. - B0*std::log(3.0e7);
A0 = 100. - B0*G4Log(3.0e7);
xsection = A0 + B0*std::log(proj_energy) - 11
+ 103*std::pow(2*0.93827*proj_energy + proj_mass*proj_mass+
xsection = A0 + B0*G4Log(proj_energy) - 11
+ 103*G4Pow::GetInstance()->powA(2*0.93827*proj_energy + proj_mass*proj_mass+
0.93827*0.93827,-0.165); // mb
}
xsection *= zz + nn;
@@ -792,33 +829,33 @@ G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aP
if( proj_momentum < 0.73 )
{
hnXscv = 23 + 50*( std::pow( std::log(0.73/proj_momentum), 3.5 ) );
hnXscv = 23 + 50*( G4Pow::GetInstance()->powA( G4Log(0.73/proj_momentum), 3.5 ) );
}
else if( proj_momentum < 1.05 )
{
hnXscv = 23 + 40*(std::log(proj_momentum/0.73))*
(std::log(proj_momentum/0.73));
hnXscv = 23 + 40*(G4Log(proj_momentum/0.73))*
(G4Log(proj_momentum/0.73));
}
else // if( proj_momentum < 10. )
{
hnXscv = 39.0+
75*(proj_momentum - 1.2)/(std::pow(proj_momentum,3.0) + 0.15);
75*(proj_momentum - 1.2)/(G4Pow::GetInstance()->powA(proj_momentum,3.0) + 0.15);
}
// pn to be np
if( proj_momentum < 0.8 )
{
hpXscv = 33+30*std::pow(std::log(proj_momentum/1.3),4.0);
hpXscv = 33+30*G4Pow::GetInstance()->powA(G4Log(proj_momentum/1.3),4.0);
}
else if( proj_momentum < 1.4 )
{
hpXscv = 33+30*std::pow(std::log(proj_momentum/0.95),2.0);
hpXscv = 33+30*G4Pow::GetInstance()->powA(G4Log(proj_momentum/0.95),2.0);
}
else // if( proj_momentum < 10. )
{
hpXscv = 33.3+
20.8*(std::pow(proj_momentum,2.0)-1.35)/
(std::pow(proj_momentum,2.50)+0.95);
20.8*(G4Pow::GetInstance()->powA(proj_momentum,2.0)-1.35)/
(G4Pow::GetInstance()->powA(proj_momentum,2.50)+0.95);
}
xsection = hpXscv*zz + hnXscv*nn;
}
@@ -838,10 +875,10 @@ G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aP
if(proj_momentum >= 10.)
{
B0 = 7.5;
A0 = 100. - B0*std::log(3.0e7);
A0 = 100. - B0*G4Log(3.0e7);
xsection = A0 + B0*std::log(proj_energy) - 11
+ 103*std::pow(2*0.93827*proj_energy + proj_mass*proj_mass+
xsection = A0 + B0*G4Log(proj_energy) - 11
+ 103*G4Pow::GetInstance()->powA(2*0.93827*proj_energy + proj_mass*proj_mass+
0.93827*0.93827,-0.165); // mb
}
xsection *= zz + nn;
@@ -852,33 +889,33 @@ G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aP
if( proj_momentum < 0.73 )
{
hpXscv = 23 + 50*( std::pow( std::log(0.73/proj_momentum), 3.5 ) );
hpXscv = 23 + 50*( G4Pow::GetInstance()->powA( G4Log(0.73/proj_momentum), 3.5 ) );
}
else if( proj_momentum < 1.05 )
{
hpXscv = 23 + 40*(std::log(proj_momentum/0.73))*
(std::log(proj_momentum/0.73));
hpXscv = 23 + 40*(G4Log(proj_momentum/0.73))*
(G4Log(proj_momentum/0.73));
}
else // if( proj_momentum < 10. )
{
hpXscv = 39.0+
75*(proj_momentum - 1.2)/(std::pow(proj_momentum,3.0) + 0.15);
75*(proj_momentum - 1.2)/(G4Pow::GetInstance()->powA(proj_momentum,3.0) + 0.15);
}
// pn to be np
if( proj_momentum < 0.8 )
{
hnXscv = 33+30*std::pow(std::log(proj_momentum/1.3),4.0);
hnXscv = 33+30*G4Pow::GetInstance()->powA(G4Log(proj_momentum/1.3),4.0);
}
else if( proj_momentum < 1.4 )
{
hnXscv = 33+30*std::pow(std::log(proj_momentum/0.95),2.0);
hnXscv = 33+30*G4Pow::GetInstance()->powA(G4Log(proj_momentum/0.95),2.0);
}
else // if( proj_momentum < 10. )
{
hnXscv = 33.3+
20.8*(std::pow(proj_momentum,2.0)-1.35)/
(std::pow(proj_momentum,2.50)+0.95);
20.8*(G4Pow::GetInstance()->powA(proj_momentum,2.0)-1.35)/
(G4Pow::GetInstance()->powA(proj_momentum,2.50)+0.95);
}
xsection = hpXscv*zz + hnXscv*nn;
// xsection = hpXscv*(Zt + Nt);
@@ -888,13 +925,13 @@ G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aP
}
else if( theParticle == theAProton )
{
// xsection = Zt*( 35.45 + B*std::pow(std::log(sMand/s0),2.)
// + 42.53*std::pow(sMand,-eta1) + 33.34*std::pow(sMand,-eta2));
// xsection = Zt*( 35.45 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
// + 42.53*G4Pow::GetInstance()->powA(sMand,-eta1) + 33.34*G4Pow::GetInstance()->powA(sMand,-eta2));
// xsection += Nt*( 35.80 + B*std::pow(std::log(sMand/s0),2.)
// + 40.15*std::pow(sMand,-eta1) + 30.*std::pow(sMand,-eta2));
// xsection += Nt*( 35.80 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
// + 40.15*G4Pow::GetInstance()->powA(sMand,-eta1) + 30.*G4Pow::GetInstance()->powA(sMand,-eta2));
G4double logP = std::log(proj_momentum);
G4double logP = G4Log(proj_momentum);
if( proj_momentum <= 1.0 )
{
@@ -902,16 +939,16 @@ G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aP
}
else
{
xsection = zz*( 41.1 + 77.2*std::pow( proj_momentum, -0.68)
xsection = zz*( 41.1 + 77.2*G4Pow::GetInstance()->powA( proj_momentum, -0.68)
+ 0.293*logP*logP - 1.82*logP );
}
if ( nn > 0.)
{
xsection += nn*( 41.9 + 96.2*std::pow( proj_momentum, -0.99) - 0.154*logP);
xsection += nn*( 41.9 + 96.2*G4Pow::GetInstance()->powA( proj_momentum, -0.99) - 0.154*logP);
}
else // H
{
fInelasticXsc = 38.0 + 38.0*std::pow( proj_momentum, -0.96)
fInelasticXsc = 38.0 + 38.0*G4Pow::GetInstance()->powA( proj_momentum, -0.96)
- 0.169*logP*logP;
fInelasticXsc *= millibarn;
}
@@ -920,49 +957,49 @@ G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aP
{
if(proj_momentum < 0.4)
{
G4double Ex3 = 180*std::exp(-(proj_momentum-0.29)*(proj_momentum-0.29)/0.085/0.085);
G4double Ex3 = 180*G4Exp(-(proj_momentum-0.29)*(proj_momentum-0.29)/0.085/0.085);
hpXscv = Ex3+20.0;
}
else if( proj_momentum < 1.15 )
{
G4double Ex4 = 88*(std::log(proj_momentum/0.75))*(std::log(proj_momentum/0.75));
G4double Ex4 = 88*(G4Log(proj_momentum/0.75))*(G4Log(proj_momentum/0.75));
hpXscv = Ex4+14.0;
}
else if(proj_momentum < 3.5)
{
G4double Ex1 = 3.2*std::exp(-(proj_momentum-2.55)*(proj_momentum-2.55)/0.55/0.55);
G4double Ex2 = 12*std::exp(-(proj_momentum-1.47)*(proj_momentum-1.47)/0.225/0.225);
G4double Ex1 = 3.2*G4Exp(-(proj_momentum-2.55)*(proj_momentum-2.55)/0.55/0.55);
G4double Ex2 = 12*G4Exp(-(proj_momentum-1.47)*(proj_momentum-1.47)/0.225/0.225);
hpXscv = Ex1+Ex2+27.5;
}
else // if(proj_momentum > 3.5) // mb
{
hpXscv = 10.6+2.*std::log(proj_energy)+25*std::pow(proj_energy,-0.43);
hpXscv = 10.6+2.*G4Log(proj_energy)+25*G4Pow::GetInstance()->powA(proj_energy,-0.43);
}
// pi+n = pi-p??
if(proj_momentum < 0.37)
{
hnXscv = 28.0 + 40*std::exp(-(proj_momentum-0.29)*(proj_momentum-0.29)/0.07/0.07);
hnXscv = 28.0 + 40*G4Exp(-(proj_momentum-0.29)*(proj_momentum-0.29)/0.07/0.07);
}
else if(proj_momentum<0.65)
{
hnXscv = 26+110*(std::log(proj_momentum/0.48))*(std::log(proj_momentum/0.48));
hnXscv = 26+110*(G4Log(proj_momentum/0.48))*(G4Log(proj_momentum/0.48));
}
else if(proj_momentum<1.3)
{
hnXscv = 36.1+
10*std::exp(-(proj_momentum-0.72)*(proj_momentum-0.72)/0.06/0.06)+
24*std::exp(-(proj_momentum-1.015)*(proj_momentum-1.015)/0.075/0.075);
10*G4Exp(-(proj_momentum-0.72)*(proj_momentum-0.72)/0.06/0.06)+
24*G4Exp(-(proj_momentum-1.015)*(proj_momentum-1.015)/0.075/0.075);
}
else if(proj_momentum<3.0)
{
hnXscv = 36.1+0.079-4.313*std::log(proj_momentum)+
3*std::exp(-(proj_momentum-2.1)*(proj_momentum-2.1)/0.4/0.4)+
1.5*std::exp(-(proj_momentum-1.4)*(proj_momentum-1.4)/0.12/0.12);
hnXscv = 36.1+0.079-4.313*G4Log(proj_momentum)+
3*G4Exp(-(proj_momentum-2.1)*(proj_momentum-2.1)/0.4/0.4)+
1.5*G4Exp(-(proj_momentum-1.4)*(proj_momentum-1.4)/0.12/0.12);
}
else // mb
{
hnXscv = 10.6+2*std::log(proj_energy)+30*std::pow(proj_energy,-0.43);
hnXscv = 10.6+2*G4Log(proj_energy)+30*G4Pow::GetInstance()->powA(proj_energy,-0.43);
}
xsection = hpXscv*zz + hnXscv*nn;
}
@@ -972,91 +1009,92 @@ G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aP
if(proj_momentum < 0.4)
{
G4double Ex3 = 180*std::exp(-(proj_momentum-0.29)*(proj_momentum-0.29)/0.085/0.085);
G4double Ex3 = 180*G4Exp(-(proj_momentum-0.29)*(proj_momentum-0.29)/0.085/0.085);
hnXscv = Ex3+20.0;
}
else if(proj_momentum < 1.15)
{
G4double Ex4 = 88*(std::log(proj_momentum/0.75))*(std::log(proj_momentum/0.75));
G4double Ex4 = 88*(G4Log(proj_momentum/0.75))*(G4Log(proj_momentum/0.75));
hnXscv = Ex4+14.0;
}
else if(proj_momentum < 3.5)
{
G4double Ex1 = 3.2*std::exp(-(proj_momentum-2.55)*(proj_momentum-2.55)/0.55/0.55);
G4double Ex2 = 12*std::exp(-(proj_momentum-1.47)*(proj_momentum-1.47)/0.225/0.225);
G4double Ex1 = 3.2*G4Exp(-(proj_momentum-2.55)*(proj_momentum-2.55)/0.55/0.55);
G4double Ex2 = 12*G4Exp(-(proj_momentum-1.47)*(proj_momentum-1.47)/0.225/0.225);
hnXscv = Ex1+Ex2+27.5;
}
else // if(proj_momentum > 3.5) // mb
{
hnXscv = 10.6+2.*std::log(proj_energy)+25*std::pow(proj_energy,-0.43);
hnXscv = 10.6+2.*G4Log(proj_energy)+25*G4Pow::GetInstance()->powA(proj_energy,-0.43);
}
// pi-p
if(proj_momentum < 0.37)
{
hpXscv = 28.0 + 40*std::exp(-(proj_momentum-0.29)*(proj_momentum-0.29)/0.07/0.07);
hpXscv = 28.0 + 40*G4Exp(-(proj_momentum-0.29)*(proj_momentum-0.29)/0.07/0.07);
}
else if(proj_momentum<0.65)
{
hpXscv = 26+110*(std::log(proj_momentum/0.48))*(std::log(proj_momentum/0.48));
hpXscv = 26+110*(G4Log(proj_momentum/0.48))*(G4Log(proj_momentum/0.48));
}
else if(proj_momentum<1.3)
{
hpXscv = 36.1+
10*std::exp(-(proj_momentum-0.72)*(proj_momentum-0.72)/0.06/0.06)+
24*std::exp(-(proj_momentum-1.015)*(proj_momentum-1.015)/0.075/0.075);
10*G4Exp(-(proj_momentum-0.72)*(proj_momentum-0.72)/0.06/0.06)+
24*G4Exp(-(proj_momentum-1.015)*(proj_momentum-1.015)/0.075/0.075);
}
else if(proj_momentum<3.0)
{
hpXscv = 36.1+0.079-4.313*std::log(proj_momentum)+
3*std::exp(-(proj_momentum-2.1)*(proj_momentum-2.1)/0.4/0.4)+
1.5*std::exp(-(proj_momentum-1.4)*(proj_momentum-1.4)/0.12/0.12);
hpXscv = 36.1+0.079-4.313*G4Log(proj_momentum)+
3*G4Exp(-(proj_momentum-2.1)*(proj_momentum-2.1)/0.4/0.4)+
1.5*G4Exp(-(proj_momentum-1.4)*(proj_momentum-1.4)/0.12/0.12);
}
else // mb
{
hpXscv = 10.6+2*std::log(proj_energy)+30*std::pow(proj_energy,-0.43);
hpXscv = 10.6+2*G4Log(proj_energy)+30*G4Pow::GetInstance()->powA(proj_energy,-0.43);
}
xsection = hpXscv*zz + hnXscv*nn;
}
else if(theParticle == theKPlus)
{
xsection = zz*( 17.91 + B*std::pow(std::log(sMand/s0),2.)
+ 7.14*std::pow(sMand,-eta1) - 13.45*std::pow(sMand,-eta2));
xsection = zz*( 17.91 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 7.14*G4Pow::GetInstance()->powA(sMand,-eta1) - 13.45*G4Pow::GetInstance()->powA(sMand,-eta2));
xsection += nn*( 17.87 + B*std::pow(std::log(sMand/s0),2.)
+ 5.17*std::pow(sMand,-eta1) - 7.23*std::pow(sMand,-eta2));
xsection += nn*( 17.87 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 5.17*G4Pow::GetInstance()->powA(sMand,-eta1) - 7.23*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else if(theParticle == theKMinus)
{
xsection = zz*( 17.91 + B*std::pow(std::log(sMand/s0),2.)
+ 7.14*std::pow(sMand,-eta1) + 13.45*std::pow(sMand,-eta2));
xsection = zz*( 17.91 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 7.14*G4Pow::GetInstance()->powA(sMand,-eta1) + 13.45*G4Pow::GetInstance()->powA(sMand,-eta2));
xsection += nn*( 17.87 + B*std::pow(std::log(sMand/s0),2.)
+ 5.17*std::pow(sMand,-eta1) + 7.23*std::pow(sMand,-eta2));
xsection += nn*( 17.87 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 5.17*G4Pow::GetInstance()->powA(sMand,-eta1) + 7.23*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else if(theParticle == theSMinus)
{
xsection = aa*( 35.20 + B*std::pow(std::log(sMand/s0),2.)
- 199.*std::pow(sMand,-eta1) + 264.*std::pow(sMand,-eta2));
xsection = aa*( 35.20 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
- 199.*G4Pow::GetInstance()->powA(sMand,-eta1) + 264.*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else if(theParticle == theGamma) // modify later on
{
xsection = aa*( 0.0 + B*std::pow(std::log(sMand/s0),2.)
+ 0.032*std::pow(sMand,-eta1) - 0.0*std::pow(sMand,-eta2));
xsection = aa*( 0.0 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 0.032*G4Pow::GetInstance()->powA(sMand,-eta1) - 0.0*G4Pow::GetInstance()->powA(sMand,-eta2));
}
else // as proton ???
{
xsection = zz*( 35.45 + B*std::pow(std::log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
xsection = zz*( 35.45 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 42.53*G4Pow::GetInstance()->powA(sMand,-eta1) - 33.34*G4Pow::GetInstance()->powA(sMand,-eta2));
xsection += nn*( 35.80 + B*std::pow(std::log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
xsection += nn*( 35.80 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 40.15*G4Pow::GetInstance()->powA(sMand,-eta1) - 30.*G4Pow::GetInstance()->powA(sMand,-eta2));
}
xsection *= millibarn; // parametrised in mb
return xsection;
}
/*
G4double
G4ComponentGGHadronNucleusXsc::GetKaonNucleonXscVector(const G4DynamicParticle* aParticle,
G4int At, G4int Zt)
@@ -1071,7 +1109,7 @@ G4ComponentGGHadronNucleusXsc::GetKaonNucleonXscVector(const G4DynamicParticle*
if( Tkin > 70*GeV ) return GetHadronNucleonXscPDG(aParticle,At,Zt);
logTkin = std::log(Tkin); // Tkin in MeV!!!
logTkin = G4Log(Tkin); // Tkin in MeV!!!
if( theParticle == theKPlus )
{
@@ -1091,6 +1129,8 @@ G4ComponentGGHadronNucleusXsc::GetKaonNucleonXscVector(const G4DynamicParticle*
xsc = xscP*Zt + xscN*Nt;
return xsc;
}
*/
/////////////////////////////////////////////////////////////////////////////////////
//
// Returns hadron-nucleon inelastic cross-section based on proper parametrisation
@@ -1152,7 +1192,7 @@ G4ComponentGGHadronNucleusXsc::GetHNinelasticXscVU(const G4DynamicParticle* aPar
Elab /= GeV;
Plab /= GeV;
G4double LogPlab = std::log( Plab );
G4double LogPlab = G4Log( Plab );
G4double sqrLogPlab = LogPlab * LogPlab;
//G4cout<<"Plab = "<<Plab<<G4endl;
@@ -1167,16 +1207,16 @@ G4ComponentGGHadronNucleusXsc::GetHNinelasticXscVU(const G4DynamicParticle* aPar
if( absPDGcode > 1000 ) //------Projectile is baryon --------
{
G4double XtotPP = 48.0 + 0. *std::pow(Plab, 0. ) +
G4double XtotPP = 48.0 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.522*sqrLogPlab - 4.51*LogPlab;
G4double XtotPN = 47.3 + 0. *std::pow(Plab, 0. ) +
G4double XtotPN = 47.3 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.513*sqrLogPlab - 4.27*LogPlab;
G4double XelPP = 11.9 + 26.9*std::pow(Plab,-1.21) +
G4double XelPP = 11.9 + 26.9*G4Pow::GetInstance()->powA(Plab,-1.21) +
0.169*sqrLogPlab - 1.85*LogPlab;
G4double XelPN = 11.9 + 26.9*std::pow(Plab,-1.21) +
G4double XelPN = 11.9 + 26.9*G4Pow::GetInstance()->powA(Plab,-1.21) +
0.169*sqrLogPlab - 1.85*LogPlab;
Xtotal = (NumberOfTargetProtons * XtotPP +
@@ -1187,16 +1227,16 @@ G4ComponentGGHadronNucleusXsc::GetHNinelasticXscVU(const G4DynamicParticle* aPar
}
else if( PDGcode == 211 ) //------Projectile is PionPlus -------
{
G4double XtotPiP = 16.4 + 19.3 *std::pow(Plab,-0.42) +
G4double XtotPiP = 16.4 + 19.3 *G4Pow::GetInstance()->powA(Plab,-0.42) +
0.19 *sqrLogPlab - 0.0 *LogPlab;
G4double XtotPiN = 33.0 + 14.0 *std::pow(Plab,-1.36) +
G4double XtotPiN = 33.0 + 14.0 *G4Pow::GetInstance()->powA(Plab,-1.36) +
0.456*sqrLogPlab - 4.03*LogPlab;
G4double XelPiP = 0.0 + 11.4*std::pow(Plab,-0.40) +
G4double XelPiP = 0.0 + 11.4*G4Pow::GetInstance()->powA(Plab,-0.40) +
0.079*sqrLogPlab - 0.0 *LogPlab;
G4double XelPiN = 1.76 + 11.2*std::pow(Plab,-0.64) +
G4double XelPiN = 1.76 + 11.2*G4Pow::GetInstance()->powA(Plab,-0.64) +
0.043*sqrLogPlab - 0.0 *LogPlab;
Xtotal = ( NumberOfTargetProtons * XtotPiP +
@@ -1207,16 +1247,16 @@ G4ComponentGGHadronNucleusXsc::GetHNinelasticXscVU(const G4DynamicParticle* aPar
}
else if( PDGcode == -211 ) //------Projectile is PionMinus -------
{
G4double XtotPiP = 33.0 + 14.0 *std::pow(Plab,-1.36) +
G4double XtotPiP = 33.0 + 14.0 *G4Pow::GetInstance()->powA(Plab,-1.36) +
0.456*sqrLogPlab - 4.03*LogPlab;
G4double XtotPiN = 16.4 + 19.3 *std::pow(Plab,-0.42) +
G4double XtotPiN = 16.4 + 19.3 *G4Pow::GetInstance()->powA(Plab,-0.42) +
0.19 *sqrLogPlab - 0.0 *LogPlab;
G4double XelPiP = 1.76 + 11.2*std::pow(Plab,-0.64) +
G4double XelPiP = 1.76 + 11.2*G4Pow::GetInstance()->powA(Plab,-0.64) +
0.043*sqrLogPlab - 0.0 *LogPlab;
G4double XelPiN = 0.0 + 11.4*std::pow(Plab,-0.40) +
G4double XelPiN = 0.0 + 11.4*G4Pow::GetInstance()->powA(Plab,-0.40) +
0.079*sqrLogPlab - 0.0 *LogPlab;
Xtotal = ( NumberOfTargetProtons * XtotPiP +
@@ -1227,24 +1267,24 @@ G4ComponentGGHadronNucleusXsc::GetHNinelasticXscVU(const G4DynamicParticle* aPar
}
else if( PDGcode == 111 ) //------Projectile is PionZero -------
{
G4double XtotPiP =(16.4 + 19.3 *std::pow(Plab,-0.42) +
G4double XtotPiP =(16.4 + 19.3 *G4Pow::GetInstance()->powA(Plab,-0.42) +
0.19 *sqrLogPlab - 0.0 *LogPlab + //Pi+
33.0 + 14.0 *std::pow(Plab,-1.36) +
33.0 + 14.0 *G4Pow::GetInstance()->powA(Plab,-1.36) +
0.456*sqrLogPlab - 4.03*LogPlab)/2; //Pi-
G4double XtotPiN =(33.0 + 14.0 *std::pow(Plab,-1.36) +
G4double XtotPiN =(33.0 + 14.0 *G4Pow::GetInstance()->powA(Plab,-1.36) +
0.456*sqrLogPlab - 4.03*LogPlab + //Pi+
16.4 + 19.3 *std::pow(Plab,-0.42) +
16.4 + 19.3 *G4Pow::GetInstance()->powA(Plab,-0.42) +
0.19 *sqrLogPlab - 0.0 *LogPlab)/2; //Pi-
G4double XelPiP =( 0.0 + 11.4*std::pow(Plab,-0.40) +
G4double XelPiP =( 0.0 + 11.4*G4Pow::GetInstance()->powA(Plab,-0.40) +
0.079*sqrLogPlab - 0.0 *LogPlab + //Pi+
1.76 + 11.2*std::pow(Plab,-0.64) +
1.76 + 11.2*G4Pow::GetInstance()->powA(Plab,-0.64) +
0.043*sqrLogPlab - 0.0 *LogPlab)/2; //Pi-
G4double XelPiN =( 1.76 + 11.2*std::pow(Plab,-0.64) +
G4double XelPiN =( 1.76 + 11.2*G4Pow::GetInstance()->powA(Plab,-0.64) +
0.043*sqrLogPlab - 0.0 *LogPlab + //Pi+
0.0 + 11.4*std::pow(Plab,-0.40) +
0.0 + 11.4*G4Pow::GetInstance()->powA(Plab,-0.40) +
0.079*sqrLogPlab - 0.0 *LogPlab)/2; //Pi-
Xtotal = ( NumberOfTargetProtons * XtotPiP +
@@ -1255,15 +1295,15 @@ G4ComponentGGHadronNucleusXsc::GetHNinelasticXscVU(const G4DynamicParticle* aPar
}
else if( PDGcode == 321 ) //------Projectile is KaonPlus -------
{
G4double XtotKP = 18.1 + 0. *std::pow(Plab, 0. ) +
G4double XtotKP = 18.1 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.26 *sqrLogPlab - 1.0 *LogPlab;
G4double XtotKN = 18.7 + 0. *std::pow(Plab, 0. ) +
G4double XtotKN = 18.7 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.21 *sqrLogPlab - 0.89*LogPlab;
G4double XelKP = 5.0 + 8.1*std::pow(Plab,-1.8 ) +
G4double XelKP = 5.0 + 8.1*G4Pow::GetInstance()->powA(Plab,-1.8 ) +
0.16 *sqrLogPlab - 1.3 *LogPlab;
G4double XelKN = 7.3 + 0. *std::pow(Plab,-0. ) +
G4double XelKN = 7.3 + 0. *G4Pow::GetInstance()->powA(Plab,-0. ) +
0.29 *sqrLogPlab - 2.4 *LogPlab;
Xtotal = ( NumberOfTargetProtons * XtotKP +
@@ -1274,15 +1314,15 @@ G4ComponentGGHadronNucleusXsc::GetHNinelasticXscVU(const G4DynamicParticle* aPar
}
else if( PDGcode ==-321 ) //------Projectile is KaonMinus ------
{
G4double XtotKP = 32.1 + 0. *std::pow(Plab, 0. ) +
G4double XtotKP = 32.1 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.66 *sqrLogPlab - 5.6 *LogPlab;
G4double XtotKN = 25.2 + 0. *std::pow(Plab, 0. ) +
G4double XtotKN = 25.2 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.38 *sqrLogPlab - 2.9 *LogPlab;
G4double XelKP = 7.3 + 0. *std::pow(Plab,-0. ) +
G4double XelKP = 7.3 + 0. *G4Pow::GetInstance()->powA(Plab,-0. ) +
0.29 *sqrLogPlab - 2.4 *LogPlab;
G4double XelKN = 5.0 + 8.1*std::pow(Plab,-1.8 ) +
G4double XelKN = 5.0 + 8.1*G4Pow::GetInstance()->powA(Plab,-1.8 ) +
0.16 *sqrLogPlab - 1.3 *LogPlab;
Xtotal = ( NumberOfTargetProtons * XtotKP +
@@ -1293,24 +1333,24 @@ G4ComponentGGHadronNucleusXsc::GetHNinelasticXscVU(const G4DynamicParticle* aPar
}
else if( PDGcode == 311 ) //------Projectile is KaonZero ------
{
G4double XtotKP = ( 18.1 + 0. *std::pow(Plab, 0. ) +
G4double XtotKP = ( 18.1 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.26 *sqrLogPlab - 1.0 *LogPlab + //K+
32.1 + 0. *std::pow(Plab, 0. ) +
32.1 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.66 *sqrLogPlab - 5.6 *LogPlab)/2; //K-
G4double XtotKN = ( 18.7 + 0. *std::pow(Plab, 0. ) +
G4double XtotKN = ( 18.7 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.21 *sqrLogPlab - 0.89*LogPlab + //K+
25.2 + 0. *std::pow(Plab, 0. ) +
25.2 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.38 *sqrLogPlab - 2.9 *LogPlab)/2; //K-
G4double XelKP = ( 5.0 + 8.1*std::pow(Plab,-1.8 )
G4double XelKP = ( 5.0 + 8.1*G4Pow::GetInstance()->powA(Plab,-1.8 )
+ 0.16 *sqrLogPlab - 1.3 *LogPlab + //K+
7.3 + 0. *std::pow(Plab,-0. ) +
7.3 + 0. *G4Pow::GetInstance()->powA(Plab,-0. ) +
0.29 *sqrLogPlab - 2.4 *LogPlab)/2; //K-
G4double XelKN = ( 7.3 + 0. *std::pow(Plab,-0. ) +
G4double XelKN = ( 7.3 + 0. *G4Pow::GetInstance()->powA(Plab,-0. ) +
0.29 *sqrLogPlab - 2.4 *LogPlab + //K+
5.0 + 8.1*std::pow(Plab,-1.8 ) +
5.0 + 8.1*G4Pow::GetInstance()->powA(Plab,-1.8 ) +
0.16 *sqrLogPlab - 1.3 *LogPlab)/2; //K-
Xtotal = ( NumberOfTargetProtons * XtotKP +
@@ -1321,15 +1361,15 @@ G4ComponentGGHadronNucleusXsc::GetHNinelasticXscVU(const G4DynamicParticle* aPar
}
else //------Projectile is undefined, Nucleon assumed
{
G4double XtotPP = 48.0 + 0. *std::pow(Plab, 0. ) +
G4double XtotPP = 48.0 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.522*sqrLogPlab - 4.51*LogPlab;
G4double XtotPN = 47.3 + 0. *std::pow(Plab, 0. ) +
G4double XtotPN = 47.3 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.513*sqrLogPlab - 4.27*LogPlab;
G4double XelPP = 11.9 + 26.9*std::pow(Plab,-1.21) +
G4double XelPP = 11.9 + 26.9*G4Pow::GetInstance()->powA(Plab,-1.21) +
0.169*sqrLogPlab - 1.85*LogPlab;
G4double XelPN = 11.9 + 26.9*std::pow(Plab,-1.21) +
G4double XelPN = 11.9 + 26.9*G4Pow::GetInstance()->powA(Plab,-1.21) +
0.169*sqrLogPlab - 1.85*LogPlab;
Xtotal = ( NumberOfTargetProtons * XtotPP +
@@ -1355,17 +1395,17 @@ G4ComponentGGHadronNucleusXsc::GetNucleusRadius(const G4DynamicParticle* ,
{
G4int At = G4lrint(anElement->GetN());
G4double oneThird = 1.0/3.0;
G4double cubicrAt = std::pow(G4double(At), oneThird);
G4double cubicrAt = G4Pow::GetInstance()->powA(G4double(At), oneThird);
G4double R; // = fRadiusConst*cubicrAt;
/*
G4double tmp = std::pow( cubicrAt-1., 3.);
G4double tmp = G4Pow::GetInstance()->powA( cubicrAt-1., 3.);
tmp += At;
tmp *= 0.5;
if (At > 20.) // 20.
{
R = fRadiusConst*std::pow (tmp, oneThird);
R = fRadiusConst*G4Pow::GetInstance()->powA (tmp, oneThird);
}
else
{
@@ -1389,15 +1429,15 @@ G4ComponentGGHadronNucleusXsc::GetNucleusRadius(const G4DynamicParticle* ,
if (At > 20) // 20.
{
R *= ( a1 + b1*std::exp( -(At - meanA)/tauA1) );
R *= ( a1 + b1*G4Exp( -(At - meanA)/tauA1) );
}
else if (At > 3)
{
R *= ( 1.0 + b2*( 1. - std::exp( (At - meanA)/tauA2) ) );
R *= ( 1.0 + b2*( 1. - G4Exp( (At - meanA)/tauA2) ) );
}
else
{
R *= ( 1.0 + b3*( 1. - std::exp( (At - meanA)/tauA3) ) );
R *= ( 1.0 + b3*( 1. - G4Exp( (At - meanA)/tauA3) ) );
}
return R;
@@ -1410,18 +1450,18 @@ G4double
G4ComponentGGHadronNucleusXsc::GetNucleusRadius(G4int At)
{
G4double oneThird = 1.0/3.0;
G4double cubicrAt = std::pow(G4double(At), oneThird);
G4double cubicrAt = G4Pow::GetInstance()->powA(G4double(At), oneThird);
G4double R; // = fRadiusConst*cubicrAt;
/*
G4double tmp = std::pow( cubicrAt-1., 3.);
G4double tmp = G4Pow::GetInstance()->powA( cubicrAt-1., 3.);
tmp += At;
tmp *= 0.5;
if (At > 20.)
{
R = fRadiusConst*std::pow (tmp, oneThird);
R = fRadiusConst*G4Pow::GetInstance()->powA (tmp, oneThird);
}
else
{
@@ -1436,11 +1476,11 @@ G4ComponentGGHadronNucleusXsc::GetNucleusRadius(G4int At)
if (At > 20) // 20.
{
R *= ( 0.8 + 0.2*std::exp( -(G4double(At) - meanA)/tauA) );
R *= ( 0.8 + 0.2*G4Exp( -(G4double(At) - meanA)/tauA) );
}
else
{
R *= ( 1.0 + 0.1*( 1. - std::exp( (G4double(At) - meanA)/tauA) ) );
R *= ( 1.0 + 0.1*( 1. - G4Exp( (G4double(At) - meanA)/tauA) ) );
}
return R;
@@ -249,11 +249,11 @@ GetZandACrossSection(const G4DynamicParticle* aParticle,
nucleusSquare = cofTotal*pi*( pR*pR + tR*tR ); // basically 2piRR
ratio = sigma/nucleusSquare;
xsection = nucleusSquare*std::log( 1. + ratio );
xsection = nucleusSquare*G4Log( 1. + ratio );
fTotalXsc = xsection;
fTotalXsc *= cB;
fInelasticXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fInelasticXsc = nucleusSquare*G4Log( 1. + cofInelastic*ratio )/cofInelastic;
fInelasticXsc *= cB;
fElasticXsc = fTotalXsc - fInelasticXsc;
@@ -262,7 +262,7 @@ GetZandACrossSection(const G4DynamicParticle* aParticle,
/*
G4double difratio = ratio/(1.+ratio);
fDiffractionXsc = 0.5*nucleusSquare*( difratio - std::log( 1. + difratio ) );
fDiffractionXsc = 0.5*nucleusSquare*( difratio - G4Log( 1. + difratio ) );
*/
// production to be checked !!! edit MK xsc
@@ -272,7 +272,7 @@ GetZandACrossSection(const G4DynamicParticle* aParticle,
sigma = (pZ*tZ+pN*tN)*ppInXsc + (pZ*tN+pN*tZ)*npInXsc;
ratio = sigma/nucleusSquare;
fProductionXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fProductionXsc = nucleusSquare*G4Log( 1. + cofInelastic*ratio )/cofInelastic;
if (fElasticXsc < 0.) fElasticXsc = 0.;
}
@@ -355,10 +355,10 @@ GetRatioSD(const G4DynamicParticle* aParticle, G4double tA, G4double tZ)
nucleusSquare = cofTotal*pi*( pR*pR + tR*tR ); // basically 2piRR
ratio = sigma/nucleusSquare;
fInelasticXsc = nucleusSquare*std::log(1. + cofInelastic*ratio)/cofInelastic;
fInelasticXsc = nucleusSquare*G4Log(1. + cofInelastic*ratio)/cofInelastic;
G4double difratio = ratio/(1.+ratio);
fDiffractionXsc = 0.5*nucleusSquare*( difratio - std::log( 1. + difratio ) );
fDiffractionXsc = 0.5*nucleusSquare*( difratio - G4Log( 1. + difratio ) );
if (fInelasticXsc > 0.) ratio = fDiffractionXsc/fInelasticXsc;
else ratio = 0.;
@@ -395,11 +395,11 @@ GetRatioQE(const G4DynamicParticle* aParticle, G4double tA, G4double tZ)
nucleusSquare = cofTotal*pi*( pR*pR + tR*tR ); // basically 2piRR
ratio = sigma/nucleusSquare;
fInelasticXsc = nucleusSquare*std::log(1. + cofInelastic*ratio)/cofInelastic;
fInelasticXsc = nucleusSquare*G4Log(1. + cofInelastic*ratio)/cofInelastic;
// sigma = GetHNinelasticXsc(aParticle, tA, tZ);
ratio = sigma/nucleusSquare;
fProductionXsc = nucleusSquare*std::log(1. + cofInelastic*ratio)/cofInelastic;
fProductionXsc = nucleusSquare*G4Log(1. + cofInelastic*ratio)/cofInelastic;
if (fInelasticXsc > fProductionXsc) ratio = (fInelasticXsc-fProductionXsc)/fInelasticXsc;
else ratio = 0.;
@@ -454,11 +454,11 @@ G4ComponentGGNuclNuclXsc::GetHadronNucleonXsc(const G4DynamicParticle* aParticle
if(pParticle == theNeutron) // as proton ???
{
xsection = G4double(At)*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
xsection = G4double(At)*(21.70*G4Pow::GetInstance()->powA(sMand,0.0808) + 56.08*G4Pow::GetInstance()->powA(sMand,-0.4525));
}
else if(pParticle == theProton)
{
xsection = G4double(At)*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
xsection = G4double(At)*(21.70*G4Pow::GetInstance()->powA(sMand,0.0808) + 56.08*G4Pow::GetInstance()->powA(sMand,-0.4525));
}
xsection *= millibarn;
@@ -496,27 +496,27 @@ G4ComponentGGNuclNuclXsc::GetHadronNucleonXscPDG(const G4ParticleDefinition* pPa
{
if ( proton )
{
xsection = ( 35.80 + B*std::pow(std::log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
xsection = ( 35.80 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 40.15*G4Pow::GetInstance()->powA(sMand,-eta1) - 30.*G4Pow::GetInstance()->powA(sMand,-eta2));
}
if ( neutron )
{
xsection = (35.45 + B*std::pow(std::log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2)); // pp for nn
xsection = (35.45 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 42.53*G4Pow::GetInstance()->powA(sMand,-eta1) - 33.34*G4Pow::GetInstance()->powA(sMand,-eta2)); // pp for nn
}
}
else if(pParticle == theProton)
{
if ( proton )
{
xsection = (35.45 + B*std::pow(std::log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
xsection = (35.45 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 42.53*G4Pow::GetInstance()->powA(sMand,-eta1) - 33.34*G4Pow::GetInstance()->powA(sMand,-eta2));
}
if ( neutron )
{
xsection = (35.80 + B*std::pow(std::log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
xsection = (35.80 + B*G4Pow::GetInstance()->powA(G4Log(sMand/s0),2.)
+ 40.15*G4Pow::GetInstance()->powA(sMand,-eta1) - 30.*G4Pow::GetInstance()->powA(sMand,-eta2));
}
}
xsection *= millibarn; // parametrised in mb
@@ -573,10 +573,10 @@ G4ComponentGGNuclNuclXsc::GetHadronNucleonXscNS(const G4ParticleDefinition* pPar
if (proj_momentum >= 10.) {
B0 = 7.5;
A0 = 100. - B0*std::log(3.0e7);
A0 = 100. - B0*G4Log(3.0e7);
xsection = A0 + B0*std::log(proj_energy) - 11
+ 103*std::pow(2*0.93827*proj_energy + proj_mass*proj_mass+
xsection = A0 + B0*G4Log(proj_energy) - 11
+ 103*G4Pow::GetInstance()->powA(2*0.93827*proj_energy + proj_mass*proj_mass+
0.93827*0.93827,-0.165); // mb
}
}
@@ -586,17 +586,17 @@ G4ComponentGGNuclNuclXsc::GetHadronNucleonXscNS(const G4ParticleDefinition* pPar
{
if( proj_momentum < 0.73 )
{
hnXscv = 23 + 50*( std::pow( std::log(0.73/proj_momentum), 3.5 ) );
hnXscv = 23 + 50*( G4Pow::GetInstance()->powA( G4Log(0.73/proj_momentum), 3.5 ) );
}
else if( proj_momentum < 1.05 )
{
hnXscv = 23 + 40*(std::log(proj_momentum/0.73))*
(std::log(proj_momentum/0.73));
hnXscv = 23 + 40*(G4Log(proj_momentum/0.73))*
(G4Log(proj_momentum/0.73));
}
else // if( proj_momentum < 10. )
{
hnXscv = 39.0 +
75*(proj_momentum - 1.2)/(std::pow(proj_momentum,3.0) + 0.15);
75*(proj_momentum - 1.2)/(G4Pow::GetInstance()->powA(proj_momentum,3.0) + 0.15);
}
xsection = hnXscv;
}
@@ -604,17 +604,17 @@ G4ComponentGGNuclNuclXsc::GetHadronNucleonXscNS(const G4ParticleDefinition* pPar
{
if( proj_momentum < 0.8 )
{
hpXscv = 33+30*std::pow(std::log(proj_momentum/1.3),4.0);
hpXscv = 33+30*G4Pow::GetInstance()->powA(G4Log(proj_momentum/1.3),4.0);
}
else if( proj_momentum < 1.4 )
{
hpXscv = 33+30*std::pow(std::log(proj_momentum/0.95),2.0);
hpXscv = 33+30*G4Pow::GetInstance()->powA(G4Log(proj_momentum/0.95),2.0);
}
else // if( proj_momentum < 10. )
{
hpXscv = 33.3+
20.8*(std::pow(proj_momentum,2.0)-1.35)/
(std::pow(proj_momentum,2.50)+0.95);
20.8*(G4Pow::GetInstance()->powA(proj_momentum,2.0)-1.35)/
(G4Pow::GetInstance()->powA(proj_momentum,2.50)+0.95);
}
xsection = hpXscv;
}
@@ -641,7 +641,7 @@ G4ComponentGGNuclNuclXsc::GetHNinelasticXscVU(const G4DynamicParticle* aParticle
Elab /= GeV;
Plab /= GeV;
G4double LogPlab = std::log( Plab );
G4double LogPlab = G4Log( Plab );
G4double sqrLogPlab = LogPlab * LogPlab;
//G4cout<<"Plab = "<<Plab<<G4endl;
@@ -656,16 +656,16 @@ G4ComponentGGNuclNuclXsc::GetHNinelasticXscVU(const G4DynamicParticle* aParticle
if( absPDGcode > 1000 ) //------Projectile is baryon --------
{
G4double XtotPP = 48.0 + 0. *std::pow(Plab, 0. ) +
G4double XtotPP = 48.0 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.522*sqrLogPlab - 4.51*LogPlab;
G4double XtotPN = 47.3 + 0. *std::pow(Plab, 0. ) +
G4double XtotPN = 47.3 + 0. *G4Pow::GetInstance()->powA(Plab, 0. ) +
0.513*sqrLogPlab - 4.27*LogPlab;
G4double XelPP = 11.9 + 26.9*std::pow(Plab,-1.21) +
G4double XelPP = 11.9 + 26.9*G4Pow::GetInstance()->powA(Plab,-1.21) +
0.169*sqrLogPlab - 1.85*LogPlab;
G4double XelPN = 11.9 + 26.9*std::pow(Plab,-1.21) +
G4double XelPN = 11.9 + 26.9*G4Pow::GetInstance()->powA(Plab,-1.21) +
0.169*sqrLogPlab - 1.85*LogPlab;
Xtotal = ( NumberOfTargetProtons * XtotPP +
@@ -691,7 +691,7 @@ G4ComponentGGNuclNuclXsc::GetNucleusRadius(const G4DynamicParticle* ,
{
G4double At = anElement->GetN();
G4double oneThird = 1.0/3.0;
G4double cubicrAt = std::pow (At, oneThird);
G4double cubicrAt = G4Pow::GetInstance()->powA (At, oneThird);
G4double R; // = fRadiusConst*cubicrAt;
R = fRadiusConst*cubicrAt;
@@ -709,15 +709,15 @@ G4ComponentGGNuclNuclXsc::GetNucleusRadius(const G4DynamicParticle* ,
if (At > 20.) // 20.
{
R *= ( a1 + b1*std::exp( -(At - meanA)/tauA1) );
R *= ( a1 + b1*G4Exp( -(At - meanA)/tauA1) );
}
else if (At > 3.5)
{
R *= ( 1.0 + b2*( 1. - std::exp( (At - meanA)/tauA2) ) );
R *= ( 1.0 + b2*( 1. - G4Exp( (At - meanA)/tauA2) ) );
}
else
{
R *= ( 1.0 + b3*( 1. - std::exp( (At - meanA)/tauA3) ) );
R *= ( 1.0 + b3*( 1. - G4Exp( (At - meanA)/tauA3) ) );
}
return R;
@@ -743,7 +743,7 @@ G4double
G4ComponentGGNuclNuclXsc::GetNucleusRadiusGG(G4double At)
{
G4double oneThird = 1.0/3.0;
G4double cubicrAt = std::pow (At, oneThird);
G4double cubicrAt = G4Pow::GetInstance()->powA (At, oneThird);
G4double R; // = fRadiusConst*cubicrAt;
R = fRadiusConst*cubicrAt;
@@ -753,11 +753,11 @@ G4ComponentGGNuclNuclXsc::GetNucleusRadiusGG(G4double At)
if ( At > 20.) // 20.
{
R *= ( 0.8 + 0.2*std::exp( -(At - meanA)/tauA) );
R *= ( 0.8 + 0.2*G4Exp( -(At - meanA)/tauA) );
}
else
{
R *= ( 1.0 + 0.1*( 1. - std::exp( (At - meanA)/tauA) ) );
R *= ( 1.0 + 0.1*( 1. - G4Exp( (At - meanA)/tauA) ) );
}
return R;
@@ -794,18 +794,18 @@ G4ComponentGGNuclNuclXsc::GetNucleusRadiusDE(G4double Z, G4double A)
else if(std::abs(Z-3.) < 0.5) return 2.40*fermi; // Li7
else if(std::abs(Z-4.) < 0.5) return 2.51*fermi; // Be9
else if( 10. < A && A <= 16. ) r0 = a11*( 1 - std::pow(A, -2./3.) )*fermi; // 1.08*fermi;
else if( 15. < A && A <= 20. ) r0 = a12*( 1 - std::pow(A, -2./3.) )*fermi;
else if( 20. < A && A <= 30. ) r0 = a13*( 1 - std::pow(A, -2./3.) )*fermi;
else if( 10. < A && A <= 16. ) r0 = a11*( 1 - G4Pow::GetInstance()->powA(A, -2./3.) )*fermi; // 1.08*fermi;
else if( 15. < A && A <= 20. ) r0 = a12*( 1 - G4Pow::GetInstance()->powA(A, -2./3.) )*fermi;
else if( 20. < A && A <= 30. ) r0 = a13*( 1 - G4Pow::GetInstance()->powA(A, -2./3.) )*fermi;
else r0 = a2*fermi;
R = r0*std::pow( A, 1./3. );
R = r0*G4Pow::GetInstance()->powA( A, 1./3. );
}
else
{
r0 = a3*fermi;
R = r0*std::pow(A, 0.27);
R = r0*G4Pow::GetInstance()->powA(A, 0.27);
}
return R;
}
@@ -829,7 +829,7 @@ G4ComponentGGNuclNuclXsc::GetNucleusRadiusRMS(G4double Z, G4double A)
else if(std::abs(Z-3.) < 0.5) return 2.40*fermi; // Li7
else if(std::abs(Z-4.) < 0.5) return 2.51*fermi; // Be9
else return 1.24*std::pow(A, 0.28 )*fermi; // A > 9
else return 1.24*G4Pow::GetInstance()->powA(A, 0.28 )*fermi; // A > 9
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4CrossSectionDataSetRegistry.cc 83697 2014-09-10 07:15:29Z gcosmo $
// $Id: G4CrossSectionDataSetRegistry.cc 93904 2015-11-03 10:16:36Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -66,8 +66,6 @@ G4_REFERENCE_XS_FACTORY(G4ChipsPionMinusElasticXS);
G4_REFERENCE_XS_FACTORY(G4ChipsAntiBaryonInelasticXS);
G4_REFERENCE_XS_FACTORY(G4ChipsAntiBaryonElasticXS);
G4_REFERENCE_XS_FACTORY(G4NucleonNuclearCrossSection);
G4_REFERENCE_XS_FACTORY(G4GlauberGribovCrossSection);
G4_REFERENCE_XS_FACTORY(G4GGNuclNuclCrossSection);
G4_REFERENCE_XS_FACTORY(G4ElectroNuclearCrossSection);
G4_REFERENCE_XS_FACTORY(G4PhotoNuclearCrossSection);
G4_REFERENCE_XS_FACTORY(G4PiNuclearCrossSection);
@@ -76,15 +74,15 @@ G4_REFERENCE_XS_FACTORY(G4NeutronElasticXS);
G4_REFERENCE_XS_FACTORY(G4NeutronCaptureXS);
G4ThreadLocal G4CrossSectionDataSetRegistry* G4CrossSectionDataSetRegistry::theInstance = 0;
G4ThreadLocal G4CrossSectionDataSetRegistry* G4CrossSectionDataSetRegistry::instance = 0;
G4CrossSectionDataSetRegistry* G4CrossSectionDataSetRegistry::Instance()
{
if(0 == theInstance) {
static G4ThreadLocal G4CrossSectionDataSetRegistry *manager_G4MT_TLS_ = 0 ; if (!manager_G4MT_TLS_) manager_G4MT_TLS_ = new G4CrossSectionDataSetRegistry ; G4CrossSectionDataSetRegistry &manager = *manager_G4MT_TLS_;
theInstance = &manager;
if(0 == instance) {
static G4ThreadLocalSingleton<G4CrossSectionDataSetRegistry> inst;
instance = inst.Instance();
}
return theInstance;
return instance;
}
G4CrossSectionDataSetRegistry::G4CrossSectionDataSetRegistry()
@@ -98,27 +96,32 @@ G4CrossSectionDataSetRegistry::~G4CrossSectionDataSetRegistry()
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;
for (size_t i=0; i<n; ++i) {
if(xSections[i]) {
const char* xxx = (xSections[i]->GetName()).c_str();
G4int len = (xSections[i]->GetName()).length();
len = std::min(len, 9);
const G4String xname = G4String(xxx, len);
//std::cout << "G4CrossSectionDataSetRegistry::Clean " << xname
// << " " << xSections[i] << " " << this << std::endl;
if( (xname != "NeutronHP") && (xname != "ParticleH") ) {
delete xSections[i];
}
//std::cout << " done" << " " << this << std::endl;
}
xSections.clear();
}
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; }
}
for (size_t i=0; i<n; ++i) {
if(xSections[i] == p) { return; }
}
//G4cout << "Register x-section: " << p->GetName() << " " << p
// << " " << this << G4endl;
xSections.push_back(p);
}
@@ -126,12 +129,10 @@ 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;
return;
}
for (size_t i=0; i<n; ++i) {
if(xSections[i] == p) {
xSections[i] = 0;
return;
}
}
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CrossSectionDataStore.cc 78442 2013-12-18 15:04:33Z gcosmo $
// $Id: G4CrossSectionDataStore.cc 94008 2015-11-05 10:06:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -55,12 +55,14 @@
#include "G4Element.hh"
#include "G4Material.hh"
#include "G4NistManager.hh"
#include <iostream>
#include <algorithm>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
G4CrossSectionDataStore::G4CrossSectionDataStore() :
nDataSetList(0), verboseLevel(0)
nDataSetList(0), verboseLevel(0),fastPathFlags(),fastPathParams(),
counters(),fastPathCache()
{
nist = G4NistManager::Instance();
currentMaterial = elmMaterial = 0;
@@ -74,36 +76,198 @@ G4CrossSectionDataStore::G4CrossSectionDataStore() :
G4CrossSectionDataStore::~G4CrossSectionDataStore()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
G4double
G4CrossSectionDataStore::GetCrossSection(const G4DynamicParticle* part,
const G4Material* mat)
const G4Material* mat , G4bool requiresSlowPath)
{
//The fast-path algorithm
// requiresSlowPath == true => Use slow path independently of other conditions
//A. Dotti: modifications to this algorithm following the studies of P. Ruth and R. Fowler
// on speeding up the cross-sections calculations. Their algorithm is called in the
// following "fast-path" while the normal approach to calcualte cross-section is
// referred to as "slow-path".
//Some details on the fast-path algorithm:
//The idea is to use a cached approximation of the material cross-section.
//Starting points:
//1- We need the material cross-section for navigation purposes: e.g. to calculate the PIL.
//2- If this interaction occurs at the end of a step we need to select the G4Element on which
// nucleus the interaction is actually happening. This is done calculating the element cross-section
// throwing a random number and selecting the appropriate nucleus (see SampleZandA function)
//3- To calculate the material cross section needed for 1- we use the G4Element cross sections.
// Since the material cross-section is simply the weighted sum of the element cross-sections.
//4- The slow path algorithm here accomplishes two use cases (not very good design IMHO): it
// calculates the material cross-section and it updates the xsecelem array that contains the
// relative cross-sections used by SampleZandA to select the element on which the interaction
// occurs.
//The idea of the fast-path algorithm is to replace the request for 1- with a faster calculation
//of the material cross-section from an approximation contained in cache.
//There two complications to take into account:
//A- If I use a fast parametrization for material cross-section, I still need to do the full
// calculations if an interaction occurs, because I need to calculate the element cross-sections.
// Since the function that updates xsecelem is the same (this one) I need to be sure that
// if I call this method for SampleAandZ the xsecelem is updated.
//B- It exists the possibility to be even fast the the fast-path algorithm: this happens when
// to select the element of the interaction via SampleZandI I call again this method exactly
// with the same conditions as when I called this method to calculate the material cross-section.
// In such a case xsecelem is updated and we do not need to do much more. This happens when
// for example a neutron undergoes an interaction at the end of the step.
//Dealing with B- complicates a bit the algorithm.
//In summary:
// If no fast-path algo is available (or user does not want that), go with the old plain algorithm
// If a fast-path algo is avilable, use it whenever possible.
//
// In general we expect user to selectively decide for which processes, materials and particle combinations
// we want to use the fast-path. If this is activated we also expect that the cross-section fast-path
// cache is created during the run initialization via calls to this method.
//
//fastPathFlags contains control flags for the fast-path algorithm:
// .prevCalcUsedFastPath == true => Previous call to GetCrossSection used the fast-path
// it is used in the decision to assess if xsecelem is
// correctly set-up
// .useFastPathIfAvailable == true => User requested the use of fast-path algorithm
// .initializationPhase == true => If true we are in Geant4 Init phase before the event-loop
//Check user-request, does he want fast-path? if not
// OR
// we want fast-path and we are in initialization phase?
if ( !fastPathFlags.useFastPathIfAvailable
|| (fastPathFlags.useFastPathIfAvailable&&fastPathFlags.initializationPhase) ) {
//Traditional algorithm is requested
requiresSlowPath=true;
}
//Logging for performance calculations and counter, active only in FPDEBUG mode
counters.MethodCalled();
//Measure number of cycles
G4FastPathHadronicCrossSection::logStartCountCycles(timing);
//This is the cache entry of the fast-path cross-section parametrization
G4FastPathHadronicCrossSection::cycleCountEntry* entry = nullptr;
//Did user request fast-path in first place and are we not in the initialization phase
if ( fastPathFlags.useFastPathIfAvailable && !fastPathFlags.initializationPhase ) {
//Important: if it is in initialization phase we should NOT use fast path: we are going to build it
//G4FastPathHadronicCrossSection::G4CrossSectionDataStore_Key searchkey = {part->GetParticleDefinition(),mat};
entry = fastPathCache[{part->GetParticleDefinition(),mat}];
}
//Super-fast-path: are we calling again this method for exactly the same conditions
//of the triplet {particle,material,energy}?
if(mat == currentMaterial && part->GetDefinition() == matParticle
&& part->GetKineticEnergy() == matKinEnergy)
{ return matCrossSection; }
{
G4FastPathHadronicCrossSection::logInvocationTriedOneLine(entry);
//If there is no user-request for the fast-path in first place?
//It means we built the xsecelem for sure, let's return immediately
if ( !fastPathFlags.useFastPathIfAvailable ) {
return matCrossSection;
} else {
//Check that the last time we called this method we used the slow
//path: we need the data-member xsecelem to be setup correctly for the current
//interaction. This is ensured only if: we will do the slow path right now or we
//did it exactly for the same conditions of the last call.
if ( !fastPathFlags.prevCalcUsedFastPath && ! requiresSlowPath ) {
counters.HitOneLine();
G4FastPathHadronicCrossSection::logInvocationOneLine(entry);
//Good everything is setup correctly, exit!
return matCrossSection;
} else {
//We need to follow the slow-path because
//xsecelem is not calculated correctly
requiresSlowPath = true;
}
}
}
//Ok, now check if we have cached for this {particle,material,energy} the cross-section
//in this case let's return immediately, if we are not forced to take the slow path
//(e.g. as before if the xsecelem is not up-to-date we need to take the slow-path).
//Note that this is not equivalent to the previous ultra-fast check: we now have a map here
//So we can have for example a different particle.
if ( entry != nullptr && entry->energy == part->GetKineticEnergy() ) {
G4FastPathHadronicCrossSection::logHit(entry);
if ( !requiresSlowPath ) {
return entry->crossSection;
}
}
currentMaterial = mat;
matParticle = part->GetDefinition();
matKinEnergy = part->GetKineticEnergy();
matCrossSection = 0;
G4int nElements = mat->GetNumberOfElements();
const G4double* nAtomsPerVolume = mat->GetVecNbOfAtomsPerVolume();
if(G4int(xsecelm.size()) < nElements) { xsecelm.resize(nElements); }
for(G4int i=0; i<nElements; ++i) {
matCrossSection += nAtomsPerVolume[i] *
GetCrossSection(part, (*mat->GetElementVector())[i], mat);
xsecelm[i] = matCrossSection;
//Now check if the cache entry has a fast-path cross-section calculation available
G4FastPathHadronicCrossSection::fastPathEntry* fast_entry = nullptr;
if ( entry != nullptr && ! requiresSlowPath ) {
fast_entry = entry->fastPath;
assert(fast_entry!=nullptr && !fastPathFlags.initializationPhase);
}
//Each fast-path cross-section has a minimum value of validity, if energy is below
//that skip fast-path algorithm
if ( fast_entry != nullptr && part->GetKineticEnergy() < fast_entry->min_cutoff )
{
assert(requiresSlowPath==false);
requiresSlowPath = true;
}
//Ready to use the fast-path calculation
if ( !requiresSlowPath && fast_entry != nullptr ) {
counters.FastPath();
//Retrieve cross-section from fast-path cache
matCrossSection = fast_entry->GetCrossSection(part->GetKineticEnergy());
fastPathFlags.prevCalcUsedFastPath=true;
} else {
counters.SlowPath();
//Remember that we are now doing the full calculation: xsecelem will
//be made valid
fastPathFlags.prevCalcUsedFastPath=false;
G4int nElements = mat->GetNumberOfElements();
const G4double* nAtomsPerVolume = mat->GetVecNbOfAtomsPerVolume();
if(G4int(xsecelm.size()) < nElements) { xsecelm.resize(nElements); }
for(G4int i=0; i<nElements; ++i) {
matCrossSection += nAtomsPerVolume[i] *
GetCrossSection(part, (*mat->GetElementVector())[i], mat);
xsecelm[i] = matCrossSection;
}
}
//Stop measurement of cpu cycles
G4FastPathHadronicCrossSection::logStopCountCycles(timing);
if ( entry != nullptr ) {
entry->energy = part->GetKineticEnergy();
entry->crossSection = matCrossSection;
}
//Some logging of timing
G4FastPathHadronicCrossSection::logTiming(entry,fast_entry,timing);
return matCrossSection;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
void
G4CrossSectionDataStore::DumpFastPath(const G4ParticleDefinition* pd, const G4Material* mat,std::ostream& os)
{
const G4FastPathHadronicCrossSection::cycleCountEntry* entry = fastPathCache[{pd,mat}];
if ( entry != nullptr ) {
if ( entry->fastPath != nullptr ) {
os<<*entry->fastPath;
} else {
os<<"#Cache entry for {"<<(pd!=nullptr?pd->GetParticleName():"UNDEFINED")<<",";
os<<(mat!=nullptr?mat->GetName():"UNDEFINED")<<"} found, but no fast path defined";
}
} else {
os<<"#Cache entry for {"<<(pd!=nullptr?pd->GetParticleName():"UNDEFINED")<<",";
os<<(mat!=nullptr?mat->GetName():"UNDEFINED")<<"} not found.";
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
G4double
G4CrossSectionDataStore::GetCrossSection(const G4DynamicParticle* part,
const G4Element* elm,
@@ -235,12 +399,13 @@ G4CrossSectionDataStore::SampleZandA(const G4DynamicParticle* part,
const G4Material* mat,
G4Nucleus& target)
{
counters.SampleZandA();
G4int nElements = mat->GetNumberOfElements();
const G4ElementVector* theElementVector = mat->GetElementVector();
G4Element* anElement = (*theElementVector)[0];
G4double cross = GetCrossSection(part, mat);
G4double cross = GetCrossSection(part, mat , true);
// select element from a compound
if(1 < nElements) {
cross *= G4UniformRand();
@@ -342,6 +507,40 @@ G4CrossSectionDataStore::BuildPhysicsTable(const G4ParticleDefinition& aParticle
for (G4int i=0; i<nDataSetList; ++i) {
dataSetList[i]->BuildPhysicsTable(aParticleType);
}
//A.Dotti: if fast-path has been requested we can now create the surrogate
// model for fast path.
if ( fastPathFlags.useFastPathIfAvailable ) {
fastPathFlags.initializationPhase = true;
using my_value_type=G4FastPathHadronicCrossSection::G4CrossSectionDataStore_Requests::value_type;
//Loop on all requests, if particle matches create the corresponding fsat-path
std::for_each( requests.begin() , requests.end() ,
[&aParticleType,this](const my_value_type& req) {
if ( aParticleType == *req.part_mat.first ) {
G4FastPathHadronicCrossSection::cycleCountEntry* entry =
new G4FastPathHadronicCrossSection::cycleCountEntry(aParticleType.GetParticleName(),req.part_mat.second);
entry->fastPath =
new G4FastPathHadronicCrossSection::fastPathEntry(&aParticleType,req.part_mat.second,req.min_cutoff);
entry->fastPath->Initialize(this);
fastPathCache[req.part_mat] = entry;
}
}
);
fastPathFlags.initializationPhase = false;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
void G4CrossSectionDataStore::ActivateFastPath( const G4ParticleDefinition* pdef, const G4Material* mat, G4double min_cutoff)
{
assert(pdef!=nullptr&&mat!=nullptr);
G4FastPathHadronicCrossSection::G4CrossSectionDataStore_Key key={pdef,mat};
if ( requests.insert( { key , min_cutoff } ).second ) {
std::ostringstream msg;
msg<<"Attempting to request FastPath for couple: "<<pdef->GetParticleName()<<","<<mat->GetName();
msg<<" but combination already exists";
G4HadronicException(__FILE__,__LINE__,msg.str());
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
@@ -373,21 +572,26 @@ G4CrossSectionDataStore::DumpPhysicsTable(const G4ParticleDefinition& aParticleT
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
void G4CrossSectionDataStore::DumpHtml(const G4ParticleDefinition&,
std::ofstream& outFile)
#include <typeinfo>
void G4CrossSectionDataStore::DumpHtml(const G4ParticleDefinition& /* pD */,
std::ofstream& outFile) const
{
// Write cross section data set info to html physics list
// documentation page
G4double ehi = 0;
G4double elo = 0;
G4String physListName(getenv("G4PhysListName"));
for (G4int i = nDataSetList-1; i > 0; i--) {
elo = dataSetList[i]->GetMinKinEnergy()/GeV;
ehi = dataSetList[i]->GetMaxKinEnergy()/GeV;
outFile << " <li><b><a href=\"" << dataSetList[i]->GetName() << ".html\"> "
outFile << " <li><b><a href=\"" << physListName << "_"
<< dataSetList[i]->GetName() << ".html\"> "
<< dataSetList[i]->GetName() << "</a> from "
<< elo << " GeV to " << ehi << " GeV </b></li>\n";
//G4cerr << i << ": XS for " << pD.GetParticleName() << " : " << dataSetList[i]->GetName()
// << " typeid : " << typeid(dataSetList[i]).name()<< G4endl;
PrintCrossSectionHtml(dataSetList[i]);
}
G4double defaultHi = dataSetList[0]->GetMaxKinEnergy()/GeV;
@@ -395,7 +599,52 @@ void G4CrossSectionDataStore::DumpHtml(const G4ParticleDefinition&,
outFile << " <li><b><a href=\"" << dataSetList[0]->GetName() << ".html\"> "
<< dataSetList[0]->GetName() << "</a> from "
<< ehi << " GeV to " << defaultHi << " GeV </b></li>\n";
PrintCrossSectionHtml(dataSetList[0]);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
void G4CrossSectionDataStore::PrintCrossSectionHtml(const G4VCrossSectionDataSet *cs) const
{
G4String dirName(getenv("G4PhysListDocDir"));
G4String physListName(getenv("G4PhysListName"));
G4String pathName = dirName + "/" + physListName + "_" + HtmlFileName(cs->GetName());
std::ofstream outCS;
outCS.open(pathName);
outCS << "<html>\n";
outCS << "<head>\n";
outCS << "<title>Description of " << cs->GetName()
<< "</title>\n";
outCS << "</head>\n";
outCS << "<body>\n";
cs->CrossSectionDescription(outCS);
outCS << "</body>\n";
outCS << "</html>\n";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
G4String G4CrossSectionDataStore::HtmlFileName(const G4String & in) const
{
G4String str(in);
// replace blanks by _ C++11 version:
#ifdef G4USE_STD11
std::transform(str.begin(), str.end(), str.begin(), [](char ch) {
return ch == ' ' ? '_' : ch;
});
#else
// and now in ancient language
for(std::string::iterator it = str.begin(); it != str.end(); ++it) {
if(*it == ' ') *it = '_';
}
#endif
str=str + ".html";
return str;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CrossSectionPairGG.cc 79981 2014-03-27 15:24:11Z gcosmo $
// $Id: G4CrossSectionPairGG.cc 93682 2015-10-28 10:09:49Z gcosmo $
// $ GEANT4 tag $Name: not supported by cvs2svn $
//
// Class G4CrossSectionPairGG
@@ -44,20 +44,21 @@
#include "G4NistManager.hh"
#include "G4ThreeVector.hh"
#include "G4NistManager.hh"
#include "G4ComponentGGHadronNucleusXsc.hh"
G4CrossSectionPairGG::G4CrossSectionPairGG(G4VCrossSectionDataSet* low,
G4double Etransit) :
G4VCrossSectionDataSet("G4CrossSectionPairGG"), theLowX(low), ETransition(
Etransit) {
NistMan = G4NistManager::Instance();
theHighX = new G4GlauberGribovCrossSection();
theHighX = new G4ComponentGGHadronNucleusXsc();
verboseLevel = 0;
}
G4CrossSectionPairGG::~G4CrossSectionPairGG() {
// The cross section registry wil delete these
// delete theLowX;
// delete theHighX;
delete theHighX;
// The cross section registry will delete theLowX
}
void G4CrossSectionPairGG::CrossSectionDescription(
@@ -36,6 +36,7 @@
//
// Modifications:
//
// 16.03.15 V. Grichine safety against H ( A > 1 only )
#include "G4DiffElasticRatio.hh"
#include "G4ParticleDefinition.hh"
@@ -46,6 +47,7 @@ G4DiffElasticRatio::G4DiffElasticRatio(const G4String& nam, G4int verb)
: G4VCrossSectionRatio( nam, verb)
{
fGGXsc = new G4ComponentGGHadronNucleusXsc();
fDDthreshold = 450.*CLHEP::MeV; // ~3 pi masses
}
G4DiffElasticRatio::~G4DiffElasticRatio()
@@ -58,13 +60,17 @@ G4double G4DiffElasticRatio::ComputeRatio(const G4ParticleDefinition* theParticl
G4double kinEnergy,
G4int Z, G4int A)
{
G4double ratio=0.;
G4double ggElXsc = fGGXsc->GetElasticElementCrossSection(theParticleDefinition,kinEnergy,
G4double ratio = 0.;
if( A > 1 && kinEnergy > fDDthreshold )
{
G4double ggElXsc = fGGXsc->GetElasticElementCrossSection(theParticleDefinition,kinEnergy,
Z,A);
G4double ggsdXsc = fGGXsc->GetDiffractionGlauberGribovXsc();
if( ggElXsc > 0.) ratio = ggsdXsc/ggElXsc;
else ratio = 0;
G4double ggsdXsc = fGGXsc->GetDiffractionGlauberGribovXsc();
if( ggElXsc > 0.) ratio = ggsdXsc/ggElXsc;
else ratio = 0;
}
// G4cout<<theParticleDefinition->GetParticleName()<<"; "<<kinEnergy/CLHEP::GeV<<" GeV; r = "<<ratio<<G4endl;
return ratio;
}
@@ -175,7 +175,7 @@ G4EMDissociationCrossSection::GetCrossSectionForProjectile (G4double AP,
//
// Initialise variables and calculate the energies for the GDR and GQR.
//
G4double AProot3 = std::pow(AP,1.0/3.0);
G4double AProot3 = G4Pow::GetInstance()->powA(AP,1.0/3.0);
G4double u = 3.0 * J / Qprime / AProot3;
G4double R0 = r0 * AProot3;
G4double E_GDR = hbarc / std::sqrt(0.7*amu_c2*R0*R0/8.0/J*
@@ -246,7 +246,7 @@ G4EMDissociationCrossSection::GetWilsonProbabilityForProtonDissociation(G4double
else
{
G4double p1 = (G4double) Z / (G4double) A;
G4double p2 = 1.95*std::exp(-0.075*Z);
G4double p2 = 1.95*G4Exp(-0.075*Z);
if (p1 < p2) p = p1;
else p = p2;
}
@@ -62,6 +62,8 @@
#include "globals.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Pow.hh"
////////////////////////////////////////////////////////////////////////////////
//
G4EMDissociationSpectrum::G4EMDissociationSpectrum ()
@@ -100,7 +102,7 @@ G4double G4EMDissociationSpectrum::GetGeneralE2Spectrum
G4double K0 = bessel->K0(xi);
G4double K1 = bessel->K1(xi);
G4double n = 2.0 * fine_structure_const / pi / b4 / Eg *
(2.0*(1.0-b2)*K1*K1 + xi*std::pow((2.0-b2),2.0)*K0*K1 -
(2.0*(1.0-b2)*K1*K1 + xi*G4Pow::GetInstance()->powA((2.0-b2),2.0)*K0*K1 -
xi*xi*b4/2.0*(K1*K1-K0*K0));
return n;
}
@@ -111,8 +113,8 @@ G4double G4EMDissociationSpectrum::GetClosestApproach
{
G4double bsq = b * b;
G4double gg = 1.0/std::sqrt(1-bsq);
G4double AProot3 = std::pow(AP,1.0/3.0);
G4double ATroot3 = std::pow(AT,1.0/3.0);
G4double AProot3 = G4Pow::GetInstance()->powA(AP,1.0/3.0);
G4double ATroot3 = G4Pow::GetInstance()->powA(AT,1.0/3.0);
G4double bc = 1.34 * fermi * (AProot3+ATroot3 - 0.75 *(1.0/AProot3+1.0/ATroot3));
// G4double a0 = ZP * ZT * classic_electr_radius/bsq;
G4double a0 = ZP * ZT * elm_coupling / (AT*AP*amu_c2/(AT+AP)) / bsq;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ElectroNuclearCrossSection.cc 81105 2014-05-21 08:03:54Z gcosmo $
// $Id: G4ElectroNuclearCrossSection.cc 94079 2015-11-05 15:03:02Z gcosmo $
//
// G4 Physics class: G4ElectroNuclearCrossSection for gamma+A cross sections
// Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-01
@@ -67,20 +67,20 @@ static const G4double pos=16.5; // HE Pomeron shift
static const G4double reg=.11; // HE Reggeon slope
static const G4double mel=0.5109989; // Mass of an electron in MeV
static const G4double mel2=mel*mel; // Squared Mass of electron in MeV
static const G4double lmel=std::log(mel); // Log of an electron mass
static const G4double lmel=G4Log(mel); // Log of an electron mass
//
static const G4int nE=336;
static const G4int mL=nE-1;
static const G4int mLL=nE-1;
static const G4double EMi=2.0612; // Minimum tabulated Energy of the Electron
static const G4double EMa=50000.; // Maximum tabulated Energy of the Electron
static const G4double EMa2=EMa*EMa; // Maximum tabulated Energy of the Electron ^2
static const G4double lEMi=std::log(EMi); // Minimum tabulated logarithmic Energy of the Electron
static const G4double lEMa=std::log(EMa); // Maximum tabulated logarithmic Energy of the Electron
static const G4double lEMi=G4Log(EMi); // Minimum tabulated logarithmic Energy of the Electron
static const G4double lEMa=G4Log(EMa); // Maximum tabulated logarithmic Energy of the Electron
static const G4double lEMa2=lEMa*lEMa; // Maximum tabulated logarithmic Energy of the Electron ^2
static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in the table for the electron Energy
static const G4double dlnE=(lEMa-lEMi)/mLL; // Logarithmic step in the table for the electron Energy
static const G4double alop=1./137.036/3.14159265; //coef. for the calculated functions (Ee>50000.)
static const G4double le1=(lEMa-1.)*EMa; // (std::log(E0)-1)*E0
static const G4double leh=(lEMa-.5)*EMa2; // (std::log(E0)-.5)*E0^2
static const G4double le1=(lEMa-1.)*EMa; // (G4Log(E0)-1)*E0
static const G4double leh=(lEMa-.5)*EMa2; // (G4Log(E0)-.5)*E0^2
//
static const G4double ha=poc*.5; // a/2
static const G4double hab=ha*pos; // a*b/2
@@ -90,9 +90,9 @@ static const G4double d2 = 2 - reg;
static const G4double cd=shd/reg; // c/d
static const G4double cd1=shd/d1; // c/d1
static const G4double cd2=shd/d2; // c/d2
static const G4double ele=std::exp(-reg*lEMa); // E0^(-d)
static const G4double ele1=std::exp(d1*lEMa); // E0^(-d1)
static const G4double ele2=std::exp(d2*lEMa); // E0^(-d2)
static const G4double ele=G4Exp(-reg*lEMa); // E0^(-d)
static const G4double ele1=G4Exp(d1*lEMa); // E0^(-d1)
static const G4double ele2=G4Exp(d2*lEMa); // E0^(-d2)
//
static const G4double phte=poc*(lEMa-pos)+shd*ele; // CrossX on theHighTableEdge (small change)
static const G4int imax=27; // Not more than "imax" steps to find the solution
@@ -103,14 +103,14 @@ static const G4double infEn = 9.e27;
static const G4double dM=938.27+939.57; // Mean double nucleon mass = m_n+m_p (@@ no binding)
static const G4double Q0=843.; // Coefficient of the dipole nucleonic form-factor
static const G4double Q02=Q0*Q0; // Squared coefficient of the dipole nucleonic form-factor
static const G4double blK0=std::log(185.); // Coefficient of the b-function
static const G4double blK0=G4Log(185.); // Coefficient of the b-function
static const G4double bp=0.85; // Power of the b-function
static const G4double clK0=std::log(1390.); // Coefficient of the c-function
static const G4double clK0=G4Log(1390.); // Coefficient of the c-function
static const G4double cp=3.; // Power of the c-function
//
static const G4int nN=14;
//
static const G4int L[nN]={138, 2, 32, 75, 26, 41, 0, 67, 58, 46, 41, 38, 39, 36};
static const G4int LL[nN]={138, 2, 32, 75, 26, 41, 0, 67, 58, 46, 41, 38, 39, 36};
// !! @@ Change it from ln(A) to A approximation !!
static const G4double A[nN]={1.,2.,3.,4.,6.,7.,9.,12.,16.,27.,63.546,118.71,207.2,238.472};
//
@@ -2205,28 +2205,29 @@ G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection()
++it;
}
cache.clear();
delete lastUsedCacheEl;
}
G4double G4ElectroNuclearCrossSection::HighEnergyJ1(G4double lE)
{
return ha*(lE*lE-lEMa2)-ab*(lE-lEMa)-cd*(std::exp(-reg*lE)-ele);
return ha*(lE*lE-lEMa2)-ab*(lE-lEMa)-cd*(G4Exp(-reg*lE)-ele);
}
G4double G4ElectroNuclearCrossSection::HighEnergyJ2(G4double lE, G4double E)
{
return poc*((lE-1.)*E-le1)-ab*(E-EMa)+cd1*(std::exp(d1*lE)-ele1);
return poc*((lE-1.)*E-le1)-ab*(E-EMa)+cd1*(G4Exp(d1*lE)-ele1);
}
G4double G4ElectroNuclearCrossSection::HighEnergyJ3(G4double lE, G4double E2)
{
return ha*((lE-.5)*E2-leh)-hab*(E2-EMa2)+cd2*(std::exp(d2*lE)-ele2);
return ha*((lE-.5)*E2-leh)-hab*(E2-EMa2)+cd2*(G4Exp(d2*lE)-ele2);
}
G4double G4ElectroNuclearCrossSection::DFun(G4double x)
{
G4double y=std::exp(x-lastG-lmel); // y for the x
G4double y=G4Exp(x-lastG-lmel); // y for the x
G4double flux=lastG*(2.-y*(2.-y))-1.; // flux factor
return (poc*(x-pos)+shd*std::exp(-reg*x))*flux;
return (poc*(x-pos)+shd*G4Exp(-reg*x))*flux;
}
G4double G4ElectroNuclearCrossSection::Fun(G4double x)
@@ -2234,8 +2235,8 @@ G4double G4ElectroNuclearCrossSection::Fun(G4double x)
// Integrated PhoNuc cross section
G4double dlg1=lastG+lastG-1.;
G4double lgoe=lastG/lastE;
G4double HE2=HighEnergyJ2(x, std::exp(x));
return dlg1*HighEnergyJ1(x)-lgoe*(HE2+HE2-HighEnergyJ3(x, std::exp(2*x))/lastE);
G4double HE2=HighEnergyJ2(x, G4Exp(x));
return dlg1*HighEnergyJ1(x)-lgoe*(HE2+HE2-HighEnergyJ3(x, G4Exp(2*x))/lastE);
}
void
@@ -2277,7 +2278,7 @@ G4double G4ElectroNuclearCrossSection::GetElementCrossSection(const G4DynamicPar
G4double Aa = nistmngr->GetAtomicMassAmu(ZZ); // average A
G4int N = (G4int)Aa - ZZ;
lastUsedCacheEl->F = GetFunctions(Aa,lastUsedCacheEl->J1,lastUsedCacheEl->J2,lastUsedCacheEl->J3); // new ZeroPos and filling of J-functions
lastUsedCacheEl->H = alop*Aa*(1.-.072*std::log(Aa));// corresponds to lastSP from G4PhotonuclearCrossSection
lastUsedCacheEl->H = alop*Aa*(1.-.072*G4Log(Aa));// corresponds to lastSP from G4PhotonuclearCrossSection
lastUsedCacheEl->TH = ThresholdEnergy(ZZ, N); // The last Threshold Energy
cacheEl_t* new_el = new cacheEl_t(*lastUsedCacheEl);
cache[ZZ] = new_el;
@@ -2308,9 +2309,9 @@ G4double G4ElectroNuclearCrossSection::GetElementCrossSection(const G4DynamicPar
return 0.;
}
G4double lE=std::log(Energy); // std::log(eE) (it is necessary at this point for the fit)
G4double lE=G4Log(Energy); // G4Log(eE) (it is necessary at this point for the fit)
lastG=lE-lmel; // Gamma of the electron (used to recover std::log(eE))
lastG=lE-lmel; // Gamma of the electron (used to recover G4Log(eE))
G4double dlg1=lastG+lastG-1.;
G4double lgoe=lastG/lastE;
if(lE<lEMa) // Linear fit is made explicitly to fix the last bin for the randomization
@@ -2318,7 +2319,7 @@ G4double G4ElectroNuclearCrossSection::GetElementCrossSection(const G4DynamicPar
G4double shift=(lE-lEMi)/dlnE;
G4int blast=static_cast<int>(shift);
if(blast<0) blast=0;
if(blast>=mL) blast=mL-1;
if(blast>=mLL) blast=mLL-1;
shift-=blast;
lastL=blast+1;
G4double YNi=dlg1*lastUsedCacheEl->J1[blast]-lgoe*(lastUsedCacheEl->J2[blast]+lastUsedCacheEl->J2[blast]-lastUsedCacheEl->J3[blast]/lastE);
@@ -2328,14 +2329,14 @@ G4double G4ElectroNuclearCrossSection::GetElementCrossSection(const G4DynamicPar
}
else
{
lastL=mL;
lastL=mLL;
G4double term1=lastUsedCacheEl->J1[mL]+lastUsedCacheEl->H*HighEnergyJ1(lE);
G4double term1=lastUsedCacheEl->J1[mLL]+lastUsedCacheEl->H*HighEnergyJ1(lE);
G4double term2=lastUsedCacheEl->J2[mL]+lastUsedCacheEl->H*HighEnergyJ2(lE, Energy);
G4double term2=lastUsedCacheEl->J2[mLL]+lastUsedCacheEl->H*HighEnergyJ2(lE, Energy);
G4double En2 = Energy*Energy;
G4double term3=lastUsedCacheEl->J3[mL]+lastUsedCacheEl->H*HighEnergyJ3(lE, En2);
G4double term3=lastUsedCacheEl->J3[mLL]+lastUsedCacheEl->H*HighEnergyJ3(lE, En2);
lastSig=dlg1*term1-lgoe*(term2+term2-term3/lastE);
}
@@ -2374,7 +2375,7 @@ G4double G4ElectroNuclearCrossSection::ThresholdEnergy(G4int Z, G4int N)
}
// Calculate the functions for the std::log(A)
// Calculate the functions for the G4Log(A)
G4int G4ElectroNuclearCrossSection::GetFunctions(G4double a, G4double* xx, G4double* yy, G4double* zz)
{
// --------------------------------
@@ -2397,7 +2398,7 @@ G4int G4ElectroNuclearCrossSection::GetFunctions(G4double a, G4double* xx, G4dou
yy[k]=P1[i][k]; // J1
zz[k]=P2[i][k]; // J2
}
r=L[i]; // Low channel for the J-functions
r=LL[i]; // Low channel for the J-functions
}
if(r<0) // Not the basic A-value -> must be calculated
{
@@ -2417,8 +2418,8 @@ G4int G4ElectroNuclearCrossSection::GetFunctions(G4double a, G4double* xx, G4dou
G4double zi=P2[k1][q];
zz[q]=zi+(P2[k][q]-zi)*b;
}
r=L[k];
if(L[k1]<r) r=L[k1];
r=LL[k];
if(LL[k1]<r) r=LL[k1];
}
}
return r;
@@ -2427,10 +2428,10 @@ G4int G4ElectroNuclearCrossSection::GetFunctions(G4double a, G4double* xx, G4dou
G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy()
{
if(lastSig <= 0.0) { return 0.0; } // VI
G4double phLE = 0.; // Prototype of the std::log(nu=E_gamma)
G4double phLE = 0.; // Prototype of the G4Log(nu=E_gamma)
G4double Y[nE] = {0.0}; // Prepare the array for randomization
G4double lastLE=lastG+lmel; // recover std::log(eE) from the gamma (lastG)
G4double lastLE=lastG+lmel; // recover G4Log(eE) from the gamma (lastG)
G4double dlg1=lastG+lastG-1.;
G4double lgoe=lastG/lastE;
for (G4int i=lastUsedCacheEl->F;i<=lastL;i++) {
@@ -2439,13 +2440,13 @@ G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy()
}
// Tempory IF of H.P.: delete it if the *HP* err message does not
// show up M.K.
if(lastSig>0.99*Y[lastL] && lastL<mL && Y[lastL]<1.E-30)
if(lastSig>0.99*Y[lastL] && lastL<mLL && Y[lastL]<1.E-30)
{
G4cerr << "*HP*G4ElNucCS::GetEqPhotE:S=" << lastSig <<">" << Y[lastL]
<< ",l=" << lastL << ">" << mL << G4endl;
<< ",l=" << lastL << ">" << mLL << G4endl;
if(lastSig <= 0.0) { return 0.0; } // VI
}
G4double ris = lastSig*G4UniformRand(); // Sig can be > Y[lastL = mL], then it
G4double ris = lastSig*G4UniformRand(); // Sig can be > Y[lastL = mLL], then it
// is in the funct. region
if (ris < Y[lastL]) { // Search the table
@@ -2459,7 +2460,7 @@ G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy()
G4double Yi = Y[j1]; // Previous value is below ris
phLE = lEMi + (j1 + (ris-Yi)/(Yj-Yi) )*dlnE;
} else { // Search with the function
if (lastL < mL) G4cerr << "**G4EleNucCS::GetEfPhE:L=" << lastL << ",S="
if (lastL < mLL) G4cerr << "**G4EleNucCS::GetEfPhE:L=" << lastL << ",S="
<< lastSig << ",Y=" << Y[lastL] << G4endl;
G4double f = (ris-Y[lastL])/lastUsedCacheEl->H; // The scaled residual value of the cross-section integral
phLE=SolveTheEquation(f); // Solve the equation to find theLog(phE) (compare with lastLE)
@@ -2470,18 +2471,18 @@ G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy()
<< currentZ << ", lpE" << phLE << ">leE" << lastLE << ",Sig="
<< lastSig << ",rndSig=" << ris << ",Beg=" << lastUsedCacheEl->F << ",End="
<< lastL << ",Y=" << Y[lastL] << G4endl;
if(lastLE<7.2) phLE=std::log(std::exp(lastLE)-.511);
if(lastLE<7.2) phLE=G4Log(G4Exp(lastLE)-.511);
else phLE=7.;
}
return std::exp(phLE);
return G4Exp(phLE);
}
G4double G4ElectroNuclearCrossSection::SolveTheEquation(G4double f)
{
G4double lastLE=lastG+lmel; // recover std::log(eE) from the gamma (lastG)
G4double topLim=lastLE-.001; // maximum std::log(phE) for equivalent photons
G4double rE=EMa/std::exp(lastLE); // r=EMa/Eel to make the firs guess
G4double lastLE=lastG+lmel; // recover G4Log(eE) from the gamma (lastG)
G4double topLim=lastLE-.001; // maximum G4Log(phE) for equivalent photons
G4double rE=EMa/G4Exp(lastLE); // r=EMa/Eel to make the firs guess
G4double x=lEMa+f/phte/(lastG*(2.-rE*(2.-rE))-1.); // First guess (the first step from the edge)
if(x>topLim) x=topLim;
for(G4int i=0; i<imax; i++)
@@ -2516,7 +2517,7 @@ G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonQ2(G4double nu)
G4double iar=Qi2/Qa2; // Q2min/Q2max ratio
G4double Dy=ye+.5*y2; // D(y) function
G4double Py=ye/Dy; // P(y) function
G4double ePy=1.-std::exp(Py); // 1-std::exp(P(y)) part
G4double ePy=1.-G4Exp(Py); // 1-std::exp(P(y)) part
G4double Uy=Py*(1.-iar); // U(y) function
G4double Fy=(ye+ye)*(1.+ye)*iar/y2; // F(y) function
G4double fr=iar/(1.-ePy*iar); // Q-fraction
@@ -2524,7 +2525,7 @@ G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonQ2(G4double nu)
{
return 0.;
}
G4double LyQa2=std::log(Fy+fr); // L(y,Q2max) function
G4double LyQa2=G4Log(Fy+fr); // L(y,Q2max) function
G4bool cond=true;
G4int maxTry=3;
G4int cntTry=0;
@@ -2532,7 +2533,7 @@ G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonQ2(G4double nu)
while(cond&&cntTry<maxTry) // The loop to avoid x>1.
{
G4double R=G4UniformRand(); // Random number (0,1)
Q2=Qi2*(ePy+1./(std::exp(R*LyQa2-(1.-R)*Uy)-Fy));
Q2=Qi2*(ePy+1./(G4Exp(R*LyQa2-(1.-R)*Uy)-Fy));
cntTry++;
cond = Q2>1878.*nu;
}
@@ -2556,12 +2557,12 @@ G4double G4ElectroNuclearCrossSection::GetVirtualFactor(G4double nu, G4double Q2
{
return 0.;
}
G4double lK=std::log(K); // ln(K)
G4double lK=G4Log(K); // ln(K)
G4double x=1.-K/nu; // This definitin saves one div.
G4double GD=1.+Q2/Q02; // Reversed nucleonic form-factor
G4double b=std::exp(bp*(lK-blK0)); // b-factor
G4double c=std::exp(cp*(lK-clK0)); // c-factor
G4double r=.5*std::log(Q2+nu*nu)-lK; // r=.5*std::log((Q^2+nu^2)/K^2)
G4double ef=std::exp(r*(b-c*r*r)); // exponential factor
G4double b=G4Exp(bp*(lK-blK0)); // b-factor
G4double c=G4Exp(cp*(lK-clK0)); // c-factor
G4double r=.5*G4Log(Q2+nu*nu)-lK; // r=.5*G4Log((Q^2+nu^2)/K^2)
G4double ef=G4Exp(r*(b-c*r*r)); // exponential factor
return (1.-x)*ef/GD/GD;
}
@@ -0,0 +1,432 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#include "G4FastPathHadronicCrossSection.hh"
#include "G4ios.hh"
#include "G4DynamicParticle.hh"
#include "G4Material.hh"
#include "G4CrossSectionDataStore.hh"
#include <vector>
#if defined(WIN32)
//Needed for M_LN10
#define _USE_MATH_DEFINES // for C++
#include <math.h>
#endif
#include <cmath>
//#include <math.h>
#include <array>
#ifdef FPDEBUG
#define DBG( msg ) G4cout<< msg <<G4endl;
#define DUMP() G4cout<< <<G4endl;
#else
#define DBG(msg)
#define DUMP()
#endif
using namespace G4FastPathHadronicCrossSection;
//Utility functions used to perform fast-path calculations.
//See later for details
namespace {
struct Point_t {
double e;
double xs;
};
int simplify_function(G4double tolerance,
std::vector<Point_t> & raw_data,
std::vector<Point_t> & simplified_data);
void RemoveBias( std::vector <Point_t> &,
std::vector <Point_t> &,
std::vector <Point_t> &);
}
fastPathEntry::fastPathEntry(const G4ParticleDefinition* part, const G4Material* mat, G4double min) :
particle(part),material(mat),min_cutoff(min),physicsVector(nullptr)
{
DBG("Initializing a fastPathEntry");
#ifdef FPDEBUG
count = 0;
slowpath_sum=0.;
max_delta=0.;
min_delta=0.;
sum_delta=0.;
sum_delta_square=0.;
#endif
}
fastPathEntry::~fastPathEntry()
{
DBG("Deleting fastPathEntry");
DBG("Dumping status for: "<<(particle?particle->GetParticleName():"PART_NONE")<<" "\
<<(material?material->GetName():"MAT_NONE")<<" min_cutoff:"<<min_cutoff<<" "\
<<" count:"<<count<<" slowpath_sum:"<<slowpath_sum<<" max_delta:"<<max_delta\
<<" min_delta"<<min_delta<<" sum_delta"<<sum_delta<<" sum_delta_squared:"<<sum_delta_square);
delete physicsVector;
}
//namespace {
// static inline G4double exp10(G4double x) {
// return std::exp( M_LN10*x);
// }
//}
void fastPathEntry::Initialize(G4CrossSectionDataStore* xsds)
{
//Check this method is called when G4CrossSectionDataStore is in the correct state:
// FastPath is enabled and we are indeed initializing
assert( xsds->GetFastPathControlFlags().useFastPathIfAvailable &&
xsds->GetFastPathControlFlags().initializationPhase );
using std::log10;
std::vector<Point_t> data_in;
const fastPathParameters& params = xsds->GetFastPathParameters();
G4double xs;
//G4double max_query = params.queryMax;
//G4int count = sampleCount;
//G4double tol = dpTol;
//Shift so max and min are >= 1.
//Don't forget to shift back before computing XS
G4double min = params.sampleMin;
G4double max = params.sampleMax;
G4double shift = 0.0;
if(min < 1.0){
shift = 1.0 - min;
}
min += shift;
max += shift;
G4double log_max = std::log10(params.sampleMax);
G4double log_min = std::log10(params.sampleMin);
G4double log_step = (log_max-log_min)/(1.0*params.sampleCount);
G4double max_xs = 0.0;
//Utility particle to calculate XS, with 0 kin energy by default
static const G4ThreeVector constDirection(0.,0.,1.);
G4DynamicParticle* probingParticle = new G4DynamicParticle( particle , constDirection , 0 );
//add the cutoff energy
probingParticle->SetKineticEnergy(min_cutoff);
//Sample cross-section
xs = xsds->GetCrossSection(probingParticle,material);
data_in.push_back({min_cutoff,xs});
G4double currEnergy = 0.0;
//log results
auto exp10 = [](G4double x){ return std::exp( M_LN10*x); };
for(G4double log_currEnergy = log_min; log_currEnergy < log_max; log_currEnergy += log_step){
currEnergy = exp10(log_currEnergy) - shift;
if (currEnergy < min_cutoff) continue;
probingParticle->SetKineticEnergy(currEnergy);
xs=xsds->GetCrossSection(probingParticle,material);
//G4cout << "PRUTH: energy value " << currEnergy << ", XS value " << xs << G4endl;
if (xs > max_xs) max_xs = xs;
data_in.push_back({currEnergy,xs});
} // --- end of loop i
probingParticle->SetKineticEnergy(max-shift);
xs = xsds->GetCrossSection(probingParticle,material);
data_in.push_back({max-shift,xs});
G4double tol = max_xs * 0.01;
std::vector<Point_t> decimated_data;
simplify_function(tol, data_in, decimated_data);
std::vector<Point_t> debiased_data;
RemoveBias( data_in, decimated_data, debiased_data);
if ( physicsVector != nullptr ) delete physicsVector;
physicsVector = new XSParam(decimated_data.size());
G4int physicsVectorIndex = 0;
for(size_t i = 0; i < decimated_data.size(); i++){
physicsVector->PutValue(physicsVectorIndex++, decimated_data[i].e, decimated_data[i].xs);
}
//xsds->DumpFastPath(particle,material,G4cout);
}
cycleCountEntry::cycleCountEntry(const G4String& pname , const G4Material* mat) :
particle(pname),material(mat),fastPath(nullptr),
energy(-1.),crossSection(-1.)
{
DBG("Initializing cache entry");
#ifdef FPDEBUG
cacheHitCount = 0;
initCyclesFastPath=0;
invocationCountSlowPath=0;
totalCyclesSlowPath=0;
invocationCountFastPath=0;
totalCyclesFastPath=0;
invocationCountTriedOneLineCache=0;
invocationCountOneLineCache=0;
#endif
}
cycleCountEntry::~cycleCountEntry()
{
DBG("Deleting cache entry");
DBG(particle<<" "<<material<<" ("<<(material?material->GetName():"MAT_NONE")<<") "<<" "\
<<"fast path pointer:"<<fastPath<<" stored:"<<energy<<" "<<crossSection<<" "\
<<cacheHitCount<<" "<<initCyclesFastPath<<" "<<invocationCountSlowPath<<" "\
<<totalCyclesSlowPath<<" "<<invocationCountFastPath<<" "<<totalCyclesFastPath<<" "\
<<invocationCountTriedOneLineCache<<" "<<invocationCountOneLineCache);
}
#ifdef FPDEBUG
namespace {
static inline unsigned long long rdtsc() {
unsigned hi=0,lo=0;
#if defined(__GNUC__) &&( defined(__i386__)|| defined(__x86_64__) )
__asm__ __volatile__ ("rdtsc":"=a"(lo),"=d"(hi));
#endif
return ((unsigned long long)lo) | ((unsigned long long)hi<<32 );
}
}
void G4FastPathHadronicCrossSection::logStartCountCycles(timing& tm)
{
tm.rdtsc_start=rdtsc();
}
void G4FastPathHadronicCrossSection::logStopCountCycles(timing& tm)
{
tm.rdtsc_stop=rdtsc();
}
#endif
getCrossSectionCount::getCrossSectionCount() {
#ifdef FPDEBUG
methodCalled = 0;
hitOneLineCache=0;
fastPath=0;
slowPath=0;
sampleZandA = 0;
#endif
}
namespace {
// Rob Fowler's simplify code
// This is a curve simplification routine based on the Douglas-Peucker
// algorithm.
// Simplifying assumptions are that the input polyline is a piecewise
// function with the x values monotonically increasing, that the function
// reaches an asymptote at the right (high energy) end.
// Also, the correct error measure is the difference in y between the original
// curve and the result.
// In GEANT4 use, the assumption is that the calling program has identified
// low- and high-energy cutoffs and that the vector passed in is restricted
// to the region between the cutoffs.
// The raw_data vector comes in ordered left to right (small energy to large).
// The simplified_data vector is initially empty.
//A.Dotti ( 16-July-2015): transform variable size C-array and use of size_t
// to remove compilation warnings
int simplify_function(G4double tolerance,
std::vector<Point_t> & raw_data,
std::vector<Point_t> & simplified_data)
{
int gap_left, gap_right; // indices of the current region
G4double tolsq = tolerance*tolerance; // Alternative to working with absolute values.
std::vector<int> working_stack;
//A stack of the points to the right of the current interval that
// are known to be selected.
gap_right = raw_data.size() - 1; // index of the last element.
gap_left = 0;
DBG("First and last elements " << gap_left <<" " <<gap_right);
simplified_data.push_back(raw_data[0]); //copy first element over.
DBG("first point ( 0 "
<<simplified_data[0].e <<", "<<simplified_data[0].xs <<" )");
working_stack.push_back(gap_right); // 0th element on the stack.
while ( !working_stack.empty() )
{ G4double a, slope, delta;
G4double deltasq_max= tolsq;
int i_max;
gap_right = working_stack.back(); //get current TOS
i_max = gap_right;
if ( (gap_left +1) < gap_right ) // At least three points in the range.
{
// co-efficients for the left to right affine line segment
slope = (raw_data[gap_right].xs - raw_data[gap_left].xs) /
(raw_data[gap_right].e - raw_data[gap_left].e);
a = raw_data[gap_left].xs - slope * raw_data[gap_left].e;
for ( int i = gap_left +1; i <gap_right; i++) {
delta = raw_data[i].xs - a - slope * raw_data[i].e;
if ( delta * delta > deltasq_max){
deltasq_max = delta * delta;
i_max = i;
}
}
} else {
DBG(" Less than 3 point interval at [ "<< gap_left <<", " <<gap_right<< " ]");
}
if(i_max < gap_right) { // Found a new point, push it on the stack
working_stack.push_back(i_max);
DBG(" pushing point " << i_max);
gap_right = i_max;
}
else { // didn't find a new point betweek gap_left and gap_right.
simplified_data.push_back(raw_data[gap_right]);
DBG("inserting point ("
<<gap_right <<", "<<raw_data[gap_right].e <<", "
<< raw_data[gap_right].xs <<" )");
gap_left = gap_right;
working_stack.pop_back();
gap_right = working_stack.back();
DBG(" new gap_right " << gap_right);
}
}
DBG("Simplified curve size "<< simplified_data.size());
return (simplified_data.size());
}
// Rob Fowler's debias code
// This is a de-biasing routine applied after using a curve simplification
// routine based on the Douglas-Peucker
// algorithm.
// Simplifying assumptions are that the input polyline is a piecewise
// function with the x values monotonically increasing, and
// The right error measure is the difference in y between the original
// curve and the result.
void RemoveBias(std::vector<Point_t> & original, std::vector<Point_t> & simplified,
std::vector<Point_t> & result){
const size_t originalSize = original.size();
const size_t simplifiedSize = simplified.size();
//Create index mapping array
std::vector<G4int> xindex(simplifiedSize,0);
//G4int xindex[simplifiedSize];
G4int lastmatch = 0;
G4int j = 0;
DBG(" original and simplified vector sizes " << originalSize <<" "<<simplifiedSize);
for (size_t k = 0; k <simplifiedSize; k++) {
for (size_t i = lastmatch; i < originalSize; i++) {
if (original[i].e == simplified[k].e) {
xindex[j++] = i;
lastmatch = i;
}
}
}
DBG("Matched " << j << " values of the simplified vector");
// Use short names here.
G4int m = simplifiedSize;
std::vector<G4double> GArea(m-1,0);
//G4double GArea [m-1];
G4double GAreatotal = 0;
//Area of original simplified curve
for(int i = 0; i < m-1; i++){
G4double GAreatemp = 0;
for(j = xindex[i]; j< xindex[i+1]; j++){
G4double trap = (original[j+1].xs + original[j].xs) * (original[j+1].e - original[j].e)/2.0;
GAreatemp = GAreatemp + trap;
}
GArea[i] = GAreatemp;
GAreatotal = GAreatotal + GAreatemp;
}
DBG(" Area under the original curve " << GAreatotal);
//aleph Why is this not alpha?
std::vector<G4double> aleph(m-1,0);
//G4double aleph [m-1];
for(int i = 0; i< m-1; i++){
aleph[i] = (simplified[i+1].e - simplified[i].e)/2.0;
}
//solve for f
std::vector<G4double> adjustedy(m-1,0);
//G4double adjustedy [m];
adjustedy[m-1] = simplified[m-1].xs;
for(int i = 2; i < m+1; i++) {
adjustedy[m-i] = (GArea[m-i]/aleph[m-i]) - adjustedy[m-i+1];
if (adjustedy[m-i] <0.0) {
adjustedy[m-i] = 0.0;
DBG(" Fixing negative cross section at index " << (m-i));
}
}
//error and difference tracking
std::vector<G4double> difference(m,0.);
//G4double difference [m];
G4double maxdiff = 0;
G4double adjustedarea = 0;
G4double simplifiedarea = 0;
for(int i = 0; i < m-1; i++){
G4double trap;
trap = (adjustedy[i+1]+adjustedy[i])*(simplified[i+1].e-simplified[i].e)/2.0;
adjustedarea = adjustedarea+trap;
trap = (simplified[i+1].xs+simplified[i].xs)*(simplified[i+1].e-simplified[i].e)/2.0;
simplifiedarea = simplifiedarea + trap;
}
DBG(" Area: Simplified curve = " <<simplifiedarea);
DBG(" Area: Debiased curve = " << adjustedarea);
for(int i = 0; i <m; i++) {
difference[i] = simplified[i].xs-adjustedy[i];
}
for(int i = 0; i <m; i++){
if(std::fabs(difference[i]) > maxdiff) {
maxdiff = std::fabs(difference[i]);
}
}
// what is the significance of the loops above ?
for(size_t i = 0; i < simplifiedSize; i++){
result.push_back( {simplified[i].e , adjustedy[i] } );
}
}
}
@@ -1,786 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// 24.11.08 V. Grichine - first implementation
// 25.10.12 W.Pokorski - following Vladimir's advice, I removed Z>1 condition
//
#include "G4GGNuclNuclCrossSection.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4HadTmpUtil.hh"
#include "G4HadronNucleonXsc.hh"
// factory
#include "G4CrossSectionFactory.hh"
//
G4_DECLARE_XS_FACTORY(G4GGNuclNuclCrossSection);
G4GGNuclNuclCrossSection::G4GGNuclNuclCrossSection()
: G4VCrossSectionDataSet(Default_Name()),
// fUpperLimit(100000*GeV),
fLowerLimit(0.1*MeV),
fRadiusConst(1.08*fermi), // 1.1, 1.3 ?
fTotalXsc(0.0), fElasticXsc(0.0), fInelasticXsc(0.0), fProductionXsc(0.0),
fDiffractionXsc(0.0)
// , fHadronNucleonXsc(0.0)
{
theProton = G4Proton::Proton();
theNeutron = G4Neutron::Neutron();
hnXsc = new G4HadronNucleonXsc();
}
G4GGNuclNuclCrossSection::~G4GGNuclNuclCrossSection()
{
delete hnXsc;
}
void
G4GGNuclNuclCrossSection::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4GGNuclNuclCrossSection calculates total, inelastic and\n"
<< "elastic cross sections for nucleus-nucleus collisions using\n"
<< "the Glauber model with Gribov corrections. It is valid for\n"
<< "all incident energies above 100 keV./n";
}
G4bool
G4GGNuclNuclCrossSection::IsElementApplicable(const G4DynamicParticle*,
G4int, const G4Material*)
{
G4bool applicable = true;
// G4double kineticEnergy = aDP->GetKineticEnergy();
// if (kineticEnergy >= fLowerLimit) applicable = true;
return applicable;
}
///////////////////////////////////////////////////////////////////////////////
//
// Calculates total and inelastic Xsc, derives elastic as total - inelastic
// accordong to Glauber model with Gribov correction calculated in the dipole
// approximation on light cone. Gaussian density helps to calculate rest
// integrals of the model. [1] B.Z. Kopeliovich, nucl-th/0306044
G4double G4GGNuclNuclCrossSection::
GetElementCrossSection(const G4DynamicParticle* aParticle, G4int Z,
const G4Material*)
{
G4int A = G4lrint(G4NistManager::Instance()->GetAtomicMassAmu(Z));
return GetZandACrossSection(aParticle, Z, A);
}
///////////////////////////////////////////////////////////////////////////////
//
// Calculates total and inelastic Xsc, derives elastic as total - inelastic
// accordong to Glauber model with Gribov correction calculated in the dipole
// approximation on light cone. Gaussian density of point-like nucleons helps
// to calculate rest integrals of the model. [1] B.Z. Kopeliovich,
// nucl-th/0306044 + simplification above
G4double G4GGNuclNuclCrossSection::
GetZandACrossSection(const G4DynamicParticle* aParticle,
G4int tZ, G4int tA)
{
G4double xsection;
G4double sigma;
G4double cofInelastic = 2.4;
G4double cofTotal = 2.0;
G4double nucleusSquare;
G4double cB;
G4double ratio;
G4double pZ = aParticle->GetDefinition()->GetPDGCharge();
G4double pA = aParticle->GetDefinition()->GetBaryonNumber();
G4double pTkin = aParticle->GetKineticEnergy();
pTkin /= pA;
G4double pN = pA - pZ;
if( pN < 0. ) pN = 0.;
G4double tN = tA - tZ;
if( tN < 0. ) tN = 0.;
G4double tR = GetNucleusRadius( G4double(tZ),G4double(tA) );
G4double pR = GetNucleusRadius(pZ,pA);
cB = GetCoulombBarier(aParticle, G4double(tZ), G4double(tA), pR, tR);
if ( cB > 0. )
{
G4DynamicParticle* dProton = new G4DynamicParticle(theProton,
G4ParticleMomentum(1.,0.,0.),
pTkin);
G4DynamicParticle* dNeutron = new G4DynamicParticle(theNeutron,
G4ParticleMomentum(1.,0.,0.),
pTkin);
sigma = (pZ*tZ+pN*tN)*hnXsc->GetHadronNucleonXscNS(dProton, theProton);
G4double ppInXsc = hnXsc->GetInelasticHadronNucleonXsc();
sigma += (pZ*tN+pN*tZ)*hnXsc->GetHadronNucleonXscNS(dNeutron, theProton);
G4double npInXsc = hnXsc->GetInelasticHadronNucleonXsc();
delete dProton;
delete dNeutron;
// G4cout<<"ppInXsc = "<<ppInXsc/millibarn<<"; npInXsc = "<<npInXsc/millibarn<<G4endl;
// G4cout<<"npTotXsc = "<<hnXsc->GetTotalHadronNucleonXsc()/millibarn<<"; npElXsc = "
// <<hnXsc->GetElasticHadronNucleonXsc()/millibarn<<G4endl;
nucleusSquare = cofTotal*pi*( pR*pR + tR*tR ); // basically 2piRR
ratio = sigma/nucleusSquare;
xsection = nucleusSquare*std::log( 1. + ratio );
fTotalXsc = xsection;
fTotalXsc *= cB;
fInelasticXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
fInelasticXsc *= cB;
fElasticXsc = fTotalXsc - fInelasticXsc;
// 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)*ppInXsc + (pZ*tN+pN*tZ)*npInXsc;
ratio = sigma/nucleusSquare;
fProductionXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
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
G4double G4GGNuclNuclCrossSection::
GetRatioSD(const G4DynamicParticle* aParticle, G4double tA, G4double tZ)
{
G4double sigma, cofInelastic = 2.4, cofTotal = 2.0, nucleusSquare, ratio;
G4double pZ = aParticle->GetDefinition()->GetPDGCharge();
G4double pA = aParticle->GetDefinition()->GetBaryonNumber();
G4double pTkin = aParticle->GetKineticEnergy();
pTkin /= pA;
G4double pN = pA - pZ;
if( pN < 0. ) pN = 0.;
G4double tN = tA - tZ;
if( tN < 0. ) tN = 0.;
G4double tR = GetNucleusRadius(tZ,tA);
G4double pR = GetNucleusRadius(pZ,pA);
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
ratio = sigma/nucleusSquare;
fInelasticXsc = nucleusSquare*std::log(1. + cofInelastic*ratio)/cofInelastic;
G4double difratio = ratio/(1.+ratio);
fDiffractionXsc = 0.5*nucleusSquare*( difratio - std::log( 1. + difratio ) );
if (fInelasticXsc > 0.) ratio = fDiffractionXsc/fInelasticXsc;
else ratio = 0.;
return ratio;
}
//////////////////////////////////////////////////////////////////////////
//
// Return quasi-elastic/inelastic cross-section ratio
G4double G4GGNuclNuclCrossSection::
GetRatioQE(const G4DynamicParticle* aParticle, G4double tA, G4double tZ)
{
G4double sigma, cofInelastic = 2.4, cofTotal = 2.0, nucleusSquare, ratio;
G4double pZ = aParticle->GetDefinition()->GetPDGCharge();
G4double pA = aParticle->GetDefinition()->GetBaryonNumber();
G4double pTkin = aParticle->GetKineticEnergy();
pTkin /= pA;
G4double pN = pA - pZ;
if( pN < 0. ) pN = 0.;
G4double tN = tA - tZ;
if( tN < 0. ) tN = 0.;
G4double tR = GetNucleusRadius(tZ,tA);
G4double pR = GetNucleusRadius(pZ,pA);
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
ratio = sigma/nucleusSquare;
fInelasticXsc = nucleusSquare*std::log(1. + cofInelastic*ratio)/cofInelastic;
// sigma = GetHNinelasticXsc(aParticle, tA, tZ);
ratio = sigma/nucleusSquare;
fProductionXsc = nucleusSquare*std::log(1. + cofInelastic*ratio)/cofInelastic;
if (fInelasticXsc > fProductionXsc) ratio = (fInelasticXsc-fProductionXsc)/fInelasticXsc;
else ratio = 0.;
if ( ratio < 0. ) ratio = 0.;
return ratio;
}
///////////////////////////////////////////////////////////////////////////////
//
// Returns hadron-nucleon Xsc according to differnt parametrisations:
// [2] E. Levin, hep-ph/9710546
// [3] U. Dersch, et al, hep-ex/9910052
// [4] M.J. Longo, et al, Phys.Rev.Lett. 33 (1974) 725
G4double
G4GGNuclNuclCrossSection::GetHadronNucleonXsc(const G4DynamicParticle* aParticle,
const G4Element* anElement)
{
G4int At = G4lrint(anElement->GetN()); // number of nucleons
G4int Zt = G4lrint(anElement->GetZ()); // number of protons
return GetHadronNucleonXsc(aParticle, At, Zt);
}
///////////////////////////////////////////////////////////////////////////////
//
// Returns hadron-nucleon Xsc according to differnt parametrisations:
// [2] E. Levin, hep-ph/9710546
// [3] U. Dersch, et al, hep-ex/9910052
// [4] M.J. Longo, et al, Phys.Rev.Lett. 33 (1974) 725
G4double
G4GGNuclNuclCrossSection::GetHadronNucleonXsc(const G4DynamicParticle* aParticle,
G4int At, G4int Zt)
{
G4double xsection = 0.;
G4double targ_mass = G4ParticleTable::GetParticleTable()->
GetIonTable()->GetIonMass(Zt, At);
targ_mass = 0.939*GeV; // ~mean neutron and proton ???
G4double proj_mass = aParticle->GetMass();
G4double proj_momentum = aParticle->GetMomentum().mag();
G4double sMand = CalcMandelstamS ( proj_mass , targ_mass , proj_momentum );
sMand /= GeV*GeV; // in GeV for parametrisation
proj_momentum /= GeV;
const G4ParticleDefinition* pParticle = aParticle->GetDefinition();
if(pParticle == theNeutron) // as proton ???
{
xsection = G4double(At)*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
}
else if(pParticle == theProton)
{
xsection = G4double(At)*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
}
xsection *= millibarn;
return xsection;
}
///////////////////////////////////////////////////////////////////////////////
//
// Returns hadron-nucleon Xsc according to PDG parametrisation (2005):
// http://pdg.lbl.gov/2006/reviews/hadronicrpp.pdf
// At = number of nucleons, Zt = number of protons
G4double
G4GGNuclNuclCrossSection::GetHadronNucleonXscPDG(const G4ParticleDefinition* pParticle,
G4double sMand,
const G4ParticleDefinition* tParticle)
{
G4double xsection = 0.;
// G4bool pORn = (tParticle == theProton || nucleon == theNeutron );
G4bool proton = (tParticle == theProton);
G4bool neutron = (tParticle == theNeutron);
// General PDG fit constants
G4double s0 = 5.38*5.38; // in Gev^2
G4double eta1 = 0.458;
G4double eta2 = 0.458;
G4double B = 0.308;
// const G4ParticleDefinition* pParticle = aParticle->GetDefinition();
if(pParticle == theNeutron) // proton-neutron fit
{
if ( proton )
{
xsection = ( 35.80 + B*std::pow(std::log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
}
if ( neutron )
{
xsection = (35.45 + B*std::pow(std::log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2)); // pp for nn
}
}
else if(pParticle == theProton)
{
if ( proton )
{
xsection = (35.45 + B*std::pow(std::log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
}
if ( neutron )
{
xsection = (35.80 + B*std::pow(std::log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
}
}
xsection *= millibarn; // parametrised in mb
return xsection;
}
///////////////////////////////////////////////////////////////////////////////
//
// Returns nucleon-nucleon cross-section based on N. Starkov parametrisation of
// data from mainly http://wwwppds.ihep.su:8001/c5-6A.html database
// projectile nucleon is pParticle with pTkin shooting target nucleon tParticle
G4double
G4GGNuclNuclCrossSection::GetHadronNucleonXscNS(const G4ParticleDefinition* pParticle,
G4double pTkin,
const G4ParticleDefinition* tParticle)
{
G4double xsection(0);
// G4double Delta; DHW 19 May 2011: variable set but not used
G4double A0, B0;
G4double hpXscv(0);
G4double hnXscv(0);
G4double targ_mass = tParticle->GetPDGMass();
G4double proj_mass = pParticle->GetPDGMass();
G4double proj_energy = proj_mass + pTkin;
G4double proj_momentum = std::sqrt(pTkin*(pTkin+2*proj_mass));
G4double sMand = CalcMandelstamS ( proj_mass , targ_mass , proj_momentum );
sMand /= GeV*GeV; // in GeV for parametrisation
proj_momentum /= GeV;
proj_energy /= GeV;
proj_mass /= GeV;
// General PDG fit constants
// G4double s0 = 5.38*5.38; // in Gev^2
// G4double eta1 = 0.458;
// G4double eta2 = 0.458;
// G4double B = 0.308;
if( proj_momentum >= 373.)
{
return GetHadronNucleonXscPDG(pParticle,sMand,tParticle);
}
else if( proj_momentum >= 10. ) // high energy: pp = nn = np
// if( proj_momentum >= 2.)
{
// Delta = 1.; // DHW 19 May 2011: variable set but not used
// if (proj_energy < 40.) Delta = 0.916+0.0021*proj_energy;
if (proj_momentum >= 10.) {
B0 = 7.5;
A0 = 100. - B0*std::log(3.0e7);
xsection = A0 + B0*std::log(proj_energy) - 11
+ 103*std::pow(2*0.93827*proj_energy + proj_mass*proj_mass+
0.93827*0.93827,-0.165); // mb
}
}
else // low energy pp = nn != np
{
if(pParticle == tParticle) // pp or nn // nn to be pp
{
if( proj_momentum < 0.73 )
{
hnXscv = 23 + 50*( std::pow( std::log(0.73/proj_momentum), 3.5 ) );
}
else if( proj_momentum < 1.05 )
{
hnXscv = 23 + 40*(std::log(proj_momentum/0.73))*
(std::log(proj_momentum/0.73));
}
else // if( proj_momentum < 10. )
{
hnXscv = 39.0 +
75*(proj_momentum - 1.2)/(std::pow(proj_momentum,3.0) + 0.15);
}
xsection = hnXscv;
}
else // pn to be np
{
if( proj_momentum < 0.8 )
{
hpXscv = 33+30*std::pow(std::log(proj_momentum/1.3),4.0);
}
else if( proj_momentum < 1.4 )
{
hpXscv = 33+30*std::pow(std::log(proj_momentum/0.95),2.0);
}
else // if( proj_momentum < 10. )
{
hpXscv = 33.3+
20.8*(std::pow(proj_momentum,2.0)-1.35)/
(std::pow(proj_momentum,2.50)+0.95);
}
xsection = hpXscv;
}
}
xsection *= millibarn; // parametrised in mb
return xsection;
}
/////////////////////////////////////////////////////////////////////////////////
//
// Returns hadron-nucleon inelastic cross-section based on FTF-parametrisation
G4double
G4GGNuclNuclCrossSection::GetHNinelasticXscVU(const G4DynamicParticle* aParticle,
G4int At, G4int Zt)
{
G4int PDGcode = aParticle->GetDefinition()->GetPDGEncoding();
G4int absPDGcode = std::abs(PDGcode);
G4double Elab = aParticle->GetTotalEnergy();
// (s - 2*0.88*GeV*GeV)/(2*0.939*GeV)/GeV;
G4double Plab = aParticle->GetMomentum().mag();
// std::sqrt(Elab * Elab - 0.88);
Elab /= GeV;
Plab /= GeV;
G4double LogPlab = std::log( Plab );
G4double sqrLogPlab = LogPlab * LogPlab;
//G4cout<<"Plab = "<<Plab<<G4endl;
G4double NumberOfTargetProtons = Zt;
G4double NumberOfTargetNucleons = At;
G4double NumberOfTargetNeutrons = NumberOfTargetNucleons - NumberOfTargetProtons;
if(NumberOfTargetNeutrons < 0.) NumberOfTargetNeutrons = 0.;
G4double Xtotal = 0., Xelastic = 0., Xinelastic =0.;
if( absPDGcode > 1000 ) //------Projectile is baryon --------
{
G4double XtotPP = 48.0 + 0. *std::pow(Plab, 0. ) +
0.522*sqrLogPlab - 4.51*LogPlab;
G4double XtotPN = 47.3 + 0. *std::pow(Plab, 0. ) +
0.513*sqrLogPlab - 4.27*LogPlab;
G4double XelPP = 11.9 + 26.9*std::pow(Plab,-1.21) +
0.169*sqrLogPlab - 1.85*LogPlab;
G4double XelPN = 11.9 + 26.9*std::pow(Plab,-1.21) +
0.169*sqrLogPlab - 1.85*LogPlab;
Xtotal = ( NumberOfTargetProtons * XtotPP +
NumberOfTargetNeutrons * XtotPN );
Xelastic = ( NumberOfTargetProtons * XelPP +
NumberOfTargetNeutrons * XelPN );
}
Xinelastic = Xtotal - Xelastic;
if(Xinelastic < 0.) Xinelastic = 0.;
return Xinelastic*= millibarn;
}
///////////////////////////////////////////////////////////////////////////////
//
//
G4double
G4GGNuclNuclCrossSection::GetNucleusRadius(const G4DynamicParticle* ,
const G4Element* anElement)
{
G4double At = anElement->GetN();
G4double oneThird = 1.0/3.0;
G4double cubicrAt = std::pow (At, oneThird);
G4double R; // = fRadiusConst*cubicrAt;
R = fRadiusConst*cubicrAt;
G4double meanA = 21.;
G4double tauA1 = 40.;
G4double tauA2 = 10.;
G4double tauA3 = 5.;
G4double a1 = 0.85;
G4double b1 = 1. - a1;
G4double b2 = 0.3;
G4double b3 = 4.;
if (At > 20.) // 20.
{
R *= ( a1 + b1*std::exp( -(At - meanA)/tauA1) );
}
else if (At > 3.5)
{
R *= ( 1.0 + b2*( 1. - std::exp( (At - meanA)/tauA2) ) );
}
else
{
R *= ( 1.0 + b3*( 1. - std::exp( (At - meanA)/tauA3) ) );
}
return R;
}
///////////////////////////////////////////////////////////////////////////////
//
//
G4double
G4GGNuclNuclCrossSection::GetNucleusRadius(G4double Zt, G4double At)
{
G4double R;
R = GetNucleusRadiusDE(Zt,At);
// R = GetNucleusRadiusRMS(Zt,At);
return R;
}
///////////////////////////////////////////////////////////////////
G4double
G4GGNuclNuclCrossSection::GetNucleusRadiusGG(G4double At)
{
G4double oneThird = 1.0/3.0;
G4double cubicrAt = std::pow (At, oneThird);
G4double R; // = fRadiusConst*cubicrAt;
R = fRadiusConst*cubicrAt;
G4double meanA = 20.;
G4double tauA = 20.;
if ( At > 20.) // 20.
{
R *= ( 0.8 + 0.2*std::exp( -(At - meanA)/tauA) );
}
else
{
R *= ( 1.0 + 0.1*( 1. - std::exp( (At - meanA)/tauA) ) );
}
return R;
}
/////////////////////////////////////////////////////////////////////////////
//
//
G4double
G4GGNuclNuclCrossSection::GetNucleusRadiusDE(G4double Z, G4double A)
{
// algorithm from diffuse-elastic
G4double R, r0, a11, a12, a13, a2, a3;
a11 = 1.26; // 1.08, 1.16
a12 = 1.; // 1.08, 1.16
a13 = 1.12; // 1.08, 1.16
a2 = 1.1;
a3 = 1.;
// Special rms radii for light nucleii
if (A < 50.)
{
if (std::abs(A-1.) < 0.5) return 0.89*fermi; // p
else if(std::abs(A-2.) < 0.5) return 2.13*fermi; // d
else if(std::abs(Z-1.) < 0.5 && std::abs(A-3.) < 0.5) return 1.80*fermi; // t
else if(std::abs(Z-2.) < 0.5 && std::abs(A-3.) < 0.5) return 1.96*fermi; // He3
else if(std::abs(Z-2.) < 0.5 && std::abs(A-4.) < 0.5) return 1.68*fermi; // He4
else if(std::abs(Z-3.) < 0.5) return 2.40*fermi; // Li7
else if(std::abs(Z-4.) < 0.5) return 2.51*fermi; // Be9
else if( 10. < A && A <= 16. ) r0 = a11*( 1 - std::pow(A, -2./3.) )*fermi; // 1.08*fermi;
else if( 15. < A && A <= 20. ) r0 = a12*( 1 - std::pow(A, -2./3.) )*fermi;
else if( 20. < A && A <= 30. ) r0 = a13*( 1 - std::pow(A, -2./3.) )*fermi;
else r0 = a2*fermi;
R = r0*std::pow( A, 1./3. );
}
else
{
r0 = a3*fermi;
R = r0*std::pow(A, 0.27);
}
return R;
}
/////////////////////////////////////////////////////////////////////////////
//
// RMS radii from e-A scattering data
G4double
G4GGNuclNuclCrossSection::GetNucleusRadiusRMS(G4double Z, G4double A)
{
if (std::abs(A-1.) < 0.5) return 0.89*fermi; // p
else if(std::abs(A-2.) < 0.5) return 2.13*fermi; // d
else if(std::abs(Z-1.) < 0.5 && std::abs(A-3.) < 0.5) return 1.80*fermi; // t
else if(std::abs(Z-2.) < 0.5 && std::abs(A-3.) < 0.5) return 1.96*fermi; // He3
else if(std::abs(Z-2.) < 0.5 && std::abs(A-4.) < 0.5) return 1.68*fermi; // He4
else if(std::abs(Z-3.) < 0.5) return 2.40*fermi; // Li7
else if(std::abs(Z-4.) < 0.5) return 2.51*fermi; // Be9
else return 1.24*std::pow(A, 0.28 )*fermi; // A > 9
}
///////////////////////////////////////////////////////////////////////////////
//
//
G4double G4GGNuclNuclCrossSection::CalculateEcmValue(const G4double mp,
const G4double mt,
const G4double Plab)
{
G4double Elab = std::sqrt ( mp * mp + Plab * Plab );
G4double Ecm = std::sqrt ( mp * mp + mt * mt + 2 * Elab * mt );
// G4double Pcm = Plab * mt / Ecm;
// G4double KEcm = std::sqrt ( Pcm * Pcm + mp * mp ) - mp;
return Ecm ; // KEcm;
}
///////////////////////////////////////////////////////////////////////////////
//
//
G4double G4GGNuclNuclCrossSection::CalcMandelstamS(const G4double mp,
const G4double mt,
const G4double Plab)
{
G4double Elab = std::sqrt ( mp * mp + Plab * Plab );
G4double sMand = mp*mp + mt*mt + 2*Elab*mt ;
return sMand;
}
//
//
///////////////////////////////////////////////////////////////////////////////
@@ -191,3 +191,31 @@ G4double G4GeneralSpaceNNCrossSection::GetElementCrossSection
return result;
}
///////////////////////////////////////////////////////////////////////////////
//
void G4GeneralSpaceNNCrossSection::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4GeneralSpaceNNCrossSection calculates hadronic inelastic\n"
<< "cross sections of interest in space science, by using the\n"
<< "following cross sections:\n"
<< "- G4ProtonInelasticCrossSection : for proton projectile\n"
<< " on targets with Z > 5;\n"
<< "- G4TripathiLightCrossSection : for proton projectile\n"
<< " on targets with Z <= 5;\n"
<< " for targets with Z = 1 and projectile Z <= 5;\n"
<< " for neutron, or deuteron, or 3He, or alpha projectile\n"
<< " with kinetic energy less than 10 GeV per nucleon,\n"
<< " in any target;\n"
<< " for 3He and 4He targets, for any projectile with\n"
<< " kinetic energy less than 10 GeV per nucleon;\n"
<< "- G4IonProtonCrossSection : for projectile with Z > 5\n"
<< " on hydrogen target;\n"
<< "- G4TripathiCrossSection : for any projectile with A >=3\n"
<< " and kinetic energy less than 1 GeV per nucleon,\n"
<< " for any target, if the previous cross section is\n"
<< " not applicable;\n"
<< "- G4IonsShenCrossSection : in all remaining cases, up to\n"
<< " projectile kinetic energy of 1 TeV per nucleon.\n";
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -34,7 +34,9 @@
#include "G4IonTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4HadTmpUtil.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
#include "G4Pow.hh"
G4HadronNucleonXsc::G4HadronNucleonXsc()
:
@@ -74,7 +76,7 @@ G4HadronNucleonXsc::G4HadronNucleonXsc()
theA = G4Alpha::Alpha();
theHe3 = G4He3::He3();
InitialiseKaonNucleonTotXsc();
// InitialiseKaonNucleonTotXsc();
}
@@ -172,7 +174,7 @@ G4HadronNucleonXsc::GetHadronNucleonXscEL(const G4DynamicParticle* aParticle,
{
xsection = (21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
// xsection = At*( 49.51*std::pow(sMand,-0.097) + 0.314*std::log(sMand)*std::log(sMand) );
// xsection = At*( 49.51*std::pow(sMand,-0.097) + 0.314*G4Log(sMand)*G4Log(sMand) );
// xsection = At*( 38.4 + 0.85*std::abs(std::pow(log(sMand),1.47)) );
}
else if(theParticle == theAProton && pORn )
@@ -185,7 +187,7 @@ G4HadronNucleonXsc::GetHadronNucleonXscEL(const G4DynamicParticle* aParticle,
}
else if(theParticle == thePiMinus && pORn )
{
// xsection = At*( 55.2*std::pow(sMand,-0.255) + 0.346*std::log(sMand)*std::log(sMand) );
// xsection = At*( 55.2*std::pow(sMand,-0.255) + 0.346*G4Log(sMand)*G4Log(sMand) );
xsection = (13.63*std::pow(sMand,0.0808) + 36.02*std::pow(sMand,-0.4525));
}
else if(theParticle == theKPlus && pORn )
@@ -250,12 +252,12 @@ G4HadronNucleonXsc::GetHadronNucleonXscPDG(const G4DynamicParticle* aParticle,
{
if ( proton )
{
xsection = Zt*( 35.80 + B*std::pow(std::log(sMand/s0),2.)
xsection = Zt*( 35.80 + B*std::pow(G4Log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));// on p
}
if ( neutron )
{
xsection = Nt*( 35.45 + B*std::pow(std::log(sMand/s0),2.)
xsection = Nt*( 35.45 + B*std::pow(G4Log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2)); // on n pp for nn
}
}
@@ -263,12 +265,12 @@ G4HadronNucleonXsc::GetHadronNucleonXscPDG(const G4DynamicParticle* aParticle,
{
if ( proton )
{
xsection = Zt*( 35.45 + B*std::pow(std::log(sMand/s0),2.)
xsection = Zt*( 35.45 + B*std::pow(G4Log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
}
if ( neutron )
{
xsection = Nt*( 35.80 + B*std::pow(std::log(sMand/s0),2.)
xsection = Nt*( 35.80 + B*std::pow(G4Log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
}
}
@@ -276,35 +278,35 @@ G4HadronNucleonXsc::GetHadronNucleonXscPDG(const G4DynamicParticle* aParticle,
{
if ( proton )
{
xsection = Zt*( 35.45 + B*std::pow(std::log(sMand/s0),2.)
xsection = Zt*( 35.45 + B*std::pow(G4Log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) + 33.34*std::pow(sMand,-eta2));
}
if ( neutron )
{
xsection = Nt*( 35.80 + B*std::pow(std::log(sMand/s0),2.)
xsection = Nt*( 35.80 + B*std::pow(G4Log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) + 30.*std::pow(sMand,-eta2));
}
}
else if(theParticle == thePiPlus && pORn )
{
xsection = At*( 20.86 + B*std::pow(std::log(sMand/s0),2.)
xsection = At*( 20.86 + B*std::pow(G4Log(sMand/s0),2.)
+ 19.24*std::pow(sMand,-eta1) - 6.03*std::pow(sMand,-eta2));
}
else if(theParticle == thePiMinus && pORn )
{
xsection = At*( 20.86 + B*std::pow(std::log(sMand/s0),2.)
xsection = At*( 20.86 + B*std::pow(G4Log(sMand/s0),2.)
+ 19.24*std::pow(sMand,-eta1) + 6.03*std::pow(sMand,-eta2));
}
else if(theParticle == theKPlus)
{
if ( proton )
{
xsection = Zt*( 17.91 + B*std::pow(std::log(sMand/s0),2.)
xsection = Zt*( 17.91 + B*std::pow(G4Log(sMand/s0),2.)
+ 7.14*std::pow(sMand,-eta1) - 13.45*std::pow(sMand,-eta2));
}
if ( neutron )
{
xsection = Nt*( 17.87 + B*std::pow(std::log(sMand/s0),2.)
xsection = Nt*( 17.87 + B*std::pow(G4Log(sMand/s0),2.)
+ 5.17*std::pow(sMand,-eta1) - 7.23*std::pow(sMand,-eta2));
}
}
@@ -312,23 +314,23 @@ G4HadronNucleonXsc::GetHadronNucleonXscPDG(const G4DynamicParticle* aParticle,
{
if ( proton )
{
xsection = Zt*( 17.91 + B*std::pow(std::log(sMand/s0),2.)
xsection = Zt*( 17.91 + B*std::pow(G4Log(sMand/s0),2.)
+ 7.14*std::pow(sMand,-eta1) + 13.45*std::pow(sMand,-eta2));
}
if ( neutron )
{
xsection = Nt*( 17.87 + B*std::pow(std::log(sMand/s0),2.)
xsection = Nt*( 17.87 + B*std::pow(G4Log(sMand/s0),2.)
+ 5.17*std::pow(sMand,-eta1) + 7.23*std::pow(sMand,-eta2) );
}
}
else if(theParticle == theSMinus && pORn )
{
xsection = At*( 35.20 + B*std::pow(std::log(sMand/s0),2.)
xsection = At*( 35.20 + B*std::pow(G4Log(sMand/s0),2.)
- 199.*std::pow(sMand,-eta1) + 264.*std::pow(sMand,-eta2) );
}
else if(theParticle == theGamma && pORn ) // modify later on
{
xsection = At*( 0.0 + B*std::pow(std::log(sMand/s0),2.)
xsection = At*( 0.0 + B*std::pow(G4Log(sMand/s0),2.)
+ 0.032*std::pow(sMand,-eta1) - 0.0*std::pow(sMand,-eta2) );
}
@@ -336,12 +338,12 @@ G4HadronNucleonXsc::GetHadronNucleonXscPDG(const G4DynamicParticle* aParticle,
{
if ( proton )
{
xsection = Zt*( 35.45 + B*std::pow(std::log(sMand/s0),2.)
xsection = Zt*( 35.45 + B*std::pow(G4Log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2) );
}
if ( neutron )
{
xsection = Nt*( 35.80 + B*std::pow(std::log(sMand/s0),2.)
xsection = Nt*( 35.80 + B*std::pow(G4Log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
}
}
@@ -385,7 +387,7 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
pE /= GeV;
pM /= GeV;
G4double logP = std::log(pLab);
G4double logP = G4Log(pLab);
// General PDG fit constants
@@ -413,7 +415,7 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
{
xsection = GetHadronNucleonXscPDG(aParticle, nucleon)/millibarn;
fElasticXsc = 6.5 + 0.308*std::pow(std::log(sMand/400.),1.65) + 9.19*std::pow(sMand,-0.458);
fElasticXsc = 6.5 + 0.308*std::pow(G4Log(sMand/400.),1.65) + 9.19*std::pow(sMand,-0.458);
fTotalXsc = xsection;
@@ -421,22 +423,22 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
else if( pLab >= 100.)
{
B0 = 7.5;
A0 = 100. - B0*std::log(3.0e7);
A0 = 100. - B0*G4Log(3.0e7);
xsection = A0 + B0*std::log(pE) - 11
xsection = A0 + B0*G4Log(pE) - 11
// + 103*std::pow(2*0.93827*pE + pM*pM+0.93827*0.93827,-0.165); // mb
+ 103*std::pow(sMand,-0.165); // mb
fElasticXsc = 5.53 + 0.308*std::pow(std::log(sMand/28.9),1.1) + 9.19*std::pow(sMand,-0.458);
fElasticXsc = 5.53 + 0.308*std::pow(G4Log(sMand/28.9),1.1) + 9.19*std::pow(sMand,-0.458);
fTotalXsc = xsection;
}
else if( pLab >= 10.)
{
B0 = 7.5;
A0 = 100. - B0*std::log(3.0e7);
A0 = 100. - B0*G4Log(3.0e7);
xsection = A0 + B0*std::log(pE) - 11
xsection = A0 + B0*G4Log(pE) - 11
+ 103*std::pow(2*0.93827*pE + pM*pM+
0.93827*0.93827,-0.165); // mb
fTotalXsc = xsection;
@@ -448,20 +450,20 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
{
if( pLab < 0.4 )
{
hnXsc = 23 + 50*( std::pow( std::log(0.73/pLab), 3.5 ) );
hnXsc = 23 + 50*( std::pow( G4Log(0.73/pLab), 3.5 ) );
fElasticXsc = hnXsc;
}
else if( pLab < 0.73 )
{
hnXsc = 23 + 50*( std::pow( std::log(0.73/pLab), 3.5 ) );
hnXsc = 23 + 50*( std::pow( G4Log(0.73/pLab), 3.5 ) );
fElasticXsc = hnXsc;
}
else if( pLab < 1.05 )
{
hnXsc = 23 + 40*(std::log(pLab/0.73))*
(std::log(pLab/0.73));
fElasticXsc = 23 + 20*(std::log(pLab/0.73))*
(std::log(pLab/0.73));
hnXsc = 23 + 40*(G4Log(pLab/0.73))*
(G4Log(pLab/0.73));
fElasticXsc = 23 + 20*(G4Log(pLab/0.73))*
(G4Log(pLab/0.73));
}
else // 1.05 - 10 GeV/c
{
@@ -475,23 +477,23 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
{
if( pLab < 0.02 )
{
hpXsc = 4100+30*std::pow(std::log(1.3/pLab),3.6); // was as pLab < 0.8
hpXsc = 4100+30*std::pow(G4Log(1.3/pLab),3.6); // was as pLab < 0.8
fElasticXsc = hpXsc;
}
else if( pLab < 0.8 )
{
hpXsc = 33+30*std::pow(std::log(pLab/1.3),4.0);
hpXsc = 33+30*std::pow(G4Log(pLab/1.3),4.0);
fElasticXsc = hpXsc;
}
else if( pLab < 1.05 )
{
hpXsc = 33+30*std::pow(std::log(pLab/0.95),2.0);
fElasticXsc = 6 + 52/( std::log(0.511/pLab)*std::log(0.511/pLab) + 1.6 );
hpXsc = 33+30*std::pow(G4Log(pLab/0.95),2.0);
fElasticXsc = 6 + 52/( G4Log(0.511/pLab)*G4Log(0.511/pLab) + 1.6 );
}
else if( pLab < 1.4 )
{
hpXsc = 33+30*std::pow(std::log(pLab/0.95),2.0);
fElasticXsc = 6 + 52/( std::log(0.511/pLab)*std::log(0.511/pLab) + 1.6 );
hpXsc = 33+30*std::pow(G4Log(pLab/0.95),2.0);
fElasticXsc = 6 + 52/( G4Log(0.511/pLab)*G4Log(0.511/pLab) + 1.6 );
}
else // 1.4 < pLab < 10. )
{
@@ -509,27 +511,27 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
{
xsection = GetHadronNucleonXscPDG(aParticle, nucleon)/millibarn;
fElasticXsc = 6.5 + 0.308*std::pow(std::log(sMand/400.),1.65) + 9.19*std::pow(sMand,-0.458);
fElasticXsc = 6.5 + 0.308*std::pow(G4Log(sMand/400.),1.65) + 9.19*std::pow(sMand,-0.458);
fTotalXsc = xsection;
}
else if( pLab >= 100.)
{
B0 = 7.5;
A0 = 100. - B0*std::log(3.0e7);
A0 = 100. - B0*G4Log(3.0e7);
xsection = A0 + B0*std::log(pE) - 11 + 103*std::pow(sMand,-0.165); // mb
xsection = A0 + B0*G4Log(pE) - 11 + 103*std::pow(sMand,-0.165); // mb
fElasticXsc = 5.53 + 0.308*std::pow(std::log(sMand/28.9),1.1) + 9.19*std::pow(sMand,-0.458);
fElasticXsc = 5.53 + 0.308*std::pow(G4Log(sMand/28.9),1.1) + 9.19*std::pow(sMand,-0.458);
fTotalXsc = xsection;
}
else if( pLab >= 10.)
{
B0 = 7.5;
A0 = 100. - B0*std::log(3.0e7);
A0 = 100. - B0*G4Log(3.0e7);
xsection = A0 + B0*std::log(pE) - 11 + 103*std::pow(sMand,-0.165); // mb
xsection = A0 + B0*G4Log(pE) - 11 + 103*std::pow(sMand,-0.165); // mb
fElasticXsc = 6 + 20/( (logP-0.182)*(logP-0.182) + 1.0 );
@@ -543,20 +545,20 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
{
if( pLab < 0.4 )
{
hpXsc = 23 + 50*( std::pow( std::log(0.73/pLab), 3.5 ) );
hpXsc = 23 + 50*( std::pow( G4Log(0.73/pLab), 3.5 ) );
fElasticXsc = hpXsc;
}
else if( pLab < 0.73 )
{
hpXsc = 23 + 50*( std::pow( std::log(0.73/pLab), 3.5 ) );
hpXsc = 23 + 50*( std::pow( G4Log(0.73/pLab), 3.5 ) );
fElasticXsc = hpXsc;
}
else if( pLab < 1.05 )
{
hpXsc = 23 + 40*(std::log(pLab/0.73))*
(std::log(pLab/0.73));
fElasticXsc = 23 + 20*(std::log(pLab/0.73))*
(std::log(pLab/0.73));
hpXsc = 23 + 40*(G4Log(pLab/0.73))*
(G4Log(pLab/0.73));
fElasticXsc = 23 + 20*(G4Log(pLab/0.73))*
(G4Log(pLab/0.73));
}
else // 1.05 - 10 GeV/c
{
@@ -570,23 +572,23 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
{
if( pLab < 0.02 )
{
hnXsc = 4100+30*std::pow(std::log(1.3/pLab),3.6); // was as pLab < 0.8
hnXsc = 4100+30*std::pow(G4Log(1.3/pLab),3.6); // was as pLab < 0.8
fElasticXsc = hnXsc;
}
else if( pLab < 0.8 )
{
hnXsc = 33+30*std::pow(std::log(pLab/1.3),4.0);
hnXsc = 33+30*std::pow(G4Log(pLab/1.3),4.0);
fElasticXsc = hnXsc;
}
else if( pLab < 1.05 )
{
hnXsc = 33+30*std::pow(std::log(pLab/0.95),2.0);
fElasticXsc = 6 + 52/( std::log(0.511/pLab)*std::log(0.511/pLab) + 1.6 );
hnXsc = 33+30*std::pow(G4Log(pLab/0.95),2.0);
fElasticXsc = 6 + 52/( G4Log(0.511/pLab)*G4Log(0.511/pLab) + 1.6 );
}
else if( pLab < 1.4 )
{
hnXsc = 33+30*std::pow(std::log(pLab/0.95),2.0);
fElasticXsc = 6 + 52/( std::log(0.511/pLab)*std::log(0.511/pLab) + 1.6 );
hnXsc = 33+30*std::pow(G4Log(pLab/0.95),2.0);
fElasticXsc = 6 + 52/( G4Log(0.511/pLab)*G4Log(0.511/pLab) + 1.6 );
}
else // 1.4 < pLab < 10. )
{
@@ -602,12 +604,12 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
{
if( proton )
{
xsection = 35.45 + B*std::pow(std::log(sMand/s0),2.)
xsection = 35.45 + B*std::pow(G4Log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) + 33.34*std::pow(sMand,-eta2);
}
if( neutron ) // ???
{
xsection = 35.80 + B*std::pow(std::log(sMand/s0),2.)
xsection = 35.80 + B*std::pow(G4Log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) + 30.*std::pow(sMand,-eta2);
}
fTotalXsc = xsection;
@@ -633,41 +635,41 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
}
else if( pLab < 0.85 )
{
G4double Ex4 = 88*(std::log(pLab/0.77))*(std::log(pLab/0.77));
G4double Ex4 = 88*(G4Log(pLab/0.77))*(G4Log(pLab/0.77));
hpXsc = Ex4 + 14.9;
fElasticXsc = hpXsc*std::exp(-3.*(pLab - 0.68));
fElasticXsc = hpXsc*G4Exp(-3.*(pLab - 0.68));
}
else if( pLab < 1.15 )
{
G4double Ex4 = 88*(std::log(pLab/0.77))*(std::log(pLab/0.77));
G4double Ex4 = 88*(G4Log(pLab/0.77))*(G4Log(pLab/0.77));
hpXsc = Ex4 + 14.9;
fElasticXsc = 6.0 + 1.4/(( pLab - 1.4)*( pLab - 1.4) + 0.1);
}
else if( pLab < 1.4) // ns original
{
G4double Ex1 = 3.2*std::exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*std::exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
G4double Ex1 = 3.2*G4Exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*G4Exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
hpXsc = Ex1 + Ex2 + 27.5;
fElasticXsc = 6.0 + 1.4/(( pLab - 1.4)*( pLab - 1.4) + 0.1);
}
else if( pLab < 2.0 ) // ns original
{
G4double Ex1 = 3.2*std::exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*std::exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
G4double Ex1 = 3.2*G4Exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*G4Exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
hpXsc = Ex1 + Ex2 + 27.5;
fElasticXsc = 3.0 + 1.36/( (logP - 0.336)*(logP - 0.336) + 0.08);
}
else if( pLab < 3.5 ) // ns original
{
G4double Ex1 = 3.2*std::exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*std::exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
G4double Ex1 = 3.2*G4Exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*G4Exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
hpXsc = Ex1 + Ex2 + 27.5;
fElasticXsc = 3.0 + 6.20/( (logP - 0.336)*(logP - 0.336) + 0.8);
}
else if( pLab < 200. ) // my
{
hpXsc = 10.6 + 2.*std::log(pE) + 25*std::pow(pE, -0.43 ); // ns original
hpXsc = 10.6 + 2.*G4Log(pE) + 25*std::pow(pE, -0.43 ); // ns original
// hpXsc = GetHadronNucleonXscPDG(aParticle, nucleon )/millibarn;
fElasticXsc = 3.0 + 6.20/( (logP - 0.336)*(logP - 0.336) + 0.8);
}
@@ -692,56 +694,56 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
}
else if( pLab < 0.5 )
{
hnXsc = 26 + 110*(std::log(pLab/0.48))*(std::log(pLab/0.48));
hnXsc = 26 + 110*(G4Log(pLab/0.48))*(G4Log(pLab/0.48));
fElasticXsc = 0.37*hnXsc;
}
else if( pLab < 0.65 )
{
hnXsc = 26 + 110*(std::log(pLab/0.48))*(std::log(pLab/0.48));
hnXsc = 26 + 110*(G4Log(pLab/0.48))*(G4Log(pLab/0.48));
fElasticXsc = 0.95/((pLab - 0.72)*(pLab - 0.72) + 0.049);
}
else if( pLab < 0.72 )
{
hnXsc = 36.1 + 10*std::exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*std::exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
hnXsc = 36.1 + 10*G4Exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*G4Exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
fElasticXsc = 0.95/((pLab - 0.72)*(pLab - 0.72) + 0.049);
}
else if( pLab < 0.88 )
{
hnXsc = 36.1 + 10*std::exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*std::exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
hnXsc = 36.1 + 10*G4Exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*G4Exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
fElasticXsc = 0.95/((pLab - 0.72)*(pLab - 0.72) + 0.049);
}
else if( pLab < 1.03 )
{
hnXsc = 36.1 + 10*std::exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*std::exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
hnXsc = 36.1 + 10*G4Exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*G4Exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
fElasticXsc = 2.0 + 0.4/((pLab - 1.03)*(pLab - 1.03) + 0.016);
}
else if( pLab < 1.15 )
{
hnXsc = 36.1 + 10*std::exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*std::exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
hnXsc = 36.1 + 10*G4Exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*G4Exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
fElasticXsc = 2.0 + 0.4/((pLab - 1.03)*(pLab - 1.03) + 0.016);
}
else if( pLab < 1.3 )
{
hnXsc = 36.1 + 10*std::exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*std::exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
hnXsc = 36.1 + 10*G4Exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*G4Exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
fElasticXsc = 3. + 13./pLab;
}
else if( pLab < 2.6 ) // < 3.0) // ns original
{
hnXsc = 36.1 + 0.079-4.313*std::log(pLab)+
3*std::exp(-(pLab-2.1)*(pLab-2.1)/0.4/0.4)+
1.5*std::exp(-(pLab-1.4)*(pLab-1.4)/0.12/0.12);
hnXsc = 36.1 + 0.079-4.313*G4Log(pLab)+
3*G4Exp(-(pLab-2.1)*(pLab-2.1)/0.4/0.4)+
1.5*G4Exp(-(pLab-1.4)*(pLab-1.4)/0.12/0.12);
fElasticXsc = 3. + 13./pLab;
}
else if( pLab < 20. ) // < 3.0) // ns original
{
hnXsc = 36.1 + 0.079 - 4.313*std::log(pLab)+
3*std::exp(-(pLab-2.1)*(pLab-2.1)/0.4/0.4)+
1.5*std::exp(-(pLab-1.4)*(pLab-1.4)/0.12/0.12);
hnXsc = 36.1 + 0.079 - 4.313*G4Log(pLab)+
3*G4Exp(-(pLab-2.1)*(pLab-2.1)/0.4/0.4)+
1.5*G4Exp(-(pLab-1.4)*(pLab-1.4)/0.12/0.12);
fElasticXsc = 3. + 13./pLab;
}
else // mb
@@ -773,41 +775,41 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
}
else if( pLab < 0.85 )
{
G4double Ex4 = 88*(std::log(pLab/0.77))*(std::log(pLab/0.77));
G4double Ex4 = 88*(G4Log(pLab/0.77))*(G4Log(pLab/0.77));
hnXsc = Ex4 + 14.9;
fElasticXsc = hnXsc*std::exp(-3.*(pLab - 0.68));
fElasticXsc = hnXsc*G4Exp(-3.*(pLab - 0.68));
}
else if( pLab < 1.15 )
{
G4double Ex4 = 88*(std::log(pLab/0.77))*(std::log(pLab/0.77));
G4double Ex4 = 88*(G4Log(pLab/0.77))*(G4Log(pLab/0.77));
hnXsc = Ex4 + 14.9;
fElasticXsc = 6.0 + 1.4/(( pLab - 1.4)*( pLab - 1.4) + 0.1);
}
else if( pLab < 1.4) // ns original
{
G4double Ex1 = 3.2*std::exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*std::exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
G4double Ex1 = 3.2*G4Exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*G4Exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
hnXsc = Ex1 + Ex2 + 27.5;
fElasticXsc = 6.0 + 1.4/(( pLab - 1.4)*( pLab - 1.4) + 0.1);
}
else if( pLab < 2.0 ) // ns original
{
G4double Ex1 = 3.2*std::exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*std::exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
G4double Ex1 = 3.2*G4Exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*G4Exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
hnXsc = Ex1 + Ex2 + 27.5;
fElasticXsc = 3.0 + 1.36/( (logP - 0.336)*(logP - 0.336) + 0.08);
}
else if( pLab < 3.5 ) // ns original
{
G4double Ex1 = 3.2*std::exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*std::exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
G4double Ex1 = 3.2*G4Exp(-(pLab-2.55)*(pLab-2.55)/0.55/0.55);
G4double Ex2 = 12*G4Exp(-(pLab-1.47)*(pLab-1.47)/0.225/0.225);
hnXsc = Ex1 + Ex2 + 27.5;
fElasticXsc = 3.0 + 6.20/( (logP - 0.336)*(logP - 0.336) + 0.8);
}
else if( pLab < 200. ) // my
{
hnXsc = 10.6 + 2.*std::log(pE) + 25*std::pow(pE, -0.43 ); // ns original
hnXsc = 10.6 + 2.*G4Log(pE) + 25*std::pow(pE, -0.43 ); // ns original
fElasticXsc = 3.0 + 6.20/( (logP - 0.336)*(logP - 0.336) + 0.8);
}
else // pLab > 100 // my
@@ -831,55 +833,55 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
}
else if( pLab < 0.5 )
{
hpXsc = 26 + 110*(std::log(pLab/0.48))*(std::log(pLab/0.48));
hpXsc = 26 + 110*(G4Log(pLab/0.48))*(G4Log(pLab/0.48));
fElasticXsc = 0.37*hpXsc;
}
else if( pLab < 0.65 )
{
hpXsc = 26 + 110*(std::log(pLab/0.48))*(std::log(pLab/0.48));
hpXsc = 26 + 110*(G4Log(pLab/0.48))*(G4Log(pLab/0.48));
fElasticXsc = 0.95/((pLab - 0.72)*(pLab - 0.72) + 0.049);
}
else if( pLab < 0.72 )
{
hpXsc = 36.1+
10*std::exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*std::exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
10*G4Exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*G4Exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
fElasticXsc = 0.95/((pLab - 0.72)*(pLab - 0.72) + 0.049);
}
else if( pLab < 0.88 )
{
hpXsc = 36.1+
10*std::exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*std::exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
10*G4Exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*G4Exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
fElasticXsc = 0.95/((pLab - 0.72)*(pLab - 0.72) + 0.049);
}
else if( pLab < 1.03 )
{
hpXsc = 36.1+
10*std::exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*std::exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
10*G4Exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*G4Exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
fElasticXsc = 2.0 + 0.4/((pLab - 1.03)*(pLab - 1.03) + 0.016);
}
else if( pLab < 1.15 )
{
hpXsc = 36.1+
10*std::exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*std::exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
10*G4Exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*G4Exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
fElasticXsc = 2.0 + 0.4/((pLab - 1.03)*(pLab - 1.03) + 0.016);
}
else if( pLab < 1.3 )
{
hpXsc = 36.1+
10*std::exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*std::exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
10*G4Exp(-(pLab-0.72)*(pLab-0.72)/0.06/0.06)+
24*G4Exp(-(pLab-1.015)*(pLab-1.015)/0.075/0.075);
fElasticXsc = 3. + 13./pLab;
}
else if( pLab < 2.6 ) // < 3.0) // ns original
{
hpXsc = 36.1+0.079-4.313*std::log(pLab)+
3*std::exp(-(pLab-2.1)*(pLab-2.1)/0.4/0.4)+
1.5*std::exp(-(pLab-1.4)*(pLab-1.4)/0.12/0.12);
fElasticXsc = 3. +13./pLab; // *std::log(pLab*6.79);
hpXsc = 36.1+0.079-4.313*G4Log(pLab)+
3*G4Exp(-(pLab-2.1)*(pLab-2.1)/0.4/0.4)+
1.5*G4Exp(-(pLab-1.4)*(pLab-1.4)/0.12/0.12);
fElasticXsc = 3. +13./pLab; // *G4Log(pLab*6.79);
}
else // mb
{
@@ -899,14 +901,14 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
}
else if( pLab > pMax )
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
fElasticXsc = cofLogE*ld2 + 2.23;
fTotalXsc = 1.1*cofLogT*ld2 + 19.7;
}
else
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
G4double sp = std::sqrt(pLab);
G4double psp = pLab*sp;
@@ -935,7 +937,7 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
{
if( pLab > pMax )
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
fElasticXsc = cofLogE*ld2 + 2.23;
fTotalXsc = 1.1*cofLogT*ld2 + 19.7;
@@ -946,14 +948,15 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
G4double lh = pLab - 0.98;
G4double hd = lh*lh + .021;
G4double LogPlab = std::log( pLab );
G4double LogPlab = G4Log( pLab );
G4double sqrLogPlab = LogPlab * LogPlab;
fElasticXsc = // 5.2/psp + (cofLogE*ld2 + 2.23)/(1. - .7/sp + .075/p4) + .004/md
5.0 + 8.1*std::pow(pLab,-1.8 ) + 0.16*sqrLogPlab - 1.3*LogPlab + .15/hd;
fTotalXsc = // 14./psp +
// (1.1*cofLogT*ld2 + 19.5)/(1. - .21/sp + .52/p4)
25.2 + 0. *std::pow(pLab, 0. ) + 0.38*sqrLogPlab - 2.9*LogPlab
// WP 25.2 + 0. *std::pow(pLab, 0. ) + 0.38*sqrLogPlab - 2.9*LogPlab
25.2 + 0.38*sqrLogPlab - 2.9*LogPlab
// + .006/md + 0.01/hd1+ 0.02/hd2
+ 0.30/hd ;
}
@@ -970,14 +973,14 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
}
else if( pLab > pMax )
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
fElasticXsc = cofLogE*ld2 + 2.23;
fTotalXsc = cofLogT*ld2 + 19.2;
}
else
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
G4double lr = pLab - .38;
G4double LE = .7/(lr*lr + .076);
@@ -1001,14 +1004,14 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
}
else if( pLab > pMax )
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
fElasticXsc = cofLogE*ld2 + 2.23;
fTotalXsc = cofLogT*ld2 + 19.2;
}
else
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
G4double sp = std::sqrt(pLab);
G4double p2 = pLab*pLab;
@@ -1021,25 +1024,25 @@ G4HadronNucleonXsc::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle,
}
else if( theParticle == theSMinus && pORn )
{
xsection = 35.20 + B*std::pow(std::log(sMand/s0),2.)
xsection = 35.20 + B*std::pow(G4Log(sMand/s0),2.)
- 199.*std::pow(sMand,-eta1) + 264.*std::pow(sMand,-eta2);
}
else if( theParticle == theGamma && pORn ) // modify later on
{
xsection = 0.0 + B*std::pow(std::log(sMand/s0),2.)
+ 0.032*std::pow(sMand,-eta1) - 0.0*std::pow(sMand,-eta2);
xsection = 0.0 + B*std::pow(G4Log(sMand/s0),2.)
+ 0.032*std::pow(sMand,-eta1); // WP - 0.0*std::pow(sMand,-eta2);
fTotalXsc = xsection;
}
else // other then p,n,pi+,pi-,K+,K- as proton ???
{
if( proton )
{
xsection = 35.45 + B*std::pow(std::log(sMand/s0),2.)
xsection = 35.45 + B*std::pow(G4Log(sMand/s0),2.)
+ 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2);
}
if( neutron )
{
xsection += 35.80 + B*std::pow(std::log(sMand/s0),2.)
xsection += 35.80 + B*std::pow(G4Log(sMand/s0),2.)
+ 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2);
}
fTotalXsc = xsection;
@@ -1072,7 +1075,7 @@ G4HadronNucleonXsc::GetKaonNucleonXscGG(const G4DynamicParticle* aParticle,
G4double pLab = aParticle->GetMomentum().mag();
pLab /= GeV;
G4double LogPlab = std::log( pLab );
G4double LogPlab = G4Log( pLab );
G4double sqrLogPlab = LogPlab * LogPlab;
G4double minLogP = 3.5; // min of (lnP-minLogP)^2
@@ -1097,14 +1100,14 @@ G4HadronNucleonXsc::GetKaonNucleonXscGG(const G4DynamicParticle* aParticle,
}
else if( pLab > pMax )
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
fElasticXsc = cofLogE*ld2 + 2.23;
fTotalXsc = 1.1*cofLogT*ld2 + 19.7;
}
else
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
G4double sp = std::sqrt(pLab);
G4double psp = pLab*sp;
@@ -1126,7 +1129,7 @@ G4HadronNucleonXsc::GetKaonNucleonXscGG(const G4DynamicParticle* aParticle,
{
if( pLab > pMax )
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
fElasticXsc = cofLogE*ld2 + 2.23;
fTotalXsc = 1.1*cofLogT*ld2 + 19.7;
@@ -1141,7 +1144,8 @@ G4HadronNucleonXsc::GetKaonNucleonXscGG(const G4DynamicParticle* aParticle,
5.0 + 8.1*std::pow(pLab,-1.8 ) + 0.16*sqrLogPlab - 1.3*LogPlab + .15/hd;
fTotalXsc = // 14./psp +
// (1.1*cofLogT*ld2 + 19.5)/(1. - .21/sp + .52/p4)
25.2 + 0. *std::pow(pLab, 0. ) + 0.38*sqrLogPlab - 2.9*LogPlab
// WP 25.2 + 0. *std::pow(pLab, 0. ) + 0.38*sqrLogPlab - 2.9*LogPlab
25.2 + 0.38*sqrLogPlab - 2.9*LogPlab
// + .006/md + 0.01/hd1+ 0.02/hd2
+ 0.60/hd ;
}
@@ -1159,14 +1163,14 @@ G4HadronNucleonXsc::GetKaonNucleonXscGG(const G4DynamicParticle* aParticle,
}
else if( pLab > pMax )
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
fElasticXsc = cofLogE*ld2 + 2.23;
fTotalXsc = cofLogT*ld2 + 19.2;
}
else
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
G4double lr = pLab - .38;
G4double LE = .7/(lr*lr + .076);
@@ -1190,14 +1194,14 @@ G4HadronNucleonXsc::GetKaonNucleonXscGG(const G4DynamicParticle* aParticle,
}
else if( pLab > pMax )
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
fElasticXsc = cofLogE*ld2 + 2.23;
fTotalXsc = cofLogT*ld2 + 19.2;
}
else
{
G4double ld = std::log(pLab) - minLogP;
G4double ld = G4Log(pLab) - minLogP;
G4double ld2 = ld*ld;
G4double sp = std::sqrt(pLab);
G4double p2 = pLab*pLab;
@@ -1244,7 +1248,7 @@ G4HadronNucleonXsc::GetHadronNucleonXscVU(const G4DynamicParticle* aParticle,
Elab /= GeV;
Plab /= GeV;
G4double LogPlab = std::log( Plab );
G4double LogPlab = G4Log( Plab );
G4double sqrLogPlab = LogPlab * LogPlab;
G4bool pORn = (nucleon == theProton || nucleon == theNeutron );
@@ -1256,12 +1260,14 @@ G4HadronNucleonXsc::GetHadronNucleonXscVU(const G4DynamicParticle* aParticle,
{
if(proton)
{
fTotalXsc = 48.0 + 0. *std::pow(Plab, 0. ) + 0.522*sqrLogPlab - 4.51*LogPlab;
// WP fTotalXsc = 48.0 + 0. *std::pow(Plab, 0. ) + 0.522*sqrLogPlab - 4.51*LogPlab;
fTotalXsc = 48.0 + 0.522*sqrLogPlab - 4.51*LogPlab;
fElasticXsc = 11.9 + 26.9*std::pow(Plab,-1.21) + 0.169*sqrLogPlab - 1.85*LogPlab;
}
if(neutron)
{
fTotalXsc = 47.3 + 0. *std::pow(Plab, 0. ) + 0.513*sqrLogPlab - 4.27*LogPlab;
// WP fTotalXsc = 47.3 + 0. *std::pow(Plab, 0. ) + 0.513*sqrLogPlab - 4.27*LogPlab;
fTotalXsc = 47.3 + 0.513*sqrLogPlab - 4.27*LogPlab;
fElasticXsc = 11.9 + 26.9*std::pow(Plab,-1.21) + 0.169*sqrLogPlab - 1.85*LogPlab;
}
}
@@ -1314,25 +1320,31 @@ G4HadronNucleonXsc::GetHadronNucleonXscVU(const G4DynamicParticle* aParticle,
{
if(proton)
{
fTotalXsc = 18.1 + 0. *std::pow(Plab, 0. ) + 0.26 *sqrLogPlab - 1.0 *LogPlab;
// WP fTotalXsc = 18.1 + 0. *std::pow(Plab, 0. ) + 0.26 *sqrLogPlab - 1.0 *LogPlab;
fTotalXsc = 18.1 + 0.26 *sqrLogPlab - 1.0 *LogPlab;
fElasticXsc = 5.0 + 8.1*std::pow(Plab,-1.8 ) + 0.16 *sqrLogPlab - 1.3 *LogPlab;
}
if(neutron)
{
fTotalXsc = 18.7 + 0. *std::pow(Plab, 0. ) + 0.21 *sqrLogPlab - 0.89*LogPlab;
fElasticXsc = 7.3 + 0. *std::pow(Plab,-0. ) + 0.29 *sqrLogPlab - 2.4 *LogPlab;
// WP fTotalXsc = 18.7 + 0. *std::pow(Plab, 0. ) + 0.21 *sqrLogPlab - 0.89*LogPlab;
// WP fElasticXsc = 7.3 + 0. *std::pow(Plab,-0. ) + 0.29 *sqrLogPlab - 2.4 *LogPlab;
fTotalXsc = 18.7 + 0.21 *sqrLogPlab - 0.89*LogPlab;
fElasticXsc = 7.3 + 0.29 *sqrLogPlab - 2.4 *LogPlab;
}
}
else if( PDGcode ==-321 && pORn ) //------Projectile is KaonMinus ----
{
if(proton)
{
fTotalXsc = 32.1 + 0. *std::pow(Plab, 0. ) + 0.66*sqrLogPlab - 5.6*LogPlab;
fElasticXsc = 7.3 + 0. *std::pow(Plab,-0. ) + 0.29*sqrLogPlab - 2.4*LogPlab;
// WP fTotalXsc = 32.1 + 0. *std::pow(Plab, 0. ) + 0.66*sqrLogPlab - 5.6*LogPlab;
// WP fElasticXsc = 7.3 + 0. *std::pow(Plab,-0. ) + 0.29*sqrLogPlab - 2.4*LogPlab;
fTotalXsc = 32.1 + 0.66*sqrLogPlab - 5.6*LogPlab;
fElasticXsc = 7.3 + 0.29*sqrLogPlab - 2.4*LogPlab;
}
if(neutron)
{
fTotalXsc = 25.2 + 0. *std::pow(Plab, 0. ) + 0.38*sqrLogPlab - 2.9*LogPlab;
// WP fTotalXsc = 25.2 + 0. *std::pow(Plab, 0. ) + 0.38*sqrLogPlab - 2.9*LogPlab;
fTotalXsc = 25.2 + 0.38*sqrLogPlab - 2.9*LogPlab;
fElasticXsc = 5.0 + 8.1*std::pow(Plab,-1.8 ) + 0.16*sqrLogPlab - 1.3*LogPlab;
}
}
@@ -1340,29 +1352,37 @@ G4HadronNucleonXsc::GetHadronNucleonXscVU(const G4DynamicParticle* aParticle,
{
if(proton)
{
fTotalXsc = ( 18.1 + 0. *std::pow(Plab, 0. ) + 0.26 *sqrLogPlab - 1.0 *LogPlab + //K+
32.1 + 0. *std::pow(Plab, 0. ) + 0.66 *sqrLogPlab - 5.6 *LogPlab)/2; //K-
// WP fTotalXsc = ( 18.1 + 0. *std::pow(Plab, 0. ) + 0.26 *sqrLogPlab - 1.0 *LogPlab + //K+
// WP 32.1 + 0. *std::pow(Plab, 0. ) + 0.66 *sqrLogPlab - 5.6 *LogPlab)/2; //K-
fTotalXsc = ( 18.1 + 0.26 *sqrLogPlab - 1.0 *LogPlab + //K+
32.1 + 0.66 *sqrLogPlab - 5.6 *LogPlab)/2; //K-
fElasticXsc = ( 5.0 + 8.1*std::pow(Plab,-1.8 ) + 0.16 *sqrLogPlab - 1.3 *LogPlab + //K+
7.3 + 0. *std::pow(Plab,-0. ) + 0.29 *sqrLogPlab - 2.4 *LogPlab)/2; //K-
7.3 + 0.29 *sqrLogPlab - 2.4 *LogPlab)/2; //K-
// WP 7.3 + 0. *std::pow(Plab,-0. ) + 0.29 *sqrLogPlab - 2.4 *LogPlab)/2; //K-
}
if(neutron)
{
fTotalXsc = ( 18.7 + 0. *std::pow(Plab, 0. ) + 0.21 *sqrLogPlab - 0.89*LogPlab + //K+
25.2 + 0. *std::pow(Plab, 0. ) + 0.38 *sqrLogPlab - 2.9 *LogPlab)/2; //K-
fElasticXsc = ( 7.3 + 0. *std::pow(Plab,-0. ) + 0.29 *sqrLogPlab - 2.4 *LogPlab + //K+
5.0 + 8.1*std::pow(Plab,-1.8 ) + 0.16 *sqrLogPlab - 1.3 *LogPlab)/2; //K-
// WP fTotalXsc = ( 18.7 + 0. *std::pow(Plab, 0. ) + 0.21 *sqrLogPlab - 0.89*LogPlab + //K+
// WP 25.2 + 0. *std::pow(Plab, 0. ) + 0.38 *sqrLogPlab - 2.9 *LogPlab)/2; //K-
fTotalXsc = ( 18.7 + 0.21 *sqrLogPlab - 0.89*LogPlab + //K+
25.2 + 0.38 *sqrLogPlab - 2.9 *LogPlab)/2; //K-
// WP fElasticXsc = ( 7.3 + 0. *std::pow(Plab,-0. ) + 0.29 *sqrLogPlab - 2.4 *LogPlab + //K+
fElasticXsc = ( 7.3 + 0.29 *sqrLogPlab - 2.4 *LogPlab + //K+
5.0 + 8.1*std::pow(Plab,-1.8 ) + 0.16 *sqrLogPlab - 1.3 *LogPlab)/2; //K-
}
}
else //------Projectile is undefined, Nucleon assumed
{
if(proton)
{
fTotalXsc = 48.0 + 0. *std::pow(Plab, 0. ) + 0.522*sqrLogPlab - 4.51*LogPlab;
// WP fTotalXsc = 48.0 + 0. *std::pow(Plab, 0. ) + 0.522*sqrLogPlab - 4.51*LogPlab;
fTotalXsc = 48.0 + 0.522*sqrLogPlab - 4.51*LogPlab;
fElasticXsc = 11.9 + 26.9*std::pow(Plab,-1.21) + 0.169*sqrLogPlab - 1.85*LogPlab;
}
if(neutron)
{
fTotalXsc = 47.3 + 0. *std::pow(Plab, 0. ) + 0.513*sqrLogPlab - 4.27*LogPlab;
// WP fTotalXsc = 47.3 + 0. *std::pow(Plab, 0. ) + 0.513*sqrLogPlab - 4.27*LogPlab;
fTotalXsc = 47.3 + 0.513*sqrLogPlab - 4.27*LogPlab;
fElasticXsc = 11.9 + 26.9*std::pow(Plab,-1.21) + 0.169*sqrLogPlab - 1.85*LogPlab;
}
}
@@ -1455,7 +1475,7 @@ G4double G4HadronNucleonXsc::GetCoulombBarrier(const G4DynamicParticle* aParticl
/*
////////////////////////////////////////////////////////////////////////////////////
//
@@ -1532,7 +1552,7 @@ void G4HadronNucleonXsc::InitialiseKaonNucleonTotXsc()
///////////////////////////////////////////////////////
//
// K-nucleon tot xsc (mb) fit data, std::log(Tkin(MeV))
// K-nucleon tot xsc (mb) fit data, G4Log(Tkin(MeV))
const G4double G4HadronNucleonXsc::fKpProtonTotXsc[66] = {
0.000000e+00, 1.592400e-01, 3.184700e-01, 7.961800e-01, 1.433120e+00, 2.070060e+00,
@@ -1620,7 +1640,7 @@ const G4double G4HadronNucleonXsc::fKmProtonTotTkin[106] = {
4.017980e+00, 4.125840e+00, 4.179780e+00, 4.251690e+00, 4.287640e+00, 4.341570e+00,
4.395510e+00, 4.467420e+00, 4.503370e+00, 4.575280e+00, 4.683150e+00, 4.737080e+00,
4.773030e+00, 4.826970e+00, 4.880900e+00, 4.916850e+00, 4.952810e+00, 4.988760e+00,
4.988760e+00, 5.006740e+00, 5.006740e+00, 5.042700e+00, 5.078650e+00, 5.114610e+00,
4.988761e+00, 5.006740e+00, 5.006741e+00, 5.042700e+00, 5.078650e+00, 5.114610e+00,
5.132580e+00, 5.150560e+00, 5.186520e+00, 5.204490e+00, 5.276400e+00, 5.348310e+00,
5.366290e+00, 5.384270e+00, 5.456180e+00, 5.564040e+00, 5.600000e+00, 5.671910e+00,
5.743820e+00, 5.833710e+00, 5.905620e+00, 5.977530e+00, 6.085390e+00, 6.085390e+00,
@@ -1668,7 +1688,7 @@ const G4double G4HadronNucleonXsc::fKmNeutronTotTkin[68] = {
}; // 68
*/
//
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4IonProtonCrossSection.cc 66241 2012-12-13 18:34:42Z gunter $
// $Id: G4IonProtonCrossSection.cc 90447 2015-05-29 07:41:53Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -78,8 +78,8 @@ void
G4IonProtonCrossSection::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4IonProtonCrossSection calculates the inelastic cross section\n"
<< "for ions scattering from protons using inverse kinematics and\n"
<< "the Axen-Wellisch inelastic cross sections in the\n"
<< "G4ProtonInelasticCrossSection class.\n";
<< "for any ion projectile with Z >=2 only on hydrogen target.\n"
<< "It uses the inverse kinematics and the Axen-Wellisch\n"
<< "inelastic cross section (G4ProtonInelasticCrossSection).\n";
}
@@ -82,8 +82,8 @@ G4IonsKoxCrossSection::GetElementCrossSection(
G4double one_third = 1.0 / 3.0;
G4double cubicrAt = std::pow ( G4double(At) , G4double(one_third) );
G4double cubicrAp = std::pow ( G4double(Ap) , G4double(one_third) );
G4double cubicrAt = G4Pow::GetInstance()->powA ( G4double(At) , G4double(one_third) );
G4double cubicrAp = G4Pow::GetInstance()->powA ( G4double(Ap) , G4double(one_third) );
// rc divide fermi
G4double Bc = Zt * Zp / ( (rc/fermi) * (cubicrAp+cubicrAt) );
@@ -134,12 +134,12 @@ G4double G4IonsKoxCrossSection::calCeValue(const G4double ke)
G4double log10_ke = std::log10 ( ke );
if (log10_ke > 1.5)
{
Ce = - 10.0 / std::pow ( G4double(log10_ke) , G4double(5) ) + 2.0;
Ce = - 10.0 / G4Pow::GetInstance()->powA ( G4double(log10_ke) , G4double(5) ) + 2.0;
}
else
{
Ce = (-10.0/std::pow(G4double(1.5), G4double(5) ) + 2.0) /
std::pow(G4double(1.5), G4double(3)) * std::pow(G4double(log10_ke), G4double(3) );
Ce = (-10.0/G4Pow::GetInstance()->powA(G4double(1.5), G4double(5) ) + 2.0) /
G4Pow::GetInstance()->powA(G4double(1.5), G4double(3)) * G4Pow::GetInstance()->powA(G4double(log10_ke), G4double(3) );
}
return Ce;
@@ -38,7 +38,6 @@
#include "G4NucleiProperties.hh"
#include "G4HadTmpUtil.hh"
#include "G4NistManager.hh"
#include "G4Pow.hh"
G4IonsShenCrossSection::G4IonsShenCrossSection()
: G4VCrossSectionDataSet("IonsShen"),
@@ -49,10 +49,15 @@
#include "G4Log.hh"
#include "G4Exp.hh"
// factory
#include "G4CrossSectionFactory.hh"
//
G4_DECLARE_XS_FACTORY(G4KokoulinMuonNuclearXS);
G4PhysicsVector* G4KokoulinMuonNuclearXS::theCrossSection[] = {0};
G4KokoulinMuonNuclearXS::G4KokoulinMuonNuclearXS()
:G4VCrossSectionDataSet("KokoulinMuonNuclearXS"),
:G4VCrossSectionDataSet(Default_Name()),
LowestKineticEnergy(1*GeV), HighestKineticEnergy(1*PeV),
TotBin(60), CutFixed(0.2*GeV), isInitialized(false), isMaster(false)
{}
@@ -67,6 +72,19 @@ G4KokoulinMuonNuclearXS::~G4KokoulinMuonNuclearXS()
}
}
void
G4KokoulinMuonNuclearXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "G4KokoulinMuonNuclearXS provides the total inelastic\n"
<< "cross section for mu- and mu+ interactions with nuclei.\n"
<< "R. Kokoulin's approximation of the Borog and Petrukhin double\n"
<< "differential cross section at high energy and low Q**2 is integrated\n"
<< "over the muon energy loss to get the total cross section as a\n"
<< "function of muon kinetic energy\n" ;
}
G4bool
G4KokoulinMuonNuclearXS::IsElementApplicable(const G4DynamicParticle*,
G4int, const G4Material*)
@@ -78,8 +96,11 @@ void
G4KokoulinMuonNuclearXS::BuildPhysicsTable(const G4ParticleDefinition&)
{
if(!isInitialized) {
isInitialized = true;
for(G4int i=0; i<MAXZMUN; ++i) {
if(theCrossSection[i]) { return; }
}
isMaster = true;
isInitialized = true;
}
if(isMaster) { BuildCrossSectionTable(); }
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NeutronCaptureXS.cc 83697 2014-09-10 07:15:29Z gcosmo $
// $Id: G4NeutronCaptureXS.cc 91903 2015-08-10 12:10:36Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -133,9 +133,8 @@ G4NeutronCaptureXS::GetElementCrossSection(const G4DynamicParticle* aParticle,
if(ekin > emax || Z < 1 || Z >= MAXZCAPTURE) { return xs; }
if(ekin < elimit) { ekin = elimit; }
G4PhysicsVector* pv = data->GetElementData(Z);
// element was not initialised
G4PhysicsVector* pv = data->GetElementData(Z);
if(!pv) {
Initialise(Z);
pv = data->GetElementData(Z);
@@ -171,26 +170,27 @@ G4double G4NeutronCaptureXS::IsoCrossSection(G4double ekin, G4int Z, G4int A)
G4double xs = 0.0;
if(ekin < elimit) { ekin = elimit; }
G4PhysicsVector* pv = data->GetElementData(Z);
// element was not initialised
G4PhysicsVector* pv = data->GetElementData(Z);
if(!pv) {
Initialise(Z);
pv = data->GetElementData(Z);
if(!pv) { return xs; }
}
G4PhysicsVector* pviso = data->GetComponentDataByID(Z, A);
if(pviso) { pv = pviso; }
G4double e1 = pv->Energy(1);
if(ekin < e1) { xs = (*pv)[1]*std::sqrt(e1/ekin); }
else if(ekin <= pv->GetMaxEnergy()) { xs = pv->Value(ekin); }
// isotope cross section exist
if(pv && amin[Z] > 0 && A >= amin[Z] && A <= amax[Z]) {
pv = data->GetComponentDataByID(Z, A - amin[Z]);
if(pv) {
if(verboseLevel > 0){
G4double e1 = pv->Energy(1);
if(ekin < e1) { xs = (*pv)[1]*std::sqrt(e1/ekin); }
else if(ekin <= pv->GetMaxEnergy()) { xs = pv->Value(ekin); }
}
}
if(verboseLevel > 0) {
G4cout << "G4NeutronCaptureXS::IsoCrossSection: Ekin(MeV)= " << ekin/MeV
<< " xs(b)= " << xs/barn
<< " Z= " << Z << " A= " << A << " " << pv->GetVectorLength()
<< G4endl;
<< " Z= " << Z << " A= " << A << G4endl;
}
return xs;
}
@@ -198,21 +198,22 @@ G4double G4NeutronCaptureXS::IsoCrossSection(G4double ekin, G4int Z, G4int A)
G4Isotope* G4NeutronCaptureXS::SelectIsotope(const G4Element* anElement,
G4double kinEnergy)
{
G4int nIso = anElement->GetNumberOfIsotopes();
size_t nIso = anElement->GetNumberOfIsotopes();
G4IsotopeVector* isoVector = anElement->GetIsotopeVector();
G4Isotope* iso = (*isoVector)[0];
// more than 1 isotope
if(1 < nIso) {
G4int Z = G4lrint(anElement->GetZ());
if(Z >= MAXZCAPTURE) { Z = MAXZCAPTURE-1; }
G4double* abundVector = anElement->GetRelativeAbundanceVector();
G4double q = G4UniformRand();
G4double sum = 0.0;
// is there isotope wise cross section?
if(0 == amin[Z]) {
for (G4int j = 0; j<nIso; ++j) {
size_t j;
if(0 == amin[Z] || Z >= MAXZCAPTURE) {
for (j = 0; j<nIso; ++j) {
sum += abundVector[j];
if(q <= sum) {
iso = (*isoVector)[j];
@@ -220,15 +221,19 @@ G4Isotope* G4NeutronCaptureXS::SelectIsotope(const G4Element* anElement,
}
}
} else {
size_t nmax = data->GetNumberOfComponents(Z);
if(temp.size() < nmax) { temp.resize(nmax,0.0); }
for (size_t i=0; i<nmax; ++i) {
G4int A = (*isoVector)[i]->GetN();
sum += abundVector[i]*IsoCrossSection(kinEnergy, Z, A);
temp[i] = sum;
// element may be not initialised in unit test
if(!data->GetElementData(Z)) { Initialise(Z); }
size_t nn = temp.size();
if(nn < nIso) { temp.resize(nIso, 0.); }
for (j=0; j<nIso; ++j) {
sum += abundVector[j]*IsoCrossSection(kinEnergy, Z,
(*isoVector)[j]->GetN());
temp[j] = sum;
}
sum *= q;
for (size_t j = 0; j<nmax; ++j) {
for (j = 0; j<nIso; ++j) {
if(temp[j] >= sum) {
iso = (*isoVector)[j];
break;
@@ -259,7 +264,6 @@ G4NeutronCaptureXS::BuildPhysicsTable(const G4ParticleDefinition& p)
isMaster = true;
data = new G4ElementData();
data->SetName("NeutronCapture");
work.resize(13,0);
temp.resize(13,0.0);
}
@@ -289,7 +293,7 @@ G4NeutronCaptureXS::BuildPhysicsTable(const G4ParticleDefinition& p)
void
G4NeutronCaptureXS::Initialise(G4int Z, const char* p)
{
if(data->GetElementData(Z)) { return; }
if(data->GetElementData(Z) || Z < 1 || Z >= MAXZCAPTURE) { return; }
const char* path = p;
// check environment variable
@@ -310,21 +314,14 @@ G4NeutronCaptureXS::Initialise(G4int Z, const char* p)
// upload isotope data
if(amin[Z] > 0) {
size_t n = 0;
size_t i = 0;
size_t nmax = (size_t)(amax[Z]-amin[Z]+1);
if(work.size() < nmax) { work.resize(nmax,0); }
data->InitialiseForComponent(Z, nmax);
for(G4int A=amin[Z]; A<=amax[Z]; ++A) {
std::ostringstream ost1;
ost1 << path << "/cap" << Z << "_" << A;
v = RetrieveVector(ost1, false);
if(v) { ++n; }
work[i] = v;
++i;
}
data->InitialiseForComponent(Z, n);
for(size_t j=0; j<i; ++j) {
if(work[j]) { data->AddComponent(Z, amin[Z]+j, work[j]); }
data->AddComponent(Z, A, v);
}
}
}
@@ -335,13 +332,14 @@ G4NeutronCaptureXS::RetrieveVector(std::ostringstream& ost, G4bool warn)
G4PhysicsLogVector* v = 0;
std::ifstream filein(ost.str().c_str());
if (!(filein)) {
if(!warn) { return v; }
G4ExceptionDescription ed;
ed << "Data file <" << ost.str().c_str()
<< "> is not opened!";
G4Exception("G4NeutronCaptureXS::RetrieveVector(..)","had014",
FatalException, ed, "Check G4NEUTRONXSDATA");
}else{
if(warn) {
G4ExceptionDescription ed;
ed << "Data file <" << ost.str().c_str()
<< "> is not opened!";
G4Exception("G4NeutronCaptureXS::RetrieveVector(..)","had014",
FatalException, ed, "Check G4NEUTRONXSDATA");
}
} else {
if(verboseLevel > 1) {
G4cout << "File " << ost.str()
<< " is opened by G4NeutronCaptureXS" << G4endl;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NeutronElasticXS.cc 83697 2014-09-10 07:15:29Z gcosmo $
// $Id: G4NeutronElasticXS.cc 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -44,7 +44,7 @@
#include "G4ElementTable.hh"
#include "G4PhysicsLogVector.hh"
#include "G4PhysicsVector.hh"
#include "G4GlauberGribovCrossSection.hh"
#include "G4ComponentGGHadronNucleusXsc.hh"
#include "G4HadronNucleonXsc.hh"
#include "G4NistManager.hh"
#include "G4Proton.hh"
@@ -72,7 +72,7 @@ G4NeutronElasticXS::G4NeutronElasticXS()
G4cout << "G4NeutronElasticXS::G4NeutronElasticXS Initialise for Z < "
<< MAXZEL << G4endl;
}
ggXsection = new G4GlauberGribovCrossSection();
ggXsection = new G4ComponentGGHadronNucleusXsc();
fNucleon = new G4HadronNucleonXsc();
isMaster = false;
}
@@ -97,11 +97,11 @@ G4NeutronInelasticCrossSection::GetCrossSection(G4double anEnergy,
G4double part2 = 1.+ A13 - p2*(1.-1./A13);
G4double firstexp = -p4*(elog-p5);
G4double first = 1. + std::exp(firstexp);
G4double first = 1. + G4Exp(firstexp);
G4double corr = 1. + p3*(1.-1./first);
G4double secondexp= -p6*(elog-p7);
G4double secondv = 1.+std::exp(secondexp);
G4double secondv = 1.+G4Exp(secondexp);
G4double corr2 = 1./secondv;
G4double xsec = corr*corr2*part1*part2*10.*millibarn;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NeutronInelasticXS.cc 83697 2014-09-10 07:15:29Z gcosmo $
// $Id: G4NeutronInelasticXS.cc 93682 2015-10-28 10:09:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -44,7 +44,7 @@
#include "G4ElementTable.hh"
#include "G4PhysicsLogVector.hh"
#include "G4PhysicsVector.hh"
#include "G4GlauberGribovCrossSection.hh"
#include "G4ComponentGGHadronNucleusXsc.hh"
#include "G4HadronNucleonXsc.hh"
#include "G4NistManager.hh"
#include "G4Proton.hh"
@@ -99,7 +99,7 @@ G4NeutronInelasticXS::G4NeutronInelasticXS()
G4cout << "G4NeutronInelasticXS::G4NeutronInelasticXS Initialise for Z < "
<< MAXZINEL << G4endl;
}
ggXsection = new G4GlauberGribovCrossSection();
ggXsection = new G4ComponentGGHadronNucleusXsc();
fNucleon = new G4HadronNucleonXsc();
isMaster = false;
}
@@ -145,7 +145,9 @@ G4double G4NeutronInelasticXS::GetElementCrossSection(
G4double xs = 0.0;
G4double ekin = aParticle->GetKineticEnergy();
if(Z < 1 || Z >= MAXZINEL) { return xs; }
if(Z >= MAXZINEL) { Z = MAXZINEL - 1; }
else if(Z < 1) { Z = 1; }
G4int Amean = G4lrint(G4NistManager::Instance()->GetAtomicMassAmu(Z));
G4PhysicsVector* pv = data->GetElementData(Z);
@@ -186,30 +188,33 @@ G4double G4NeutronInelasticXS::GetIsoCrossSection(
const G4Isotope*, const G4Element*,
const G4Material*)
{
G4double xs = 0.0;
G4double ekin = aParticle->GetKineticEnergy();
if(Z > 0 && Z < MAXZINEL) { xs = IsoCrossSection(ekin, Z, A); }
return xs;
if(Z >= MAXZINEL) { Z = MAXZINEL - 1; }
else if(Z < 1) { Z = 1; }
return IsoCrossSection(aParticle->GetKineticEnergy(), Z, A);
}
G4double
G4NeutronInelasticXS::IsoCrossSection(G4double ekin, G4int Z, G4int A)
{
G4double xs = 0.0;
G4PhysicsVector* pv = data->GetElementData(Z);
/*
G4cout << "IsoCrossSection Z= " << Z << " A= " << A
<< " Amin= " << amin[Z] << " Amax= " << amax[Z]
<< " E(MeV)= " << ekin << G4endl;
*/
// element was not initialised
G4PhysicsVector* pv = data->GetElementData(Z);
if(!pv) {
Initialise(Z);
pv = data->GetElementData(Z);
if(!pv) { return xs; }
}
G4PhysicsVector* pviso = data->GetComponentDataByID(Z, A);
if(pviso) { pv = pviso; }
xs = pv->Value(ekin);
// isotope cross section exist
if(pv && amin[Z] > 0 && A >= amin[Z] && A <= amax[Z]) {
pv = data->GetComponentDataByIndex(Z, A - amin[Z]);
if(pv && ekin > pv->Energy(0)) { xs = pv->Value(ekin); }
}
if(verboseLevel > 0){
G4cout << "ekin= " << ekin << ", xs= " << xs << G4endl;
}
@@ -219,21 +224,25 @@ G4NeutronInelasticXS::IsoCrossSection(G4double ekin, G4int Z, G4int A)
G4Isotope* G4NeutronInelasticXS::SelectIsotope(
const G4Element* anElement, G4double kinEnergy)
{
G4int nIso = anElement->GetNumberOfIsotopes();
size_t nIso = anElement->GetNumberOfIsotopes();
G4IsotopeVector* isoVector = anElement->GetIsotopeVector();
G4Isotope* iso = (*isoVector)[0];
//G4cout << "SelectIsotope NIso= " << nIso << G4endl;
// more than 1 isotope
if(1 < nIso) {
G4int Z = G4lrint(anElement->GetZ());
if(Z >= MAXZINEL) { Z = MAXZINEL - 1; }
//G4cout << "SelectIsotope Z= " << Z << G4endl;
G4double* abundVector = anElement->GetRelativeAbundanceVector();
G4double q = G4UniformRand();
G4double sum = 0.0;
// is there isotope wise cross section?
if(0 == amin[Z]) {
for (G4int j = 0; j<nIso; ++j) {
size_t j;
if(0 == amin[Z] || Z >= MAXZINEL) {
for (j = 0; j<nIso; ++j) {
sum += abundVector[j];
if(q <= sum) {
iso = (*isoVector)[j];
@@ -241,15 +250,21 @@ G4Isotope* G4NeutronInelasticXS::SelectIsotope(
}
}
} else {
size_t nmax = data->GetNumberOfComponents(Z);
if(temp.size() < nmax) { temp.resize(nmax,0.0); }
for (size_t i=0; i<nmax; ++i) {
G4int A = (*isoVector)[i]->GetN();
sum += abundVector[i]*IsoCrossSection(kinEnergy, Z, A);
temp[i] = sum;
// element may be not initialised in unit test
if(!data->GetElementData(Z)) { Initialise(Z); }
size_t nn = temp.size();
if(nn < nIso) { temp.resize(nIso, 0.); }
for (j=0; j<nIso; ++j) {
//G4cout << j << "-th isotope " << (*isoVector)[j]->GetN()
// << " abund= " << abundVector[j] << G4endl;
sum += abundVector[j]*IsoCrossSection(kinEnergy, Z,
(*isoVector)[j]->GetN());
temp[j] = sum;
}
sum *= q;
for (size_t j = 0; j<nmax; ++j) {
for (j = 0; j<nIso; ++j) {
if(temp[j] >= sum) {
iso = (*isoVector)[j];
break;
@@ -280,7 +295,6 @@ G4NeutronInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
isMaster = true;
data = new G4ElementData();
data->SetName("NeutronInelastic");
work.resize(13,0);
temp.resize(13,0.0);
}
@@ -317,7 +331,7 @@ void
G4NeutronInelasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
const char* p)
{
if(data->GetElementData(Z)) { return; }
if(data->GetElementData(Z) || Z < 1 || Z >= MAXZINEL) { return; }
const char* path = p;
if(!p) {
// check environment variable
@@ -350,24 +364,14 @@ G4NeutronInelasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
*/
// upload isotope data
if(amin[Z] > 0) {
size_t n = 0;
size_t i = 0;
size_t nmax = (size_t)(amax[Z]-amin[Z]+1);
if(work.size() < nmax) { work.resize(nmax,0); }
data->InitialiseForComponent(Z, nmax);
for(G4int A=amin[Z]; A<=amax[Z]; ++A) {
std::ostringstream ost1;
ost1 << path << "/inelast" << Z << "_" << A;
G4PhysicsVector* v1 = RetrieveVector(ost1, false);
if(v1) { ++n; }
work[i] = v1;
++i;
}
//G4cout << " n= " << n << G4endl;
data->InitialiseForComponent(Z, n);
for(size_t j=0; j<i; ++j) {
if(work[j]) { data->AddComponent(Z, amin[Z]+j, work[j]); }
data->AddComponent(Z, A, v1);
}
}
@@ -393,13 +397,14 @@ G4NeutronInelasticXS::RetrieveVector(std::ostringstream& ost, G4bool warn)
G4PhysicsLogVector* v = 0;
std::ifstream filein(ost.str().c_str());
if (!(filein)) {
if(!warn) { return v; }
G4ExceptionDescription ed;
ed << "Data file <" << ost.str().c_str()
<< "> is not opened!";
G4Exception("G4NeutronInelasticXS::RetrieveVector(..)","had014",
FatalException, ed, "Check G4NEUTRONXSDATA");
}else{
if(warn) {
G4ExceptionDescription ed;
ed << "Data file <" << ost.str().c_str()
<< "> is not opened!";
G4Exception("G4NeutronInelasticXS::RetrieveVector(..)","had014",
FatalException, ed, "Check G4NEUTRONXSDATA");
}
} else {
if(verboseLevel > 1) {
G4cout << "File " << ost.str()
<< " is opened by G4NeutronInelasticXS" << G4endl;
@@ -39,6 +39,7 @@
#include "G4DynamicParticle.hh"
#include "G4Neutron.hh"
#include "G4Proton.hh"
#include "G4Pow.hh"
// factory
#include "G4CrossSectionFactory.hh"
@@ -649,7 +650,7 @@ Interpolate(G4int Z1, G4int Z2, G4int Z, G4double x1, G4double x2)
{
for (G4int i=0; i<92; ++i)
{
A75[i] = std::pow(A[i], alpha); // interpolate by square ~ A^(2/3)
A75[i] = G4Pow::GetInstance()->powA(A[i], alpha); // interpolate by square ~ A^(2/3)
}
NeedInit=false;
}
@@ -50,14 +50,14 @@ static const G4int nL=105; // A#of GDResonance points in E
static const G4double Emin=THmin+(nL-1)*dE; // minE for the HighE part
static const G4double Emax=50000.; // maxE for the HighE part
static const G4int nH=224; // A#of HResonance points in lnE
static const G4double milE=std::log(Emin); // Low logarithm energy for
static const G4double milE=G4Log(Emin); // Low logarithm energy for
// the HighE part
static const G4double malE=std::log(Emax); // High logarithm energy
static const G4double malE=G4Log(Emax); // High logarithm energy
// (each 2.75 percent)
static const G4double dlE=(malE-milE)/(nH-1); // Step in logarithm energy
// in the HighE part
//
//static const G4double shd=1.075-.0023*std::log(2.); // HE PomShadowing(D)
//static const G4double shd=1.075-.0023*G4Log(2.); // HE PomShadowing(D)
static const G4double shd=1.0734; // HE PomShadowing(D)
static const G4double shc=0.072; // HE Shadowing constant
static const G4double poc=0.0375; // HE Pomeron coefficient
@@ -1557,7 +1557,7 @@ G4PhotoNuclearCrossSection::GetElementCrossSection(const G4DynamicParticle* aPar
G4double Aa = nistmngr->GetAtomicMassAmu(ZZ); // average A
G4int N = (G4int)Aa - ZZ;
G4double lnA=std::log(Aa); // The nucleus is not found in DB. It is new.
G4double lnA=G4Log(Aa); // The nucleus is not found in DB. It is new.
if(Aa==1.) lastSP=1.; // The Reggeon shadowing (A=1)
else lastSP=Aa*(1.-shc*lnA); // The Reggeon shadowing
lastTH=ThresholdEnergy(ZZ, N); // Energy Threshold
@@ -1592,13 +1592,13 @@ G4PhotoNuclearCrossSection::GetElementCrossSection(const G4DynamicParticle* aPar
}
else if (Energy<Emax) // High Energy region
{
G4double lE=std::log(Energy);
G4double lE=G4Log(Energy);
sigma=EquLinearFit(lE,nH,milE,dlE,lastHEN);
}
else // UHE region (calculation, but not so frequent)
{
G4double lE=std::log(Energy);
sigma=lastSP*(poc*(lE-pos)+shd*std::exp(-reg*lE));
G4double lE=G4Log(Energy);
sigma=lastSP*(poc*(lE-pos)+shd*G4Exp(-reg*lE));
}
// End of "sigma" calculation
@@ -1663,7 +1663,7 @@ G4PhotoNuclearCrossSection::EquLinearFit(G4double X, G4int N,
return sigma;
}
// Calculate the functions for the std::log(A)
// Calculate the functions for the G4Log(A)
G4int
G4PhotoNuclearCrossSection::GetFunctions(G4double a, G4double* y, G4double* z)
@@ -29,6 +29,7 @@
#include "G4DynamicParticle.hh"
#include "G4HadronicException.hh"
#include "G4HadTmpUtil.hh"
#include "G4Pow.hh"
// factory
#include "G4CrossSectionFactory.hh"
@@ -614,7 +615,7 @@ Interpolate(G4int Z1, G4int Z2, G4int Z, G4double x1, G4double x2)
{
for (G4int i=0; i<92; ++i)
{
A75[i]=std::pow(A[i],0.75);
A75[i]=G4Pow::GetInstance()->powA(A[i],0.75);
}
NeedInit=false;
}
@@ -72,7 +72,7 @@ G4double G4ProtonInelasticCrossSection::GetProtonCrossSection(
if (kineticEnergy > thEnergy) { kineticEnergy = thEnergy; }
G4double a = nist->GetAtomicMassAmu(Z);
G4double a13 = std::pow(a,-0.3333333333);
G4double a13 = G4Pow::GetInstance()->powA(a,-0.3333333333);
G4int nOfNeutrons = G4lrint(a) - Z;
kineticEnergy /=GeV;
G4double alog10E = std::log10(kineticEnergy);
@@ -83,18 +83,18 @@ G4double G4ProtonInelasticCrossSection::GetProtonCrossSection(
G4double b0 = 2.247-0.915*(1 - a13);
G4double fac1 = b0*(1 - a13);
G4double fac2 = 1.;
if(nOfNeutrons > 1) { fac2=std::log((G4double(nOfNeutrons))); }
if(nOfNeutrons > 1) { fac2=G4Log((G4double(nOfNeutrons))); }
G4double crossSection = 1.0E31*fac*fac2*(1. + 1./a13 - fac1);
// high energy correction
crossSection *= (1 - 0.15*std::exp(-kineticEnergy))/(1.0 - 0.0007*a);
crossSection *= (1 - 0.15*G4Exp(-kineticEnergy))/(1.0 - 0.0007*a);
// first try on low energies: rise
G4double ff1= 0.70-0.002*a; // slope of the drop at medium energies.
G4double ff2= 1.00+1/a; // start of the slope.
G4double ff3= 0.8+18/a-0.002*a; // stephight
G4double ff4= 1.0 - (1.0/(1+std::exp(-8*ff1*(alog10E + 1.37*ff2))));
G4double ff4= 1.0 - (1.0/(1+G4Exp(-8*ff1*(alog10E + 1.37*ff2))));
crossSection *= (1 + ff3*ff4);
@@ -105,6 +105,6 @@ G4double G4ProtonInelasticCrossSection::GetProtonCrossSection(
ff4=-8.*ff1*(alog10E + 2.0*ff2);
crossSection *= millibarn/(1. + std::exp(ff4));
crossSection *= millibarn/(1. + G4Exp(ff4));
return crossSection;
}
@@ -86,9 +86,9 @@ GetElementCrossSection(const G4DynamicParticle* aPart, G4int ZZ,
if(E_cm <= DBL_MIN) { return result; }
// done
G4double r_rms_p = 0.6 * myNuleonRadius *
std::pow(projectileAtomicNumber, 1./3.);
G4Pow::GetInstance()->powA(projectileAtomicNumber, 1./3.);
G4double r_rms_t = 0.6 * myNuleonRadius *
std::pow(targetAtomicNumber, 1./3.);
G4Pow::GetInstance()->powA(targetAtomicNumber, 1./3.);
// done
G4double r_p = 1.29*r_rms_p/nuleonRadius ;
@@ -96,8 +96,8 @@ GetElementCrossSection(const G4DynamicParticle* aPart, G4int ZZ,
// done
G4double Radius = r_p + r_t +
1.2*(std::pow(targetAtomicNumber, 1./3.) +
std::pow(projectileAtomicNumber, 1./3.))/std::pow(E_cm, 1./3.);
1.2*(G4Pow::GetInstance()->powA(targetAtomicNumber, 1./3.) +
G4Pow::GetInstance()->powA(projectileAtomicNumber, 1./3.))/G4Pow::GetInstance()->powA(E_cm, 1./3.);
//done
G4double B = 1.44*nProjProtons*nTargetProtons/Radius;
@@ -123,7 +123,7 @@ GetElementCrossSection(const G4DynamicParticle* aPart, G4int ZZ,
{
D = 2.77-(8.0E-3*targetAtomicNumber)+
(1.8E-5*targetAtomicNumber*targetAtomicNumber)
- 0.8/(1+std::exp((250.-Energy)/75.));
- 0.8/(1+G4Exp((250.-Energy)/75.));
}
else
{
@@ -136,24 +136,24 @@ GetElementCrossSection(const G4DynamicParticle* aPart, G4int ZZ,
D = 1.75;
}
// done
G4double C_E = D * (1-std::exp(-Energy/40.)) -
0.292*std::exp(-Energy/792.)*std::cos(0.229*std::pow(Energy, 0.453));
G4double C_E = D * (1-G4Exp(-Energy/40.)) -
0.292*G4Exp(-Energy/792.)*std::cos(0.229*G4Pow::GetInstance()->powA(Energy, 0.453));
// done
G4double S = std::pow(projectileAtomicNumber, 1./3.)*
std::pow(targetAtomicNumber, 1./3.)/
(std::pow(projectileAtomicNumber, 1./3.) +
std::pow(targetAtomicNumber, 1./3.));
G4double S = G4Pow::GetInstance()->powA(projectileAtomicNumber, 1./3.)*
G4Pow::GetInstance()->powA(targetAtomicNumber, 1./3.)/
(G4Pow::GetInstance()->powA(projectileAtomicNumber, 1./3.) +
G4Pow::GetInstance()->powA(targetAtomicNumber, 1./3.));
// done
G4double deltaE = 1.85*S + 0.16*S/std::pow(E_cm,1./3.) - C_E +
G4double deltaE = 1.85*S + 0.16*S/G4Pow::GetInstance()->powA(E_cm,1./3.) - C_E +
0.91*(targetAtomicNumber-2.*nTargetProtons)*nProjProtons/
(targetAtomicNumber*projectileAtomicNumber);
// done
result = pi * nuleonRadius*nuleonRadius *
std::pow(( std::pow(targetAtomicNumber, 1./3.) +
std::pow(projectileAtomicNumber, 1./3.) + deltaE),2.) *
G4Pow::GetInstance()->powA(( G4Pow::GetInstance()->powA(targetAtomicNumber, 1./3.) +
G4Pow::GetInstance()->powA(projectileAtomicNumber, 1./3.) + deltaE),2.) *
(1-B/E_cm);
if(result < 0.) { result = 0.; }
@@ -184,15 +184,15 @@ G4TripathiLightCrossSection::GetElementCrossSection(const G4DynamicParticle* the
if ((AT==1 && ZT==1) || (AP==1 && ZP==1)) {
T1 = 23.0;
D = 1.85 + 0.16/(1+std::exp((500.0-E)/200.0));
D = 1.85 + 0.16/(1+G4Exp((500.0-E)/200.0));
} else if ((AT==1 && ZT==0) || (AP==1 && ZP==0)) {
T1 = 18.0;
D = 1.85 + 0.16/(1+std::exp((500.0-E)/200.0));
D = 1.85 + 0.16/(1+G4Exp((500.0-E)/200.0));
} else if ((AT==2 && ZT==1) || (AP==2 && ZP==1)) {
T1 = 23.0;
D = 1.65 + 0.1/(1+std::exp((500.0-E)/200.0));
D = 1.65 + 0.1/(1+G4Exp((500.0-E)/200.0));
} else if ((AT==3 && ZT==2) || (AP==3 && ZP==2)) {
T1 = 40.0;
@@ -205,7 +205,7 @@ G4TripathiLightCrossSection::GetElementCrossSection(const G4DynamicParticle* the
else if (ZT==13) {T1 = 25.0; G = 300.0;}
else if (ZT==26) {T1 = 40.0; G = 300.0;}
else {T1 = 40.0; G = 75.0;}
D = 2.77 - 8.0E-3*AT + 1.8E-5*AT*AT-0.8/(1.0+std::exp((250.0-E)/G));
D = 2.77 - 8.0E-3*AT + 1.8E-5*AT*AT-0.8/(1.0+G4Exp((250.0-E)/G));
}
else if (AT==4 && ZT==2) {
if (AP==4 && ZP==2) {T1 = 40.0; G = 300.0;}
@@ -214,15 +214,15 @@ G4TripathiLightCrossSection::GetElementCrossSection(const G4DynamicParticle* the
else if (ZP==13) {T1 = 25.0; G = 300.0;}
else if (ZP==26) {T1 = 40.0; G = 300.0;}
else {T1 = 40.0; G = 75.0;}
D = 2.77 - 8.0E-3*AP + 1.8E-5*AP*AP-0.8/(1.0+std::exp((250.0-E)/G));
D = 2.77 - 8.0E-3*AP + 1.8E-5*AP*AP-0.8/(1.0+G4Exp((250.0-E)/G));
}
// C_E, S, deltaE, X1, S_L and X_m correspond directly with the original
// formulae of Tripathi et al in his report.
//G4cout << "E= " << E << " T1= " << T1 << " AP= " << AP << " ZP= " << ZP
// << " AT= " << AT << " ZT= " << ZT << G4endl;
G4double C_E = D*(1.0-std::exp(-E/T1)) -
0.292*std::exp(-E/792.0)*std::cos(0.229*std::pow(E,0.453));
G4double C_E = D*(1.0-G4Exp(-E/T1)) -
0.292*G4Exp(-E/792.0)*std::cos(0.229*G4Pow::GetInstance()->powA(E,0.453));
G4double S = AP13*AT13/(AP13 + AT13);
@@ -238,9 +238,9 @@ G4TripathiLightCrossSection::GetElementCrossSection(const G4DynamicParticle* the
deltaE = 1.85*S + 0.16*S/E_cm13 - C_E + 0.91*(AP-2*ZP)*ZT/(xAT*xAP);
X1 = 2.83 - 3.1E-2*AP + 1.7E-4*AP*AP;
}
G4double S_L = 1.2 + 1.6*(1.0-std::exp(-E/15.0));
G4double S_L = 1.2 + 1.6*(1.0-G4Exp(-E/15.0));
//JMQ 241110 bug fixed
G4double X_m = 1.0 - X1*std::exp(-E/(X1*S_L));
G4double X_m = 1.0 - X1*G4Exp(-E/(X1*S_L));
//G4cout << "deltaE= " << deltaE << " X1= " << X1 << " S_L= " << S_L << " X_m= " << X_m << G4endl;
@@ -58,7 +58,7 @@ G4UPiNuclearCrossSection::G4UPiNuclearCrossSection()
elowest = MeV;
G4NistManager* nist = G4NistManager::Instance();
for(G4int i=1; i<93; ++i) {
APower[i] = std::pow(nist->GetAtomicMassAmu(i),aPower);
APower[i] = G4Pow::GetInstance()->powA(nist->GetAtomicMassAmu(i),aPower);
}
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VCrossSectionDataSet.cc 66241 2012-12-13 18:34:42Z gunter $
// $Id: G4VCrossSectionDataSet.cc 89024 2015-03-18 08:17:25Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -54,12 +54,13 @@
G4VCrossSectionDataSet::G4VCrossSectionDataSet(const G4String& nam) :
verboseLevel(0),minKinEnergy(0.0),maxKinEnergy(100*TeV),name(nam)
{
G4CrossSectionDataSetRegistry::Instance()->Register(this);
registry = G4CrossSectionDataSetRegistry::Instance();
registry->Register(this);
}
G4VCrossSectionDataSet::~G4VCrossSectionDataSet()
{
G4CrossSectionDataSetRegistry::Instance()->DeRegister(this);
registry->DeRegister(this);
}
G4bool
@@ -23,74 +23,62 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ZeroXS.cc 79981 2014-03-27 15:24:11Z gcosmo $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4NeutronHPBGGNucleonInelasticXS
// File name: G4ZeroXS
//
// Author: KOI, Tatsumi
// Author: Tatsumi Koi
//
// Creation date: 22.03.2012
// Creation date: 26.10.2015
// Modifications:
//
//
// -------------------------------------------------------------------
//
#include "G4NeutronHPBGGNucleonInelasticXS.hh"
#include "G4SystemOfUnits.hh"
/*
#include "G4GlauberGribovCrossSection.hh"
#include "G4NucleonNuclearCrossSection.hh"
#include "G4HadronNucleonXsc.hh"
*/
#include "G4HadronInelasticDataSet.hh"
/*
#include "G4Proton.hh"
#include "G4Neutron.hh"
#include "G4NistManager.hh"
#include "G4Material.hh"
#include "G4Element.hh"
#include "G4Isotope.hh"
*/
#include "G4ZeroXS.hh"
#include "G4CrossSectionDataSetRegistry.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4NeutronHPBGGNucleonInelasticXS::G4NeutronHPBGGNucleonInelasticXS(const G4ParticleDefinition* p)
: G4BGGNucleonInelasticXS( p )
{
fLowEnergyLimitForHPN = 20*MeV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4NeutronHPBGGNucleonInelasticXS::~G4NeutronHPBGGNucleonInelasticXS()
G4ZeroXS::G4ZeroXS()
: G4VCrossSectionDataSet("ZeroXS")
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool G4NeutronHPBGGNucleonInelasticXS::IsElementApplicable(const G4DynamicParticle* dp,
G4int Z,
const G4Material*)
G4ZeroXS::~G4ZeroXS()
{
if ( dp->GetKineticEnergy() < fLowEnergyLimitForHPN ) return false;
return (1 < Z);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool G4NeutronHPBGGNucleonInelasticXS::IsIsoApplicable(const G4DynamicParticle* dp,
G4int Z, G4int A,
const G4Element*,
const G4Material*)
G4bool
G4ZeroXS::IsElementApplicable(const G4DynamicParticle*, G4int,
const G4Material*)
{
if ( dp->GetKineticEnergy() < fLowEnergyLimitForHPN ) return false;
return (1 == Z && 2 >= A);
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double
G4ZeroXS::GetElementCrossSection(const G4DynamicParticle* ,
G4int , const G4Material*)
{
return 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4ZeroXS::CrossSectionDescription(std::ostream& outFile) const
{
outFile << "An artificial cross section data set which always replys zero.";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

Some files were not shown because too many files have changed in this diff Show More