Import Geant4 3.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:10:37 +02:00
parent 137e303ecc
commit 36c080dca6
3464 changed files with 119310 additions and 52696 deletions
@@ -1,12 +1,28 @@
// 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.
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * 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: G4ReplicaNavigation.icc,v 1.3 2000/11/20 18:59:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// $Id: G4ReplicaNavigation.icc,v 1.4.2.1 2001/06/28 19:09:41 gunter Exp $
// GEANT4 tag $Name: $
//
//
// class G4ReplicaNavigation Inline implementation
@@ -17,14 +33,16 @@ inline G4int G4ReplicaNavigation::VoxelLocate(const G4SmartVoxelHeader *pHead,
{
EAxis targetHeaderAxis;
G4double coord=0.;
G4double targetHeaderMin;
G4double targetHeaderMin, targetHeaderMax;
G4double targetHeaderNodeWidth,targetNodePos;
G4int targetHeaderNoSlices,targetNodeNo;
targetHeaderAxis=pHead->GetAxis();
targetHeaderNoSlices=pHead->GetNoSlices();
targetHeaderMin=pHead->GetMinExtent();
targetHeaderNodeWidth=(pHead->GetMaxExtent()-targetHeaderMin)/targetHeaderNoSlices;
targetHeaderMax=pHead->GetMaxExtent();
targetHeaderNodeWidth=(targetHeaderMax-targetHeaderMin)/targetHeaderNoSlices;
switch (targetHeaderAxis)
{
case kXAxis:
@@ -60,27 +78,40 @@ inline G4int G4ReplicaNavigation::VoxelLocate(const G4SmartVoxelHeader *pHead,
// (or similar) P.Kent
// assert(targetNodeNo>=0&&targetNodeNo<targetHeaderNoSlices);
// The assert above fails for simulation of high energy electrons
// It is not clear what is the cause for this failure.
// The code below attempts to rectify this problem until a
// complete resolution is possible.
// The assert above fails for simulation of high energy electrons
// It is not clear what is the cause for this failure.
// The code below attempts to rectify this problem until a
// complete resolution is possible.
// J.Apostolakis, June 12, 1998
if((targetNodeNo<0) || (targetNodeNo>=targetHeaderNoSlices))
{
#ifdef G4_REPORT_REPLICA_NAV
G4cerr << " ERROR: assert in G4ReplicaNavigation::VoxelLocate "
G4cerr << " WARNING: assert in G4ReplicaNavigation::VoxelLocate "
<< " has failed : " << G4endl <<
<< " (targetNodeNo>=0&&targetNodeNo<targetHeaderNoSlices) "
<< " targetNodeNo= " << targetNodeNo
<< " Number of Slices = " << targetHeaderNoSlices << G4endl;
#endif
if (targetNodeNo<0)
{
targetNodeNo=0;
}
else if (targetNodeNo>=targetHeaderNoSlices)
{
targetNodeNo=targetHeaderNoSlices-1;
// In the case of rotational symmetry and an extent over the
// whole 360 degrees, the above is not true and you can go from
// the last voxel to the zeroth and vice versa
// H.Boie, April 30, 2001
if(targetHeaderAxis==kPhi &&
targetHeaderMin==0 && targetHeaderMax==2*M_PI)
{
if(targetNodeNo<0)
targetNodeNo=targetHeaderNoSlices-1;
else if(targetNodeNo>=targetHeaderNoSlices)
targetNodeNo=0;
}
else
{
if(targetNodeNo<0)
targetNodeNo=0;
else if(targetNodeNo>=targetHeaderNoSlices)
targetNodeNo=targetHeaderNoSlices-1;
}
}
}