Import Geant4 9.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:46:55 +02:00
parent 89a9605df1
commit b1eb5424d2
10957 changed files with 888481 additions and 160139 deletions
@@ -7,7 +7,7 @@
#
# Generated on : 24/9/2010
#
# $Id: CMakeLists.txt,v 1.1 2010/09/29 18:58:05 bmorgan Exp $
# $Id: CMakeLists.txt,v 1.1 2010-09-29 18:58:05 bmorgan Exp $
#
#------------------------------------------------------------------------------
@@ -10,6 +10,7 @@ endif
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += -DG4HADRONIC_ALLOC_EXPORT
CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/HEPGeometry/include \
@@ -1,7 +1,7 @@
==========================================================
=--------------------------------------------------------=
Geant4 - an Object-Oriented Toolkit for Physics Simulation
==========================================================
=--------------------------------------------------------=
History file for hadronic/models/chiral_inv_phase_space/interface
@@ -12,6 +12,50 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
04-Oct-2011 Dennis Wright (hadr-chips-inter-V09-04-04)
---------------------------------------------------------------------------
- integer Z and A migration: change GetZ to GetZ_asInt and GetN to
GetA_asInt for instances of G4Nucleus, for the following files:
G4ProtonAntiProtonAtRestChips.hh
G4ElectroNuclearReaction.hh
G4ProtonAntiProtonReaction.hh
G4PionMinusNuclearAtRestChips.hh
09-Sep-2011 M.Kelsey (hadr-chips-inter-V09-04-03)
---------------------------------------------------------------------------
- G4ElectroNuclearReaction.hh: Follow migration of G4HadFinalState interface
in hadr-util-V09-04-02 when merging output of HE and LE models.
06-Sep-2011 J.Apostolakis (hadr-chips-inter-V09-04-02)
---------------------------------------------------------------------------
- Deleted dead-code, which existed since version 8.0 in
G4StringChipsParticleLevelInterface and
G4QStringChipsParticleLevelInterface
- G4StringChipsInterface: Removed 'new' of G4ReactionProduct which was
not used (overwritten before use). The old code, as a result, leaked
memory. This leak is fixed.
Note: The classes were used in physics lists as follows:
G4QStringChipsParticleLevelInterface: FTFC, QGSC_EFLOW, QGSC_CHIPS.
G4QStringChipsParticleLevelInterface: QGSC and QGSC_QGSC.
G4StringChipsInterface: Not used
(only in tests 19/29/39/49)
02-Aug-2011 Dennis Wright (hadr-chips-inter-V09-04-01)
---------------------------------------------------------------------------
- Add Description() method to classes
G4ElectroNuclearReaction
G4GammaNuclearReaction
G4QHadronElasticDataSet
G4QHadronInelasticDataSet
for html physics list documentation
14-Apr-2011 J.Apostolakis + M.Kosov (hadr-chips-inter-V09-04-00)
---------------------------------------------------------------------------
- G4QHadron(Elastic/Inelastic)DataSet: add "return 0" for missing hadrons
- G4ElectronNuclearReaction.hh: destructor improvement (more delete's)
18-Nov-2010 J.Apostolakis (hadr-chips-inter-V09-03-03)
---------------------------------------------------------------------------
- G4ChiralInvariantPhaseSpace.cc: Change to use integer value of Z and A.
@@ -23,15 +23,17 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ElectroNuclearReaction.hh,v 1.28 2010/11/10 16:20:11 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4ElectroNuclearReaction.hh,v 1.28 2010-11-10 16:20:11 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// GEANT4 physics class: G4ElectroNuclearReaction -- header file for CHIPS
// Class description:
// G4ElectroNuclearReaction = eA interface to use CHIPS in the G4Hadronic frame
// Created: J.P. Wellisch, following M. Kossov's algorithm. 12/11/2001
// The last update: J.P. Wellisch, 06-June-02
// 17.02.2009 M.Kossov, now it is recommended to use the G4QCollision process
// 10.11.2010 V.Ivanchenko use cross sections by pointer and not by value
//
// 07.09.2011 M.Kelsey, follow changes to G4HadFinalState interface
#ifndef G4ElectroNuclearReaction_h
#define G4ElectroNuclearReaction_h 1
@@ -52,12 +54,13 @@
#include "G4TheoFSGenerator.hh"
#include "G4GeneratorPrecompoundInterface.hh"
#include "G4ExcitedStringDecay.hh"
#include <iostream>
class G4ElectroNuclearReaction : public G4HadronicInteraction
{
public:
G4ElectroNuclearReaction():G4HadronicInteraction("CHIPS")
G4ElectroNuclearReaction():G4HadronicInteraction("CHIPSElectroNuclear")
{
SetMinEnergy(0*GeV);
SetMaxEnergy(30*TeV);
@@ -72,32 +75,74 @@ public:
theHEModel->SetMaxEnergy(100*TeV);
theElectronData = new G4ElectroNuclearCrossSection;
thePhotonData = new G4PhotoNuclearCrossSection;
Description();
}
virtual ~G4ElectroNuclearReaction() {delete theStringDecay;};
~G4ElectroNuclearReaction()
{
delete theHEModel;
delete theCascade;
delete theStringDecay;
delete theElectronData;
delete thePhotonData;
}
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& aTargetNucleus);
G4HadFinalState*
ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& aTargetNucleus);
void Description() const
{
char* dirName = getenv("G4PhysListDocDir");
if (dirName) {
std::ofstream outFile;
G4String outFileName = GetModelName() + ".html";
G4String pathName = G4String(dirName) + "/" + outFileName;
outFile.open(pathName);
outFile << "<html>\n";
outFile << "<head>\n";
outFile << "<title>Description of CHIPS ElectroNuclear Model</title>\n";
outFile << "</head>\n";
outFile << "<body>\n";
outFile << "G4ElectroNuclearReaction handles the inelastic scattering\n"
<< "of e- and e+ from nuclei using the Chiral Invariant Phase\n"
<< "Space (CHIPS) model of M. Kossov. This model uses the\n"
<< "Equivalent Photon Approximation in which the incoming\n"
<< "electron generates a virtual photon at the electromagnetic\n"
<< "vertex, and the virtual photon is converted to a real photon\n"
<< "before it interacts with the nucleus. The real photon\n"
<< "interacts with the hadrons in the target by producing\n"
<< "quasmons (or generalized excited hadrons) which then decay\n"
<< "into final state hadrons. This model is valid for e- and\n"
<< "e+ of all incident energies.\n";
outFile << "</body>\n";
outFile << "</html>\n";
outFile.close();
}
}
private:
G4ChiralInvariantPhaseSpace theLEModel;
G4TheoFSGenerator * theHEModel;
G4GeneratorPrecompoundInterface * theCascade;
G4QGSModel< G4GammaParticipants > theStringModel;
G4QGSMFragmentation theFragmentation;
G4ExcitedStringDecay * theStringDecay;
G4ElectroNuclearCrossSection* theElectronData;
G4PhotoNuclearCrossSection* thePhotonData;
G4HadFinalState theResult;
G4ChiralInvariantPhaseSpace theLEModel;
G4TheoFSGenerator* theHEModel;
G4GeneratorPrecompoundInterface* theCascade;
G4QGSModel<G4GammaParticipants> theStringModel;
G4QGSMFragmentation theFragmentation;
G4ExcitedStringDecay* theStringDecay;
G4ElectroNuclearCrossSection* theElectronData;
G4PhotoNuclearCrossSection* thePhotonData;
G4HadFinalState theResult;
};
inline
inline
G4HadFinalState* G4ElectroNuclearReaction::ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& aTargetNucleus)
G4Nucleus& aTargetNucleus)
{
theResult.Clear();
static const G4double dM=G4Proton::Proton()->GetPDGMass()+
static const G4double dM=G4Proton::Proton()->GetPDGMass() +
G4Neutron::Neutron()->GetPDGMass(); // MeanDoubleNucleon Mass = m_n+m_p (@@ no binding)
static const G4double me=G4Electron::Electron()->GetPDGMass(); // electron mass
static const G4double me2=me*me; // squared electron mass
@@ -110,24 +155,21 @@ G4HadFinalState* G4ElectroNuclearReaction::ApplyYourself(const G4HadProjectile&
"G4ElectroNuclearReaction::ApplyYourself called for neither electron or positron");
const G4ElementTable* aTab = G4Element::GetElementTable();
G4Element * anElement = 0;
G4int aZ = static_cast<G4int>(aTargetNucleus.GetZ()+.1);
for(size_t ii=0; ii<aTab->size(); ii++)
G4int aZ = static_cast<G4int>(aTargetNucleus.GetZ_asInt()+.1);
for(size_t ii=0; ii<aTab->size(); ++ii) if ( std::abs((*aTab)[ii]->GetZ()-aZ) < .1)
{
if ( std::abs((*aTab)[ii]->GetZ()-aZ) < .1)
{
anElement = (*aTab)[ii];
break;
}
anElement = (*aTab)[ii];
break;
}
if(0==anElement)
{
G4cerr<<"***G4ElectroNuclearReaction::ApplyYourself: element with Z="
<<aTargetNucleus.GetZ()<<" is not in the element table"<<G4endl;
<<aTargetNucleus.GetZ_asInt()<<" is not in the element table"<<G4endl;
throw G4HadronicException(__FILE__, __LINE__, "Anomalous element error.");
}
// Note: high energy gamma nuclear now implemented.
G4double xSec = theElectronData->GetCrossSection(theElectron, anElement);// Check XSection
G4double xSec = theElectronData->GetCrossSection(theElectron, anElement);// Check out XS
if(xSec<=0.)
{
theResult.SetStatusChange(isAlive);
@@ -161,16 +203,16 @@ G4HadFinalState* G4ElectroNuclearReaction::ApplyYourself(const G4HadProjectile&
// new direction for the electron
theResult.SetMomentumChange(theElectron->GetMomentumDirection());
return &theResult; // DO-NOTHING condition
throw G4HadronicException(__FILE__, __LINE__,
"G4ElectroNuclearReaction::ApplyYourself: negative equivalent energy");
// throw G4HadronicException(__FILE__, __LINE__,
// "G4ElectroNuclearReaction::ApplyYourself: negative equivalent energy");
}
G4DynamicParticle* theDynamicPhoton = new
G4DynamicParticle(G4Gamma::GammaDefinition(),
G4ParticleMomentum(1.,0.,0.), photonEnergy*MeV); //----->-*
G4ParticleMomentum(1.,0.,0.), photonEnergy*MeV); //----->-*
G4double sigNu=thePhotonData->GetCrossSection(theDynamicPhoton, anElement); // |
theDynamicPhoton->SetKineticEnergy(W); // Redefine photon with equivalent energy |
theDynamicPhoton->SetKineticEnergy(W); // Redefine photon with equivalent energy |
G4double sigK =thePhotonData->GetCrossSection(theDynamicPhoton, anElement); // |
delete theDynamicPhoton; // <-------------------------------------------------------*
delete theDynamicPhoton; // <--------------------------------------------------------*
G4double rndFraction = theElectronData->GetVirtualFactor(photonEnergy, photonQ2);
if(sigNu*G4UniformRand()>sigK*rndFraction)
{
@@ -189,7 +231,7 @@ G4HadFinalState* G4ElectroNuclearReaction::ApplyYourself(const G4HadProjectile&
G4double iniP=std::sqrt(iniE*iniE-me2); // Initial momentum of the electron
G4double finP=std::sqrt(finE*finE-me2); // Final momentum of the electron
G4double cost=(EEm+EEm-photonQ2)/iniP/finP;// std::cos(theta) for the electron scattering
if(cost>1.) cost=1.;
if(cost> 1.) cost= 1.;
if(cost<-1.) cost=-1.;
G4ThreeVector dir=theElectron->GetMomentumDirection(); // Direction of primary electron
G4ThreeVector ort=dir.orthogonal(); // Not normed orthogonal vector (!) (to dir)
@@ -208,19 +250,13 @@ G4HadFinalState* G4ElectroNuclearReaction::ApplyYourself(const G4HadProjectile&
G4ThreeVector position(0,0,0);
G4HadProjectile localTrack(localGamma);
G4HadFinalState * result;
if(photonEnergy < 3*GeV)
{
if (photonEnergy < 3*GeV)
result = theLEModel.ApplyYourself(localTrack, aTargetNucleus, &theResult);
}
else
{
else {
// G4cout << "0) Getting a high energy electro-nuclear reaction"<<G4endl;
G4HadFinalState * aResult = theHEModel->ApplyYourself(localTrack, aTargetNucleus);
for(G4int all = 0; all < aResult->GetNumberOfSecondaries(); all++)
{
theResult.AddSecondary(aResult->GetSecondary(all));
}
aResult->SecondariesAreStale();
theResult.AddSecondaries(aResult);
aResult->Clear();
result = &theResult;
}
return result;
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4GammaNuclearReaction.hh,v 1.15 2009/02/23 09:49:24 mkossov Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4GammaNuclearReaction.hh,v 1.15 2009-02-23 09:49:24 mkossov Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
// GEANT4 physics class: G4GammaNuclearReaction - header file for CHIPS
@@ -41,21 +41,23 @@
#include "G4HadronicInteraction.hh"
#include "G4ChiralInvariantPhaseSpace.hh"
class G4GammaNuclearReaction : public G4HadronicInteraction
{
public:
public:
G4GammaNuclearReaction();
G4GammaNuclearReaction(const G4String& name = "CHIPSGammaNuclear");
virtual ~G4GammaNuclearReaction();
virtual ~G4GammaNuclearReaction();
virtual G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& aTargetNucleus);
virtual G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& aTargetNucleus);
private:
void Description() const;
G4ChiralInvariantPhaseSpace theModel;
private:
G4ChiralInvariantPhaseSpace theModel;
};
#endif
@@ -85,8 +85,8 @@ AtRestDoIt(const G4Track& aTrack, const G4Step&aStep)
}
// Create target
G4Element * theTarget = theSelector.GetElement(aTrack.GetMaterial());
G4Nucleus aTargetNucleus(theTarget->GetN() ,theTarget->GetZ());
G4Element* theTarget = theSelector.GetElement(aTrack.GetMaterial());
G4Nucleus aTargetNucleus(theTarget->GetA_asInt(), theTarget->GetZ_asInt());
// Call chips
return theModel.ApplyYourself(aTrack, aTargetNucleus);
@@ -88,7 +88,7 @@ AtRestDoIt(const G4Track& aTrack, const G4Step&aStep)
{
// Create target
G4Element * theTarget = theSelector.GetElement(aTrack.GetMaterial());
G4Nucleus aTargetNucleus(theTarget->GetN() ,theTarget->GetZ());
G4Nucleus aTargetNucleus(theTarget->GetA_asInt(), theTarget->GetZ_asInt());
// Check model validity - note this will be a sub-branch in the ordinary stopping @@@@@@
// in the long haul. @@@@@@
@@ -97,7 +97,7 @@ AtRestDoIt(const G4Track& aTrack, const G4Step&aStep)
throw G4HadronicException(__FILE__, __LINE__,
"Calling G4ProtonAntiProtonAtRestChips with particle other than p-bar!!!");
}
if(aTargetNucleus.GetZ() != 1)
if(aTargetNucleus.GetZ_asInt() != 1)
{
throw G4HadronicException(__FILE__, __LINE__,
"Calling G4ProtonAntiProtonAtRestChips for target other than Hydrogen!!!");
@@ -51,7 +51,7 @@ ApplyYourself(const G4Track& aTrack, G4Nucleus& aTargetNucleus)
{
throw G4HadronicException(__FILE__, __LINE__, "Calling G4ProtonAntiProtonReaction with particle other than p-bar!!!");
}
if(aTargetNucleus.GetZ() != 1)
if(aTargetNucleus.GetZ_asInt() != 1)
{
throw G4HadronicException(__FILE__, __LINE__, "Calling G4ProtonAntiProtonReaction for target other than Hydrogen!!!");
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4QHadronElasticDataSet.hh,v 1.2 2010/02/16 07:53:05 mkossov Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4QHadronElasticDataSet.hh,v 1.2 2010-02-16 07:53:05 mkossov Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// GEANT4 physics class: G4QHadronElasticDataSet -- header file
// Created by M. Kosov (Mikhail.Kossov@cern.ch) 21.01.10
@@ -78,23 +78,34 @@
class G4QHadronElasticDataSet : public G4VCrossSectionDataSet
{
public:
public:
G4QHadronElasticDataSet();
~G4QHadronElasticDataSet() {}
G4bool IsApplicable(const G4DynamicParticle* aParticle, const G4Element* anElement);
G4bool IsZAApplicable(const G4DynamicParticle* aParticle, G4double Z, G4double A);
G4double GetCrossSection(const G4DynamicParticle* Part, const G4Element* El, G4double T);
G4double GetIsoZACrossSection(const G4DynamicParticle* P,G4double Z,G4double A,G4double);
void BuildPhysicsTable(const G4ParticleDefinition&){}
void DumpPhysicsTable(const G4ParticleDefinition&) {}
G4QHadronElasticDataSet(const G4String& name = "CHIPSElasticXS");
~G4QHadronElasticDataSet() {}
G4bool IsApplicable(const G4DynamicParticle* aParticle,
const G4Element* anElement);
G4bool IsZAApplicable(const G4DynamicParticle* aParticle,
G4double Z, G4double A);
G4double GetCrossSection(const G4DynamicParticle* Part,
const G4Element* El, G4double T);
G4double GetIsoZACrossSection(const G4DynamicParticle* P,
G4double Z,G4double A,G4double);
void BuildPhysicsTable(const G4ParticleDefinition&){}
void DumpPhysicsTable(const G4ParticleDefinition&) {}
private:
void Description() const;
G4QIsotope* Isotopes; // Pointer to the G4QIsotopes singleton
static std::vector <G4int> ElementZ; // Z of the element(i) in theLastCalc
static std::vector <std::vector<G4int>*> ElIsoN; // N of isotope(j) of Element(i)
static std::vector <std::vector<G4double>*> IsoProbInEl;// SumProbabIsotopes in Element i
private:
G4QIsotope* Isotopes; // Pointer to the G4QIsotopes singleton
static std::vector <G4int> ElementZ;
// Z of the element(i) in theLastCalc
static std::vector <std::vector<G4int>*> ElIsoN;
// N of isotope(j) of Element(i)
static std::vector <std::vector<G4double>*> IsoProbInEl;
// SumProbabIsotopes in Element i
};
#endif
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4QHadronInelasticDataSet.hh,v 1.2 2010/01/22 17:02:49 mkossov Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4QHadronInelasticDataSet.hh,v 1.2 2010-01-22 17:02:49 mkossov Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// GEANT4 physics class: G4QHadronInelasticDataSet -- header file
// Created by M. Kosov (Mikhail.Kossov@cern.ch) 11.11.09
@@ -103,23 +103,34 @@
class G4QHadronInelasticDataSet : public G4VCrossSectionDataSet
{
public:
public:
G4QHadronInelasticDataSet();
~G4QHadronInelasticDataSet() {}
G4bool IsApplicable(const G4DynamicParticle* aParticle, const G4Element* anElement);
G4bool IsZAApplicable(const G4DynamicParticle* aParticle, G4double Z, G4double A);
G4double GetCrossSection(const G4DynamicParticle* Part, const G4Element* El, G4double T);
G4double GetIsoZACrossSection(const G4DynamicParticle* P,G4double Z,G4double A,G4double);
void BuildPhysicsTable(const G4ParticleDefinition&){}
void DumpPhysicsTable(const G4ParticleDefinition&) {}
G4QHadronInelasticDataSet(const G4String& name = "CHIPSInelasticXS");
~G4QHadronInelasticDataSet() {}
G4bool IsApplicable(const G4DynamicParticle* aParticle,
const G4Element* anElement);
G4bool IsZAApplicable(const G4DynamicParticle* aParticle,
G4double Z, G4double A);
G4double GetCrossSection(const G4DynamicParticle* Part,
const G4Element* El, G4double T);
G4double GetIsoZACrossSection(const G4DynamicParticle* P,
G4double Z,G4double A,G4double);
void BuildPhysicsTable(const G4ParticleDefinition&){}
void DumpPhysicsTable(const G4ParticleDefinition&) {}
private:
void Description() const;
G4QIsotope* Isotopes; // Pointer to the G4QIsotopes singleton
static std::vector <G4int> ElementZ; // Z of the element(i) in theLastCalc
static std::vector <std::vector<G4int>*> ElIsoN; // N of isotope(j) of Element(i)
static std::vector <std::vector<G4double>*> IsoProbInEl;// SumProbabIsotopes in Element i
private:
G4QIsotope* Isotopes; // Pointer to the G4QIsotopes singleton
static std::vector <G4int> ElementZ;
// Z of the element(i) in theLastCalc
static std::vector <std::vector<G4int>*> ElIsoN;
// N of isotope(j) of Element(i)
static std::vector <std::vector<G4double>*> IsoProbInEl;
// SumProbabIsotopes in Element i
};
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
// !!! Was used in QBBC PL, NOW it is not. Must be absolete !!!
// ============================================================
// =----------------------------------------------------------=
//
#ifndef G4StringChipsInterface_h
#define G4StringChipsInterface_h
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake,v 1.1 2010/09/29 18:58:13 bmorgan Exp $
# $Id: sources.cmake,v 1.1 2010-09-29 18:58:13 bmorgan Exp $
#
#------------------------------------------------------------------------------
@@ -36,14 +36,51 @@
#include "G4Nucleus.hh"
#include "G4HadFinalState.hh"
#include "G4HadProjectile.hh"
#include <iostream>
G4GammaNuclearReaction::G4GammaNuclearReaction(const G4String& name):
G4HadronicInteraction(name)
{
Description();
}
G4GammaNuclearReaction::G4GammaNuclearReaction():
G4HadronicInteraction("CHIPS")
{}
G4GammaNuclearReaction::~G4GammaNuclearReaction()
{}
void G4GammaNuclearReaction::Description() const
{
char* dirName = getenv("G4PhysListDocDir");
if (dirName) {
std::ofstream outFile;
G4String outFileName = GetModelName() + ".html";
G4String pathName = G4String(dirName) + "/" + outFileName;
outFile.open(pathName);
outFile << "<html>\n";
outFile << "<head>\n";
outFile << "<title>Description of CHIPS Gamma Nuclear Model</title>\n";
outFile << "</head>\n";
outFile << "<body>\n";
outFile << "G4GammaNuclearReaction handles inelastic gamma scattering\n"
<< "using the Chiral Invariant Phase Space (CHIPS) model of\n"
<< "M. Kossov. The incident gamma is interacted directly with\n"
<< "nucleons and clusters of nucleons within the target by\n"
<< "forming quasmons (or generalized excited hadrons) which then\n"
<< "decay into final state hadrons. The model is valid for\n"
<< "incident gamma energies up to 3.5 GeV.\n";
outFile << "</body>\n";
outFile << "</html>\n";
outFile.close();
}
}
G4HadFinalState * G4GammaNuclearReaction::ApplyYourself(
const G4HadProjectile& aTrack,
G4Nucleus& aTargetNucleus)
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4QHadronElasticDataSet.cc,v 1.3 2010/05/26 12:19:06 mkossov Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4QHadronElasticDataSet.cc,v 1.3 2010-05-26 12:19:06 mkossov Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// GEANT4 physics class: G4QHadronElasticDataSet -- header file
// Created by M. Kosov (Mikhail.Kossov@cern.ch) 21.01.10
@@ -37,15 +37,51 @@
#include "G4QHadronElasticDataSet.hh"
// Initialization of static vectors
std::vector<G4int> G4QHadronElasticDataSet::ElementZ; // Z of the element(i) in LastCalc
std::vector<std::vector<G4int>*> G4QHadronElasticDataSet::ElIsoN; // N of iso(j) of El(i)
std::vector<std::vector<G4double>*> G4QHadronElasticDataSet::IsoProbInEl;//SumProbIsoInEl
std::vector<G4int> G4QHadronElasticDataSet::ElementZ;
// Z of the element(i) in LastCalc
G4QHadronElasticDataSet::G4QHadronElasticDataSet()
std::vector<std::vector<G4int>*> G4QHadronElasticDataSet::ElIsoN;
// N of iso(j) of El(i)
std::vector<std::vector<G4double>*> G4QHadronElasticDataSet::IsoProbInEl;
//SumProbIsoInEl
G4QHadronElasticDataSet::G4QHadronElasticDataSet(const G4String& name)
: G4VCrossSectionDataSet(name)
{
Isotopes = G4QIsotope::Get(); // Pointer to the G4QIsotopes singleton
Description();
}
void G4QHadronElasticDataSet::Description() const
{
char* dirName = getenv("G4PhysListDocDir");
if (dirName) {
std::ofstream outFile;
G4String outFileName = GetName() + ".html";
G4String pathName = G4String(dirName) + "/" + outFileName;
outFile.open(pathName);
outFile << "<html>\n";
outFile << "<head>\n";
outFile << "<title>Description of CHIPSElasticXS</title>\n";
outFile << "</head>\n";
outFile << "<body>\n";
outFile << "CHIPSElasticXS provides hadron-nuclear elastic cross\n"
<< "sections for all hadrons at all energies. These cross\n"
<< "sections represent parameterizations developed by M. Kossov.\n";
outFile << "</body>\n";
outFile << "</html>\n";
outFile.close();
}
}
G4bool G4QHadronElasticDataSet::IsApplicable(const G4DynamicParticle* P,const G4Element*)
{
G4ParticleDefinition* particle = P->GetDefinition();
@@ -174,13 +210,13 @@ G4double G4QHadronElasticDataSet::GetCrossSection(const G4DynamicParticle* Pt,
}
G4double G4QHadronElasticDataSet::GetIsoZACrossSection(const G4DynamicParticle* Pt,
G4double Z, G4double A, G4double)
G4double Z, G4double A, G4double)
{
G4ParticleDefinition* particle = Pt->GetDefinition();
G4double Momentum=Pt->GetTotalMomentum();
G4VQCrossSection* CSmanager=0;
G4VQCrossSection* CSmanager2=0;
//G4VQCrossSection* CSmanager2=0;
G4int pPDG=0;
if(particle == G4Neutron::Neutron())
{
@@ -302,11 +338,17 @@ G4double G4QHadronElasticDataSet::GetIsoZACrossSection(const G4DynamicParticle*
CSmanager=G4QAntiBaryonElasticCrossSection::GetPointer();
pPDG=-3334;
}
else G4cout<<"-Warning-G4QHadronElasticDataSet::GetIsoZACrossSection: PDG="
<<particle->GetPDGEncoding()<<" isn't supported by CHIPS"<<G4endl;
else
{
G4cerr << "-ERROR-G4QHadronElasticDataSet::GetIsoZACrossSection: PDG="
<< particle->GetPDGEncoding() << " isn't supported by CHIPS" << G4endl;
//throw G4HadronicException(__FILE__, __LINE__,
// "G4QHadronElasticDataSet::GetIsoZACrossSection: Particle isn't supported by CHIPS");
return 0;
}
G4int tZ=(G4int)(Z);
G4int tN=(G4int)(A-Z);
G4double CSI=CSmanager->GetCrossSection(true, Momentum, tZ, tN, pPDG); // CS(j,i) basic
if(CSmanager2) CSI= (CSI +CSmanager2->GetCrossSection(true, Momentum, tZ, tN, pPDG))/2.;
if(CSmanager2) CSI = (CSI + CSmanager2->GetCrossSection(true, Momentum, tZ, tN, pPDG))/2;
return CSI;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4QHadronInelasticDataSet.cc,v 1.2 2010/05/26 12:19:06 mkossov Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4QHadronInelasticDataSet.cc,v 1.2 2010-05-26 12:19:06 mkossov Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// GEANT4 physics class: G4QHadronInelasticDataSet -- header file
// Created by M. Kosov (Mikhail.Kossov@cern.ch) 11.11.09
@@ -35,13 +35,21 @@
//
#include "G4QHadronInelasticDataSet.hh"
#include <iostream>
// Initialization of static vectors
std::vector<G4int> G4QHadronInelasticDataSet::ElementZ; // Z of the element(i) in LastCalc
std::vector<std::vector<G4int>*> G4QHadronInelasticDataSet::ElIsoN; // N of iso(j) of El(i)
std::vector<std::vector<G4double>*> G4QHadronInelasticDataSet::IsoProbInEl;//SumProbIsoInEl
std::vector<G4int> G4QHadronInelasticDataSet::ElementZ;
// Z of the element(i) in LastCalc
G4QHadronInelasticDataSet::G4QHadronInelasticDataSet()
std::vector<std::vector<G4int>*> G4QHadronInelasticDataSet::ElIsoN;
// N of iso(j) of El(i)
std::vector<std::vector<G4double>*> G4QHadronInelasticDataSet::IsoProbInEl;
//SumProbIsoInEl
G4QHadronInelasticDataSet::G4QHadronInelasticDataSet(const G4String& name)
: G4VCrossSectionDataSet(name)
{
//CHIPSpAin = G4QProtonNuclearCrossSection::GetPointer();
//CHIPSnAin = G4QNeutronNuclearCrossSection::GetPointer();
@@ -66,8 +74,37 @@ G4QHadronInelasticDataSet::G4QHadronInelasticDataSet()
////CHIPSananAin = G4QANuANuNuclearCrossSection::GetPointer();
Isotopes = G4QIsotope::Get(); // Pointer to the G4QIsotopes singleton
Description();
}
void G4QHadronInelasticDataSet::Description() const
{
char* dirName = getenv("G4PhysListDocDir");
if (dirName) {
std::ofstream outFile;
G4String outFileName = GetName() + ".html";
G4String pathName = G4String(dirName) + "/" + outFileName;
outFile.open(pathName);
outFile << "<html>\n";
outFile << "<head>\n";
outFile << "<title>Description of CHIPSInelasticXS</title>\n";
outFile << "</head>\n";
outFile << "<body>\n";
outFile << "CHIPSInelasticXS provides hadron-nuclear inelastic cross\n"
<< "sections for all hadrons at all energies. These cross\n"
<< "sections represent parameterizations developed by M. Kossov.\n";
outFile << "</body>\n";
outFile << "</html>\n";
outFile.close();
}
}
G4bool G4QHadronInelasticDataSet::IsApplicable(const G4DynamicParticle* P,const G4Element*)
{
G4ParticleDefinition* particle = P->GetDefinition();
@@ -156,8 +193,7 @@ G4bool G4QHadronInelasticDataSet::IsZAApplicable(const G4DynamicParticle* Pt,
}
G4double G4QHadronInelasticDataSet::GetCrossSection(const G4DynamicParticle* Pt,
const G4Element* pElement,
G4double)
const G4Element* pElement, G4double)
{
G4int IPIE=IsoProbInEl.size(); // How many old elements?
if(IPIE) for(G4int ip=0; ip<IPIE; ++ip) // Clean up the SumProb's of Isotopes (SPI)
@@ -227,7 +263,7 @@ G4double G4QHadronInelasticDataSet::GetIsoZACrossSection(const G4DynamicParticle
G4ParticleDefinition* particle = Pt->GetDefinition();
G4double Momentum=Pt->GetTotalMomentum();
G4VQCrossSection* CSmanager=0;
//G4VQCrossSection* CSmanager2=0;
G4int pPDG=0;
if(particle == G4Neutron::Neutron())
{
@@ -395,11 +431,16 @@ G4double G4QHadronInelasticDataSet::GetIsoZACrossSection(const G4DynamicParticle
// CSmanager2=G4QANuANuNuclearCrossSection::GetPointer();
// pPDG=-12;
//}
else G4cout<<"-Warning-G4QHadronInelasticDataSet::GetIsoZACrossSection: PDG="
<<particle->GetPDGEncoding()<<" isn't supported by CHIPS"<<G4endl;
else
{
G4cerr << "-ERROR-G4QHadronInelasticDataSet::GetIsoZACrossSection: PDG="
<< particle->GetPDGEncoding() << " isn't supported by CHIPS" << G4endl;
//throw G4HadronicException(__FILE__, __LINE__,
//"G4QHadronInelasticDataSet::GetIsoZACrossSection: Particle not supported by CHIPS");
return 0;
}
G4int tZ=(G4int)(Z);
G4int tN=(G4int)(A-Z);
G4double CSI=CSmanager->GetCrossSection(true, Momentum, tZ, tN, pPDG); // CS(j,i) basic
//if(CSmanager2) CSI+=CSmanager2->GetCrossSection(true,Momentum,Z,N,pPDG); // e.g.(nu,nu)
return CSI;
}
@@ -366,41 +366,13 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
}
std::vector<G4QContent> theFinalContents;
std::vector<G4LorentzVector*> theFinalMomenta;
if(theContents.size()<hitCount || 1) // Looks like the "else" is closed by "|| 1"
for(unsigned int hp = 0; hp<theContents.size(); hp++)
{
for(unsigned int hp = 0; hp<theContents.size(); hp++)
{
G4QHadron* aHadron = new G4QHadron(theContents[hp], *(theMomenta[hp]) );
projHV.push_back(aHadron);
}
}
else // Never come here (!?)
{
unsigned int hp;
for(hp=0; hp<hitCount; hp++) // Initialize the arrays
{
G4QContent co(0, 0, 0, 0, 0, 0);
theFinalContents.push_back(co);
G4LorentzVector* mo = new G4LorentzVector(0,0,0,0);
theFinalMomenta.push_back(mo);
}
unsigned int running = 0;
while (running<theContents.size())
{
for(hp = 0; hp<hitCount; hp++)
{
theFinalContents[hp] +=theContents[running];
*(theFinalMomenta[hp])+=*(theMomenta[running]);
running++;
if(running == theContents.size()) break;
}
}
for(hp = 0; hp<hitCount; hp++)
{
G4QHadron* aHadron = new G4QHadron(theFinalContents[hp], *theFinalMomenta[hp]);
projHV.push_back(aHadron);
}
G4QHadron* aHadron = new G4QHadron(theContents[hp], *(theMomenta[hp]) );
projHV.push_back(aHadron);
}
// construct the quasmon
size_t i;
for (i=0; i<theFinalMomenta.size(); i++) delete theFinalMomenta[i];
@@ -24,7 +24,7 @@
// ********************************************************************
//
// !!! Was used in QBBC PL, NOW it is not. Must be absolete !!!
// ============================================================
// =----------------------------------------------------------=
//#define debug
//#define pdebug
@@ -259,8 +259,9 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
G4LorentzVector targ4Mom(-1.*hitMomentum, targetEnergy);
// construct the quasmon
G4int nop = 85; // clusters up to Alpha cluster (Reduced)
// G4int nop = 122; // clusters up to Alpha cluster
G4int nop = 152; // V.Ivanchenko set the same parameter as for all CHIPS models
// G4int nop = 152; // not reduced upto Li6
G4double fractionOfSingleQuasiFreeNucleons = 0.5; // It is A-dependent (C=.85, U=.40)
G4double fractionOfPairedQuasiFreeNucleons = 0.05;
G4double clusteringCoefficient = 5.;
@@ -390,7 +391,7 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
delete output->operator[](particle);
continue;
}
theSec = new G4ReactionProduct;
// theSec = new G4ReactionProduct; // JA - not used, and memory leaked (Coverity)
G4int pdgCode = output->operator[](particle)->GetPDGCode();
G4ParticleDefinition * theDefinition;
// Note that I still have to take care of strange nuclei
@@ -412,40 +412,39 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
}
std::vector<G4QContent> theFinalContents;
std::vector<G4LorentzVector*> theFinalMomenta;
if(theContents.size()<hitCount || 1) // Looks like the "else" is closed by "|| 1"
// Multiquasmon case: each particle creates a quasmon
//for(unsigned int hp = 0; hp<theContents.size(); hp++)
//{
// G4QHadron* aHadron = new G4QHadron(theContents[hp], *(theMomenta[hp]) );
// projHV.push_back(aHadron);
//}
// Energy flow: one Quasmon for each B>0 collection ----------
G4QContent EnFlowQC(0,0,0,0,0,0);
G4LorentzVector EnFlow4M(0.,0.,0.,0.);
//G4bool empty=true;
G4int barys=0;
G4int stras=0;
G4int chars=0;
for(G4int hp = theContents.size()-1; hp>=0; hp--)
{
// Multiquasmon case: each particle creates a quasmon
//for(unsigned int hp = 0; hp<theContents.size(); hp++)
//{
// G4QHadron* aHadron = new G4QHadron(theContents[hp], *(theMomenta[hp]) );
// projHV.push_back(aHadron);
//}
// Energy flow: one Quasmon for each B>0 collection ----------
G4QContent EnFlowQC(0,0,0,0,0,0);
G4LorentzVector EnFlow4M(0.,0.,0.,0.);
//G4bool empty=true;
G4int barys=0;
G4int stras=0;
G4int chars=0;
for(G4int hp = theContents.size()-1; hp>=0; hp--)
{
G4QContent curQC=theContents[hp];
G4int baryn = curQC.GetBaryonNumber();
G4int stran = curQC.GetStrangeness();
G4int charg = curQC.GetCharge();
EnFlowQC += curQC; // Keep collecting energy flow
EnFlow4M += *(theMomenta[hp]);
barys += baryn; // Collected baryon number
stras += stran; // Collected strangeness
chars += charg; // Collected charge
//empty = false;
}
if(barys>pcl) // Split in two or more parts (to survive!)
{
G4int nprt=(barys-1)/pcl+1; // Number of parts (pcl=4: 2:5-8,3:9-12...)
G4int curb=barys;
while (nprt>0)
{
G4QContent curQC=theContents[hp];
G4int baryn = curQC.GetBaryonNumber();
G4int stran = curQC.GetStrangeness();
G4int charg = curQC.GetCharge();
EnFlowQC += curQC; // Keep collecting energy flow
EnFlow4M += *(theMomenta[hp]);
barys += baryn; // Collected baryon number
stras += stran; // Collected strangeness
chars += charg; // Collected charge
//empty = false;
}
if(barys>pcl) // Split in two or more parts (to survive!)
{
G4int nprt=(barys-1)/pcl+1; // Number of parts (pcl=4: 2:5-8,3:9-12...)
G4int curb=barys;
while (nprt>0)
{
nprt--; // One part is going to be created
G4int brnm=pcl; // Baryon number of splitting part
curb-=brnm; // The residual baryon number
@@ -576,71 +575,14 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
#ifdef debug
G4cout<<"G4StringChipsParticleLevelInterface::Propagate: nprt="<<nprt<<G4endl;
#endif
} // End of WHILE
}
else
{
G4QHadron* aHadron = new G4QHadron(EnFlowQC, EnFlow4M);
projHV.push_back(aHadron);
}
// End of Energy Flow ----------------------------------------
// Energy flow: one Quasmon for each B>0 collection ---------- too forward
//G4QContent EnFlowQC(0,0,0,0,0,0);
//G4LorentzVector EnFlow4M(0.,0.,0.,0.);
//G4bool empty=true;
//G4int barys=0;
//for(G4int hp = theContents.size()-1; hp>=0; hp--)
//{
// G4QContent curQC=theContents[hp];
// G4int baryn = curQC.GetBaryonNumber();
// if(baryn>0 && barys>0 && !empty) // New baryon and b-positive collection -> fill
// {
// G4QHadron* aHadron = new G4QHadron(EnFlowQC, EnFlow4M);
// projHV.push_back(aHadron);
// EnFlowQC = G4QContent(0,0,0,0,0,0);
// EnFlow4M = G4LorentzVector(0.,0.,0.,0.);
// barys=0;
// empty=true;
// }
// EnFlowQC += curQC; // Keep collecting energy flow
// EnFlow4M += *(theMomenta[hp]);
// barys += baryn;
// empty = false;
//}
//if(!empty)
//{
// G4QHadron* aHadron = new G4QHadron(EnFlowQC, EnFlow4M);
// projHV.push_back(aHadron);
//}
// End of Energy Flow One Quasmon for each ----------------------------
} // End of WHILE
}
else // Never come here (!?)
else
{
unsigned int hp;
for(hp=0; hp<hitCount; hp++) // Initialize the arrays
{
G4QContent co(0, 0, 0, 0, 0, 0);
theFinalContents.push_back(co);
G4LorentzVector* mo = new G4LorentzVector(0,0,0,0);
theFinalMomenta.push_back(mo);
}
unsigned int running = 0;
while (running<theContents.size())
{
for(hp = 0; hp<hitCount; hp++)
{
theFinalContents[hp] +=theContents[running];
*(theFinalMomenta[hp])+=*(theMomenta[running]);
running++;
if(running == theContents.size()) break;
}
}
for(hp = 0; hp<hitCount; hp++)
{
G4QHadron* aHadron = new G4QHadron(theFinalContents[hp], *theFinalMomenta[hp]);
projHV.push_back(aHadron);
}
G4QHadron* aHadron = new G4QHadron(EnFlowQC, EnFlow4M);
projHV.push_back(aHadron);
}
// construct the quasmon
size_t i;
for (i=0; i<theFinalMomenta.size(); i++) delete theFinalMomenta[i];