Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
@@ -21,11 +21,11 @@
// ********************************************************************
//
//
// $Id: G4PTouchableKey.hh,v 1.3 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4GeometryCell.hh,v 1.5 2002/10/22 13:18:43 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4PTouchableKey
// Class G4GeometryCell
//
// Class description:
//
@@ -33,48 +33,47 @@
// It serves to address a "cell". A "cell" is somewhat
// related to a touchable in Geant4. It is identified by a reference
// to a G4VPhysicalVolume and a number (replica number).
// Only simple replicas are supported.
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4PTouchableKey_hh
#define G4PTouchableKey_hh G4PTouchableKey_hh
#ifndef G4GeometryCell_hh
#define G4GeometryCell_hh G4GeometryCell_hh
#include "globals.hh"
class G4VPhysicalVolume;
class G4PTouchableKey
class G4GeometryCell
{
public: // with description
G4PTouchableKey(const G4VPhysicalVolume &aVolume, G4int RepNum);
G4GeometryCell(const G4VPhysicalVolume &aVolume, G4int RepNum);
G4GeometryCell(const G4GeometryCell &rhs);
// initialise volume and replica number
~G4PTouchableKey();
~G4GeometryCell();
// simple destruction
const G4VPhysicalVolume &GetPhysicalVolume() const;
// return the physical volume of the cell
G4int GetReplicaNumber() const;
// returns the replica number of the cell
G4GeometryCell &operator=(const G4GeometryCell &rhs);
private:
const G4VPhysicalVolume *fVPhysiclaVolume;
// pinter to the G4VPhysicalVolume of the "cell"
// it is treated as identifyer
G4int fRepNum;
// replica number of the "cell"
};
// -----------------------------------------------------------------------
class G4PTkComp
{
public: // without description
G4bool operator() (const G4PTouchableKey &k1,
const G4PTouchableKey &k2) const;
};
// -----------------------------------------------------------------------
G4bool operator==(const G4PTouchableKey &k1, const G4PTouchableKey &k2);
G4bool operator!=(const G4PTouchableKey &k1, const G4PTouchableKey &k2);
G4bool operator==(const G4GeometryCell &k1, const G4GeometryCell &k2);
G4bool operator!=(const G4GeometryCell &k1, const G4GeometryCell &k2);
#endif
@@ -21,32 +21,35 @@
// ********************************************************************
//
//
// $Id: G4Pstring.hh,v 1.3 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4GeometryCellComp.hh,v 1.1 2002/10/22 13:18:44 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Declaration
// Class G4GeometryCellComp
//
// Declaration description:
// Class description:
//
// This fucntions convert some non character objects into
// G4Strings
// A class needed for comparing G4GeometryCell e.g. in stl containers.
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4Pstring_hh
#define G4Pstring_hh G4Pstring_hh
#ifndef G4GeometryCellComp_hh
#define G4GeometryCellComp_hh G4GeometryCellComp_hh
#include "globals.hh"
#include "G4ThreeVector.hh"
G4String str(const int &i);
// convert an integer into a G4String
class G4GeometryCell;
G4String str(const double &d);
// convert a double into a G4String
class G4GeometryCellComp
{
public: // without description
G4GeometryCellComp();
G4bool operator() (const G4GeometryCell &g1,
const G4GeometryCell &g2) const;
// returns true if g1 < g2
};
G4String str(const G4ThreeVector &v);
// convert a G4ThreeVector into a G4String
#endif
@@ -21,11 +21,11 @@
// ********************************************************************
//
//
// $Id: G4PtkImportance.hh,v 1.5 2002/04/10 13:13:07 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4GeometryCellImportance.hh,v 1.2 2002/10/22 13:18:44 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4PtkImportance
// Class G4GeometryCellImportance
//
// Class description:
//
@@ -34,16 +34,17 @@
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4PtkImportance_hh
#define G4PtkImportance_hh G4PtkImportance_hh
#ifndef G4GeometryCellImportance_hh
#define G4GeometryCellImportance_hh G4GeometryCellImportance_hh
#include "g4std/map"
#include "globals.hh"
#include "G4PTouchableKey.hh"
#include "G4GeometryCell.hh"
#include "G4GeometryCellComp.hh"
typedef G4std::map<G4PTouchableKey, G4double, G4PTkComp> G4PtkImportance;
// implement container G4PtkImportance as map
typedef G4std::map<G4GeometryCell, G4double, G4GeometryCellComp> G4GeometryCellImportance;
// implement container G4GeometryCellImportance as map
G4std::ostream& operator<<(G4std::ostream &out, const G4PtkImportance &ptki);
G4std::ostream& operator<<(G4std::ostream &out, const G4GeometryCellImportance &gCelli);
#endif
@@ -21,11 +21,11 @@
// ********************************************************************
//
//
// $Id: G4PStep.hh,v 1.3 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4GeometryCellStep.hh,v 1.1 2002/10/22 13:18:44 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4PStep
// Class G4GeometryCellStep
//
// Class description:
//
@@ -33,41 +33,83 @@
// touched and a "cell" a track is currently in. It is used
// for scoring and importance sampling in the "mass" geometry as well
// as in a "parallel" geometry.
// The "cell" information is available with the fPreTouchableKey and the
// fPostTouchableKey.
// The fCrossBoundary member is set true in case the step
// crosses a boundary in the geometry it this G4PStep
// The "cell" information is available with the GetPreGeometryCell and
// the GetPostGeometryCell functions.
// The GetCrossBoundary finction returns true in case the step
// crosses a boundary in the geometry this G4GeometryCellStep
// refers to.
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4PStep_hh
#define G4PStep_hh G4PStep_hh
#ifndef G4GeometryCellStep_hh
#define G4GeometryCellStep_hh G4GeometryCellStep_hh
#include "G4PTouchableKey.hh"
#include "G4GeometryCell.hh"
class G4PStep
class G4GeometryCellStep
{
public: // with description
G4GeometryCellStep(const G4GeometryCell &preCell,
const G4GeometryCell &postCell);
// initialise pre and post G4GeometryCell
public: // with description
~G4GeometryCellStep();
G4PStep(const G4PTouchableKey &preKey, const G4PTouchableKey &postKey)
: fPreTouchableKey(preKey), fPostTouchableKey(postKey),
fCrossBoundary(false) {}
// initialise pre and post G4PTouchableKey
~G4PStep(){}
public: // without description
G4PTouchableKey fPreTouchableKey;
const G4GeometryCell &GetPreGeometryCell() const;
// addressing the "cell" the track previously touched
G4PTouchableKey fPostTouchableKey;
// addressing the current "cell"
const G4GeometryCell &GetPostGeometryCell() const;
// addressing the current "cell"
G4bool GetCrossBoundary() const;
// returns true if step crosses boundary of the geometry it refers to
// the following functions are used by the scoring and importance
// system to set the cell information.
void SetPreGeometryCell(const G4GeometryCell &preCell);
void SetPostGeometryCell(const G4GeometryCell &postCell);
void SetCrossBoundary(G4bool b);
private:
G4GeometryCell fPreGeometryCell;
G4GeometryCell fPostGeometryCell;
G4bool fCrossBoundary;
// true if step crosses boundary of the geometry it refers to
};
inline void G4GeometryCellStep::SetPreGeometryCell(const G4GeometryCell &preCell)
{
fPreGeometryCell = preCell;
}
inline void G4GeometryCellStep::SetPostGeometryCell(const G4GeometryCell &postCell)
{
fPostGeometryCell = postCell;
}
inline void G4GeometryCellStep::SetCrossBoundary(G4bool b)
{
fCrossBoundary = b;
}
inline const G4GeometryCell &G4GeometryCellStep::GetPreGeometryCell() const
{
return fPreGeometryCell;
}
inline const G4GeometryCell &G4GeometryCellStep::GetPostGeometryCell() const
{
return fPostGeometryCell;
}
inline G4bool G4GeometryCellStep::GetCrossBoundary() const
{
return fCrossBoundary;
}
#endif
@@ -21,25 +21,25 @@
// ********************************************************************
//
//
// $Id: G4PStepStream.hh,v 1.5 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4GeometryCellStepStream.hh,v 1.1 2002/10/22 13:18:44 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Declarations
//
// Declaration description:
//
// declarations of streams for G4PTouchableKey and G4PStep
// declarations of streams for G4GeometryCell and G4GeometryCellStep
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4PStepStream_hh
#define G4PStepStream_hh G4PStepStream_hh
#ifndef G4GeometryCellStepStream_hh
#define G4GeometryCellStepStream_hh G4GeometryCellStepStream_hh
#include "G4PTouchableKey.hh"
#include "G4PStep.hh"
#include "G4GeometryCell.hh"
#include "G4GeometryCellStep.hh"
G4std::ostream& operator<<(G4std::ostream &out, const G4PTouchableKey &tk);
G4std::ostream& operator<<(G4std::ostream &out, const G4PStep &ps);
G4std::ostream& operator<<(G4std::ostream &out, const G4GeometryCell &tk);
G4std::ostream& operator<<(G4std::ostream &out, const G4GeometryCellStep &ps);
#endif
+33 -22
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4IStore.hh,v 1.3 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4IStore.hh,v 1.9 2002/10/22 13:18:44 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4IStore
@@ -31,8 +31,13 @@
//
// An implementation of a "importance store" with the interface
// G4VIStore. See description in G4VIStore.
// This implementation uses G4PtkImportance as the container
// This implementation uses G4GeometryCellImportance as the container
// to store the "cells" together with the importance values.
// Giving a cell the importance 0 is allowed as
// a flagging that no biasing should happen between this
// cell and it's neighbors
// If a cell is not known by the importance store no biasing
// should be applied between this cell and it's nighbors.
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
@@ -40,24 +45,40 @@
#define G4IStore_hh G4IStore_hh
#include "G4VIStore.hh"
#include "G4PtkImportance.hh"
#include "G4GeometryCellImportance.hh"
class G4IStore : public G4VIStore
{
public: // with description
G4IStore(G4VPhysicalVolume &worldvolume);
explicit G4IStore(const G4VPhysicalVolume &worldvolume);
// initialise the importance store for the given geometry
~G4IStore();
virtual ~G4IStore();
// destruct
void AddImportanceRegion(G4double importance,
virtual G4double GetImportance(const G4GeometryCell &gCell) const;
// derive a importance value of a "cell" addresed by a G4GeometryCell
// from the store.
virtual G4bool IsKnown(const G4GeometryCell &gCell) const;
// returns true if the gCell is in the store, else false
virtual const G4VPhysicalVolume &GetWorldVolume() const;
// return a reference to the wolrd volume of the
// "importance" geometry
void AddImportanceGeometryCell(G4double importance,
const G4GeometryCell &gCell);
void AddImportanceGeometryCell(G4double importance,
const G4VPhysicalVolume &,
G4int aRepNum = 0);
// Add a "cell" together with a importance value to the store.
void ChangeImportance(G4double importance,
const G4GeometryCell &gCell);
void ChangeImportance(G4double importance,
const G4VPhysicalVolume &,
G4int aRepNum = 0);
@@ -65,29 +86,19 @@ public: // with description
G4double GetImportance(const G4VPhysicalVolume &,
G4int aRepNum = 0) const ;
// derive the importance value of a "cell" from the store.
G4double GetImportance(const G4PTouchableKey &ptk) const;
// derive a importance value of a "cell" addresed by a G4PTouchableKey
// from the store.
G4VPhysicalVolume &GetWorldVolume();
// return a reference to the wolrd volume of the
// "importance" geometry
private:
G4bool IsInWorld(const G4VPhysicalVolume &) const;
void SetInternalIterator(const G4VPhysicalVolume &,
G4int aRepNum) const;
void SetInternalIterator(const G4GeometryCell &gCell) const;
void Error(const G4String &m) const;
private:
G4VPhysicalVolume &fWorldVolume;
G4PtkImportance fPtki;
const G4VPhysicalVolume &fWorldVolume;
G4GeometryCellImportance fGeometryCelli;
mutable G4PtkImportance::const_iterator fCurrentIterator;
mutable G4GeometryCellImportance::const_iterator fCurrentIterator;
};
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ImportanceAlgorithm.hh,v 1.3 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4ImportanceAlgorithm.hh,v 1.6 2002/10/14 12:36:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4ImportanceAlgorithm
@@ -47,13 +47,14 @@ public: // with description
G4ImportanceAlgorithm();
// simple construction
~G4ImportanceAlgorithm();
virtual ~G4ImportanceAlgorithm();
// repeate warning if triggered
G4Nsplit_Weight Calculate(G4double ipre_over_ipost,
G4double init_w) const;
virtual G4Nsplit_Weight Calculate(G4double ipre,
G4double ipost,
G4double init_w) const;
// calculate the number of tracks and their weight according
// to the ratio of pre over post importance and the weight of
// to the pre and post importance value and the weight of
// the mother track.
private:
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ImportanceFinder.hh,v 1.3 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4ImportanceFinder.hh,v 1.6 2002/10/14 12:36:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4ImportanceFinder
@@ -31,7 +31,7 @@
//
// This class is used internally by importance sampling in a parallel
// geometry. It derives the ratio of importances of the pre over the post
// G4PTouchableKey.
// G4GeometryCell.
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
@@ -42,23 +42,21 @@
class G4VParallelStepper;
class G4VIStore;
class G4PTouchableKey;
class G4GeometryCell;
class G4ImportanceFinder
{
public: // with description
G4ImportanceFinder(const G4VIStore &aIStore);
explicit G4ImportanceFinder(const G4VIStore &aIStore);
// initialise fIStore
~G4ImportanceFinder();
// destruction
G4double GetIPre_over_IPost(const G4PTouchableKey &prekey,
const G4PTouchableKey &postkey) const;
// get the ratio of importances of the pre over the
// post G4PTouchableKey importances.
G4double GetImportance(const G4GeometryCell &gCell) const;
// get the importance to a G4GeometryCell
private:
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ImportanceSplitExaminer.hh,v 1.2 2002/05/31 09:56:09 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4ImportanceSplitExaminer.hh,v 1.5 2002/10/14 12:36:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4ImportanceSplitExaminer
@@ -41,10 +41,10 @@
#define G4ImportanceSplitExaminer_hh G4ImportanceSplitExaminer_hh
#include "G4VImportanceSplitExaminer.hh"
#include "G4ImportanceFinder.hh"
class G4VImportanceAlgorithm;
class G4VParallelStepper;
class G4ImportanceFinder;
class G4VIStore;
class G4ImportanceSplitExaminer: public G4VImportanceSplitExaminer
@@ -57,10 +57,10 @@ public: // with description
const G4VIStore &istore);
// initialisation and construct G4ImportanceFinder
~G4ImportanceSplitExaminer();
virtual ~G4ImportanceSplitExaminer();
// delete G4ImportanceFinder
G4Nsplit_Weight Examine(G4double w) const;
virtual G4Nsplit_Weight Examine(G4double w) const;
// Get G4Nsplit_Weight for a given mother track weight.
@@ -73,7 +73,7 @@ private:
const G4VImportanceAlgorithm &fIalgorithm;
const G4VParallelStepper &fPStepper;
const G4ImportanceFinder &fIfinder;
G4ImportanceFinder fIfinder;
};
@@ -21,16 +21,16 @@
// ********************************************************************
//
//
// $Id: G4Nsplit_Weight.hh,v 1.5 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4Nsplit_Weight.hh,v 1.9 2002/11/20 13:18:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4Nsplit_Weight
//
// Class description:
//
// A struct used by importance sampling. It contains the number of tracks
// a mother track should be split into and their weight.
// A class (struct) used by importance sampling. It contains the number
// of tracks a mother track should be split into and their weight.
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
@@ -39,10 +39,9 @@
#include "globals.hh"
struct G4Nsplit_Weight
class G4Nsplit_Weight
{
G4Nsplit_Weight(G4int an, G4double aw): fN(an), fW(aw){}
// initialise members
public:
G4int fN;
// number of tracks a mother track should be split into
@@ -55,6 +54,7 @@ struct G4Nsplit_Weight
G4std::ostream& operator<<(G4std::ostream &out,
const G4Nsplit_Weight &nw);
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ParallelNavigator.hh,v 1.3 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4ParallelNavigator.hh,v 1.9 2002/10/14 12:36:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4ParallelNavigator
@@ -42,9 +42,10 @@
#include "G4VPGeoDriver.hh"
#include "geomdefs.hh"
class G4VTouchable;
class G4Navigator;
class G4PTouchableKey ;
#include "G4TouchableHandle.hh"
#include "G4Navigator.hh"
class G4GeometryCell ;
class G4VPhysicalVolume;
class G4ParallelNavigator : public G4VPGeoDriver
@@ -52,14 +53,15 @@ class G4ParallelNavigator : public G4VPGeoDriver
public: // with description
G4ParallelNavigator(G4VPhysicalVolume &aWorldVolume);
explicit G4ParallelNavigator(G4VPhysicalVolume &aWorldVolume);
// initialise and create G4Navigator and a TouchableHistory
~G4ParallelNavigator();
virtual ~G4ParallelNavigator();
// delete Touchable and Navigator
G4PTouchableKey LocateOnBoundary(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
virtual G4GeometryCell
LocateOnBoundary(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
// The location of a track according to it's position
// and direction in case the track crosses a boundary
// of a "parallel" geometry.
@@ -67,22 +69,27 @@ public: // with description
// (The track crosses the boundary if PostDOIT gets called.)
G4PTouchableKey GetCurrentTouchableKey() const;
// get the current G4PTouchableKey of the "parallel" geometry
virtual G4GeometryCell GetCurrentGeometryCell() const;
// get the current G4GeometryCell of the "parallel" geometry
G4double ComputeStepLengthInit(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
virtual G4double
ComputeStepLengthInit(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
// compute step length for a starting track.
G4double ComputeStepLengthCrossBoundary(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
virtual G4double
ComputeStepLengthCrossBoundary(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
// compute the step length after a track crossed a boundary
// in a "parallel" geometry
G4double ComputeStepLengthInVolume(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
virtual G4double
ComputeStepLengthInVolume(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
// compute step length when track moves inside a volume.
void SetVerboseity(G4int v);
private:
G4ParallelNavigator(const G4ParallelNavigator &);
@@ -92,9 +99,18 @@ private:
const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
G4double GetStepLength(const G4String &methodname,
const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
G4double GetStepLengthUseLocate(const G4String &methodname,
const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection);
void Locate(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection,
G4bool histsearch);
G4bool historysearch,
G4bool useDirection);
void Error(const G4String &m,
const G4ThreeVector &pos,
@@ -104,9 +120,11 @@ private:
private:
G4Navigator &fNavigator;
G4VTouchable *fCurrentTouchable;
G4Navigator fNavigator;
G4int fNlocated;
G4int fMaxShiftedTrys;
G4TouchableHandle fCurrentTouchableH;
G4int fVerbose;
};
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ParallelStepper.hh,v 1.3 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4ParallelStepper.hh,v 1.6 2002/10/22 13:18:45 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4ParallelStepper
@@ -38,7 +38,7 @@
#define G4ParallelStepper_hh G4ParallelStepper_hh
#include "G4VParallelStepper.hh"
#include "G4PStep.hh"
#include "G4GeometryCellStep.hh"
class G4ParallelStepper : public G4VParallelStepper
{
@@ -48,28 +48,29 @@ public: // with description
G4ParallelStepper();
// imitilisation
~G4ParallelStepper();
G4ParallelStepper(const G4ParallelStepper &);
// create new G4GeometryCellStep
virtual ~G4ParallelStepper();
// delete G4Pstep if created
G4ParallelStepper(const G4ParallelStepper &);
// create new G4PStep
virtual G4GeometryCellStep GetPStep() const;
// get the current G4GeometryCellStep
virtual void Init(const G4GeometryCell &agCell);
// initialise the parallel stepper and the G4GeometryCellStep
// pre and post G4GeometryCell of the step are set equal
virtual void Update(const G4GeometryCell &agCell);
// to be called when crossing a boundary of the
// "parallel" geometry to update the G4GeometryCellStep
virtual void UnSetCrossBoundary();
// to be called to unset the fCrossBoundary member of the G4GeometryCellStep
G4ParallelStepper &operator=(const G4ParallelStepper &);
// create new G4PStep
G4PStep GetPStep() const {return *fPStep;}
// get the current G4PStep
void Init(const G4PTouchableKey &aptk);
// initialise the parallel stepper and the G4PStep
// pre and post G4PTouchableKey of the step are set equal
void Update(const G4PTouchableKey &aptk);
// to be called when crossing a boundary of the
// "parallel" geometry to update the G4PStep
void UnSetCrossBoundary();
// to be called to unset the fCrossBoundary member of the G4PStep
// create new G4GeometryCellStep
private:
@@ -77,7 +78,9 @@ private:
private:
G4PStep *fPStep;
G4GeometryCellStep *fPStep;
};
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ParallelWorld.hh,v 1.3 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4ParallelWorld.hh,v 1.6 2002/10/14 12:36:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4ParallelWorld
@@ -51,20 +51,12 @@ class G4ParallelWorld
public: // with description
G4ParallelWorld(G4VPhysicalVolume &worldvolume);
explicit G4ParallelWorld(G4VPhysicalVolume &worldvolume);
// initialisation and create G4ParallelStepper and a G4VPGeoDriver
~G4ParallelWorld();
// delete G4ParallelStepper and a G4VPGeoDriver
G4ParallelWorld(const G4ParallelWorld &rhs);
// create G4ParallelStepper and a G4VPGeoDriver
G4ParallelWorld &operator=(const G4ParallelWorld &rhs);
// create G4ParallelStepper and a G4VPGeoDriver
G4VPhysicalVolume *GetWorldVolume() const;
// get the world volume
G4VParallelStepper &GetParallelStepper();
// get the parallel stepper
@@ -74,7 +66,12 @@ public: // with description
private:
G4VPhysicalVolume *fWorldVolume;
G4ParallelWorld(const G4ParallelWorld &rhs);
// create G4ParallelStepper and a G4VPGeoDriver
G4ParallelWorld &operator=(const G4ParallelWorld &rhs);
// create G4ParallelStepper and a G4VPGeoDriver
G4VParallelStepper *fPstepper;
G4VPGeoDriver *fPdriver;
};
-106
View File
@@ -1,106 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4Sigma.hh,v 1.6 2002/04/10 13:13:07 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
// ----------------------------------------------------------------------
// Class G4Sigma
//
// Class description:
//
// A class for simple Gaussian statistics taking into account
// weights.
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4Sigma_hh
#define G4Sigma_hh G4Sigma_hh
#include "g4std/iostream"
#include "globals.hh"
class G4Sigma
{
public: // with description
G4Sigma();
// call Init()
~G4Sigma();
// simple deonstruction
void Init();
// initialisation
G4int Xin(G4double x, G4double w = 1.);
// enter a value [with a weight]
G4int GetEntries() const;
// get the number of entries
G4double GetMean() const;
// get the weighted mean value: Sum(w*x)/Sum(w)
G4double GetSigma() const;
// get the weighted sigma: sqrt(Sum(w*x*x)/Sum(w)-mean^2)
G4double GetXsum() const;
// get sum over x: Sum(x)
G4double GetXXsum() const;
// get sum over squared x: Sum(x*x)
G4double GetSumOfWeights() const;
// get sum over weights: Sum(w)
G4double GetWeightedXsum() const;
// get weighted sum over x*w: Sum(w*x)
G4double GetWeightedXXsum() const;
// get weighted sum over squarted x: Sum(W*x*x)
private:
G4int GetCalc() const;
G4int Calculate() const;
void Error(const G4String &m);
private:
G4int fEntries;
mutable G4double fMean;
mutable G4double fSigma;
G4double fXsum;
G4double fXXsum;
G4double fWsum;
G4double fWXsum;
G4double fWXXsum;
mutable G4int fcalc;
};
G4std::ostream& operator<<(G4std::ostream &out, const G4Sigma &s);
#endif
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VCellScorer.hh,v 1.6 2002/10/28 09:53:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4VCellScorer
//
// Class description:
//
// This is an interface for an object which does scoring for one cell
// of a geometry.
// The cell may be a physical volume or replica in the mass or a
// parallel geometry.
//
// Three different situation of the step with respect to the cell
// are separated: entering end exiting the cell and stepping inside
// the cell.
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4VCellScorer_hh
#define G4VCellScorer_hh G4VCellScorer_hh
class G4Step;
class G4GeometryCell;
class G4VCellScorer {
public: // with description
G4VCellScorer();
virtual ~G4VCellScorer();
virtual void ScoreAnExitingStep(const G4Step &aStep,
const G4GeometryCell &gCell) = 0;
// to update scores related with the exiting of a cell
virtual void ScoreAnEnteringStep(const G4Step &aStep,
const G4GeometryCell &gCell) = 0;
// to update scores related with the entering of a cell
virtual void ScoreAnInVolumeStep(const G4Step &aStep,
const G4GeometryCell &gCell) = 0;
// to update scores related with the stepping inside the cell
};
#endif
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VCellScorerStore.hh,v 1.6 2002/10/28 09:53:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4VCellScorerStore
//
// Class description:
//
// This class describes the interface for a store for
// G4VCellScorer objects. It is used by the class
// G4CellStoreScorer to score the G4CellScorer objects per cell.
//
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4VCellScorerStore_hh
#define G4VCellScorerStore_hh G4VCellScorerStore_hh
class G4VCellScorer;
class G4GeometryCell;
class G4VCellScorerStore {
public: // with description
G4VCellScorerStore();
virtual ~G4VCellScorerStore();
virtual G4VCellScorer *GetCellScore(const G4GeometryCell &gCell) = 0;
// returns a cell scorer related to the given cell
};
#endif
@@ -21,34 +21,43 @@
// ********************************************************************
//
//
// $Id: G4PMapPtkTallys.hh,v 1.8 2002/04/10 13:13:06 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VGCellFinder.hh,v 1.1 2002/10/16 14:30:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4PMapNameTally and G4PMapPtkTallys
// Class G4VGCellFinder
//
// Class description:
//
// Used by G4PScorer and G4PIScorer as containers for tallies.
// An interface of an GCellFinder. The G4GeometryCell is obtained
// in the parallel geometry from G4VParallelStepper and in the
// mass geometry form G4Step. This interface allows to implement
// the two different ways to get a G4GeometryCell used by a process.
//
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4PMapPtkTallys_hh
#define G4PMapPtkTallys_hh G4PMapPtkTallys_hh
#ifndef G4VGCellFinder_hh
#define G4VGCellFinder_hh G4VGCellFinder_hh
#include "g4std/map"
#include "globals.hh"
#include "g4std/iostream"
#include "G4PTouchableKey.hh"
#include "G4Sigma.hh"
#include "G4GeometryCell.hh"
typedef G4std::map<const char *, G4Sigma> G4PMapNameTally;
// container for a G4Sigma to each tally
typedef G4std::map<G4PTouchableKey, G4PMapNameTally, G4PTkComp> G4PMapPtkTallys;
// container for a G4PMapNameTally to each "cell" addressed by a
// G4PTouchableKey
class G4Step;
G4std::ostream& operator<<(G4std::ostream &out, const G4PMapNameTally &tally);
G4std::ostream& operator<<(G4std::ostream &out, const G4PMapPtkTallys &ptktally);
class G4VGCellFinder
{
public: // with description
G4VGCellFinder();
virtual ~G4VGCellFinder();
virtual G4GeometryCell
GetPreGeometryCell(const G4Step &aStep) const=0;
virtual G4GeometryCell
GetPostGeometryCell(const G4Step &aStep) const=0;
};
#endif
+11 -22
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VIStore.hh,v 1.3 2002/04/10 13:13:07 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VIStore.hh,v 1.8 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4VIStore
@@ -43,7 +43,7 @@
#include "globals.hh"
class G4PTouchableKey;
class G4GeometryCell;
class G4VPhysicalVolume;
class G4VIStore
@@ -51,28 +51,17 @@ class G4VIStore
public: // with description
G4VIStore(G4VPhysicalVolume &worldVolume){}
virtual ~G4VIStore(){}
G4VIStore();
virtual ~G4VIStore();
virtual void AddImportanceRegion(G4double importance,
const G4VPhysicalVolume &,
G4int aRepNum = 0) = 0;
// Add a "cell" together with a importance value to the store.
virtual void ChangeImportance(G4double importance,
const G4VPhysicalVolume &,
G4int aRepNum = 0) = 0;
// Change a importance value of a "cell".
virtual G4double GetImportance(const G4VPhysicalVolume &,
G4int aRepNum = 0) const = 0;
// derive the importance value of a "cell" from the store.
virtual G4double GetImportance(const G4PTouchableKey &ptk) const = 0;
// derive a importance value of a "cell" addresed by a G4PTouchableKey
virtual G4double GetImportance(const G4GeometryCell &gCell) const = 0;
// derive a importance value of a "cell" addresed by a G4GeometryCell
// from the store.
virtual G4VPhysicalVolume &GetWorldVolume() = 0;
virtual G4bool IsKnown(const G4GeometryCell &gCell) const = 0;
// returns true if the gCell is in the store, else false
virtual const G4VPhysicalVolume &GetWorldVolume() const = 0;
};
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VImportanceAlgorithm.hh,v 1.3 2002/04/10 13:13:07 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VImportanceAlgorithm.hh,v 1.7 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4VImportanceAlgorithm
@@ -51,11 +51,13 @@ class G4VImportanceAlgorithm
public: // with description
virtual ~G4VImportanceAlgorithm(){}
virtual G4Nsplit_Weight Calculate(G4double ipre_over_ipost,
G4VImportanceAlgorithm();
virtual ~G4VImportanceAlgorithm();
virtual G4Nsplit_Weight Calculate(G4double ipre,
G4double ipost,
G4double init_w) const = 0;
// calculate the number of tracks and their weight according
// to the ratio of pre over post importance and the weight of
// to the pre and post importance value and the weight of
// the mother track.
};
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VImportanceSplitExaminer.hh,v 1.1 2002/05/31 08:07:47 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VImportanceSplitExaminer.hh,v 1.4 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4VImportanceSplitExaminer
@@ -47,8 +47,8 @@ class G4VImportanceSplitExaminer
{
public: // with description
virtual ~G4VImportanceSplitExaminer(){}
G4VImportanceSplitExaminer();
virtual ~G4VImportanceSplitExaminer();
virtual G4Nsplit_Weight Examine(G4double w) const = 0;
// Get G4Nsplit_Weight for a given mother track weight.
};
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VPGeoDriver.hh,v 1.3 2002/04/10 13:13:07 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VPGeoDriver.hh,v 1.6 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4VPGeoDriver
@@ -41,25 +41,28 @@
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4PTouchableKey.hh"
#include "G4GeometryCell.hh"
class G4VPhysicalVolume;
class G4VPGeoDriver
{
public: // with description
virtual ~G4VPGeoDriver(){}
G4VPGeoDriver();
virtual ~G4VPGeoDriver();
virtual G4PTouchableKey LocateOnBoundary(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection) = 0;
virtual G4GeometryCell LocateOnBoundary(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection) = 0;
// The location of a track according to it's position
// and direction in case the track crosses a boundary
// of a "parallel" geometry.
// Must be called in the PostDOIT of the ParallelTransportation.
// (The track crosses the boundary if PostDOIT gets called.)
virtual G4PTouchableKey GetCurrentTouchableKey() const = 0;
// get the current G4PTouchableKey of the "parallel" geometry
virtual G4GeometryCell GetCurrentGeometryCell() const = 0;
// get the current G4GeometryCell of the "parallel" geometry
virtual G4double ComputeStepLengthInit(const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection) = 0;
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VParallelStepper.hh,v 1.3 2002/04/10 13:13:07 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VParallelStepper.hh,v 1.7 2002/10/22 13:18:46 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4VParallelStepper
@@ -32,7 +32,7 @@
// This interface is used internally by importance sampling and scoring
// in a "parallel" geometry.
// It abstracts a parallel stepper which servs to comunicate
// information about a G4PStep between the "transportation"
// information about a G4GeometryCellStep between the "transportation"
// (done by G4ParallelTransport) of a track in a "parallel" geometry
// and a scorer for that geometry.
@@ -41,28 +41,29 @@
#ifndef G4VParallelStepper_hh
#define G4VParallelStepper_hh G4VParallelStepper_hh
#include "G4PStep.hh"
#include "G4GeometryCellStep.hh"
class G4VParallelStepper
{
public: // with description
virtual ~G4VParallelStepper(){}
G4VParallelStepper();
virtual ~G4VParallelStepper();
virtual G4PStep GetPStep() const = 0;
// get the current G4PStep
virtual G4GeometryCellStep GetPStep() const = 0;
// get the current G4GeometryCellStep
virtual void Init(const G4PTouchableKey &aptk) = 0;
// initialise the parallel stepper and the G4PStep
// pre and post G4PTouchableKey of the step are set equal
virtual void Init(const G4GeometryCell &agCell) = 0;
// initialise the parallel stepper and the G4GeometryCellStep
// pre and post G4GeometryCell of the step are set equal
virtual void Update(const G4PTouchableKey &aptk) = 0;
virtual void Update(const G4GeometryCell &agCell) = 0;
// to be called when crossing a boundary of the
// "parallel" geometry to update the G4PStep
// "parallel" geometry to update the G4GeometryCellStep
virtual void UnSetCrossBoundary() = 0;
// to be called to unset the fCrossBoundary member of the G4PStep
// to be called to unset the fCrossBoundary member of the G4GeometryCellStep
};
@@ -21,11 +21,11 @@
// ********************************************************************
//
//
// $Id: G4VPScorer.hh,v 1.3 2002/04/10 13:13:07 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VScorer.hh,v 1.1 2002/10/28 09:53:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4VPScorer
// Class G4VScorer
//
// Class description:
//
@@ -33,31 +33,29 @@
// scorers should inherit from it.
// A scorer is applicable to a particle type.
// The scorer (inheriting from this interface) is informed
// about every step of a particle of a the applicable type.
// The information consists of the G4Step and the G4PStep
// (see G4PStep.hh).
// about every step of a particle of the applicable type.
// The information consists of the G4Step and the G4GeometryCellStep
// (see G4GeometryCellStep.hh).
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4VPScorer_hh
#define G4VPScorer_hh G4VPScorer_hh
#ifndef G4VScorer_hh
#define G4VScorer_hh G4VScorer_hh
class G4Step;
class G4PStep;
class G4GeometryCellStep;
class G4VPScorer
class G4VScorer
{
public: // with description
virtual ~G4VPScorer() {}
virtual void Score(const G4Step &step, const G4PStep &pstep) = 0;
// perform scoring for the G4Step and G4PStep
G4VScorer();
virtual ~G4VScorer();
virtual void Score(const G4Step &step, const G4GeometryCellStep &gstep) = 0;
// perform scoring for the G4Step and G4GeometryCellStep
};
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VWeightWindowAlgorithm.hh,v 1.2 2002/05/30 16:00:55 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VWeightWindowAlgorithm.hh,v 1.5 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4VWeightWindowAlgorithm
@@ -50,7 +50,8 @@ class G4VWeightWindowAlgorithm
public: // with description
virtual ~G4VWeightWindowAlgorithm(){}
G4VWeightWindowAlgorithm();
virtual ~G4VWeightWindowAlgorithm();
virtual void SetUpperLimit(G4double Upper) = 0;
// set upper limiting factor for window
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4WeightWindowAlgorithm.hh,v 1.2 2002/05/30 16:00:55 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4WeightWindowAlgorithm.hh,v 1.4 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4WeightWindowAlgorithm
@@ -46,22 +46,22 @@ public: // with description
G4WeightWindowAlgorithm();
~G4WeightWindowAlgorithm(){}
virtual ~G4WeightWindowAlgorithm();
void SetUpperLimit(G4double Upper);
virtual void SetUpperLimit(G4double Upper);
// set upper limiting factor for window
// - Upper is the maximum factor by which the weight of a particle may
// be higher than it should be according to the importance
void SetLowerLimit(G4double Lower);
virtual void SetLowerLimit(G4double Lower);
// set lower limiting facotr for window
// - Lower is the minimal factor by which the wight may be
// lower than it should be according to the importance
G4Nsplit_Weight Calculate(G4double init_w,
G4double importance) const;
virtual G4Nsplit_Weight Calculate(G4double init_w,
G4double importance) const;
// calculate the number of tracks and their weight according
// to the upper and lower limmiting factors of the window
// and the initial weight