Import Geant4 9.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:15:05 +02:00
parent b79225fb37
commit 74cad5e589
3877 changed files with 234205 additions and 167127 deletions
@@ -133,7 +133,7 @@ EnergyAndMomentumCorrector(G4KineticTrackVector* Output, G4LorentzVector& TotalC
break;
}
}
#ifdef debug_G4ExcitedStringDecay
if(!success)
{
G4cout << "G4ExcitedStringDecay::EnergyAndMomentumCorrector - Warning"<<G4endl;
@@ -143,9 +143,16 @@ EnergyAndMomentumCorrector(G4KineticTrackVector* Output, G4LorentzVector& TotalC
G4cout << " Increase number of attempts or increase ERRLIMIT"<<G4endl;
// throw G4HadronicException(__FILE__, __LINE__, "G4ExcitedStringDecay failed to correct...");
}
#endif
// Compute c.m.s. interaction velocity and KTV back boost
Beta = TotalCollisionMom.boostVector();
Output->Boost(Beta);
/* // Uzhi
G4cout<<"Number of produced hadrons // correct E and P "<<Output->size()<<G4endl; // Uzhi
for(cHadron = 0; cHadron < Output->size(); cHadron++)
{
G4cout<<cHadron<<" "<<Output->operator[](cHadron)->Get4Momentum()<<" "<<Output->operator[](cHadron)->Get4Momentum().mag()<<Output->operator[](cHadron)->GetDefinition()->GetParticleName()<<G4endl;
}
*/ // Uzhi
return success;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4HadronBuilder.cc,v 1.7 2008/04/25 14:20:14 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4HadronBuilder.cc,v 1.10 2009/05/22 16:34:31 gunter Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -146,7 +146,7 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
G4bool IsAnti = id1 < 0; // quark 1 is antiquark?
if( (IsUp && IsAnti ) || (!IsUp && !IsAnti ) )
PDGEncoding = - PDGEncoding;
}
}
G4ParticleDefinition * MesonDef=
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4LundStringFragmentation.cc,v 1.13 2008/06/23 09:17:10 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $ 1.8
// $Id: G4LundStringFragmentation.cc,v 1.18 2009/10/05 12:52:48 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-03 $ 1.8
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -57,7 +57,8 @@ G4LundStringFragmentation::G4LundStringFragmentation()
// ------ smearinr sharp mass cut-off ---------------------------
SmoothParam = 0.2;
SetStringTensionParameter(0.25); // Uzhi 20 June 08
// SetStringTensionParameter(0.25); // Uzhi 20 June 08
SetStringTensionParameter(1.); // Uzhi 20 June 09
}
// --------------------------------------------------------------
@@ -195,7 +196,7 @@ G4cout<<"FragmentString Momentum"<<theString.Get4Momentum()<<theString.Get4Momen
theString.GetPosition().z()+100.*fermi);
LeftVector->operator[](0)->SetPosition(aPosition);
*/
//G4cout<<"Single hadron "<<LeftVector->operator[](0)->GetPosition()<<" "<<LeftVector->operator[](0)->GetFormationTime()<<G4endl;
//G4cout<<"Single hadron "<<LeftVector->operator[](0)->Get4Momentum()<<" "<<LeftVector->operator[](0)->Get4Momentum().mag()<<G4endl;
} else { // 2 hadrons created from qq-qqbar are stored
LeftVector->operator[](0)->SetFormationTime(theString.GetTimeOfCreation());
LeftVector->operator[](0)->SetPosition(theString.GetPosition());
@@ -292,7 +293,8 @@ G4cout<<"FragmentString Momentum"<<theString.Get4Momentum()<<theString.Get4Momen
G4double TimeOftheStringCreation=theString.GetTimeOfCreation();
G4ThreeVector PositionOftheStringCreation(theString.GetPosition());
// Uzhi 11.07.09
//G4cout<<" String T Pos"<<TimeOftheStringCreation<<' '<<PositionOftheStringCreation<<G4endl;
/* // For large formation time open *
G4double TimeOftheStringCreation=theString.GetTimeOfCreation()+100*fermi;
G4ThreeVector PositionOftheStringCreation(theString.GetPosition().x(),
@@ -312,6 +314,8 @@ G4cout<<"FragmentString Momentum"<<theString.Get4Momentum()<<theString.Get4Momen
PositionOftheStringCreation=aPosition;
}
*/
//G4cout<<"Lund Frag # hadrons"<<LeftVector->size()<<G4endl; // Uzhi 11.07.09
for(size_t C1 = 0; C1 < LeftVector->size(); C1++)
{
G4KineticTrack* Hadron = LeftVector->operator[](C1);
@@ -321,11 +325,20 @@ G4cout<<"FragmentString Momentum"<<theString.Get4Momentum()<<theString.Get4Momen
G4LorentzVector Coordinate(Hadron->GetPosition(), Hadron->GetFormationTime());
Momentum = toObserverFrame*Coordinate;
Hadron->SetFormationTime(TimeOftheStringCreation+Momentum.e());
Hadron->SetFormationTime(TimeOftheStringCreation+Momentum.e() // Uzhi 11.07.09
-fermi/c_light); // Uzhi 11.07.09
G4ThreeVector aPosition(Momentum.vect());
// Hadron->SetPosition(theString.GetPosition()+aPosition);
Hadron->SetPosition(PositionOftheStringCreation+aPosition);
//G4cout<<"Hadron "<<C1<<" "<<Hadron->GetPosition()/fermi<<" "<<Hadron->GetFormationTime()/fermi<<G4endl;
/* // Uzhi 11.07.09
G4cout<<C1<<' '<<Hadron->GetDefinition()->GetParticleName()<<G4endl;
G4cout<<Hadron->GetDefinition()->GetPDGMass()<<' '
<<Hadron->Get4Momentum()<<G4endl;
G4cout<<Hadron->GetFormationTime()<<' '
<<Hadron->GetPosition()<<' '
<<Hadron->GetPosition().z()/fermi<<G4endl;
*/ // Uzhi
};
//G4cout<<"Out FragmentString"<<G4endl;
@@ -507,8 +520,22 @@ void G4LundStringFragmentation::Sample4Momentum(G4LorentzVector* Mom, G4double M
else
{
do
{
Pt=SampleQuarkPt(); Pt.setZ(0); G4double Pt2=Pt.mag2();
{
// GF 22-May-09, limit sampled pt to allowed range
G4double termD = InitialMass*InitialMass -Mass*Mass - AntiMass*AntiMass;
G4double termab = 4*sqr(Mass*AntiMass);
G4double termN = 2*termD + 4*Mass*Mass + 4*AntiMass*AntiMass;
G4double pt2max=(termD*termD - termab )/ termN ;
// G4cout << " termD, ab, N " << termD << " " << termab << " " << termN
// << " pt2max= " << pt2max ;
Pt=SampleQuarkPt(std::sqrt(pt2max)); Pt.setZ(0); G4double Pt2=Pt.mag2();
// G4cout << " sampled Pt2 = " << Pt2 << " " << pt2max-Pt2 << G4endl;
// end.. GF
//G4cout<<"Sample4Momentum Pt x y "<<Pt.getX()<<" "<<Pt.getY()<<G4endl;
@@ -520,7 +547,7 @@ void G4LundStringFragmentation::Sample4Momentum(G4LorentzVector* Mom, G4double M
AvailablePz2= sqr(InitialMass*InitialMass - MassMt2 - AntiMassMt2) -
4.*MassMt2*AntiMassMt2;
}
while(AvailablePz2 < 0.);
while(AvailablePz2 < 0.); // GF will occur only for numerical precision problem with limit in sampled pt
AvailablePz2 /=(4.*InitialMass*InitialMass);
AvailablePz = std::sqrt(AvailablePz2);
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VLongitudinalStringDecay.cc,v 1.13 2008/06/23 08:35:55 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VLongitudinalStringDecay.cc,v 1.18 2009/08/03 13:21:25 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -70,7 +70,6 @@ G4VLongitudinalStringDecay::G4VLongitudinalStringDecay()
ClusterLoopInterrupt = 500;
// Changable Parameters below.
SigmaQT = 0.5 * GeV;
StrangeSuppress = 0.44; // 27 % strange quarks produced, ie. u:d:s=1:1:0.27
@@ -484,9 +483,16 @@ G4VLongitudinalStringDecay::pDefPair G4VLongitudinalStringDecay::CreatePartonPai
// return G4ThreeVector(Pt * std::cos(phi),Pt * std::sin(phi),0);
// }
G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt()
G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt(G4double ptMax)
{
G4double Pt = -std::log(G4UniformRand());
G4double Pt;
if ( ptMax < 0 ) {
// sample full gaussian
Pt = -std::log(G4UniformRand());
} else {
// sample in limited range
Pt = -std::log(CLHEP::RandFlat::shoot(std::exp(-sqr(ptMax)/sqr(SigmaQT)), 1.));
}
Pt = SigmaQT * std::sqrt(Pt);
G4double phi = 2.*pi*G4UniformRand();
return G4ThreeVector(Pt * std::cos(phi),Pt * std::sin(phi),0);
@@ -497,11 +503,12 @@ G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt()
void G4VLongitudinalStringDecay::CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector* Hadrons)
{
// `yo-yo` formation time
// `yo-yo` formation time
// const G4double kappa = 1.0 * GeV/fermi/4.; // Uzhi String tension 1.06.08
G4double kappa = GetStringTensionParameter();
//G4cout<<"Kappa "<<kappa<<G4endl; // Uzhi 20.06.08
//G4int Uzhi; G4cin>>Uzhi; // Uzhi 20.06.08
//G4cout<<"Number of hadrons "<<Hadrons->size()<<G4endl; // Vova
for(size_t c1 = 0; c1 < Hadrons->size(); c1++)
{
G4double SumPz = 0;
@@ -513,9 +520,26 @@ void G4VLongitudinalStringDecay::CalculateHadronTimePosition(G4double theInitial
}
G4double HadronE = Hadrons->operator[](c1)->Get4Momentum().e();
G4double HadronPz = Hadrons->operator[](c1)->Get4Momentum().pz();
Hadrons->operator[](c1)->SetFormationTime((theInitialStringMass - 2.*SumPz + HadronE - HadronPz)/(2.*kappa));
G4ThreeVector aPosition(0, 0, (theInitialStringMass - 2.*SumE - HadronE + HadronPz)/(2.*kappa));
Hadrons->operator[](c1)->SetFormationTime(
(theInitialStringMass - 2.*SumPz + HadronE - HadronPz)/(2.*kappa)/c_light); //Uzhi1.07.09c_light
G4ThreeVector aPosition(0, 0,
(theInitialStringMass - 2.*SumE - HadronE + HadronPz)/(2.*kappa));
Hadrons->operator[](c1)->SetPosition(aPosition);
/*
G4cout<<"kappa "<<kappa<<G4endl;
G4cout<<c1<<" Partic time, position Old "<<
(theInitialStringMass - 2.*SumPz + HadronE - HadronPz)/(2.*kappa)<<' '<<
(theInitialStringMass - 2.*SumE - HadronE + HadronPz)/(2.*kappa)<<G4endl;
G4cout<<c1<<" Partic time, position New "<<
(theInitialStringMass - 2.*SumPz + HadronE - HadronPz)/(2.*kappa)/c_light<<' '<<
(theInitialStringMass - 2.*SumE - HadronE + HadronPz)/(2.*kappa)<<G4endl;
G4cout<<"fermi "<<fermi<<" 1/fermi "<<1./fermi<<' '<<"1*fermi/c "<<1.*fermi/c_light<<G4endl;
G4int Uzhi; G4cin>>Uzhi; // Uzhi 20.06.08
*/
}
}