Import Geant4 7.0.0 source tree
This commit is contained in:
+3
-3
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ExcitedStringDecay.hh,v 1.2 2004/01/29 17:39:14 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4ExcitedStringDecay.hh,v 1.3 2004/12/07 13:50:10 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
#ifndef G4ExcitedStringDecay_h
|
||||
#define G4ExcitedStringDecay_h 1
|
||||
@@ -109,7 +109,7 @@ FragmentStrings(const G4ExcitedStringVector * theStrings)
|
||||
}
|
||||
|
||||
|
||||
if ( abs((KTsum1.e()-theStrings->operator[](astring)->Get4Momentum().e()) / KTsum1.e()) > perMillion )
|
||||
if ( std::abs((KTsum1.e()-theStrings->operator[](astring)->Get4Momentum().e()) / KTsum1.e()) > perMillion )
|
||||
{
|
||||
NeedEnergyCorrector=true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FragmentingString.hh,v 1.1 2003/10/07 11:25:40 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
|
||||
#ifndef G4FragmentingString_h
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HadronBuilder.hh,v 1.1 2003/10/07 11:25:40 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LundStringFragmentation.hh,v 1.1 2003/10/07 11:25:40 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $ Maxim Komogorov
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $ Maxim Komogorov
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4QGSMFragmentation.hh,v 1.1 2003/10/07 11:25:40 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VKinkyStringDecay.hh,v 1.1 2003/10/07 11:25:40 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// Maxim Komogorov
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VLongitudinalStringDecay.hh,v 1.1 2003/10/07 11:25:40 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// Maxim Komogorov
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@ EnergyAndMomentumCorrector(G4KineticTrackVector* Output, G4LorentzVector& TotalC
|
||||
if (SumMass > TotalCollisionMass) return FALSE;
|
||||
SumMass = SumMom.m2();
|
||||
if (SumMass < 0) return FALSE;
|
||||
SumMass = sqrt(SumMass);
|
||||
SumMass = std::sqrt(SumMass);
|
||||
|
||||
// Compute c.m.s. hadron velocity and boost KTV to hadron c.m.s.
|
||||
G4ThreeVector Beta = -SumMom.boostVector();
|
||||
@@ -109,7 +109,7 @@ EnergyAndMomentumCorrector(G4KineticTrackVector* Output, G4LorentzVector& TotalC
|
||||
{
|
||||
G4LorentzVector HadronMom = Output->operator[](cHadron)->Get4Momentum();
|
||||
HadronMom.setVect(Scale*HadronMom.vect());
|
||||
G4double E = sqrt(HadronMom.vect().mag2() + sqr(Output->operator[](cHadron)->GetDefinition()->GetPDGMass()));
|
||||
G4double E = std::sqrt(HadronMom.vect().mag2() + sqr(Output->operator[](cHadron)->GetDefinition()->GetPDGMass()));
|
||||
HadronMom.setE(E);
|
||||
Output->operator[](cHadron)->Set4Momentum(HadronMom);
|
||||
Sum += E;
|
||||
|
||||
+1
-1
@@ -209,5 +209,5 @@ G4double G4FragmentingString::Mass2() const
|
||||
|
||||
G4double G4FragmentingString::Mass() const
|
||||
{
|
||||
return sqrt(this->Mass2());
|
||||
return std::sqrt(this->Mass2());
|
||||
}
|
||||
|
||||
+18
-18
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HadronBuilder.cc,v 1.2 2003/11/03 17:54:53 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4HadronBuilder.cc,v 1.3 2004/12/07 13:50:13 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -98,7 +98,7 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
|
||||
|
||||
G4double charge = black->GetPDGCharge()
|
||||
+ white->GetPDGCharge();
|
||||
if (abs(charge) > 2 || abs(3.*charge - 3*G4int(charge)) > perCent )
|
||||
if (std::abs(charge) > 2 || std::abs(3.*charge - 3*G4int(charge)) > perCent )
|
||||
{
|
||||
G4cerr << " G4HadronBuilder::Build()" << G4endl;
|
||||
G4cerr << " Invalid total charge found for on input: "
|
||||
@@ -112,22 +112,22 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
|
||||
|
||||
G4int id1= black->GetPDGEncoding();
|
||||
G4int id2= white->GetPDGEncoding();
|
||||
// G4int ifl1= std::max(abs(id1), abs(id2));
|
||||
if ( abs(id1) < abs(id2) )
|
||||
// G4int ifl1= std::max(std::abs(id1), std::abs(id2));
|
||||
if ( std::abs(id1) < std::abs(id2) )
|
||||
{
|
||||
G4int xchg = id1;
|
||||
id1 = id2;
|
||||
id2 = xchg;
|
||||
}
|
||||
|
||||
if (abs(id1) > 3 )
|
||||
if (std::abs(id1) > 3 )
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4HadronBuilder::Meson : Illegal Quark content as input");
|
||||
|
||||
G4int PDGEncoding=0;
|
||||
|
||||
if (id1 + id2 == 0) {
|
||||
G4double rmix = G4UniformRand();
|
||||
G4int imix = 2*abs(id1) - 1;
|
||||
G4int imix = 2*std::abs(id1) - 1;
|
||||
if(theSpin == SpinZero) {
|
||||
PDGEncoding = 110*(1 + (G4int)(rmix + scalarMesonMixings[imix - 1])
|
||||
+ (G4int)(rmix + scalarMesonMixings[imix])
|
||||
@@ -138,8 +138,8 @@ G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
|
||||
) + theSpin;
|
||||
}
|
||||
} else {
|
||||
PDGEncoding = 100 * abs(id1) + 10 * abs(id2) + theSpin;
|
||||
G4bool IsUp = (abs(id1)&1) == 0; // quark 1 up type quark (u or c)
|
||||
PDGEncoding = 100 * std::abs(id1) + 10 * std::abs(id2) + theSpin;
|
||||
G4bool IsUp = (std::abs(id1)&1) == 0; // quark 1 up type quark (u or c)
|
||||
G4bool IsAnti = id1 < 0; // quark 1 is antiquark?
|
||||
if( (IsUp && IsAnti ) || (!IsUp && !IsAnti ) )
|
||||
PDGEncoding = - PDGEncoding;
|
||||
@@ -177,7 +177,7 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
|
||||
// Verify Input Charge
|
||||
G4double charge = black->GetPDGCharge()
|
||||
+ white->GetPDGCharge();
|
||||
if (abs(charge) > 2 || abs(3.*charge - 3*G4int(charge)) > perCent )
|
||||
if (std::abs(charge) > 2 || std::abs(3.*charge - 3*G4int(charge)) > perCent )
|
||||
{
|
||||
G4cerr << " G4HadronBuilder::Build()" << G4endl;
|
||||
G4cerr << " Invalid total charge found for on input: "
|
||||
@@ -190,19 +190,19 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
|
||||
#endif
|
||||
G4int id1= black->GetPDGEncoding();
|
||||
G4int id2= white->GetPDGEncoding();
|
||||
if ( abs(id1) < abs(id2) )
|
||||
if ( std::abs(id1) < std::abs(id2) )
|
||||
{
|
||||
G4int xchg = id1;
|
||||
id1 = id2;
|
||||
id2 = xchg;
|
||||
}
|
||||
|
||||
if (abs(id1) < 1000 || abs(id2) > 3 )
|
||||
if (std::abs(id1) < 1000 || std::abs(id2) > 3 )
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4HadronBuilder::Barion: Illegal quark content as input");
|
||||
|
||||
G4int ifl1= abs(id1)/1000;
|
||||
G4int ifl2 = (abs(id1) - ifl1 * 1000)/100;
|
||||
G4int diquarkSpin = abs(id1)%10;
|
||||
G4int ifl1= std::abs(id1)/1000;
|
||||
G4int ifl2 = (std::abs(id1) - ifl1 * 1000)/100;
|
||||
G4int diquarkSpin = std::abs(id1)%10;
|
||||
G4int ifl3 = id2;
|
||||
if (id1 < 0)
|
||||
{
|
||||
@@ -210,9 +210,9 @@ G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
|
||||
ifl2 = - ifl2;
|
||||
}
|
||||
//... Construct barion, distinguish Lambda and Sigma barions.
|
||||
G4int kfla = abs(ifl1);
|
||||
G4int kflb = abs(ifl2);
|
||||
G4int kflc = abs(ifl3);
|
||||
G4int kfla = std::abs(ifl1);
|
||||
G4int kflb = std::abs(ifl2);
|
||||
G4int kflc = std::abs(ifl3);
|
||||
|
||||
G4int kfld = std::max(kfla,kflb);
|
||||
kfld = std::max(kfld,kflc);
|
||||
|
||||
+5
-5
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4LundStringFragmentation.cc,v 1.2 2003/11/03 17:54:53 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4LundStringFragmentation.cc,v 1.3 2004/12/07 13:50:14 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -85,12 +85,12 @@ 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 * exp(-alund*Mt2/zOfMaxyf);
|
||||
G4double maxYf=(1-zOfMaxyf)/zOfMaxyf * std::exp(-alund*Mt2/zOfMaxyf);
|
||||
do
|
||||
{
|
||||
z = zmin + G4UniformRand()*(zmax-zmin);
|
||||
// yf = pow(1. - z, blund)/z*exp(-alund*Mt2/z);
|
||||
yf = (1-z)/z * exp(-alund*Mt2/z);
|
||||
// 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);
|
||||
return z;
|
||||
|
||||
+5
-5
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QGSMFragmentation.cc,v 1.2 2003/11/03 17:54:53 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4QGSMFragmentation.cc,v 1.3 2004/12/07 13:50:15 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -74,7 +74,7 @@ G4double G4QGSMFragmentation::GetLightConeZ(G4double zmin, G4double zmax, G4int
|
||||
{
|
||||
G4double z;
|
||||
G4double theA(0), d1, d2, yf;
|
||||
G4int absCode = abs( PartonEncoding );
|
||||
G4int absCode = std::abs( PartonEncoding );
|
||||
if (absCode < 10)
|
||||
{
|
||||
if(absCode == 1 || absCode == 2) theA = arho;
|
||||
@@ -86,7 +86,7 @@ G4double G4QGSMFragmentation::GetLightConeZ(G4double zmin, G4double zmax, G4int
|
||||
z = zmin + G4UniformRand() * (zmax - zmin);
|
||||
d1 = (1. - z);
|
||||
d2 = (alft - theA);
|
||||
yf = pow(d1, d2);
|
||||
yf = std::pow(d1, d2);
|
||||
}
|
||||
while (G4UniformRand() > yf);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ G4double G4QGSMFragmentation::GetLightConeZ(G4double zmin, G4double zmax, G4int
|
||||
{
|
||||
z = zmin + G4UniformRand() * (zmax - zmin);
|
||||
d1 = (1. - z);
|
||||
yf = pow(d1, d2);
|
||||
yf = std::pow(d1, d2);
|
||||
}
|
||||
while (G4UniformRand() > yf);
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VKinkyStringDecay.cc,v 1.1 2003/10/07 11:25:41 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// Maxim Komogorov
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
+14
-14
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VLongitudinalStringDecay.cc,v 1.2 2003/11/03 17:54:53 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4VLongitudinalStringDecay.cc,v 1.3 2004/12/07 13:50:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -166,10 +166,10 @@ G4VLongitudinalStringDecay::pDefPair G4VLongitudinalStringDecay::CreatePartonPai
|
||||
|
||||
G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt()
|
||||
{
|
||||
G4double Pt = -log(G4UniformRand());
|
||||
Pt = SigmaQT * sqrt(Pt);
|
||||
G4double Pt = -std::log(G4UniformRand());
|
||||
Pt = SigmaQT * std::sqrt(Pt);
|
||||
G4double phi = 2.*pi*G4UniformRand();
|
||||
return G4ThreeVector(Pt * cos(phi),Pt * sin(phi),0);
|
||||
return G4ThreeVector(Pt * std::cos(phi),Pt * std::sin(phi),0);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
@@ -258,8 +258,8 @@ G4ParticleDefinition *G4VLongitudinalStringDecay::DiQuarkSplitup(
|
||||
pDefPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted
|
||||
//... Build new Diquark
|
||||
G4int QuarkEncoding=QuarkPair.second->GetPDGEncoding();
|
||||
G4int i10 = std::max(abs(QuarkEncoding), abs(stableQuarkEncoding));
|
||||
G4int i20 = std::min(abs(QuarkEncoding), abs(stableQuarkEncoding));
|
||||
G4int i10 = std::max(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding));
|
||||
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);
|
||||
@@ -614,7 +614,7 @@ G4KineticTrackVector* G4VLongitudinalStringDecay::LightFragmentationTest(const
|
||||
|
||||
G4ThreeVector Mom3 = string->Get4Momentum().vect();
|
||||
G4LorentzVector Mom(Mom3,
|
||||
sqrt(Mom3.mag2() + sqr(hadrons.first->GetPDGMass())));
|
||||
std::sqrt(Mom3.mag2() + sqr(hadrons.first->GetPDGMass())));
|
||||
result->push_back(new G4KineticTrack(hadrons.first, 0, string->GetPosition(), Mom));
|
||||
} else
|
||||
{
|
||||
@@ -651,21 +651,21 @@ 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.)? sqrt(r_val)/(2.*InitialMass) : 0;
|
||||
G4double Pabs = (r_val > 0.)? std::sqrt(r_val)/(2.*InitialMass) : 0;
|
||||
|
||||
//... sample unit vector
|
||||
G4double pz = 1. - 2.*G4UniformRand();
|
||||
G4double st = sqrt(1. - pz * pz)*Pabs;
|
||||
G4double st = std::sqrt(1. - pz * pz)*Pabs;
|
||||
G4double phi = 2.*pi*G4UniformRand();
|
||||
G4double px = st*cos(phi);
|
||||
G4double py = st*sin(phi);
|
||||
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(sqrt(Pabs*Pabs + Mass*Mass));
|
||||
Mom->setE(std::sqrt(Pabs*Pabs + Mass*Mass));
|
||||
|
||||
AntiMom->setPx(-px); AntiMom->setPy(-py); AntiMom->setPz(-pz);
|
||||
AntiMom->setE (sqrt(Pabs*Pabs + AntiMass*AntiMass));
|
||||
AntiMom->setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user