Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
@@ -25,7 +25,7 @@
//
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
// GEANT 4 class implementation file
// ------------------------------------------------------------
//
@@ -36,26 +36,26 @@
#include "G4GeometryTolerance.hh"
//------------------------------------------------------------------------
G4ErrorSurfaceTrajParam::
G4ErrorSurfaceTrajParam( const G4Point3D& pos, const G4Vector3D& mom,
const G4Vector3D& vecV, const G4Vector3D& vecW )
G4ErrorSurfaceTrajParam::G4ErrorSurfaceTrajParam(const G4Point3D& pos,
const G4Vector3D& mom,
const G4Vector3D& vecV,
const G4Vector3D& vecW)
{
SetParameters( pos, mom, vecV, vecW );
}
//------------------------------------------------------------------------
G4ErrorSurfaceTrajParam::
G4ErrorSurfaceTrajParam( const G4Point3D& pos, const G4Vector3D& mom,
const G4Plane3D& plane )
{
SetParameters( pos, mom, plane );
SetParameters(pos, mom, vecV, vecW);
}
//------------------------------------------------------------------------
void G4ErrorSurfaceTrajParam::
SetParameters( const G4Point3D& pos, const G4Vector3D& mom,
const G4Plane3D& plane )
G4ErrorSurfaceTrajParam::G4ErrorSurfaceTrajParam(const G4Point3D& pos,
const G4Vector3D& mom,
const G4Plane3D& plane)
{
SetParameters(pos, mom, plane);
}
//------------------------------------------------------------------------
void G4ErrorSurfaceTrajParam::SetParameters(const G4Point3D& pos,
const G4Vector3D& mom,
const G4Plane3D& plane)
{
//--- Get two perpendicular vectors: first parallel X
// (unless normal is parallel to X, then take Y)
@@ -63,63 +63,64 @@ SetParameters( const G4Point3D& pos, const G4Vector3D& mom,
G4double kCarTolerance =
G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
G4ThreeVector Xvec(1.,0.,0.);
G4ThreeVector Xvec(1., 0., 0.);
G4Vector3D vecV = -Xvec.cross(plane.normal());
if( vecV.mag() < kCarTolerance )
if(vecV.mag() < kCarTolerance)
{
G4ThreeVector Zvec(0.,0.,1.);
G4ThreeVector Zvec(0., 0., 1.);
vecV = Zvec.cross(plane.normal());
}
G4Vector3D vecW = plane.normal().cross( vecV );
G4Vector3D vecW = plane.normal().cross(vecV);
SetParameters( pos, mom, vecV, vecW );
SetParameters(pos, mom, vecV, vecW);
}
//------------------------------------------------------------------------
void G4ErrorSurfaceTrajParam::
SetParameters( const G4Point3D& pos, const G4Vector3D& mom,
const G4Vector3D& vecV, const G4Vector3D& vecW )
void G4ErrorSurfaceTrajParam::SetParameters(const G4Point3D& pos,
const G4Vector3D& mom,
const G4Vector3D& vecV,
const G4Vector3D& vecW)
{
if( mom.mag() > 0. ) {
if(mom.mag() > 0.)
{
fDir = mom;
fDir /= mom.mag();
} else {
fDir = G4Vector3D(0.,0.,0.);
}
else
{
fDir = G4Vector3D(0., 0., 0.);
}
fVectorV = vecV / vecV.mag();
fVectorW = vecW / vecW.mag();
fInvP = 1./mom.mag();
fInvP = 1. / mom.mag();
G4ThreeVector momv(mom);
//check 3 vectors are ortogonal and right handed
// check 3 vectors are ortogonal and right handed
// now all 4 scalar memeber variables retain the signs
// fPV = momv.project( vecV ).mag();
// fPW = momv.project( vecW ).mag();
fPV = momv.dot( vecV );
fPW = momv.dot( vecW );
fPV = momv.dot(vecV);
fPW = momv.dot(vecW);
G4ThreeVector posv(pos);
// fV = posv.project( vecV ).mag();
// fW = posv.project( vecW ).mag();
fV = posv.dot( vecV );
fW = posv.dot( vecW );
fV = posv.dot(vecV);
fW = posv.dot(vecW);
}
//------------------------------------------------------------------------
std::ostream& operator<<(std::ostream& out, const G4ErrorSurfaceTrajParam& tp)
{
// long mode = out.setf(std::ios::fixed,std::ios::floatfield);
// out << tp.theType;
// out << std::setprecision(5) << std::setw(10);
out << " InvP= " << tp.fInvP << " PV= " << tp.fPV
<< " PW= " << tp.fPW << " V= " << tp.fV << " W= " << tp.fW << G4endl;
out << " InvP= " << tp.fInvP << " PV= " << tp.fPV << " PW= " << tp.fPW
<< " V= " << tp.fV << " W= " << tp.fW << G4endl;
out << " vectorV direction= " << tp.fVectorV
<< " vectorW direction= " << tp.fVectorW << G4endl;
return out;
}