Import Geant4 5.0.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.1 2002/03/25 17:09:16 gcosmo Exp $
|
||||
# $Id: GNUmakefile,v 1.2 2002/07/11 16:07:07 dressel Exp $
|
||||
# --------------------------------------------------------------------
|
||||
# GNUmakefile for geometry/biasing library. Gabriele Cosmo, 25/03/02.
|
||||
# --------------------------------------------------------------------
|
||||
@@ -11,7 +11,9 @@ endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -I$(G4BASE)/graphics_reps/include \
|
||||
CPPFLAGS += -I$(G4BASE)/geometry/solids/CSG/include \
|
||||
-I$(G4BASE)/materials/include \
|
||||
-I$(G4BASE)/graphics_reps/include \
|
||||
-I$(G4BASE)/intercoms/include \
|
||||
-I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/global/HEPRandom/include \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.9 2002/05/31 09:56:09 dressel Exp $
|
||||
$Id: History,v 1.29 2002/11/20 13:19:09 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,87 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Nov, 20th 2002 G.Cosmo geombias-V04-01-04
|
||||
- changed definition of G4NSplit_Weight from struct to class
|
||||
to allow porting on Windows DLLs.
|
||||
|
||||
Nov, 4th 2002 M.Dressel geombias-V04-01-03
|
||||
- remove G4std:: where it does not belong to,
|
||||
- remove G4StringConversion,
|
||||
- and added G4Nsplit_Weight.cc
|
||||
|
||||
Oct, 28th 2002 M.Dressel geombias-V04-01-02
|
||||
- moving interfaces G4VCellScorer and G4VCellScorerStore back
|
||||
|
||||
Oct, 22th 2002 M.Dressel internal_7_geombias-V04-01-01
|
||||
- renaming G4VPScorer to G4VScorer and
|
||||
G4PStep to G4GeometryCellStep
|
||||
- moving interfaces G4VCellScorer and G4VCellScorerStore to intercoms
|
||||
- adding comments
|
||||
|
||||
Oct. 16th 2002 M.Dressel internal_6_geombias-V04-01-01
|
||||
- changes recomanded by codewizard
|
||||
- stream, and string conversion from file G4Nsplit_Weight.hh/.cc
|
||||
to G4StringConversion.hh/.cc
|
||||
|
||||
Oct. 15th 2002 M.Dressel
|
||||
removing G4Pstring with G4StringConversion
|
||||
|
||||
Oct. 14th 2002 M.Dressel
|
||||
cleanup according to codewizzard
|
||||
|
||||
Oct. 10th 2002 M.Dressel geombias-V04-01-01-internal-5
|
||||
change in G4(V)ImportanceAlgorithm, G4ImportanceSplitExaminer
|
||||
G4ImportanceFinder: give pre and post importance
|
||||
separatly insted only ipre/ipost.
|
||||
|
||||
Sep, 2th 2002 M.Dressel geombias-V04-01-01-internal-4
|
||||
moved files concerning messaging a importance geometry to
|
||||
/afs/cern.ch/user/d/dressel/G4/IGeoMessangers.
|
||||
Support will be given on demand.
|
||||
|
||||
Sep, 2th 2002 M.Dressel geombias-V04-01-01-internal-3
|
||||
code cleanup for code-wizard
|
||||
|
||||
Aug, 29th 2002 M.Dressel int-2-geombias-V04-01-01
|
||||
renaming of G4PTouchableKey to G4GeometryCell
|
||||
changing G4VIStore and G4IStore
|
||||
and dependants
|
||||
|
||||
Aug, 13th, 2002 M.Dressel
|
||||
removed G4VPrintableScorer.hh G4VPrintableScorerFactory.hh
|
||||
|
||||
Aug, 13th, 2002 M.Dressel - geombias-V04-01-01
|
||||
added G4VCellScorer.hh and G4VCellScorerStore.hh
|
||||
|
||||
July, 18th, 2002 M.Dressel
|
||||
change the strategy for importance sampling:
|
||||
- G4VIStore: new function:
|
||||
IsKnown(const G4PTouchableKey &ptk)
|
||||
to tell if a cell (G4PTouchableKey) is known in the
|
||||
store
|
||||
- no biasing is applied between cells that are not known by
|
||||
the G4IStore and it's neighbors.
|
||||
- importance valu 0 is allowed to flag that no biasing should
|
||||
be done betweeen the cell and it's neighbors.
|
||||
change the G4PArallelNavigator:
|
||||
- using G4TouchableHanle
|
||||
- and LocateGlobalPointAndSetup
|
||||
|
||||
|
||||
July, 11th, 2002 M.Dressel
|
||||
added comments in new classes
|
||||
|
||||
July, 11th, 2002 M.Dressel - internal-2-geombias-V04-01-01
|
||||
added clases for contruction of a simple geometry with
|
||||
importance values and messengers.
|
||||
|
||||
July, 10th, 2002 M.Dressel - internal-1-geombias-V04-01-01
|
||||
change in G4Sigma: the sum over the weights is returned by GetWsum
|
||||
(before it was GetSumOfWeights) and the weighted sum over x is returned
|
||||
by GetWXsum().
|
||||
|
||||
|
||||
May, 31th, 2002 M.Dressel - geombias-V04-00-04
|
||||
- change name ImportanceSampler to ImportanceSplitExaminer
|
||||
|
||||
|
||||
+23
-24
@@ -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
|
||||
+18
-15
@@ -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
|
||||
+10
-9
@@ -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
|
||||
+67
-25
@@ -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
|
||||
+9
-9
@@ -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
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
+26
-17
@@ -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
|
||||
@@ -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
|
||||
|
||||
};
|
||||
|
||||
|
||||
+16
-18
@@ -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
|
||||
|
||||
+47
-20
@@ -21,47 +21,74 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PTouchableKey.cc,v 1.2 2002/04/09 16:23:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4GeometryCell.cc,v 1.5 2002/10/22 13:18:46 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4PTouchableKey.cc
|
||||
// G4GeometryCell.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4PTouchableKey.hh"
|
||||
#include "G4GeometryCell.hh"
|
||||
//#include "G4VPhysicalVolume.hh"
|
||||
|
||||
G4PTouchableKey::G4PTouchableKey(const G4VPhysicalVolume &aVolume,
|
||||
G4GeometryCell::G4GeometryCell(const G4VPhysicalVolume &aVolume,
|
||||
G4int RepNum)
|
||||
: fVPhysiclaVolume(&aVolume),
|
||||
fRepNum(RepNum)
|
||||
{}
|
||||
|
||||
G4PTouchableKey::~G4PTouchableKey()
|
||||
G4GeometryCell::~G4GeometryCell()
|
||||
{}
|
||||
|
||||
G4bool G4PTkComp::operator() (const G4PTouchableKey &k1,
|
||||
const G4PTouchableKey &k2) const
|
||||
|
||||
const G4VPhysicalVolume &G4GeometryCell::GetPhysicalVolume() const
|
||||
{
|
||||
if (k1.fVPhysiclaVolume != k2.fVPhysiclaVolume) {
|
||||
return k1.fVPhysiclaVolume < k2.fVPhysiclaVolume;
|
||||
} else {
|
||||
return k1.fRepNum < k2.fRepNum;
|
||||
return *fVPhysiclaVolume;
|
||||
}
|
||||
|
||||
G4int G4GeometryCell::GetReplicaNumber() const
|
||||
{
|
||||
return fRepNum;
|
||||
}
|
||||
|
||||
|
||||
G4GeometryCell::G4GeometryCell(const G4GeometryCell &rhs){
|
||||
*this = rhs;
|
||||
}
|
||||
|
||||
G4GeometryCell &G4GeometryCell::operator=(const G4GeometryCell &rhs){
|
||||
if (this != &rhs) {
|
||||
fVPhysiclaVolume = rhs.fVPhysiclaVolume; // this is treated
|
||||
// as identifyer
|
||||
fRepNum = rhs.fRepNum;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4bool operator==(const G4PTouchableKey &k1, const G4PTouchableKey &k2)
|
||||
|
||||
G4bool operator==(const G4GeometryCell &k1, const G4GeometryCell &k2)
|
||||
{
|
||||
if (k1.fVPhysiclaVolume != k2.fVPhysiclaVolume) return false;
|
||||
if (k1.fRepNum != k2.fRepNum) return false;
|
||||
return true;
|
||||
G4bool equal=true;
|
||||
if (&(k1.GetPhysicalVolume()) != &(k2.GetPhysicalVolume())) {
|
||||
equal = false;
|
||||
}
|
||||
else if (k1.GetReplicaNumber() != k2.GetReplicaNumber()) {
|
||||
equal = false;
|
||||
}
|
||||
return equal;
|
||||
}
|
||||
|
||||
G4bool operator!=(const G4PTouchableKey &k1, const G4PTouchableKey &k2)
|
||||
G4bool operator!=(const G4GeometryCell &k1, const G4GeometryCell &k2)
|
||||
{
|
||||
if (k1.fVPhysiclaVolume != k2.fVPhysiclaVolume) return true;
|
||||
if (k1.fRepNum != k2.fRepNum) return true;
|
||||
return false;
|
||||
G4bool unequal = false;
|
||||
if (&(k1.GetPhysicalVolume()) != &(k2.GetPhysicalVolume())) {
|
||||
unequal = true;
|
||||
}
|
||||
else if (k1.GetReplicaNumber() != k2.GetReplicaNumber()) {
|
||||
unequal = true;
|
||||
}
|
||||
return unequal;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4GeometryCellComp.cc,v 1.3 2002/12/13 11:54:19 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4GeometryCellCmp.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4GeometryCellComp.hh"
|
||||
#include "G4GeometryCell.hh"
|
||||
//#include "G4VPhysicalVolume.hh"
|
||||
|
||||
|
||||
G4GeometryCellComp::G4GeometryCellComp()
|
||||
{}
|
||||
|
||||
G4bool G4GeometryCellComp::operator() (const G4GeometryCell &k1,
|
||||
const G4GeometryCell &k2) const
|
||||
{
|
||||
G4bool smaler=false;
|
||||
if (&(k1.GetPhysicalVolume()) != &(k2.GetPhysicalVolume())) {
|
||||
smaler = &(k1.GetPhysicalVolume()) < &(k2.GetPhysicalVolume());
|
||||
} else {
|
||||
smaler = k1.GetReplicaNumber() < k2.GetReplicaNumber();
|
||||
}
|
||||
return smaler;
|
||||
}
|
||||
+8
-8
@@ -21,23 +21,23 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PtkImportance.cc,v 1.4 2002/04/09 16:23:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4GeometryCellImportance.cc,v 1.3 2002/10/22 13:18:46 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4PtkImportance.cc
|
||||
// G4GeometryCellImportance.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4PtkImportance.hh"
|
||||
#include "G4PStepStream.hh"
|
||||
#include "G4GeometryCellImportance.hh"
|
||||
#include "G4GeometryCellStepStream.hh"
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4PtkImportance &ptki)
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4GeometryCellImportance &gCelli)
|
||||
{
|
||||
for (G4PtkImportance::const_iterator it = ptki.begin();
|
||||
it != ptki.end(); it++) {
|
||||
for (G4GeometryCellImportance::const_iterator it = gCelli.begin();
|
||||
it != gCelli.end(); ++it) {
|
||||
out << (*it).first << ", importance = ";
|
||||
out << (*it).second << "\n";
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4GeometryCellStep.cc,v 1.1 2002/10/22 13:18:46 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4GeometryCellStep.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4GeometryCellStep.hh"
|
||||
|
||||
G4GeometryCellStep::G4GeometryCellStep(const G4GeometryCell &preCell,
|
||||
const G4GeometryCell &postCell)
|
||||
:
|
||||
fPreGeometryCell(preCell),
|
||||
fPostGeometryCell(postCell),
|
||||
fCrossBoundary(false)
|
||||
{}
|
||||
|
||||
G4GeometryCellStep::~G4GeometryCellStep()
|
||||
{}
|
||||
+12
-12
@@ -21,31 +21,31 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PStepStream.cc,v 1.3 2002/04/09 16:23:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4GeometryCellStepStream.cc,v 1.1 2002/10/22 13:18:47 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4PStepStream.cc
|
||||
// G4GeometryCellStepStream.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4PStepStream.hh"
|
||||
#include "G4GeometryCellStepStream.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4PStep.hh"
|
||||
#include "G4GeometryCellStep.hh"
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4PTouchableKey &tk)
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4GeometryCell &tk)
|
||||
{
|
||||
out << "Volume name = " << tk.fVPhysiclaVolume->GetName() << ", ";
|
||||
out << "Replica number = " << tk.fRepNum;
|
||||
out << "Volume name = " << tk.GetPhysicalVolume().GetName() << ", ";
|
||||
out << "Replica number = " << tk.GetReplicaNumber();
|
||||
return out;
|
||||
}
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4PStep &ps)
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4GeometryCellStep &ps)
|
||||
{
|
||||
out << "PreTouchableKey : " << ps.fPreTouchableKey << " ";
|
||||
out << "PostTouchableKey: " << ps.fPostTouchableKey << " ";
|
||||
out << "CrossBoundary : " << ps.fCrossBoundary << "\n";
|
||||
out << "PreGeometryCell : " << ps.GetPreGeometryCell() << " ";
|
||||
out << "PostGeometryCell: " << ps.GetPostGeometryCell() << " ";
|
||||
out << "CrossBoundary : " << ps.GetCrossBoundary() << "\n";
|
||||
return out;
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4IStore.cc,v 1.3 2002/04/09 16:23:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4IStore.cc,v 1.10 2002/11/04 10:43:07 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -33,83 +33,98 @@
|
||||
|
||||
#include "G4IStore.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4PTouchableKey.hh"
|
||||
#include "G4PStepStream.hh"
|
||||
#include "G4GeometryCell.hh"
|
||||
#include "G4GeometryCellStepStream.hh"
|
||||
|
||||
|
||||
G4IStore::G4IStore(G4VPhysicalVolume &worldvolume) :
|
||||
G4VIStore(worldvolume),
|
||||
G4IStore::G4IStore(const G4VPhysicalVolume &worldvolume) :
|
||||
fWorldVolume(worldvolume)
|
||||
{}
|
||||
|
||||
G4IStore::~G4IStore()
|
||||
{}
|
||||
|
||||
G4VPhysicalVolume &G4IStore::GetWorldVolume()
|
||||
const G4VPhysicalVolume &G4IStore::GetWorldVolume() const
|
||||
{
|
||||
return fWorldVolume;
|
||||
}
|
||||
|
||||
void G4IStore::SetInternalIterator(const G4VPhysicalVolume &aVolume,
|
||||
G4int aRepNum) const
|
||||
void G4IStore::SetInternalIterator(const G4GeometryCell &gCell) const
|
||||
{
|
||||
if (!IsInWorld(aVolume)) {
|
||||
Error("SetInternalIterator: physical volume not in this World");
|
||||
}
|
||||
fCurrentIterator = fPtki.find(G4PTouchableKey(aVolume, aRepNum));
|
||||
// if (!IsInWorld(aVolume)) {
|
||||
// Error("SetInternalIterator: physical volume not in this World");
|
||||
// }
|
||||
fCurrentIterator = fGeometryCelli.find(gCell);
|
||||
}
|
||||
|
||||
void G4IStore::AddImportanceRegion(G4double importance,
|
||||
void G4IStore::AddImportanceGeometryCell(G4double importance,
|
||||
const G4GeometryCell &gCell){
|
||||
if (importance < 0 ) {
|
||||
Error("AddImportanceGeometryCell: invalid importance value given");
|
||||
}
|
||||
SetInternalIterator(gCell);
|
||||
if (fCurrentIterator!=fGeometryCelli.end()) {
|
||||
Error("AddImportanceGeometryCell: Region allready exists");
|
||||
}
|
||||
fGeometryCelli[gCell] = importance;
|
||||
}
|
||||
|
||||
void G4IStore::AddImportanceGeometryCell(G4double importance,
|
||||
const G4VPhysicalVolume &aVolume,
|
||||
G4int aRepNum)
|
||||
{
|
||||
if (importance <=0 ) {
|
||||
Error("AddImportanceRegion: invalid importance value given");
|
||||
}
|
||||
SetInternalIterator(aVolume, aRepNum);
|
||||
if (fCurrentIterator!=fPtki.end()) {
|
||||
Error("AddImportanceRegion: Region allready exists");
|
||||
}
|
||||
fPtki[G4PTouchableKey(aVolume, aRepNum)] = importance;
|
||||
AddImportanceGeometryCell(importance,
|
||||
G4GeometryCell(aVolume, aRepNum));
|
||||
}
|
||||
|
||||
void G4IStore::ChangeImportance(G4double importance,
|
||||
const G4GeometryCell &gCell){
|
||||
if (importance < 0 ) {
|
||||
Error("ChangeImportance: Invalid importance value given");
|
||||
}
|
||||
SetInternalIterator(gCell);
|
||||
if (fCurrentIterator==fGeometryCelli.end()) {
|
||||
Error("ChangeImportance: Region does not exist");
|
||||
}
|
||||
fGeometryCelli[gCell] = importance;
|
||||
|
||||
}
|
||||
void G4IStore::ChangeImportance(G4double importance,
|
||||
const G4VPhysicalVolume &aVolume,
|
||||
G4int aRepNum)
|
||||
{
|
||||
if (importance <=0 ) {
|
||||
Error("ChangeImportance: Invalid importance value given");
|
||||
}
|
||||
SetInternalIterator(aVolume, aRepNum);
|
||||
if (fCurrentIterator==fPtki.end()) {
|
||||
Error("ChangeImportance: Region does not exist");
|
||||
}
|
||||
fPtki[G4PTouchableKey(aVolume, aRepNum)] = importance;
|
||||
ChangeImportance(importance, G4GeometryCell(aVolume, aRepNum));
|
||||
}
|
||||
|
||||
G4double G4IStore::GetImportance(const G4VPhysicalVolume &aVolume,
|
||||
G4int aRepNum) const
|
||||
{
|
||||
SetInternalIterator(aVolume, aRepNum);
|
||||
if (fCurrentIterator==fPtki.end()) {
|
||||
SetInternalIterator(G4GeometryCell(aVolume, aRepNum));
|
||||
if (fCurrentIterator==fGeometryCelli.end()) {
|
||||
Error("GetImportance: Region does not exist");
|
||||
}
|
||||
return (*fCurrentIterator).second;
|
||||
}
|
||||
|
||||
|
||||
G4double G4IStore::GetImportance(const G4PTouchableKey &ptk) const
|
||||
G4double G4IStore::GetImportance(const G4GeometryCell &gCell) const
|
||||
{
|
||||
fCurrentIterator = fPtki.find(ptk);
|
||||
if (fCurrentIterator==fPtki.end()) {
|
||||
G4cout << "PTouchableKey ptk: " << ptk << G4endl;
|
||||
SetInternalIterator(gCell);
|
||||
if (fCurrentIterator==fGeometryCelli.end()) {
|
||||
G4cout << "PGeometryCell gCell: " << gCell << G4endl;
|
||||
G4cout << "Not found in: " << G4endl;
|
||||
G4cout << fPtki << G4endl;
|
||||
Error("GetImportance(ptk): Region does not exist");
|
||||
G4cout << fGeometryCelli << G4endl;
|
||||
Error("GetImportance(gCell): Region does not exist");
|
||||
}
|
||||
return (*fCurrentIterator).second;
|
||||
}
|
||||
|
||||
G4bool G4IStore::IsKnown(const G4GeometryCell &gCell) const {
|
||||
SetInternalIterator(gCell);
|
||||
return (fCurrentIterator!=fGeometryCelli.end());
|
||||
}
|
||||
|
||||
|
||||
G4bool G4IStore::IsInWorld(const G4VPhysicalVolume &aVolume) const
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ImportanceAlgorithm.cc,v 1.4 2002/04/09 16:23:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ImportanceAlgorithm.cc,v 1.9 2002/11/04 10:43:07 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -49,59 +49,67 @@ G4ImportanceAlgorithm::~G4ImportanceAlgorithm()
|
||||
}
|
||||
|
||||
G4Nsplit_Weight
|
||||
G4ImportanceAlgorithm::Calculate(G4double ipre_over_ipost,
|
||||
G4ImportanceAlgorithm::Calculate(G4double ipre,
|
||||
G4double ipost,
|
||||
G4double init_w) const
|
||||
{
|
||||
if ((ipre_over_ipost<0.25 || ipre_over_ipost> 4) && !fWorned) {
|
||||
G4std::ostrstream os;
|
||||
os << "Calculate: ipre_over_ipost ! in [0.25, 4]: ipre_over_ipost = "
|
||||
<< ipre_over_ipost << '\0' << G4endl;
|
||||
Warning(os.str());
|
||||
fWorned = true;
|
||||
if (ipre_over_ipost<=0) {
|
||||
Error("Calculate: ipre_over_ipost<=0");
|
||||
G4Nsplit_Weight nw = {0,0};
|
||||
if (ipost>0.){
|
||||
if (!(ipre>0.)){
|
||||
G4Exception("Error: G4ImportanceAlgorithm::Calculate: ipre==0.");
|
||||
}
|
||||
G4double ipre_over_ipost = ipre/ipost;
|
||||
if ((ipre_over_ipost<0.25 || ipre_over_ipost> 4) && !fWorned) {
|
||||
G4std::ostrstream os;
|
||||
os << "Calculate: ipre_over_ipost ! in [0.25, 4]: ipre_over_ipost = "
|
||||
<< ipre_over_ipost << '\0' << G4endl;
|
||||
Warning(os.str());
|
||||
fWorned = true;
|
||||
if (ipre_over_ipost<=0) {
|
||||
Error("Calculate: ipre_over_ipost<=0");
|
||||
}
|
||||
}
|
||||
if (init_w<=0.) {
|
||||
Error("Calculate: iniitweight<= 0. found");
|
||||
}
|
||||
}
|
||||
if (init_w<=0.) {
|
||||
Error("Calculate: iniitweight<= 0. found");
|
||||
}
|
||||
|
||||
// default geometrical splitting
|
||||
// in integer mode
|
||||
// for ipre_over_ipost <= 1
|
||||
G4double inv = 1./ipre_over_ipost;
|
||||
G4Nsplit_Weight nw( (int)inv, init_w * ipre_over_ipost);
|
||||
|
||||
// geometrical splitting for double mode
|
||||
if (ipre_over_ipost<1) {
|
||||
if ( G4double(nw.fN) != inv) {
|
||||
// double mode
|
||||
// probability p for splitting into n+1 tracks
|
||||
G4double p = inv - nw.fN;
|
||||
// default geometrical splitting
|
||||
// in integer mode
|
||||
// for ipre_over_ipost <= 1
|
||||
G4double inv = 1./ipre_over_ipost;
|
||||
nw.fN = static_cast<G4int>(inv);
|
||||
nw.fW = init_w * ipre_over_ipost;
|
||||
|
||||
// geometrical splitting for double mode
|
||||
if (ipre_over_ipost<1) {
|
||||
if ( static_cast<G4double>(nw.fN) != inv) {
|
||||
// double mode
|
||||
// probability p for splitting into n+1 tracks
|
||||
G4double p = inv - nw.fN;
|
||||
// get a random number out of [0,1)
|
||||
G4double r = G4UniformRand();
|
||||
if (r<p) {
|
||||
nw.fN++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ipre_over_ipost > 1
|
||||
// russian roulett
|
||||
else if (ipre_over_ipost>1) {
|
||||
// probabiity for killing track
|
||||
G4double p = 1-inv;
|
||||
// get a random number out of [0,1)
|
||||
G4double r = G4UniformRand();
|
||||
if (r<p) {
|
||||
nw.fN++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ipre_over_ipost > 1
|
||||
// russian roulett
|
||||
else {
|
||||
// probabiity for killing track
|
||||
G4double p = 1-inv;
|
||||
// get a random number out of [0,1)
|
||||
G4double r = G4UniformRand();
|
||||
if (r<p) {
|
||||
// kill track
|
||||
nw.fN = 0;
|
||||
nw.fW = 0;
|
||||
}
|
||||
else {
|
||||
nw.fN = 1;
|
||||
// kill track
|
||||
nw.fN = 0;
|
||||
nw.fW = 0;
|
||||
}
|
||||
else {
|
||||
nw.fN = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nw;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ImportanceFinder.cc,v 1.3 2002/04/09 16:23:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ImportanceFinder.cc,v 1.9 2002/11/04 10:43:07 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "G4VParallelStepper.hh"
|
||||
#include "G4ImportanceFinder.hh"
|
||||
#include "G4VIStore.hh"
|
||||
#include "G4PStepStream.hh"
|
||||
#include "G4GeometryCellStepStream.hh"
|
||||
|
||||
G4ImportanceFinder::G4ImportanceFinder(const G4VIStore &aIStore)
|
||||
: fIStore(aIStore)
|
||||
@@ -45,19 +45,16 @@ G4ImportanceFinder::~G4ImportanceFinder()
|
||||
{}
|
||||
|
||||
G4double
|
||||
G4ImportanceFinder::GetIPre_over_IPost(const G4PTouchableKey &prekey,
|
||||
const G4PTouchableKey &postkey) const
|
||||
G4ImportanceFinder::GetImportance(const G4GeometryCell &gCell) const
|
||||
{
|
||||
G4double ipre = fIStore.GetImportance(prekey);
|
||||
G4double ipost = fIStore.GetImportance(postkey);
|
||||
|
||||
if (ipre <= 0 || ipost <=0 ) {
|
||||
G4double imp = fIStore.GetImportance(gCell);
|
||||
// importances < 0 are not allowed
|
||||
if (imp < 0) {
|
||||
G4std::ostrstream os;
|
||||
os << "ipre <= 0 || ipost <=0, preTouchableKey = " << prekey
|
||||
<< ", postTouchableKey = " << postkey << '\0';
|
||||
os << "imp < 0: GeometryCell = " << gCell << '\0';
|
||||
Error(os.str());
|
||||
}
|
||||
return ipre/ipost;
|
||||
return imp;
|
||||
}
|
||||
|
||||
void G4ImportanceFinder::Error(const G4String &m) const
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ImportanceSplitExaminer.cc,v 1.1 2002/05/31 08:07:47 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ImportanceSplitExaminer.cc,v 1.6 2002/10/22 13:18:47 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -32,7 +32,6 @@
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ImportanceSplitExaminer.hh"
|
||||
#include "G4ImportanceFinder.hh"
|
||||
#include "G4VParallelStepper.hh"
|
||||
#include "G4VImportanceAlgorithm.hh"
|
||||
|
||||
@@ -42,19 +41,19 @@ G4ImportanceSplitExaminer(const G4VImportanceAlgorithm &aIalg,
|
||||
const G4VIStore &istore)
|
||||
: fIalgorithm(aIalg),
|
||||
fPStepper(astepper),
|
||||
fIfinder(*(new G4ImportanceFinder(istore)))
|
||||
fIfinder(istore)
|
||||
{}
|
||||
|
||||
G4ImportanceSplitExaminer::~G4ImportanceSplitExaminer()
|
||||
{
|
||||
delete &fIfinder;
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
G4Nsplit_Weight G4ImportanceSplitExaminer::Examine(G4double w) const
|
||||
{
|
||||
G4PStep pstep = fPStepper.GetPStep();
|
||||
return fIalgorithm.
|
||||
Calculate(fIfinder.GetIPre_over_IPost(pstep.fPreTouchableKey,
|
||||
pstep.fPostTouchableKey),
|
||||
G4GeometryCellStep pstep = fPStepper.GetPStep();
|
||||
G4Nsplit_Weight nw = fIalgorithm.
|
||||
Calculate(fIfinder.GetImportance(pstep.GetPreGeometryCell()),
|
||||
fIfinder.GetImportance(pstep.GetPostGeometryCell()),
|
||||
w);
|
||||
return nw;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Nsplit_Weight.cc,v 1.3 2002/04/09 16:23:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4Nsplit_Weight.cc,v 1.8 2002/12/13 11:54:19 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -30,10 +30,10 @@
|
||||
// G4Nsplit_Weight.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4Nsplit_Weight.hh"
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4Nsplit_Weight &nw)
|
||||
G4std::ostream& operator<<(G4std::ostream &out,
|
||||
const G4Nsplit_Weight &nw)
|
||||
{
|
||||
out << "nw.fN = " << nw.fN << ", nw.fW = " << nw.fW;
|
||||
return out;
|
||||
|
||||
@@ -1,57 +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: G4PMapPtkTallys.cc,v 1.4 2002/04/09 16:23:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4PMapPtkTallys.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4PMapPtkTallys.hh"
|
||||
#include "G4PStepStream.hh"
|
||||
#include "G4Sigma.hh"
|
||||
|
||||
G4std::ostream& operator << (G4std::ostream &out, const G4PMapNameTally &tallys)
|
||||
{
|
||||
for (G4PMapNameTally::const_iterator it = tallys.begin();
|
||||
it != tallys.end(); it++) {
|
||||
out << (*it).first << "\n";
|
||||
out << (*it).second;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
G4std::ostream& operator << (G4std::ostream &out,
|
||||
const G4PMapPtkTallys &tallystore)
|
||||
{
|
||||
for (G4PMapPtkTallys::const_iterator it = tallystore.begin();
|
||||
it != tallystore.end(); it++) {
|
||||
out << (*it).first << "\n";
|
||||
out << (*it).second;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParallelNavigator.cc,v 1.5 2002/05/31 08:07:06 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ParallelNavigator.cc,v 1.14 2002/11/04 10:43:07 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -31,59 +31,63 @@
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "g4std/strstream"
|
||||
|
||||
#include "G4ParallelNavigator.hh"
|
||||
|
||||
#include "G4VTouchable.hh"
|
||||
#include "G4Navigator.hh"
|
||||
#include "G4PTouchableKey.hh"
|
||||
#include "g4std/strstream"
|
||||
#include "G4VParallelStepper.hh"
|
||||
|
||||
|
||||
G4ParallelNavigator::G4ParallelNavigator(G4VPhysicalVolume &aWorldVolume)
|
||||
: fNavigator(*(new G4Navigator)), fNlocated(0)
|
||||
{
|
||||
fNavigator.SetWorldVolume(&aWorldVolume);
|
||||
fCurrentTouchable = fNavigator.CreateTouchableHistory();
|
||||
}
|
||||
:
|
||||
fNlocated(0),
|
||||
fMaxShiftedTrys(10),
|
||||
fCurrentTouchableH((fNavigator.SetWorldVolume(&aWorldVolume),
|
||||
fNavigator.CreateTouchableHistory())),
|
||||
fVerbose(1)
|
||||
{}
|
||||
|
||||
G4ParallelNavigator::~G4ParallelNavigator()
|
||||
{
|
||||
delete fCurrentTouchable;
|
||||
delete &fNavigator;
|
||||
}
|
||||
|
||||
// public functions
|
||||
|
||||
G4PTouchableKey G4ParallelNavigator::
|
||||
G4GeometryCell G4ParallelNavigator::
|
||||
LocateOnBoundary(const G4ThreeVector &aPosition,
|
||||
const G4ThreeVector &aDirection)
|
||||
{
|
||||
Locate(aPosition, aDirection, true);
|
||||
// since the track crosses a boundary ipdate stepper
|
||||
return GetCurrentTouchableKey();
|
||||
{/*
|
||||
fNavigator->SetGeometricallyLimitedStep();
|
||||
fNavigator->
|
||||
LocateGlobalPointAndUpdateTouchableHandle( aPosition,
|
||||
aDirection,
|
||||
fCurrentTouchableH,
|
||||
true);
|
||||
fNlocated++;
|
||||
*/
|
||||
if (fVerbose>=2) {
|
||||
G4cout.precision(12);
|
||||
G4cout << "LOB: " << aPosition << ", " << aDirection << G4endl;
|
||||
}
|
||||
fNavigator.SetGeometricallyLimitedStep();
|
||||
Locate(aPosition, aDirection, true, false);
|
||||
// since the track crosses a boundary ipdate stepper
|
||||
G4GeometryCell g= GetCurrentGeometryCell();
|
||||
return g;
|
||||
}
|
||||
|
||||
G4double G4ParallelNavigator::
|
||||
ComputeStepLengthInit(const G4ThreeVector &aPosition,
|
||||
const G4ThreeVector &aDirection)
|
||||
{
|
||||
G4double newSafety;
|
||||
G4double stepLength;
|
||||
|
||||
// initialization
|
||||
fNlocated = 0;
|
||||
|
||||
// first try
|
||||
Locate(aPosition, aDirection, false);
|
||||
stepLength = fNavigator.ComputeStep( aPosition, aDirection,
|
||||
kInfinity, newSafety);
|
||||
if (stepLength<=0.0) {
|
||||
// second try with schifted position
|
||||
stepLength = ComputeStepLengthShifted("ComputeStepLengthInit",
|
||||
aPosition, aDirection);
|
||||
}
|
||||
return stepLength;
|
||||
if (fVerbose>=2) {
|
||||
G4cout.precision(12);
|
||||
G4cout << "CSInit: " << aPosition << ", " << aDirection << G4endl;
|
||||
}
|
||||
Locate(aPosition, aDirection, false, false);
|
||||
return GetStepLength("ComputeStepLengthInit",
|
||||
aPosition, aDirection);
|
||||
}
|
||||
|
||||
G4double G4ParallelNavigator::
|
||||
@@ -94,26 +98,20 @@ ComputeStepLengthCrossBoundary(const G4ThreeVector &aPosition,
|
||||
Error("ComputeStepLengthCrossBoundary: no location done before call",
|
||||
aPosition, aDirection);
|
||||
}
|
||||
|
||||
// if the track is on boundary the location was done
|
||||
// in the DOIT of the ImportanceSplitExaminer
|
||||
|
||||
G4double newSafety;
|
||||
G4double stepLength = fNavigator.ComputeStep( aPosition, aDirection,
|
||||
kInfinity, newSafety);
|
||||
if (stepLength<=0.) {
|
||||
// second try with schifted position
|
||||
G4cout << "Warning: G4ParallelNavigator::ComputeStepLengthCrossBoundary: "
|
||||
<< G4endl;
|
||||
G4cout << "stepLength<=0." << ", pos = " << aPosition
|
||||
<< ", dir = " << aDirection << G4endl;
|
||||
G4cout << "try ComputeStepLengthShifted" << G4endl;
|
||||
stepLength = ComputeStepLengthShifted("ComputeStepLengthCrossBoundary",
|
||||
aPosition, aDirection);
|
||||
if (fVerbose>=2) {
|
||||
G4cout.precision(12);
|
||||
G4cout << "CSCB: " << aPosition << ", " << aDirection << G4endl;
|
||||
}
|
||||
return stepLength;
|
||||
// if the track is on boundary the LocateOnBoundary was called
|
||||
// in the DOIT of the ParalleTransport
|
||||
|
||||
// but location in volume overcomes a problem with spheres
|
||||
// fNavigator->LocateGlobalPointWithinVolume(aPosition);
|
||||
return GetStepLength("ComputeStepLengthCrossBoundary",
|
||||
aPosition, aDirection);
|
||||
}
|
||||
|
||||
|
||||
G4double G4ParallelNavigator::
|
||||
ComputeStepLengthInVolume(const G4ThreeVector &aPosition,
|
||||
const G4ThreeVector &aDirection)
|
||||
@@ -122,68 +120,140 @@ ComputeStepLengthInVolume(const G4ThreeVector &aPosition,
|
||||
Error("ComputeStepLengthInVolume, no location done before call",
|
||||
aPosition, aDirection);
|
||||
}
|
||||
|
||||
if (fVerbose>=2) {
|
||||
G4cout.precision(12);
|
||||
G4cout << "CSinV: " << aPosition << ", " << aDirection << G4endl;
|
||||
}
|
||||
// if the track is not on the boundary and it's
|
||||
// not the first step, the location must be inside the
|
||||
// volume
|
||||
|
||||
fNavigator.LocateGlobalPointWithinVolume(aPosition);
|
||||
G4double newSafety;
|
||||
G4double stepLength = fNavigator.ComputeStep( aPosition, aDirection,
|
||||
kInfinity, newSafety);
|
||||
if (stepLength<=0.) {
|
||||
// second try with schifted position
|
||||
G4cout << "Warning: G4ParallelNavigator::ComputeStepLengthInVolume: "
|
||||
<< G4endl;
|
||||
G4cout << "stepLength<=0." << ", pos = " << aPosition
|
||||
<< ", dir = " << aDirection << G4endl;
|
||||
G4cout << "try ComputeStepLengthShifted" << G4endl;
|
||||
stepLength = ComputeStepLengthShifted("ComputeStepLengthInVolume",
|
||||
aPosition, aDirection);
|
||||
}
|
||||
return stepLength;
|
||||
// Locate(aPosition, aDirection, true); // reduces stepLength<=0. calls
|
||||
return GetStepLengthUseLocate("ComputeStepLengthInVolume",
|
||||
aPosition, aDirection);
|
||||
}
|
||||
|
||||
// private functions
|
||||
|
||||
void G4ParallelNavigator::Locate(const G4ThreeVector &aPosition,
|
||||
const G4ThreeVector &aDirection,
|
||||
G4bool histsearch)
|
||||
G4bool historysearch,
|
||||
G4bool useDirection)
|
||||
{
|
||||
fNavigator.SetGeometricallyLimitedStep();
|
||||
fNavigator.
|
||||
LocateGlobalPointAndUpdateTouchable( aPosition, aDirection,
|
||||
fCurrentTouchable, histsearch);
|
||||
if (fVerbose>=2) {
|
||||
G4cout.precision(12);
|
||||
G4cout << "Locate: " << aPosition << ", " << aDirection << G4endl;
|
||||
}
|
||||
fNavigator.LocateGlobalPointAndSetup( aPosition,
|
||||
&aDirection,
|
||||
historysearch,
|
||||
!useDirection);
|
||||
fCurrentTouchableH = fNavigator.CreateTouchableHistory();
|
||||
|
||||
fNlocated++;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
G4double G4ParallelNavigator::
|
||||
GetStepLength(const G4String &methodname,
|
||||
const G4ThreeVector &aPosition,
|
||||
const G4ThreeVector &aDirection) {
|
||||
if (fVerbose>=2) {
|
||||
G4cout.precision(12);
|
||||
G4cout << "GetSL: " << aPosition << ", " << aDirection << G4endl;
|
||||
}
|
||||
G4double newSafety = 0.;
|
||||
G4double stepLength = fNavigator.ComputeStep( aPosition,
|
||||
aDirection,
|
||||
kInfinity,
|
||||
newSafety);
|
||||
// if stepLength = 0 try shifting
|
||||
if (stepLength<=2*kCarTolerance) {
|
||||
stepLength =
|
||||
ComputeStepLengthShifted(methodname,
|
||||
aPosition, aDirection);
|
||||
}
|
||||
return stepLength;
|
||||
}
|
||||
|
||||
G4double G4ParallelNavigator::
|
||||
GetStepLengthUseLocate(const G4String &methodname,
|
||||
const G4ThreeVector &aPosition,
|
||||
const G4ThreeVector &aDirection) {
|
||||
if (fVerbose>=2) {
|
||||
G4cout.precision(12);
|
||||
G4cout << "GetSLuseLocate: " << aPosition << ", " << aDirection << G4endl;
|
||||
}
|
||||
G4double newSafety = 0;
|
||||
G4double stepLength = fNavigator.ComputeStep( aPosition, aDirection,
|
||||
kInfinity, newSafety);
|
||||
// if stepLength = 0 try locate
|
||||
if (stepLength<=2*kCarTolerance) {
|
||||
Locate(aPosition, aDirection, true, true);
|
||||
stepLength = GetStepLength(methodname +
|
||||
"form GetStepLengthUseLocate",
|
||||
aPosition,
|
||||
aDirection);
|
||||
}
|
||||
return stepLength;
|
||||
}
|
||||
|
||||
|
||||
G4double
|
||||
G4ParallelNavigator::ComputeStepLengthShifted(const G4String &m,
|
||||
const G4ThreeVector &aPosition,
|
||||
const G4ThreeVector &aDirection)
|
||||
G4ParallelNavigator::
|
||||
ComputeStepLengthShifted(const G4String &m,
|
||||
const G4ThreeVector &aPosition,
|
||||
const G4ThreeVector &aDirection)
|
||||
{
|
||||
if (fVerbose>=1) {
|
||||
G4cout.precision(12);
|
||||
G4cout << "G4ParallelNavigator::ComputeStepLengthShifted: invoked by: "
|
||||
<< m << G4endl;
|
||||
}
|
||||
G4ThreeVector shift_pos(aPosition);
|
||||
shift_pos+=G4ThreeVector(Shift(aDirection.x()),
|
||||
Shift(aDirection.y()),
|
||||
Shift(aDirection.z()));
|
||||
Locate(shift_pos, aDirection, false);
|
||||
G4double newSafety;
|
||||
G4double stepLength = fNavigator.ComputeStep( shift_pos, aDirection,
|
||||
kInfinity, newSafety);
|
||||
if (stepLength<=0.0) {
|
||||
G4std::ostrstream os;
|
||||
os << "ComputeStepLengthShifted: called by " << m << "\n";
|
||||
os << "shifted positio in second try: " << shift_pos << '\0' << G4endl;
|
||||
Error(os.str() , aPosition, aDirection);
|
||||
G4double stepLength = 0.;
|
||||
G4int trys = 0;
|
||||
while (stepLength<=2*kCarTolerance && trys < fMaxShiftedTrys) {
|
||||
if (fVerbose>=1) {
|
||||
G4cout << "G4ParallelNavigator::ComputeStepLengthShifted: trys = "
|
||||
<< ++trys << G4endl;
|
||||
G4cout << "shifted position: " << shift_pos
|
||||
<< ", direction: " << aDirection << G4endl;
|
||||
}
|
||||
Locate(shift_pos, aDirection, true, true); // to get into the correct volume
|
||||
G4double newSafety = 0;
|
||||
fNavigator.LocateGlobalPointWithinVolume(aPosition); // to place at the correct position
|
||||
stepLength = fNavigator.ComputeStep( aPosition, aDirection,
|
||||
kInfinity, newSafety);
|
||||
}
|
||||
if (stepLength<=kCarTolerance) {
|
||||
char st[200];
|
||||
G4std::ostrstream os(st,200);
|
||||
os << "still got stepLength<=kCarTolerance: "
|
||||
<< shift_pos
|
||||
<< "\n"
|
||||
<< '\0';
|
||||
G4String m(st);
|
||||
Error(m, aPosition, aDirection);
|
||||
}
|
||||
return stepLength;
|
||||
}
|
||||
|
||||
G4PTouchableKey G4ParallelNavigator::GetCurrentTouchableKey() const
|
||||
G4GeometryCell G4ParallelNavigator::GetCurrentGeometryCell() const
|
||||
{
|
||||
return G4PTouchableKey(*fCurrentTouchable->GetVolume(),
|
||||
fCurrentTouchable->GetReplicaNumber());
|
||||
return G4GeometryCell(*fCurrentTouchableH->GetVolume(),
|
||||
fCurrentTouchableH->GetReplicaNumber());
|
||||
}
|
||||
|
||||
|
||||
void G4ParallelNavigator::SetVerboseity(G4int v) {
|
||||
fVerbose = v;
|
||||
}
|
||||
|
||||
void G4ParallelNavigator::Error(const G4String &m,
|
||||
@@ -198,7 +268,12 @@ void G4ParallelNavigator::Error(const G4String &m,
|
||||
|
||||
G4double G4ParallelNavigator::Shift(G4double d)
|
||||
{
|
||||
if (d>0) return 2 * kCarTolerance;
|
||||
if (d<0) return -2 * kCarTolerance;
|
||||
return 0.;
|
||||
G4double s=0;
|
||||
if (d>0){
|
||||
s = 2 * kCarTolerance;
|
||||
}
|
||||
else if (d<0) {
|
||||
s = -2 * kCarTolerance;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParallelStepper.cc,v 1.3 2002/04/10 13:13:07 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ParallelStepper.cc,v 1.8 2002/11/04 10:43:07 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -40,42 +40,61 @@ G4ParallelStepper::G4ParallelStepper()
|
||||
|
||||
G4ParallelStepper::~G4ParallelStepper()
|
||||
{
|
||||
if (fPStep) delete fPStep;
|
||||
if (fPStep) {
|
||||
delete fPStep;
|
||||
}
|
||||
}
|
||||
|
||||
G4ParallelStepper::G4ParallelStepper(const G4ParallelStepper &rhs)
|
||||
:
|
||||
fPStep(new G4GeometryCellStep(rhs.GetPStep()))
|
||||
{
|
||||
fPStep = new G4PStep(rhs.GetPStep());
|
||||
if (!fPStep) {
|
||||
Error("G4ParallelStepper:: new failed to create a G4GeometryCellStep!");
|
||||
}
|
||||
}
|
||||
|
||||
G4ParallelStepper &G4ParallelStepper::operator=(const G4ParallelStepper &rhs)
|
||||
{
|
||||
if (this != &rhs) {
|
||||
fPStep = new G4PStep(rhs.GetPStep());
|
||||
fPStep = new G4GeometryCellStep(rhs.GetPStep());
|
||||
if (!fPStep) {
|
||||
Error("operator=: new failed to create a G4GeometryCellStep!");
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void G4ParallelStepper::Init(const G4PTouchableKey &aptk)
|
||||
{
|
||||
if (!fPStep) {
|
||||
fPStep = new G4PStep(aptk, aptk);
|
||||
}
|
||||
else {
|
||||
fPStep->fPreTouchableKey = aptk;
|
||||
fPStep->fPostTouchableKey = aptk;
|
||||
}
|
||||
UnSetCrossBoundary();
|
||||
G4GeometryCellStep G4ParallelStepper::GetPStep() const {
|
||||
G4GeometryCellStep p = *fPStep;
|
||||
return p;
|
||||
}
|
||||
|
||||
void G4ParallelStepper::Update(const G4PTouchableKey &aptk)
|
||||
|
||||
void G4ParallelStepper::Init(const G4GeometryCell &agCell)
|
||||
{
|
||||
if (!fPStep) {
|
||||
fPStep = new G4GeometryCellStep(agCell, agCell);
|
||||
if (!fPStep) {
|
||||
Error("Init new failed to create a G4GeometryCellStep!");
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
fPStep->SetPreGeometryCell(agCell);
|
||||
fPStep->SetPostGeometryCell(agCell);
|
||||
fPStep->SetCrossBoundary(false);
|
||||
}
|
||||
}
|
||||
|
||||
void G4ParallelStepper::Update(const G4GeometryCell &agCell)
|
||||
{
|
||||
if (!fPStep) {
|
||||
Error("fPStep == 0, Init not called?");
|
||||
}
|
||||
fPStep->fPreTouchableKey = fPStep->fPostTouchableKey;
|
||||
fPStep->fPostTouchableKey = aptk;
|
||||
fPStep->fCrossBoundary = true;
|
||||
fPStep->SetPreGeometryCell(fPStep->GetPostGeometryCell());
|
||||
fPStep->SetPostGeometryCell(agCell);
|
||||
fPStep->SetCrossBoundary(true);
|
||||
}
|
||||
|
||||
void G4ParallelStepper::UnSetCrossBoundary()
|
||||
@@ -83,7 +102,7 @@ void G4ParallelStepper::UnSetCrossBoundary()
|
||||
if (!fPStep) {
|
||||
Error("fPStep == 0, Init not called?");
|
||||
}
|
||||
fPStep->fCrossBoundary = false;
|
||||
fPStep->SetCrossBoundary(false);
|
||||
}
|
||||
|
||||
void G4ParallelStepper::Error(const G4String &m)
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParallelWorld.cc,v 1.2 2002/04/09 16:23:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ParallelWorld.cc,v 1.6 2002/11/04 10:43:07 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -37,10 +37,16 @@
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
G4ParallelWorld::G4ParallelWorld(G4VPhysicalVolume &worldvolume)
|
||||
: fWorldVolume(&worldvolume),
|
||||
fPstepper(new G4ParallelStepper),
|
||||
fPdriver(new G4ParallelNavigator(*fWorldVolume))
|
||||
{}
|
||||
: fPstepper(new G4ParallelStepper),
|
||||
fPdriver(new G4ParallelNavigator(worldvolume))
|
||||
{
|
||||
if (!fPstepper) {
|
||||
G4Exception("ERROR: G4ParallelWorld::G4ParallelWorld: new failed to create a G4ParallelStepper");
|
||||
}
|
||||
if (!fPdriver) {
|
||||
G4Exception("ERROR: G4ParallelWorld::G4ParallelWorld: new failed to create a G4ParallelNavigator");
|
||||
}
|
||||
}
|
||||
|
||||
G4ParallelWorld::~G4ParallelWorld()
|
||||
{
|
||||
@@ -48,31 +54,6 @@ G4ParallelWorld::~G4ParallelWorld()
|
||||
delete fPstepper;
|
||||
}
|
||||
|
||||
G4ParallelWorld::G4ParallelWorld(const G4ParallelWorld &rhs)
|
||||
: fWorldVolume(rhs.GetWorldVolume())
|
||||
{
|
||||
fPstepper = new G4ParallelStepper;
|
||||
fPdriver = new G4ParallelNavigator(*fWorldVolume);
|
||||
}
|
||||
|
||||
G4ParallelWorld &G4ParallelWorld::operator=(const G4ParallelWorld &rhs)
|
||||
{
|
||||
if (this!=&rhs) {
|
||||
|
||||
fWorldVolume = rhs.GetWorldVolume();
|
||||
fPstepper = new G4ParallelStepper;
|
||||
fPdriver = new G4ParallelNavigator(*fWorldVolume);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
G4VPhysicalVolume *G4ParallelWorld::GetWorldVolume() const
|
||||
{
|
||||
return fWorldVolume;
|
||||
}
|
||||
|
||||
|
||||
G4VParallelStepper &G4ParallelWorld::GetParallelStepper()
|
||||
{
|
||||
return *fPstepper;
|
||||
|
||||
@@ -1,134 +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.cc,v 1.4 2002/04/09 16:23:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4Sigma.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4Sigma.hh"
|
||||
#include "globals.hh"
|
||||
#include <cstdio>
|
||||
#include <cmath>
|
||||
|
||||
G4Sigma::G4Sigma()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
G4Sigma::~G4Sigma()
|
||||
{}
|
||||
|
||||
void G4Sigma::Init()
|
||||
{
|
||||
fEntries = 0;
|
||||
fMean = 0.;
|
||||
fSigma = -1.;
|
||||
fXsum = 0;
|
||||
fXXsum = 0;
|
||||
fWsum = 0;
|
||||
fWXsum = 0;
|
||||
fWXXsum = 0;
|
||||
fcalc = 0;
|
||||
}
|
||||
|
||||
G4int G4Sigma::Xin(G4double x, G4double w)
|
||||
{
|
||||
if (w<0.) Error("Xin: w < 0");
|
||||
fEntries++;
|
||||
fXsum+=x;
|
||||
fXXsum+=x*x;
|
||||
fWsum += w;
|
||||
fWXsum += w*x;
|
||||
fWXXsum += w*x*x;
|
||||
fcalc = 0;
|
||||
return fEntries;
|
||||
}
|
||||
|
||||
|
||||
|
||||
G4int G4Sigma::GetCalc() const
|
||||
{
|
||||
return fcalc;
|
||||
}
|
||||
|
||||
G4int G4Sigma::Calculate() const
|
||||
{
|
||||
if (fcalc==0) {
|
||||
if(fWsum>0) {
|
||||
fMean=fWXsum/fWsum;
|
||||
fSigma = sqrt( fWXXsum / fWsum - fMean * fMean);
|
||||
fcalc = 1;
|
||||
} else {
|
||||
fcalc = -1;
|
||||
}
|
||||
}
|
||||
return fcalc;
|
||||
}
|
||||
|
||||
G4int G4Sigma::GetEntries() const
|
||||
{
|
||||
return fEntries;
|
||||
}
|
||||
|
||||
G4double G4Sigma::GetMean() const
|
||||
{
|
||||
if (fcalc==0) Calculate();
|
||||
return fMean;
|
||||
}
|
||||
|
||||
G4double G4Sigma::GetSigma() const
|
||||
{
|
||||
if (fcalc==0) Calculate();
|
||||
return fSigma;
|
||||
}
|
||||
|
||||
G4double G4Sigma::GetXsum() const {return fXsum;}
|
||||
G4double G4Sigma::GetXXsum() const {return fXXsum;}
|
||||
G4double G4Sigma::GetSumOfWeights() const {return fWsum;}
|
||||
G4double G4Sigma::GetWeightedXsum() const {return fWXsum;}
|
||||
G4double G4Sigma::GetWeightedXXsum() const {return fWXXsum;}
|
||||
|
||||
void G4Sigma::Error(const G4String &m)
|
||||
{
|
||||
G4cout << "ERROR: G4Sigma::" << m << G4endl;
|
||||
}
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4Sigma &s)
|
||||
{
|
||||
out << "entries : " << s.GetEntries() << "\n";
|
||||
out << "Sum(w) : " << s.GetSumOfWeights()<<"\n";
|
||||
out << "Sum(w*x) : " << s.GetWeightedXsum() << "\n";
|
||||
out << "Sum(w*x*x) : " << s.GetWeightedXXsum() << "\n";
|
||||
out << "mean=Sum(w*x) / Sum(w) : " << s.GetMean() << "\n";
|
||||
out << "sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): " << s.GetSigma() << "\n";
|
||||
out << "Sum(x) : " << s.GetXsum() << "\n";
|
||||
out << "Sum(x^2) : " << s.GetXXsum() << "\n";
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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.cc,v 1.5 2002/12/13 11:54:20 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VCellScorer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VCellScorer.hh"
|
||||
|
||||
G4VCellScorer::G4VCellScorer()
|
||||
{}
|
||||
|
||||
G4VCellScorer::~G4VCellScorer()
|
||||
{}
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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.cc,v 1.3 2002/10/28 09:53:51 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VCellScorerStore.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VCellScorerStore.hh"
|
||||
|
||||
G4VCellScorerStore::G4VCellScorerStore()
|
||||
{}
|
||||
|
||||
G4VCellScorerStore::~G4VCellScorerStore()
|
||||
{}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VGCellFinder.cc,v 1.1 2002/10/16 14:30:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VGCellFinder.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VGCellFinder.hh"
|
||||
|
||||
G4VGCellFinder::G4VGCellFinder()
|
||||
{}
|
||||
G4VGCellFinder::~G4VGCellFinder()
|
||||
{}
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VIStore.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VIStore.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VIStore.hh"
|
||||
|
||||
G4VIStore::G4VIStore()
|
||||
{}
|
||||
|
||||
G4VIStore::~G4VIStore()
|
||||
{}
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VImportanceAlgorithm.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VImportanceAlgortihm.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VImportanceAlgorithm.hh"
|
||||
|
||||
G4VImportanceAlgorithm::G4VImportanceAlgorithm()
|
||||
{}
|
||||
|
||||
G4VImportanceAlgorithm::~G4VImportanceAlgorithm()
|
||||
{}
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VImportanceSplitExaminer.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VImportanceSplitExaminer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VImportanceSplitExaminer.hh"
|
||||
|
||||
G4VImportanceSplitExaminer::G4VImportanceSplitExaminer()
|
||||
{}
|
||||
|
||||
G4VImportanceSplitExaminer::~G4VImportanceSplitExaminer()
|
||||
{}
|
||||
+8
-29
@@ -21,42 +21,21 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Pstring.cc,v 1.2 2002/04/09 16:23:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4VPGeoDriver.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4Pstring.cc
|
||||
// G4VPGeoDriver.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4Pstring.hh"
|
||||
|
||||
G4String str(const int &i)
|
||||
{
|
||||
char s[200];
|
||||
sprintf(s,"%d",i);
|
||||
return s;
|
||||
}
|
||||
|
||||
G4String str(const double &d)
|
||||
{
|
||||
char s[200];
|
||||
sprintf(s,"%f",d);
|
||||
return s;
|
||||
}
|
||||
|
||||
G4String str(const G4ThreeVector &v)
|
||||
{
|
||||
G4String out = "(";
|
||||
out += str(v.x());
|
||||
out += ", ";
|
||||
out += str(v.y());
|
||||
out += ", ";
|
||||
out += str(v.z());
|
||||
out += ")";
|
||||
return out;
|
||||
}
|
||||
#include "G4VPGeoDriver.hh"
|
||||
G4VPGeoDriver::G4VPGeoDriver()
|
||||
{}
|
||||
|
||||
G4VPGeoDriver::~G4VPGeoDriver()
|
||||
{}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VParallelStepper.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VParallelStepper.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VParallelStepper.hh"
|
||||
|
||||
G4VParallelStepper::G4VParallelStepper()
|
||||
{}
|
||||
|
||||
G4VParallelStepper::~G4VParallelStepper()
|
||||
{}
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VScorer.cc,v 1.1 2002/10/28 09:53:51 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VScorer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "G4VScorer.hh"
|
||||
|
||||
G4VScorer::G4VScorer()
|
||||
{}
|
||||
|
||||
G4VScorer::~G4VScorer()
|
||||
{}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VWeightWindowAlgorithm.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VWeightWindowAlgorithm.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VWeightWindowAlgorithm.hh"
|
||||
|
||||
G4VWeightWindowAlgorithm::G4VWeightWindowAlgorithm()
|
||||
{}
|
||||
|
||||
G4VWeightWindowAlgorithm::~G4VWeightWindowAlgorithm()
|
||||
{}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4WeightWindowAlgorithm.cc,v 1.2 2002/05/31 09:56:09 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4WeightWindowAlgorithm.cc,v 1.5 2002/10/16 14:29:07 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -39,6 +39,10 @@ G4WeightWindowAlgorithm::G4WeightWindowAlgorithm() :
|
||||
fLower(1)
|
||||
{}
|
||||
|
||||
G4WeightWindowAlgorithm::~G4WeightWindowAlgorithm()
|
||||
{}
|
||||
|
||||
|
||||
void G4WeightWindowAlgorithm::SetUpperLimit(G4double Upper){
|
||||
fUpper = Upper;
|
||||
}
|
||||
@@ -53,7 +57,7 @@ G4WeightWindowAlgorithm::Calculate(G4double init_w,
|
||||
G4double importance) const {
|
||||
|
||||
|
||||
G4Nsplit_Weight nw(1, init_w);
|
||||
G4Nsplit_Weight nw = {1, init_w};
|
||||
G4double iw = importance * init_w;
|
||||
if (iw>fUpper) {
|
||||
// f is the factor by which the weight is greater
|
||||
@@ -64,9 +68,9 @@ G4WeightWindowAlgorithm::Calculate(G4double init_w,
|
||||
nw.fW/=f;
|
||||
|
||||
// calculate the number of coppies
|
||||
nw.fN = int(f);
|
||||
nw.fN = static_cast<G4int>(f);
|
||||
// correct the number of coppies in case f is not an integer
|
||||
if (G4double(nw.fN) != f) {
|
||||
if (static_cast<G4double>(nw.fN) != f) {
|
||||
// probabillity p for splitting into nw.fN+1 particles
|
||||
G4double p = f - nw.fN;
|
||||
// get a random number out of [0,1)
|
||||
|
||||
Reference in New Issue
Block a user