Import Geant4 10.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2018-12-07 15:15:39 +01:00
parent 6aa23be517
commit db49709b53
11370 changed files with 187480 additions and 160142 deletions
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4HadronBuilder.cc 107968 2017-12-14 13:16:35Z gcosmo $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -54,15 +53,12 @@ G4ParticleDefinition * G4HadronBuilder::Build(G4ParticleDefinition * black, G4Pa
{
if (black->GetParticleSubType()== "di_quark" || white->GetParticleSubType()== "di_quark" ) {
// Barion
// Barion
Spin spin = (G4UniformRand() < barionSpinMix) ? SpinHalf : SpinThreeHalf;
return Barion(black,white,spin);
} else {
// Meson
} else {
// Meson
Spin spin = (G4UniformRand() < mesonSpinMix) ? SpinZero : SpinOne;
return Meson(black,white,spin);
}
@@ -75,7 +71,7 @@ G4ParticleDefinition * G4HadronBuilder::BuildLowSpin(G4ParticleDefinition * blac
if ( black->GetParticleSubType()== "quark" && white->GetParticleSubType()== "quark" ) {
return Meson(black,white, SpinZero);
} else {
// will return a SpinThreeHalf Barion if all quarks the same
// will return a SpinThreeHalf Barion if all quarks the same
return Barion(black,white, SpinHalf);
}
}
@@ -96,13 +92,11 @@ G4ParticleDefinition * G4HadronBuilder::BuildHighSpin(G4ParticleDefinition * bla
G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
G4ParticleDefinition * white, Spin theSpin)
{
#ifdef G4VERBOSE
// Verify Input Charge
G4double charge = black->GetPDGCharge()
+ white->GetPDGCharge();
if (std::abs(charge) > 2 || std::abs(3.*charge - 3*G4int(charge*1.001)) > perCent ) // 1.001 to avoid int(.9999) -> 0
{
#ifdef G4VERBOSE
// Verify Input Charge
G4double charge = black->GetPDGCharge() + white->GetPDGCharge();
if (std::abs(charge) > 2 || std::abs(3.*charge - 3*G4int(charge*1.001)) > perCent ) // 1.001 to avoid int(.9999) -> 0
{
G4cerr << " G4HadronBuilder::Build()" << G4endl;
G4cerr << " Invalid total charge found for on input: "
<< charge<< G4endl;
@@ -111,17 +105,17 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
white->GetPDGEncoding() << G4endl;
G4cerr << G4endl;
}
#endif
#endif
G4int id1= black->GetPDGEncoding();
G4int id2= white->GetPDGEncoding();
// G4int ifl1= std::max(std::abs(id1), std::abs(id2));
// G4int ifl1= std::max(std::abs(id1), std::abs(id2));
if ( std::abs(id1) < std::abs(id2) )
{
{
G4int xchg = id1;
id1 = id2;
id2 = xchg;
}
}
if (std::abs(id1) > 3 )
throw G4HadronicException(__FILE__, __LINE__, "G4HadronBuilder::Meson : Illegal Quark content as input");
@@ -131,7 +125,7 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
if (id1 + id2 == 0) {
G4double rmix = G4UniformRand();
G4int imix = 2*std::abs(id1) - 1;
if(theSpin == SpinZero) {
if (theSpin == SpinZero) {
PDGEncoding = 110*(1 + (G4int)(rmix + scalarMesonMixings[imix - 1])
+ (G4int)(rmix + scalarMesonMixings[imix])
) + theSpin;
@@ -150,7 +144,8 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
G4ParticleDefinition * MesonDef=
G4ParticleTable::GetParticleTable()->FindParticle(PDGEncoding);
#ifdef G4VERBOSE
#ifdef G4VERBOSE
if (MesonDef == 0 ) {
G4cerr << " G4HadronBuilder - Warning: No particle for PDGcode= "
<< PDGEncoding << G4endl;
@@ -163,7 +158,7 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
<< " resulting Hadron " << MesonDef->GetParticleName()
<< G4endl;
}
#endif
#endif
return MesonDef;
}
@@ -172,12 +167,10 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
G4ParticleDefinition * white,Spin theSpin)
{
#ifdef G4VERBOSE
// Verify Input Charge
G4double charge = black->GetPDGCharge()
+ white->GetPDGCharge();
if (std::abs(charge) > 2 || std::abs(3.*charge - 3*G4int(charge*1.001)) > perCent )
#ifdef G4VERBOSE
// Verify Input Charge
G4double charge = black->GetPDGCharge() + white->GetPDGCharge();
if (std::abs(charge) > 2 || std::abs(3.*charge - 3*G4int(charge*1.001)) > perCent )
{
G4cerr << " G4HadronBuilder::Build()" << G4endl;
G4cerr << " Invalid total charge found for on input: "
@@ -187,15 +180,16 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
white->GetPDGEncoding() << G4endl;
G4cerr << G4endl;
}
#endif
#endif
G4int id1= black->GetPDGEncoding();
G4int id2= white->GetPDGEncoding();
if ( std::abs(id1) < std::abs(id2) )
{
{
G4int xchg = id1;
id1 = id2;
id2 = xchg;
}
}
if (std::abs(id1) < 1000 || std::abs(id2) > 3 )
throw G4HadronicException(__FILE__, __LINE__, "G4HadronBuilder::Barion: Illegal quark content as input");
@@ -205,10 +199,10 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
G4int diquarkSpin = std::abs(id1)%10;
G4int ifl3 = id2;
if (id1 < 0)
{
{
ifl1 = - ifl1;
ifl2 = - ifl2;
}
}
//... Construct barion, distinguish Lambda and Sigma barions.
G4int kfla = std::abs(ifl1);
G4int kflb = std::abs(ifl2);
@@ -225,11 +219,11 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
theSpin = (kfla == kflb && kflb == kflc)? SpinThreeHalf : theSpin;
G4int kfll = 0;
if(theSpin == SpinHalf && kfld > kfle && kfle > kflf) {
// Spin J=1/2 and all three quarks different
// Two states exist: (uds -> lambda or sigma0)
// - lambda: s(ud)0 s : 3122; ie. reverse the two lighter quarks
// - sigma0: s(ud)1 s : 3212
if (theSpin == SpinHalf && kfld > kfle && kfle > kflf) {
// Spin J=1/2 and all three quarks different
// Two states exist: (uds -> lambda or sigma0)
// - lambda: s(ud)0 s : 3122; ie. reverse the two lighter quarks
// - sigma0: s(ud)1 s : 3212
if(diquarkSpin == 1 ) {
if ( kfla == kfld) { // heaviest quark in diquark
kfll = 1;
@@ -250,10 +244,10 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
if (id1 < 0)
PDGEncoding = -PDGEncoding;
G4ParticleDefinition * BarionDef=
G4ParticleTable::GetParticleTable()->FindParticle(PDGEncoding);
#ifdef G4VERBOSE
#ifdef G4VERBOSE
if (BarionDef == 0 ) {
G4cerr << " G4HadronBuilder - Warning: No particle for PDGcode= "
<< PDGEncoding << G4endl;
@@ -266,7 +260,7 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
<< " resulting Hadron " << BarionDef->GetParticleName()
<< G4endl;
}
#endif
#endif
return BarionDef;
}