Import Geant4 2.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:42:07 +02:00
parent 103bda00c8
commit e7d7193284
3106 changed files with 171117 additions and 90550 deletions
@@ -5,12 +5,19 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4AuxiliaryNavServices.hh,v 1.2 1999/12/15 14:50:21 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4AuxiliaryNavServices.hh,v 1.3 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4NormalNavigation: Utility for navigation in volumes
// containing only G4PVPlacement daughter volumes. Paul Kent Aug 96
// class G4NormalNavigation
//
// Class description:
//
// Utility for navigation in volumes containing only G4PVPlacement
// daughter volumes.
// History:
// - Created: Paul Kent, Aug 96
#ifndef G4AuxiliaryNavServices_hh
#define G4AuxiliaryNavServices_hh
@@ -23,22 +30,26 @@
class G4AuxiliaryNavServices
{
public:
public: // with description
static G4bool CheckPointOnSurface( const G4VSolid* sampleSolid,
const G4ThreeVector& localPoint,
const G4ThreeVector* globalDirection,
const G4AffineTransform& sampleTransform,
const G4bool locatedOnEdge);
//
// Is the track (Point, direction) inside the solid sampleSolid ?
// Returns true if we are going to enter the volume,
// which is the case if:
// - The point is inside
// - The point is on the surface and the direction points inside or along it.
// Else returns false
//
// Is the track (Point, direction) inside the solid sampleSolid ?
// Returns true if we are going to enter the volume, which is the case if:
// - The point is inside
// - The point is on the surface and the direction points inside
// or along it.
// Else returns false
private:
G4bool testOne();
};
#include "G4AuxiliaryNavServices.icc"
@@ -5,59 +5,23 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4BlockingList.hh,v 1.3 1999/12/15 14:50:21 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4BlockingList.hh,v 1.4 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// class G4BlockingList
//
// Class description:
//
// A utility class responsible for (efficiently) maintaining a List
// of blocked volume numbers, with rapid `reset' operations.
//
// Member functions:
//
// G4BlockingList(G4int maxDefault=511,G4int stride=512)
//
// Create empty blocking List of default size and `stride' resize
// count.
//
// ~G4BlockingList()
//
// Reset()
//
// Efficiently `Reset' the blocking List, so that no volumes
// are blocked
// [Advance tag no and only fully clear List if tag max reached]
//
// FullyReset()
//
// Clear the blocking List and reset tag value [slow]
//
// Enlarge(G4int nv)
//
// Enlarges blocking List is current size < nv, in units of stride
// Clears the new part of the List
//
// G4int Length()
//
// Returns the current length of the List. Note a length of 16
// means volumes of indices between 0 & 15 inclusive may be blocked
//
// void BlockVolume(G4int v)
//
// Block the volume number v. Requires: 0<=v<Length()
//
// G4bool IsBlocked(G4int v)
//
// Return true if the volume number v is blocked, else false
// Requires: 0<=v<Length()
//
// Notes:
//
// Implemented via a ValVector of ints: a tag value is used to set
// the indices of blocked volumes. On reset the current tag value is
// increases, so that the ValVector must only be zeroed when the
// increased, so that the ValVector must only be zeroed when the
// numerical range of the tag is used.
//
// History:
//
// 24.7.96 P.Kent Separated from G4Navigator
@@ -75,24 +39,48 @@ const G4int kBlockTagNoMax = 2147483647; // 2^31-1 maximum tag no may reach
class G4BlockingList
{
public:
G4BlockingList(G4int maxDefault=kBlockingListMaxDefault,
G4int stride=kBlockingListStride);
~G4BlockingList();
void Reset();
void FullyReset();
void Enlarge(const G4int nv);
G4int Length() const;
void BlockVolume(const G4int v);
G4bool IsBlocked(const G4int v) const;
public: // with description
G4BlockingList(G4int maxDefault=kBlockingListMaxDefault,
G4int stride=kBlockingListStride);
// Create empty blocking List of default size and `stride' resize count.
~G4BlockingList();
// Destructor. No operations.
void Reset();
// Efficiently `Reset' the blocking List, so that no volumes
// are blocked [Advance tag number and only fully clear List
// if tag max reached]
void FullyReset();
// Clear the blocking List and reset tag value [slow].
void Enlarge(const G4int nv);
// Enlarges blocking List if current size < nv, in units of stride.
// Clears the new part of the List.
G4int Length() const;
// Returns the current length of the List. Note a length of 16
// means volumes of indices between 0 & 15 inclusive may be blocked.
void BlockVolume(const G4int v);
// Block the volume number v.
// Requires: 0<=v<Length().
G4bool IsBlocked(const G4int v) const;
// Return true if the volume number v is blocked, else false.
// Requires: 0<=v<Length().
private:
G4int fBlockTagNo, fStride;
// Current blocked volume tag number.
G4RWTValVector<G4int> fBlockingList;
// Blocked volumes: Elements with indices
// corresponding to blocked volume set to fBlockTagNo.
private:
// Current blocked volume tag no.
G4int fBlockTagNo,fStride;
// Blocked volumes: Elements with indices
// corresponding to blocked volume set to fBlockTagNo
G4RWTValVector<G4int> fBlockingList;
};
#include "G4BlockingList.icc"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4BlockingList.icc,v 1.2 1999/12/15 14:50:21 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4BlockingList Inlined Implementation
+28 -22
View File
@@ -5,47 +5,53 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GRSSolid.hh,v 1.2 1999/12/15 14:50:21 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4GRSSolid.hh,v 1.3 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4GRSSolid Paul Kent August 1996
// class G4GRSSolid
//
// Object representing a touchable solid - maintains
// association between a solid and its net resultant
// local->global transform
// Class description:
//
// Object representing a touchable solid - maintains the association
// between a solid and its net resultant local->global transform.
//
// NOTE: The (optional) rotation matrix is copied
// History:
// - Created. Paul Kent, August 1996
#ifndef G4GRSSOLID_HH
#define G4GRSSOLID_HH
#include "G4VTouchable.hh"
#include "G4VPhysicalVolume.hh"
// #include "G4LogicalVolume.hh"
#include "G4RotationMatrix.hh"
class G4GRSSolid : public G4VTouchable
{
public:
G4GRSSolid(G4VSolid *pSolid,
const G4RotationMatrix *pRot,
const G4ThreeVector &tlate);
G4GRSSolid(G4VSolid *pSolid,
const G4RotationMatrix &rot,
const G4ThreeVector &tlate);
~G4GRSSolid();
G4VSolid* GetSolid(G4int depth=0) const;
const G4ThreeVector& GetTranslation(G4int depth=0) const;
const G4RotationMatrix* GetRotation(G4int depth=0) const;
public: // with description
G4GRSSolid(G4VSolid *pSolid,
const G4RotationMatrix *pRot,
const G4ThreeVector &tlate);
G4GRSSolid(G4VSolid *pSolid,
const G4RotationMatrix &rot,
const G4ThreeVector &tlate);
~G4GRSSolid();
G4VSolid* GetSolid(G4int depth=0) const;
const G4ThreeVector& GetTranslation(G4int depth=0) const;
const G4RotationMatrix* GetRotation(G4int depth=0) const;
private:
private:
G4VSolid *fsolid;
G4RotationMatrix *frot;
G4ThreeVector ftlate;
G4VSolid *fsolid;
G4RotationMatrix *frot;
G4ThreeVector ftlate;
};
#include "G4GRSSolid.icc"
#endif
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GRSSolid.icc,v 1.2 1999/12/15 14:50:21 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4GRSSolid inline implementation
+28 -20
View File
@@ -5,18 +5,23 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GRSVolume.hh,v 1.2 1999/12/15 14:50:21 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4GRSVolume.hh,v 1.3 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4GRSVolume Paul Kent August 1996
// class G4GRSVolume
//
// Class description:
//
// Object representing a touchable detector element - maintains
// associations between a physical volume and its net resultant
// local->global transform
// local->global transform.
//
// NOTE: The (optional) rotation matrix is copied
// History:
// - Created. Paul Kent, August 1996
#ifndef G4GRSVOLUME_HH
#define G4GRSVOLUME_HH
@@ -28,25 +33,28 @@
class G4GRSVolume : public G4VTouchable
{
public:
G4GRSVolume(G4VPhysicalVolume *pVol,
const G4RotationMatrix *pRot,
const G4ThreeVector &tlate);
G4GRSVolume(G4VPhysicalVolume *pVol,
const G4RotationMatrix &rot,
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;
public: // with description
G4GRSVolume(G4VPhysicalVolume *pVol,
const G4RotationMatrix *pRot,
const G4ThreeVector &tlate);
G4GRSVolume(G4VPhysicalVolume *pVol,
const G4RotationMatrix &rot,
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;
private:
private:
G4VPhysicalVolume *fvol;
G4RotationMatrix *frot;
G4ThreeVector ftlate;
G4VPhysicalVolume *fvol;
G4RotationMatrix *frot;
G4ThreeVector ftlate;
};
#include "G4GRSVolume.icc"
#endif
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GRSVolume.icc,v 1.3 1999/12/15 14:50:21 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4GRSVolume inline implementation
@@ -5,23 +5,25 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LogicalBorderSurface.hh,v 1.3 1999/12/15 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4LogicalBorderSurface.hh,v 1.4 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
////////////////////////////////////////////////////////////////////////
// G4LogicalBorderSurface Definition
// class G4LogicalBorderSurface
////////////////////////////////////////////////////////////////////////
//
// File: G4LogicalBorderSurface.hh
// Description: A Logical Surface class for surfaces defined by the
// boundary of two physical volumes.
// Version: 1.0
// Class description:
//
// A Logical Surface class for surfaces defined by the boundary
// of two physical volumes.
// History:
// -------
// Created: 1997-06-17
// Author: John Apostolakis
// mail: John.Apostolakis@cern.ch
// Modified: 1997-06-16 John Apostolakis
//
// Id tag:
////////////////////////////////////////////////////////////////////////
#ifndef G4LogicalBorderSurface_h
@@ -50,7 +52,7 @@ class G4LogicalBorderSurface: public G4LogicalSurface
////////////////////////////////
// Constructors and Destructor
////////////////////////////////
public:
public:
G4LogicalBorderSurface(const G4String& name,
G4VPhysicalVolume* vol1,
@@ -62,44 +64,38 @@ public:
////////////
// Methods
////////////
public:
// public methods
public:
static G4LogicalBorderSurface* GetSurface(const G4VPhysicalVolume* vol1,
const G4VPhysicalVolume* vol2);
const G4VPhysicalVolume* vol2);
void SetPhysicalVolumes(G4VPhysicalVolume* vol1,
G4VPhysicalVolume* vol2)
{ Volume1 = vol1; Volume2 = vol2; }
G4VPhysicalVolume* vol2);
G4VPhysicalVolume* GetVolume1() const {return Volume1;}
G4VPhysicalVolume* GetVolume2() const {return Volume2;}
G4VPhysicalVolume* GetVolume1() const;
G4VPhysicalVolume* GetVolume2() const;
// These are potentially dangerous.
void SetVolume1(G4VPhysicalVolume* vol1)
{Volume1 = vol1;}
void SetVolume1(G4VPhysicalVolume* vol1);
void SetVolume2(G4VPhysicalVolume* vol2);
// These are potentially dangerous.
void SetVolume2(G4VPhysicalVolume* vol2)
{Volume2 = vol2;}
// Methods dealing with the table of surfaces.
//
static const G4RWTPtrOrderedVector<G4LogicalBorderSurface>* GetSurfaceTable()
{ return &theBorderSurfaceTable; }
static size_t GetNumberOfBorderSurfaces()
{ return theBorderSurfaceTable.length(); }
static const G4RWTPtrOrderedVector<G4LogicalBorderSurface>* GetSurfaceTable();
static size_t GetNumberOfBorderSurfaces();
static void DumpInfo();
// Methods dealing with the table of surfaces.
size_t GetIndex() const { return theIndexInTable; }
size_t GetIndex() const;
//////////////
// Operators
//////////////
public:
G4int operator==(const G4LogicalBorderSurface &right) const;
G4int operator!=(const G4LogicalBorderSurface &right) const;
private:
private:
G4LogicalBorderSurface(const G4LogicalBorderSurface &right);
const G4LogicalBorderSurface & operator=(const G4LogicalBorderSurface &right);
@@ -107,15 +103,16 @@ private:
// Basic data members ( To define a 'logical' surface)
// ------------------
private:
private:
G4VPhysicalVolume* Volume1; // Physical Volume pointer on side 1
G4VPhysicalVolume* Volume2; // Physical Volume pointer on side 2
// The static Table of Surfaces
static G4RWTPtrOrderedVector<G4LogicalBorderSurface> theBorderSurfaceTable;
// The static Table of Surfaces
size_t theIndexInTable; // Index of surface in the surface table
size_t theIndexInTable;
// Index of surface in the surface table
};
typedef G4RWTPtrOrderedVector<G4LogicalBorderSurface> G4LogicalBorderSurfaceTable;
@@ -124,4 +121,6 @@ typedef G4RWTPtrOrderedVector<G4LogicalBorderSurface> G4LogicalBorderSurfaceTabl
// Inline methods
////////////////////
#include "G4LogicalBorderSurface.icc"
#endif /* G4LogicalBorderSurface_h */
@@ -0,0 +1,50 @@
// 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: G4LogicalBorderSurface.icc,v 1.1 2000/04/25 16:15:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4LogicalBorderSurface inline implementation
inline
void G4LogicalBorderSurface::SetPhysicalVolumes(G4VPhysicalVolume* vol1,
G4VPhysicalVolume* vol2)
{
Volume1 = vol1;
Volume2 = vol2;
}
inline
G4VPhysicalVolume* G4LogicalBorderSurface::GetVolume1() const
{
return Volume1;
}
inline
G4VPhysicalVolume* G4LogicalBorderSurface::GetVolume2() const
{
return Volume2;
}
inline
void G4LogicalBorderSurface::SetVolume1(G4VPhysicalVolume* vol1)
{
Volume1 = vol1;
}
inline
void G4LogicalBorderSurface::SetVolume2(G4VPhysicalVolume* vol2)
{
Volume2 = vol2;
}
inline
size_t G4LogicalBorderSurface::GetIndex() const
{
return theIndexInTable;
}
@@ -5,23 +5,25 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LogicalSkinSurface.hh,v 1.3 1999/12/15 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4LogicalSkinSurface.hh,v 1.4 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
////////////////////////////////////////////////////////////////////////
// G4LogicalSkinSurface Definition
// class G4LogicalSkinSurface
////////////////////////////////////////////////////////////////////////
//
// File: G4LogicalSkinSurface.hh
// Description: A Logical Surface class for the surface
// surrounding a single logical volume.
// Version: 1.0
// Class description:
//
// A Logical Surface class for the surface surrounding a single logical
// volume.
// History:
// -------
// Created: 1997-06-16
// Author: John Apostolakis
// mail: John.Apostolakis@cern.ch
// Modified: 1997-06-16 John Apostolakis
//
// Id tag:
////////////////////////////////////////////////////////////////////////
#ifndef G4LogicalSkinSurface_h
@@ -46,7 +48,7 @@
class G4LogicalSkinSurface : public G4LogicalSurface
{
public:
public:
////////////////////////////////
// Constructors and Destructor
@@ -62,53 +64,47 @@ public:
////////////
// Methods
////////////
public:
// public methods
public:
static G4LogicalSkinSurface* GetSurface(const G4LogicalVolume* vol);
G4LogicalVolume* GetLogicalVolume() const {return LogVolume;};
void SetLogicalVolume(G4LogicalVolume* vol)
{LogVolume = vol;};
G4LogicalVolume* GetLogicalVolume() const;
void SetLogicalVolume(G4LogicalVolume* vol);
// Methods dealing with the table of surfaces.
//
static size_t GetNumberOfSkinSurfaces()
{ return theSurfaceTable.length(); };
static size_t GetNumberOfSkinSurfaces();
static void DumpInfo(); // const
// Methods dealing with the table of surfaces.
#if THESE_ARE_NEEDED
// static const G4RWTPtrOrderedVector<G4LogicalSkinSurface>*
// GetSurfaceTable()
// { return &theSurfaceTable; };
size_t GetIndex() const { return theIndexInTable; };
size_t GetIndex() const;
#endif
//////////////
// Operators
//////////////
public:
G4int operator==(const G4LogicalSkinSurface &right) const;
G4int operator!=(const G4LogicalSkinSurface &right) const;
private:
// Assignment and copying must be denied.
G4LogicalSkinSurface(const G4LogicalSkinSurface &right);
const G4LogicalSkinSurface & operator=(const G4LogicalSkinSurface &right);
// Assignment and copying must be denied.
// ------------------
// Basic data members ( To define a 'logical' surface)
// ------------------
private:
G4LogicalVolume* LogVolume; // Logical Volume pointer on side 1
G4LogicalVolume* LogVolume;
// Logical Volume pointer on side 1
// The static Table of Surfaces
static G4RWTPtrOrderedVector<G4LogicalSkinSurface> theSurfaceTable;
// static G4LogicalSkinSurfaceTable theSurfaceTable;
// The static Table of Surfaces
size_t theIndexInTable; // Index of surface in the surface table
size_t theIndexInTable;
// Index of surface in the surface table
};
@@ -118,4 +114,6 @@ typedef G4RWTPtrOrderedVector<G4LogicalSkinSurface> G4LogicalSkinSurfaceTable;
// Inline methods
////////////////////
#include "G4LogicalSkinSurface.icc"
#endif /* G4LogicalSkinSurface_h */
@@ -0,0 +1,32 @@
// 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: G4LogicalSkinSurface.icc,v 1.1 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4LogicalSkinSurface inline implementation
inline
G4LogicalVolume* G4LogicalSkinSurface::GetLogicalVolume() const
{
return LogVolume;
}
inline
void G4LogicalSkinSurface::SetLogicalVolume(G4LogicalVolume* vol)
{
LogVolume = vol;
}
#if THESE_ARE_NEEDED
inline
size_t G4LogicalSkinSurface::GetIndex() const
{
return theIndexInTable;
}
#endif
@@ -5,15 +5,17 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NavigationHistory.hh,v 1.4 1999/12/15 16:40:10 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4NavigationHistory.hh,v 1.5 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// class G4NavigationHistory
//
// Responsible for maintenance of the history of the path taken through
// the geometrical hierarchy. Principally a utility class for use by
// G4Navigator.
// Class description:
//
// Responsible for maintenance of the history of the path taken through
// the geometrical hierarchy. Principally a utility class for use by the
// G4Navigator.
// History:
//
// 25.07.96 P.Kent Initial version. Services derived from
@@ -38,7 +40,8 @@ const G4int kHistoryStride=16; // History increase stride
class G4NavigationHistory
{
public:
public: // with description
friend G4std::ostream& operator << (G4std::ostream &os,const G4NavigationHistory &h);
G4NavigationHistory();
@@ -73,11 +76,11 @@ public:
G4NavigationHistory& operator=(const G4NavigationHistory &h);
private:
private:
void EnlargeHistory();
// Depth of stack: effectively depth in geometrical tree
G4int fStackDepth;
// Depth of stack: effectively depth in geometrical tree
G4RWTValVector<G4NavigationLevel> fNavHistory;
// G4RWTPtrVector<G4NavigationLevel> fNavHistory;
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4NavigationHistory.icc,v 1.2 1999/12/15 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4NavigationHistory Inline implementation
@@ -5,14 +5,16 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NavigationLevel.hh,v 1.10 1999/12/15 16:40:10 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4NavigationLevel.hh,v 1.11 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// class G4NavigationLevel
//
// Maintains one level of the geometrical hierarchy. A utility class for use
// by G4NavigationHistory.
// Class description:
//
// Maintains one level of the geometrical hierarchy.
// A utility class for use by G4NavigationHistory.
// History:
//
// 30.09.97 J.Apostolakis Initial version. Services derived from
@@ -33,21 +35,21 @@
class G4NavigationLevel
{
public:
public: // with description
G4NavigationLevel(G4VPhysicalVolume* newPtrPhysVol,
const G4AffineTransform& newT,
EVolume newVolTp,
G4int newRepNo= -1);
// As the previous constructor, but instead of giving Transform, give
// the AffineTransform to the level above and the current level's
// Transform relative to that.
//
G4NavigationLevel(G4VPhysicalVolume* newPtrPhysVol,
const G4AffineTransform& levelAbove,
const G4AffineTransform& relativeCurrent,
EVolume newVolTp,
G4int newRepNo= -1);
// As the previous constructor, but instead of giving Transform, give
// the AffineTransform to the level above and the current level's
// Transform relative to that.
G4NavigationLevel();
G4NavigationLevel( const G4NavigationLevel& );
@@ -63,23 +65,24 @@ class G4NavigationLevel
EVolume GetVolumeType() const ;
G4int GetReplicaNo() const ;
// To try to resolve the possible problem with returning a reference.
const G4AffineTransform* GetPtrTransform() const;
public: // without description
const G4AffineTransform* GetPtrTransform() const;
// To try to resolve the possible problem with returning a reference.
// Override "new" and "delete" to use "G4Allocator".
inline void *operator new(size_t);
inline void operator delete(void *aLevel);
// Override "new" and "delete" to use "G4Allocator".
// Pre-allocated 'new' and 'delete' for use with STL
// - do not (directly) use Allocator F.Behner/J.Apostolakis
inline void *operator new(size_t, void *); // void*);
inline void *operator new(size_t, void *);
#ifndef G4NOT_ISO_DELETES
inline void operator delete(void *ptr, void*); // Not accepted Sun/HP
#endif
// Pre-allocated 'new' and 'delete' for use with STL
// Do not (directly) use Allocator - F.Behner/J.Apostolakis
// Data members:
//
private:
G4NavigationLevelRep* fLevelRep;
};
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4NavigationLevel.icc,v 1.9 1999/12/15 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// 30.09.97 J.Apostolakis Initial version.
//
@@ -5,21 +5,23 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NavigationLevelRep.hh,v 1.3 1999/12/15 16:40:10 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4NavigationLevelRep.hh,v 1.4 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// class G4NavigationLevelRep
//
// A data representation class, used to hold the data for
// a single level of the Navigation history tree.
// Class description:
//
// This is the body of a handle/body pair of classes,
// that implement reference counting for NavigationLevels.
// The corresponding handle class is G4NavigationLevel
// A data representation class, used to hold the data for a single level
// of the Navigation history tree.
//
// This is the body of a handle/body pair of classes, that implement
// reference counting for NavigationLevels.
// The corresponding handle class is G4NavigationLevel
// History:
//
// 1 October 1997, J.Apostolakis: Initial version.
// - 1 October 1997, J.Apostolakis: initial version.
#ifndef G4NAVIGATIONLEVELREP_HH
#define G4NAVIGATIONLEVELREP_HH
@@ -33,21 +35,21 @@
class G4NavigationLevelRep
{
public:
public: // with description
G4NavigationLevelRep(G4VPhysicalVolume* newPtrPhysVol,
const G4AffineTransform& newT,
EVolume newVolTp,
G4int newRepNo= -1);
// As the previous constructor, but instead of giving Transform, give
// the AffineTransform to the level above and the current level's
// Transform relative to that.
//
G4NavigationLevelRep(G4VPhysicalVolume* newPtrPhysVol,
const G4AffineTransform& levelAbove,
const G4AffineTransform& relativeCurrent,
EVolume newVolTp,
G4int newRepNo= -1);
// As the previous constructor, but instead of giving Transform, give
// the AffineTransform to the level above and the current level's
// Transform relative to that.
G4NavigationLevelRep();
G4NavigationLevelRep( G4NavigationLevelRep& );
@@ -64,28 +66,32 @@ class G4NavigationLevelRep
EVolume GetVolumeType() const ;
G4int GetReplicaNo() const ;
void AddAReference();
G4bool RemoveAReference();
// Take care of the reference counts.
inline void *operator new(size_t);
// Override "new" to use "G4Allocator".
inline void operator delete(void *aTrack);
// Override "delete" to use "G4Allocator".
public: // without description
// const G4AffineTransform* GetPtrTransform() const;
// G4AffineTransform& accessTransform();
// Take care of the reference counts.
//
void AddAReference();
G4bool RemoveAReference();
inline void *operator new(size_t);
// Override "new" to use "G4Allocator".
inline void operator delete(void *aTrack);
// Override "delete" to use "G4Allocator".
private:
// Compounded global->local transformation (takes a point in the
// global reference system to the system of the volume at this level)
G4AffineTransform sTransform;
// Physical volume ptrs, for this level's volume
// Compounded global->local transformation (takes a point in the
// global reference system to the system of the volume at this level)
G4VPhysicalVolume* sPhysicalVolumePtr;
// Volume `type'
// Physical volume ptrs, for this level's volume
G4int sReplicaNo;
EVolume sVolumeType;
// Volume `type'
G4int fCountRef;
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4NavigationLevelRep.icc,v 1.2 1999/12/15 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// 1 October 1997 J.Apostolakis Initial version.
//
+187 -229
View File
@@ -5,11 +5,13 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Navigator.hh,v 1.1.10.1.2.2 1999/12/09 13:51:22 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4Navigator.hh,v 1.5 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4Navigator Paul Kent July 95/96
// class G4Navigator
//
// Class description:
//
// A class for use by the tracking management, able to obtain/calculate
// dynamic tracking time information such as the distance to the next volume,
@@ -17,110 +19,9 @@
// reference system. The navigator maintains a transformation history and
// other information to optimise the tracking time performance.
//
// Member functions:
// NOTES:
//
// G4Navigator()
// Constructor. No actions yet.
//
// ~G4Navigator()
// Destructor. No actions yet.
//
// G4double ComputeStep(const G4ThreeVector &globalpoint,
// const G4ThreeVector &direction,
// const G4double pCurrentProposedStepLength,
// G4double &newSafety)
// Calculate the distance to the next boundary intersected
// along the specified NORMALISED vector direction and
// from the specified point in the global coordiante
// system. LocateGlobalPointAndSetup or LocateGlobalPointWithinVolume
// must have been called with the same global point prior to this call.
// The isotropic distance to the nearest boundary is also
// calculated (usually an underestimate). The current
// proposed Step length is used to avoid intersection
// calculations: if it can be determined that the nearest
// boundary is >pCurrentProposedStepLength away, kInfinity
// is returned together with the computed isotropic safety
// distance. Geometry must be closed.
//
// G4double ComputeSafety(const G4ThreeVector &globalpoint,
// const G4double pProposedMaxLength=DBL_MAX )
//
// Calculate the isotropic distance to the nearest boundary from the
// specified point in the global coordinate system.
// The globalpoint utilised must be within the current volume.
// The value returned is usually an underestimate.
// The proposed maximum length is used to avoid volume safety
// calculations. The geometry must be closed.
//
// G4ThreeVector GetCurrentLocalCoordinate() const
// Return the local coordinate of the point in the reference system
// of its containing volume that was found by
// LocalGlobalPointAndSetup.
//
// G4ThreeVector ComputeLocalAxis(const G4ThreeVector& pGVector) const
// Return the local direction of the specified vector in the reference
// system of the volume that was found by LocalGlobalPointAndSetup.
//
// G4VPhysicalVolume* GetWorldVolume() const
// Return the current world (`topmost') volume
//
// G4VPhysicalVolume* LocateGlobalPointAndSetup(const G4ThreeVector& point,
// const G4ThreeVector* direction=0,
// G4bool pRelativeSearch=true)
// Search the geometrical hierarchy for the volumes deepest in the hierarchy
// containing the point in the global coordinate space. Two main cases are:
// i) If pRelativeSearch=false it makes use of no previous/state
// information. Returns the physical volume containing the point,
// with all previous mothers correctly set up.
// ii) If pRelativeSearch is set to true, the search begin is the geometrical
// hierarchy at the location of the last located point, or the endpoint of
// the previous Step if SetGeometricallyLimitedStep() has been called
// immediately before.
// The direction is used (to check if a volume is entered) only if
// the Navigator has determined that it is on an edge shared by two or more
// volumes. (This is state information.)
// The geometry must be closed.
//
//
// void LocateGlobalPointWithinVolume( const G4ThreeVector& position)
// Notify the Navigator that a track has moved to the new Global point
// 'position', that is know to be within the current safety.
// No check is performed to ensure that it is within the volume.
// This method can be called instead of LocateGlobalPointAndSetup ONLY if
// the caller is certain that the new global point (position) is inside the
// same volume as the previous position. Usually this can be guaranteed
// only if the point is within safety.
//
// void
// LocateGlobalPointAndUpdateTouchable( const G4ThreeVector& position,
// const G4ThreeVector& globalDirection,
// G4Touchable* touchableToUpdate,
// const G4bool relativeSearch=true);
// First, search the geometrical hierarchy like the above method
// LocateGlobalPointAndSetup(const G4ThreeVector&, G4bool).
// Then use the volume found and its navigation history to
// update the touchable.
//
// void SetGeometricallyLimitedStep()
// Inform the navigator that the previous Step calculated
// by the geometry was taken in its entirety
//
// void SetWorldVolume(G4VPhysicalVolume* pWorld)
// Set the world (`topmost') volume. This must be
// positioned at (0,0,0) and unrotated.
//
// G4ThreeVector GetLocalExitNormal(G4bool* valid);
// Can be called only if the Navigator's last Step has arrived at
// a geometrical boundary.
// It returns the Normal to the surface pointing out of the volume that
// was left behind and/or into the volume that was entered.
// (The normal is in the coordinate system of the final volume.)
// This function takes full care about how to calculate this normal,
// but if the surfaces are not convex it will return valid=false.
//
// The following methods provide (more detailed) information when a Step has
// The following methods provide detailed information when a Step has
// arrived at a geometrical boundary. They distinguish between the different
// causes that can result in the track leaving its current volume.
//
@@ -143,27 +44,9 @@
// reccomended to compare the G4touchables associated
// to the preStepPoint and postStepPoint to handle this case.
//
// G4bool EnteredDaughterVolume();
// The purpose of this function is to inform the caller if the track is
// entering a daughter volume while exiting from the current volume.
// This method returns
// - True only in case 1) above, that is when
// the Step has caused the track to arrive at a boundary of a daughter.
// - False in cases 2), 3) and 4), ie in all other cases.
// This function is not guaranteed to work if SetGeometricallyLimitedStep()
// was not called when it should have been called.
//
// 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.
//
// G4ThreeVector GetLocalExitNormal();
// Can be called (ie can return a valid result) only if Navigator replied
// true to IsExitNormalValid()
// It returns the ExitNormal of the previous volume
// (The normal is in the coordinate system of the final volume.)
// G4bool EnteredDaughterVolume()
// G4bool IsExitNormalValid()
// G4ThreeVector GetLocalExitNormal()
//
// The expected usefulness of these methods is to allow the caller to
// determine how to compute the surface normal at the volume boundary. The two
@@ -171,21 +54,23 @@
//
// i) the solid associated with the volume of the initial point of the Step.
// This is valid for cases 2 and 3.
// (Note that the initial point is generally the PreStepPoint of a Step).
// or
// (Note that the initial point is generally the PreStepPoint of a Step).
// or
//
// ii) the solid of the final point, ie of the volume after the relocation.
// This is valid for case 1.
// (Note that the final point is generally the PreStepPoint of a Step).
// (Note that the final point is generally the PreStepPoint of a Step).
//
// This way the caller can always get a valid normal, pointing outside
// the solid for which it is computed, that can be used at his own
// discretion.
//
// 18th Dec 1997 John Allison Temporary change -> NON-CONST (8 functions)
// History:
// - Created. Paul Kent, July 95/96
#ifndef G4NAVIGATOR_HH
#define G4NAVIGATOR_HH
#include "geomdefs.hh"
#include "G4ThreeVector.hh"
@@ -211,141 +96,216 @@
class G4Navigator
{
public:
public: // with description
friend G4std::ostream& operator << (G4std::ostream &os, const G4Navigator &n);
// Constructor - initialisers and setup
G4Navigator();
~G4Navigator();
// Constructor - initialisers and setup.
~G4Navigator();
// Destructor. No actions.
// Compute the next geometric Step
G4double ComputeStep(const G4ThreeVector &pGlobalPoint,
const G4ThreeVector &pDirection,
const G4double pCurrentProposedStepLength,
G4double &pNewSafety);
// Locate the point in the hierarchy
// Calculate the distance to the next boundary intersected
// along the specified NORMALISED vector direction and
// from the specified point in the global coordinate
// system. LocateGlobalPointAndSetup or LocateGlobalPointWithinVolume
// must have been called with the same global point prior to this call.
// The isotropic distance to the nearest boundary is also
// calculated (usually an underestimate). The current
// proposed Step length is used to avoid intersection
// calculations: if it can be determined that the nearest
// boundary is >pCurrentProposedStepLength away, kInfinity
// is returned together with the computed isotropic safety
// distance. Geometry must be closed.
G4VPhysicalVolume* LocateGlobalPointAndSetup(const G4ThreeVector &p,
const G4TouchableHistory &h);
G4VPhysicalVolume* LocateGlobalPointAndSetup(const G4ThreeVector& point,
const G4ThreeVector* direction=0,
const G4bool pRelativeSearch=true);
G4VPhysicalVolume* LocateGlobalPointAndSetup(const G4ThreeVector &p,
const G4TouchableHistory &h);
// Search the geometrical hierarchy for the volumes deepest in the hierarchy
// containing the point in the global coordinate space. Two main cases are:
// i) If pRelativeSearch=false it makes use of no previous/state
// information. Returns the physical volume containing the point,
// with all previous mothers correctly set up.
// ii) If pRelativeSearch is set to true, the search begin is the geometrical
// hierarchy at the location of the last located point, or the endpoint of
// the previous Step if SetGeometricallyLimitedStep() has been called
// immediately before.
// The direction is used (to check if a volume is entered) only if
// the Navigator has determined that it is on an edge shared by two or more
// volumes. (This is state information.)
// The geometry must be closed.
void LocateGlobalPointWithinVolume( const G4ThreeVector& position);
// Notify the Navigator that a track has moved to the new Global point
// 'position', that is known to be within the current safety.
// No check is performed to ensure that it is within the volume.
// This method can be called instead of LocateGlobalPointAndSetup ONLY if
// the caller is certain that the new global point (position) is inside the
// same volume as the previous position. Usually this can be guaranteed
// only if the point is within safety.
void LocateGlobalPointAndUpdateTouchable(
void LocateGlobalPointAndUpdateTouchable(
const G4ThreeVector& position,
const G4ThreeVector& direction,
G4VTouchable* touchableToUpdate,
const G4bool RelativeSearch =true);
// First, search the geometrical hierarchy like the above method
// LocateGlobalPointAndSetup(). Then use the volume found and its
// navigation history to update the touchable.
// Old version (missing direction) : not recommended
// replace with new version above.
void LocateGlobalPointAndUpdateTouchable(
void LocateGlobalPointAndUpdateTouchable(
const G4ThreeVector& position,
G4VTouchable* touchableToUpdate,
const G4bool RelativeSearch =true);
// Old version (missing direction).
// Not recommended replace with newer version above.
// Inform the navigator that the previous Step calculated
// by the geometry was taken in its entirety
void SetGeometricallyLimitedStep();
// Inform the navigator that the previous Step calculated
// by the geometry was taken in its entirety.
// Calculate the isotropic distance to the nearest boundary from the
// specified point in the global coordinate system.
G4double ComputeSafety(const G4ThreeVector &globalpoint,
const G4double pProposedMaxLength=DBL_MAX );
G4double ComputeSafety(const G4ThreeVector &globalpoint,
const G4double pProposedMaxLength=DBL_MAX );
// Calculate the isotropic distance to the nearest boundary from the
// specified point in the global coordinate system.
// The globalpoint utilised must be within the current volume.
// The value returned is usually an underestimate.
// The proposed maximum length is used to avoid volume safety
// calculations. The geometry must be closed.
// Return the local coordinate of the last located track
G4ThreeVector GetCurrentLocalCoordinate() const;
// Return position vector in local coordinate system, given a position vector
// in world coord system
G4ThreeVector ComputeLocalPoint(const G4ThreeVector& rGlobPoint) const;
// Return Local Coordinates of point in world coordinate system
//
G4ThreeVector ComputeLocalAxis(const G4ThreeVector& pVec) 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;
// Return position vector in local coordinate system, given a position
// vector in world coordinate system.
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.
// Compute+return the local->global translation/rotation of current volume
G4ThreeVector NetTranslation() const;
G4RotationMatrix NetRotation() const;
// Compute+return the local->global translation/rotation of current volume.
// Return the current world (`topmost') volume
G4VPhysicalVolume* GetWorldVolume() const;
// Return the current world (`topmost') volume.
// Set the world (`topmost') volume. Check at origin and unrotated.
void SetWorldVolume(G4VPhysicalVolume* pWorld);
// Set the world (`topmost') volume. This must be positioned at
// origin (0,0,0) and unrotated.
// `Touchable' creation methods: caller has deletion responsibility
G4GRSVolume* CreateGRSVolume() const;
G4GRSSolid* CreateGRSSolid() const;
G4TouchableHistory* CreateTouchableHistory() const;
// `Touchable' creation methods: caller has deletion responsibility.
// Obtain the Normal vector to a surface (in local coordinates)
G4bool IsExitNormalValid();
G4ThreeVector GetLocalExitNormal(); // Valid only if Navigator replied true
// It is in the coordinate system of the final volume
// 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();
// 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.
// (The normal is in the coordinate system of the final volume.)
// It is in the coordinate system of the final volume.
// More powerful calculation of Exit Surface Normal, returns validity too.
// But it can only be called if the Step has crossed a volume boundary.
G4ThreeVector GetLocalExitNormal(G4bool* valid);
// More powerful calculation of Exit Surface Normal, returns validity too.
// But it can only be called if the Navigator's last Step has crossed a
// volume geometrical boundary.
// It returns the Normal to the surface pointing out of the volume that
// was left behind and/or into the volume that was entered.
// (The normal is in the coordinate system of the final volume.)
// This function takes full care about how to calculate this normal,
// but if the surfaces are not convex it will return valid=false.
//
G4bool EnteredDaughterVolume();
// G4bool ExitedMotherVolume();
G4bool EnteredDaughterVolume();
// The purpose of this function is to inform the caller if the track is
// entering a daughter volume while exiting from the current volume.
// This method returns
// - True only in case 1) above, that is when the Step has caused
// the track to arrive at a boundary of a daughter.
// - False in cases 2), 3) and 4), i.e. in all other cases.
// This function is not guaranteed to work if SetGeometricallyLimitedStep()
// was not called when it should have been called.
// G4bool ExitedMotherVolume();
// Get/Set Verbose(ness) level (if level>0 && G4VERBOSE, printout can occur)
G4int GetVerboseLevel();
void SetVerboseLevel(G4int level);
// Get/Set Verbose(ness) level.
// [if level>0 && G4VERBOSE, printout can occur]
// Print the internal state of the Navigator (for debugging).
// The level of detail is according to the verbosity.
void PrintState();
void PrintState();
// Print the internal state of the Navigator (for debugging).
// The level of detail is according to the verbosity.
// Obtain the transformations Global/Local (and inverse)
// Clients of these methods must copy the data if they need to keep it.
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
protected:
// Reset stack and minimum or navigator state machine necessary for reset
// as needed by LocalGlobalPointAnsSetup
// [Does not perform clears, resizes, or reset fLastLocatedPointLocal]
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]
// Characterise `type' of volume - normal/replicated/parameterised
EVolume VolumeType(const G4VPhysicalVolume *pVol) const;
// Characterise daughter of logical volume
// Characterise `type' of volume - normal/replicated/parameterised.
EVolume CharacteriseDaughters(const G4LogicalVolume *pLog) const;
// Characterise daughter of logical volume.
// Renavigate & reset hierarchy described by current history
// o Reset volumes
// o Recompute transforms and/or solids of replicated/parameterised vols
void SetupHierarchy();
private:
// Renavigate & reset hierarchy described by current history
// o Reset volumes
// o Recompute transforms and/or solids of replicated/parameterised
// volumes.
//
// BEGIN State information
//
private:
//
// BEGIN State information
//
// Position of the last located point relative to its containing volume
G4ThreeVector fLastLocatedPointLocal;
// Set true if last Step was limited by geometry.
G4bool fWasLimitedByGeometry;
G4bool fEntering,fExiting;
// Position of the last located point relative to its containing volume.
// Entering/Exiting volumes blocking/setup
// o If exiting
// volume ptr & replica number (set & used by Locate..())
// used for blocking on redescent of geometry
// o If entering
// volume ptr & replica number (set by ComputeStep(),used by
// Locate..()) of volume for `automatic' entry
G4bool fWasLimitedByGeometry;
// Set true if last Step was limited by geometry.
G4bool fEntering,fExiting;
// Entering/Exiting volumes blocking/setup
// o If exiting
// volume ptr & replica number (set & used by Locate..())
// used for blocking on redescent of geometry
// o If entering
// volume ptr & replica number (set by ComputeStep(),used by
// Locate..()) of volume for `automatic' entry
G4VPhysicalVolume *fBlockedPhysicalVolume;
G4int fBlockedReplicaNo;
G4VPhysicalVolume *fCandidatePhysicalVolume;
G4int fCandidateReplicaNo;
G4bool fEnteredDaughter; // A memory of whether in this Step a daughter
// volume is entered (set in Compute & Locate)
// After Compute: it expects to enter a daughter
@@ -376,32 +336,36 @@ private:
// Used in ComputeStep to ensure that
// origin of current Step is in the same
// volume as the point of the last relocation.
//
// END State information
//
//
// END State information
//
//
// BEGIN Tracking Invariants
//
//
// BEGIN Tracking Invariants
//
// A link to the topmost physical volume in the detector.
// Must be positioned at the origin and unrotated.
G4VPhysicalVolume *fTopPhysical;
//
// END Tracking Invariants
//
// A link to the topmost physical volume in the detector.
// Must be positioned at the origin and unrotated.
//
// BEGIN Utility information
//
G4int fVerbose; // Verbose(ness) level (if > 0, printout can occur)
//
// END Utility Invariants
//
//
// END Tracking Invariants
//
//
// Helpers/Utility classes
//
//
// BEGIN Utility information
//
G4int fVerbose;
// Verbose(ness) level [if > 0, printout can occur].
//
// END Utility Invariants
//
//
// Helpers/Utility classes
//
G4NormalNavigation fnormalNav;
G4VoxelNavigation fvoxelNav;
G4ParameterisedNavigation fparamNav;
@@ -411,9 +375,3 @@ private:
#include "G4Navigator.icc"
#endif
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Navigator.icc,v 1.2 1999/12/15 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4Navigator Inline implementation
@@ -5,12 +5,19 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NormalNavigation.hh,v 1.2 1999/12/15 14:50:23 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4NormalNavigation.hh,v 1.3 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4NormalNavigation: Utility for navigation in volumes
// containing only G4PVPlacement daughter volumes. Paul Kent Aug 96
// class G4NormalNavigation
//
// Class description:
//
// Utility for navigation in volumes containing only G4PVPlacement
// daughter volumes.
// History:
// - Created. Paul Kent, Aug 96
#ifndef G4NORMALNAVIGATION_HH
#define G4NORMALNAVIGATION_HH
@@ -25,37 +32,37 @@
class G4NormalNavigation
{
public:
public: // with description
// Search positioned volumes in mother at current top level of history for
// volume containing globalPoint. Do not test the blocked volume. If a
// containing volume is found, `stack' the new volume and return true,
// else return false (the point lying in the mother but not any of the
// daughters). localPoint = global point in local system on entry,
// point in new system on exit.
G4bool LevelLocate(G4NavigationHistory &history,
const G4VPhysicalVolume *blockedVol,
const G4int blockedNum,
const G4ThreeVector &globalPoint,
const G4ThreeVector* globalDirection,
const G4bool pLocatedOnEdge,
G4ThreeVector &localPoint);
G4bool LevelLocate(G4NavigationHistory &history,
const G4VPhysicalVolume *blockedVol,
const G4int blockedNum,
const G4ThreeVector &globalPoint,
const G4ThreeVector* globalDirection,
const G4bool pLocatedOnEdge,
G4ThreeVector &localPoint);
// Search positioned volumes in mother at current top level of history
// for volume containing globalPoint. Do not test the blocked volume.
// If a containing volume is found, `stack' the new volume and return
// true, else return false (the point lying in the mother but not any
// of the daughters). localPoint = global point in local system on entry,
// point in new system on exit.
G4double ComputeStep(const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection,
const G4double currentProposedStepLength,
G4double &newSafety,
G4NavigationHistory &history,
G4bool &validExitNormal,
G4ThreeVector &exitNormal,
G4bool &exiting,
G4bool &entering,
G4VPhysicalVolume *(*pBlockedPhysical),
G4int &blockedReplicaNo);
G4double ComputeStep(const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection,
const G4double currentProposedStepLength,
G4double &newSafety,
G4NavigationHistory &history,
G4bool &validExitNormal,
G4ThreeVector &exitNormal,
G4bool &exiting,
G4bool &entering,
G4VPhysicalVolume *(*pBlockedPhysical),
G4int &blockedReplicaNo);
G4double ComputeSafety(const G4ThreeVector &globalpoint,
const G4NavigationHistory &history,
const G4double pMaxLength=DBL_MAX );
G4double ComputeSafety(const G4ThreeVector &globalpoint,
const G4NavigationHistory &history,
const G4double pMaxLength=DBL_MAX );
};
#include "G4AuxiliaryNavServices.hh" // Needed for inline methods
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4NormalNavigation.icc,v 1.2 1999/12/15 14:50:23 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// G4NormalNavigation Inline Implementation
@@ -5,14 +5,20 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParameterisedNavigation.hh,v 1.2 1999/12/15 14:50:23 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParameterisedNavigation.hh,v 1.3 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4ParameterisedNavigation: Utility for navigation in volumes
// containing a single G4PVParameterised volume for which voxels for
// the replicated volumes have been constructed.
// [Voxels MUST be along one axis only: NOT refined] Paul Kent Aug 96
// class G4ParameterisedNavigation
//
// Class description:
//
// Utility for navigation in volumes containing a single G4PVParameterised
// volume for which voxels for the replicated volumes have been constructed.
// [Voxels MUST be along one axis only: NOT refined]
// History:
// - Created. Paul Kent, Aug 96
#ifndef G4PARAMETERISEDNAVIGATION_HH
#define G4PARAMETERISEDNAVIGATION_HH
@@ -35,7 +41,8 @@
class G4ParameterisedNavigation
{
public:
public: // with description
G4ParameterisedNavigation();
~G4ParameterisedNavigation();
G4SmartVoxelNode* VoxelLocate(G4SmartVoxelHeader *pHead,
@@ -61,22 +68,24 @@ public:
G4double ComputeSafety(const G4ThreeVector &localPoint,
const G4NavigationHistory &history,
const G4double pProposedMaxLength=DBL_MAX );
private:
private:
G4double ComputeVoxelSafety(const G4ThreeVector &localPoint) const;
G4bool LocateNextVoxel(const G4ThreeVector &localPoint,
const G4ThreeVector& localDirection,
const G4double currentStep);
G4BlockingList fBList; // Blocked volumes
G4BlockingList fBList; // Blocked volumes
//
// BEGIN Voxel Stack information
//
EAxis fVoxelAxis;
G4int fVoxelNoSlices;
G4double fVoxelSliceWidth;
G4int fVoxelNodeNo;
G4SmartVoxelHeader *fVoxelHeader;
G4SmartVoxelNode *fVoxelNode;
EAxis fVoxelAxis;
G4int fVoxelNoSlices;
G4double fVoxelSliceWidth;
G4int fVoxelNodeNo;
G4SmartVoxelHeader *fVoxelHeader;
G4SmartVoxelNode *fVoxelNode;
//
// END Voxel Stack information
//
@@ -88,5 +97,3 @@ private:
#include "G4ParameterisedNavigation.icc"
#endif
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ParameterisedNavigation.icc,v 1.2 1999/12/15 14:50:23 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4ParameterisedNavigation Inline implementation
@@ -5,30 +5,31 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PropagatorInField.hh,v 1.6 1999/12/15 14:50:23 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4PropagatorInField.hh,v 1.8 2000/05/16 17:39:00 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------------------
// GEANT 4 include file implementation
// class G4PropagatorInField
//
// For information related to this code contact:
// CERN, IT Division (formely CN), ASD group
// ------------------------------------------------------------------------
// Class description:
//
// This class performs the navigation/propagation of a particle/track
// in a magnetic field. The field is in general non-uniform.
// For the calculation of the path, it relies on the class G4MagTr.
// This class performs the navigation/propagation of a particle/track
// in a magnetic field. The field is in general non-uniform.
// For the calculation of the path, it relies on the class G4MagTr.
// To create an object, must have an object that calculates the Curved
// paths and also must know the value of the maximum displacement allowed.
//
// class G4PropagatorInField
// Methods:
// Methods:
// ComputeStep(..)
// CalculateStepTimeAndAccuracy(..)
// LocateIntersectionPoint(..)
//
// History:
// -------
// 25.10.96 John Apostolakis, design and implementation
// 25.03.97 John Apostolakis, adaptation for G4Transportation and cleanup
// ------------------------------------------------------------------------
#ifndef G4PropagatorInField_hh
#define G4PropagatorInField_hh 1
@@ -44,12 +45,10 @@
// #include "G4MagIntegratorDriver.hh"
class G4PropagatorInField {
class G4PropagatorInField
{
public:
// To create an object, must have an object that calculates the Curved
// paths and also must know the value of the maximum displacement allowed
//
public: // with description
G4PropagatorInField( G4Navigator *theNavigator,
G4FieldManager *detectorFieldMgr);
@@ -57,8 +56,6 @@ class G4PropagatorInField {
G4PropagatorInField( G4Navigator *theNavigator );
~G4PropagatorInField(){};
// Compute the next geometric Step
//
G4double ComputeStep(G4FieldTrack &pFieldTrack,
G4double pCurrentProposedStepLength,
G4double &pNewSafety,
@@ -69,26 +66,22 @@ class G4PropagatorInField {
G4double pCurrentProposedStepLength,
G4double &pNewSafety,
G4VPhysicalVolume *pPhysVol=0 );
// Current Volume (to check)
// Compute the next geometric Step
// Return the state after the Step
//
G4ThreeVector EndPosition();
G4ThreeVector EndMomentumDir();
G4bool IsParticleLooping();
// Return the state after the Step
// The accuracy of finding an intersection
//
G4double DeltaIntersection();
// The accuracy of finding an intersection
// The accuracy of a single Step
//
G4double DeltaOneStep();
// The accuracy of a single Step
// The ratio DeltaOneStep()/h_current_step
//
G4double GetEpsilonStep(); // Relative accuracy for current Step (Calc.)
void SetEpsilonStep(G4double newEps);
// The ratio DeltaOneStep()/h_current_step
void SetChargeMomentumMass( G4double Charge, // in e+ units
G4double Momentum, // in Geant4 units
@@ -97,23 +90,27 @@ class G4PropagatorInField {
G4ChordFinder* GetChordFinder();
// void SetChordFinder(G4ChordFinder* newCF); // Not yet relevant
G4int SetVerboseLevel( G4int Verbose ){ return fVerboseLevel=Verbose; }
G4int Verbose(){ return fVerboseLevel; }
G4int SetVerboseLevel( G4int Verbose );
G4int Verbose();
// Accuracies:
G4double GetDeltaIntersection(); // for boundary intersection
G4double GetDeltaOneStep(); // for one tracking/physics step
G4double GetDeltaIntersection();
// Accuracy for boundary intersection.
G4double GetDeltaOneStep();
// Accuracy for one tracking/physics step.
// Sets both accuracies,
// maintaining a particular ratio Delta Interaction / OneStep )
void SetAccuraciesWithDeltaOneStep(G4double deltaOneStep);
// Sets both accuracies, maintaining a particular ratio
// for accuracties of volume Intersection and Integration (in One Step)
void SetDeltaOneStep(G4double deltaOneStep);
// Set accuracy for integration of one step. (only)
void SetDeltaIntersection(G4double deltaIntersection);
// Set accuracy of intersection of a volume. (only)
// A maximum for the number of steps that a (looping) particle can take
G4int GetMaxLoopCount();
void SetMaxLoopCount(G4int new_max);
// A maximum for the number of steps that a (looping) particle can take.
// Print Method - useful mostly for debugging this class
//
void printStatus(
const G4FieldTrack& StartFT,
const G4FieldTrack& CurrentFT,
@@ -121,48 +118,51 @@ class G4PropagatorInField {
G4double safety,
G4int Step,
G4VPhysicalVolume* startVolume);
// Print Method - useful mostly for debugging.
G4FieldTrack GetEndState();
public: // without description
// The Field Manager of the Detector
//
// void SetGlobalFieldMgr( G4FieldManager *detectorFieldMgr );
G4FieldTrack GetEndState() { return End_PointAndTangent; }
// The Field Manager of the Detector.
private:
// If such an intersection exists, this function
// calculate the intersection point of the true path of the particle
// with the surface of the current volume (or of one of its daughters).
// (Should use lateral displacement as measure of convergence).
//
G4bool LocateIntersectionPoint(
const G4FieldTrack& CurveStartPointTangent, // A
const G4FieldTrack& CurveEndPointTangent, // B
const G4ThreeVector& TrialPoint, // E
G4FieldTrack& IntersectPointTangent); // Output
// If such an intersection exists, this function
// calculate the intersection point of the true path of the particle
// with the surface of the current volume (or of one of its daughters).
// (Should use lateral displacement as measure of convergence).
// DATA Members
// ----------------------------------------------------------------------
private:
// The Field Manager of the whole Detector
//
G4FieldManager *fDetectorFieldMgr;
// The Field Manager of the whole Detector.
G4Navigator *fNavigator;
// STATE information
// ------------------
G4double fEpsilonStep; // Relative accuracy for current Step (Calc.)
G4double fEpsilonStep;
// Relative accuracy for current Step (Calc.)
// End point storage:
//
G4FieldTrack End_PointAndTangent;
// End point storage
G4bool fParticleIsLooping;
// For debuging purposes
G4int fVerboseLevel;
// For debuging purposes
// Values for the required accuracies
//
@@ -177,16 +177,16 @@ class G4PropagatorInField {
G4int fmax_loop_count;
// Variables to keep track of "abnormal" case - which causes loop
//
G4int fNoZeroStep; // Counter of zeroStep
G4int fThresholdNo_ZeroSteps; // Threshold: above this - action
G4int fThresholdNo_ZeroSteps; // Threshold: above this - action
// G4double fMidPoint_CurveLen_of_LastAttempt= -1;
G4double fFull_CurveLen_of_LastAttempt;
G4double fLast_ProposedStepLength;
}; // End of class G4PropagatorInField {
};
// Defines the constructor.
//
#include "G4PropagatorInField.icc"
#endif
// End of "#ifndef G4PropagatorInField_hh"
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PropagatorInField.icc,v 1.6 1999/12/15 14:50:24 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4PropagatorInField.icc,v 1.8 2000/05/16 17:39:25 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------------------
@@ -113,3 +113,31 @@ inline void G4PropagatorInField::SetAccuraciesWithDeltaOneStep(G4double valDelta
fDelta_One_Step_Value= valDeltaOneStep;
fDelta_Intersection_Val = 0.4 * fDelta_One_Step_Value;
}
inline void G4PropagatorInField::SetDeltaOneStep(G4double valDeltaOneStep)
{
fDelta_One_Step_Value= valDeltaOneStep;
}
inline void G4PropagatorInField::SetDeltaIntersection(G4double valDeltaIntersection)
{
fDelta_Intersection_Val = valDeltaIntersection;
}
inline
G4int G4PropagatorInField::SetVerboseLevel( G4int Verbose )
{
return fVerboseLevel=Verbose;
}
inline
G4int G4PropagatorInField::Verbose()
{
return fVerboseLevel;
}
inline
G4FieldTrack G4PropagatorInField::GetEndState()
{
return End_PointAndTangent;
}
@@ -5,14 +5,20 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ReplicaNavigation.hh,v 1.2 1999/12/15 14:50:24 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ReplicaNavigation.hh,v 1.3 2000/04/25 16:15:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4ReplicaNavigation: Utility for navigation in volumes
// containing a single G4PVParameterised volume for which voxels for
// the replicated volumes have been constructed.
// [Voxels MUST be along one axis only: NOT refined] Paul Kent Aug 96
// class G4ReplicaNavigation
//
// Class description:
//
// Utility for navigation in volumes containing a single G4PVParameterised
// volume for which voxels for the replicated volumes have been constructed.
// [Voxels MUST be along one axis only: NOT refined]
// History:
// - Created. Paul Kent, Aug 96
#ifndef G4REPLICANAVIGATION_HH
#define G4REPLICANAVIGATION_HH
@@ -37,7 +43,8 @@ class G4ReplicaNavigation
{
friend class G4ReplicaNavigationTester;
public:
public: // with description
G4ReplicaNavigation();
G4bool LevelLocate(G4NavigationHistory& history,
const G4VPhysicalVolume *blockedVol,
@@ -89,7 +96,9 @@ public:
const G4int replicaNo,
const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection) const;
private:
private:
G4int VoxelLocate(const G4SmartVoxelHeader *pHead,
const G4ThreeVector &localPoint,
const G4int blocked=-1) const;
@@ -110,5 +119,3 @@ private:
#include "G4ReplicaNavigation.icc"
#endif
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ReplicaNavigation.icc,v 1.2 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4ReplicaNavigation Inline implementation
@@ -5,15 +5,19 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TouchableHistory.hh,v 1.2 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4TouchableHistory.hh,v 1.3 2000/04/25 16:15:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4TouchableHistory Paul Kent August 1996
// class G4TouchableHistory
//
// Object representing a touchable detector element, and
// its history in the geomtrical hierarchy, including
// its net resultant local->global transform
// Class description:
//
// Object representing a touchable detector element, and its history in the
// geomtrical hierarchy, including its net resultant local->global transform.
// History:
// - Created. Paul Kent, August 1996
#ifndef G4TOUCHABLEHISTORY_HH
#define G4TOUCHABLEHISTORY_HH
@@ -26,37 +30,43 @@
class G4TouchableHistory : public G4VTouchable
{
public:
public: // with description
G4TouchableHistory(const G4NavigationHistory &history);
// The default constructor produces a touchable-history of
// 'zero-depth', ie an "unphysical" and not very unusable one.
// It is for initialisation only .
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;
const G4ThreeVector& GetTranslation(G4int depth=0) const;
const G4RotationMatrix* GetRotation(G4int depth=0) const;
// New access methods for touchables with history
G4int GetReplicaNumber(G4int depth=0) const;
G4int GetHistoryDepth() const;
G4int MoveUpHistory( G4int num_levels = 1 );
// void ResetLevel(); // Set the level to the top level.
// Access methods for touchables with history
// Update methods for touchables with history
virtual void UpdateYourself( G4VPhysicalVolume* pPhysVol,
const G4NavigationHistory* history=NULL);
virtual void UpdateYourself(G4VPhysicalVolume* pPhysVol,
const G4NavigationHistory* history=NULL);
// Update methods for touchables with history
public: // without description
// Should this method be "depricated" ?
// it is used now in G4Navigator::LocateGlobalPointAndSetup
//
const G4NavigationHistory* GetHistory() const;
// Should this method be "depricated" ?
// it is used now in G4Navigator::LocateGlobalPointAndSetup
// void ResetLevel();
// Set the level to the top level.
private:
private:
G4int CalculateHistoryIndex(G4int stackDepth) const;
private:
G4RotationMatrix frot;
G4ThreeVector ftlate;
G4NavigationHistory fhistory;
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4TouchableHistory.icc,v 1.3 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4TouchableHistory inline implementation
@@ -1,266 +0,0 @@
// 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: G4Transform.hh,v 1.2 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
// class G4Transform
//
// A coordinate transform, consisting of a translation and a rotation.
// When applying the forwards transformations, rotation is applied first, then
// the translation.
//
//
// Member functions:
//
// G4Transform(G4RotationMatrix* pRot=0)
// Create a translform consisting of a rotation by the specified matrix.
// If NULL (the default) and indentity transform is constructed
// G4Transform(G4RotationMatrix* pRot,const G4ThreeVector& pVec)
// Create a transform consisting of a rotation by the specified matrix, then
// a translation by specified vector. The transform does not copy the
// specified matrix: ownership (hence deletion responsibility) remains with
// the caller.
//
// If the rotation is 0 (NULL ptr), no rotation is performed.
//
// G4ThreeVector& Apply(G4ThreeVector& pVec)
// Apply to the transformation to the specified vector.
// G4ThreeVector& ApplyReverse(G4ThreeVector& pVec)
// Apply to the reverse transformation to the specified vector.
//
// G4ThreeVector Transform(const G4ThreeVector& pVec)
// Compute the transformation of the specified vector.
// G4ThreeVector ReverseTransform(const G4ThreeVector& pVec)
// Compute the reverse transformation to the specified vector.
//
// G4RotationMatrix* GetRotation()
// Return ptr to rotation for the transformation (possibly null if no
// rotation)
// const G4ThreeVector& GetTranslation() const
// Return the translation component of the transformation
// G4Transform& SetTranslation(const G4ThreeVector& pVec)
// Set the translation resulting from the transform.
// Returns a self reference.
//
// [Intended so that simple modifications can be made without creating
// new transforms]
//
// G4Transform& SetRotation(G4RotationMatrix* pRot)
// Set the translation resulting from the transform.
// Returns a self reference.
//
// G4Transform& ComputeCompoundTransform(const G4Transform& t1,
// const G4Transform& t2,G4RotationMatrix* pRot)
// Compute the compound transformation resulting from the transform t1
// followed by the transform t2. The Rotation matrix pRot is modified
// and set to the rotation resulting from the transformation. If no
// rotation results, the rotation ptr of the compounded transform is set
// to NULL. Returns self reference.
//
// If transforms are considered as 4*4 matrices computes t1 . t2
//
// G4Transform& ComputeCompoundReverseTransform(const G4Transform& t1,
// const G4Transform& t2,G4RotationMatrix* pRot)
// Compute the compound transformation resulting from the inverse of
// transform t1 followed by the transform t2. The Rotation matrix pRot
// is modified and set to the rotation resulting from the transformation.
// If no rotation results, the rotation ptr of the compounded transform
// is set to NULL. Returns self reference.
//
// If transforms are considered as 4*4 matrices computes [t1^-1].t2
//
// G4bool IsRotated() const
// Return true if transform involves rotation
//
// G4bool operator == (const G4Transform& t) const
// Define equality as
// 1) equal translations and equal rotation matrix *pointers*
// or
// 2) equal translation and rotation matrices (contents)
//
// Member data:
//
// G4RotationMatrix* frotation
// Pointer to the transmations rotation component
// G4ThreeVector ftranslation
// Translation component
//
// History:
// 16.07.95 P.Kent Added SetTranslation
// 13.07.95 P.Kent Initial version
#ifndef G4TRANSFORM_HH
#define G4TRANSFORM_HH
#include "globals.hh"
#include <assert.h>
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
class G4Transform
{
public:
inline G4Transform( G4RotationMatrix* pRot=0) :
frotation(pRot)
{;}
inline G4Transform( G4RotationMatrix* pRot,
const G4ThreeVector& pVec) :
frotation(pRot),
ftranslation(pVec)
{;}
// inline ~G4Transform() {;}
// Apply to specified vector
inline G4ThreeVector& Apply(G4ThreeVector& pVec) const
{
if (frotation)
{
return pVec=frotation->operator*(pVec)+ftranslation;
}
else
{
return pVec+=ftranslation;
}
}
// Apply reverse transformation to specified vector
inline G4ThreeVector& ApplyReverse(G4ThreeVector& pVec) const
{
if (frotation)
{
return pVec=frotation->inverse()*(pVec-ftranslation);
}
else
{
return pVec-=ftranslation;
}
}
// Compute the transform of the specified vector
inline G4ThreeVector Transform(const G4ThreeVector& pVec) const
{
if (frotation)
{
return frotation->operator*(pVec)+ftranslation;
}
else
{
return pVec+ftranslation;
}
}
// Compute the transform of the specified vector
inline G4ThreeVector ReverseTransform(const G4ThreeVector& pVec) const
{
if (frotation)
{
return frotation->inverse()*(pVec-ftranslation);
}
else
{
return pVec-ftranslation;
}
}
inline G4ThreeVector ComputeLocalAxis(const G4ThreeVector& pVec) const
{
if (!frotation)
{
return pVec;
}
else
{
return (*frotation)*pVec; // UNTESTED
}
}
inline G4RotationMatrix* GetRotation() const
{
return frotation;
}
inline const G4ThreeVector& GetTranslation() const
{
return ftranslation;
}
inline void SetTranslation(const G4ThreeVector& pVec)
{
ftranslation=pVec;
}
inline void SetRotation(G4RotationMatrix* pRot)
{
frotation=pRot;
}
inline G4Transform& ComputeCompoundTransform(const G4Transform& t1,
const G4Transform& t2,
G4RotationMatrix* pRot)
{
if (!(t1.GetRotation()&&t2.GetRotation()))
{
SetTranslation(t1.GetTranslation()+t2.GetTranslation());
SetRotation(0);
}
else
{
pRot=pRot; // Avoid unuse warning
assert(0==1); // Unimpl 13.7.95
}
return *this;
}
inline G4Transform& ComputeCompoundReverseTransform(const G4Transform& t1,
const G4Transform& t2,
G4RotationMatrix* pRot)
{
if (!(t1.GetRotation()&&t2.GetRotation()))
{
SetTranslation(t2.GetTranslation()-t1.GetTranslation());
SetRotation(0);
}
else
{
pRot=pRot; // Avoid unused warning
assert(0==1); // Unimpl 13.7.95
}
return *this;
}
// Return true if transform involves rotations
inline G4bool IsRotated() const
{
return (!frotation||frotation->isIdentity()) ? false : true;
}
// Define equality as
// 1) equal rotation matrix *pointers*, and equal translations
// or
// 2) equal rotation matrices and equal translations
inline G4bool operator == (const G4Transform& t) const
{
return ((GetTranslation()==t.GetTranslation())&&
( (GetRotation()==t.GetRotation())
|| (*GetRotation()==*t.GetRotation()) )) ? true : false;
}
private:
G4RotationMatrix* frotation;
G4ThreeVector ftranslation;
};
#endif
@@ -5,27 +5,24 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TransportationManager.hh,v 1.3 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4TransportationManager.hh,v 1.4 2000/04/25 16:15:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 inlude file implementation
// class G4TransportationManager
//
// For information related to this code contact:
// CERN, IT Division (formely CN), ASD group
// ------------------------------------------------------------
// Class description:
//
// A singleton class which stores the (volume) navigator used by
// the transportation process to do the geometrical tracking.
// It also stores a pointer to the propagator used in a (magnetic)
// field and to the field manager.
// The class instance is created before main() is called, and
// in turn creates the navigator and the rest.
//
// the transportation process to do the geometrical tracking.
// It also stores a pointer to the propagator used in a (magnetic)
// field and to the field manager.
// The class instance is created before main() is called, and
// in turn creates the navigator and the rest.
// =======================================================================
// Created: 10 March 1997, J. Apostolakis
// =======================================================================
#ifndef G4TransportationManager_hh
#define G4TransportationManager_hh
@@ -36,7 +33,8 @@ class G4FieldManager;
class G4TransportationManager
{
public:
public: // with description
static G4TransportationManager* GetTransportationManager();
G4Navigator* GetNavigatorForTracking();
@@ -50,9 +48,11 @@ class G4TransportationManager
~G4TransportationManager();
protected:
G4TransportationManager();
private:
G4Navigator* fNavigatorForTracking ;
G4PropagatorInField* fPropagatorInField;
G4FieldManager* fFieldManager;
@@ -63,4 +63,3 @@ class G4TransportationManager
#include "G4TransportationManager.icc"
#endif
// end of #ifndef G4TransportationManager_hh
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4TransportationManager.icc,v 1.3 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,13 +5,19 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VoxelNavigation.hh,v 1.5 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4VoxelNavigation.hh,v 1.6 2000/04/25 16:15:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4VoxelNavigation: Utility for navigation in volumes
// containing only G4PVPlacement daughter volumes for which voxels
// have been constructed. Paul Kent Aug 96
// class G4VoxelNavigation
//
// Class description:
//
// Utility for navigation in volumes containing only G4PVPlacement
// daughter volumes for which voxels have been constructed.
// History:
// - Created. Paul Kent, Aug 96
#ifndef G4VOXELNAVIGATION_HH
#define G4VOXELNAVIGATION_HH
@@ -38,7 +44,8 @@ const G4int kNavigatorVoxelStackMax = 3;
class G4VoxelNavigation
{
public:
public: // with description
G4VoxelNavigation();
~G4VoxelNavigation();
G4SmartVoxelNode* VoxelLocate(G4SmartVoxelHeader *pHead,
@@ -66,7 +73,8 @@ public:
G4double ComputeSafety(const G4ThreeVector &globalpoint,
const G4NavigationHistory &history,
const G4double pMaxLength=DBL_MAX );
private:
private:
G4double ComputeVoxelSafety(const G4ThreeVector &localPoint) const;
G4bool LocateNextVoxel(const G4ThreeVector &localPoint,
const G4ThreeVector& localDirection,
@@ -76,34 +84,36 @@ private:
G4int pDepth);
G4BlockingList fBList; // Blocked volumes
//
// BEGIN Voxel Stack information
//
// Note: fVoxelDepth==0+ => fVoxelAxisStack(0+) contains axes of voxel
// fVoxelDepth==-1 -> not in voxel
//
// BEGIN Voxel Stack information
//
G4int fVoxelDepth;
// Note: fVoxelDepth==0+ => fVoxelAxisStack(0+) contains axes of voxel
// fVoxelDepth==-1 -> not in voxel
// Voxel axes
G4RWTValVector<EAxis> fVoxelAxisStack;
// Voxel axes
// No slices per voxel at each level
G4RWTValVector<G4int> fVoxelNoSlicesStack;
// No slices per voxel at each level
// Width of voxels at each level
G4RWTValVector<G4double> fVoxelSliceWidthStack;
// Width of voxels at each level
// Node no point is inside at each level
G4RWTValVector<G4int> fVoxelNodeNoStack;
// Node no point is inside at each level
// Voxel headers at each level
G4RWTPtrVector<G4SmartVoxelHeader> fVoxelHeaderStack;
// Voxel headers at each level
// Node containing last located point
G4SmartVoxelNode* fVoxelNode;
//
// END Voxel Stack information
//
// Node containing last located point
//
// END Voxel Stack information
//
};
@@ -112,7 +122,3 @@ private:
#include "G4VoxelNavigation.icc"
#endif
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VoxelNavigation.icc,v 1.2 1999/12/15 14:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// class G4VoxelNavigation Inline implementation