Import Geant4 8.3.0 source tree
This commit is contained in:
+13
-14
@@ -119,34 +119,33 @@ EnergyAndMomentumCorrector(G4KineticTrackVector* Output, G4LorentzVector& TotalC
|
||||
HadronMom.setE(E);
|
||||
Output->operator[](cHadron)->Set4Momentum(HadronMom);
|
||||
Sum += E;
|
||||
}
|
||||
}
|
||||
Scale = TotalCollisionMass/Sum;
|
||||
if (Scale - 1 <= ErrLimit)
|
||||
#ifdef debug_G4ExcitedStringDecay
|
||||
G4cout << "Scale-1=" << Scale -1
|
||||
<< ", TotalCollisionMass=" << TotalCollisionMass
|
||||
<< ", Sum=" << Sum
|
||||
<< G4endl;
|
||||
#endif
|
||||
if (std::fabs(Scale - 1) <= ErrLimit)
|
||||
{
|
||||
success = true;
|
||||
break;
|
||||
}
|
||||
#ifdef debug_G4ExcitedStringDecay
|
||||
std::cout << "Scale-1=" << Scale -1
|
||||
<< ", TotalCollisionMass=" << TotalCollisionMass
|
||||
<< ", Sum=" << Sum
|
||||
<< std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
if(!success)
|
||||
{
|
||||
G4cout << "G4ExcitedStringDecay::EnergyAndMomentumCorrector - Warning"<<G4endl;
|
||||
G4cout << " Scale not unity at end of iteration loop: "<<TotalCollisionMass<<" "<<Sum<<" "<<Scale<<G4endl;
|
||||
G4cout << " Number of secondaries: " << Output->size() << G4endl;
|
||||
G4cout << " Wanted total energy: " << TotalCollisionMom.e() << G4endl;
|
||||
G4cout << " Increase number of attempts or increase ERRLIMIT"<<G4endl;
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4ExcitedStringDecay failed to correct...");
|
||||
// throw G4HadronicException(__FILE__, __LINE__, "G4ExcitedStringDecay failed to correct...");
|
||||
}
|
||||
|
||||
// Compute c.m.s. interaction velocity and KTV back boost
|
||||
Beta = TotalCollisionMom.boostVector();
|
||||
Beta = TotalCollisionMom.boostVector();
|
||||
Output->Boost(Beta);
|
||||
return TRUE;
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+502
-10
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4LundStringFragmentation.cc,v 1.5 2006/06/29 20:55:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4LundStringFragmentation.cc,v 1.7 2007/04/24 14:55:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -33,6 +33,10 @@
|
||||
// History: first implementation, Maxim Komogorov, 10-Jul-1998
|
||||
// -----------------------------------------------------------------------------
|
||||
#include "G4LundStringFragmentation.hh"
|
||||
#include "G4FragmentingString.hh"
|
||||
#include "G4DiQuarks.hh"
|
||||
#include "G4Quarks.hh"
|
||||
|
||||
#include "Randomize.hh"
|
||||
|
||||
// Class G4LundStringFragmentation
|
||||
@@ -40,6 +44,11 @@
|
||||
|
||||
G4LundStringFragmentation::G4LundStringFragmentation()
|
||||
{
|
||||
MinimalStringMass = 0.; // Uzhi
|
||||
MinimalStringMass2 = 0.; // Uzhi
|
||||
WminLUND = 1.*GeV; // Uzhi
|
||||
SmoothParam = 0.2; // Uzhi
|
||||
|
||||
}
|
||||
|
||||
// G4LundStringFragmentation::G4LundStringFragmentation(G4double sigmaPt)
|
||||
@@ -75,8 +84,136 @@ int G4LundStringFragmentation::operator!=(const G4LundStringFragmentation &right
|
||||
}
|
||||
|
||||
//****************************************************************************************
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4double G4LundStringFragmentation::GetLightConeZ(G4double zmin, G4double zmax, G4int , G4ParticleDefinition* pHadron, G4double Px, G4double Py)
|
||||
G4KineticTrackVector* G4LundStringFragmentation::FragmentString(const G4ExcitedString& theString)
|
||||
{
|
||||
|
||||
//G4cout<<"In FragmentString"<<G4endl;
|
||||
|
||||
// Can no longer modify Parameters for Fragmentation.
|
||||
PastInitPhase=true;
|
||||
|
||||
// check if string has enough mass to fragment...
|
||||
G4KineticTrackVector * LeftVector=LightFragmentationTest(&theString);
|
||||
if ( LeftVector != 0 ) {
|
||||
//G4cout<<"Return single hadron from string"<<G4endl;
|
||||
return LeftVector;}
|
||||
|
||||
LeftVector = new G4KineticTrackVector;
|
||||
G4KineticTrackVector * RightVector=new G4KineticTrackVector;
|
||||
|
||||
// this should work but its only a semi deep copy. %GF G4ExcitedString theStringInCMS(theString);
|
||||
G4ExcitedString *theStringInCMS=CPExcited(theString);
|
||||
G4LorentzRotation toCms=theStringInCMS->TransformToAlignedCms();
|
||||
|
||||
G4bool success=false, inner_sucess=true;
|
||||
G4int attempt=0;
|
||||
while ( !success && attempt++ < StringLoopInterrupt )
|
||||
{
|
||||
G4FragmentingString *currentString=new G4FragmentingString(*theStringInCMS);
|
||||
|
||||
//G4cout<<"Main FragmentString cur M2 "<<std::sqrt(currentString->Mass2())<<G4endl;
|
||||
|
||||
std::for_each(LeftVector->begin(), LeftVector->end(), DeleteKineticTrack());
|
||||
LeftVector->clear();
|
||||
std::for_each(RightVector->begin(), RightVector->end(), DeleteKineticTrack());
|
||||
RightVector->clear();
|
||||
|
||||
inner_sucess=true; // set false on failure..
|
||||
while (! StopFragmenting(currentString) )
|
||||
{ // Split current string into hadron + new string
|
||||
|
||||
// G4FragmentingString *PreviousString=currentString; // Uzhi
|
||||
|
||||
G4FragmentingString *newString=0; // used as output from SplitUp...
|
||||
|
||||
//G4cout<<"FragmentString to Splitup ===================================="<<G4endl;
|
||||
//G4int Uzhi; G4cin>>Uzhi; // Uzhi
|
||||
G4KineticTrack * Hadron=Splitup(currentString,newString);
|
||||
//G4cout<<" Hadron "<<Hadron<<G4endl;
|
||||
|
||||
// if ( Hadron != 0 && IsFragmentable(newString)) // Uzhi
|
||||
if ( Hadron != 0 ) // Uzhi
|
||||
{
|
||||
if ( currentString->GetDecayDirection() > 0 )
|
||||
LeftVector->push_back(Hadron);
|
||||
else
|
||||
RightVector->push_back(Hadron);
|
||||
delete currentString;
|
||||
currentString=newString;
|
||||
} /* else { // Uzhi
|
||||
// abandon ... start from the beginning
|
||||
if (newString) delete newString; // ??? Uzhi local?
|
||||
if (Hadron) delete Hadron;
|
||||
// currentString = PreviousString; // Uzhi
|
||||
inner_sucess=false;
|
||||
break;
|
||||
} */ // Uzhi
|
||||
// delete PreviousString; // ??? Uzhi local?
|
||||
};
|
||||
// Split current string into 2 final Hadrons
|
||||
//G4cout<<"FragmentString to SplitLast if inner_sucess#0"<<inner_sucess<<G4endl;
|
||||
if ( inner_sucess && // Uzhi
|
||||
SplitLast(currentString,LeftVector, RightVector) )
|
||||
{
|
||||
success=true;
|
||||
}
|
||||
delete currentString;
|
||||
}
|
||||
|
||||
delete theStringInCMS;
|
||||
|
||||
if ( ! success )
|
||||
{
|
||||
std::for_each(LeftVector->begin(), LeftVector->end(), DeleteKineticTrack());
|
||||
LeftVector->clear();
|
||||
std::for_each(RightVector->begin(), RightVector->end(), DeleteKineticTrack());
|
||||
delete RightVector;
|
||||
return LeftVector;
|
||||
}
|
||||
|
||||
// Join Left- and RightVector into LeftVector in correct order.
|
||||
while(!RightVector->empty())
|
||||
{
|
||||
LeftVector->push_back(RightVector->back());
|
||||
RightVector->erase(RightVector->end()-1);
|
||||
}
|
||||
delete RightVector;
|
||||
|
||||
//G4cout<<"CalculateHadronTimePosition"<<G4endl;
|
||||
|
||||
CalculateHadronTimePosition(theString.Get4Momentum().mag(), LeftVector);
|
||||
|
||||
G4LorentzRotation toObserverFrame(toCms.inverse());
|
||||
|
||||
for(size_t C1 = 0; C1 < LeftVector->size(); C1++)
|
||||
{
|
||||
G4KineticTrack* Hadron = LeftVector->operator[](C1);
|
||||
G4LorentzVector Momentum = Hadron->Get4Momentum();
|
||||
Momentum = toObserverFrame*Momentum;
|
||||
Hadron->Set4Momentum(Momentum);
|
||||
G4LorentzVector Coordinate(Hadron->GetPosition(), Hadron->GetFormationTime());
|
||||
Momentum = toObserverFrame*Coordinate;
|
||||
Hadron->SetFormationTime(Momentum.e());
|
||||
G4ThreeVector aPosition(Momentum.vect());
|
||||
Hadron->SetPosition(theString.GetPosition()+aPosition);
|
||||
}
|
||||
|
||||
//G4cout<<"Out FragmentString"<<G4endl;
|
||||
return LeftVector;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
//G4double G4LundStringFragmentation::GetLightConeZ(G4double zmin, G4double zmax, // Uzhi
|
||||
// G4int , G4ParticleDefinition* pHadron, // Uzhi
|
||||
G4double G4LundStringFragmentation::GetLightConeZ(G4double zmin, G4double zmax,
|
||||
G4int, G4ParticleDefinition* pHadron, // Uzhi
|
||||
G4double Px, G4double Py)
|
||||
{
|
||||
const G4double alund = 0.7/GeV/GeV;
|
||||
|
||||
@@ -89,14 +226,369 @@ G4double G4LundStringFragmentation::GetLightConeZ(G4double zmin, G4double zmax,
|
||||
G4double Mt2 = Px*Px + Py*Py + Mass*Mass;
|
||||
G4double zOfMaxyf=alund*Mt2/(alund*Mt2 + 1.);
|
||||
G4double maxYf=(1-zOfMaxyf)/zOfMaxyf * std::exp(-alund*Mt2/zOfMaxyf);
|
||||
do
|
||||
{
|
||||
z = zmin + G4UniformRand()*(zmax-zmin);
|
||||
// yf = std::pow(1. - z, blund)/z*std::exp(-alund*Mt2/z);
|
||||
yf = (1-z)/z * std::exp(-alund*Mt2/z);
|
||||
}
|
||||
while (G4UniformRand()*maxYf > yf);
|
||||
|
||||
// G4double N=1.; // Uzhi
|
||||
// G4double OverN=1./N; // Uzhi
|
||||
// G4double ZminN=std::pow(zmin,N); // Uzhi
|
||||
// G4double ZmaxN=std::pow(zmax,N); // Uzhi
|
||||
// G4double Brac=ZmaxN-ZminN; // Uzhi
|
||||
|
||||
//G4cout<<" ZminN ZmaxN Brac Code "<<ZminN<<" "<< ZmaxN<<" "<<Brac<<" "<<PartonEncoding<<G4endl;
|
||||
|
||||
// if(std::abs(PartonEncoding) < 1000) // Uzhi
|
||||
{ // Uzhi q or q-bar
|
||||
//G4cout<<" quark "<<G4endl; // Vova
|
||||
do // Uzhi
|
||||
{
|
||||
z = zmin + G4UniformRand()*(zmax-zmin);
|
||||
// yf = std::pow(1. - z, blund)/z*std::exp(-alund*Mt2/z);
|
||||
yf = (1-z)/z * std::exp(-alund*Mt2/z);
|
||||
}
|
||||
while (G4UniformRand()*maxYf > yf);
|
||||
} // Uzhi
|
||||
// else // Uzhi
|
||||
// { // Uzhi qq or qq-bar
|
||||
// //G4cout<<"Di-quark"<<G4endl; // Vova
|
||||
// z = std::pow(Brac * G4UniformRand() + ZminN, OverN); // Uzhi
|
||||
// }; // Uzhi
|
||||
//
|
||||
//G4cout<<" test z "<<std::pow(2.,3.)<<" "<<z<<G4endl; // Vova
|
||||
return z;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
G4LorentzVector * G4LundStringFragmentation::SplitEandP(G4ParticleDefinition * pHadron,
|
||||
G4FragmentingString * string)
|
||||
{
|
||||
G4double HadronMass = pHadron->GetPDGMass();
|
||||
SetMinimalStringMass(string); // Uzhi
|
||||
G4double StringMass2 = string->Mass2(); // Uzhi
|
||||
|
||||
//G4cout<<"SplitEandP string mass "<<string->Mass()<<" Hadron mass "<<HadronMass<<pHadron->GetParticleName()<<G4endl; // Uzhi
|
||||
//G4cout<<string->GetLeftParton()->GetPDGEncoding()<<" "<<G4endl;
|
||||
//G4cout<<string->GetRightParton()->GetPDGEncoding()<<" "<<G4endl;
|
||||
//G4cout<<" Min string mass "<<MinimalStringMass<<G4endl;
|
||||
|
||||
// calculate and assign hadron transverse momentum component HadronPx andHadronPy
|
||||
G4ThreeVector thePt;
|
||||
thePt=SampleQuarkPt();
|
||||
|
||||
G4ThreeVector HadronPt = thePt +string->DecayPt();
|
||||
HadronPt.setZ(0);
|
||||
//... sample z to define hadron longitudinal momentum and energy
|
||||
//... but first check the available phase space
|
||||
|
||||
// G4double DecayQuarkMass2 = sqr(string->GetDecayParton()->GetPDGMass());
|
||||
|
||||
//G4cout<<" QuarkMass "<<string->GetDecayParton()->GetPDGMass()<<G4endl; // Uzhi
|
||||
|
||||
G4double HadronMass2T = sqr(HadronMass) + HadronPt.mag2();
|
||||
// G4double ResidualMass2T=sqr(MinimalStringMass + WminLUND) + HadronPt.mag2(); // Uzhi
|
||||
G4double ResidualMass2T=sqr(MinimalStringMass + WminLUND) + HadronPt.mag2(); // Uzhi
|
||||
|
||||
//G4cout<<" Mt h res str "<<std::sqrt(HadronMass2T)<<" "<<std::sqrt(ResidualMass2T)<<" srt mass"<<string->Mass()<<G4endl;
|
||||
|
||||
// if (DecayQuarkMass2 + HadronMass2T >= SmoothParam*(string->Mass2()) ) // Uzhi
|
||||
|
||||
G4double Pz2 = (sqr(StringMass2 - HadronMass2T - ResidualMass2T) - // Uzhi
|
||||
4*HadronMass2T * ResidualMass2T)/4./StringMass2; // Uzhi
|
||||
|
||||
//G4cout<<" Pz**2 "<<Pz2<<G4endl;
|
||||
|
||||
if(Pz2 < 0 ) {return 0;} // have to start all over! // Uzhi
|
||||
|
||||
//... then compute allowed z region z_min <= z <= z_max
|
||||
|
||||
G4double Pz = std::sqrt(Pz2); // Uzhi
|
||||
G4double zMin = (std::sqrt(HadronMass2T+Pz2) - Pz)/std::sqrt(StringMass2); // Uzhi
|
||||
G4double zMax = (std::sqrt(HadronMass2T+Pz2) + Pz)/std::sqrt(StringMass2); // Uzhi
|
||||
|
||||
//G4cout<<" Zmin max "<<zMin<<" "<<zMax<<G4endl; // Uzhi
|
||||
|
||||
// G4double zMax = 1. - DecayQuarkMass2/(string->Mass2()); // Uzhi
|
||||
if (zMin >= zMax) return 0; // have to start all over!
|
||||
|
||||
G4double z = GetLightConeZ(zMin, zMax,
|
||||
string->GetDecayParton()->GetPDGEncoding(), pHadron,
|
||||
HadronPt.x(), HadronPt.y());
|
||||
|
||||
//... now compute hadron longitudinal momentum and energy
|
||||
// longitudinal hadron momentum component HadronPz
|
||||
|
||||
HadronPt.setZ(0.5* string->GetDecayDirection() *
|
||||
(z * string->LightConeDecay() -
|
||||
HadronMass2T/(z * string->LightConeDecay())));
|
||||
|
||||
G4double HadronE = 0.5* (z * string->LightConeDecay() +
|
||||
HadronMass2T/(z * string->LightConeDecay()));
|
||||
|
||||
G4LorentzVector * a4Momentum= new G4LorentzVector(HadronPt,HadronE);
|
||||
|
||||
//G4cout<<"Out of SplitEandP Pz E "<<HadronPt.getZ()<<" "<<0.5* (z * string->LightConeDecay() + HadronMass2T/(z * string->LightConeDecay()))<<G4endl;
|
||||
|
||||
return a4Momentum;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4LundStringFragmentation::SplitLast(G4FragmentingString * string,
|
||||
G4KineticTrackVector * LeftVector,
|
||||
G4KineticTrackVector * RightVector)
|
||||
{
|
||||
//... perform last cluster decay
|
||||
//G4cout<<"SplitLast String mass "<<string->Mass()<<G4endl;
|
||||
//G4cout<<string->GetLeftParton()->GetPDGEncoding()<<" "<<G4endl;
|
||||
//G4cout<<string->GetRightParton()->GetPDGEncoding()<<" "<<G4endl;
|
||||
|
||||
G4ThreeVector ClusterVel =string->Get4Momentum().boostVector();
|
||||
|
||||
G4double ResidualMass = string->Mass();
|
||||
// G4double ClusterMassCut = ClusterMass;
|
||||
|
||||
G4int cClusterInterrupt = 0;
|
||||
|
||||
G4ParticleDefinition * LeftHadron, * RightHadron;
|
||||
do
|
||||
{
|
||||
//G4cout<<" Cicle "<<cClusterInterrupt<<" "<< ClusterLoopInterrupt<<G4endl;
|
||||
|
||||
if (cClusterInterrupt++ >= ClusterLoopInterrupt)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
G4ParticleDefinition * quark = NULL;
|
||||
string->SetLeftPartonStable(); // to query quark contents..
|
||||
|
||||
if (string->DecayIsQuark() && string->StableIsQuark() )
|
||||
{
|
||||
//... there are quarks on cluster ends
|
||||
LeftHadron= QuarkSplitup(string->GetLeftParton(), quark);
|
||||
} else {
|
||||
//... there is a Diquark on cluster ends
|
||||
G4int IsParticle;
|
||||
|
||||
if ( string->StableIsQuark() ) {
|
||||
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
|
||||
} else {
|
||||
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? +1 : -1;
|
||||
}
|
||||
|
||||
pDefPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted
|
||||
quark = QuarkPair.second;
|
||||
|
||||
LeftHadron=hadronizer->Build(QuarkPair.first, string->GetLeftParton());
|
||||
}
|
||||
|
||||
RightHadron = hadronizer->Build(string->GetRightParton(), quark);
|
||||
|
||||
//G4cout<<"SplitLast Left Right hadrons "<<LeftHadron->GetPDGEncoding()<<" "<<RightHadron->GetPDGEncoding()<<G4endl;
|
||||
//G4cout<<"SplitLast Left Right hadrons "<<LeftHadron->GetPDGMass()<<" "<<RightHadron->GetPDGMass()<<G4endl;
|
||||
//G4cout<<" Sum H mass Str Mass "<<LeftHadron->GetPDGMass() + RightHadron->GetPDGMass()<<" "<<ResidualMass<<G4endl;
|
||||
|
||||
//... repeat procedure, if mass of cluster is too low to produce hadrons
|
||||
//... ClusterMassCut = 0.15*GeV model parameter
|
||||
// if ( quark->GetParticleSubType()== "quark" ) {ClusterMassCut = 0.;} // Uzhi
|
||||
// else {ClusterMassCut = ClusterMass;} // Uzhi
|
||||
|
||||
}
|
||||
while (ResidualMass <= LeftHadron->GetPDGMass() + RightHadron->GetPDGMass()); // Uzhi VOVA
|
||||
// while (ResidualMass <= LeftHadron->GetPDGMass() + RightHadron->GetPDGMass() + ClusterMassCut); // Uzhi
|
||||
//... compute hadron momenta and energies
|
||||
|
||||
G4LorentzVector LeftMom, RightMom;
|
||||
G4ThreeVector Pos;
|
||||
|
||||
//G4cout<<"Sample4Momentum"<<G4endl;
|
||||
|
||||
Sample4Momentum(&LeftMom, LeftHadron->GetPDGMass(), &RightMom, RightHadron->GetPDGMass(), ResidualMass);
|
||||
|
||||
LeftMom.boost(ClusterVel);
|
||||
RightMom.boost(ClusterVel);
|
||||
|
||||
LeftVector->push_back(new G4KineticTrack(LeftHadron, 0, Pos, LeftMom));
|
||||
RightVector->push_back(new G4KineticTrack(RightHadron, 0, Pos, RightMom));
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4LundStringFragmentation::IsFragmentable(const G4FragmentingString * const string)
|
||||
{
|
||||
//G4cout<<"In IsFragmentable"<<G4endl;
|
||||
SetMinimalStringMass(string); // Uzhi
|
||||
//G4cout<<"Out IsFragmentable MinMass"<<MinimalStringMass<<" String Mass"<<std::sqrt(string->Get4Momentum().mag2())<<G4endl;
|
||||
return sqr(MinimalStringMass + WminLUND) < string->Get4Momentum().mag2(); // Uzhi
|
||||
|
||||
// return sqr(FragmentationMass(string)+MassCut) < // Uzhi
|
||||
// string->Mass2(); // Uzhi
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4LundStringFragmentation::StopFragmenting(const G4FragmentingString * const string)
|
||||
{
|
||||
//G4cout<<"StopFragmenting"<<G4endl;
|
||||
|
||||
SetMinimalStringMass(string); // Uzhi
|
||||
//G4cout<<"StopFragm MinMass "<<MinimalStringMass<<" String Mass "<<std::sqrt(string->Get4Momentum().mag2())<<G4endl;
|
||||
return sqr((MinimalStringMass + WminLUND)*(1 + SmoothParam * (1.-2*G4UniformRand()))) > // Uzhi
|
||||
string->Get4Momentum().mag2(); // Uzhi
|
||||
// sqr(FragmentationMass(string,&G4HadronBuilder::BuildHighSpin)+MassCut) > // Uzhi
|
||||
// string->Get4Momentum().mag2(); // Uzhi
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
void G4LundStringFragmentation::Sample4Momentum(G4LorentzVector* Mom, G4double Mass, G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass)
|
||||
{
|
||||
G4ThreeVector Pt; // Uzhi
|
||||
G4double MassMt2, AntiMassMt2; // Uzhi
|
||||
G4double AvailablePz, AvailablePz2; // Uzhi
|
||||
|
||||
//G4cout<<" Smpl4Mom "<<Mass<<" "<<AntiMass<<" "<<InitialMass<<G4endl;
|
||||
// Uzhi
|
||||
do // Uzhi
|
||||
{ // Uzhi
|
||||
Pt=SampleQuarkPt(); Pt.setZ(0); G4double Pt2=Pt.mag2(); // Uzhi
|
||||
|
||||
//G4cout<<"Sample4Momentum Pt x y "<<Pt.getX()<<" "<<Pt.getY()<<G4endl;
|
||||
|
||||
MassMt2 = Mass * Mass + Pt2; // Uzhi
|
||||
AntiMassMt2= AntiMass * AntiMass + Pt2; // Uzhi
|
||||
|
||||
//G4cout<<"Mts "<<MassMt2<<" "<<AntiMassMt2<<" "<<InitialMass*InitialMass<<G4endl;
|
||||
|
||||
AvailablePz2= sqr(InitialMass*InitialMass - MassMt2 - AntiMassMt2) -
|
||||
4.*MassMt2*AntiMassMt2; // Uzhi
|
||||
} // Uzhi
|
||||
while(AvailablePz2 < 0.); // Uzhi
|
||||
// Uzhi
|
||||
AvailablePz2 /=(4.*InitialMass*InitialMass); // Uzhi
|
||||
// Uzhi
|
||||
AvailablePz = std::sqrt(AvailablePz2); // Uzhi
|
||||
|
||||
//G4cout<<"AvailablePz "<<AvailablePz<<G4endl;
|
||||
|
||||
|
||||
G4double Px=Pt.getX(); // Uzhi
|
||||
G4double Py=Pt.getY(); // Uzhi
|
||||
// Uzhi
|
||||
Mom->setPx(Px); Mom->setPy(Py); Mom->setPz(AvailablePz); // Uzhi
|
||||
Mom->setE(std::sqrt(MassMt2+AvailablePz2)); // Uzhi
|
||||
|
||||
//G4cout<<" 1 part "<<Px<<" "<<Py<<" "<<AvailablePz<<" "<<std::sqrt(MassMt2+AvailablePz2)<<G4endl;
|
||||
|
||||
// Uzhi
|
||||
AntiMom->setPx(-Px); AntiMom->setPy(-Py); AntiMom->setPz(-AvailablePz); // Uzhi
|
||||
AntiMom->setE (std::sqrt(AntiMassMt2+AvailablePz2)); // Uzhi
|
||||
|
||||
//G4cout<<" 2 part "<<-Px<<" "<<-Py<<" "<<-AvailablePz<<" "<<std::sqrt(AntiMassMt2+AvailablePz2)<<G4endl;
|
||||
|
||||
// Maybe it must be inversed! // Uzhi
|
||||
/* // Uzhi
|
||||
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;
|
||||
|
||||
//... sample unit vector
|
||||
G4double pz = 1. - 2.*G4UniformRand();
|
||||
G4double st = std::sqrt(1. - pz * pz)*Pabs;
|
||||
G4double phi = 2.*pi*G4UniformRand();
|
||||
G4double px = st*std::cos(phi);
|
||||
G4double py = st*std::sin(phi);
|
||||
pz *= Pabs;
|
||||
|
||||
Mom->setPx(px); Mom->setPy(py); Mom->setPz(pz);
|
||||
Mom->setE(std::sqrt(Pabs*Pabs + Mass*Mass));
|
||||
|
||||
AntiMom->setPx(-px); AntiMom->setPy(-py); AntiMom->setPz(-pz);
|
||||
AntiMom->setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass));
|
||||
*/ // Uzhi
|
||||
}
|
||||
|
||||
|
||||
void G4LundStringFragmentation::SetMinimalStringMass(const G4FragmentingString * const string) // Uzhi
|
||||
{
|
||||
//G4cout<<"In SetMinMass -------------------"<<std::sqrt(string->Mass2())<<G4endl;
|
||||
//G4cout<<string->GetLeftParton()->GetPDGEncoding()<<G4endl;
|
||||
//G4cout<<string->GetRightParton()->GetPDGEncoding()<<G4endl;
|
||||
|
||||
G4double EstimatedMass=0.750* GeV; // 2*m_q
|
||||
|
||||
G4int Qleft =std::abs(string->GetLeftParton()->GetPDGEncoding());
|
||||
|
||||
if( Qleft > 1000)
|
||||
{
|
||||
G4int q1=Qleft/1000;
|
||||
if( q1 < 3) {EstimatedMass += 0.325* GeV;}
|
||||
if( q1 > 2) {EstimatedMass += 0.500* GeV;}
|
||||
|
||||
G4int q2=(Qleft/100)%10;
|
||||
if( q2 < 3) {EstimatedMass += 0.325* GeV;}
|
||||
if( q2 > 2) {EstimatedMass += 0.500* GeV;}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( Qleft < 3) {EstimatedMass += 0.325* GeV;}
|
||||
if( Qleft > 2) {EstimatedMass += 0.500* GeV;}
|
||||
}
|
||||
|
||||
G4int Qright=std::abs(string->GetRightParton()->GetPDGEncoding());
|
||||
|
||||
if( Qright > 1000)
|
||||
{
|
||||
G4int q1=Qright/1000;
|
||||
if( q1 < 3) {EstimatedMass += 0.325* GeV;}
|
||||
if( q1 > 2) {EstimatedMass += 0.500* GeV;}
|
||||
|
||||
G4int q2=(Qright/100)%10;
|
||||
if( q2 < 3) {EstimatedMass += 0.325* GeV;}
|
||||
if( q2 > 2) {EstimatedMass += 0.500* GeV;}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( Qright < 3) {EstimatedMass += 0.325* GeV;}
|
||||
if( Qright > 2) {EstimatedMass += 0.500* GeV;}
|
||||
}
|
||||
|
||||
MinimalStringMass=EstimatedMass;
|
||||
SetMinimalStringMass2(EstimatedMass);
|
||||
|
||||
/*
|
||||
Pcreate build=&G4HadronBuilder::BuildLowSpin;
|
||||
|
||||
G4ParticleDefinition *Hadron1, *Hadron2=0;
|
||||
|
||||
G4int iflc = (G4UniformRand() < 0.5)? 1 : 2;
|
||||
|
||||
if (string->GetLeftParton()->GetParticleSubType() == "quark") iflc = -iflc;
|
||||
|
||||
if (string->GetLeftParton()->GetPDGEncoding() < 0) iflc = -iflc;
|
||||
|
||||
// 1/2 baryon (anti-baryon) and scalar meson (QQ-q or QbarQbar-Qbar),
|
||||
// or 2 scalar mesons (Q-Qbar),
|
||||
// or 2 1/2 baryons (anti-baryons) will be built (QQ-QbarQbar)
|
||||
|
||||
//G4cout<<"In SetMinMass -------------------"<<std::sqrt(string->Mass2())<<G4endl;
|
||||
//G4cout<<string->GetLeftParton()->GetPDGEncoding()<<" "<<FindParticle(iflc)->GetPDGEncoding()<<G4endl;
|
||||
//G4cout<<string->GetRightParton()->GetPDGEncoding()<<" "<<FindParticle(-iflc)->GetPDGEncoding()<<G4endl;
|
||||
|
||||
Hadron1 = (hadronizer->*build)(string->GetLeftParton(),FindParticle(iflc));
|
||||
Hadron2 =(hadronizer->*build)(string->GetRightParton(),FindParticle(-iflc));
|
||||
MinimalStringMass = (Hadron1)->GetPDGMass() + (Hadron2)->GetPDGMass();
|
||||
|
||||
//G4cout<<(Hadron1)->GetPDGEncoding()<<" "<<(Hadron2)->GetPDGEncoding()<<G4endl;
|
||||
//G4cout<<"Out SetMinMass "<<MinimalStringMass<<G4endl;
|
||||
*/
|
||||
// SetMinimalStringMass2(MinimalStringMass);
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
|
||||
void G4LundStringFragmentation::SetMinimalStringMass2(const G4double aValue) // Uzhi
|
||||
{
|
||||
MinimalStringMass2=aValue * aValue;
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
|
||||
//****************************************************************************************
|
||||
|
||||
+250
-2
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QGSMFragmentation.cc,v 1.5 2006/06/29 20:55:05 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4QGSMFragmentation.cc,v 1.6 2007/04/24 14:55:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -33,6 +33,10 @@
|
||||
// History: first implementation, Maxim Komogorov, 10-Jul-1998
|
||||
// -----------------------------------------------------------------------------
|
||||
#include "G4QGSMFragmentation.hh"
|
||||
#include "G4FragmentingString.hh"
|
||||
#include "G4DiQuarks.hh"
|
||||
#include "G4Quarks.hh"
|
||||
|
||||
#include "Randomize.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
@@ -72,6 +76,107 @@ int G4QGSMFragmentation::operator!=(const G4QGSMFragmentation &right) const
|
||||
}
|
||||
|
||||
//****************************************************************************************
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4KineticTrackVector* G4QGSMFragmentation::FragmentString(const G4ExcitedString& theString)
|
||||
{
|
||||
// Can no longer modify Parameters for Fragmentation.
|
||||
PastInitPhase=true;
|
||||
|
||||
// check if string has enough mass to fragment...
|
||||
G4KineticTrackVector * LeftVector=LightFragmentationTest(&theString);
|
||||
if ( LeftVector != 0 ) return LeftVector;
|
||||
|
||||
LeftVector = new G4KineticTrackVector;
|
||||
G4KineticTrackVector * RightVector=new G4KineticTrackVector;
|
||||
|
||||
// this should work but its only a semi deep copy. %GF G4ExcitedString theStringInCMS(theString);
|
||||
G4ExcitedString *theStringInCMS=CPExcited(theString);
|
||||
G4LorentzRotation toCms=theStringInCMS->TransformToAlignedCms();
|
||||
|
||||
G4bool success=false, inner_sucess=true;
|
||||
G4int attempt=0;
|
||||
while ( !success && attempt++ < StringLoopInterrupt )
|
||||
{
|
||||
G4FragmentingString *currentString=new G4FragmentingString(*theStringInCMS);
|
||||
|
||||
std::for_each(LeftVector->begin(), LeftVector->end(), DeleteKineticTrack());
|
||||
LeftVector->clear();
|
||||
std::for_each(RightVector->begin(), RightVector->end(), DeleteKineticTrack());
|
||||
RightVector->clear();
|
||||
|
||||
inner_sucess=true; // set false on failure..
|
||||
while (! StopFragmenting(currentString) )
|
||||
{ // Split current string into hadron + new string
|
||||
G4FragmentingString *newString=0; // used as output from SplitUp...
|
||||
G4KineticTrack * Hadron=Splitup(currentString,newString);
|
||||
if ( Hadron != 0 && IsFragmentable(newString))
|
||||
{
|
||||
if ( currentString->GetDecayDirection() > 0 )
|
||||
LeftVector->push_back(Hadron);
|
||||
else
|
||||
RightVector->push_back(Hadron);
|
||||
delete currentString;
|
||||
currentString=newString;
|
||||
} else {
|
||||
// abandon ... start from the beginning
|
||||
if (newString) delete newString;
|
||||
if (Hadron) delete Hadron;
|
||||
inner_sucess=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Split current string into 2 final Hadrons
|
||||
if ( inner_sucess &&
|
||||
SplitLast(currentString,LeftVector, RightVector) )
|
||||
{
|
||||
success=true;
|
||||
}
|
||||
delete currentString;
|
||||
}
|
||||
|
||||
delete theStringInCMS;
|
||||
|
||||
if ( ! success )
|
||||
{
|
||||
std::for_each(LeftVector->begin(), LeftVector->end(), DeleteKineticTrack());
|
||||
LeftVector->clear();
|
||||
std::for_each(RightVector->begin(), RightVector->end(), DeleteKineticTrack());
|
||||
delete RightVector;
|
||||
return LeftVector;
|
||||
}
|
||||
|
||||
// Join Left- and RightVector into LeftVector in correct order.
|
||||
while(!RightVector->empty())
|
||||
{
|
||||
LeftVector->push_back(RightVector->back());
|
||||
RightVector->erase(RightVector->end()-1);
|
||||
}
|
||||
delete RightVector;
|
||||
|
||||
CalculateHadronTimePosition(theString.Get4Momentum().mag(), LeftVector);
|
||||
|
||||
G4LorentzRotation toObserverFrame(toCms.inverse());
|
||||
|
||||
for(size_t C1 = 0; C1 < LeftVector->size(); C1++)
|
||||
{
|
||||
G4KineticTrack* Hadron = LeftVector->operator[](C1);
|
||||
G4LorentzVector Momentum = Hadron->Get4Momentum();
|
||||
Momentum = toObserverFrame*Momentum;
|
||||
Hadron->Set4Momentum(Momentum);
|
||||
G4LorentzVector Coordinate(Hadron->GetPosition(), Hadron->GetFormationTime());
|
||||
Momentum = toObserverFrame*Coordinate;
|
||||
Hadron->SetFormationTime(Momentum.e());
|
||||
G4ThreeVector aPosition(Momentum.vect());
|
||||
Hadron->SetPosition(theString.GetPosition()+aPosition);
|
||||
}
|
||||
return LeftVector;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4double G4QGSMFragmentation::GetLightConeZ(G4double zmin, G4double zmax, G4int PartonEncoding, G4ParticleDefinition* , G4double , G4double )
|
||||
{
|
||||
@@ -120,5 +225,148 @@ G4double G4QGSMFragmentation::GetLightConeZ(G4double zmin, G4double zmax, G4int
|
||||
}
|
||||
return z;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
G4LorentzVector * G4QGSMFragmentation::SplitEandP(G4ParticleDefinition * pHadron,
|
||||
G4FragmentingString * string)
|
||||
{
|
||||
G4double HadronMass = pHadron->GetPDGMass();
|
||||
|
||||
// calculate and assign hadron transverse momentum component HadronPx andHadronPy
|
||||
G4ThreeVector thePt;
|
||||
thePt=SampleQuarkPt();
|
||||
G4ThreeVector HadronPt = thePt +string->DecayPt();
|
||||
HadronPt.setZ(0);
|
||||
//... sample z to define hadron longitudinal momentum and energy
|
||||
//... but first check the available phase space
|
||||
G4double DecayQuarkMass2 = sqr(string->GetDecayParton()->GetPDGMass());
|
||||
G4double HadronMass2T = sqr(HadronMass) + HadronPt.mag2();
|
||||
if (DecayQuarkMass2 + HadronMass2T >= SmoothParam*(string->Mass2()) )
|
||||
return 0; // have to start all over!
|
||||
|
||||
//... then compute allowed z region z_min <= z <= z_max
|
||||
|
||||
G4double zMin = HadronMass2T/(string->Mass2());
|
||||
G4double zMax = 1. - DecayQuarkMass2/(string->Mass2());
|
||||
if (zMin >= zMax) return 0; // have to start all over!
|
||||
|
||||
G4double z = GetLightConeZ(zMin, zMax,
|
||||
string->GetDecayParton()->GetPDGEncoding(), pHadron,
|
||||
HadronPt.x(), HadronPt.y());
|
||||
|
||||
//... now compute hadron longitudinal momentum and energy
|
||||
// longitudinal hadron momentum component HadronPz
|
||||
|
||||
HadronPt.setZ(0.5* string->GetDecayDirection() *
|
||||
(z * string->LightConeDecay() -
|
||||
HadronMass2T/(z * string->LightConeDecay())));
|
||||
G4double HadronE = 0.5* (z * string->LightConeDecay() +
|
||||
HadronMass2T/(z * string->LightConeDecay()));
|
||||
|
||||
G4LorentzVector * a4Momentum= new G4LorentzVector(HadronPt,HadronE);
|
||||
|
||||
return a4Momentum;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4QGSMFragmentation::SplitLast(G4FragmentingString * string,
|
||||
G4KineticTrackVector * LeftVector,
|
||||
G4KineticTrackVector * RightVector)
|
||||
{
|
||||
//... perform last cluster decay
|
||||
G4ThreeVector ClusterVel =string->Get4Momentum().boostVector();
|
||||
G4double ResidualMass =string->Mass();
|
||||
G4double ClusterMassCut = ClusterMass;
|
||||
G4int cClusterInterrupt = 0;
|
||||
G4ParticleDefinition * LeftHadron, * RightHadron;
|
||||
do
|
||||
{
|
||||
if (cClusterInterrupt++ >= ClusterLoopInterrupt)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
G4ParticleDefinition * quark = NULL;
|
||||
string->SetLeftPartonStable(); // to query quark contents..
|
||||
if (string->DecayIsQuark() && string->StableIsQuark() )
|
||||
{
|
||||
//... there are quarks on cluster ends
|
||||
LeftHadron= QuarkSplitup(string->GetLeftParton(), quark);
|
||||
} else {
|
||||
//... there is a Diquark on cluster ends
|
||||
G4int IsParticle;
|
||||
if ( string->StableIsQuark() ) {
|
||||
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
|
||||
} else {
|
||||
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? +1 : -1;
|
||||
}
|
||||
pDefPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted
|
||||
quark = QuarkPair.second;
|
||||
LeftHadron=hadronizer->Build(QuarkPair.first, string->GetLeftParton());
|
||||
}
|
||||
RightHadron = hadronizer->Build(string->GetRightParton(), quark);
|
||||
|
||||
//... repeat procedure, if mass of cluster is too low to produce hadrons
|
||||
//... ClusterMassCut = 0.15*GeV model parameter
|
||||
if ( quark->GetParticleSubType()== "quark" ) {ClusterMassCut = 0.;}
|
||||
else {ClusterMassCut = ClusterMass;}
|
||||
}
|
||||
while (ResidualMass <= LeftHadron->GetPDGMass() + RightHadron->GetPDGMass() + ClusterMassCut);
|
||||
|
||||
//... compute hadron momenta and energies
|
||||
G4LorentzVector LeftMom, RightMom;
|
||||
G4ThreeVector Pos;
|
||||
Sample4Momentum(&LeftMom, LeftHadron->GetPDGMass(), &RightMom, RightHadron->GetPDGMass(), ResidualMass);
|
||||
LeftMom.boost(ClusterVel);
|
||||
RightMom.boost(ClusterVel);
|
||||
LeftVector->push_back(new G4KineticTrack(LeftHadron, 0, Pos, LeftMom));
|
||||
RightVector->push_back(new G4KineticTrack(RightHadron, 0, Pos, RightMom));
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4QGSMFragmentation::IsFragmentable(const G4FragmentingString * const string)
|
||||
{
|
||||
return sqr(FragmentationMass(string)+MassCut) <
|
||||
string->Mass2();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4QGSMFragmentation::StopFragmenting(const G4FragmentingString * const string)
|
||||
{
|
||||
return
|
||||
sqr(FragmentationMass(string,&G4HadronBuilder::BuildHighSpin)+MassCut) >
|
||||
string->Get4Momentum().mag2();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
void G4QGSMFragmentation::Sample4Momentum(G4LorentzVector* Mom, G4double Mass, G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass)
|
||||
{
|
||||
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;
|
||||
|
||||
//... sample unit vector
|
||||
G4double pz = 1. - 2.*G4UniformRand();
|
||||
G4double st = std::sqrt(1. - pz * pz)*Pabs;
|
||||
G4double phi = 2.*pi*G4UniformRand();
|
||||
G4double px = st*std::cos(phi);
|
||||
G4double py = st*std::sin(phi);
|
||||
pz *= Pabs;
|
||||
|
||||
Mom->setPx(px); Mom->setPy(py); Mom->setPz(pz);
|
||||
Mom->setE(std::sqrt(Pabs*Pabs + Mass*Mass));
|
||||
|
||||
AntiMom->setPx(-px); AntiMom->setPy(-py); AntiMom->setPz(-pz);
|
||||
AntiMom->setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass));
|
||||
}
|
||||
|
||||
|
||||
//*********************************************************************************************
|
||||
|
||||
+56
-257
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VLongitudinalStringDecay.cc,v 1.5 2006/06/29 20:55:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VLongitudinalStringDecay.cc,v 1.8 2007/04/24 14:55:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -53,6 +53,10 @@
|
||||
#include "G4Quarks.hh"
|
||||
#include "G4Gluons.hh"
|
||||
|
||||
//------------------------debug switches
|
||||
//#define DEBUG_LightFragmentationTest 1
|
||||
|
||||
|
||||
//********************************************************************************
|
||||
// Constructors
|
||||
|
||||
@@ -167,6 +171,14 @@ G4VLongitudinalStringDecay::pDefPair G4VLongitudinalStringDecay::CreatePartonPai
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt()
|
||||
// {
|
||||
// G4double width_param= 2.0 * GeV*GeV;
|
||||
// G4double R = G4UniformRand();
|
||||
// G4double Pt = std::sqrt(width_param*R/(1-R));
|
||||
// G4double phi = 2.*pi*G4UniformRand();
|
||||
// return G4ThreeVector(Pt * std::cos(phi),Pt * std::sin(phi),0);
|
||||
// }
|
||||
G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt()
|
||||
{
|
||||
G4double Pt = -std::log(G4UniformRand());
|
||||
@@ -267,8 +279,9 @@ G4ParticleDefinition *G4VLongitudinalStringDecay::DiQuarkSplitup(
|
||||
G4int NewDecayEncoding = -1*IsParticle*(i10 * 1000 + i20 * 100 + spin);
|
||||
created = FindParticle(NewDecayEncoding);
|
||||
G4ParticleDefinition * decayQuark=FindParticle(decayQuarkEncoding);
|
||||
|
||||
return hadronizer->Build(QuarkPair.first, decayQuark);
|
||||
G4ParticleDefinition * had=hadronizer->Build(QuarkPair.first, decayQuark);
|
||||
return had;
|
||||
// return hadronizer->Build(QuarkPair.first, decayQuark);
|
||||
|
||||
} else {
|
||||
//... Diquark does not break
|
||||
@@ -278,7 +291,9 @@ G4ParticleDefinition *G4VLongitudinalStringDecay::DiQuarkSplitup(
|
||||
pDefPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted
|
||||
created = QuarkPair.second;
|
||||
|
||||
return hadronizer->Build(QuarkPair.first, decay);
|
||||
G4ParticleDefinition * had=hadronizer->Build(QuarkPair.first, decay);
|
||||
return had;
|
||||
// return G4ParticleDefinition * had=hadronizer->Build(QuarkPair.first, decay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,208 +339,6 @@ G4KineticTrack * G4VLongitudinalStringDecay::Splitup(
|
||||
return Hadron;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
G4LorentzVector * G4VLongitudinalStringDecay::SplitEandP(G4ParticleDefinition * pHadron,
|
||||
G4FragmentingString * string)
|
||||
{
|
||||
G4double HadronMass = pHadron->GetPDGMass();
|
||||
|
||||
// calculate and assign hadron transverse momentum component HadronPx andHadronPy
|
||||
G4ThreeVector thePt;
|
||||
thePt=SampleQuarkPt();
|
||||
G4ThreeVector HadronPt = thePt +string->DecayPt();
|
||||
HadronPt.setZ(0);
|
||||
//... sample z to define hadron longitudinal momentum and energy
|
||||
//... but first check the available phase space
|
||||
G4double DecayQuarkMass2 = sqr(string->GetDecayParton()->GetPDGMass());
|
||||
G4double HadronMass2T = sqr(HadronMass) + HadronPt.mag2();
|
||||
if (DecayQuarkMass2 + HadronMass2T >= SmoothParam*(string->Mass2()) )
|
||||
return 0; // have to start all over!
|
||||
|
||||
//... then compute allowed z region z_min <= z <= z_max
|
||||
|
||||
G4double zMin = HadronMass2T/(string->Mass2());
|
||||
G4double zMax = 1. - DecayQuarkMass2/(string->Mass2());
|
||||
if (zMin >= zMax) return 0; // have to start all over!
|
||||
|
||||
G4double z = GetLightConeZ(zMin, zMax,
|
||||
string->GetDecayParton()->GetPDGEncoding(), pHadron,
|
||||
HadronPt.x(), HadronPt.y());
|
||||
|
||||
//... now compute hadron longitudinal momentum and energy
|
||||
// longitudinal hadron momentum component HadronPz
|
||||
|
||||
HadronPt.setZ(0.5* string->GetDecayDirection() *
|
||||
(z * string->LightConeDecay() -
|
||||
HadronMass2T/(z * string->LightConeDecay())));
|
||||
G4double HadronE = 0.5* (z * string->LightConeDecay() +
|
||||
HadronMass2T/(z * string->LightConeDecay()));
|
||||
|
||||
G4LorentzVector * a4Momentum= new G4LorentzVector(HadronPt,HadronE);
|
||||
|
||||
return a4Momentum;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4VLongitudinalStringDecay::SplitLast(G4FragmentingString * string,
|
||||
G4KineticTrackVector * LeftVector,
|
||||
G4KineticTrackVector * RightVector)
|
||||
{
|
||||
//... perform last cluster decay
|
||||
G4ThreeVector ClusterVel =string->Get4Momentum().boostVector();
|
||||
G4double ResidualMass =string->Mass();
|
||||
G4double ClusterMassCut = ClusterMass;
|
||||
G4int cClusterInterrupt = 0;
|
||||
G4ParticleDefinition * LeftHadron, * RightHadron;
|
||||
do
|
||||
{
|
||||
if (cClusterInterrupt++ >= ClusterLoopInterrupt)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
G4ParticleDefinition * quark = NULL;
|
||||
string->SetLeftPartonStable(); // to query quark contents..
|
||||
if (string->DecayIsQuark() && string->StableIsQuark() )
|
||||
{
|
||||
//... there are quarks on cluster ends
|
||||
LeftHadron= QuarkSplitup(string->GetLeftParton(), quark);
|
||||
} else {
|
||||
//... there is a Diquark on cluster ends
|
||||
G4int IsParticle;
|
||||
if ( string->StableIsQuark() ) {
|
||||
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
|
||||
} else {
|
||||
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? +1 : -1;
|
||||
}
|
||||
pDefPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted
|
||||
quark = QuarkPair.second;
|
||||
LeftHadron=hadronizer->Build(QuarkPair.first, string->GetLeftParton());
|
||||
}
|
||||
RightHadron = hadronizer->Build(string->GetRightParton(), quark);
|
||||
|
||||
//... repeat procedure, if mass of cluster is too low to produce hadrons
|
||||
//... ClusterMassCut = 0.15*GeV model parameter
|
||||
if ( quark->GetParticleSubType()== "quark" ) {ClusterMassCut = 0.;}
|
||||
else {ClusterMassCut = ClusterMass;}
|
||||
}
|
||||
while (ResidualMass <= LeftHadron->GetPDGMass() + RightHadron->GetPDGMass() + ClusterMassCut);
|
||||
|
||||
//... compute hadron momenta and energies
|
||||
G4LorentzVector LeftMom, RightMom;
|
||||
G4ThreeVector Pos;
|
||||
Sample4Momentum(&LeftMom, LeftHadron->GetPDGMass(), &RightMom, RightHadron->GetPDGMass(), ResidualMass);
|
||||
LeftMom.boost(ClusterVel);
|
||||
RightMom.boost(ClusterVel);
|
||||
LeftVector->push_back(new G4KineticTrack(LeftHadron, 0, Pos, LeftMom));
|
||||
RightVector->push_back(new G4KineticTrack(RightHadron, 0, Pos, RightMom));
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4KineticTrackVector* G4VLongitudinalStringDecay::FragmentString(const G4ExcitedString& theString)
|
||||
{
|
||||
// Can no longer modify Parameters for Fragmentation.
|
||||
PastInitPhase=true;
|
||||
|
||||
// check if string has enough mass to fragment...
|
||||
G4KineticTrackVector * LeftVector=LightFragmentationTest(&theString);
|
||||
if ( LeftVector != 0 ) return LeftVector;
|
||||
|
||||
LeftVector = new G4KineticTrackVector;
|
||||
G4KineticTrackVector * RightVector=new G4KineticTrackVector;
|
||||
|
||||
// this should work but its only a semi deep copy. %GF G4ExcitedString theStringInCMS(theString);
|
||||
G4ExcitedString *theStringInCMS=CPExcited(theString);
|
||||
G4LorentzRotation toCms=theStringInCMS->TransformToAlignedCms();
|
||||
|
||||
G4bool success=false, inner_sucess=true;
|
||||
G4int attempt=0;
|
||||
while ( !success && attempt++ < StringLoopInterrupt )
|
||||
{
|
||||
G4FragmentingString *currentString=new G4FragmentingString(*theStringInCMS);
|
||||
|
||||
std::for_each(LeftVector->begin(), LeftVector->end(), DeleteKineticTrack());
|
||||
LeftVector->clear();
|
||||
std::for_each(RightVector->begin(), RightVector->end(), DeleteKineticTrack());
|
||||
RightVector->clear();
|
||||
|
||||
inner_sucess=true; // set false on failure..
|
||||
while (! StopFragmenting(currentString) )
|
||||
{ // Split current string into hadron + new string
|
||||
G4FragmentingString *newString=0; // used as output from SplitUp...
|
||||
G4KineticTrack * Hadron=Splitup(currentString,newString);
|
||||
if ( Hadron != 0 && IsFragmentable(newString))
|
||||
{
|
||||
if ( currentString->GetDecayDirection() > 0 )
|
||||
LeftVector->push_back(Hadron);
|
||||
else
|
||||
RightVector->push_back(Hadron);
|
||||
delete currentString;
|
||||
currentString=newString;
|
||||
} else {
|
||||
// abandon ... start from the beginning
|
||||
if (newString) delete newString;
|
||||
if (Hadron) delete Hadron;
|
||||
inner_sucess=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Split current string into 2 final Hadrons
|
||||
if ( inner_sucess &&
|
||||
SplitLast(currentString,LeftVector, RightVector) )
|
||||
{
|
||||
success=true;
|
||||
}
|
||||
delete currentString;
|
||||
}
|
||||
|
||||
delete theStringInCMS;
|
||||
|
||||
if ( ! success )
|
||||
{
|
||||
std::for_each(LeftVector->begin(), LeftVector->end(), DeleteKineticTrack());
|
||||
LeftVector->clear();
|
||||
std::for_each(RightVector->begin(), RightVector->end(), DeleteKineticTrack());
|
||||
delete RightVector;
|
||||
return LeftVector;
|
||||
}
|
||||
|
||||
// Join Left- and RightVector into LeftVector in correct order.
|
||||
while(!RightVector->empty())
|
||||
{
|
||||
LeftVector->push_back(RightVector->back());
|
||||
RightVector->erase(RightVector->end()-1);
|
||||
}
|
||||
delete RightVector;
|
||||
|
||||
CalculateHadronTimePosition(theString.Get4Momentum().mag(), LeftVector);
|
||||
|
||||
G4LorentzRotation toObserverFrame(toCms.inverse());
|
||||
|
||||
for(size_t C1 = 0; C1 < LeftVector->size(); C1++)
|
||||
{
|
||||
G4KineticTrack* Hadron = LeftVector->operator[](C1);
|
||||
G4LorentzVector Momentum = Hadron->Get4Momentum();
|
||||
Momentum = toObserverFrame*Momentum;
|
||||
Hadron->Set4Momentum(Momentum);
|
||||
G4LorentzVector Coordinate(Hadron->GetPosition(), Hadron->GetFormationTime());
|
||||
Momentum = toObserverFrame*Coordinate;
|
||||
Hadron->SetFormationTime(Momentum.e());
|
||||
G4ThreeVector aPosition(Momentum.vect());
|
||||
Hadron->SetPosition(theString.GetPosition()+aPosition);
|
||||
}
|
||||
return LeftVector;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4ExcitedString *G4VLongitudinalStringDecay::CPExcited(const G4ExcitedString & in)
|
||||
@@ -543,6 +356,17 @@ G4double G4VLongitudinalStringDecay::FragmentationMass(
|
||||
{
|
||||
|
||||
G4double mass;
|
||||
static G4bool NeedInit(true);
|
||||
static std::vector<double> nomix;
|
||||
static G4HadronBuilder * minMassHadronizer;
|
||||
if ( NeedInit )
|
||||
{
|
||||
NeedInit = false;
|
||||
nomix.resize(6);
|
||||
for ( G4int i=0; i<6 ; i++ ) nomix[i]=0;
|
||||
// minMassHadronizer=new G4HadronBuilder(pspin_meson,pspin_barion,nomix,nomix);
|
||||
minMassHadronizer=hadronizer;
|
||||
}
|
||||
|
||||
if ( build==0 ) build=&G4HadronBuilder::BuildLowSpin;
|
||||
|
||||
@@ -552,7 +376,7 @@ G4double G4VLongitudinalStringDecay::FragmentationMass(
|
||||
{
|
||||
// spin 0 meson or spin 1/2 barion will be built
|
||||
|
||||
Hadron1 = (hadronizer->*build)(string->GetLeftParton(),
|
||||
Hadron1 = (minMassHadronizer->*build)(string->GetLeftParton(),
|
||||
string->GetRightParton());
|
||||
mass= (Hadron1)->GetPDGMass();
|
||||
} else
|
||||
@@ -563,8 +387,8 @@ G4double G4VLongitudinalStringDecay::FragmentationMass(
|
||||
if (string->GetLeftParton()->GetPDGEncoding() < 0) iflc = -iflc;
|
||||
|
||||
//... theSpin = 4; spin 3/2 baryons will be built
|
||||
Hadron1 = (hadronizer->*build)(string->GetLeftParton(),FindParticle(iflc));
|
||||
Hadron2 =(hadronizer->*build)(string->GetRightParton(),FindParticle(-iflc));
|
||||
Hadron1 = (minMassHadronizer->*build)(string->GetLeftParton(),FindParticle(iflc));
|
||||
Hadron2 =(minMassHadronizer->*build)(string->GetRightParton(),FindParticle(-iflc));
|
||||
mass = (Hadron1)->GetPDGMass() + (Hadron2)->GetPDGMass();
|
||||
}
|
||||
|
||||
@@ -577,25 +401,6 @@ G4double G4VLongitudinalStringDecay::FragmentationMass(
|
||||
return mass;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4VLongitudinalStringDecay::IsFragmentable(const G4FragmentingString * const string)
|
||||
{
|
||||
return sqr(FragmentationMass(string)+MassCut) <
|
||||
string->Mass2();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4VLongitudinalStringDecay::StopFragmenting(const G4FragmentingString * const string)
|
||||
{
|
||||
return
|
||||
sqr(FragmentationMass(string,&G4HadronBuilder::BuildHighSpin)+MassCut) >
|
||||
string->Get4Momentum().mag2();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
G4KineticTrackVector* G4VLongitudinalStringDecay::LightFragmentationTest(const
|
||||
G4ExcitedString * const string)
|
||||
{
|
||||
@@ -614,6 +419,13 @@ G4KineticTrackVector* G4VLongitudinalStringDecay::LightFragmentationTest(const
|
||||
if ( hadrons.second ==0 )
|
||||
{
|
||||
// Substitute string by light hadron, Note that Energy is not conserved here!
|
||||
|
||||
#ifdef DEBUG_LightFragmentationTest
|
||||
G4cout << "VlongSF Warning replacing string by single hadron "
|
||||
<< hadrons.first->GetParticleName()
|
||||
<< "string .. " << string->Get4Momentum() << " "
|
||||
<< string->Get4Momentum().m() << G4endl;
|
||||
#endif
|
||||
|
||||
G4ThreeVector Mom3 = string->Get4Momentum().vect();
|
||||
G4LorentzVector Mom(Mom3,
|
||||
@@ -622,6 +434,15 @@ G4KineticTrackVector* G4VLongitudinalStringDecay::LightFragmentationTest(const
|
||||
} else
|
||||
{
|
||||
//... string was qq--qqbar type: Build two stable hadrons,
|
||||
|
||||
#ifdef DEBUG_LightFragmentationTest
|
||||
G4cout << "VlongSF Warning replacing qq-qqbar string by TWO hadrons "
|
||||
<< hadrons.first->GetParticleName() << " / "
|
||||
<< hadrons.second->GetParticleName()
|
||||
<< "string .. " << string->Get4Momentum() << " "
|
||||
<< string->Get4Momentum().m() << G4endl;
|
||||
#endif
|
||||
|
||||
G4LorentzVector Mom1, Mom2;
|
||||
Sample4Momentum(&Mom1, hadrons.first->GetPDGMass(),
|
||||
&Mom2,hadrons.second->GetPDGMass(),
|
||||
@@ -651,28 +472,6 @@ G4ParticleDefinition* G4VLongitudinalStringDecay::FindParticle(G4int Encoding)
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
void G4VLongitudinalStringDecay::Sample4Momentum(G4LorentzVector* Mom, G4double Mass, G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass)
|
||||
{
|
||||
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;
|
||||
|
||||
//... sample unit vector
|
||||
G4double pz = 1. - 2.*G4UniformRand();
|
||||
G4double st = std::sqrt(1. - pz * pz)*Pabs;
|
||||
G4double phi = 2.*pi*G4UniformRand();
|
||||
G4double px = st*std::cos(phi);
|
||||
G4double py = st*std::sin(phi);
|
||||
pz *= Pabs;
|
||||
|
||||
Mom->setPx(px); Mom->setPy(py); Mom->setPz(pz);
|
||||
Mom->setE(std::sqrt(Pabs*Pabs + Mass*Mass));
|
||||
|
||||
AntiMom->setPx(-px); AntiMom->setPy(-py); AntiMom->setPz(-pz);
|
||||
AntiMom->setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
void G4VLongitudinalStringDecay::SetSigmaTransverseMomentum(G4double aValue)
|
||||
{
|
||||
if ( PastInitPhase ) {
|
||||
@@ -718,7 +517,7 @@ void G4VLongitudinalStringDecay::SetDiquarkBreakProbability(G4double aValue)
|
||||
void G4VLongitudinalStringDecay::SetVectorMesonProbability(G4double aValue)
|
||||
{
|
||||
if ( PastInitPhase ) {
|
||||
throw G4HadronicException(__FILE__, __LINE__, "4VLongitudinalStringDecay::SetVectorMesonProbability after FragmentString() not allowed");
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4VLongitudinalStringDecay::SetVectorMesonProbability after FragmentString() not allowed");
|
||||
} else {
|
||||
pspin_meson = aValue;
|
||||
delete hadronizer;
|
||||
@@ -732,7 +531,7 @@ void G4VLongitudinalStringDecay::SetVectorMesonProbability(G4double aValue)
|
||||
void G4VLongitudinalStringDecay::SetSpinThreeHalfBarionProbability(G4double aValue)
|
||||
{
|
||||
if ( PastInitPhase ) {
|
||||
throw G4HadronicException(__FILE__, __LINE__, "4VLongitudinalStringDecay::SetSpinThreeHalfBarionProbability after FragmentString() not allowed");
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4VLongitudinalStringDecay::SetSpinThreeHalfBarionProbability after FragmentString() not allowed");
|
||||
} else {
|
||||
pspin_barion = aValue;
|
||||
delete hadronizer;
|
||||
@@ -746,10 +545,10 @@ void G4VLongitudinalStringDecay::SetSpinThreeHalfBarionProbability(G4double aVal
|
||||
void G4VLongitudinalStringDecay::SetScalarMesonMixings(std::vector<G4double> aVector)
|
||||
{
|
||||
if ( PastInitPhase ) {
|
||||
throw G4HadronicException(__FILE__, __LINE__, "4VLongitudinalStringDecay::SetScalarMesonMixings after FragmentString() not allowed");
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4VLongitudinalStringDecay::SetScalarMesonMixings after FragmentString() not allowed");
|
||||
} else {
|
||||
if ( aVector.size() < 6 )
|
||||
throw G4HadronicException(__FILE__, __LINE__, "4VLongitudinalStringDecay::SetScalarMesonMixings( argument Vector too small");
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4VLongitudinalStringDecay::SetScalarMesonMixings( argument Vector too small");
|
||||
scalarMesonMix[0] = aVector[0];
|
||||
scalarMesonMix[1] = aVector[1];
|
||||
scalarMesonMix[2] = aVector[2];
|
||||
@@ -767,10 +566,10 @@ void G4VLongitudinalStringDecay::SetScalarMesonMixings(std::vector<G4double> aVe
|
||||
void G4VLongitudinalStringDecay::SetVectorMesonMixings(std::vector<G4double> aVector)
|
||||
{
|
||||
if ( PastInitPhase ) {
|
||||
throw G4HadronicException(__FILE__, __LINE__, "4VLongitudinalStringDecay::SetVectorMesonMixings after FragmentString() not allowed");
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4VLongitudinalStringDecay::SetVectorMesonMixings after FragmentString() not allowed");
|
||||
} else {
|
||||
if ( aVector.size() < 6 )
|
||||
throw G4HadronicException(__FILE__, __LINE__, "4VLongitudinalStringDecay::SetVectorMesonMixings( argument Vector too small");
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4VLongitudinalStringDecay::SetVectorMesonMixings( argument Vector too small");
|
||||
vectorMesonMix[0] = aVector[0];
|
||||
vectorMesonMix[1] = aVector[1];
|
||||
vectorMesonMix[2] = aVector[2];
|
||||
|
||||
Reference in New Issue
Block a user