Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
@@ -1,24 +1,58 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Axis2Placement3D.cc,v 1.5 2000/11/20 17:54:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
//
// G4Axis2Placement3D.cc
//
// ----------------------------------------------------------------------
#include "G4Axis2Placement3D.hh"
//G4Axis2Placement3D
G4Axis2Placement3D::G4Axis2Placement3D(){}
G4Axis2Placement3D::~G4Axis2Placement3D(){}
// this function is used in STEPinterface directory
// copy constructor (used in STEPinterface module)
//
G4Axis2Placement3D::G4Axis2Placement3D(const G4Axis2Placement3D& place)
: location(place.location), axis(place.axis),
refDirection(place.refDirection),
pX(place.pX), pY(place.pY), pZ(place.pZ),
toPlacementCoordinates(place.toPlacementCoordinates),
fromPlacementCoordinates(place.fromPlacementCoordinates)
{
refDirection = place.GetRefDirection();
axis = place.GetAxis();
location = place.GetLocation();
pX = place.GetPX();
pY = place.GetPY();
pZ = place.GetPZ();
toPlacementCoordinates = GetToPlacementCoordinates();
fromPlacementCoordinates = GetFromPlacementCoordinates();
}
// assignment operator
//
G4Axis2Placement3D&
G4Axis2Placement3D::operator=(const G4Axis2Placement3D& place)
{
if (&place == this) return *this;
refDirection = place.refDirection;
axis = place.axis;
location = place.location;
pX = place.pX;
pY = place.pY;
pZ = place.pZ;
toPlacementCoordinates = place.toPlacementCoordinates;
fromPlacementCoordinates = place.fromPlacementCoordinates;
return *this;
}
/* everything below here is commented-out ...
/*
G4Axis2Placement3D::G4Axis2Placement3D(const G4ThreeVec Dir,
const G4ThreeVec Axis,
const G4Point3d Pt )
@@ -32,7 +66,11 @@ G4Axis2Placement3D::G4Axis2Placement3D(const G4ThreeVec Dir,
G4Ray::CalcPlane3Pts(Pl, Pt, Pt2, Pt3);
}
G4Axis2Placement3D::G4Axis2Placement3D(const G4ThreeVec Dir, const G4ThreeVec Axis, const G4Point3d Pt1, const G4Point3d Pt2, const G4Point3d Pt3)
G4Axis2Placement3D::G4Axis2Placement3D(const G4ThreeVec Dir,
const G4ThreeVec Axis,
const G4Point3d Pt1,
const G4Point3d Pt2,
const G4Point3d Pt3)
{
dir=Dir;
axis=Axis;
@@ -40,10 +78,10 @@ G4Axis2Placement3D::G4Axis2Placement3D(const G4ThreeVec Dir, const G4ThreeVec Ax
ComputeNormal();
G4Ray::CalcPlane3Pts(Pl, Pt1, Pt2, Pt3);
}
*/
/*
void G4Axis2Placement3D::ProjectPlacement(const G4Plane& Pl1, const G4Plane& Pl2)
void
G4Axis2Placement3D::ProjectPlacement(const G4Plane& Pl1,
const G4Plane& Pl2)
{
Project(ProjectedDir, dir, Pl1, Pl2);
Project(ProjectedAxis, axis, Pl1, Pl2);
@@ -51,7 +89,8 @@ void G4Axis2Placement3D::ProjectPlacement(const G4Plane& Pl1, const G4Plane& Pl2
Project(ProjectedNormal, Normal, Pl1, Pl2);
}
void G4Axis2Placement3D::ComputeNormal()
void
G4Axis2Placement3D::ComputeNormal()
{
if(dir == axis)
@@ -65,7 +104,8 @@ void G4Axis2Placement3D::ComputeNormal()
}
G4Point3d G4Axis2Placement3D::EvaluateIntersection(register const G4Ray& rray)
G4Point3d
G4Axis2Placement3D::EvaluateIntersection(register const G4Ray& rray)
{
// s is solution, line is p + tq, n is G4Plane Normal, r is point on G4Plane
@@ -79,10 +119,10 @@ G4Point3d G4Axis2Placement3D::EvaluateIntersection(register const G4Ray& rray)
G4double dirz = RayDir.Z();
b = Normal.X() * dirx + Normal.Y() * diry + Normal.Z() * dirz;
if (fabs(b) < 0.001)//== 0.0) // or some better test involving a small positive e
// if (b == 0.0) // or some better test involving a small positive e
if (fabs(b) < 0.001)//== 0.0)
// or some better test involving a small positive e
{
// G4cout << "\nLine is parallel to G4Plane.No Hit.";
// G4cout << "\nLine is parallel to G4Plane.No Hit.";
G4Point3d hit_point( kInfinity, kInfinity, kInfinity);
return hit_point;
}
@@ -90,27 +130,20 @@ G4Point3d G4Axis2Placement3D::EvaluateIntersection(register const G4Ray& rray)
G4double starty = RayStart.Y();
G4double startz = RayStart.Z();
a = Normal.X() * (srf_point.X() - startx) + Normal.Y() * (srf_point.Y() - starty)
a = Normal.X() * (srf_point.X() - startx)
+ Normal.Y() * (srf_point.Y() - starty)
+ Normal.Z() * (srf_point.Z() - startz);
t = a/b;
// substitute t into line equation
// to calculate final solution
G4Point3d hit_point(startx + t * dirx,starty + t * diry,startz + t * dirz);
// to calculate final solution
G4Point3d hit_point(startx + t * dirx,starty
+ t * diry,startz
+ t * dirz);
// G4cout << "\nPLANE HIT POINT :" << hit_point.X() << " " << hit_point.Y() << " " << hit_point.Z();
// G4cout << "\nPLANE HIT POINT :" << hit_point.X()
// << " " << hit_point.Y() << " " << hit_point.Z();
return hit_point;
}
*/