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
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4AuxiliaryNavServices.hh,v 1.3 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4NormalNavigation
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4BlockingList.hh,v 1.4 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
// class G4BlockingList
//
@@ -5,13 +5,24 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4BlockingList.icc,v 1.2 1999/12/15 14:50:21 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4BlockingList.icc,v 1.3 2000/11/20 18:59:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4BlockingList Inlined Implementation
//
inline G4BlockingList::G4BlockingList(G4int maxDefault,G4int stride)
: fStride(stride), fBlockingList(maxDefault)
{
FullyReset();
}
// Do nothing destructor
inline G4BlockingList::~G4BlockingList()
{
}
inline G4int G4BlockingList::Length() const
{
return fBlockingList.length();
@@ -53,15 +64,3 @@ inline void G4BlockingList::Enlarge(const G4int nv)
}
}
}
inline G4BlockingList::G4BlockingList(G4int maxDefault,G4int stride) :
fBlockingList(maxDefault),fStride(stride)
{
FullyReset();
}
// Do nothing destructor
inline G4BlockingList::~G4BlockingList()
{
}
+12 -6
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GRSSolid.hh,v 1.3 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4GRSSolid.hh,v 1.4 2000/11/01 16:51:05 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4GRSSolid
@@ -41,10 +41,16 @@ class G4GRSSolid : public G4VTouchable
const G4ThreeVector &tlate);
~G4GRSSolid();
G4VSolid* GetSolid(G4int depth=0) const;
const G4ThreeVector& GetTranslation(G4int depth=0) const;
const G4RotationMatrix* GetRotation(G4int depth=0) const;
inline G4VSolid* GetSolid(G4int depth=0) const;
inline const G4ThreeVector& GetTranslation(G4int depth=0) const;
inline const G4RotationMatrix* GetRotation(G4int depth=0) const;
private:
G4GRSSolid(const G4GRSSolid&);
G4GRSSolid& operator=(const G4GRSSolid&);
// Copy constructor and assignment operator NOT public
private:
G4VSolid *fsolid;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GRSSolid.icc,v 1.2 1999/12/15 14:50:21 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4GRSSolid.icc,v 1.4 2000/11/20 18:59:33 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4GRSSolid inline implementation
@@ -14,7 +14,8 @@
inline G4GRSSolid::G4GRSSolid(G4VSolid *pSolid,
const G4RotationMatrix *pRot,
const G4ThreeVector &tlate)
: fsolid(pSolid),ftlate(tlate), G4VTouchable()
: G4VTouchable(),
fsolid(pSolid), ftlate(tlate)
{
if (pRot)
{
@@ -30,7 +31,8 @@ inline G4GRSSolid::G4GRSSolid(G4VSolid *pSolid,
inline G4GRSSolid::G4GRSSolid(G4VSolid *pSolid,
const G4RotationMatrix &rot,
const G4ThreeVector &tlate)
: fsolid(pSolid),ftlate(tlate), G4VTouchable()
: G4VTouchable(),
fsolid(pSolid), ftlate(tlate)
{
frot=new G4RotationMatrix(rot);
if (!frot) G4Exception ("G4GRSSolid::G4GRSSolid cannot alloc G4RotationMatrix");
+13 -7
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GRSVolume.hh,v 1.3 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4GRSVolume.hh,v 1.4 2000/11/01 16:51:05 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4GRSVolume
@@ -43,11 +43,17 @@ class G4GRSVolume : public G4VTouchable
const G4ThreeVector &tlate);
~G4GRSVolume();
G4VPhysicalVolume* GetVolume(G4int depth=0) const;
G4VSolid* GetSolid(G4int depth=0) const;
const G4ThreeVector& GetTranslation(G4int depth=0) const;
const G4RotationMatrix* GetRotation(G4int depth=0) const;
inline G4VPhysicalVolume* GetVolume(G4int depth=0) const;
inline G4VSolid* GetSolid(G4int depth=0) const;
inline const G4ThreeVector& GetTranslation(G4int depth=0) const;
inline const G4RotationMatrix* GetRotation(G4int depth=0) const;
private:
G4GRSVolume(const G4GRSVolume&);
G4GRSVolume& operator=(const G4GRSVolume&);
// Copy constructor and assignment operator NOT public
private:
G4VPhysicalVolume *fvol;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GRSVolume.icc,v 1.3 1999/12/15 14:50:21 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4GRSVolume.icc,v 1.5 2000/11/20 18:59:33 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4GRSVolume inline implementation
@@ -14,7 +14,8 @@
inline G4GRSVolume::G4GRSVolume(G4VPhysicalVolume *pVol,
const G4RotationMatrix *pRot,
const G4ThreeVector &tlate)
: fvol(pVol),ftlate(tlate), G4VTouchable()
: G4VTouchable(),
fvol(pVol), ftlate(tlate)
{
if (pRot)
{
@@ -30,7 +31,8 @@ inline G4GRSVolume::G4GRSVolume(G4VPhysicalVolume *pVol,
inline G4GRSVolume::G4GRSVolume(G4VPhysicalVolume *pVol,
const G4RotationMatrix &rot,
const G4ThreeVector &tlate)
: fvol(pVol),ftlate(tlate), G4VTouchable()
: G4VTouchable(),
fvol(pVol), ftlate(tlate)
{
frot=new G4RotationMatrix(rot);
if (!frot) G4Exception ("G4GRSVolume::G4GRSVolume cannot alloc G4RotationMatrix");
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LogicalBorderSurface.hh,v 1.4 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4LogicalBorderSurface.hh,v 1.5 2000/11/01 16:51:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
////////////////////////////////////////////////////////////////////////
// class G4LogicalBorderSurface
@@ -70,14 +70,14 @@ class G4LogicalBorderSurface: public G4LogicalSurface
static G4LogicalBorderSurface* GetSurface(const G4VPhysicalVolume* vol1,
const G4VPhysicalVolume* vol2);
void SetPhysicalVolumes(G4VPhysicalVolume* vol1,
inline void SetPhysicalVolumes(G4VPhysicalVolume* vol1,
G4VPhysicalVolume* vol2);
G4VPhysicalVolume* GetVolume1() const;
G4VPhysicalVolume* GetVolume2() const;
inline const G4VPhysicalVolume* GetVolume1() const;
inline const G4VPhysicalVolume* GetVolume2() const;
void SetVolume1(G4VPhysicalVolume* vol1);
void SetVolume2(G4VPhysicalVolume* vol2);
inline void SetVolume1(G4VPhysicalVolume* vol1);
inline void SetVolume2(G4VPhysicalVolume* vol2);
// These are potentially dangerous.
static const G4RWTPtrOrderedVector<G4LogicalBorderSurface>* GetSurfaceTable();
@@ -85,7 +85,7 @@ class G4LogicalBorderSurface: public G4LogicalSurface
static void DumpInfo();
// Methods dealing with the table of surfaces.
size_t GetIndex() const;
inline size_t GetIndex() const;
//////////////
// Operators
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LogicalBorderSurface.icc,v 1.1 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4LogicalBorderSurface.icc,v 1.2 2000/11/01 16:51:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4LogicalBorderSurface inline implementation
@@ -20,13 +20,15 @@ void G4LogicalBorderSurface::SetPhysicalVolumes(G4VPhysicalVolume* vol1,
}
inline
G4VPhysicalVolume* G4LogicalBorderSurface::GetVolume1() const
const G4VPhysicalVolume*
G4LogicalBorderSurface::GetVolume1() const
{
return Volume1;
}
inline
G4VPhysicalVolume* G4LogicalBorderSurface::GetVolume2() const
const G4VPhysicalVolume*
G4LogicalBorderSurface::GetVolume2() const
{
return Volume2;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LogicalSkinSurface.hh,v 1.4 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4LogicalSkinSurface.hh,v 1.5 2000/11/01 16:51:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
////////////////////////////////////////////////////////////////////////
// class G4LogicalSkinSurface
@@ -68,15 +68,15 @@ class G4LogicalSkinSurface : public G4LogicalSurface
static G4LogicalSkinSurface* GetSurface(const G4LogicalVolume* vol);
G4LogicalVolume* GetLogicalVolume() const;
void SetLogicalVolume(G4LogicalVolume* vol);
inline const G4LogicalVolume* GetLogicalVolume() const;
inline void SetLogicalVolume(G4LogicalVolume* vol);
static size_t GetNumberOfSkinSurfaces();
static void DumpInfo(); // const
// Methods dealing with the table of surfaces.
#if THESE_ARE_NEEDED
size_t GetIndex() const;
inline size_t GetIndex() const;
#endif
//////////////
@@ -5,14 +5,15 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LogicalSkinSurface.icc,v 1.1 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4LogicalSkinSurface.icc,v 1.2 2000/11/01 16:51:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4LogicalSkinSurface inline implementation
inline
G4LogicalVolume* G4LogicalSkinSurface::GetLogicalVolume() const
const G4LogicalVolume*
G4LogicalSkinSurface::GetLogicalVolume() const
{
return LogVolume;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NavigationHistory.hh,v 1.5 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4NavigationHistory.hh,v 1.7 2000/11/20 18:59:38 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// class G4NavigationHistory
//
@@ -25,7 +25,7 @@
#define G4NAVIGATIONHISTORY_HH
#include <assert.h>
#include "globals.hh"
#include "geomdefs.hh"
#include "G4AffineTransform.hh"
#include "G4VPhysicalVolume.hh"
@@ -35,56 +35,98 @@
#include "g4rw/tpvector.h"
#include "g4std/iostream"
const G4int kHistoryMax=15; // Default max size of history
const G4int kHistoryStride=16; // History increase stride
class G4NavigationHistory
{
public: // with description
friend G4std::ostream& operator << (G4std::ostream &os,const G4NavigationHistory &h);
friend G4std::ostream&
operator << (G4std::ostream &os, const G4NavigationHistory &h);
G4NavigationHistory();
G4NavigationHistory(const G4NavigationHistory &h);
// Constructor: sizes history lists & resets histories.
~G4NavigationHistory();
void Reset();
void Clear();
void SetFirstEntry(G4VPhysicalVolume* pVol);
const G4AffineTransform& GetTopTransform() const;
// Destructor.
const G4AffineTransform* GetPtrTopTransform() const;
G4int GetTopReplicaNo() const;
EVolume GetTopVolumeType() const;
G4VPhysicalVolume* GetTopVolume() const;
G4int GetDepth() const;
G4int GetMaxDepth() const;
const G4AffineTransform& GetTransform(const G4int n) const;
G4NavigationHistory(const G4NavigationHistory &h);
// Copy constructor.
G4int GetReplicaNo(const G4int n) const;
EVolume GetVolumeType(const G4int n) const;
G4VPhysicalVolume* GetVolume(const G4int n) const;
void NewLevel(G4VPhysicalVolume *pNewMother,
EVolume vType=kNormal,
G4int nReplica=-1);
void BackLevel();
void BackLevel(G4int n);
G4NavigationHistory& operator=(const G4NavigationHistory &h);
// Assignment operator.
inline void Reset();
// Resets history. It now does clear most entries.
// Level 0 is preserved.
inline void Clear();
// Clears entries, zeroing transforms, matrices & negating
// replica history.
inline void SetFirstEntry(G4VPhysicalVolume* pVol);
// Setup initial entry in stack: copies through volume transform & matrix.
// The volume is assumed to be unrotated.
inline const G4AffineTransform& GetTopTransform() const;
// Returns topmost transform.
inline const G4AffineTransform* GetPtrTopTransform() const;
// Returns pointer to topmost transform.
inline G4int GetTopReplicaNo() const;
// Returns topmost replica no record.
inline EVolume GetTopVolumeType() const;
// Returns topmost volume type.
inline G4VPhysicalVolume* GetTopVolume() const;
// Returns topmost physical volume pointer.
inline G4int GetDepth() const;
// Returns current history depth.
inline G4int GetMaxDepth() const;
// Returns current maximum size of history.
// Note: MaxDepth of 16 mean history entries [0..15] inclusive.
inline const G4AffineTransform& GetTransform(G4int n) const;
// Returns specified transformation.
inline G4int GetReplicaNo(G4int n) const;
// Returns specified replica no record.
inline EVolume GetVolumeType(G4int n) const;
// Returns specified volume type.
inline G4VPhysicalVolume* GetVolume(G4int n) const;
// Returns specified physical volume pointer.
inline void NewLevel(G4VPhysicalVolume *pNewMother,
EVolume vType=kNormal,
G4int nReplica=-1);
// Changes navigation level to that of the new mother.
inline void BackLevel();
// Back up one level in history: from mother to grandmother.
// It does not erase history record of current mother.
inline void BackLevel(G4int n);
// Back up specified number of levels in history.
private:
void EnlargeHistory();
inline void EnlargeHistory();
// Enlarge history if required: increase size by kHistoryStride.
// Note that additional history entries are `dirty' (non zero) apart
// from the volume history.
private:
G4RWTValVector<G4NavigationLevel> fNavHistory;
G4int fStackDepth;
// Depth of stack: effectively depth in geometrical tree
G4RWTValVector<G4NavigationLevel> fNavHistory;
// G4RWTPtrVector<G4NavigationLevel> fNavHistory;
};
#include "G4NavigationHistory.icc"
@@ -5,171 +5,39 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NavigationHistory.icc,v 1.2 1999/12/15 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4NavigationHistory.icc,v 1.3 2000/11/01 16:51:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4NavigationHistory Inline implementation
//
// `Reset' history. It now does clear most entries (It used to not do this).
// Level 0 is preserved
inline void G4NavigationHistory::Reset()
{
fStackDepth=0;
}
// 'Clear' entries, zeroing transforms, matrices & negating replica history
//
inline void G4NavigationHistory::Clear()
{
G4AffineTransform dummyTransform(G4ThreeVector(0.));
G4NavigationLevel tmpNavLevel;
tmpNavLevel=G4NavigationLevel(0, dummyTransform, kParameterised, -1) ;
Reset();
for (G4int ilev=fNavHistory.length()-1; ilev>=0; ilev--)
{
// fNavHistory(ilev)= 0;
fNavHistory(ilev)= tmpNavLevel;
}
}
// Constructor
// Size history lists & reset histories
inline G4NavigationHistory::G4NavigationHistory() :
fNavHistory(kHistoryMax),
fStackDepth(0)
inline
G4NavigationHistory::G4NavigationHistory()
: fNavHistory(kHistoryMax), fStackDepth(0)
{
Reset(); // Reset depth
Clear();
}
// Constructor
// Size history lists & reset histories
inline G4NavigationHistory::G4NavigationHistory(const G4NavigationHistory &h):
fNavHistory(h.fNavHistory),
fStackDepth(h.fStackDepth)
inline
G4NavigationHistory::G4NavigationHistory(const G4NavigationHistory &h)
: fNavHistory(h.fNavHistory), fStackDepth(h.fStackDepth)
{
}
// Destructor
inline G4NavigationHistory::~G4NavigationHistory()
{
Reset(); // To delete all but one current entries!
// delete fNavHistory(0);
}
// Setup initial entry in stack: copies through volume transform & matrix
// The volume is assumed to be unrotated
//
inline void G4NavigationHistory::SetFirstEntry(G4VPhysicalVolume* pVol)
inline
G4NavigationHistory&
G4NavigationHistory::operator=(const G4NavigationHistory &h)
{
G4ThreeVector translation(0.,0.,0.);
if (&h == this) return *this;
// Protection needed in case pVol=null
// so that a touchable-history can signal OutOfWorld
//
if(pVol !=0) {
translation=pVol->GetTranslation();
}
fNavHistory(0)= G4NavigationLevel( pVol,
G4AffineTransform(translation),
kNormal );
}
// Return topmost transform
inline const G4AffineTransform* G4NavigationHistory::GetPtrTopTransform() const
{
return fNavHistory(fStackDepth).GetPtrTransform();
}
// Return topmost transform
inline const G4AffineTransform& G4NavigationHistory::GetTopTransform() const
{
return fNavHistory(fStackDepth).GetTransform();
}
// Return topmost replica no record
inline G4int G4NavigationHistory::GetTopReplicaNo() const
{
return fNavHistory(fStackDepth).GetReplicaNo();
}
// Return topmost volume type
inline EVolume G4NavigationHistory::GetTopVolumeType() const
{
return fNavHistory(fStackDepth).GetVolumeType();
}
// Return topmost physical volume ptr
inline G4VPhysicalVolume* G4NavigationHistory::GetTopVolume() const
{
return fNavHistory(fStackDepth).GetPhysicalVolume();
}
// Return current history depth
inline G4int G4NavigationHistory::GetDepth() const
{
return fStackDepth;
}
// Return specified transform
inline const G4AffineTransform& G4NavigationHistory::GetTransform(const G4int n) const
{
return fNavHistory(n).GetTransform();
}
// Return specified replica no record
inline G4int G4NavigationHistory::GetReplicaNo(const G4int n) const
{
return fNavHistory(n).GetReplicaNo();
}
// Return specified volume type
inline EVolume G4NavigationHistory::GetVolumeType(const G4int n) const
{
return fNavHistory(n).GetVolumeType();
}
// Return specified physical volume ptr
inline G4VPhysicalVolume* G4NavigationHistory::GetVolume(const G4int n) const
{
return fNavHistory(n).GetPhysicalVolume();
}
// Return current maximum size of history.
// Note: MaxDepth of 16 mean history entries 0 - 15 inclusive may be used
inline G4int G4NavigationHistory::GetMaxDepth() const
{
return fNavHistory.length();
}
// Back up one level in history: from mother to grandmother
// It does not erase history record of current mother
inline void G4NavigationHistory::BackLevel()
{
assert(fStackDepth>0);
// Tell the level that I am forgetting it
// delete fNavHistory(fStackDepth);
fStackDepth--;
}
// Back up specified no of levels in history
inline void G4NavigationHistory::BackLevel(G4int n)
{
assert(n<=fStackDepth);
fStackDepth-=n;
}
inline G4NavigationHistory& G4NavigationHistory::operator=(const G4NavigationHistory &h)
{
// fNavHistory=h.fNavHistory; // This works, but is very slow.
if( this->GetMaxDepth() < h.fStackDepth ){
fNavHistory.reshape( h.fStackDepth );
@@ -184,24 +52,144 @@ inline G4NavigationHistory& G4NavigationHistory::operator=(const G4NavigationHis
return *this;
}
// Enlarge history if required
// Increase size by kHistoryStride. Note that additional
// history entries are `dirty' (non zero) apart from volume history
inline void G4NavigationHistory::EnlargeHistory()
inline
void G4NavigationHistory::Reset()
{
fStackDepth=0;
}
inline
void G4NavigationHistory::Clear()
{
G4AffineTransform dummyTransform(G4ThreeVector(0.));
G4NavigationLevel tmpNavLevel;
tmpNavLevel=G4NavigationLevel(0, dummyTransform, kParameterised, -1) ;
Reset();
for (G4int ilev=fNavHistory.length()-1; ilev>=0; ilev--)
{
// fNavHistory(ilev)= 0;
fNavHistory(ilev)= tmpNavLevel;
}
}
inline
void G4NavigationHistory::SetFirstEntry(G4VPhysicalVolume* pVol)
{
G4ThreeVector translation(0.,0.,0.);
// Protection needed in case pVol=null
// so that a touchable-history can signal OutOfWorld
//
if(pVol !=0) {
translation=pVol->GetTranslation();
}
fNavHistory(0)= G4NavigationLevel( pVol,
G4AffineTransform(translation),
kNormal );
}
inline
const G4AffineTransform* G4NavigationHistory::GetPtrTopTransform() const
{
return fNavHistory(fStackDepth).GetPtrTransform();
}
inline
const G4AffineTransform& G4NavigationHistory::GetTopTransform() const
{
return fNavHistory(fStackDepth).GetTransform();
}
inline
G4int G4NavigationHistory::GetTopReplicaNo() const
{
return fNavHistory(fStackDepth).GetReplicaNo();
}
inline
EVolume G4NavigationHistory::GetTopVolumeType() const
{
return fNavHistory(fStackDepth).GetVolumeType();
}
inline
G4VPhysicalVolume* G4NavigationHistory::GetTopVolume() const
{
return fNavHistory(fStackDepth).GetPhysicalVolume();
}
inline
G4int G4NavigationHistory::GetDepth() const
{
return fStackDepth;
}
inline
const G4AffineTransform&
G4NavigationHistory::GetTransform(G4int n) const
{
return fNavHistory(n).GetTransform();
}
inline
G4int G4NavigationHistory::GetReplicaNo(G4int n) const
{
return fNavHistory(n).GetReplicaNo();
}
inline
EVolume G4NavigationHistory::GetVolumeType(G4int n) const
{
return fNavHistory(n).GetVolumeType();
}
inline
G4VPhysicalVolume* G4NavigationHistory::GetVolume(G4int n) const
{
return fNavHistory(n).GetPhysicalVolume();
}
inline
G4int G4NavigationHistory::GetMaxDepth() const
{
return fNavHistory.length();
}
inline
void G4NavigationHistory::BackLevel()
{
assert(fStackDepth>0);
// Tell the level that I am forgetting it
// delete fNavHistory(fStackDepth);
fStackDepth--;
}
inline
void G4NavigationHistory::BackLevel(G4int n)
{
assert(n<=fStackDepth);
fStackDepth-=n;
}
inline
void G4NavigationHistory::EnlargeHistory()
{
G4int len=fNavHistory.length();
if (len==fStackDepth)
{
{ // Note: Resize operation clears additional entries
G4int nlen=len+kHistoryStride;
fNavHistory.reshape(nlen);
// Note: Resize operation clears additional entries
}
}
inline void G4NavigationHistory::NewLevel(G4VPhysicalVolume *pNewMother,
EVolume vType,
G4int nReplica)
inline
void G4NavigationHistory::NewLevel(G4VPhysicalVolume *pNewMother,
EVolume vType,
G4int nReplica)
{
EnlargeHistory(); // Enlarge if required
fStackDepth++;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NavigationLevel.hh,v 1.11 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4NavigationLevel.hh,v 1.12 2000/11/01 16:51:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// class G4NavigationLevel
//
@@ -23,7 +23,6 @@
#ifndef G4NAVIGATIONLEVEL_HH
#define G4NAVIGATIONLEVEL_HH
// #include <assert.h>
#include "globals.hh"
#include "G4AffineTransform.hh"
@@ -58,16 +57,18 @@ class G4NavigationLevel
G4NavigationLevel& operator=(const G4NavigationLevel &right);
G4VPhysicalVolume* GetPhysicalVolume() const;
const G4AffineTransform* GetTransformPtr() const ; // New
const G4AffineTransform& GetTransform() const ; // Old
// G4AffineTransform& GetTransform(); // Only temporarily
EVolume GetVolumeType() const ;
G4int GetReplicaNo() const ;
inline G4VPhysicalVolume* GetPhysicalVolume() const;
inline const G4AffineTransform* GetTransformPtr() const ; // New
inline const G4AffineTransform& GetTransform() const ; // Old
inline EVolume GetVolumeType() const ;
inline G4int GetReplicaNo() const ;
public: // without description
const G4AffineTransform* GetPtrTransform() const;
// inline G4AffineTransform& GetTransform();
inline const G4AffineTransform* GetPtrTransform() const;
// To try to resolve the possible problem with returning a reference.
inline void *operator new(size_t);
@@ -5,16 +5,17 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NavigationLevel.icc,v 1.9 1999/12/15 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4NavigationLevel.icc,v 1.10 2000/11/01 16:51:07 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// 30.09.97 J.Apostolakis Initial version.
//
inline G4NavigationLevel::G4NavigationLevel(G4VPhysicalVolume* pPhysVol,
const G4AffineTransform& afTransform,
EVolume volTp,
G4int repNo)
inline
G4NavigationLevel::G4NavigationLevel(G4VPhysicalVolume* pPhysVol,
const G4AffineTransform& afTransform,
EVolume volTp,
G4int repNo)
{
fLevelRep=new G4NavigationLevelRep( pPhysVol,
afTransform,
@@ -22,12 +23,12 @@ inline G4NavigationLevel::G4NavigationLevel(G4VPhysicalVolume* pPhysVol,
repNo );
}
inline G4NavigationLevel::
G4NavigationLevel(G4VPhysicalVolume* pPhysVol,
const G4AffineTransform& levelAbove,
const G4AffineTransform& relativeCurrent,
EVolume volTp,
G4int repNo)
inline
G4NavigationLevel::G4NavigationLevel(G4VPhysicalVolume* pPhysVol,
const G4AffineTransform& levelAbove,
const G4AffineTransform& relativeCurrent,
EVolume volTp,
G4int repNo)
{
fLevelRep=new G4NavigationLevelRep( pPhysVol,
levelAbove,
@@ -36,25 +37,31 @@ inline G4NavigationLevel::
repNo );
}
inline G4NavigationLevel::G4NavigationLevel()
inline
G4NavigationLevel::G4NavigationLevel()
{
fLevelRep= new G4NavigationLevelRep();
}
inline G4NavigationLevel::G4NavigationLevel(const G4NavigationLevel& right)
: fLevelRep( right.fLevelRep )
inline
G4NavigationLevel::G4NavigationLevel(const G4NavigationLevel& right)
: fLevelRep( right.fLevelRep )
{
fLevelRep->AddAReference();
}
inline G4NavigationLevel::~G4NavigationLevel()
inline
G4NavigationLevel::~G4NavigationLevel()
{
if( fLevelRep->RemoveAReference() ) delete fLevelRep;
}
inline G4NavigationLevel&
inline
G4NavigationLevel&
G4NavigationLevel::operator=(const G4NavigationLevel &right)
{
if (&right == this) return *this;
// The order of these two lines is needed to handle "a=a"
right.fLevelRep->AddAReference();
if( fLevelRep->RemoveAReference() ) delete fLevelRep;
@@ -63,34 +70,40 @@ G4NavigationLevel::operator=(const G4NavigationLevel &right)
return *this;
}
inline G4VPhysicalVolume* G4NavigationLevel::GetPhysicalVolume() const
inline
G4VPhysicalVolume* G4NavigationLevel::GetPhysicalVolume() const
{
return fLevelRep->GetPhysicalVolume();
}
#if 0
inline G4AffineTransform& G4NavigationLevel::GetTransform()
inline
G4AffineTransform& G4NavigationLevel::GetTransform()
{
return fLevelRep->GetTransform() ;
}
#endif
inline const G4AffineTransform& G4NavigationLevel::GetTransform() const
inline
const G4AffineTransform& G4NavigationLevel::GetTransform() const
{
return fLevelRep->GetTransform() ;
}
inline const G4AffineTransform* G4NavigationLevel::GetPtrTransform() const
inline
const G4AffineTransform* G4NavigationLevel::GetPtrTransform() const
{
return fLevelRep->GetTransformPtr() ;
}
inline EVolume G4NavigationLevel::GetVolumeType() const
inline
EVolume G4NavigationLevel::GetVolumeType() const
{
return fLevelRep->GetVolumeType() ;
}
inline G4int G4NavigationLevel::GetReplicaNo() const
inline
G4int G4NavigationLevel::GetReplicaNo() const
{
return fLevelRep->GetReplicaNo() ;
}
@@ -100,7 +113,8 @@ extern G4Allocator<G4NavigationLevel> aNavigationLevelAllocator;
// I believe that there is no provision in case this class is subclassed.
// If it is subclassed, this will fail and may not give errors!
//
inline void* G4NavigationLevel::operator new(size_t)
inline
void* G4NavigationLevel::operator new(size_t)
{
// void *aNavigationLevel;
// aNavigationLevel= (void *) aNavigationLevelAllocator.MallocSingle();
@@ -110,12 +124,14 @@ inline void* G4NavigationLevel::operator new(size_t)
// Added for use by STL. F.Behner (used for pre-allocation)
//
inline void* G4NavigationLevel::operator new(size_t,void *a)
inline
void* G4NavigationLevel::operator new(size_t,void *a)
{
return a;
}
inline void G4NavigationLevel::operator delete(void *aLevel)
inline
void G4NavigationLevel::operator delete(void *aLevel)
{
aNavigationLevelAllocator.FreeSingle((G4NavigationLevel *) aLevel);
}
@@ -123,15 +139,9 @@ inline void G4NavigationLevel::operator delete(void *aLevel)
// Added for use by STL. J. Apostolakis (used for free-ing pre-allocated?)
#ifndef G4NOT_ISO_DELETES
inline void G4NavigationLevel::operator delete(void *ptr, void *p)
inline
void G4NavigationLevel::operator delete(void *ptr, void *p)
{
;
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NavigationLevelRep.hh,v 1.4 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4NavigationLevelRep.hh,v 1.5 2000/11/01 16:51:07 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// class G4NavigationLevelRep
//
@@ -58,16 +58,16 @@ class G4NavigationLevelRep
G4NavigationLevelRep& operator=(const G4NavigationLevelRep &right);
G4VPhysicalVolume* GetPhysicalVolume() const;
inline G4VPhysicalVolume* GetPhysicalVolume();
const G4AffineTransform* GetTransformPtr() const ; // New
const G4AffineTransform& GetTransform() const ; // Old
// G4AffineTransform& GetTransform(); // Only temporarily
EVolume GetVolumeType() const ;
G4int GetReplicaNo() const ;
inline const G4AffineTransform* GetTransformPtr() const ; // New
inline const G4AffineTransform& GetTransform() const ; // Old
void AddAReference();
G4bool RemoveAReference();
inline EVolume GetVolumeType() const ;
inline G4int GetReplicaNo() const ;
inline void AddAReference();
inline G4bool RemoveAReference();
// Take care of the reference counts.
inline void *operator new(size_t);
@@ -77,6 +77,7 @@ class G4NavigationLevelRep
public: // without description
// G4AffineTransform& GetTransform();
// const G4AffineTransform* GetPtrTransform() const;
// G4AffineTransform& accessTransform();
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NavigationLevelRep.icc,v 1.2 1999/12/15 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4NavigationLevelRep.icc,v 1.4 2000/11/20 18:59:39 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// 1 October 1997 J.Apostolakis Initial version.
//
@@ -14,29 +14,31 @@
// Constructors
//--------------
inline G4NavigationLevelRep::G4NavigationLevelRep(G4VPhysicalVolume* pPhysVol,
inline
G4NavigationLevelRep::G4NavigationLevelRep(G4VPhysicalVolume* pPhysVol,
const G4AffineTransform& afTransform,
EVolume volTp,
G4int repNo)
: sPhysicalVolumePtr(pPhysVol),
sTransform(afTransform),
sVolumeType(volTp),
: sTransform(afTransform),
sPhysicalVolumePtr(pPhysVol),
sReplicaNo(repNo),
sVolumeType(volTp),
fCountRef(1)
{
}
inline G4NavigationLevelRep::G4NavigationLevelRep()
: sPhysicalVolumePtr(0),
sTransform(),
sVolumeType(kReplica),
inline
G4NavigationLevelRep::G4NavigationLevelRep()
: sTransform(),
sPhysicalVolumePtr(0),
sReplicaNo(-1),
sVolumeType(kReplica),
fCountRef(1)
{
}
inline G4NavigationLevelRep::
G4NavigationLevelRep( G4VPhysicalVolume* pPhysVol,
inline
G4NavigationLevelRep::G4NavigationLevelRep(G4VPhysicalVolume* pPhysVol,
const G4AffineTransform& levelAbove,
const G4AffineTransform& relativeCurrent,
EVolume volTp,
@@ -49,7 +51,8 @@ inline G4NavigationLevelRep::
sTransform.InverseProduct( levelAbove, relativeCurrent );
}
inline G4NavigationLevelRep::G4NavigationLevelRep(G4NavigationLevelRep& right)
inline
G4NavigationLevelRep::G4NavigationLevelRep(G4NavigationLevelRep& right)
: sTransform(right.sTransform),
sPhysicalVolumePtr(right.sPhysicalVolumePtr),
sReplicaNo(right.sReplicaNo),
@@ -61,7 +64,8 @@ inline G4NavigationLevelRep::G4NavigationLevelRep(G4NavigationLevelRep& right)
// Destructor
//--------------
inline G4NavigationLevelRep::~G4NavigationLevelRep()
inline
G4NavigationLevelRep::~G4NavigationLevelRep()
{
#ifdef DEBUG_NAVIG_LEVEL
if(fCountRef>0){
@@ -73,52 +77,73 @@ inline G4NavigationLevelRep::~G4NavigationLevelRep()
// Operators
// --------------
inline G4NavigationLevelRep&
inline
G4NavigationLevelRep&
G4NavigationLevelRep::operator=(const G4NavigationLevelRep &right)
{
sTransform= right.sTransform;
sPhysicalVolumePtr=right.sPhysicalVolumePtr;
sVolumeType= right.sVolumeType;
sReplicaNo= right.sReplicaNo;
if (&right == this) return *this;
if (&right)
{
sTransform = right.sTransform;
sPhysicalVolumePtr = right.sPhysicalVolumePtr;
sVolumeType = right.sVolumeType;
sReplicaNo = right.sReplicaNo;
fCountRef = right.fCountRef;
}
return *this;
}
inline G4VPhysicalVolume* G4NavigationLevelRep::GetPhysicalVolume() const
inline
G4VPhysicalVolume*
G4NavigationLevelRep::GetPhysicalVolume()
{
return sPhysicalVolumePtr;
return sPhysicalVolumePtr;
}
inline const G4AffineTransform& G4NavigationLevelRep::GetTransform() const
inline
const G4AffineTransform&
G4NavigationLevelRep::GetTransform() const
{
return sTransform;
}
#if 0
inline G4AffineTransform& G4NavigationLevelRep::GetTransform()
inline
G4AffineTransform& G4NavigationLevelRep::GetTransform()
{
return sTransform;
}
#endif
inline const G4AffineTransform* G4NavigationLevelRep::GetTransformPtr() const
inline
const G4AffineTransform*
G4NavigationLevelRep::GetTransformPtr() const
{
return &sTransform;
}
inline EVolume G4NavigationLevelRep::GetVolumeType() const
inline
EVolume G4NavigationLevelRep::GetVolumeType() const
{
return sVolumeType;
}
inline G4int G4NavigationLevelRep::GetReplicaNo() const
inline
G4int G4NavigationLevelRep::GetReplicaNo() const
{
return sReplicaNo;
}
inline void G4NavigationLevelRep::AddAReference()
inline
void G4NavigationLevelRep::AddAReference()
{
fCountRef++;
}
inline G4bool G4NavigationLevelRep::RemoveAReference()
inline
G4bool G4NavigationLevelRep::RemoveAReference()
{
return( --fCountRef <= 0);
}
@@ -129,12 +154,14 @@ extern G4Allocator<G4NavigationLevelRep> aNavigLevelRepAllocator;
// If it is subclassed & new data members are added then the
// following "new" & "delete" will fail and give errors.
//
inline void* G4NavigationLevelRep::operator new(size_t)
inline
void* G4NavigationLevelRep::operator new(size_t)
{
return (void *) aNavigLevelRepAllocator.MallocSingle();
}
inline void G4NavigationLevelRep::operator delete(void *aLevelRep)
inline
void G4NavigationLevelRep::operator delete(void *aLevelRep)
{
aNavigLevelRepAllocator.FreeSingle((G4NavigationLevelRep *) aLevelRep);
}
+15 -15
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Navigator.hh,v 1.5 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4Navigator.hh,v 1.6 2000/11/01 16:51:07 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4Navigator
@@ -152,7 +152,7 @@ class G4Navigator
// same volume as the previous position. Usually this can be guaranteed
// only if the point is within safety.
void LocateGlobalPointAndUpdateTouchable(
inline void LocateGlobalPointAndUpdateTouchable(
const G4ThreeVector& position,
const G4ThreeVector& direction,
G4VTouchable* touchableToUpdate,
@@ -161,14 +161,14 @@ class G4Navigator
// LocateGlobalPointAndSetup(). Then use the volume found and its
// navigation history to update the touchable.
void LocateGlobalPointAndUpdateTouchable(
inline void LocateGlobalPointAndUpdateTouchable(
const G4ThreeVector& position,
G4VTouchable* touchableToUpdate,
const G4bool RelativeSearch =true);
// Old version (missing direction).
// Not recommended replace with newer version above.
void SetGeometricallyLimitedStep();
inline void SetGeometricallyLimitedStep();
// Inform the navigator that the previous Step calculated
// by the geometry was taken in its entirety.
@@ -181,16 +181,16 @@ class G4Navigator
// The proposed maximum length is used to avoid volume safety
// calculations. The geometry must be closed.
G4ThreeVector GetCurrentLocalCoordinate() const;
inline G4ThreeVector GetCurrentLocalCoordinate() const;
// Return the local coordinate of the point in the reference system
// of its containing volume that was found by LocalGlobalPointAndSetup.
// The local coordinate of the last located track.
G4ThreeVector ComputeLocalPoint(const G4ThreeVector& rGlobPoint) const;
inline G4ThreeVector ComputeLocalPoint(const G4ThreeVector& rGlobPoint) const;
// Return position vector in local coordinate system, given a position
// vector in world coordinate system.
G4ThreeVector ComputeLocalAxis(const G4ThreeVector& pVec) const;
inline G4ThreeVector ComputeLocalAxis(const G4ThreeVector& pVec) const;
// Return the local direction of the specified vector in the reference
// system of the volume that was found by LocalGlobalPointAndSetup.
// The Local Coordinates of point in world coordinate system.
@@ -199,7 +199,7 @@ class G4Navigator
G4RotationMatrix NetRotation() const;
// Compute+return the local->global translation/rotation of current volume.
G4VPhysicalVolume* GetWorldVolume() const;
inline G4VPhysicalVolume* GetWorldVolume() const;
// Return the current world (`topmost') volume.
void SetWorldVolume(G4VPhysicalVolume* pWorld);
@@ -211,14 +211,14 @@ class G4Navigator
G4TouchableHistory* CreateTouchableHistory() const;
// `Touchable' creation methods: caller has deletion responsibility.
G4bool IsExitNormalValid();
inline G4bool IsExitNormalValid();
// Return true if the Navigator
// i) found that it is exiting the previous volume and is not
// entering a daughter volume.
// ii) has obtained the normal for the previous volume (in local
// coordinates).
G4ThreeVector GetLocalExitNormal();
inline G4ThreeVector GetLocalExitNormal();
// Can be called (i.e. can return a valid result) only if the Navigator
// replied true to IsExitNormalValid().
// It returns the ExitNormal of the previous volume.
@@ -256,22 +256,22 @@ class G4Navigator
// Print the internal state of the Navigator (for debugging).
// The level of detail is according to the verbosity.
const G4AffineTransform& GetGlobalToLocalTransform() const;
inline const G4AffineTransform& GetGlobalToLocalTransform() const;
const G4AffineTransform GetLocalToGlobalTransform() const;
// Obtain the transformations Global/Local (and inverse).
// Clients of these methods must copy the data if they need to keep it.
protected: // with description
void ResetStackAndState();
inline void ResetStackAndState();
// Reset stack and minimum or navigator state machine necessary for reset
// as needed by LocalGlobalPointAndSetup.
// [Does not perform clears, resizes, or reset fLastLocatedPointLocal]
EVolume VolumeType(const G4VPhysicalVolume *pVol) const;
inline EVolume VolumeType(const G4VPhysicalVolume *pVol) const;
// Characterise `type' of volume - normal/replicated/parameterised.
EVolume CharacteriseDaughters(const G4LogicalVolume *pLog) const;
inline EVolume CharacteriseDaughters(const G4LogicalVolume *pLog) const;
// Characterise daughter of logical volume.
void SetupHierarchy();
+44 -23
View File
@@ -5,46 +5,59 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Navigator.icc,v 1.2 1999/12/15 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4Navigator.icc,v 1.3 2000/11/01 16:51:07 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4Navigator Inline implementation
// Return the local coordinate of the current track
inline G4ThreeVector G4Navigator::GetCurrentLocalCoordinate() const
//
inline
G4ThreeVector G4Navigator::GetCurrentLocalCoordinate() const
{
return fLastLocatedPointLocal;
}
// Return local direction of vector direction in world coord system
inline G4ThreeVector G4Navigator::ComputeLocalAxis(const G4ThreeVector& pVec) const
//
inline
G4ThreeVector G4Navigator::ComputeLocalAxis(const G4ThreeVector& pVec) const
{
return (fHistory.GetTopTransform().IsRotated()) ? fHistory.GetTopTransform().TransformAxis(pVec) : pVec ;
return (fHistory.GetTopTransform().IsRotated())
? fHistory.GetTopTransform().TransformAxis(pVec) : pVec ;
}
// Return local coordinates of a point in the world coord system
inline G4ThreeVector G4Navigator::ComputeLocalPoint(const G4ThreeVector& pGlobalPoint) const
//
inline
G4ThreeVector G4Navigator::ComputeLocalPoint(const G4ThreeVector& pGlobalPoint) const
{
return ( fHistory.GetTopTransform().TransformPoint(pGlobalPoint) ) ;
}
// Return the current world (`topmost') volume
inline G4VPhysicalVolume* G4Navigator::GetWorldVolume() const
//
inline
G4VPhysicalVolume* G4Navigator::GetWorldVolume() const
{
return fTopPhysical;
}
// Inform the navigator that the previous Step calculated
// by the geometry was taken in its entirety
inline void G4Navigator::SetGeometricallyLimitedStep()
//
inline
void G4Navigator::SetGeometricallyLimitedStep()
{
fWasLimitedByGeometry=true;
}
// Reset stack and minimum of navigator state `machine'
inline void G4Navigator::ResetStackAndState()
//
inline
void G4Navigator::ResetStackAndState()
{
fHistory.Reset();
@@ -57,7 +70,8 @@ inline void G4Navigator::ResetStackAndState()
fBlockedReplicaNo=-1;
}
inline EVolume G4Navigator::VolumeType(const G4VPhysicalVolume *pVol) const
inline
EVolume G4Navigator::VolumeType(const G4VPhysicalVolume *pVol) const
{
EVolume type;
EAxis axis;
@@ -76,7 +90,8 @@ inline EVolume G4Navigator::VolumeType(const G4VPhysicalVolume *pVol) const
return type;
}
inline EVolume G4Navigator::CharacteriseDaughters(const G4LogicalVolume *pLog) const
inline
EVolume G4Navigator::CharacteriseDaughters(const G4LogicalVolume *pLog) const
{
EVolume type;
EAxis axis;
@@ -108,28 +123,34 @@ inline EVolume G4Navigator::CharacteriseDaughters(const G4LogicalVolume *pLog) c
// JA April 30th, 1997
//
// Is the Surface Normal valid?
inline G4bool G4Navigator::IsExitNormalValid()
//
inline
G4bool G4Navigator::IsExitNormalValid()
{
return fExiting && fValidExitNormal;
}
// Obtain the Normal vector to a surface (in local coordinates)
// ( It is valid only if Navigator replied true to above function)
inline G4ThreeVector G4Navigator::GetLocalExitNormal()
// Obtain the Normal vector to a surface (in local coordinates)
// (It is valid only if Navigator replied true to above function)
//
inline
G4ThreeVector G4Navigator::GetLocalExitNormal()
{
return fExitNormal;
}
// Return local to global transformation
// ie transformation that will take point or axis in world coord system
// and return one in the local coord system
inline const G4AffineTransform& G4Navigator::GetGlobalToLocalTransform() const
// Return local to global transformation.
// I.e. transformation that will take point or axis in world coord system
// and return one in the local coord system
//
inline
const G4AffineTransform& G4Navigator::GetGlobalToLocalTransform() const
{
return fHistory.GetTopTransform();
}
inline void G4Navigator::LocateGlobalPointAndUpdateTouchable(
inline
void G4Navigator::LocateGlobalPointAndUpdateTouchable(
const G4ThreeVector& position,
G4VTouchable* touchableToUpdate,
const G4bool RelativeSearch )
@@ -139,7 +160,8 @@ inline void G4Navigator::LocateGlobalPointAndUpdateTouchable(
touchableToUpdate->UpdateYourself( pPhysVol, &fHistory );
}
inline void G4Navigator::LocateGlobalPointAndUpdateTouchable(
inline
void G4Navigator::LocateGlobalPointAndUpdateTouchable(
const G4ThreeVector& position,
const G4ThreeVector& direction,
G4VTouchable* touchableToUpdate,
@@ -149,4 +171,3 @@ inline void G4Navigator::LocateGlobalPointAndUpdateTouchable(
pPhysVol= LocateGlobalPointAndSetup( position, &direction, RelativeSearch);
touchableToUpdate->UpdateYourself( pPhysVol, &fHistory );
}
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4NormalNavigation.hh,v 1.3 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4NormalNavigation
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NormalNavigation.icc,v 1.2 1999/12/15 14:50:23 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4NormalNavigation.icc,v 1.3 2000/11/20 18:59:40 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// G4NormalNavigation Inline Implementation
@@ -39,8 +39,6 @@ inline G4bool G4NormalNavigation::LevelLocate(G4NavigationHistory &history,
samplePhysical=targetLogical->GetDaughter(sampleNo);
if (samplePhysical!=blockedVol)
{
EInside sampleInside;
// Setup volume with mother ptr
samplePhysical->Setup(targetPhysical);
history.NewLevel(samplePhysical, kNormal, samplePhysical->GetCopyNo());
@@ -62,7 +60,8 @@ inline G4bool G4NormalNavigation::LevelLocate(G4NavigationHistory &history,
history.BackLevel();
}
#else
sampleInside= sampleSolid->Inside(samplePoint);
EInside sampleInside = sampleSolid->Inside(samplePoint);
if( sampleInside == kOutside)
{
history.BackLevel();
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ParameterisedNavigation.hh,v 1.3 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4ParameterisedNavigation
@@ -5,15 +5,15 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParameterisedNavigation.icc,v 1.2 1999/12/15 14:50:23 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ParameterisedNavigation.icc,v 1.3 2000/11/20 18:59:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4ParameterisedNavigation Inline implementation
inline G4ParameterisedNavigation::G4ParameterisedNavigation() :
fVoxelNode(0),fVoxelHeader(0)
inline G4ParameterisedNavigation::G4ParameterisedNavigation()
: fVoxelHeader(0), fVoxelNode(0)
{
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PropagatorInField.hh,v 1.8 2000/05/16 17:39:00 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4PropagatorInField.hh,v 1.10 2000/11/01 16:51:07 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4PropagatorInField
@@ -68,47 +68,48 @@ class G4PropagatorInField
G4VPhysicalVolume *pPhysVol=0 );
// Compute the next geometric Step
G4ThreeVector EndPosition();
G4ThreeVector EndMomentumDir();
G4bool IsParticleLooping();
inline G4ThreeVector EndPosition() const;
inline G4ThreeVector EndMomentumDir() const;
inline G4bool IsParticleLooping() const;
// Return the state after the Step
G4double DeltaIntersection();
inline G4double DeltaIntersection() const;
// The accuracy of finding an intersection
G4double DeltaOneStep();
// The accuracy of a single Step
G4double GetEpsilonStep(); // Relative accuracy for current Step (Calc.)
void SetEpsilonStep(G4double newEps);
inline G4double GetEpsilonStep() const;
// Relative accuracy for current Step (Calc.)
inline void SetEpsilonStep(G4double newEps);
// The ratio DeltaOneStep()/h_current_step
void SetChargeMomentumMass( G4double Charge, // in e+ units
G4double Momentum, // in Geant4 units
G4double pMass);
inline void SetChargeMomentumMass(G4double Charge, // in e+ units
G4double Momentum, // in Geant4 units
G4double pMass);
G4ChordFinder* GetChordFinder();
inline G4ChordFinder* GetChordFinder();
// void SetChordFinder(G4ChordFinder* newCF); // Not yet relevant
G4int SetVerboseLevel( G4int Verbose );
G4int Verbose();
inline G4int SetVerboseLevel( G4int Verbose );
inline G4int Verbose() const;
G4double GetDeltaIntersection();
inline G4double GetDeltaIntersection() const;
// Accuracy for boundary intersection.
G4double GetDeltaOneStep();
inline G4double GetDeltaOneStep() const;
// Accuracy for one tracking/physics step.
void SetAccuraciesWithDeltaOneStep(G4double deltaOneStep);
inline void SetAccuraciesWithDeltaOneStep(G4double deltaOneStep);
// Sets both accuracies, maintaining a particular ratio
// for accuracties of volume Intersection and Integration (in One Step)
// for accuracties of volume Intersection and Integration (in One Step)
void SetDeltaOneStep(G4double deltaOneStep);
inline void SetDeltaOneStep(G4double deltaOneStep);
// Set accuracy for integration of one step. (only)
void SetDeltaIntersection(G4double deltaIntersection);
inline void SetDeltaIntersection(G4double deltaIntersection);
// Set accuracy of intersection of a volume. (only)
G4int GetMaxLoopCount();
void SetMaxLoopCount(G4int new_max);
inline G4int GetMaxLoopCount() const;
inline void SetMaxLoopCount(G4int new_max);
// A maximum for the number of steps that a (looping) particle can take.
void printStatus(
@@ -120,7 +121,7 @@ class G4PropagatorInField
G4VPhysicalVolume* startVolume);
// Print Method - useful mostly for debugging.
G4FieldTrack GetEndState();
inline G4FieldTrack GetEndState() const;
public: // without description
@@ -5,15 +5,15 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PropagatorInField.icc,v 1.8 2000/05/16 17:39:25 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4PropagatorInField.icc,v 1.13 2000/11/20 19:02:34 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// ------------------------------------------------------------------------
// GEANT 4 include file implementation
//
// For information related to this code contact:
// CERN, IT Division (formely CN), ASD group
// GEANT4 Collaboration
// ------------------------------------------------------------------------
//
// 25.10.96 John Apostolakis, design and implementation
@@ -25,17 +25,17 @@
// and ?? also must know the value of the maximum displacement allowed
//
inline G4PropagatorInField::
G4PropagatorInField( G4Navigator *theNavigator,
G4FieldManager *detectorFieldMgr) :
inline
G4PropagatorInField::G4PropagatorInField(G4Navigator *theNavigator,
G4FieldManager *detectorFieldMgr)
: fDetectorFieldMgr(detectorFieldMgr),
fNavigator(theNavigator),
fDetectorFieldMgr(detectorFieldMgr),
fmax_loop_count(10000),
End_PointAndTangent(G4ThreeVector(0.,0.,0.),
G4ThreeVector(0.,0.,0.),0.0,0.0),
fVerboseLevel(0),
fDelta_One_Step_Value(fDefault_Delta_One_Step_Value),
fDelta_Intersection_Val(fDefault_Delta_Intersection_Val),
fVerboseLevel(0)
fmax_loop_count(10000)
{
// this->fChordFinder = new G4ChordFinder( (G4MagneticField*)0, 1e-6 );
@@ -54,7 +54,8 @@ G4ChordFinder* G4PropagatorInField::GetChordFinder()
return fDetectorFieldMgr->GetChordFinder();
}
inline void G4PropagatorInField::SetChargeMomentumMass(
inline
void G4PropagatorInField::SetChargeMomentumMass(
G4double Charge, // in e+ units
G4double Momentum, // in GeV/c
G4double Mass) // in ? units
@@ -65,61 +66,75 @@ inline void G4PropagatorInField::SetChargeMomentumMass(
// Obtain the final space-point and velocity (normal) at the end of the Step
//
inline
G4ThreeVector G4PropagatorInField::EndPosition()
G4ThreeVector G4PropagatorInField::EndPosition() const
{
return End_PointAndTangent.Position();
}
inline
G4ThreeVector G4PropagatorInField::EndMomentumDir()
G4ThreeVector G4PropagatorInField::EndMomentumDir() const
{
return End_PointAndTangent.GetMomentumDir();
}
inline G4double G4PropagatorInField::GetEpsilonStep()
inline
G4double G4PropagatorInField::GetEpsilonStep() const
{
return fEpsilonStep;
}
inline void G4PropagatorInField::SetEpsilonStep(G4double newEps)
inline
void G4PropagatorInField::SetEpsilonStep(G4double newEps)
{
fEpsilonStep=newEps;
}
inline G4bool G4PropagatorInField::IsParticleLooping()
inline
G4bool G4PropagatorInField::IsParticleLooping() const
{
return fParticleIsLooping;
}
inline G4int G4PropagatorInField::GetMaxLoopCount()
inline
G4int G4PropagatorInField::GetMaxLoopCount() const
{
return fmax_loop_count;
}
inline void G4PropagatorInField::SetMaxLoopCount(G4int new_max)
inline
void G4PropagatorInField::SetMaxLoopCount(G4int new_max)
{
fmax_loop_count= new_max;
}
// inline void G4PropagatorInField::SetChordFinder(G4ChordFinder* newCF)
inline
G4double G4PropagatorInField::GetDeltaIntersection() const
{
return fDelta_Intersection_Val;
}
inline
G4double G4PropagatorInField::GetDeltaOneStep() const
{
return fDelta_One_Step_Value;
}
inline G4double G4PropagatorInField::GetDeltaIntersection()
{ return fDelta_Intersection_Val; }
inline G4double G4PropagatorInField:: GetDeltaOneStep()
{ return fDelta_One_Step_Value; }
// void SetDeltaIntersection(G4double);
inline void G4PropagatorInField::SetAccuraciesWithDeltaOneStep(G4double valDeltaOneStep)
inline
void
G4PropagatorInField::SetAccuraciesWithDeltaOneStep(G4double valDeltaOneStep)
{
fDelta_One_Step_Value= valDeltaOneStep;
fDelta_Intersection_Val = 0.4 * fDelta_One_Step_Value;
}
inline void G4PropagatorInField::SetDeltaOneStep(G4double valDeltaOneStep)
inline
void G4PropagatorInField::SetDeltaOneStep(G4double valDeltaOneStep)
{
fDelta_One_Step_Value= valDeltaOneStep;
}
inline void G4PropagatorInField::SetDeltaIntersection(G4double valDeltaIntersection)
inline
void G4PropagatorInField::SetDeltaIntersection(G4double valDeltaIntersection)
{
fDelta_Intersection_Val = valDeltaIntersection;
}
@@ -131,13 +146,13 @@ G4int G4PropagatorInField::SetVerboseLevel( G4int Verbose )
}
inline
G4int G4PropagatorInField::Verbose()
G4int G4PropagatorInField::Verbose() const
{
return fVerboseLevel;
}
inline
G4FieldTrack G4PropagatorInField::GetEndState()
G4FieldTrack G4PropagatorInField::GetEndState() const
{
return End_PointAndTangent;
}
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ReplicaNavigation.hh,v 1.3 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4ReplicaNavigation
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ReplicaNavigation.icc,v 1.2 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ReplicaNavigation.icc,v 1.3 2000/11/20 18:59:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4ReplicaNavigation Inline implementation
@@ -16,7 +16,8 @@ inline G4int G4ReplicaNavigation::VoxelLocate(const G4SmartVoxelHeader *pHead,
const G4int blocked) const
{
EAxis targetHeaderAxis;
G4double coord,targetHeaderMin;
G4double coord=0.;
G4double targetHeaderMin;
G4double targetHeaderNodeWidth,targetNodePos;
G4int targetHeaderNoSlices,targetNodeNo;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TouchableHistory.hh,v 1.3 2000/04/25 16:15:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4TouchableHistory.hh,v 1.4 2000/11/01 16:51:07 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4TouchableHistory
@@ -33,31 +33,32 @@ class G4TouchableHistory : public G4VTouchable
public: // with description
G4TouchableHistory(const G4NavigationHistory &history);
G4TouchableHistory(const G4NavigationHistory& history);
G4TouchableHistory();
// The default constructor produces a touchable-history of
// 'zero-depth', ie an "unphysical" and not very unusable one.
// It is for initialisation only.
~G4TouchableHistory();
G4VPhysicalVolume* GetVolume(G4int depth=0) const;
G4VSolid* GetSolid(G4int depth=0) const;
virtual ~G4TouchableHistory();
inline G4VPhysicalVolume* GetVolume(G4int depth=0) const;
inline G4VSolid* GetSolid(G4int depth=0) const;
const G4ThreeVector& GetTranslation(G4int depth=0) const;
const G4RotationMatrix* GetRotation(G4int depth=0) const;
const G4RotationMatrix* GetRotation(G4int depth=0) const;
G4int GetReplicaNumber(G4int depth=0) const;
G4int GetHistoryDepth() const;
inline G4int GetReplicaNumber(G4int depth=0) const;
inline G4int GetHistoryDepth() const;
G4int MoveUpHistory( G4int num_levels = 1 );
// Access methods for touchables with history
virtual void UpdateYourself(G4VPhysicalVolume* pPhysVol,
const G4NavigationHistory* history=NULL);
const G4NavigationHistory* history=0);
// Update methods for touchables with history
public: // without description
const G4NavigationHistory* GetHistory() const;
// Should this method be "depricated" ?
inline const G4NavigationHistory* GetHistory() const;
// Should this method be "deprecated" ?
// it is used now in G4Navigator::LocateGlobalPointAndSetup
// void ResetLevel();
@@ -65,7 +66,7 @@ class G4TouchableHistory : public G4VTouchable
private:
G4int CalculateHistoryIndex(G4int stackDepth) const;
inline G4int CalculateHistoryIndex(G4int stackDepth) const;
G4RotationMatrix frot;
G4ThreeVector ftlate;
@@ -5,20 +5,20 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TouchableHistory.icc,v 1.3 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4TouchableHistory.icc,v 1.5 2000/11/20 18:59:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4TouchableHistory inline implementation
inline G4TouchableHistory::G4TouchableHistory()
: fhistory()
inline
G4TouchableHistory::G4TouchableHistory()
: frot(G4RotationMatrix()), ftlate(G4ThreeVector(0.,0.,0.)), fhistory()
{
ftlate= G4ThreeVector(0.,0.,0.);
frot= G4RotationMatrix();
}
inline G4TouchableHistory::G4TouchableHistory(const G4NavigationHistory &history)
inline
G4TouchableHistory::G4TouchableHistory(const G4NavigationHistory &history)
: fhistory(history)
{
G4AffineTransform tf(fhistory.GetTopTransform().Inverse());
@@ -26,9 +26,9 @@ inline G4TouchableHistory::G4TouchableHistory(const G4NavigationHistory &history
frot=tf.NetRotation();
}
inline
void G4TouchableHistory::UpdateYourself( G4VPhysicalVolume* pPhysVol,
const G4NavigationHistory* pHistory)
inline
void G4TouchableHistory::UpdateYourself(G4VPhysicalVolume* pPhysVol,
const G4NavigationHistory* pHistory)
{
fhistory= *pHistory;
G4AffineTransform tf(fhistory.GetTopTransform().Inverse());
@@ -42,38 +42,44 @@ void G4TouchableHistory::UpdateYourself( G4VPhysicalVolume* pPhysVol,
frot=tf.NetRotation();
}
G4int
inline G4TouchableHistory::CalculateHistoryIndex(G4int stackDepth) const
inline
G4int G4TouchableHistory::CalculateHistoryIndex(G4int stackDepth) const
{
return (fhistory.GetDepth()-stackDepth); // was -1
}
inline G4VPhysicalVolume* G4TouchableHistory::GetVolume(G4int depth) const
inline
G4VPhysicalVolume* G4TouchableHistory::GetVolume(G4int depth) const
{
return fhistory.GetVolume(CalculateHistoryIndex(depth));
}
inline G4VSolid* G4TouchableHistory::GetSolid(G4int depth) const
inline
G4VSolid* G4TouchableHistory::GetSolid(G4int depth) const
{
return fhistory.GetVolume(CalculateHistoryIndex(depth))->GetLogicalVolume()->GetSolid();
return fhistory.GetVolume(CalculateHistoryIndex(depth))
->GetLogicalVolume()->GetSolid();
}
inline G4int G4TouchableHistory::GetReplicaNumber(G4int depth) const
inline
G4int G4TouchableHistory::GetReplicaNumber(G4int depth) const
{
// return this->GetHistory()->GetTopReplicaNo();
return fhistory.GetReplicaNo(CalculateHistoryIndex(depth));
}
inline G4int G4TouchableHistory::GetHistoryDepth() const
inline
G4int G4TouchableHistory::GetHistoryDepth() const
{
return fhistory.GetDepth();
}
inline G4int G4TouchableHistory::MoveUpHistory( G4int num_levels )
inline
G4int G4TouchableHistory::MoveUpHistory( G4int num_levels )
{
G4NavigationHistory* nHistory= &fhistory;
G4int maxLevelsMove= nHistory->GetDepth();
G4int minLevelsMove= 0; // Cannot redescend today!
G4int minLevelsMove= 0; // Cannot redescend today!
// Soon it will be possible
// by adding a data member here
// fCurrentDepth;
@@ -90,7 +96,8 @@ inline G4int G4TouchableHistory::MoveUpHistory( G4int num_levels )
return num_levels;
}
inline const G4NavigationHistory* G4TouchableHistory::GetHistory() const
inline
const G4NavigationHistory* G4TouchableHistory::GetHistory() const
{
return &fhistory;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TransportationManager.hh,v 1.4 2000/04/25 16:15:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4TransportationManager.hh,v 1.5 2000/11/01 16:51:07 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// class G4TransportationManager
//
@@ -37,13 +37,13 @@ class G4TransportationManager
static G4TransportationManager* GetTransportationManager();
G4Navigator* GetNavigatorForTracking();
G4PropagatorInField* GetPropagatorInField();
G4FieldManager* GetFieldManager();
inline G4Navigator* GetNavigatorForTracking() const;
inline G4PropagatorInField* GetPropagatorInField() const;
inline G4FieldManager* GetFieldManager() const;
void SetNavigatorForTracking( G4Navigator* newNavigator);
void SetPropagatorInField( G4PropagatorInField* newFieldPropagator);
void SetFieldManager( G4FieldManager* newFieldManager);
inline void SetNavigatorForTracking( G4Navigator* newNavigator);
inline void SetPropagatorInField( G4PropagatorInField* newFieldPropagator);
inline void SetFieldManager( G4FieldManager* newFieldManager);
~G4TransportationManager();
@@ -5,50 +5,49 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TransportationManager.icc,v 1.3 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// $Id: G4TransportationManager.icc,v 1.4 2000/11/01 16:51:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// ------------------------------------------------------------
// GEANT 4 inlined function members implementation
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ------------------------------------------------------------
//
// Created: 10 March 1997, J. Apostolakis
//
inline G4Navigator* G4TransportationManager::GetNavigatorForTracking()
inline
G4Navigator* G4TransportationManager::GetNavigatorForTracking() const
{
return fNavigatorForTracking;
}
inline G4PropagatorInField* G4TransportationManager::GetPropagatorInField()
inline
G4PropagatorInField* G4TransportationManager::GetPropagatorInField() const
{
return fPropagatorInField;
}
inline G4FieldManager* G4TransportationManager::GetFieldManager()
inline
G4FieldManager* G4TransportationManager::GetFieldManager() const
{
return fFieldManager;
}
inline void G4TransportationManager::SetNavigatorForTracking(
G4Navigator* newNavigator)
inline
void G4TransportationManager::SetNavigatorForTracking(G4Navigator* newNavigator)
{
fNavigatorForTracking= newNavigator;
// fPropagatorInField->setNavigator(newNavigator);
}
inline void G4TransportationManager::SetPropagatorInField(
inline
void G4TransportationManager::SetPropagatorInField(
G4PropagatorInField* newFieldPropagator )
{
fPropagatorInField= newFieldPropagator;
}
inline void G4TransportationManager::SetFieldManager(
G4FieldManager* newFieldManager)
inline
void G4TransportationManager::SetFieldManager(G4FieldManager* newFieldManager)
{
fFieldManager= newFieldManager;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VoxelNavigation.hh,v 1.6 2000/04/25 16:15:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4VoxelNavigation.hh,v 1.7 2000/11/01 16:51:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4VoxelNavigation
@@ -22,7 +22,7 @@
#ifndef G4VOXELNAVIGATION_HH
#define G4VOXELNAVIGATION_HH
#include "globals.hh"
#include "geomdefs.hh"
#include "G4NavigationHistory.hh"
#include "G4AffineTransform.hh"
#include "G4VPhysicalVolume.hh"
@@ -39,9 +39,6 @@
#include "g4rw/tvvector.h"
#include "g4rw/tpvector.h"
// Voxel stack depth maximum [no resizing]
const G4int kNavigatorVoxelStackMax = 3;
class G4VoxelNavigation
{
public: // with description
@@ -5,24 +5,28 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VoxelNavigation.icc,v 1.2 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4VoxelNavigation.icc,v 1.4 2000/11/20 18:59:44 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4VoxelNavigation Inline implementation
inline G4VoxelNavigation::G4VoxelNavigation() :
inline
G4VoxelNavigation::G4VoxelNavigation()
: fVoxelDepth(-1),
fVoxelAxisStack(kNavigatorVoxelStackMax),
fVoxelNoSlicesStack(kNavigatorVoxelStackMax),
fVoxelSliceWidthStack(kNavigatorVoxelStackMax),
fVoxelNodeNoStack(kNavigatorVoxelStackMax),
fVoxelHeaderStack(kNavigatorVoxelStackMax),
fVoxelDepth(-1),fVoxelNode(0)
fVoxelNode(0)
{
}
inline G4SmartVoxelNode* G4VoxelNavigation::VoxelLocate(G4SmartVoxelHeader *pHead,
const G4ThreeVector &localPoint)
inline
G4SmartVoxelNode*
G4VoxelNavigation::VoxelLocate(G4SmartVoxelHeader *pHead,
const G4ThreeVector &localPoint)
{
G4SmartVoxelHeader *targetVoxelHeader=pHead;
G4SmartVoxelNode *targetVoxelNode=0;
@@ -32,12 +36,15 @@ inline G4SmartVoxelNode* G4VoxelNavigation::VoxelLocate(G4SmartVoxelHeader *pHea
G4int targetHeaderNoSlices,targetNodeNo;
fVoxelDepth=0;
do {
while (!targetVoxelNode)
{
targetHeaderAxis=targetVoxelHeader->GetAxis();
targetHeaderNoSlices=targetVoxelHeader->GetNoSlices();
targetHeaderMin=targetVoxelHeader->GetMinExtent();
targetHeaderNodeWidth=(targetVoxelHeader->GetMaxExtent()-targetHeaderMin)/targetHeaderNoSlices;
targetNodeNo=G4int ((localPoint(targetHeaderAxis)-targetHeaderMin)/targetHeaderNodeWidth);
targetHeaderNodeWidth= (targetVoxelHeader->GetMaxExtent()
-targetHeaderMin)/targetHeaderNoSlices;
targetNodeNo=G4int((localPoint(targetHeaderAxis)
-targetHeaderMin)/targetHeaderNodeWidth);
// Rounding protection
if (targetNodeNo<0)
{
@@ -64,12 +71,13 @@ inline G4SmartVoxelNode* G4VoxelNavigation::VoxelLocate(G4SmartVoxelHeader *pHea
targetVoxelHeader=sampleProxy->GetHeader();
fVoxelDepth++;
}
} while (!targetVoxelNode);
}
fVoxelNode=targetVoxelNode;
return targetVoxelNode;
}
inline G4bool G4VoxelNavigation::LevelLocate(G4NavigationHistory& history,
inline
G4bool G4VoxelNavigation::LevelLocate(G4NavigationHistory& history,
const G4VPhysicalVolume *blockedVol,
const G4int,
const G4ThreeVector &globalPoint,
@@ -107,7 +115,7 @@ inline G4bool G4VoxelNavigation::LevelLocate(G4NavigationHistory& history,
{
// Setup volume with mother ptr
samplePhysical->Setup(targetPhysical);
history.NewLevel(samplePhysical, kNormal, samplePhysical->GetCopyNo());
history.NewLevel(samplePhysical,kNormal,samplePhysical->GetCopyNo());
sampleSolid=samplePhysical->GetLogicalVolume()->GetSolid();
samplePoint=history.GetTopTransform().TransformPoint(globalPoint);
@@ -129,4 +137,3 @@ inline G4bool G4VoxelNavigation::LevelLocate(G4NavigationHistory& history,
}
return false;
}