Import Geant4 10.6.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2019-06-28 11:59:04 +02:00
parent 28a70706e0
commit d0f911957d
1056 changed files with 95168 additions and 78160 deletions
@@ -416,7 +416,7 @@ class G4GHEKinematicsVector
a = (momentum.x()*p.momentum.x() +
momentum.y()*p.momentum.y() +
momentum.z()*p.momentum.z()) / a;
if( std::fabs(a) > 1.0 ) a<0.0 ? a=-1.0 : a=1.0;
if( std::abs(a) > 1.0 ) a<0.0 ? a=-1.0 : a=1.0;
}
return a;
}
@@ -429,7 +429,7 @@ class G4GHEKinematicsVector
a = (momentum.x()*p.momentum.x() +
momentum.y()*p.momentum.y() +
momentum.z()*p.momentum.z()) / a;
if( std::fabs(a) > 1.0 ) a<0.0 ? a=-1.0 : a=1.0;
if( std::abs(a) > 1.0 ) a<0.0 ? a=-1.0 : a=1.0;
}
return std::acos(a);
}
@@ -583,7 +583,7 @@ class G4GHEKinematicsVector
{
G4double ph, px, py, pz;
G4double cost = p2.momentum.z()/p2.momentum.mag();
G4double sint = 0.5 * ( std::sqrt(std::fabs((1.-cost)*(1.+cost)))
G4double sint = 0.5 * ( std::sqrt(std::abs((1.-cost)*(1.+cost)))
+ std::sqrt(pt2)/p2.momentum.mag());
(p2.momentum.y() < 0.) ? ph = 1.5*CLHEP::pi : ph = CLHEP::halfpi;
if( p2.momentum.x() != 0.0)
@@ -30,7 +30,7 @@
#include "G4Material.hh"
#include "G4ParticleDefinition.hh"
#include "G4LorentzVector.hh"
#include "G4LorentzVector.hh"
#include "G4ThreeVector.hh"
#include "G4LorentzRotation.hh"
class G4Track;
@@ -49,6 +49,7 @@ public:
inline const G4Material * GetMaterial() const;
inline const G4ParticleDefinition * GetDefinition() const;
inline const G4LorentzVector & Get4Momentum() const;
inline const G4ThreeVector & GetMomentumDirection() const;
inline G4LorentzRotation & GetTrafoToLab();
inline G4double GetKineticEnergy() const;
inline G4double GetTotalEnergy() const;
@@ -59,16 +60,20 @@ public:
inline void SetBoundEnergy(G4double e);
private:
void InitialiseLocal(const G4DynamicParticle*);
// hide assignment operator as private
G4HadProjectile& operator=(const G4HadProjectile &right);
G4HadProjectile(const G4HadProjectile& );
const G4Material * theMat;
G4LorentzVector theOrgMom;
G4LorentzVector theMom;
const G4ParticleDefinition * theDef;
G4LorentzVector theMom;
G4LorentzRotation toLabFrame;
G4ThreeVector theDirection;
G4double theMass;
G4double theKinEnergy;
G4double theTime;
G4double theBoundEnergy;
};
@@ -93,21 +98,24 @@ inline G4LorentzRotation& G4HadProjectile::GetTrafoToLab()
return toLabFrame;
}
inline const G4ThreeVector& G4HadProjectile::GetMomentumDirection() const
{
return theDirection;
}
G4double G4HadProjectile::GetTotalEnergy() const
{
return Get4Momentum().e();
return theMom.e();
}
G4double G4HadProjectile::GetTotalMomentum() const
{
return Get4Momentum().vect().mag();
return theMom.pz();
}
G4double G4HadProjectile::GetKineticEnergy() const
{
G4double ekin = GetTotalEnergy() - GetDefinition()->GetPDGMass();
if(ekin < 0.0) { ekin = 0.0; }
return ekin;
return theKinEnergy;
}
inline G4double G4HadProjectile::GetGlobalTime() const
@@ -27,39 +27,24 @@
#define G4HadronicException_h
#include <exception>
#include <iostream>
#include "globals.hh"
class G4HadronicException : public std::exception
{
public:
G4HadronicException(G4String in, G4int at, G4String mess)
{
theMessage = mess;
theName = in;
theLine = at;
Report(G4cout);
class G4HadronicException : public std::exception {
public:
G4HadronicException(G4String in, G4int at, G4String mess);
if(getenv("DumpCoreOnHadronicException") )
{
G4Exception("G4HadronicException", "007", FatalException,
"Fatal problem in above location");
}
}
virtual ~G4HadronicException() throw () {}
void Report(std::ostream & aS)
{
aS<< "In " <<theName<<", line "<<theLine<<": "<<std::endl;
aS<< "===> "<<theMessage<<std::endl;
}
private:
G4String theMessage;
G4String theName;
G4int theLine;
virtual ~G4HadronicException() throw();
const char *what() const noexcept override;
void Report(std::ostream &aS) const;
private:
const G4String theMessage;
const G4String theName;
const G4int theLine;
G4String whatString;
};
#endif