Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -28,62 +28,34 @@
#include "G4ExcitedStringDecay.hh"
#include "G4SystemOfUnits.hh"
#include "G4KineticTrack.hh"
#include "G4LundStringFragmentation.hh"
#include "G4HadronicInteractionRegistry.hh"
#include "G4SampleResonance.hh"
//#define debug_G4ExcitedStringDecay
//#define debug_G4ExcitedStringCorr
G4ExcitedStringDecay::G4ExcitedStringDecay() : G4VStringFragmentation(),theStringDecay(0)
{}
G4ExcitedStringDecay::G4ExcitedStringDecay(G4VLongitudinalStringDecay * aStringDecay)
: G4VStringFragmentation(),
theStringDecay(aStringDecay)
{}
G4ExcitedStringDecay::G4ExcitedStringDecay(const G4ExcitedStringDecay &)
: G4VStringFragmentation(),
theStringDecay(0)
G4ExcitedStringDecay::G4ExcitedStringDecay(G4VLongitudinalStringDecay* ptr)
: G4VStringFragmentation(), theStringDecay(ptr)
{
throw G4HadronicException(__FILE__, __LINE__, "G4ExcitedStringDecay::copy ctor not accessible");
}
if(!ptr) {
G4HadronicInteraction* p =
G4HadronicInteractionRegistry::Instance()->FindModel("LundStringFragmentation");
theStringDecay = static_cast<G4VLongitudinalStringDecay*>(p);
if(!theStringDecay) { theStringDecay = new G4LundStringFragmentation(); }
}
SetModelName(theStringDecay->GetModelName());
}
G4ExcitedStringDecay::~G4ExcitedStringDecay()
{
}
const G4ExcitedStringDecay & G4ExcitedStringDecay::operator=(const G4ExcitedStringDecay &)
{
throw G4HadronicException(__FILE__, __LINE__, "G4ExcitedStringDecay::operator= meant to not be accessable");
return *this;
}
G4bool G4ExcitedStringDecay::operator==(const G4ExcitedStringDecay &) const
{
return false;
}
G4bool G4ExcitedStringDecay::operator!=(const G4ExcitedStringDecay &) const
{
return true;
}
{}
G4KineticTrackVector *G4ExcitedStringDecay::FragmentString(const G4ExcitedString &theString)
{
if ( theStringDecay == NULL ) theStringDecay=new G4LundStringFragmentation();
return theStringDecay->FragmentString(theString);
return theStringDecay->FragmentString(theString);
}
G4KineticTrackVector *G4ExcitedStringDecay::FragmentStrings(const G4ExcitedStringVector * theStrings)
{
G4LorentzVector KTsum(0.,0.,0.,0.);
@@ -47,6 +47,7 @@
//*************************************************************************************
G4LundStringFragmentation::G4LundStringFragmentation()
: G4VLongitudinalStringDecay("LundStringFragmentation")
{
SetMassCut(210.*MeV); // Mpi + Delta
// For ProduceOneHadron it is required
@@ -787,8 +788,8 @@ Diquark_AntiDiquark_belowThreshold_lastSplitting(G4FragmentingString * & string,
{
G4double StringMass = string->Mass();
G4int cClusterInterrupt = 0;
G4bool isOK = false;
G4int cClusterInterrupt = 0;
do
{
G4int LeftQuark1= string->GetLeftParton()->GetPDGEncoding()/1000;
@@ -801,26 +802,26 @@ Diquark_AntiDiquark_belowThreshold_lastSplitting(G4FragmentingString * & string,
{
LeftHadron =hadronizer->Build(FindParticle( LeftQuark1),
FindParticle(RightQuark1));
RightHadron= (LeftHadron == nullptr) ? nullptr :
hadronizer->Build(FindParticle( LeftQuark2),
FindParticle(RightQuark2));
} else
{
LeftHadron =hadronizer->Build(FindParticle( LeftQuark1),
FindParticle(RightQuark2));
RightHadron=(LeftHadron == nullptr) ? nullptr :
hadronizer->Build(FindParticle( LeftQuark2),
FindParticle(RightQuark1));
}
RightHadron= (LeftHadron == nullptr) ? nullptr :
hadronizer->Build(FindParticle( LeftQuark2),
FindParticle(RightQuark2));
} else
{
LeftHadron =hadronizer->Build(FindParticle( LeftQuark1),
FindParticle(RightQuark2));
RightHadron=(LeftHadron == nullptr) ? nullptr :
hadronizer->Build(FindParticle( LeftQuark2),
FindParticle(RightQuark1));
}
isOK = (LeftHadron != nullptr) && (RightHadron != nullptr);
if(isOK) { isOK = (StringMass > LeftHadron->GetPDGMass() + RightHadron->GetPDGMass()); }
++cClusterInterrupt;
//... repeat procedure, if mass of cluster is too low to produce hadrons
//... ClusterMassCut = 0.15*GeV model parameter
}
while (isOK == false || cClusterInterrupt < ClusterLoopInterrupt);
/* Loop checking, 07.08.2015, A.Ribon */
isOK = (LeftHadron != nullptr) && (RightHadron != nullptr);
if(isOK) { isOK = (StringMass > LeftHadron->GetPDGMass() + RightHadron->GetPDGMass()); }
++cClusterInterrupt;
//... repeat procedure, if mass of cluster is too low to produce hadrons
//... ClusterMassCut = 0.15*GeV model parameter
}
while (isOK == false || cClusterInterrupt < ClusterLoopInterrupt);
/* Loop checking, 07.08.2015, A.Ribon */
return isOK;
}
@@ -48,16 +48,18 @@
G4QGSMFragmentation::G4QGSMFragmentation()
{
SigmaQT = 0.45 * GeV; // Uzhi June 2020
MassCut = 0.35*GeV;
SetStrangenessSuppression((1.0 - 0.16)/2.);
SetStrangenessSuppression((1.0 - 0.12)/2.); // Uzhi June 2020 0.16 -> 0.12
// For the time being, set to 0.0 the probabilities for c-cbar and b-bbar creation.
SetProbCCbar(0.0); //(0.0033); // According to O.I. Piskunova Yad. Fiz. 56 (1993) 1094
SetProbBBbar(0.0); //(5.0e-5); // According to O.I. Piskunova Yad. Fiz. 56 (1993) 1094
SetDiquarkSuppression(0.32);
SetDiquarkBreakProbability(0.7);
SetDiquarkSuppression(0.195); // Uzhi June 2020 0.32 -> 0.195
SetDiquarkBreakProbability(0.0); // Uzhi June 2020 0.7 -> 0.0
SetMinMasses();
@@ -208,7 +210,11 @@ G4KineticTrackVector* G4QGSMFragmentation::FragmentString(const G4ExcitedString&
// Split current string into 2 final Hadrons
#ifdef debug_QGSMfragmentation
G4cout<<"Split remaining string into 2 final hadrons."<<G4endl;
if( inner_sucess ) { // Uzhi June 2020
G4cout<<"Split remaining string into 2 final hadrons."<<G4endl;
} else {
G4cout<<" New attempt to fragment string"<<G4endl;
} // Uzhi June 2020
#endif
// To the close production of hadrons at last string decay
if ( inner_sucess &&
@@ -261,7 +267,8 @@ G4KineticTrackVector* G4QGSMFragmentation::FragmentString(const G4ExcitedString&
G4bool G4QGSMFragmentation::IsItFragmentable(const G4FragmentingString * const string)
{
return sqr( PossibleHadronMass(string) + MassCut ) < string->Mass2();
//Uzhi June 2020 return sqr( PossibleHadronMass(string) + MassCut ) < string->Mass2();
return sqr( MinimalStringMass + MassCut ) < string->Mass2(); // Uzhi June 2020
}
//----------------------------------------------------------------------------------------------------------
@@ -401,7 +408,7 @@ G4ParticleDefinition *G4QGSMFragmentation::DiQuarkSplitup( G4ParticleDefinition*
G4int IsParticle=(decayQuarkEncoding>0) ? -1 : +1; // if we have a quark, we need antiquark
G4double StrSup=GetStrangeSuppress();
SetStrangenessSuppression((1.0 - 0.07)/2.);
SetStrangenessSuppression((1.0 - 0.07)/2.); // Prob qq->K qq' 0.07
pDefPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted
SetStrangenessSuppression(StrSup);
@@ -411,12 +418,13 @@ G4ParticleDefinition *G4QGSMFragmentation::DiQuarkSplitup( G4ParticleDefinition*
G4int i20 = std::min(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding));
G4int spin = (i10 != i20 && G4UniformRand() <= 0.5)? 1 : 3;
G4int NewDecayEncoding = -1*IsParticle*(i10 * 1000 + i20 * 100 + spin);
created = FindParticle(NewDecayEncoding);
G4ParticleDefinition * decayQuark=FindParticle(decayQuarkEncoding);
G4ParticleDefinition * had=hadronizer->Build(QuarkPair.first, decayQuark);
DecayQuark = decayQuarkEncoding;
NewQuark = QuarkPair.first->GetPDGEncoding();
DecayQuark = decay->GetPDGEncoding(); //Uzhi June 2020 decayQuarkEncoding;
NewQuark = NewDecayEncoding; //Uzhi June 2020 QuarkPair.first->GetPDGEncoding();
return had;
@@ -476,13 +484,21 @@ G4LorentzVector * G4QGSMFragmentation::SplitEandP(G4ParticleDefinition * pHadron
G4ThreeVector HadronPt , RemSysPt;
G4double HadronMassT2, ResidualMassT2;
//Uzhi June 2020 Mt distribution is implemented
G4double HadronMt, Pt, Pt2, phi; // Uzhi June 2020
//... sample Pt of the hadron
G4int attempt=0;
do
{
attempt++; if (attempt > StringLoopInterrupt) return 0;
HadronPt =SampleQuarkPt() + string->DecayPt();
HadronMt = HadronMass - 200.0*G4Log(G4UniformRand()); // Uzhi June 2020, 200.0 must be tuned
Pt2 = sqr(HadronMt)-sqr(HadronMass); Pt=std::sqrt(Pt2); // Uzhi June 2020
phi = 2.*pi*G4UniformRand();
G4ThreeVector SampleQuarkPtw= G4ThreeVector(Pt*std::cos(phi), Pt*std::sin(phi), 0);
HadronPt =SampleQuarkPtw + string->DecayPt(); // Uzhi June 2020
//Uzhi June 2020 HadronPt =SampleQuarkPt() + string->DecayPt(); // Save this for possible return
HadronPt.setZ(0);
RemSysPt = StringPt - HadronPt;
@@ -534,12 +550,14 @@ G4LorentzVector * G4QGSMFragmentation::SplitEandP(G4ParticleDefinition * pHadron
//----------------------------------------------------------------------------------------------------------
G4double G4QGSMFragmentation::GetLightConeZ(G4double zmin, G4double zmax, G4int /* PartonEncoding */,
G4ParticleDefinition* /* pHadron */, G4double , G4double )
G4double G4QGSMFragmentation::GetLightConeZ(G4double zmin, G4double zmax, G4int /* PartonEncoding */ ,
G4ParticleDefinition* /* pHadron */, G4double ptx , G4double pty)
{
G4double lambda = 2.0*(sqr(ptx)+sqr(pty))/sqr(GeV); // Uzhi June 2020
#ifdef debug_QGSMfragmentation
G4cout<<"GetLightConeZ zmin zmax Parton pHadron "<<zmin<<" "<<zmax<<" "<< /* PartonEncoding */
<<" "<</* pHadron->GetParticleName() */ <<G4endl;
G4cout<<"GetLightConeZ zmin zmax Parton pHadron "<<zmin<<" "<<zmax<<" "/*<< PartonEncoding */
<<" "/*<< pHadron->GetParticleName() */ <<G4endl;
#endif
G4double z(0.);
@@ -575,6 +593,7 @@ G4double G4QGSMFragmentation::GetLightConeZ(G4double zmin, G4double zmax, G4int
d1 = FFqq2qq[DiQold][absNewQuarkCode-1][0]; d2 = FFqq2qq[DiQold][absNewQuarkCode-1][1];
}
d2 +=lambda; // Uzhi June 2020
d1+=1.0; d2+=1.0;
invD1=1./d1; invD2=1./d2;
@@ -615,15 +634,16 @@ G4bool G4QGSMFragmentation::SplitLast(G4FragmentingString * string,
<<string->GetRightParton()->GetParticleName()<<G4endl;
#endif
G4int cClusterInterrupt = 0;
G4ParticleDefinition *LeftHadron = nullptr;
G4ParticleDefinition *RightHadron = nullptr;
const G4int maxNumberOfLoops = 1000;
G4int loopCounter = 0;
G4bool isOK = false;
G4double LeftHadronMass(0.); G4double RightHadronMass(0.);
do
{
if (cClusterInterrupt++ >= ClusterLoopInterrupt) return false; // Uzhi June 2020
LeftHadronMass = -MaxMass; RightHadronMass = -MaxMass;
G4ParticleDefinition * quark = nullptr;
@@ -640,8 +660,12 @@ G4bool G4QGSMFragmentation::SplitLast(G4FragmentingString * string,
quark = QuarkPair.second;
LeftHadron= hadronizer->BuildLowSpin(QuarkPair.first, string->GetLeftParton());
} else {
//... there is a Diquark on cluster ends
if ( LeftHadron == NULL ) continue; // Uzhi June 2020
RightHadron = hadronizer->BuildLowSpin(string->GetRightParton(), quark); // Uzhi June 2020
if ( RightHadron == NULL ) continue; // Uzhi June 2020
} else if( (!string->DecayIsQuark() && string->StableIsQuark() ) || // Uzhi June 2020
( string->DecayIsQuark() && !string->StableIsQuark() ) ) { // Uzhi June 2020
//... there is a Diquark on one of cluster ends
G4int IsParticle;
if ( string->StableIsQuark() ) {
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
@@ -657,27 +681,36 @@ G4bool G4QGSMFragmentation::SplitLast(G4FragmentingString * string,
//SetStrangenessSuppression((1.0-ProbSaS)/2.0);
quark = QuarkPair.second;
LeftHadron=hadronizer->BuildLowSpin(QuarkPair.first, string->GetLeftParton());
}
if ( LeftHadron != nullptr ) {
RightHadron = hadronizer->BuildLowSpin(string->GetRightParton(), quark);
if ( RightHadron != nullptr ) {
LeftHadronMass = LeftHadron->GetPDGMass();
RightHadronMass = RightHadron->GetPDGMass();
isOK = (ResidualMass > LeftHadronMass + RightHadronMass);
if ( LeftHadron == NULL ) continue; // Uzhi June 2020
RightHadron = hadronizer->BuildLowSpin(string->GetRightParton(), quark); // Uzhi June 2020
if ( RightHadron == NULL ) continue; // Uzhi June 2020
} else { // Diquark and anti-diquark are on the string ends // Uzhi June 2020
//+++++++++++++++++++++++++++++++ Inserted from FTF // Uzhi June 2020
// Uzhi G4double StringMass = string->Mass();
if (cClusterInterrupt++ >= ClusterLoopInterrupt) return false;
G4int LeftQuark1= string->GetLeftParton()->GetPDGEncoding()/1000;
G4int LeftQuark2=(string->GetLeftParton()->GetPDGEncoding()/100)%10;
G4int RightQuark1= string->GetRightParton()->GetPDGEncoding()/1000;
G4int RightQuark2=(string->GetRightParton()->GetPDGEncoding()/100)%10;
if (G4UniformRand()<0.5) {
LeftHadron =hadronizer->Build(FindParticle( LeftQuark1), FindParticle(RightQuark1));
RightHadron =hadronizer->Build(FindParticle( LeftQuark2), FindParticle(RightQuark2));
} else {
LeftHadron =hadronizer->Build(FindParticle( LeftQuark1), FindParticle(RightQuark2));
RightHadron =hadronizer->Build(FindParticle( LeftQuark2), FindParticle(RightQuark1));
}
if ( (LeftHadron == NULL) || (RightHadron == NULL) ) continue;
// End of inserting from FTF Uzhi June 2020
}
++loopCounter;
if ( loopCounter >= maxNumberOfLoops ) {
return false;
}
//... repeat procedure, if mass of cluster is too low to produce hadrons
//... ClusterMassCut = 0.15*GeV model parameter
LeftHadronMass = LeftHadron->GetPDGMass();
RightHadronMass = RightHadron->GetPDGMass();
//... repeat procedure, if mass of cluster is too low to produce hadrons
} while ( ( ResidualMass <= LeftHadronMass + RightHadronMass )
&& ++loopCounter < maxNumberOfLoops ); /* Loop checking, 07.08.2015, A.Ribon */
if ( loopCounter >= maxNumberOfLoops ) {
return false;
}
while (isOK == false);
/* Loop checking, 07.08.2015, A.Ribon */
//... compute hadron momenta and energies
G4LorentzVector LeftMom, RightMom;
@@ -704,6 +737,12 @@ G4bool G4QGSMFragmentation::SplitLast(G4FragmentingString * string,
void G4QGSMFragmentation::Sample4Momentum(G4LorentzVector* Mom , G4double Mass ,
G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass)
{
#ifdef debug_QGSMfragmentation // Uzhi June 2020
G4cout<<"Sample4Momentum Last-----------------------------------------"<<G4endl;
G4cout<<" StrMass "<<InitialMass<<" Mass1 "<<Mass<<" Mass2 "<<AntiMass<<G4endl;
G4cout<<" SumMass "<<Mass+AntiMass<<G4endl;
#endif
G4double r_val = sqr(InitialMass*InitialMass - Mass*Mass - AntiMass*AntiMass) - sqr(2.*Mass*AntiMass);
G4double Pabs = (r_val > 0.)? std::sqrt(r_val)/(2.*InitialMass) : 0;
@@ -55,13 +55,16 @@
#include "G4Exp.hh"
#include "G4Log.hh"
#include "G4HadronicException.hh"
//------------------------debug switches
//#define debug_VStringDecay
//********************************************************************************
//******************************************************************************
// Constructors
G4VLongitudinalStringDecay::G4VLongitudinalStringDecay() : ProbCCbar(0.0), ProbBBbar(0.0)
G4VLongitudinalStringDecay::G4VLongitudinalStringDecay(const G4String& name)
: G4HadronicInteraction(name), ProbCCbar(0.0), ProbBBbar(0.0)
{
MassCut = 210.0*MeV; // Mpi + Delta
@@ -117,38 +120,24 @@ G4VLongitudinalStringDecay::G4VLongitudinalStringDecay() : ProbCCbar(0.0), ProbB
SetMinMasses(); // Re-calculation of minimal mass of strings and weights of particles in 2-part. decays
Kappa = 1.0 * GeV/fermi;
DecayQuark = NewQuark = 0;
}
G4VLongitudinalStringDecay::~G4VLongitudinalStringDecay()
{
delete hadronizer;
}
G4HadFinalState*
G4VLongitudinalStringDecay::ApplyYourself(const G4HadProjectile&, G4Nucleus&)
{
return nullptr;
}
//=============================================================================
// Operators
//-----------------------------------------------------------------------------
G4bool G4VLongitudinalStringDecay::operator==(const G4VLongitudinalStringDecay &) const
{
throw G4HadronicException(__FILE__, __LINE__, "G4VLongitudinalStringDecay::operator== forbidden");
return false;
}
//-------------------------------------------------------------------------------------
G4bool G4VLongitudinalStringDecay::operator!=(const G4VLongitudinalStringDecay &) const
{
throw G4HadronicException(__FILE__, __LINE__, "G4VLongitudinalStringDecay::operator!= forbidden");
return true;
}
//***********************************************************************************
// For changing Mass Cut used for selection of very small mass strings
void G4VLongitudinalStringDecay::SetMassCut(G4double aValue){ MassCut=aValue; }
void G4VLongitudinalStringDecay::SetMassCut(G4double aValue){ MassCut=aValue; }
G4double G4VLongitudinalStringDecay::GetMassCut() { return MassCut; }
//-----------------------------------------------------------------------------
@@ -167,15 +156,15 @@ G4KineticTrackVector* G4VLongitudinalStringDecay::ProduceOneHadron(const G4Excit
#ifdef debug_VStringDecay
G4cout<<"G4VLongitudinalStringDecay::ProduceOneHadron: PossibleHmass StrMass "
<<aString.Mass()<<" MassCut "<<MassCut<<G4endl;
G4cout<<"G4VLongitudinalStringDecay::ProduceOneHadron: PossibleHmass StrMass WWW "
<<aString.Mass()<<G4endl;
#endif
SetMinimalStringMass(&aString); // Uzhi June 2020
if ( sqr(PossibleHadronMass(&aString,0,&hadrons)+MassCut) < aString.Mass2()) {
return 0;
}
// The string mass has low mass---------------------------
// The string mass has low value
result=new G4KineticTrackVector;
@@ -184,7 +173,7 @@ G4KineticTrackVector* G4VLongitudinalStringDecay::ProduceOneHadron(const G4Excit
// Substitute string by light hadron, Note that Energy is not conserved here!
#ifdef debug_VStringDecay
G4cout << "VlongSF Warning replacing string by single hadron (G4VLongitudinalStringDecay)" <<G4endl;
G4cout << "VlongSD Warning replacing string by single hadron (G4VLongitudinalStringDecay)" <<G4endl;
G4cout << hadrons.first->GetParticleName()<<G4endl
<< "string .. " << string->Get4Momentum() << " "
<< string->Get4Momentum().m() << G4endl;
@@ -195,11 +184,10 @@ G4KineticTrackVector* G4VLongitudinalStringDecay::ProduceOneHadron(const G4Excit
result->push_back( new G4KineticTrack( hadrons.first, 0, string->GetPosition(), Mom ) );
} else
{
// I do not know if this part work?
//... string was qq--qqbar type: Build two stable hadrons,
#ifdef debug_VStringDecay
G4cout << "VlongSF Warning replacing qq-qqbar string by TWO hadrons (G4VLongitudinalStringDecay)"
G4cout << "VlongSD Warning replacing qq-qqbar string by TWO hadrons (G4VLongitudinalStringDecay)"
<< hadrons.first->GetParticleName() << " / "
<< hadrons.second->GetParticleName()
<< "string .. " << string->Get4Momentum() << " "
@@ -230,7 +218,8 @@ G4double G4VLongitudinalStringDecay::PossibleHadronMass( const G4FragmentingStri
if ( build==0 ) build=&G4HadronBuilder::BuildLowSpin;
G4ParticleDefinition *Hadron1, *Hadron2=0;
G4ParticleDefinition* Hadron1 = nullptr;
G4ParticleDefinition* Hadron2 = nullptr;
if (!string->IsAFourQuarkString() )
{
@@ -238,24 +227,26 @@ G4double G4VLongitudinalStringDecay::PossibleHadronMass( const G4FragmentingStri
Hadron1 = (hadronizer->*build)(string->GetLeftParton(), string->GetRightParton());
#ifdef debug_VStringDecay
G4cout<<"VlongSF Quarks at the string ends "<<string->GetLeftParton()->GetParticleName()
G4cout<<"VlongSD PossibleHadronMass"<<G4endl;
G4cout<<"VlongSD Quarks at the string ends "<<string->GetLeftParton()->GetParticleName()
<<" "<<string->GetRightParton()->GetParticleName()<<G4endl;
if ( Hadron1 != NULL) {
if ( Hadron1 != nullptr) {
G4cout<<"(G4VLongitudinalStringDecay) Hadron "<<Hadron1->GetParticleName()
<<" "<<Hadron1->GetPDGMass()<<G4endl;
}
#endif
if ( Hadron1 != NULL) { mass = (Hadron1)->GetPDGMass();}
if ( Hadron1 != nullptr) { mass = (Hadron1)->GetPDGMass();}
else { mass = MaxMass;}
} else
{
//... string is qq--qqbar: Build two stable hadrons,
//... with extra uubar or ddbar quark pair
#ifdef debug_VStringDecay
G4cout<<"VlongSF string is qq--qqbar: Build two stable hadrons"<<G4endl;
G4cout<<"VlongSD PossibleHadronMass"<<G4endl;
G4cout<<"VlongSD string is qq--qqbar: Build two stable hadrons"<<G4endl;
#endif
/* // Uzhi June 2020
G4int iflc = (G4UniformRand() < 0.5)? 1 : 2;
if (string->GetLeftParton()->GetPDGEncoding() < 0) iflc = -iflc;
@@ -263,12 +254,43 @@ G4double G4VLongitudinalStringDecay::PossibleHadronMass( const G4FragmentingStri
Hadron1 = (hadronizer->*build)(string->GetLeftParton(), FindParticle(iflc));
Hadron2 = (hadronizer->*build)(string->GetRightParton(), FindParticle(-iflc));
if ( (Hadron1 != NULL) && (Hadron2 != NULL) ) { mass = (Hadron1)->GetPDGMass() + (Hadron2)->GetPDGMass();}
if ( (Hadron1 != nullptr) && (Hadron2 != nullptr) ) { mass = (Hadron1)->GetPDGMass() + (Hadron2)->GetPDGMass();}
else { mass = MaxMass;}
return mass;
*/ // Uzhi June 2020
//+++++++++++++++++++++++++++++++ // Uzhi June 2020 Start
G4double StringMass = string->Mass();
G4int cClusterInterrupt = 0;
do
{
if (cClusterInterrupt++ >= ClusterLoopInterrupt) return false;
G4int LeftQuark1= string->GetLeftParton()->GetPDGEncoding()/1000;
G4int LeftQuark2=(string->GetLeftParton()->GetPDGEncoding()/100)%10;
G4int RightQuark1= string->GetRightParton()->GetPDGEncoding()/1000;
G4int RightQuark2=(string->GetRightParton()->GetPDGEncoding()/100)%10;
if (G4UniformRand()<0.5) {
Hadron1 =hadronizer->Build(FindParticle(LeftQuark1), FindParticle(RightQuark1));
Hadron2 =hadronizer->Build(FindParticle(LeftQuark2), FindParticle(RightQuark2));
} else {
Hadron1 =hadronizer->Build(FindParticle(LeftQuark1), FindParticle(RightQuark2));
Hadron2 =hadronizer->Build(FindParticle(LeftQuark2), FindParticle(RightQuark1));
}
if ( (Hadron1 == nullptr) || (Hadron2 == nullptr) ) continue;
//... repeat procedure, if mass of cluster is too low to produce hadrons
//... ClusterMassCut = 0.15*GeV model parameter
}
while ((StringMass <= Hadron1->GetPDGMass() + Hadron2->GetPDGMass()));
mass = (Hadron1)->GetPDGMass() + (Hadron2)->GetPDGMass();
//+++++++++++++++++++++++++++++++ // Uzhi June 2020 End
}
#ifdef debug_VStringDecay
G4cout<<"VlongSF *Hadrons 1 and 2, proposed mass "<<Hadron1<<" "<<Hadron2<<" "<<mass<<G4endl;
G4cout<<"VlongSD *Hadrons 1 and 2, proposed mass "<<Hadron1<<" "<<Hadron2<<" "<<mass<<G4endl;
#endif
if ( pdefs != 0 )
@@ -301,7 +323,7 @@ G4ParticleDefinition* G4VLongitudinalStringDecay::FindParticle(G4int Encoding)
G4ParticleDefinition* ptr = G4ParticleTable::GetParticleTable()->FindParticle(Encoding);
if (ptr == NULL)
if (ptr == nullptr)
{
for (size_t i=0; i < NewParticles.size(); i++)
{
@@ -341,7 +363,7 @@ G4ParticleDefinition * G4VLongitudinalStringDecay::QuarkSplitup( G4ParticleDefin
G4ParticleDefinition *&created )
{
#ifdef debug_VStringDecay
G4cout<<"VlongSF QuarkSplitup: quark ID "<<decay->GetPDGEncoding()<<G4endl;
G4cout<<"VlongSD QuarkSplitup: quark ID "<<decay->GetPDGEncoding()<<G4endl;
#endif
G4int IsParticle=(decay->GetPDGEncoding()>0) ? -1 : +1; // if we have a quark, we need antiquark (or diquark)
@@ -353,7 +375,7 @@ G4ParticleDefinition * G4VLongitudinalStringDecay::QuarkSplitup( G4ParticleDefin
NewQuark = created->GetPDGEncoding();
#ifdef debug_VStringDecay
G4cout<<"VlongSF QuarkSplitup: "<<decay->GetPDGEncoding()<<" -> "<<QuarkPair.second->GetPDGEncoding()<<G4endl;
G4cout<<"VlongSD QuarkSplitup: "<<decay->GetPDGEncoding()<<" -> "<<QuarkPair.second->GetPDGEncoding()<<G4endl;
G4cout<<"hadronizer->Build(QuarkPair.first, decay)"<<G4endl;
#endif
return hadronizer->Build(QuarkPair.first, decay);
@@ -369,7 +391,7 @@ CreatePartonPair(G4int NeedParticle,G4bool AllowDiquarks)
{
// Create a Diquark - AntiDiquark pair , first in pair is anti to IsParticle
#ifdef debug_VStringDecay
G4cout<<"VlongSF Create a Diquark - AntiDiquark pair"<<G4endl;
G4cout<<"VlongSD Create a Diquark - AntiDiquark pair"<<G4endl;
#endif
G4int q1(0), q2(0), spin(0), PDGcode(0);
@@ -385,7 +407,7 @@ CreatePartonPair(G4int NeedParticle,G4bool AllowDiquarks)
} else {
// Create a Quark - AntiQuark pair, first in pair IsParticle
#ifdef debug_VStringDecay
G4cout<<"VlongSF Create a Quark - AntiQuark pair"<<G4endl;
G4cout<<"VlongSD Create a Quark - AntiQuark pair"<<G4endl;
#endif
G4int PDGcode=SampleQuarkFlavor()*NeedParticle;
return pDefPair (FindParticle(PDGcode),FindParticle(-PDGcode));
@@ -405,7 +427,7 @@ G4int G4VLongitudinalStringDecay::SampleQuarkFlavor(void)
quark = 1 + (int)(G4UniformRand()/StrangeSuppress);
}
#ifdef debug_VStringDecay
G4cout<<"VlongSF SampleQuarkFlavor "<<quark<<" (ProbCB ProbCCbar ProbBBbar "<<ProbCB
G4cout<<"VlongSD SampleQuarkFlavor "<<quark<<" (ProbCB ProbCCbar ProbBBbar "<<ProbCB
<<" "<<ProbCCbar<<" "<<ProbBBbar<<" )"<<G4endl;
#endif
return quark;
@@ -620,11 +642,11 @@ void G4VLongitudinalStringDecay::SetMinMasses()
Code1 = 100*i + 10*1 + 1;
hadron1 = FindParticle(Code1);
if (hadron1 != NULL) {
if (hadron1 != nullptr) {
for (G4int j=1; j < 6; j++) {
Code2 = 100*j + 10*1 + 1;
hadron2 = FindParticle(Code2);
if (hadron2 != NULL) {
if (hadron2 != nullptr) {
minMassQQbarStr[i-1][j-1] = hadron1->GetPDGMass() + hadron2->GetPDGMass() + 70.0 * MeV;
}
}
@@ -653,15 +675,15 @@ void G4VLongitudinalStringDecay::SetMinMasses()
hadron2 = G4ParticleTable::GetParticleTable()->FindParticle(Code2);
hadron3 = G4ParticleTable::GetParticleTable()->FindParticle(Code2 + 2);
if ((hadron2 == NULL) && (hadron3 == NULL)) {minMassQDiQStr[i-1][j-1][k-1] = MaxMass; continue;};
if ((hadron2 == nullptr) && (hadron3 == nullptr)) {minMassQDiQStr[i-1][j-1][k-1] = MaxMass; continue;};
if ((hadron2 != NULL) && (hadron3 != NULL)) {
if ((hadron2 != nullptr) && (hadron3 != nullptr)) {
if (hadron2->GetPDGMass() > hadron3->GetPDGMass() ) { hadron2 = hadron3; }
};
if ((hadron2 != NULL) && (hadron3 == NULL)) {};
if ((hadron2 != nullptr) && (hadron3 == nullptr)) {};
if ((hadron2 == NULL) && (hadron3 != NULL)) {hadron2 = hadron3;};
if ((hadron2 == nullptr) && (hadron3 != nullptr)) {hadron2 = hadron3;};
minMassQDiQStr[i-1][j-1][k-1] = hadron1->GetPDGMass() + hadron2->GetPDGMass() + 70.0 * MeV;
}
@@ -917,12 +939,12 @@ void G4VLongitudinalStringDecay::SetMinMasses()
G4ParticleTable::GetParticleTable()->FindParticle(Baryon[i][j][k][l]);
/*
G4cout<<i<<" "<<j<<" "<<k<<" "<<l<<" "<<Baryon[i][j][k][l]<<" "<<TestHadron<<" "<<BaryonWeight[i][j][k][l];
if (TestHadron != NULL) G4cout<<" "<<TestHadron->GetParticleName();
if ((TestHadron == NULL)&&(Baryon[i][j][k][l] != 0)) G4cout<<" *****";
if ((TestHadron == NULL)&&(Baryon[i][j][k][l] == 0)) G4cout<<" ---------------";
if (TestHadron != nullptr) G4cout<<" "<<TestHadron->GetParticleName();
if ((TestHadron == nullptr)&&(Baryon[i][j][k][l] != 0)) G4cout<<" *****";
if ((TestHadron == nullptr)&&(Baryon[i][j][k][l] == 0)) G4cout<<" ---------------";
G4cout<<G4endl;
*/
if ((TestHadron == NULL)&&(Baryon[i][j][k][l] != 0)) Baryon[i][j][k][l] = 0;
if ((TestHadron == nullptr)&&(Baryon[i][j][k][l] != 0)) Baryon[i][j][k][l] = 0;
}
}
}
@@ -950,8 +972,27 @@ void G4VLongitudinalStringDecay::SetMinMasses()
void G4VLongitudinalStringDecay::SetMinimalStringMass(const G4FragmentingString * const string)
{
//MaxMass = -350.0*GeV;
G4double EstimatedMass=0.;
G4double EstimatedMass=MaxMass; // Uzhi June 2020 0.->MaxMass;
// Uzhi June 2020 Start
G4ParticleDefinition* LeftParton = string->GetLeftParton();
G4ParticleDefinition* RightParton = string->GetRightParton();
if( LeftParton->GetParticleSubType() == RightParton->GetParticleSubType() ) { // q qbar, qq qqbar
if( LeftParton->GetPDGEncoding() * RightParton->GetPDGEncoding() > 0 ) {
// Not allowed combination of the partons
throw G4HadronicException(__FILE__, __LINE__,
"G4VLongitudinalStringDecay::SetMinimalStringMass: Illegal quark content as input");
}
}
if( LeftParton->GetParticleSubType() != RightParton->GetParticleSubType() ) { // q qq, qbar qqbar
if( LeftParton->GetPDGEncoding() * RightParton->GetPDGEncoding() < 0 ) {
// Not allowed combination of the partons
throw G4HadronicException(__FILE__, __LINE__,
"G4VLongitudinalStringDecay::SetMinimalStringMass: Illegal quark content as input");
}
}
// Uzhi June 2020 End
G4int Qleft =std::abs(string->GetLeftParton()->GetPDGEncoding());
G4int Qright=std::abs(string->GetRightParton()->GetPDGEncoding());