Import Geant4 10.6.0 source tree
This commit is contained in:
+81
-50
@@ -39,24 +39,28 @@
|
||||
#include "G4HadronicException.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
//#define debug_Hbuilder
|
||||
|
||||
G4HadronBuilder::G4HadronBuilder(G4double mesonMix, G4double barionMix,
|
||||
std::vector<double> scalarMesonMix,
|
||||
std::vector<double> vectorMesonMix)
|
||||
std::vector<double> scalarMesonMix,
|
||||
std::vector<double> vectorMesonMix,
|
||||
G4double Eta_cProb, G4double Eta_bProb)
|
||||
{
|
||||
mesonSpinMix=mesonMix;
|
||||
barionSpinMix=barionMix;
|
||||
scalarMesonMixings=scalarMesonMix;
|
||||
vectorMesonMixings=vectorMesonMix;
|
||||
mesonSpinMix = mesonMix;
|
||||
barionSpinMix = barionMix;
|
||||
scalarMesonMixings = scalarMesonMix;
|
||||
vectorMesonMixings = vectorMesonMix;
|
||||
|
||||
ProbEta_c = Eta_cProb;
|
||||
ProbEta_b = Eta_bProb;
|
||||
}
|
||||
|
||||
G4ParticleDefinition * G4HadronBuilder::Build(G4ParticleDefinition * black, G4ParticleDefinition * white)
|
||||
{
|
||||
|
||||
if (black->GetParticleSubType()== "di_quark" || white->GetParticleSubType()== "di_quark" ) {
|
||||
// Barion
|
||||
Spin spin = (G4UniformRand() < barionSpinMix) ? SpinHalf : SpinThreeHalf;
|
||||
return Barion(black,white,spin);
|
||||
|
||||
} else {
|
||||
// Meson
|
||||
Spin spin = (G4UniformRand() < mesonSpinMix) ? SpinZero : SpinOne;
|
||||
@@ -92,7 +96,7 @@ G4ParticleDefinition * G4HadronBuilder::BuildHighSpin(G4ParticleDefinition * bla
|
||||
G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
|
||||
G4ParticleDefinition * white, Spin theSpin)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
#ifdef debug_Hbuilder
|
||||
// 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
|
||||
@@ -106,9 +110,10 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
|
||||
G4cerr << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
G4int id1= black->GetPDGEncoding();
|
||||
G4int id2= white->GetPDGEncoding();
|
||||
|
||||
G4int id1 = black->GetPDGEncoding();
|
||||
G4int id2 = white->GetPDGEncoding();
|
||||
|
||||
// G4int ifl1= std::max(std::abs(id1), std::abs(id2));
|
||||
if ( std::abs(id1) < std::abs(id2) )
|
||||
{
|
||||
@@ -116,39 +121,61 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
|
||||
id1 = id2;
|
||||
id2 = xchg;
|
||||
}
|
||||
|
||||
G4int abs_id1 = std::abs(id1);
|
||||
|
||||
if (std::abs(id1) > 3 )
|
||||
if ( abs_id1 > 5 )
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4HadronBuilder::Meson : Illegal Quark content as input");
|
||||
|
||||
G4int PDGEncoding=0;
|
||||
|
||||
if (id1 + id2 == 0) {
|
||||
G4double rmix = G4UniformRand();
|
||||
G4int imix = 2*std::abs(id1) - 1;
|
||||
if (theSpin == SpinZero) {
|
||||
PDGEncoding = 110*(1 + (G4int)(rmix + scalarMesonMixings[imix - 1])
|
||||
+ (G4int)(rmix + scalarMesonMixings[imix])
|
||||
) + theSpin;
|
||||
} else {
|
||||
PDGEncoding = 110*(1 + (G4int)(rmix + vectorMesonMixings[imix - 1])
|
||||
+ (G4int)(rmix + vectorMesonMixings[imix])
|
||||
) + theSpin;
|
||||
}
|
||||
if ( abs_id1 < 4) { // light quarks: u, d or s
|
||||
G4double rmix = G4UniformRand();
|
||||
G4int imix = 2*std::abs(id1) - 1;
|
||||
if (theSpin == SpinZero) {
|
||||
PDGEncoding = 110*(1 + (G4int)(rmix + scalarMesonMixings[imix - 1])
|
||||
+ (G4int)(rmix + scalarMesonMixings[imix])
|
||||
) + theSpin;
|
||||
} else {
|
||||
PDGEncoding = 110*(1 + (G4int)(rmix + vectorMesonMixings[imix - 1])
|
||||
+ (G4int)(rmix + vectorMesonMixings[imix])
|
||||
) + theSpin;
|
||||
}
|
||||
} else { // for c and b quarks
|
||||
|
||||
PDGEncoding = abs_id1*100 + abs_id1*10;
|
||||
|
||||
if (PDGEncoding == 440) {
|
||||
if ( G4UniformRand() < ProbEta_c ) {
|
||||
PDGEncoding +=1;
|
||||
} else {
|
||||
PDGEncoding +=3;
|
||||
}
|
||||
}
|
||||
if (PDGEncoding == 550) {
|
||||
if ( G4UniformRand() < ProbEta_b ) {
|
||||
PDGEncoding +=1;
|
||||
} else {
|
||||
PDGEncoding +=3;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
PDGEncoding = 100 * std::abs(id1) + 10 * std::abs(id2) + theSpin;
|
||||
G4bool IsUp = (std::abs(id1)&1) == 0; // quark 1 up type quark (u or c)
|
||||
G4bool IsAnti = id1 < 0; // quark 1 is antiquark?
|
||||
if( (IsUp && IsAnti ) || (!IsUp && !IsAnti ) )
|
||||
PDGEncoding = - PDGEncoding;
|
||||
G4bool IsAnti = id1 < 0; // quark 1 is antiquark?
|
||||
if ( (IsUp && IsAnti ) || (!IsUp && !IsAnti ) ) PDGEncoding = - PDGEncoding;
|
||||
}
|
||||
|
||||
|
||||
G4ParticleDefinition * MesonDef=
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(PDGEncoding);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
#ifdef debug_Hbuilder
|
||||
if (MesonDef == 0 ) {
|
||||
G4cerr << " G4HadronBuilder - Warning: No particle for PDGcode= "
|
||||
<< PDGEncoding << G4endl;
|
||||
|
||||
} else if ( ( black->GetPDGCharge() + white->GetPDGCharge()
|
||||
- MesonDef->GetPDGCharge() ) > perCent ) {
|
||||
G4cerr << " G4HadronBuilder - Warning: Incorrect Charge : "
|
||||
@@ -165,9 +192,9 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
|
||||
|
||||
|
||||
G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
|
||||
G4ParticleDefinition * white,Spin theSpin)
|
||||
G4ParticleDefinition * white,Spin theSpin)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
#ifdef debug_Hbuilder
|
||||
// Verify Input Charge
|
||||
G4double charge = black->GetPDGCharge() + white->GetPDGCharge();
|
||||
if (std::abs(charge) > 2 || std::abs(3.*charge - 3*G4int(charge*1.001)) > perCent )
|
||||
@@ -182,8 +209,9 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
|
||||
}
|
||||
#endif
|
||||
|
||||
G4int id1= black->GetPDGEncoding();
|
||||
G4int id2= white->GetPDGEncoding();
|
||||
G4int id1 = black->GetPDGEncoding();
|
||||
G4int id2 = white->GetPDGEncoding();
|
||||
|
||||
if ( std::abs(id1) < std::abs(id2) )
|
||||
{
|
||||
G4int xchg = id1;
|
||||
@@ -191,7 +219,7 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
|
||||
id2 = xchg;
|
||||
}
|
||||
|
||||
if (std::abs(id1) < 1000 || std::abs(id2) > 3 )
|
||||
if (std::abs(id1) < 1000 || std::abs(id2) > 5 )
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4HadronBuilder::Barion: Illegal quark content as input");
|
||||
|
||||
G4int ifl1= std::abs(id1)/1000;
|
||||
@@ -219,21 +247,23 @@ 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(diquarkSpin == 1 ) {
|
||||
if ( kfla == kfld) { // heaviest quark in diquark
|
||||
kfll = 1;
|
||||
} else {
|
||||
kfll = (G4int)(0.25 + G4UniformRand());
|
||||
}
|
||||
}
|
||||
if(diquarkSpin == 3 && kfla != kfld)
|
||||
kfll = (G4int)(0.75 + G4UniformRand());
|
||||
}
|
||||
if (kfld < 4) {
|
||||
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;
|
||||
} else {
|
||||
kfll = (G4int)(0.25 + G4UniformRand());
|
||||
}
|
||||
}
|
||||
if (diquarkSpin == 3 && kfla != kfld)
|
||||
kfll = (G4int)(0.75 + G4UniformRand());
|
||||
}
|
||||
}
|
||||
|
||||
G4int PDGEncoding;
|
||||
if (kfll == 1)
|
||||
@@ -247,7 +277,7 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
|
||||
G4ParticleDefinition * BarionDef=
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(PDGEncoding);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
#ifdef debug_Hbuilder
|
||||
if (BarionDef == 0 ) {
|
||||
G4cerr << " G4HadronBuilder - Warning: No particle for PDGcode= "
|
||||
<< PDGEncoding << G4endl;
|
||||
@@ -264,3 +294,4 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
|
||||
|
||||
return BarionDef;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user