Import Geant4 5.0.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.4 2002/05/17 07:08:58 gcosmo Exp $
|
||||
# $Id: GNUmakefile,v 1.6 2002/10/16 16:26:57 dressel Exp $
|
||||
# ------------------------------------------------------------
|
||||
# GNUmakefile for transportation library. G.Folger 10-Dec-97.
|
||||
# ------------------------------------------------------------
|
||||
@@ -11,7 +11,8 @@ endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
CPPFLAGS += \
|
||||
-I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/global/HEPRandom/include \
|
||||
-I$(G4BASE)/global/HEPGeometry/include \
|
||||
-I$(G4BASE)/geometry/management/include \
|
||||
@@ -22,7 +23,8 @@ CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/processes/management/include \
|
||||
-I$(G4BASE)/processes/electromagnetic/utils/include \
|
||||
-I$(G4BASE)/particles/management/include \
|
||||
-I$(G4BASE)/materials/include
|
||||
-I$(G4BASE)/materials/include \
|
||||
-I$(G4BASE)/intercoms/include
|
||||
|
||||
ifdef G4DEBUG_TRANSPORT
|
||||
CPPFLAGS += -DG4DEBUG_TRANSPORT
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.38 2002/05/31 14:52:01 dressel Exp $
|
||||
$Id: History,v 1.63 2002/11/20 19:27:39 japost Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,91 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Nov, 20th, J. Apostolakis transport-V04-01-05
|
||||
-------------------------
|
||||
- Tagged.
|
||||
Tag requires: geomvol-V04-01-06 and tracking-V04-01-10
|
||||
and is dependent also on greps-V04-01-01 and track-V04-01-01.
|
||||
|
||||
Nov, 8th, J.Generowicz
|
||||
- Copy auxiliary smooth trajectory point from PIF to ParticleChange
|
||||
|
||||
Nov, 4th 2002 M.Dressel transport-V04-01-04
|
||||
-----------------------------------------------------
|
||||
- remove G4std:: where it does not belong to
|
||||
- replace str() functions
|
||||
|
||||
Oct 31st, 2002 M.Dressel transport-V04-01-03
|
||||
-----------------------------------------------------
|
||||
- bug fix in G4MassGeometrySampler and G4ParallelGeometrySampler
|
||||
|
||||
Oct 28th, 2002 M.Dressel transport-V04-01-02
|
||||
-----------------------------------------------------
|
||||
- bug fix in G4MassGeometry
|
||||
|
||||
Oct 22th, 2002 M.Dressel internal_7_transport-V04-01-01
|
||||
--------------------------------------------------------
|
||||
- moving G4CellStoreScorer, G4TrackLogger
|
||||
to digits+hits/detector
|
||||
- resolving G4SLRawValues
|
||||
|
||||
Oct 16th, 2002 M.Dressel internal_6_transport-V04-01-01
|
||||
--------------------------------------------------------
|
||||
- changes recomanded by codewizrd
|
||||
- added GCellFinder concept
|
||||
|
||||
Oct 10th, 2002 M.Dressel transport-V04-01-01-internal-5
|
||||
--------------------------------------------------------
|
||||
- changing sampler concept: instead of separat samplers for
|
||||
all combinations of importance sampling, scoring, wieght roulette
|
||||
for parallel and mass geometry there are two Samplers now
|
||||
for the mass and parallel geometry: G4MassGeometrySampler
|
||||
and G4ParallelGeometrySampler.
|
||||
- Introduction of Configurators to setup the processes.
|
||||
|
||||
Sep 18th, 2002 M.Dressel transport-V04-01-01-internal-4
|
||||
--------------------------------------------------------
|
||||
- tagging a version before reducing the number of Samplers
|
||||
|
||||
Sep 2th, 2002 M.dressel transport-V04-01-01-internal-3
|
||||
-----------------------------------------
|
||||
code cleanup for code-wizard
|
||||
|
||||
Aug 29th, 2002 M.Dressel int-1-V04-01-01
|
||||
-----------------------------------------
|
||||
- adopted to changes in int-2-geombias-V04-01-01:
|
||||
renaming of G4PTouchableKey to G4GeometryCell
|
||||
changing G4VIStore and G4IStore
|
||||
and dependants
|
||||
|
||||
Aug 13th, 2002 M.Dressel transport-V04-01-01
|
||||
----------------------------------------------
|
||||
- added G4CellStoreScorer, G4VTrackTerminator and changed the sampler
|
||||
classes in order to use the G4VTrackTerminator (if necessary) to
|
||||
kill a track.
|
||||
- coworks with geombias-V04-01-01
|
||||
|
||||
July 18th, 2002 M.Dressel
|
||||
-------------------------
|
||||
- bug fix in G4TrackLogger
|
||||
|
||||
July 11th, 2002 M.Dressel internal-2-transport-V04-01-01
|
||||
--------------------------------------------------------
|
||||
- moved the standard scoring classes to run because
|
||||
they need G4EventManager.
|
||||
|
||||
July 10th, 2002 M.Dressel internal-1-transport-V04-01-01
|
||||
--------------------------------------------------------
|
||||
- add classes for standard scoreing. Remove G4ScorePrinter and G4Scorer.
|
||||
G4StandardScorer and G4StandardScoreTable may be used as replacement.
|
||||
The source file G4StandardScorer.cc may be found in
|
||||
extended/examples/B09/src because it needs to acces the
|
||||
G4EventManager.
|
||||
|
||||
Jun 13, 2002 M.Dressel transport-V04-00-09
|
||||
---------------------------------------------
|
||||
- add classes for creating and printing tallies.
|
||||
|
||||
May 31, 2002 M.Dressel transport-V04-00-08
|
||||
--------------------------------------------------------
|
||||
- made weight window sampling to apply only at inital track step 1.
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ImportancePostStepDoIt.hh,v 1.4 2002/05/31 08:06:34 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ImportancePostStepDoIt.hh,v 1.6 2002/10/16 16:26:58 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ImportancePostStepDoIt
|
||||
@@ -43,13 +43,16 @@ class G4ParticleChange;
|
||||
class G4Track;
|
||||
class G4Step;
|
||||
class G4Nsplit_Weight;
|
||||
class G4VTrackTerminator;
|
||||
|
||||
|
||||
class G4ImportancePostStepDoIt
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4ImportancePostStepDoIt();
|
||||
explicit G4ImportancePostStepDoIt(const G4VTrackTerminator &
|
||||
TrackTerminator);
|
||||
// simply construct
|
||||
|
||||
~G4ImportancePostStepDoIt();
|
||||
@@ -57,15 +60,18 @@ public: // with description
|
||||
|
||||
void DoIt(const G4Track& aTrack,
|
||||
G4ParticleChange *aParticleChange,
|
||||
const G4Nsplit_Weight nw);
|
||||
const G4Nsplit_Weight &nw);
|
||||
// Do the PostStepDoIt part common to importance sampling in the
|
||||
// "mass" and "parallel" geometry.
|
||||
|
||||
private:
|
||||
|
||||
void Split(const G4Track &aTrack,
|
||||
const G4Nsplit_Weight &nw,
|
||||
G4ParticleChange *aParticleChange);
|
||||
|
||||
const G4VTrackTerminator &fTrackTerminator;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#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: G4MImportanceConfigurator.hh,v 1.3 2002/10/22 13:25:55 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4MImportanceConfigurator
|
||||
//
|
||||
// Class description:
|
||||
// This class builds and places the G4ImportanceProcess.
|
||||
// If the object is deleted the process is removed from the
|
||||
// process list.
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4MImportanceConfigurator_hh
|
||||
#define G4MImportanceConfigurator_hh G4MImportanceConfigurator_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4MassImportanceProcess.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
#include "G4VSamplerConfigurator.hh"
|
||||
|
||||
class G4VImportanceAlgorithm;
|
||||
|
||||
class G4MImportanceConfigurator : public G4VSamplerConfigurator{
|
||||
public:
|
||||
G4MImportanceConfigurator(const G4String &particlename,
|
||||
G4VIStore &istore,
|
||||
const G4VImportanceAlgorithm *ialg);
|
||||
|
||||
virtual ~G4MImportanceConfigurator();
|
||||
virtual void Configure(G4VSamplerConfigurator *preConf);
|
||||
virtual const G4VTrackTerminator *GetTrackTerminator() const;
|
||||
|
||||
private:
|
||||
G4MImportanceConfigurator(const G4MImportanceConfigurator &);
|
||||
G4MImportanceConfigurator &
|
||||
operator=(const G4MImportanceConfigurator &);
|
||||
|
||||
G4ProcessPlacer fPlacer;
|
||||
G4VIStore &fIStore;
|
||||
G4bool fDeleteIalg;
|
||||
const G4VImportanceAlgorithm *fIalgorithm;
|
||||
G4MassImportanceProcess *fMassImportanceProcess;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
+28
-36
@@ -21,58 +21,50 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MassScoreSampler.hh,v 1.1 2002/05/31 10:16:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4MScoreConfigurator.hh,v 1.3 2002/10/22 13:25:55 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4MassScoreSampler
|
||||
// Class G4MScoreConfigurator
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A user should use this class to set up scoring in the "mass" geometry.
|
||||
// The user must create an object of this kind and initialise it.
|
||||
// This class builds and places the G4MScoreProcess.
|
||||
// If the object is deleted the process is removed from the
|
||||
// process list.
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4MassScoreSampler_hh
|
||||
#define G4MassScoreSampler_hh G4MassScoreSampler_hh
|
||||
|
||||
#ifndef G4MScoreConfigurator_hh
|
||||
#define G4MScoreConfigurator_hh G4MScoreConfigurator_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VSampler.hh"
|
||||
#include "G4MScoreProcess.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
|
||||
class G4VProcess;
|
||||
class G4VPScorer;
|
||||
class G4MScoreProcess;
|
||||
#include "G4VSamplerConfigurator.hh"
|
||||
|
||||
class G4MassScoreSampler : public G4VSampler
|
||||
{
|
||||
class G4VScorer;
|
||||
class G4VTrackTerminator;
|
||||
|
||||
public: // with description
|
||||
|
||||
G4MassScoreSampler(G4VPScorer &ascorer, const G4String &particlename);
|
||||
// a G4MassScoreSampler for a particle type
|
||||
|
||||
~G4MassScoreSampler();
|
||||
// delete G4MScoreProcess if constructed
|
||||
|
||||
G4MScoreProcess *CreateMassScoreProcess();
|
||||
// create the mass score process
|
||||
// don't use it if you use Initialize()
|
||||
|
||||
void Initialize();
|
||||
// the G4MassScoreSampler has to be initialised after
|
||||
// the initialisation of the G4RunManager !
|
||||
class G4MScoreConfigurator : public G4VSamplerConfigurator{
|
||||
public:
|
||||
G4MScoreConfigurator(const G4String &particlename,
|
||||
G4VScorer &scorer);
|
||||
virtual ~G4MScoreConfigurator();
|
||||
|
||||
virtual void Configure(G4VSamplerConfigurator *preConf);
|
||||
virtual const G4VTrackTerminator *GetTrackTerminator() const;
|
||||
|
||||
|
||||
private:
|
||||
G4MScoreConfigurator(const G4MScoreConfigurator&);
|
||||
G4MScoreConfigurator &operator=(const G4MScoreConfigurator&);
|
||||
|
||||
G4MassScoreSampler(const G4MassScoreSampler &);
|
||||
G4MassScoreSampler &operator=(const G4MassScoreSampler &);
|
||||
|
||||
private:
|
||||
|
||||
G4VPScorer &fScorer;
|
||||
G4String fParticleName;
|
||||
G4ProcessPlacer fPlacer;
|
||||
G4VScorer &fScorer;
|
||||
G4MScoreProcess *fMScoreProcess;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MScoreProcess.hh,v 1.3 2002/04/10 13:14:16 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4MScoreProcess.hh,v 1.7 2002/10/22 13:25:55 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4MScoreProcess
|
||||
@@ -31,7 +31,7 @@
|
||||
//
|
||||
// Used internally by scoring in the "mass" world.
|
||||
// This is a forced post step process messaging a "scorer"
|
||||
// derived from G4VPScorer.
|
||||
// derived from G4VScorer.
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -39,16 +39,18 @@
|
||||
#define G4MScoreProcess_hh G4MScoreProcess_hh
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4VTrackTerminator.hh"
|
||||
|
||||
class G4VPScorer;
|
||||
class G4VScorer;
|
||||
|
||||
class G4MScoreProcess : public G4VProcess, public G4VTrackTerminator
|
||||
|
||||
class G4MScoreProcess : public G4VProcess
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4MScoreProcess(G4VPScorer &aScorer,
|
||||
const G4String &aName = "MScoreProcess");
|
||||
explicit G4MScoreProcess(G4VScorer &aScorer,
|
||||
const G4String &aName = "MScoreProcess");
|
||||
// take reference to scorer and coppy particle name and
|
||||
// create a G4ParticleChange
|
||||
|
||||
@@ -62,37 +64,44 @@ public: // with description
|
||||
// make processed being forced
|
||||
|
||||
virtual G4VParticleChange * PostStepDoIt(const G4Track&, const G4Step&);
|
||||
// message "scorer" with G4Step and a G4PStep from the "mass"
|
||||
// message "scorer" with G4Step and a G4GeometryCellStep from the "mass"
|
||||
// geometry
|
||||
|
||||
virtual void KillTrack() const;
|
||||
|
||||
// to be called by the importance process if the track should
|
||||
// be killed after scoring
|
||||
virtual const G4String &GetName() const ;
|
||||
|
||||
public: // without description
|
||||
|
||||
// no operation in AtRestDoIt and AlongStepDoIt
|
||||
|
||||
G4double
|
||||
virtual G4double
|
||||
AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*) {return -1.0;}
|
||||
G4GPILSelection*);
|
||||
|
||||
G4double
|
||||
virtual G4double
|
||||
AtRestGetPhysicalInteractionLength(const G4Track&,
|
||||
G4ForceCondition*) {return -1.0;}
|
||||
G4ForceCondition*);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(const G4Track&,
|
||||
const G4Step&) {return 0;}
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track&,
|
||||
const G4Step&) {return 0;}
|
||||
virtual G4VParticleChange* AtRestDoIt(const G4Track&,
|
||||
const G4Step&);
|
||||
virtual G4VParticleChange* AlongStepDoIt(const G4Track&,
|
||||
const G4Step&);
|
||||
|
||||
private:
|
||||
|
||||
G4MScoreProcess(const G4MScoreProcess &);
|
||||
G4MScoreProcess &operator=(const G4MScoreProcess &);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
G4VPScorer &fScorer;
|
||||
G4VScorer &fScorer;
|
||||
mutable G4bool fKillTrack;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+16
-32
@@ -21,56 +21,40 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PScorer.hh,v 1.5 2002/04/10 13:14:16 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4MassGCellFinder.hh,v 1.1 2002/10/16 16:27:41 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4PScorer
|
||||
// Class G4ParallelGCellFinder
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A scorer for standard tallies. Under development.
|
||||
// See also G4VPScorer.
|
||||
// It scores using informations form G4Step and G4PStep.
|
||||
// The tallies are contained and related with "cells"
|
||||
// in the container G4PMapPtkTallys (see G4PMapPtkTallys.hh)
|
||||
// Find a G4GeometryCell in the mass geometry.
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4Pscorer_hh
|
||||
#define G4Pscorer_hh G4Pscorer_hh
|
||||
|
||||
#include "g4std/iostream"
|
||||
#ifndef G4MassGCellFinder_hh
|
||||
#define G4MassGCellFinder_hh G4MassGCellFinder_hh
|
||||
|
||||
#include "G4VPScorer.hh"
|
||||
#include "G4PMapPtkTallys.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Step;
|
||||
class G4PStep;
|
||||
#include "G4VGCellFinder.hh"
|
||||
|
||||
class G4PScorer : public G4VPScorer
|
||||
class G4MassGCellFinder : public G4VGCellFinder
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4PScorer();
|
||||
// simple construction
|
||||
G4MassGCellFinder();
|
||||
virtual ~G4MassGCellFinder();
|
||||
|
||||
~G4PScorer();
|
||||
// simple destruction
|
||||
virtual G4GeometryCell
|
||||
GetPreGeometryCell(const G4Step &aStep) const;
|
||||
virtual G4GeometryCell
|
||||
GetPostGeometryCell(const G4Step &aStep) const;
|
||||
|
||||
void Score(const G4Step &aStep, const G4PStep &aPStep);
|
||||
// perform scoring for the G4Step and G4PStep
|
||||
|
||||
const G4PMapPtkTallys &GetMapPtkTallys() const {return fPtkTallys;}
|
||||
// get a reference to the G4PMapPtkTallys containing
|
||||
// the tallies
|
||||
|
||||
private:
|
||||
|
||||
G4PMapPtkTallys fPtkTallys;
|
||||
};
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4PScorer &ps);
|
||||
|
||||
#endif
|
||||
+42
-44
@@ -21,69 +21,67 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MassImportanceSampler.hh,v 1.1 2002/05/31 10:16:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4MassGeometrySampler.hh,v 1.3 2002/10/22 13:25:55 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4MassImportanceSampler
|
||||
// Class G4MassGeometrySampler
|
||||
//
|
||||
// Class description:
|
||||
// This class inherits from G4VSampler. It is used for scoring and
|
||||
// importance smpling in the tracking (mass) geometry.
|
||||
// See also the description in G4VSampler.hh.
|
||||
//
|
||||
// A user should use this class to set up importance sampling
|
||||
// in the "mass" geometry.
|
||||
// The user must create an object of this kind and initialise it.
|
||||
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4MassImportanceSampler_hh
|
||||
#define G4MassImportanceSampler_hh G4MassImportanceSampler_hh
|
||||
#ifndef G4MassGeometrySampler_hh
|
||||
#define G4MassGeometrySampler_hh G4MassGeometrySampler_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VSampler.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4VSamplerConfigurator.hh"
|
||||
|
||||
class G4VIStore;
|
||||
class G4MassImportanceProcess;
|
||||
class G4VImportanceAlgorithm;
|
||||
class G4VProcess;
|
||||
class G4MImportanceConfigurator;
|
||||
class G4MScoreConfigurator;
|
||||
class G4WeightCutOffConfigurator;
|
||||
class G4VGCellFinder;
|
||||
|
||||
class G4MassImportanceSampler : public G4VSampler
|
||||
{
|
||||
class G4MassGeometrySampler : public G4VSampler{
|
||||
|
||||
public: // with description
|
||||
public:
|
||||
|
||||
explicit G4MassGeometrySampler(const G4String &particlename);
|
||||
virtual ~G4MassGeometrySampler();
|
||||
|
||||
G4MassImportanceSampler(G4VIStore &aIstore,
|
||||
const G4String &particlename,
|
||||
const G4VImportanceAlgorithm *algorithm = 0);
|
||||
// if *algorithm = 0: use the G4ImportanceAlgorithm
|
||||
// else: use a customised importance algorithm derived from
|
||||
// G4VImportanceAlgorithm
|
||||
|
||||
~G4MassImportanceSampler();
|
||||
// delete G4MassImportanceProcess and G4VImportanceAlgorithm
|
||||
// if constructed by this object
|
||||
|
||||
G4MassImportanceProcess *CreateMassImportanceProcess();
|
||||
// create the mass importance process
|
||||
// don't use it if you use Initialize()
|
||||
|
||||
void Initialize();
|
||||
// the G4MassImportanceSampler has to be initialised after
|
||||
// the initialisation of the G4RunManager !
|
||||
virtual void PrepareScoring(G4VScorer *Scorer);
|
||||
virtual void PrepareImportanceSampling(G4VIStore *istore,
|
||||
const G4VImportanceAlgorithm
|
||||
*ialg);
|
||||
virtual void PrepareWeightRoulett(G4double wsurvive,
|
||||
G4double wlimit,
|
||||
G4double isource);
|
||||
|
||||
virtual void Configure();
|
||||
|
||||
virtual void ClearSampling();
|
||||
virtual G4bool IsConfigured() const;
|
||||
|
||||
private:
|
||||
|
||||
G4MassImportanceSampler(const G4MassImportanceSampler &);
|
||||
G4MassImportanceSampler &operator=(const G4MassImportanceSampler &);
|
||||
G4MassGeometrySampler(const G4MassGeometrySampler &);
|
||||
G4MassGeometrySampler &
|
||||
operator=(const G4MassGeometrySampler &);
|
||||
|
||||
private:
|
||||
|
||||
G4VIStore &fIStore;
|
||||
G4String fParticleName;
|
||||
G4MassImportanceProcess *fMassImportanceProcess;
|
||||
G4bool fCreatedAlgorithm;
|
||||
const G4VImportanceAlgorithm *fAlgorithm;
|
||||
G4MImportanceConfigurator *fMImportanceConfigurator;
|
||||
G4MScoreConfigurator *fMScoreConfigurator;
|
||||
G4VGCellFinder *fGCellFinder;
|
||||
G4WeightCutOffConfigurator *fWeightCutOffConfigurator;
|
||||
G4VIStore *fIStore;
|
||||
G4bool fIsConfigured;
|
||||
G4Configurators fConfigurators;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MassImportanceProcess.hh,v 1.3 2002/04/10 13:14:16 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4MassImportanceProcess.hh,v 1.6 2002/10/16 16:26:58 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4MassImportanceProcess
|
||||
@@ -41,22 +41,24 @@
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4ImportancePostStepDoIt.hh"
|
||||
#include "G4VTrackTerminator.hh"
|
||||
#include "G4ImportanceFinder.hh"
|
||||
|
||||
class G4VImportanceAlgorithm;
|
||||
class G4ImportanceFinder;
|
||||
class G4VIStore;
|
||||
|
||||
class G4MassImportanceProcess : public G4VProcess
|
||||
class G4MassImportanceProcess : public G4VProcess, public G4VTrackTerminator
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4MassImportanceProcess(const G4VImportanceAlgorithm &aImportanceAlgorithm,
|
||||
const G4VIStore &aIstore,
|
||||
const G4VTrackTerminator *TrackTerminator,
|
||||
const G4String &aName = "MassImportanceProcess");
|
||||
// creates a G4ParticleChange
|
||||
|
||||
~G4MassImportanceProcess();
|
||||
virtual ~G4MassImportanceProcess();
|
||||
// delete the G4ParticleChange
|
||||
|
||||
virtual G4double
|
||||
@@ -67,33 +69,45 @@ public: // with description
|
||||
virtual G4VParticleChange *PostStepDoIt(const G4Track&, const G4Step&);
|
||||
// manage the importance sampling in the "mass" geometry
|
||||
|
||||
virtual void KillTrack() const;
|
||||
// used in case no scoring process follows that does the killing
|
||||
|
||||
virtual const G4String &GetName() const;
|
||||
|
||||
|
||||
public: // without description
|
||||
|
||||
// no operation in AtRestDoIt and AlongStepDoIt
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
virtual G4double
|
||||
AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*) {return -1.0;}
|
||||
G4GPILSelection*);
|
||||
virtual G4double
|
||||
AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*);
|
||||
|
||||
G4double AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*) {return -1.0;}
|
||||
|
||||
G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) {return 0;}
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) {return 0;}
|
||||
virtual G4VParticleChange*
|
||||
AtRestDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
|
||||
virtual G4VParticleChange*
|
||||
AlongStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
G4MassImportanceProcess(const G4MassImportanceProcess &);
|
||||
G4MassImportanceProcess &operator=(const G4MassImportanceProcess &);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
G4ParticleChange *fParticleChange;
|
||||
G4ImportancePostStepDoIt fImportancePostStepDoIt;
|
||||
const G4VTrackTerminator *fTrackTerminator;
|
||||
const G4VImportanceAlgorithm &fImportanceAlgorithm;
|
||||
G4ImportanceFinder *fImportanceFinder;
|
||||
G4ImportanceFinder fImportanceFinder;
|
||||
G4ImportancePostStepDoIt fImportancePostStepDoIt;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,95 +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: G4PIScorer.hh,v 1.5 2002/04/10 13:14:16 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4PIScorer
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A scorer delegating the scoring to G4PScorer. It performs
|
||||
// a check for consistency between the importance value
|
||||
// assigned to a post G4PTouchableKey and the weight of a track.
|
||||
// The relation should be importance value * weight = 1.
|
||||
// CAUTION: This holds only in well defined situations:
|
||||
// A track starts in a "cell" with importance 1 and has a weight of 1.
|
||||
// The particle can not be produced by other not importance sampled
|
||||
// particles.
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4PIScorer_hh
|
||||
#define G4PIScorer_hh G4PIScorer_hh
|
||||
|
||||
#include "g4std/iostream"
|
||||
|
||||
#include "G4VPScorer.hh"
|
||||
#include "G4PMapPtkTallys.hh"
|
||||
#include "G4PScorer.hh"
|
||||
|
||||
class G4Step;
|
||||
class G4PStep;
|
||||
class G4VIStore;
|
||||
|
||||
class G4PIScorer : public G4VPScorer
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4PIScorer(const G4VIStore &IStore);
|
||||
// simple construction
|
||||
|
||||
~G4PIScorer();
|
||||
// simple destruction
|
||||
|
||||
void Score(const G4Step &aStep, const G4PStep &aPStep);
|
||||
// perform scoring for the G4Step and G4PStep
|
||||
|
||||
const G4PMapPtkTallys &GetMapPtkTallys() const
|
||||
{return fPScorer.GetMapPtkTallys();}
|
||||
// get a reference to the G4PMapPtkTallys containing
|
||||
// the tallies
|
||||
|
||||
G4bool CorrectWeight() const {return fCorrectWeight;}
|
||||
// returns false if the weight was not correct
|
||||
// a user might want to get this information
|
||||
// to mark the event a incorrect weight occurred
|
||||
|
||||
void ResetCorrectWeight() {fCorrectWeight = true;}
|
||||
// reset fCorrectWeight
|
||||
// the user has to reset the flag fCorrectWeight
|
||||
// if he wants to use CorrectWeight()
|
||||
|
||||
private:
|
||||
|
||||
const G4VIStore &fIStore;
|
||||
G4PScorer fPScorer;
|
||||
G4int fNerr;
|
||||
G4bool fCorrectWeight;
|
||||
};
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4PIScorer &ps);
|
||||
|
||||
#endif
|
||||
+34
-44
@@ -21,65 +21,55 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MassImportanceScoreSampler.hh,v 1.1 2002/05/31 10:16:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4PImportanceConfigurator.hh,v 1.3 2002/10/22 13:25:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4MassImportanceScoreSampler
|
||||
// Class G4PImportanceConfigurator
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A user should use this class to set up importance sampling and scoring
|
||||
// in the "mass" geometry.
|
||||
// The user must create an object of this kind and initialise it.
|
||||
|
||||
// This class builds and places the G4PImportanceProcess
|
||||
// If the object is deleted the process is removed from the
|
||||
// process list.
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4MassImportanceScoreSampler_hh
|
||||
#define G4MassImportanceScoreSampler_hh G4MassImportanceScoreSampler_hh
|
||||
|
||||
#ifndef G4PImportanceConfigurator_hh
|
||||
#define G4PImportanceConfigurator_hh G4PImportanceConfigurator_hh
|
||||
|
||||
#include "G4VSamplerConfigurator.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VSampler.hh"
|
||||
#include "G4ImportanceSplitExaminer.hh"
|
||||
#include "G4ParallelImportanceProcess.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
|
||||
class G4VIStore;
|
||||
class G4VPScorer;
|
||||
class G4ParallelWorld;
|
||||
class G4VImportanceAlgorithm;
|
||||
class G4MassImportanceSampler;
|
||||
class G4MassScoreSampler;
|
||||
|
||||
class G4MassImportanceScoreSampler : public G4VSampler
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4MassImportanceScoreSampler(G4VIStore &aIstore,
|
||||
G4VPScorer &ascorer,
|
||||
const G4String &particlename,
|
||||
const G4VImportanceAlgorithm
|
||||
*algorithm = 0);
|
||||
// if *algorithm = 0: use the G4ImportanceAlgorithm
|
||||
// else : use a customised importance algorithm derived from
|
||||
// G4VImportanceAlgorithm
|
||||
class G4PImportanceConfigurator : public G4VSamplerConfigurator {
|
||||
public:
|
||||
G4PImportanceConfigurator(const G4String &particlename,
|
||||
G4ParallelWorld ¶llelWorld,
|
||||
G4VIStore &istore,
|
||||
const G4VImportanceAlgorithm *ialg);
|
||||
virtual ~G4PImportanceConfigurator();
|
||||
virtual void Configure(G4VSamplerConfigurator *preConf);
|
||||
virtual const G4VTrackTerminator *GetTrackTerminator() const;
|
||||
|
||||
|
||||
~G4MassImportanceScoreSampler();
|
||||
// delete G4MassScoreSampler and G4MassImportanceSampler if created
|
||||
|
||||
void Initialize();
|
||||
// the G4MassImportanceScoreSampler has to be initialised after
|
||||
// the initialisation of the G4RunManager !
|
||||
|
||||
private:
|
||||
|
||||
G4MassImportanceScoreSampler(const G4MassImportanceScoreSampler &);
|
||||
G4MassImportanceScoreSampler &
|
||||
operator=(const G4MassImportanceScoreSampler &);
|
||||
|
||||
private:
|
||||
|
||||
G4MassImportanceSampler *fMassImportanceSampler;
|
||||
G4MassScoreSampler *fMassScoreSampler;
|
||||
G4PImportanceConfigurator(const G4PImportanceConfigurator &);
|
||||
G4PImportanceConfigurator &
|
||||
operator=(const G4PImportanceConfigurator &);
|
||||
G4ProcessPlacer fPlacer;
|
||||
G4ParallelWorld &fPWorld;
|
||||
G4bool fDeleteIalg;
|
||||
const G4VImportanceAlgorithm *fIalgorithm;
|
||||
G4ImportanceSplitExaminer fExaminer;
|
||||
G4ParallelImportanceProcess *fParallelImportanceProcess;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,99 +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: G4PImportanceWWindowScoreSampler.hh,v 1.1 2002/05/31 10:16:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4PImportanceWWindowScoreSampler
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This class manages the importance sampling and importance weight window
|
||||
// sampling together with scoring in a parallel geometry.
|
||||
// The user must create an object of this kind and initialise it.
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4PImportanceWWindowScoreSampler_hh
|
||||
#define G4PImportanceWWindowScoreSampler_hh G4PImportanceWWindowScoreSampler_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VSampler.hh"
|
||||
|
||||
class G4VIStore;
|
||||
class G4VPScorer;
|
||||
class G4VImportanceAlgorithm;
|
||||
class G4PScoreProcess;
|
||||
class G4ParallelWorld;
|
||||
class G4ParallelImportanceSampler;
|
||||
class G4VProcess;
|
||||
class G4VWeightWindowAlgorithm;
|
||||
|
||||
class G4PImportanceWWindowScoreSampler :
|
||||
public G4VSampler
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4PImportanceWWindowScoreSampler(G4VIStore &iw,
|
||||
G4VPScorer &ascorer,
|
||||
const G4String &particlename,
|
||||
G4VWeightWindowAlgorithm &wwalg,
|
||||
const G4VImportanceAlgorithm *ialg = 0);
|
||||
// if *ialg = 0: use G4ImportanceAlgorithm
|
||||
// use a customised importance algorithm derived from
|
||||
// G4VImportanceAlgorithm
|
||||
|
||||
|
||||
~G4PImportanceWWindowScoreSampler();
|
||||
// delete constructed objects
|
||||
|
||||
G4PScoreProcess *CreateParallelScoreProcess();
|
||||
// create the parallel score process
|
||||
// don't use it if you use Initialize()
|
||||
|
||||
G4VProcess *CreateWeightWindowProcess();
|
||||
|
||||
void Initialize();
|
||||
// the G4MassImportanceScoreSampler has to be initialised after
|
||||
// the initialisation of the G4RunManager !
|
||||
|
||||
private:
|
||||
|
||||
G4PImportanceWWindowScoreSampler(const G4PImportanceWWindowScoreSampler &);
|
||||
G4PImportanceWWindowScoreSampler &
|
||||
operator=(const G4PImportanceWWindowScoreSampler &);
|
||||
|
||||
private:
|
||||
G4String fParticleName;
|
||||
G4ParallelWorld &fParallelWorld;
|
||||
G4ParallelImportanceSampler &fParallelImportanceSampler;
|
||||
G4VPScorer &fPScorer;
|
||||
G4VIStore &fIstore;
|
||||
G4PScoreProcess *fPScoreProcess;
|
||||
G4VProcess *fPWeightWindowProcess;
|
||||
G4VWeightWindowAlgorithm &fWWAlgorithm;
|
||||
};
|
||||
|
||||
#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: G4PScoreConfigurator.hh,v 1.3 2002/10/22 13:25:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4PScoreConfigurator
|
||||
//
|
||||
// Class description:
|
||||
// This class builds and places the G4PScoreProcess
|
||||
// If the object is deleted the process is removed from the
|
||||
// process list.
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4PScoreConfigurator_hh
|
||||
#define G4PScoreConfigurator_hh G4PScoreConfigurator_hh
|
||||
|
||||
#include "G4VSamplerConfigurator.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4PScoreProcess.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
|
||||
class G4VParallelStepper;
|
||||
class G4VScorer;
|
||||
class G4VTrackTerminator;
|
||||
|
||||
class G4PScoreConfigurator : public G4VSamplerConfigurator{
|
||||
public:
|
||||
G4PScoreConfigurator(const G4String &particlename,
|
||||
G4VParallelStepper &pstepper,
|
||||
G4VScorer &scorer);
|
||||
virtual ~G4PScoreConfigurator();
|
||||
|
||||
virtual void Configure(G4VSamplerConfigurator *preConf);
|
||||
virtual const G4VTrackTerminator *GetTrackTerminator() const;
|
||||
|
||||
private:
|
||||
G4PScoreConfigurator(const G4PScoreConfigurator &);
|
||||
G4PScoreConfigurator &operator=(const G4PScoreConfigurator &);
|
||||
G4ProcessPlacer fPlacer;
|
||||
G4VParallelStepper &fPStepper;
|
||||
G4VScorer &fScorer;
|
||||
G4PScoreProcess *fPScoreProcess;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PScoreProcess.hh,v 1.3 2002/04/10 13:14:16 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4PScoreProcess.hh,v 1.7 2002/10/22 13:25:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4PIScoreProcess
|
||||
@@ -30,8 +30,8 @@
|
||||
// Class description:
|
||||
//
|
||||
// Used internally by scoring in a "parallel" geometry.
|
||||
// This forced process messages a "scorer" derived from G4VPScorer.
|
||||
// The scorer is messaged with the current G4Step and G4PStep.
|
||||
// This forced process messages a "scorer" derived from G4VScorer.
|
||||
// The scorer is messaged with the current G4Step and G4GeometryCellStep.
|
||||
// This post step process is supposed to be placed as the
|
||||
// process following directly after transportation and the
|
||||
// importance sampling process if applied and before all physical
|
||||
@@ -43,17 +43,19 @@
|
||||
#define G4PScoreProcess_hh G4PScoreProcess_hh
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4VTrackTerminator.hh"
|
||||
|
||||
class G4VParallelStepper;
|
||||
class G4VPScorer;
|
||||
class G4VScorer;
|
||||
|
||||
class G4PScoreProcess : public G4VProcess
|
||||
class G4PScoreProcess : public G4VProcess,
|
||||
public G4VTrackTerminator
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4PScoreProcess(G4VParallelStepper &astepper,
|
||||
G4VPScorer &aScorer,
|
||||
G4VScorer &aScorer,
|
||||
const G4String &aName = "PScoreProcess");
|
||||
// create a G4ParticleChange
|
||||
|
||||
@@ -67,24 +69,32 @@ public: // with description
|
||||
// make the process beeing forced
|
||||
|
||||
virtual G4VParticleChange * PostStepDoIt(const G4Track&,
|
||||
const G4Step&);
|
||||
// get G4PStep and G4Step and message "scorer"
|
||||
|
||||
const G4Step&);
|
||||
// get G4GeometryCellStep and G4Step and message "scorer"
|
||||
|
||||
virtual void KillTrack() const;
|
||||
|
||||
virtual const G4String &GetName() const;
|
||||
|
||||
// to be called by the importance process if the track should
|
||||
// be killed after scoring
|
||||
|
||||
public: // without description
|
||||
|
||||
// no operation in AtRestDoIt and AlongStepDoIt
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*) {return -1.0;}
|
||||
|
||||
G4double AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*) {return -1.0;}
|
||||
virtual G4double
|
||||
AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) {return 0;}
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) {return 0;}
|
||||
virtual G4double AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*);
|
||||
|
||||
virtual G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&);
|
||||
virtual G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
private:
|
||||
|
||||
@@ -92,7 +102,9 @@ private:
|
||||
G4PScoreProcess &operator=(const G4PScoreProcess &);
|
||||
|
||||
G4VParallelStepper &fPstepper;
|
||||
G4VPScorer &fScorer;
|
||||
G4VScorer &fScorer;
|
||||
|
||||
mutable G4bool fKillTrack;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParallelGCellFinder.hh,v 1.1 2002/10/16 16:27:41 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ParallelGCellFinder
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Find a G4GeometryCell in the parallel geometry.
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4ParallelGCellFinder_hh
|
||||
#define G4ParallelGCellFinder_hh G4ParallelGCellFinder_hh
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
#include "G4VGCellFinder.hh"
|
||||
|
||||
class G4VParallelStepper;
|
||||
class G4ParallelGCellFinder : public G4VGCellFinder
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
explicit G4ParallelGCellFinder(const G4VParallelStepper &astepper);
|
||||
virtual ~G4ParallelGCellFinder();
|
||||
|
||||
virtual G4GeometryCell
|
||||
GetPreGeometryCell(const G4Step &aStep) const;
|
||||
virtual G4GeometryCell
|
||||
GetPostGeometryCell(const G4Step &aStep) const;
|
||||
|
||||
private:
|
||||
const G4VParallelStepper &fPStepper;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
+52
-45
@@ -21,72 +21,79 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParallelImportanceScoreSampler.hh,v 1.1 2002/05/31 10:16:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ParallelGeometrySampler.hh,v 1.3 2002/10/22 13:25:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ParallelImportanceScoreSampler
|
||||
// Class G4ParallelGeometrySampler
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A user should use this class to set up importance sampling and scoring
|
||||
// in a "parallel" geometry.
|
||||
// The user must create an object of this kind and initialise it.
|
||||
// Class description:
|
||||
// This class inherits from G4VSampler. It is used for scoring and
|
||||
// importance smpling in a parallel geometry.
|
||||
// See also the description in G4VSampler.hh.
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4ParallelImportanceScoreSampler_hh
|
||||
#define G4ParallelImportanceScoreSampler_hh G4ParallelImportanceScoreSampler_hh
|
||||
#ifndef G4ParallelGeometrySampler_hh
|
||||
#define G4ParallelGeometrySampler_hh G4ParallelGeometrySampler_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VSampler.hh"
|
||||
|
||||
class G4VIStore;
|
||||
class G4VPScorer;
|
||||
class G4VImportanceAlgorithm;
|
||||
class G4PScoreProcess;
|
||||
class G4ParallelWorld;
|
||||
class G4ParallelImportanceSampler;
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ParallelImportanceScoreSampler :
|
||||
public G4VSampler
|
||||
{
|
||||
#include "G4ParallelWorld.hh"
|
||||
|
||||
public: // with description
|
||||
#include "G4VSamplerConfigurator.hh"
|
||||
|
||||
class G4ParallelTransportConfigurator;
|
||||
class G4PScoreConfigurator;
|
||||
class G4PImportanceConfigurator;
|
||||
class G4WeightCutOffConfigurator;
|
||||
class G4VGCellFinder;
|
||||
|
||||
class G4ParallelGeometrySampler : public G4VSampler{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
G4ParallelImportanceScoreSampler(G4VIStore &iw,
|
||||
G4VPScorer &ascorer,
|
||||
const G4String &particlename,
|
||||
const G4VImportanceAlgorithm *ialg = 0);
|
||||
// if *ialg = 0: use G4ImportanceAlgorithm,
|
||||
// use a customised importance algorithm derived from
|
||||
// G4VImportanceAlgorithm
|
||||
G4ParallelGeometrySampler(G4VPhysicalVolume &worldvolume,
|
||||
const G4String &particlename);
|
||||
virtual ~G4ParallelGeometrySampler();
|
||||
|
||||
virtual void PrepareScoring(G4VScorer *Scorer);
|
||||
virtual void PrepareImportanceSampling(G4VIStore *istore,
|
||||
const G4VImportanceAlgorithm
|
||||
*ialg);
|
||||
virtual void PrepareWeightRoulett(G4double wsurvive,
|
||||
G4double wlimit,
|
||||
G4double isource);
|
||||
|
||||
virtual void Configure();
|
||||
|
||||
~G4ParallelImportanceScoreSampler();
|
||||
// delete constructed objects
|
||||
|
||||
G4PScoreProcess *CreateParallelScoreProcess();
|
||||
// create the parallel score process
|
||||
// don't use it if you use Initialize()
|
||||
|
||||
void Initialize();
|
||||
// the G4MassImportanceScoreSampler has to be initialised after
|
||||
// the initialisation of the G4RunManager !
|
||||
|
||||
virtual void ClearSampling();
|
||||
virtual G4bool IsConfigured() const;
|
||||
|
||||
private:
|
||||
|
||||
G4ParallelImportanceScoreSampler(const G4ParallelImportanceScoreSampler &);
|
||||
G4ParallelImportanceScoreSampler &
|
||||
operator=(const G4ParallelImportanceScoreSampler &);
|
||||
G4ParallelGeometrySampler(const G4ParallelGeometrySampler &);
|
||||
G4ParallelGeometrySampler &
|
||||
operator=(const G4ParallelGeometrySampler &);
|
||||
|
||||
private:
|
||||
G4String fParticleName;
|
||||
G4ParallelWorld &fParallelWorld;
|
||||
G4ParallelImportanceSampler &fParallelImportanceSampler;
|
||||
G4VPScorer &fPScorer;
|
||||
G4PScoreProcess *fPScoreProcess;
|
||||
G4ParallelWorld fParallelWorld;
|
||||
G4ParallelTransportConfigurator *fParallelTransportConfigurator;
|
||||
G4PImportanceConfigurator *fPImportanceConfigurator;
|
||||
G4PScoreConfigurator *fPScoreConfigurator;
|
||||
G4VGCellFinder *fGCellFinder;
|
||||
G4WeightCutOffConfigurator *fWeightCutOffConfigurator;
|
||||
G4VIStore *fIStore;
|
||||
G4bool fIsConfigured;
|
||||
G4Configurators fConfigurators;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParallelImportanceProcess.hh,v 1.5 2002/05/31 10:16:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ParallelImportanceProcess.hh,v 1.8 2002/10/16 16:26:58 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ParallelImportanceProcess
|
||||
@@ -40,11 +40,12 @@
|
||||
|
||||
#include "G4ParallelTransport.hh"
|
||||
#include "G4ImportancePostStepDoIt.hh"
|
||||
#include "G4VTrackTerminator.hh"
|
||||
|
||||
class G4VImportanceSplitExaminer;
|
||||
class G4Nsplit_Weight;
|
||||
|
||||
class G4ParallelImportanceProcess : public G4ParallelTransport
|
||||
class G4ParallelImportanceProcess : public G4ParallelTransport, public G4VTrackTerminator
|
||||
{
|
||||
|
||||
public: // with description
|
||||
@@ -52,25 +53,39 @@ public: // with description
|
||||
G4ParallelImportanceProcess(const G4VImportanceSplitExaminer &aImportanceSplitExaminer,
|
||||
G4VPGeoDriver &pgeodriver,
|
||||
G4VParallelStepper &aStepper,
|
||||
const G4VTrackTerminator *TrackTerminator,
|
||||
const G4String &aName = "ParallelImportanceProcess");
|
||||
// initialise G4ParallelTransport and members
|
||||
|
||||
G4VParticleChange *PostStepDoIt(const G4Track&,
|
||||
const G4Step&);
|
||||
virtual ~G4ParallelImportanceProcess();
|
||||
|
||||
virtual G4VParticleChange *PostStepDoIt(const G4Track&,
|
||||
const G4Step&);
|
||||
// do the "parallel transport" and importance sampling.
|
||||
|
||||
virtual void KillTrack() const;
|
||||
// used in case no scoring process follows that does the killing
|
||||
|
||||
virtual const G4String &GetName() const;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
G4ParallelImportanceProcess(const G4ParallelImportanceProcess &);
|
||||
G4ParallelImportanceProcess &operator=(const G4ParallelImportanceProcess &);
|
||||
|
||||
void Error(const G4String &m);
|
||||
virtual void Error(const G4String &m);
|
||||
|
||||
private:
|
||||
|
||||
const G4VTrackTerminator *fTrackTerminator;
|
||||
G4ParticleChange *fParticleChange;
|
||||
const G4VImportanceSplitExaminer &fImportanceSplitExaminer;
|
||||
G4ImportancePostStepDoIt fImportancePostStepDoIt;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,104 +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: G4ParallelImportanceSampler.hh,v 1.1 2002/05/31 10:16:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ParallelImportanceSampler
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A user should use this class to set up importance sampling
|
||||
// in a "parallel" geometry.
|
||||
// The user must create an object of this kind and initialise it.
|
||||
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4ParallelImportanceSampler_hh
|
||||
#define G4ParallelImportanceSampler_hh G4ParallelImportanceSampler_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VSampler.hh"
|
||||
|
||||
class G4ParallelWorld;
|
||||
class G4VIStore;
|
||||
class G4VImportanceAlgorithm;
|
||||
class G4VImportanceSplitExaminer;
|
||||
class G4ParallelImportanceProcess;
|
||||
|
||||
class G4ParallelImportanceSampler : public G4VSampler
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4ParallelImportanceSampler(G4VIStore &is,
|
||||
const G4String &particlename,
|
||||
const G4VImportanceAlgorithm *ialg = 0);
|
||||
// if *ialg = 0: use the G4ImportanceAlgorithm
|
||||
// use a customised importance algorithm derived from
|
||||
// G4VImportanceAlgorithm
|
||||
// create G4ParallelWorld and G4ImportanceSplitExaminer
|
||||
|
||||
public: // used internally by importance sampling
|
||||
|
||||
G4ParallelImportanceSampler(G4VIStore &is,
|
||||
const G4String &particlename,
|
||||
G4ParallelWorld &pworld,
|
||||
const G4VImportanceAlgorithm *ialg = 0);
|
||||
|
||||
~G4ParallelImportanceSampler();
|
||||
// delete G4ParallelWorld and G4ImportanceSplitExaminer
|
||||
// and G4ImportanceAgorithm and G4ParallelImportanceProcess
|
||||
// if created
|
||||
|
||||
public: // with description
|
||||
|
||||
G4ParallelImportanceProcess *CreateParallelImportanceProcess();
|
||||
// create the parallel importance process
|
||||
// don't use it if you use Initialize()
|
||||
|
||||
void Initialize();
|
||||
// the G4ParallelImportanceSampler has to be initialised after
|
||||
// the initialisation of the G4RunManager !
|
||||
|
||||
private:
|
||||
|
||||
G4ParallelImportanceSampler(const G4ParallelImportanceSampler &);
|
||||
G4ParallelImportanceSampler &operator=(const G4ParallelImportanceSampler &);
|
||||
|
||||
private:
|
||||
|
||||
G4String fParticleName;
|
||||
G4ParallelWorld &fParallelWorld;
|
||||
G4bool fCreatedPW;
|
||||
|
||||
G4bool fDeleteAlg;
|
||||
const G4VImportanceAlgorithm *fIalgorithm;
|
||||
|
||||
G4VImportanceSplitExaminer *fExaminer;
|
||||
G4ParallelImportanceProcess *fParallelImportanceProcess;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParallelTransport.hh,v 1.4 2002/05/02 08:43:23 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ParallelTransport.hh,v 1.6 2002/10/16 16:26:58 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ParallelTransport
|
||||
@@ -79,24 +79,28 @@ public: // with description
|
||||
virtual void EndTracking();
|
||||
|
||||
|
||||
G4VParallelStepper &GetPStepper(){return fPStepper;}
|
||||
const G4VParallelStepper &GetPStepper() const;
|
||||
// get the fPStepper
|
||||
|
||||
public: // without description
|
||||
|
||||
// no operation in AtRestDoIt and AlongStepDoIt
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*) {return -1.0;}
|
||||
G4double AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*) {return -1.0;}
|
||||
|
||||
G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) {return 0;}
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) {return 0;}
|
||||
virtual G4double
|
||||
AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*);
|
||||
virtual G4double
|
||||
AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*);
|
||||
|
||||
virtual G4VParticleChange* AtRestDoIt(const G4Track&,
|
||||
const G4Step&);
|
||||
virtual G4VParticleChange* AlongStepDoIt(const G4Track&,
|
||||
const G4Step&);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void Error(const G4String &m);
|
||||
@@ -119,4 +123,11 @@ private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
inline const G4VParallelStepper &G4ParallelTransport::
|
||||
GetPStepper() const {
|
||||
return fPStepper;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+29
-47
@@ -21,67 +21,49 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParallelScoreSampler.hh,v 1.1 2002/05/31 10:16:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ParallelTransportConfigurator.hh,v 1.3 2002/10/22 13:25:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ParallelScoreSampler
|
||||
// Class G4ParallelTransportConfigurator
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A user should use this class to set up scoring in a "parallel"
|
||||
// geometry.
|
||||
// The user must create an object of this kind and initialise it.
|
||||
|
||||
// This class builds and places the G4ParallelTransport
|
||||
// If the object is deleted the process is removed from the
|
||||
// process list.
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4ParallelScoreSampler_hh
|
||||
#define G4ParallelScoreSampler_hh G4ParallelScoreSampler_hh
|
||||
|
||||
#ifndef G4ParallelTransportConfigurator_hh
|
||||
#define G4ParallelTransportConfigurator_hh G4ParallelTransportConfigurator_hh
|
||||
|
||||
#include "G4VSamplerConfigurator.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VSampler.hh"
|
||||
#include "G4ParallelTransport.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
|
||||
|
||||
class G4ParallelWorld;
|
||||
class G4VPhysicalVolume;
|
||||
class G4ParallelTransport;
|
||||
class G4VPScorer;
|
||||
class G4PScoreProcess;
|
||||
|
||||
class G4ParallelScoreSampler : public G4VSampler
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4ParallelScoreSampler(G4VPhysicalVolume &worldvolume,
|
||||
const G4String &particlename,
|
||||
G4VPScorer &scorer);
|
||||
// create and initalise members
|
||||
|
||||
~G4ParallelScoreSampler();
|
||||
// delete constructed members
|
||||
|
||||
G4PScoreProcess *CreateParallelScoreProcess();
|
||||
// create the parallel score process
|
||||
// don't use it if you use Initialize()
|
||||
G4ParallelTransport *CreateParallelTransport();
|
||||
// get the G4ParallelTransport
|
||||
|
||||
void Initialize();
|
||||
// the G4ParallelScoreSampler has to be initialised after
|
||||
// the initialisation of the G4RunManager !
|
||||
|
||||
class G4ParallelTransportConfigurator : public G4VSamplerConfigurator{
|
||||
public:
|
||||
G4ParallelTransportConfigurator(const G4String &particlename,
|
||||
G4ParallelWorld &pworld);
|
||||
virtual ~G4ParallelTransportConfigurator();
|
||||
virtual void Configure(G4VSamplerConfigurator *preConf);
|
||||
virtual const G4VTrackTerminator *GetTrackTerminator() const;
|
||||
|
||||
private:
|
||||
|
||||
G4ParallelScoreSampler(const G4ParallelScoreSampler &);
|
||||
G4ParallelScoreSampler &operator=(const G4ParallelScoreSampler&);
|
||||
|
||||
private:
|
||||
G4String fParticleName;
|
||||
G4ParallelWorld &fParallelWorld;
|
||||
G4VPScorer &fPScorer;
|
||||
G4PScoreProcess *fPScorerProcess;
|
||||
G4ParallelTransportConfigurator(const
|
||||
G4ParallelTransportConfigurator &);
|
||||
G4ParallelTransportConfigurator &
|
||||
operator=(const G4ParallelTransportConfigurator &);
|
||||
G4ProcessPlacer fPlacer;
|
||||
G4ParallelWorld &fPWorld;
|
||||
G4ParallelTransport *fParallelTransport;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,118 +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: G4ParallelWeightWindowProcess.hh,v 1.2 2002/05/31 10:16:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ParallelWeightWindowProcess
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// The process performing the weight window sampling according
|
||||
// to an G4VWeightWindowAlgorithm
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4ParallelWeightWindowProcess_hh
|
||||
#define G4ParallelWeightWindowProcess_hh G4ParallelWeightWindowProcess_hh
|
||||
|
||||
#include "g4std/strstream"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Nsplit_Weight.hh"
|
||||
#include "G4ImportancePostStepDoIt.hh"
|
||||
|
||||
class G4VIStore;;
|
||||
class G4VParallelStepper;
|
||||
class G4VWeightWindowAlgorithm;
|
||||
|
||||
class G4ParallelWeightWindowProcess : public G4VProcess
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4ParallelWeightWindowProcess(G4VIStore &aIstore,
|
||||
G4VParallelStepper &aStepper,
|
||||
G4VWeightWindowAlgorithm &aWWAlgorithm,
|
||||
const G4String &aName = "ParallelWeightWindowProcess");
|
||||
// create G4ParticleChange
|
||||
|
||||
virtual ~G4ParallelWeightWindowProcess();
|
||||
// delete G4ParticleChange
|
||||
|
||||
|
||||
|
||||
virtual G4double
|
||||
PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
|
||||
virtual G4VParticleChange *PostStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
|
||||
void StartTracking();
|
||||
void EndTracking();
|
||||
|
||||
public: // without description
|
||||
|
||||
// no operation in AtRestDoIt and AlongStepDoIt
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*) {return -1.0;}
|
||||
G4double AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*) {return -1.0;}
|
||||
|
||||
G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) {return 0;}
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) {return 0;}
|
||||
|
||||
protected:
|
||||
|
||||
virtual void Error(const G4String &m);
|
||||
virtual void Warning(const G4String &m);
|
||||
|
||||
G4ParticleChange *fParticleChange;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
G4ParallelWeightWindowProcess(const G4ParallelWeightWindowProcess &);
|
||||
G4ParallelWeightWindowProcess &operator=(const G4ParallelWeightWindowProcess &);
|
||||
|
||||
private:
|
||||
|
||||
G4VIStore &fIStore;
|
||||
G4VParallelStepper &fPStepper;
|
||||
G4VWeightWindowAlgorithm &fWWAlgorithm;
|
||||
G4Nsplit_Weight fNsplit_Weight;
|
||||
G4ImportancePostStepDoIt fImportancePostStepDoIt;
|
||||
G4bool fInitStep;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ProcessPlacer.hh,v 1.4 2002/05/24 08:17:19 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ProcessPlacer.hh,v 1.6 2002/10/16 16:26:58 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ProcessPlacer
|
||||
@@ -48,32 +48,37 @@ class G4ProcessPlacer : public G4VProcessPlacer
|
||||
|
||||
public: // with description
|
||||
|
||||
G4ProcessPlacer(const G4String &particlename);
|
||||
explicit G4ProcessPlacer(const G4String &particlename);
|
||||
// create a process placer for a particle type
|
||||
|
||||
void AddProcessAsLastDoIt(G4VProcess *process);
|
||||
virtual ~G4ProcessPlacer();
|
||||
|
||||
virtual void AddProcessAsLastDoIt(G4VProcess *process);
|
||||
// place a post step do it process such that the
|
||||
// PostStepDoIt function is called last
|
||||
// THE ORDER CHANGES BY SUBSEQUENT CALLS
|
||||
|
||||
void AddProcessAsSecondDoIt(G4VProcess *process);
|
||||
virtual void AddProcessAsSecondDoIt(G4VProcess *process);
|
||||
// place a post step do it process such that the
|
||||
// PostStepDoIt function is called second
|
||||
// THE ORDER CHANGES BY SUBSEQUENT CALLS
|
||||
|
||||
void RemoveProcess(G4VProcess *process);
|
||||
virtual void RemoveProcess(G4VProcess *process);
|
||||
// removes a given process
|
||||
|
||||
private:
|
||||
|
||||
G4ProcessManager &GetProcessManager();
|
||||
|
||||
enum SecondOrLast
|
||||
{
|
||||
eSecond = 1,
|
||||
eLast = 0
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
G4ProcessManager *GetProcessManager();
|
||||
|
||||
|
||||
|
||||
void AddProcessAs(G4VProcess *process, SecondOrLast);
|
||||
|
||||
void PrintProcVec(G4ProcessVector* processVec);
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4TrackTerminator.hh,v 1.1 2002/10/16 16:27:41 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4TrackTerminator
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This is an interface for an object which maybe told to kill a track.
|
||||
// The type it provides is needed in case importance biasing and
|
||||
// scoring is done at the same time.
|
||||
// For navigation in the parallel geometry which is done
|
||||
// by the importance biasing process (it derives from G4ParallelTransport)
|
||||
// importance biasing has to be done before scoring (to score the correct
|
||||
// volume). But since scoring would not be called if the importance
|
||||
// biasing kills a track it only tells a G4TrackTerminator to kill the
|
||||
// track. The scoring process implements the interface G4TrackTerminator
|
||||
// and is now able to kill the track after it has done the scoring.
|
||||
//
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4TrackTerminator_hh
|
||||
#define G4TrackTerminator_hh G4TrackTerminator_hh
|
||||
#include "globals.hh"
|
||||
|
||||
class G4TrackTerminator {
|
||||
public:
|
||||
G4TrackTerminator():
|
||||
fKillTrack(false)
|
||||
{}
|
||||
~G4TrackTerminator();
|
||||
void SetKillTrack(){fKillTrack = true;}
|
||||
G4bool GetKillTrack() const {return fKillTrack;}
|
||||
private:
|
||||
G4bool fKillTrack;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Transportation.hh,v 1.6 2001/11/28 18:27:50 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4Transportation.hh,v 1.7 2002/08/29 15:32:00 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Transportation.icc,v 1.4 2001/11/06 01:38:19 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
//
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserSpecialCuts.hh,v 1.4 2001/07/11 10:08:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4UserSpecialCuts.hh,v 1.5 2002/08/29 15:32:00 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// ------------------------------------------------------------
|
||||
// 15 April 1998 M.Maire
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VProcessPlacer.hh,v 1.4 2002/05/24 08:17:19 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4VProcessPlacer.hh,v 1.7 2002/10/16 16:26:58 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4VProcessPlacer
|
||||
@@ -46,8 +46,8 @@ class G4VProcessPlacer
|
||||
|
||||
public: // with description
|
||||
|
||||
G4VProcessPlacer(const G4String &particlename){}
|
||||
virtual ~G4VProcessPlacer(){}
|
||||
G4VProcessPlacer();
|
||||
virtual ~G4VProcessPlacer();
|
||||
|
||||
virtual void AddProcessAsLastDoIt(G4VProcess *process) = 0;
|
||||
// place a post step do it process such that the
|
||||
@@ -59,7 +59,7 @@ public: // with description
|
||||
// PostStepDoIt function is called second
|
||||
// THE ORDER CHANGES BY SUBSEQUENT CALLS
|
||||
|
||||
void RemoveProcess(G4VProcess *process);
|
||||
virtual void RemoveProcess(G4VProcess *process) = 0;
|
||||
// removes a given process
|
||||
|
||||
|
||||
|
||||
@@ -21,28 +21,60 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VSampler.hh,v 1.1 2002/05/31 08:08:22 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4VSampler.hh,v 1.6 2002/10/22 13:25:57 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4VSampler
|
||||
//
|
||||
// Class description:
|
||||
// The base class for importance sampling and scoring.
|
||||
//
|
||||
//
|
||||
// This interface discribes a configurable sampler.
|
||||
// It applies to a given particle type.
|
||||
// Concrete classes with this interface may be used for
|
||||
// scoring, importance sampling and weigth cutoff (weight roulett).
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4VSampler_hh
|
||||
#define G4VSampler_hh G4VSampler_hh
|
||||
|
||||
class G4VSampler
|
||||
{
|
||||
public:
|
||||
virtual ~G4VSampler(){}
|
||||
virtual void Initialize() = 0;
|
||||
// the user must initialize the concrete object this interface
|
||||
// covers afer the initialization of the G4RunManager
|
||||
};
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4VImportanceAlgorithm;
|
||||
class G4VIStore;
|
||||
class G4VScorer;
|
||||
|
||||
|
||||
class G4VSampler {
|
||||
|
||||
public:
|
||||
|
||||
G4VSampler();
|
||||
virtual ~G4VSampler();
|
||||
|
||||
virtual void PrepareScoring(G4VScorer *Scorer) = 0;
|
||||
|
||||
virtual void PrepareImportanceSampling(G4VIStore *istore,
|
||||
const G4VImportanceAlgorithm
|
||||
*ialg = 0) = 0;
|
||||
|
||||
|
||||
virtual void PrepareWeightRoulett(G4double wsurvive = 0.5,
|
||||
G4double wlimit = 0.25,
|
||||
G4double isource = 1) = 0;
|
||||
|
||||
virtual void Configure() = 0;
|
||||
|
||||
virtual void ClearSampling() = 0;
|
||||
// clear the sampler and remove the processes
|
||||
|
||||
virtual G4bool IsConfigured() const = 0;
|
||||
// check if some initialization hase already been done
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VSamplerConfigurator.hh,v 1.3 2002/12/12 19:18:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4VSamplerConfigurator
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This is an interface for configurators seeting up processes
|
||||
// needed for importance sampling and scoring.
|
||||
// The Configurator may be given a pointer to another Configurator.
|
||||
// If a configurator will be given a pointer to another configurator
|
||||
// it may obtain a G4VTrackTerminator from the given Configurator.
|
||||
// This way it is possible to delegate the killing of a track.
|
||||
//
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4VSamplerConfigurator_hh
|
||||
#define G4VSamplerConfigurator_hh G4VSamplerConfigurator_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "g4std/vector"
|
||||
class G4VTrackTerminator;
|
||||
|
||||
|
||||
class G4VSamplerConfigurator{
|
||||
public:
|
||||
G4VSamplerConfigurator();
|
||||
virtual ~G4VSamplerConfigurator();
|
||||
virtual void Configure(G4VSamplerConfigurator *preConf) = 0;
|
||||
// do the configuration, if preConf is given a
|
||||
// G4VTrackTerminator may be obtained from it
|
||||
virtual const G4VTrackTerminator *GetTrackTerminator() const = 0;
|
||||
// return a G4VTrackTerminator or 0
|
||||
};
|
||||
|
||||
typedef G4std::vector<G4VSamplerConfigurator *> G4Configurators;
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VTrackTerminator.hh,v 1.4 2002/10/16 16:26:59 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4VTrackTerminator
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This is an interface for an object which maybe told to kill a track.
|
||||
// The type it provides is needed in case importance biasing and
|
||||
// scoring is done at the same time.
|
||||
// For navigation in the parallel geometry which is done
|
||||
// by the importance biasing process (it derives from G4ParallelTransport)
|
||||
// importance biasing has to be done before scoring (to score the correct
|
||||
// volume). But since scoring would not be called if the importance
|
||||
// biasing kills a track it only tells a G4VTrackTerminator to kill the
|
||||
// track. The scoring process implements the interface G4VTrackTerminator
|
||||
// and is now able to kill the track after it has done the scoring.
|
||||
//
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4VTrackTerminator_hh
|
||||
#define G4VTrackTerminator_hh G4VTrackTerminator_hh
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VTrackTerminator {
|
||||
public:
|
||||
G4VTrackTerminator();
|
||||
virtual ~G4VTrackTerminator();
|
||||
virtual void KillTrack() const = 0;
|
||||
virtual const G4String &GetName() const = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4WeightCutOffConfigurator.hh,v 1.3 2002/10/22 13:25:57 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4WeightCutOffConfigurator
|
||||
//
|
||||
// Class description:
|
||||
// This class builds and places the G4WeightCutOffProcess
|
||||
// If the object is deleted the process is removed from the
|
||||
// process list.
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4WeightCutOffConfigurator_hh
|
||||
#define G4WeightCutOffConfigurator_hh G4WeightCutOffConfigurator_hh
|
||||
|
||||
#include "G4VSamplerConfigurator.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
|
||||
class G4WeightCutOffProcess;
|
||||
class G4VGCellFinder;
|
||||
class G4VIStore;
|
||||
|
||||
|
||||
class G4WeightCutOffConfigurator : public G4VSamplerConfigurator {
|
||||
public:
|
||||
G4WeightCutOffConfigurator(const G4String &particlename,
|
||||
G4double wsurvival,
|
||||
G4double wlimit,
|
||||
G4double isource,
|
||||
G4VIStore *istore,
|
||||
const G4VGCellFinder &aGCellFinder);
|
||||
|
||||
virtual ~G4WeightCutOffConfigurator();
|
||||
virtual void Configure(G4VSamplerConfigurator *preConf);
|
||||
virtual const G4VTrackTerminator *GetTrackTerminator() const ;
|
||||
|
||||
private:
|
||||
G4WeightCutOffConfigurator(const G4WeightCutOffConfigurator&);
|
||||
G4WeightCutOffConfigurator &
|
||||
operator=(const G4WeightCutOffConfigurator&);
|
||||
G4ProcessPlacer fPlacer;
|
||||
G4WeightCutOffProcess *fWeightCutOffProcess;
|
||||
G4bool fPlaced;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,111 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4WeightCutOffProcess.hh,v 1.2 2002/10/16 16:26:59 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4WeightCutOffProcess
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4WeightCutOffProcess_hh
|
||||
#define G4WeightCutOffProcess_hh G4WeightCutOffProcess_hh
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4VTrackTerminator.hh"
|
||||
#include "G4GeometryCell.hh"
|
||||
|
||||
class G4VGCellFinder;
|
||||
class G4VIStore;
|
||||
|
||||
class G4WeightCutOffProcess : public G4VProcess
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4WeightCutOffProcess(G4double wsurvival,
|
||||
G4double wlimit,
|
||||
G4double isource,
|
||||
G4VIStore *istore,
|
||||
const G4VGCellFinder &aGCellFinder,
|
||||
const G4String &aName = "WeightCutOffProcess");
|
||||
// create a G4ParticleChange
|
||||
|
||||
virtual ~G4WeightCutOffProcess();
|
||||
// delete the G4ParticleChange
|
||||
|
||||
virtual G4double
|
||||
PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
// make the process beeing forced
|
||||
|
||||
virtual G4VParticleChange * PostStepDoIt(const G4Track&,
|
||||
const G4Step&);
|
||||
|
||||
|
||||
const G4String &GetName() const;
|
||||
|
||||
|
||||
public: // without description
|
||||
|
||||
// no operation in AtRestDoIt and AlongStepDoIt
|
||||
|
||||
virtual G4double
|
||||
AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*);
|
||||
|
||||
virtual G4double
|
||||
AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*);
|
||||
|
||||
virtual G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&);
|
||||
virtual G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
private:
|
||||
|
||||
G4WeightCutOffProcess(const G4WeightCutOffProcess &);
|
||||
G4WeightCutOffProcess &operator=(const G4WeightCutOffProcess &);
|
||||
|
||||
G4ParticleChange *fParticleChange;
|
||||
G4double fWeightSurvival;
|
||||
G4double fWeightLimit;
|
||||
G4double fSourceImportance;
|
||||
G4VIStore *fIStore;
|
||||
const G4VGCellFinder &fGCellFinder;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ImportancePostStepDoIt.cc,v 1.5 2002/05/31 08:06:34 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ImportancePostStepDoIt.cc,v 1.8 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -31,20 +31,25 @@
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "g4std/strstream"
|
||||
|
||||
#include "G4ImportancePostStepDoIt.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4ParticleChange.hh"
|
||||
#include "G4VImportanceSplitExaminer.hh"
|
||||
#include "G4Nsplit_Weight.hh"
|
||||
#include "G4VTrackTerminator.hh"
|
||||
#include "g4std/strstream"
|
||||
|
||||
G4ImportancePostStepDoIt::G4ImportancePostStepDoIt(){}
|
||||
|
||||
G4ImportancePostStepDoIt::
|
||||
G4ImportancePostStepDoIt(const G4VTrackTerminator &TrackTerminator)
|
||||
:
|
||||
fTrackTerminator(TrackTerminator)
|
||||
{}
|
||||
G4ImportancePostStepDoIt::~G4ImportancePostStepDoIt(){}
|
||||
|
||||
void G4ImportancePostStepDoIt::DoIt(const G4Track& aTrack,
|
||||
G4ParticleChange *aParticleChange,
|
||||
const G4Nsplit_Weight nw)
|
||||
const G4Nsplit_Weight &nw)
|
||||
{
|
||||
// evaluate results from sampler
|
||||
if (nw.fN>1) {
|
||||
@@ -57,14 +62,19 @@ void G4ImportancePostStepDoIt::DoIt(const G4Track& aTrack,
|
||||
}
|
||||
else if (nw.fN==0) {
|
||||
// kill track
|
||||
aParticleChange->SetStatusChange(fStopAndKill);
|
||||
fTrackTerminator.KillTrack();
|
||||
}
|
||||
else {
|
||||
// wrong answer
|
||||
G4std::ostrstream os;
|
||||
os << "G4ImportancePostStepDoIt::DoIt: sampler returned nw = "
|
||||
<< nw << '\0' << G4endl;
|
||||
G4Exception(os.str());
|
||||
char st[200];
|
||||
G4std::ostrstream os(st,200);
|
||||
os << "G4ImportancePostStepDoIt::DoIt: sampler returned nw = "
|
||||
<< nw
|
||||
<< "\n"
|
||||
<< '\0';
|
||||
G4String m(st);
|
||||
|
||||
G4Exception(m);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+43
-35
@@ -21,56 +21,64 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MassImportanceSampler.cc,v 1.1 2002/05/31 10:16:02 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4MImportanceConfigurator.cc,v 1.3 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4MassImportanceSampler.cc
|
||||
// Class G4MImportanceConfigurator
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4MassImportanceSampler.hh"
|
||||
|
||||
#include "G4MImportanceConfigurator.hh"
|
||||
|
||||
#include "G4MassImportanceProcess.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
#include "G4ImportanceAlgorithm.hh"
|
||||
|
||||
|
||||
G4MassImportanceSampler::
|
||||
G4MassImportanceSampler(G4VIStore &aIstore,
|
||||
const G4String &particlename,
|
||||
const G4VImportanceAlgorithm *algorithm)
|
||||
: fIStore(aIstore),
|
||||
fParticleName(particlename),
|
||||
fMassImportanceProcess(0),
|
||||
fCreatedAlgorithm( ( ! algorithm) ),
|
||||
fAlgorithm(( (fCreatedAlgorithm) ?
|
||||
new G4ImportanceAlgorithm : algorithm))
|
||||
G4MImportanceConfigurator::
|
||||
G4MImportanceConfigurator(const G4String &particlename,
|
||||
G4VIStore &istore,
|
||||
const G4VImportanceAlgorithm *ialg)
|
||||
:
|
||||
fPlacer(particlename),
|
||||
fIStore(istore),
|
||||
fDeleteIalg( ( ! ialg) ),
|
||||
fIalgorithm(( (fDeleteIalg) ?
|
||||
new G4ImportanceAlgorithm : ialg)),
|
||||
fMassImportanceProcess(0)
|
||||
{}
|
||||
|
||||
G4MassImportanceSampler::~G4MassImportanceSampler()
|
||||
{
|
||||
G4MImportanceConfigurator::
|
||||
~G4MImportanceConfigurator(){
|
||||
if (fMassImportanceProcess) {
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.RemoveProcess(fMassImportanceProcess);
|
||||
fPlacer.RemoveProcess(fMassImportanceProcess);
|
||||
delete fMassImportanceProcess;
|
||||
}
|
||||
if (fCreatedAlgorithm) delete fAlgorithm;
|
||||
if (fDeleteIalg) {
|
||||
delete fIalgorithm;
|
||||
}
|
||||
}
|
||||
void
|
||||
G4MImportanceConfigurator::Configure(G4VSamplerConfigurator *preConf){
|
||||
const G4VTrackTerminator *terminator = 0;
|
||||
if (preConf) {
|
||||
terminator = preConf->GetTrackTerminator();
|
||||
};
|
||||
|
||||
fMassImportanceProcess =
|
||||
new G4MassImportanceProcess(*fIalgorithm,
|
||||
fIStore,
|
||||
terminator);
|
||||
if (!fMassImportanceProcess) {
|
||||
G4Exception("ERROR: G4MImportanceConfigurator::Configure: new failed to create G4MassImportanceProcess!");
|
||||
}
|
||||
fPlacer.AddProcessAsSecondDoIt(fMassImportanceProcess);
|
||||
}
|
||||
|
||||
|
||||
G4MassImportanceProcess *G4MassImportanceSampler::CreateMassImportanceProcess()
|
||||
{
|
||||
if (!fMassImportanceProcess) {
|
||||
fMassImportanceProcess =
|
||||
new G4MassImportanceProcess(*fAlgorithm, fIStore);
|
||||
}
|
||||
const G4VTrackTerminator *G4MImportanceConfigurator::
|
||||
GetTrackTerminator() const {
|
||||
return fMassImportanceProcess;
|
||||
}
|
||||
|
||||
void G4MassImportanceSampler::Initialize()
|
||||
{
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.AddProcessAsSecondDoIt(CreateMassImportanceProcess());
|
||||
}
|
||||
+26
-27
@@ -21,47 +21,46 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MassScoreSampler.cc,v 1.1 2002/05/31 10:16:02 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4MScoreConfigurator.cc,v 1.4 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4MassScoreSampler.cc
|
||||
// Class G4MScoreConfigurator
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4MassScoreSampler.hh"
|
||||
#include "G4MScoreProcess.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
#include "G4MScoreConfigurator.hh"
|
||||
#include "G4VScorer.hh"
|
||||
#include "G4VTrackTerminator.hh"
|
||||
|
||||
|
||||
G4MassScoreSampler::G4MassScoreSampler(G4VPScorer &ascorer,
|
||||
const G4String &particlename)
|
||||
: fScorer(ascorer),
|
||||
fParticleName(particlename),
|
||||
fMScoreProcess(0)
|
||||
G4MScoreConfigurator::
|
||||
G4MScoreConfigurator(const G4String &particlename,
|
||||
G4VScorer &scorer)
|
||||
:
|
||||
fPlacer(particlename),
|
||||
fScorer(scorer),
|
||||
fMScoreProcess(0)
|
||||
{}
|
||||
|
||||
G4MassScoreSampler::~G4MassScoreSampler()
|
||||
{
|
||||
G4MScoreConfigurator::~G4MScoreConfigurator(){
|
||||
if (fMScoreProcess) {
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.RemoveProcess(fMScoreProcess);
|
||||
fPlacer.RemoveProcess(fMScoreProcess);
|
||||
delete fMScoreProcess;
|
||||
}
|
||||
}
|
||||
|
||||
G4MScoreProcess *G4MassScoreSampler::CreateMassScoreProcess()
|
||||
{
|
||||
if (!fMScoreProcess) {
|
||||
fMScoreProcess = new G4MScoreProcess(fScorer);
|
||||
}
|
||||
|
||||
const G4VTrackTerminator *G4MScoreConfigurator::
|
||||
GetTrackTerminator() const{
|
||||
return fMScoreProcess;
|
||||
}
|
||||
|
||||
void G4MassScoreSampler::Initialize()
|
||||
void G4MScoreConfigurator::Configure(G4VSamplerConfigurator *preConf)
|
||||
{
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.AddProcessAsSecondDoIt(CreateMassScoreProcess());
|
||||
fMScoreProcess = new G4MScoreProcess(fScorer);
|
||||
if (!fMScoreProcess) {
|
||||
G4Exception("ERROR: G4MScoreConfigurator::Configure: new failed to create G4MScoreProcess!");
|
||||
}
|
||||
fPlacer.AddProcessAsSecondDoIt(fMScoreProcess);
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MScoreProcess.cc,v 1.3 2002/04/09 17:40:15 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4MScoreProcess.cc,v 1.9 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -32,16 +32,21 @@
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4MScoreProcess.hh"
|
||||
#include "G4VPScorer.hh"
|
||||
#include "G4PStep.hh"
|
||||
#include "G4VScorer.hh"
|
||||
#include "G4GeometryCellStep.hh"
|
||||
#include "G4VParallelStepper.hh"
|
||||
|
||||
G4MScoreProcess::G4MScoreProcess(G4VPScorer &aScorer,
|
||||
G4MScoreProcess::G4MScoreProcess(G4VScorer &aScorer,
|
||||
const G4String &aName)
|
||||
: G4VProcess(aName),
|
||||
fScorer(aScorer)
|
||||
:
|
||||
G4VProcess(aName),
|
||||
fScorer(aScorer),
|
||||
fKillTrack(false)
|
||||
{
|
||||
G4VProcess::pParticleChange = new G4ParticleChange;
|
||||
if (!G4VProcess::pParticleChange) {
|
||||
G4Exception("ERROR:G4MScoreProcess::G4MScoreProcess new failed to create G4ParticleChange!");
|
||||
}
|
||||
}
|
||||
|
||||
G4MScoreProcess::~G4MScoreProcess()
|
||||
@@ -68,17 +73,58 @@ G4MScoreProcess::PostStepDoIt(const G4Track& aTrack, const G4Step &aStep)
|
||||
G4StepPoint *postpoint = aStep.GetPostStepPoint();
|
||||
|
||||
|
||||
G4PTouchableKey prekey(*(prepoint->GetPhysicalVolume()),
|
||||
G4GeometryCell prekey(*(prepoint->GetPhysicalVolume()),
|
||||
prepoint->GetTouchable()->GetReplicaNumber());
|
||||
G4PTouchableKey postkey(*(postpoint->GetPhysicalVolume()),
|
||||
G4GeometryCell postkey(*(postpoint->GetPhysicalVolume()),
|
||||
postpoint->GetTouchable()->GetReplicaNumber());
|
||||
|
||||
G4PStep pstep(prekey, postkey);
|
||||
pstep.fCrossBoundary = false;
|
||||
G4GeometryCellStep pstep(prekey, postkey);
|
||||
pstep.SetCrossBoundary(false);
|
||||
|
||||
if (prekey != postkey) pstep.fCrossBoundary = true;
|
||||
|
||||
if (prekey != postkey) {
|
||||
pstep.SetCrossBoundary(true);
|
||||
}
|
||||
fScorer.Score(aStep, pstep);
|
||||
}
|
||||
|
||||
if (fKillTrack) {
|
||||
fKillTrack = false;
|
||||
pParticleChange->SetStatusChange(fStopAndKill);
|
||||
}
|
||||
|
||||
return G4VProcess::pParticleChange;
|
||||
}
|
||||
|
||||
const G4String &G4MScoreProcess::GetName() const {
|
||||
return theProcessName;
|
||||
}
|
||||
|
||||
|
||||
G4double G4MScoreProcess::
|
||||
AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*) {
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
G4double G4MScoreProcess::
|
||||
AtRestGetPhysicalInteractionLength(const G4Track&,
|
||||
G4ForceCondition*) {
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4MScoreProcess::AtRestDoIt(const G4Track&,
|
||||
const G4Step&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4MScoreProcess::AlongStepDoIt(const G4Track&,
|
||||
const G4Step&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void G4MScoreProcess::KillTrack() const{
|
||||
fKillTrack = true;
|
||||
}
|
||||
|
||||
+23
-24
@@ -21,40 +21,39 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MassImportanceScoreSampler.cc,v 1.1 2002/05/31 10:16:02 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4MassGCellFinder.cc,v 1.1 2002/10/16 16:27:41 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4MassImportanceScoreSampler.cc
|
||||
// G4MassGCellFinder.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4MassImportanceScoreSampler.hh"
|
||||
#include "G4MassImportanceSampler.hh"
|
||||
#include "G4MassScoreSampler.hh"
|
||||
#include "G4MassGCellFinder.hh"
|
||||
#include "G4TouchableHandle.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
|
||||
G4MassImportanceScoreSampler::
|
||||
G4MassImportanceScoreSampler(G4VIStore &aIstore,
|
||||
G4VPScorer &ascorer,
|
||||
const G4String &particlename,
|
||||
const G4VImportanceAlgorithm *algorithm)
|
||||
: fMassImportanceSampler(new G4MassImportanceSampler(aIstore,
|
||||
particlename,
|
||||
algorithm)),
|
||||
fMassScoreSampler(new G4MassScoreSampler(ascorer, particlename))
|
||||
G4MassGCellFinder::G4MassGCellFinder()
|
||||
{}
|
||||
|
||||
G4MassImportanceScoreSampler::~G4MassImportanceScoreSampler()
|
||||
{
|
||||
delete fMassScoreSampler;
|
||||
delete fMassImportanceSampler;
|
||||
G4MassGCellFinder::~G4MassGCellFinder()
|
||||
{}
|
||||
|
||||
G4GeometryCell G4MassGCellFinder::
|
||||
GetPreGeometryCell(const G4Step &aStep) const {
|
||||
const G4TouchableHandle& th =
|
||||
aStep.GetPreStepPoint()->GetTouchableHandle();
|
||||
G4GeometryCell g(*th->GetVolume(), th->GetReplicaNumber());
|
||||
return g;
|
||||
}
|
||||
|
||||
void G4MassImportanceScoreSampler::Initialize()
|
||||
{
|
||||
fMassScoreSampler->Initialize();
|
||||
fMassImportanceSampler->Initialize();
|
||||
G4GeometryCell G4MassGCellFinder::
|
||||
GetPostGeometryCell(const G4Step &aStep) const {
|
||||
const G4TouchableHandle& th =
|
||||
aStep.GetPostStepPoint()->GetTouchableHandle();
|
||||
G4GeometryCell g(*th->GetVolume(), th->GetReplicaNumber());
|
||||
return g;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4MassGeometrySampler.cc,v 1.7 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4MassGeometrySampler.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
#include "G4MassGeometrySampler.hh"
|
||||
|
||||
#include "G4VIStore.hh"
|
||||
#include "G4VScorer.hh"
|
||||
|
||||
#include "G4MScoreConfigurator.hh"
|
||||
#include "G4MImportanceConfigurator.hh"
|
||||
#include "G4WeightCutOffConfigurator.hh"
|
||||
#include "G4MassGCellFinder.hh"
|
||||
|
||||
G4MassGeometrySampler::
|
||||
G4MassGeometrySampler(const G4String &particlename)
|
||||
:
|
||||
fParticleName(particlename),
|
||||
fMImportanceConfigurator(0),
|
||||
fMScoreConfigurator(0),
|
||||
fGCellFinder(0),
|
||||
fWeightCutOffConfigurator(0),
|
||||
fIStore(0),
|
||||
fIsConfigured(false)
|
||||
{}
|
||||
|
||||
G4MassGeometrySampler::~G4MassGeometrySampler(){
|
||||
ClearSampling();
|
||||
};
|
||||
|
||||
void G4MassGeometrySampler::ClearSampling() {
|
||||
|
||||
if (fMImportanceConfigurator) {
|
||||
delete fMImportanceConfigurator;
|
||||
fMImportanceConfigurator = 0;
|
||||
}
|
||||
if (fMScoreConfigurator) {
|
||||
delete fMScoreConfigurator;
|
||||
fMScoreConfigurator = 0;
|
||||
}
|
||||
if (fWeightCutOffConfigurator) {
|
||||
delete fWeightCutOffConfigurator;
|
||||
fWeightCutOffConfigurator = 0;
|
||||
}
|
||||
if (fGCellFinder) {
|
||||
delete fGCellFinder;
|
||||
fGCellFinder = 0;
|
||||
}
|
||||
fIStore = 0;
|
||||
fConfigurators.clear();
|
||||
fIsConfigured = false;
|
||||
};
|
||||
|
||||
G4bool G4MassGeometrySampler::IsConfigured() const{
|
||||
|
||||
G4bool isconf = false;
|
||||
if (fIsConfigured) {
|
||||
G4cout << "G4MassGeometrySampler::CheckIfInit some initalization exists, use ClearSampling() before a new initialization" << G4endl;
|
||||
isconf = true;
|
||||
}
|
||||
return isconf;
|
||||
}
|
||||
|
||||
void G4MassGeometrySampler::
|
||||
PrepareScoring(G4VScorer *scorer){
|
||||
fMScoreConfigurator =
|
||||
new G4MScoreConfigurator(fParticleName, *scorer);
|
||||
if (!fMScoreConfigurator) {
|
||||
G4Exception("ERROR:G4MassGeometrySampler::PrepareScoring: new failed to ccreate G4MScoreConfigurator!");
|
||||
}
|
||||
}
|
||||
|
||||
void G4MassGeometrySampler::
|
||||
PrepareImportanceSampling(G4VIStore *istore,
|
||||
const G4VImportanceAlgorithm
|
||||
*ialg) {
|
||||
fIStore = istore;
|
||||
|
||||
fMImportanceConfigurator =
|
||||
new G4MImportanceConfigurator(fParticleName,
|
||||
*fIStore,
|
||||
ialg);
|
||||
if (!fMImportanceConfigurator) {
|
||||
G4Exception("ERROR:G4MassGeometrySampler::PrepareImportanceSampling: new failed to ccreate G4MImportanceConfigurator!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void G4MassGeometrySampler::
|
||||
PrepareWeightRoulett(G4double wsurvive,
|
||||
G4double wlimit,
|
||||
G4double isource) {
|
||||
fGCellFinder = new G4MassGCellFinder;
|
||||
if (!fGCellFinder) {
|
||||
G4Exception("ERROR:G4MassGeometrySampler::PrepareWeightRoulett: new failed to create G4MassGCellFinder!");
|
||||
}
|
||||
|
||||
fWeightCutOffConfigurator =
|
||||
new G4WeightCutOffConfigurator(fParticleName,
|
||||
wsurvive,
|
||||
wlimit,
|
||||
isource,
|
||||
fIStore,
|
||||
*fGCellFinder);
|
||||
if (!fWeightCutOffConfigurator) {
|
||||
G4Exception("ERROR:G4MassGeometrySampler::PrepareWeightRoulett: new failed to ccreate G4WeightCutOffConfigurator!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void G4MassGeometrySampler::Configure(){
|
||||
if (!IsConfigured()) {
|
||||
fIsConfigured = true;
|
||||
|
||||
if (fMScoreConfigurator) {
|
||||
fConfigurators.push_back(fMScoreConfigurator);
|
||||
}
|
||||
if (fMImportanceConfigurator) {
|
||||
fConfigurators.push_back(fMImportanceConfigurator);
|
||||
}
|
||||
|
||||
G4VSamplerConfigurator *preConf = 0;
|
||||
for (G4Configurators::iterator it = fConfigurators.begin();
|
||||
it != fConfigurators.end(); it++) {
|
||||
G4VSamplerConfigurator *currConf =*it;
|
||||
currConf->Configure(preConf);
|
||||
preConf = *it;
|
||||
}
|
||||
if (fWeightCutOffConfigurator) {
|
||||
fWeightCutOffConfigurator->Configure(0);
|
||||
}
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MassImportanceProcess.cc,v 1.3 2002/04/09 17:40:15 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4MassImportanceProcess.cc,v 1.10 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -33,24 +33,28 @@
|
||||
|
||||
#include "G4MassImportanceProcess.hh"
|
||||
#include "G4VImportanceAlgorithm.hh"
|
||||
#include "G4ImportanceFinder.hh"
|
||||
#include "G4PTouchableKey.hh"
|
||||
#include "G4GeometryCell.hh"
|
||||
|
||||
G4MassImportanceProcess::
|
||||
G4MassImportanceProcess(const G4VImportanceAlgorithm &aImportanceAlgorithm,
|
||||
const G4VIStore &aIstore,
|
||||
const G4VTrackTerminator *TrackTerminator,
|
||||
const G4String &aName)
|
||||
: G4VProcess(aName),
|
||||
fParticleChange(new G4ParticleChange),
|
||||
fTrackTerminator(TrackTerminator ? TrackTerminator : this),
|
||||
fImportanceAlgorithm(aImportanceAlgorithm),
|
||||
fImportanceFinder(new G4ImportanceFinder(aIstore))
|
||||
fImportanceFinder(aIstore),
|
||||
fImportancePostStepDoIt(*fTrackTerminator)
|
||||
{
|
||||
fParticleChange = new G4ParticleChange;
|
||||
if (!fParticleChange) {
|
||||
G4Exception("ERROR:G4MassImportanceProcess::G4MassImportanceProcess: new failed to create G4ParticleChange!");
|
||||
}
|
||||
G4VProcess::pParticleChange = fParticleChange;
|
||||
}
|
||||
|
||||
G4MassImportanceProcess::~G4MassImportanceProcess()
|
||||
{
|
||||
delete fImportanceFinder;
|
||||
delete fParticleChange;
|
||||
}
|
||||
|
||||
@@ -78,16 +82,52 @@ G4MassImportanceProcess::PostStepDoIt(const G4Track &aTrack,
|
||||
G4StepPoint *postpoint = aStep.GetPostStepPoint();
|
||||
|
||||
|
||||
G4PTouchableKey prekey(*(prepoint->GetPhysicalVolume()),
|
||||
G4GeometryCell prekey(*(prepoint->GetPhysicalVolume()),
|
||||
prepoint->GetTouchable()->GetReplicaNumber());
|
||||
G4PTouchableKey postkey(*(postpoint->GetPhysicalVolume()),
|
||||
G4GeometryCell postkey(*(postpoint->GetPhysicalVolume()),
|
||||
postpoint->GetTouchable()->GetReplicaNumber());
|
||||
|
||||
G4Nsplit_Weight nw = fImportanceAlgorithm.
|
||||
Calculate(fImportanceFinder->
|
||||
GetIPre_over_IPost(prekey, postkey),
|
||||
Calculate(fImportanceFinder.GetImportance(prekey),
|
||||
fImportanceFinder.GetImportance(postkey),
|
||||
aTrack.GetWeight());
|
||||
fImportancePostStepDoIt.DoIt(aTrack, fParticleChange, nw);
|
||||
}
|
||||
return fParticleChange;
|
||||
}
|
||||
|
||||
void G4MassImportanceProcess::KillTrack() const {
|
||||
fParticleChange->SetStatusChange(fStopAndKill);
|
||||
}
|
||||
|
||||
const G4String &G4MassImportanceProcess::GetName() const {
|
||||
return theProcessName;
|
||||
}
|
||||
|
||||
G4double G4MassImportanceProcess::
|
||||
AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*) {
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
G4double G4MassImportanceProcess::
|
||||
AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*)
|
||||
{
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4MassImportanceProcess::
|
||||
AtRestDoIt(const G4Track&, const G4Step&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4MassImportanceProcess::
|
||||
AlongStepDoIt(const G4Track&, const G4Step&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,92 +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: G4PIScorer.cc,v 1.4 2002/04/09 17:40:15 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4PIScorer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4PIScorer.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4PStep.hh"
|
||||
#include "G4Sigma.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4VIStore.hh"
|
||||
#include "G4PStepStream.hh"
|
||||
#include "G4StepPoint.hh"
|
||||
|
||||
G4PIScorer::G4PIScorer(const G4VIStore &IStore)
|
||||
: fIStore(IStore), fNerr(0),fCorrectWeight(true)
|
||||
{}
|
||||
|
||||
G4PIScorer::~G4PIScorer()
|
||||
{}
|
||||
|
||||
void G4PIScorer::Score(const G4Step &aStep, const G4PStep &aPstep)
|
||||
{
|
||||
G4Track *track = aStep.GetTrack();
|
||||
|
||||
if (track->GetTrackStatus()==fStopAndKill) {
|
||||
G4cout << " track status is StopAndKill -> do nothing" << G4endl;
|
||||
}
|
||||
// do the scoring
|
||||
else {
|
||||
G4double weight = track->GetWeight();
|
||||
G4double import = fIStore.GetImportance(aPstep.fPostTouchableKey);
|
||||
G4double i_w =import * weight;
|
||||
if (i_w != 1.) {
|
||||
fNerr++;
|
||||
G4StepPoint* prepoint = aStep.GetPreStepPoint();
|
||||
G4StepPoint* postpoint = aStep.GetPostStepPoint();
|
||||
|
||||
G4cout << "G4PIScorer::Score:" << G4endl;
|
||||
G4cout << " Stepnumber = " << aStep.GetTrack()->GetCurrentStepNumber()
|
||||
<< G4endl;
|
||||
G4cout << " TrackID = " << aStep.GetTrack()->GetTrackID() << G4endl;
|
||||
G4cout << " ParentID = " << aStep.GetTrack()->GetParentID() << G4endl;
|
||||
G4cout << " Track wieght = " << weight << G4endl;
|
||||
G4cout << " Importance = " << import << G4endl;
|
||||
G4cout << " i_w = " << i_w << G4endl;
|
||||
G4cout << " aPstep: " << aPstep << G4endl;
|
||||
G4cout << " steplength = " << aStep.GetStepLength() << G4endl;
|
||||
G4cout << " pre_pos = " << prepoint->GetPosition()
|
||||
<< ", pre_dir = " << prepoint->GetMomentumDirection() << G4endl;
|
||||
G4cout << " post_pos = " << postpoint->GetPosition()
|
||||
<< ", post_dir = " << postpoint->GetMomentumDirection() << G4endl;
|
||||
G4cout << " vxt mom: " << track->GetVertexMomentumDirection() << G4endl;
|
||||
fCorrectWeight = false;
|
||||
}
|
||||
fPScorer.Score(aStep, aPstep);
|
||||
}
|
||||
}
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4PIScorer &ps)
|
||||
{
|
||||
out << ps.GetMapPtkTallys();
|
||||
return out;
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4PImportanceConfigurator.cc,v 1.3 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4PImportanceConfigurator
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4PImportanceConfigurator.hh"
|
||||
|
||||
#include "G4ParallelWorld.hh"
|
||||
#include "G4ImportanceAlgorithm.hh"
|
||||
|
||||
G4PImportanceConfigurator::
|
||||
G4PImportanceConfigurator(const G4String &particlename,
|
||||
G4ParallelWorld ¶llelWorld,
|
||||
G4VIStore &istore,
|
||||
const G4VImportanceAlgorithm *ialg)
|
||||
:
|
||||
fPlacer(particlename),
|
||||
fPWorld(parallelWorld),
|
||||
fDeleteIalg( ( ! ialg) ),
|
||||
fIalgorithm(( (fDeleteIalg) ?
|
||||
new G4ImportanceAlgorithm : ialg)),
|
||||
fExaminer(*fIalgorithm,
|
||||
parallelWorld.GetParallelStepper(),
|
||||
istore),
|
||||
fParallelImportanceProcess(0)
|
||||
{
|
||||
if (!fIalgorithm) {
|
||||
G4Exception("ERROR:G4PImportanceConfigurator::G4PImportanceConfigurator: no fIalgorithm!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4PImportanceConfigurator::~G4PImportanceConfigurator(){
|
||||
if (fParallelImportanceProcess) {
|
||||
fPlacer.RemoveProcess(fParallelImportanceProcess);
|
||||
delete fParallelImportanceProcess;
|
||||
}
|
||||
if (fDeleteIalg) {
|
||||
delete fIalgorithm;
|
||||
}
|
||||
}
|
||||
|
||||
void G4PImportanceConfigurator::
|
||||
Configure(G4VSamplerConfigurator *preConf){
|
||||
const G4VTrackTerminator *terminator = 0;
|
||||
if (preConf) {
|
||||
terminator = preConf->GetTrackTerminator();
|
||||
};
|
||||
|
||||
fParallelImportanceProcess =
|
||||
new G4ParallelImportanceProcess(fExaminer,
|
||||
fPWorld.GetGeoDriver(),
|
||||
fPWorld.GetParallelStepper(),
|
||||
terminator);
|
||||
if (!fParallelImportanceProcess) {
|
||||
G4Exception("ERROR:G4PImportanceConfigurator::Configure: new failed to create G4ParallelImportanceProcess!");
|
||||
}
|
||||
|
||||
fPlacer.AddProcessAsSecondDoIt(fParallelImportanceProcess);
|
||||
}
|
||||
|
||||
const G4VTrackTerminator *G4PImportanceConfigurator::
|
||||
GetTrackTerminator() const {
|
||||
return fParallelImportanceProcess;
|
||||
}
|
||||
|
||||
@@ -1,111 +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: G4PImportanceWWindowScoreSampler.cc,v 1.1 2002/05/31 10:16:02 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4PImportanceWWindowScoreSampler.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ParallelWorld.hh"
|
||||
#include "G4PImportanceWWindowScoreSampler.hh"
|
||||
#include "G4ParallelImportanceSampler.hh"
|
||||
#include "G4ParallelWorld.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
#include "G4VIStore.hh"
|
||||
#include "G4VPScorer.hh"
|
||||
#include "G4PScoreProcess.hh"
|
||||
#include "G4ParallelWeightWindowProcess.hh"
|
||||
#include "G4WeightWindowAlgorithm.hh"
|
||||
|
||||
G4PImportanceWWindowScoreSampler::
|
||||
G4PImportanceWWindowScoreSampler(G4VIStore &is,
|
||||
G4VPScorer &ascorer,
|
||||
const G4String &particlename,
|
||||
G4VWeightWindowAlgorithm &wwalg,
|
||||
const G4VImportanceAlgorithm *ialg) :
|
||||
fParticleName(particlename),
|
||||
fParallelWorld(*(new G4ParallelWorld(is.GetWorldVolume()))),
|
||||
fParallelImportanceSampler(*(new
|
||||
G4ParallelImportanceSampler(is,
|
||||
fParticleName,
|
||||
fParallelWorld,
|
||||
ialg))),
|
||||
fPScorer(ascorer),
|
||||
fIstore(is),
|
||||
fPScoreProcess(0),
|
||||
fPWeightWindowProcess(0),
|
||||
fWWAlgorithm(wwalg)
|
||||
{}
|
||||
|
||||
G4PImportanceWWindowScoreSampler::~G4PImportanceWWindowScoreSampler()
|
||||
{
|
||||
if (fPScoreProcess) {
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.RemoveProcess(fPScoreProcess);
|
||||
delete fPScoreProcess;
|
||||
}
|
||||
if (fPWeightWindowProcess) {
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.RemoveProcess(fPWeightWindowProcess);
|
||||
delete fPWeightWindowProcess;
|
||||
}
|
||||
delete &fParallelImportanceSampler;
|
||||
delete &fParallelWorld;
|
||||
}
|
||||
|
||||
G4PScoreProcess *
|
||||
G4PImportanceWWindowScoreSampler::CreateParallelScoreProcess()
|
||||
{
|
||||
if (!fPScoreProcess) {
|
||||
fPScoreProcess =
|
||||
new G4PScoreProcess(fParallelWorld.GetParallelStepper(),
|
||||
fPScorer);
|
||||
}
|
||||
return fPScoreProcess;
|
||||
}
|
||||
|
||||
G4VProcess *
|
||||
G4PImportanceWWindowScoreSampler::CreateWeightWindowProcess()
|
||||
{
|
||||
if (!fPWeightWindowProcess) {
|
||||
fPWeightWindowProcess =
|
||||
new G4ParallelWeightWindowProcess(fIstore,
|
||||
fParallelWorld.
|
||||
GetParallelStepper(),
|
||||
fWWAlgorithm);
|
||||
}
|
||||
return fPWeightWindowProcess;
|
||||
}
|
||||
|
||||
void G4PImportanceWWindowScoreSampler::Initialize()
|
||||
{
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.AddProcessAsSecondDoIt(CreateParallelScoreProcess());
|
||||
fParallelImportanceSampler.Initialize();
|
||||
placer.AddProcessAsSecondDoIt(CreateWeightWindowProcess());
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4PScoreConfigurator.cc,v 1.4 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4PScoreConfigurator
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4PScoreConfigurator.hh"
|
||||
|
||||
#include "G4VTrackTerminator.hh"
|
||||
|
||||
|
||||
G4PScoreConfigurator::
|
||||
G4PScoreConfigurator(const G4String &particlename,
|
||||
G4VParallelStepper &pstepper,
|
||||
G4VScorer &scorer)
|
||||
:
|
||||
fPlacer(particlename),
|
||||
fPStepper(pstepper),
|
||||
fScorer(scorer),
|
||||
fPScoreProcess(0)
|
||||
{}
|
||||
|
||||
G4PScoreConfigurator::~G4PScoreConfigurator(){
|
||||
if (fPScoreProcess) {
|
||||
fPlacer.RemoveProcess(fPScoreProcess);
|
||||
delete fPScoreProcess;
|
||||
}
|
||||
}
|
||||
|
||||
void G4PScoreConfigurator::Configure(G4VSamplerConfigurator *preConf){
|
||||
fPScoreProcess = new G4PScoreProcess(fPStepper, fScorer);
|
||||
if (!fPScoreProcess) {
|
||||
G4Exception("ERROR:G4PScoreConfigurator::Configure: new failed to create G4PScoreProcess!");
|
||||
}
|
||||
fPlacer.AddProcessAsSecondDoIt(fPScoreProcess);
|
||||
}
|
||||
|
||||
|
||||
const G4VTrackTerminator *G4PScoreConfigurator::
|
||||
GetTrackTerminator() const {
|
||||
return fPScoreProcess;
|
||||
}
|
||||
|
||||
@@ -21,29 +21,34 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PScoreProcess.cc,v 1.2 2002/04/09 17:40:15 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4PScoreProcess.cc,v 1.6 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4PIScoreProcess.cc
|
||||
// G4PScoreProcess.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4PScoreProcess.hh"
|
||||
#include "G4VPScorer.hh"
|
||||
#include "G4PStep.hh"
|
||||
#include "G4VScorer.hh"
|
||||
#include "G4GeometryCellStep.hh"
|
||||
#include "G4VParallelStepper.hh"
|
||||
|
||||
G4PScoreProcess::G4PScoreProcess(G4VParallelStepper &astepper,
|
||||
G4VPScorer &aScorer,
|
||||
G4VScorer &aScorer,
|
||||
const G4String &aName)
|
||||
: G4VProcess(aName),
|
||||
fPstepper(astepper),
|
||||
fScorer(aScorer)
|
||||
:
|
||||
G4VProcess(aName),
|
||||
fPstepper(astepper),
|
||||
fScorer(aScorer),
|
||||
fKillTrack(false)
|
||||
{
|
||||
G4VProcess::pParticleChange = new G4ParticleChange;
|
||||
if (!G4VProcess::pParticleChange) {
|
||||
G4Exception("ERROR:G4PScoreProcess::G4PScoreProcess: new failed to create G4ParticleChange!");
|
||||
}
|
||||
}
|
||||
|
||||
G4PScoreProcess::~G4PScoreProcess()
|
||||
@@ -65,6 +70,44 @@ G4PScoreProcess::PostStepDoIt(const G4Track& aTrack, const G4Step &aStep)
|
||||
{
|
||||
pParticleChange->Initialize(aTrack);
|
||||
fScorer.Score(aStep, fPstepper.GetPStep());
|
||||
|
||||
if (fKillTrack) {
|
||||
fKillTrack = false;
|
||||
pParticleChange->SetStatusChange(fStopAndKill);
|
||||
}
|
||||
return G4VProcess::pParticleChange;
|
||||
}
|
||||
|
||||
void G4PScoreProcess::KillTrack() const {
|
||||
fKillTrack = true;
|
||||
}
|
||||
|
||||
const G4String &G4PScoreProcess::GetName() const {
|
||||
return theProcessName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
G4double G4PScoreProcess::
|
||||
AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*) {
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
G4double G4PScoreProcess::
|
||||
AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*) {
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4PScoreProcess::
|
||||
AtRestDoIt(const G4Track&, const G4Step&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4PScoreProcess::
|
||||
AlongStepDoIt(const G4Track&, const G4Step&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,77 +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: G4PScorer.cc,v 1.7 2002/04/09 17:40:15 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4PScorer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4PScorer.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4PStep.hh"
|
||||
#include "G4Sigma.hh"
|
||||
#include "G4StateManager.hh"
|
||||
|
||||
G4PScorer::G4PScorer(){}
|
||||
G4PScorer::~G4PScorer(){}
|
||||
|
||||
void G4PScorer::Score(const G4Step &aStep, const G4PStep &aPstep)
|
||||
{
|
||||
G4Track *track = aStep.GetTrack();
|
||||
|
||||
if (track->GetTrackStatus()==fStopAndKill) {
|
||||
G4cout << " track status is StopAndKill -> do nothing" << G4endl;
|
||||
}
|
||||
// do the scoring
|
||||
else {
|
||||
G4double weight = track->GetWeight();
|
||||
// the map fPtkTallys, the map nametallys and the "G4Sigma" will
|
||||
// be setup the first time they are accesed.
|
||||
G4PTouchableKey post_ptk(aPstep.fPostTouchableKey);
|
||||
if (aPstep.fCrossBoundary) {
|
||||
// Pstep crosses boundary
|
||||
fPtkTallys[post_ptk]["WeighteOfHistorysEntering"].Xin(weight);
|
||||
fPtkTallys[post_ptk]["HistorysEnteringWeighted"].Xin(1,weight);
|
||||
fPtkTallys[post_ptk]["EnergyEnteringHistoryWeighted"].
|
||||
Xin(track->GetKineticEnergy(), weight);
|
||||
}
|
||||
else {
|
||||
// Pstep with both points in the same I volume
|
||||
if (aStep.GetPostStepPoint()->GetStepStatus() != fGeomBoundary) {
|
||||
fPtkTallys[post_ptk]["WeighteOfCollisions"].Xin(weight);
|
||||
fPtkTallys[post_ptk]["CollisionsWeighted"].Xin(1,weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const G4PScorer &ps)
|
||||
{
|
||||
out << ps.GetMapPtkTallys();
|
||||
return out;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParallelGCellFinder.cc,v 1.1 2002/10/16 16:27:41 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4ParallelGCellFinder.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ParallelGCellFinder.hh"
|
||||
#include "G4VParallelStepper.hh"
|
||||
|
||||
|
||||
G4ParallelGCellFinder::
|
||||
G4ParallelGCellFinder(const G4VParallelStepper &astepper):
|
||||
fPStepper(astepper)
|
||||
{}
|
||||
|
||||
G4ParallelGCellFinder::~G4ParallelGCellFinder()
|
||||
{}
|
||||
|
||||
G4GeometryCell G4ParallelGCellFinder::
|
||||
GetPreGeometryCell(const G4Step &aStep) const {
|
||||
G4GeometryCell g(fPStepper.GetPStep().GetPreGeometryCell());
|
||||
return g;
|
||||
}
|
||||
|
||||
G4GeometryCell G4ParallelGCellFinder::
|
||||
GetPostGeometryCell(const G4Step &aStep) const {
|
||||
G4GeometryCell g(fPStepper.GetPStep().GetPostGeometryCell());
|
||||
return g;
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParallelGeometrySampler.cc,v 1.6 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4ParallelGeometrySampler.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "G4ParallelGeometrySampler.hh"
|
||||
|
||||
#include "G4VIStore.hh"
|
||||
#include "G4VScorer.hh"
|
||||
|
||||
#include "G4ParallelTransportConfigurator.hh"
|
||||
#include "G4PScoreConfigurator.hh"
|
||||
#include "G4PImportanceConfigurator.hh"
|
||||
#include "G4WeightCutOffConfigurator.hh"
|
||||
#include "G4ParallelGCellFinder.hh"
|
||||
|
||||
G4ParallelGeometrySampler::
|
||||
G4ParallelGeometrySampler(G4VPhysicalVolume &worldvolume,
|
||||
const G4String &particlename)
|
||||
:
|
||||
fParticleName(particlename),
|
||||
fParallelWorld(worldvolume),
|
||||
fParallelTransportConfigurator(0),
|
||||
fPImportanceConfigurator(0),
|
||||
fPScoreConfigurator(0),
|
||||
fGCellFinder(0),
|
||||
fWeightCutOffConfigurator(0),
|
||||
fIStore(0),
|
||||
fIsConfigured(false)
|
||||
{}
|
||||
|
||||
G4ParallelGeometrySampler::~G4ParallelGeometrySampler(){
|
||||
ClearSampling();
|
||||
};
|
||||
|
||||
void G4ParallelGeometrySampler::ClearSampling() {
|
||||
if (fParallelTransportConfigurator) {
|
||||
delete fParallelTransportConfigurator;
|
||||
fParallelTransportConfigurator = 0;
|
||||
}
|
||||
if (fPImportanceConfigurator) {
|
||||
delete fPImportanceConfigurator;
|
||||
fPImportanceConfigurator = 0;
|
||||
}
|
||||
if (fPScoreConfigurator) {
|
||||
delete fPScoreConfigurator;
|
||||
fPScoreConfigurator = 0;
|
||||
}
|
||||
if (fWeightCutOffConfigurator) {
|
||||
delete fWeightCutOffConfigurator;
|
||||
fWeightCutOffConfigurator = 0;
|
||||
}
|
||||
if (fGCellFinder) {
|
||||
delete fGCellFinder;
|
||||
fGCellFinder = 0;
|
||||
}
|
||||
fIStore = 0;
|
||||
fConfigurators.clear();
|
||||
fIsConfigured = false;
|
||||
};
|
||||
|
||||
G4bool G4ParallelGeometrySampler::IsConfigured() const{
|
||||
G4bool isconf = false;
|
||||
if (fIsConfigured) {
|
||||
G4cout << "G4ParallelGeometrySampler::CheckIfInit some initalization exists, use ClearSampling() before a new initialization" << G4endl;
|
||||
isconf = true;
|
||||
}
|
||||
return isconf;
|
||||
}
|
||||
|
||||
void G4ParallelGeometrySampler::
|
||||
PrepareImportanceSampling(G4VIStore *istore,
|
||||
const G4VImportanceAlgorithm
|
||||
*ialg) {
|
||||
fIStore = istore;
|
||||
fPImportanceConfigurator =
|
||||
new G4PImportanceConfigurator(fParticleName,
|
||||
fParallelWorld,
|
||||
*istore,
|
||||
ialg);
|
||||
if (!fPImportanceConfigurator) {
|
||||
G4Exception("ERROR:G4ParallelGeometrySampler::PrepareImportanceSampling: new failed to create G4PImportanceConfigurator!");
|
||||
}
|
||||
}
|
||||
|
||||
void G4ParallelGeometrySampler::PrepareScoring(G4VScorer *scorer){
|
||||
fPScoreConfigurator =
|
||||
new G4PScoreConfigurator(fParticleName,
|
||||
fParallelWorld.
|
||||
GetParallelStepper(),
|
||||
*scorer);
|
||||
if (!fPScoreConfigurator) {
|
||||
G4Exception("ERROR:G4ParallelGeometrySampler::PrepareScoring: new failed to create G4PScoreConfigurator!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void G4ParallelGeometrySampler::
|
||||
PrepareWeightRoulett(G4double wsuvive, G4double wlimit, G4double isource){
|
||||
fGCellFinder = new G4ParallelGCellFinder(fParallelWorld.
|
||||
GetParallelStepper());
|
||||
if (!fGCellFinder) {
|
||||
G4Exception("ERROR:G4ParallelGeometrySampler::PrepareWeightRoulett: new failed to create G4ParallelGCellFinder!");
|
||||
}
|
||||
|
||||
fWeightCutOffConfigurator =
|
||||
new G4WeightCutOffConfigurator(fParticleName,
|
||||
wsuvive,
|
||||
wlimit,
|
||||
isource,
|
||||
fIStore,
|
||||
*fGCellFinder);
|
||||
if (!fWeightCutOffConfigurator) {
|
||||
G4Exception("ERROR:G4ParallelGeometrySampler::PrepareWeightRoulett: new failed to create G4WeightCutOffConfigurator!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void G4ParallelGeometrySampler::Configure(){
|
||||
|
||||
if (!IsConfigured()) {
|
||||
fIsConfigured = true;
|
||||
|
||||
if (fPScoreConfigurator) {
|
||||
fConfigurators.push_back(fPScoreConfigurator);
|
||||
}
|
||||
if (fPImportanceConfigurator) {
|
||||
fConfigurators.push_back(fPImportanceConfigurator);
|
||||
}
|
||||
else {
|
||||
fParallelTransportConfigurator =
|
||||
new G4ParallelTransportConfigurator(fParticleName,
|
||||
fParallelWorld);
|
||||
if (!fParallelTransportConfigurator) {
|
||||
G4Exception("ERROR:G4ParallelGeometrySampler::Configure: new failed to create G4ParallelTransportConfigurator!");
|
||||
}
|
||||
fConfigurators.push_back(fParallelTransportConfigurator);
|
||||
}
|
||||
G4VSamplerConfigurator *preConf = 0;
|
||||
for (G4Configurators::iterator it = fConfigurators.begin();
|
||||
it != fConfigurators.end(); it++) {
|
||||
G4VSamplerConfigurator *currConf =*it;
|
||||
currConf->Configure(preConf);
|
||||
preConf = *it;
|
||||
}
|
||||
|
||||
if (fWeightCutOffConfigurator) {
|
||||
fWeightCutOffConfigurator->Configure(0);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParallelImportanceProcess.cc,v 1.3 2002/05/31 08:06:34 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ParallelImportanceProcess.cc,v 1.8 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -34,15 +34,23 @@
|
||||
#include "G4ParallelImportanceProcess.hh"
|
||||
#include "G4VImportanceSplitExaminer.hh"
|
||||
#include "g4std/strstream"
|
||||
#include "G4VTrackTerminator.hh"
|
||||
|
||||
G4ParallelImportanceProcess::
|
||||
G4ParallelImportanceProcess(const G4VImportanceSplitExaminer &aImportanceSplitExaminer,
|
||||
G4VPGeoDriver &pgeodriver,
|
||||
G4VParallelStepper &aStepper,
|
||||
const G4String &aName)
|
||||
: G4ParallelTransport(pgeodriver, aStepper, aName),
|
||||
fParticleChange(G4ParallelTransport::fParticleChange),
|
||||
fImportanceSplitExaminer(aImportanceSplitExaminer)
|
||||
G4VPGeoDriver &pgeodriver,
|
||||
G4VParallelStepper &aStepper,
|
||||
const G4VTrackTerminator *TrackTerminator,
|
||||
const G4String &aName)
|
||||
:
|
||||
G4ParallelTransport(pgeodriver, aStepper, aName),
|
||||
fTrackTerminator(TrackTerminator ? TrackTerminator : this),
|
||||
fParticleChange(G4ParallelTransport::fParticleChange),
|
||||
fImportanceSplitExaminer(aImportanceSplitExaminer),
|
||||
fImportancePostStepDoIt(*fTrackTerminator)
|
||||
{}
|
||||
|
||||
G4ParallelImportanceProcess::~G4ParallelImportanceProcess()
|
||||
{}
|
||||
|
||||
|
||||
@@ -66,3 +74,14 @@ void G4ParallelImportanceProcess::Error(const G4String &m)
|
||||
G4cout << "ERROR - G4ImportanceProcess::" << m << G4endl;
|
||||
G4Exception("Program aborted.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void G4ParallelImportanceProcess::KillTrack() const{
|
||||
fParticleChange->SetStatusChange(fStopAndKill);
|
||||
}
|
||||
|
||||
|
||||
const G4String &G4ParallelImportanceProcess::GetName() const {
|
||||
return G4ParallelTransport::GetProcessName();
|
||||
}
|
||||
|
||||
@@ -1,110 +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: G4ParallelImportanceSampler.cc,v 1.1 2002/05/31 10:16:02 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4ParallelImportanceSampler.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ParallelImportanceSampler.hh"
|
||||
#include "G4ParallelWorld.hh"
|
||||
#include "G4ParallelWorld.hh"
|
||||
#include "G4IStore.hh"
|
||||
#include "G4ImportanceSplitExaminer.hh"
|
||||
#include "G4ParallelImportanceProcess.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
#include "G4ImportanceAlgorithm.hh"
|
||||
|
||||
G4ParallelImportanceSampler::
|
||||
G4ParallelImportanceSampler(G4VIStore &is,
|
||||
const G4String &particlename,
|
||||
const G4VImportanceAlgorithm *ialg)
|
||||
:fParticleName(particlename),
|
||||
fParallelWorld(*(new G4ParallelWorld(is.GetWorldVolume()))),
|
||||
fCreatedPW(true),
|
||||
fDeleteAlg( ( ! ialg) ),
|
||||
fIalgorithm(( (fDeleteAlg) ?
|
||||
new G4ImportanceAlgorithm : ialg)),
|
||||
fExaminer(new G4ImportanceSplitExaminer(*fIalgorithm,
|
||||
fParallelWorld.
|
||||
GetParallelStepper(),
|
||||
is)),
|
||||
fParallelImportanceProcess(0)
|
||||
{}
|
||||
|
||||
G4ParallelImportanceSampler::
|
||||
G4ParallelImportanceSampler(G4VIStore &is,
|
||||
const G4String &pname,
|
||||
G4ParallelWorld &pworld,
|
||||
const G4VImportanceAlgorithm *ialg) :
|
||||
fParticleName(pname),
|
||||
fParallelWorld(pworld),
|
||||
fCreatedPW(false),
|
||||
fDeleteAlg( ( ! ialg) ),
|
||||
fIalgorithm(( (fDeleteAlg) ?
|
||||
new G4ImportanceAlgorithm : ialg)),
|
||||
fExaminer(new G4ImportanceSplitExaminer(*fIalgorithm,
|
||||
fParallelWorld.
|
||||
GetParallelStepper(),
|
||||
is)),
|
||||
fParallelImportanceProcess(0)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
G4ParallelImportanceProcess *
|
||||
G4ParallelImportanceSampler::CreateParallelImportanceProcess()
|
||||
{
|
||||
if (!fParallelImportanceProcess) {
|
||||
fParallelImportanceProcess =
|
||||
new G4ParallelImportanceProcess(*fExaminer,
|
||||
fParallelWorld.
|
||||
GetGeoDriver(),
|
||||
fParallelWorld.
|
||||
GetParallelStepper());
|
||||
}
|
||||
return fParallelImportanceProcess;
|
||||
}
|
||||
|
||||
void G4ParallelImportanceSampler::Initialize()
|
||||
{
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.AddProcessAsSecondDoIt(CreateParallelImportanceProcess());
|
||||
}
|
||||
|
||||
G4ParallelImportanceSampler::~G4ParallelImportanceSampler()
|
||||
{
|
||||
if (fParallelImportanceProcess) {
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.RemoveProcess(fParallelImportanceProcess);
|
||||
delete fParallelImportanceProcess;
|
||||
}
|
||||
if (fCreatedPW) delete &fParallelWorld;
|
||||
if (fDeleteAlg) delete fIalgorithm;
|
||||
delete fExaminer;
|
||||
}
|
||||
@@ -1,86 +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: G4ParallelImportanceScoreSampler.cc,v 1.1 2002/05/31 10:16:02 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4ParallelImportanceScoreSampler.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ParallelWorld.hh"
|
||||
#include "G4ParallelImportanceScoreSampler.hh"
|
||||
#include "G4ParallelImportanceSampler.hh"
|
||||
#include "G4ParallelWorld.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
#include "G4VIStore.hh"
|
||||
#include "G4VPScorer.hh"
|
||||
#include "G4PScoreProcess.hh"
|
||||
|
||||
G4ParallelImportanceScoreSampler::
|
||||
G4ParallelImportanceScoreSampler(G4VIStore &is,
|
||||
G4VPScorer &ascorer,
|
||||
const G4String &particlename,
|
||||
const G4VImportanceAlgorithm *ialg) :
|
||||
fParticleName(particlename),
|
||||
fParallelWorld(*(new G4ParallelWorld(is.GetWorldVolume()))),
|
||||
fParallelImportanceSampler(*(new
|
||||
G4ParallelImportanceSampler(is,
|
||||
fParticleName,
|
||||
fParallelWorld,
|
||||
ialg))),
|
||||
fPScorer(ascorer),
|
||||
fPScoreProcess(0)
|
||||
{}
|
||||
|
||||
G4ParallelImportanceScoreSampler::~G4ParallelImportanceScoreSampler()
|
||||
{
|
||||
if (fPScoreProcess) {
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.RemoveProcess(fPScoreProcess);
|
||||
delete fPScoreProcess;
|
||||
}
|
||||
delete &fParallelImportanceSampler;
|
||||
delete &fParallelWorld;
|
||||
}
|
||||
|
||||
G4PScoreProcess *
|
||||
G4ParallelImportanceScoreSampler::CreateParallelScoreProcess()
|
||||
{
|
||||
if (!fPScoreProcess) {
|
||||
fPScoreProcess =
|
||||
new G4PScoreProcess(fParallelWorld.
|
||||
GetParallelStepper(), fPScorer);
|
||||
}
|
||||
return fPScoreProcess;
|
||||
}
|
||||
|
||||
void G4ParallelImportanceScoreSampler::Initialize()
|
||||
{
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.AddProcessAsSecondDoIt(CreateParallelScoreProcess());
|
||||
fParallelImportanceSampler.Initialize();
|
||||
}
|
||||
@@ -1,88 +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: G4ParallelScoreSampler.cc,v 1.2 2002/05/31 13:49:46 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4ParallelScoreSampler.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ParallelScoreSampler.hh"
|
||||
#include "G4PScoreProcess.hh"
|
||||
#include "G4ProcessPlacer.hh"
|
||||
#include "G4ParallelWorld.hh"
|
||||
#include "G4ParallelTransport.hh"
|
||||
|
||||
G4ParallelScoreSampler::
|
||||
G4ParallelScoreSampler(G4VPhysicalVolume &worldvolume,
|
||||
const G4String &particlename,
|
||||
G4VPScorer &scorer) :
|
||||
fParticleName(particlename),
|
||||
fParallelWorld(*(new G4ParallelWorld(worldvolume))),
|
||||
fPScorer(scorer),
|
||||
fPScorerProcess(0),
|
||||
fParallelTransport(0)
|
||||
{}
|
||||
|
||||
G4ParallelScoreSampler::~G4ParallelScoreSampler()
|
||||
{
|
||||
if (fPScorerProcess) {
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.RemoveProcess(fPScorerProcess);
|
||||
delete fPScorerProcess;
|
||||
}
|
||||
delete &fParallelWorld;
|
||||
}
|
||||
|
||||
|
||||
G4PScoreProcess *G4ParallelScoreSampler::CreateParallelScoreProcess()
|
||||
{
|
||||
if (!fPScorerProcess) {
|
||||
fPScorerProcess =
|
||||
new G4PScoreProcess(fParallelWorld.GetParallelStepper(),
|
||||
fPScorer);
|
||||
}
|
||||
return fPScorerProcess;
|
||||
}
|
||||
|
||||
G4ParallelTransport *G4ParallelScoreSampler::CreateParallelTransport()
|
||||
{
|
||||
if (!fParallelTransport) {
|
||||
fParallelTransport = new G4ParallelTransport(fParallelWorld.
|
||||
GetGeoDriver(),
|
||||
fParallelWorld.
|
||||
GetParallelStepper());
|
||||
}
|
||||
return fParallelTransport;
|
||||
}
|
||||
|
||||
void G4ParallelScoreSampler::Initialize()
|
||||
{
|
||||
G4ProcessPlacer placer(fParticleName);
|
||||
placer.AddProcessAsSecondDoIt(CreateParallelScoreProcess());
|
||||
placer.AddProcessAsSecondDoIt(CreateParallelTransport());
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParallelTransport.cc,v 1.4 2002/05/31 13:49:47 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ParallelTransport.cc,v 1.8 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -34,18 +34,24 @@
|
||||
#include "G4ParallelTransport.hh"
|
||||
#include "G4VPGeoDriver.hh"
|
||||
#include "G4VParallelStepper.hh"
|
||||
#include "G4Pstring.hh"
|
||||
#include "g4std/strstream"
|
||||
|
||||
|
||||
G4ParallelTransport::G4ParallelTransport(G4VPGeoDriver &pgeodriver,
|
||||
G4VParallelStepper &aStepper,
|
||||
const G4String &aName)
|
||||
: G4VProcess(aName),
|
||||
fPgeodriver(pgeodriver),
|
||||
fPStepper(aStepper),
|
||||
:
|
||||
G4VProcess(aName),
|
||||
fParticleChange(new G4ParticleChange),
|
||||
fPgeodriver(pgeodriver),
|
||||
fPStepper(aStepper),
|
||||
fCrossBoundary(false),
|
||||
fInitStep(false)
|
||||
{
|
||||
fParticleChange = new G4ParticleChange;
|
||||
if (!fParticleChange) {
|
||||
G4Exception("ERROR:G4ParallelTransport::G4ParallelTransport: new failed to create G4ParticleChange!");
|
||||
}
|
||||
|
||||
G4VProcess::pParticleChange = fParticleChange;
|
||||
}
|
||||
|
||||
@@ -66,7 +72,7 @@ PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
G4double stepLength;
|
||||
G4double stepLength = 0;
|
||||
|
||||
// if this function is called on a new track let the navigator
|
||||
// know about it
|
||||
@@ -77,7 +83,7 @@ PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
|
||||
stepLength = fPgeodriver.
|
||||
ComputeStepLengthInit(aTrack.GetPosition(),
|
||||
aTrack.GetMomentumDirection());
|
||||
fPStepper.Init(fPgeodriver.GetCurrentTouchableKey());
|
||||
fPStepper.Init(fPgeodriver.GetCurrentGeometryCell());
|
||||
fCrossBoundary = false;
|
||||
}
|
||||
else if (fCrossBoundary) {
|
||||
@@ -101,10 +107,15 @@ G4VParticleChange *
|
||||
G4ParallelTransport::PostStepDoIt(const G4Track& aTrack,
|
||||
const G4Step& aStep)
|
||||
{
|
||||
if (aStep.GetStepLength() == 0.) {
|
||||
G4String m = "G4PArallelTransport::PostStepDoIt: StepLength() == 0.\n";
|
||||
m += "pos: " + str(aTrack.GetPosition()) + ", "
|
||||
+ "dir: " + str(aTrack.GetMomentumDirection()) + "\n";
|
||||
if (!(aStep.GetStepLength() > 0.)) {
|
||||
char st[1000];
|
||||
G4std::ostrstream os(st,1000);
|
||||
os << "G4PArallelTransport::InitPostDoIt: StepLength() == 0.\n"
|
||||
<< "pos: " << aTrack.GetPosition() << ", "
|
||||
<< "dir: " << aTrack.GetMomentumDirection() << "\n"
|
||||
<< '\0';
|
||||
G4String m(st);
|
||||
|
||||
Warning(m);
|
||||
}
|
||||
|
||||
@@ -113,7 +124,7 @@ G4ParallelTransport::PostStepDoIt(const G4Track& aTrack,
|
||||
fCrossBoundary = true;
|
||||
fPgeodriver.LocateOnBoundary(aTrack.GetPosition(),
|
||||
aTrack.GetMomentumDirection());
|
||||
fPStepper.Update(fPgeodriver.GetCurrentTouchableKey());
|
||||
fPStepper.Update(fPgeodriver.GetCurrentGeometryCell());
|
||||
|
||||
return fParticleChange;
|
||||
}
|
||||
@@ -129,3 +140,30 @@ void G4ParallelTransport::Warning(const G4String &m)
|
||||
G4cout << "WARNING - G4ParallelTransport: " << G4endl;
|
||||
G4cout << m << G4endl;
|
||||
}
|
||||
|
||||
G4double G4ParallelTransport::
|
||||
AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*) {
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
G4double G4ParallelTransport::
|
||||
AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*) {
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4ParallelTransport::
|
||||
AtRestDoIt(const G4Track&, const G4Step&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4ParallelTransport::
|
||||
AlongStepDoIt(const G4Track&, const G4Step&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParallelTransportConfigurator.cc,v 1.3 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ParallelTransportConfigurator
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ParallelTransportConfigurator.hh"
|
||||
#include "G4ParallelWorld.hh"
|
||||
|
||||
G4ParallelTransportConfigurator::
|
||||
G4ParallelTransportConfigurator(const G4String &particlename,
|
||||
G4ParallelWorld &pworld)
|
||||
:
|
||||
fPlacer(particlename),
|
||||
fPWorld(pworld),
|
||||
fParallelTransport(0)
|
||||
{}
|
||||
|
||||
G4ParallelTransportConfigurator::
|
||||
~G4ParallelTransportConfigurator(){
|
||||
if (fParallelTransport) {
|
||||
fPlacer.RemoveProcess(fParallelTransport);
|
||||
delete fParallelTransport;
|
||||
}
|
||||
}
|
||||
|
||||
void G4ParallelTransportConfigurator::
|
||||
Configure(G4VSamplerConfigurator *preConf){
|
||||
fParallelTransport = new
|
||||
G4ParallelTransport(fPWorld.GetGeoDriver(),
|
||||
fPWorld.GetParallelStepper());
|
||||
if (!fParallelTransport) {
|
||||
G4Exception("ERROR:G4ParallelTransportConfigurator::Configure new failed to create G4ParallelTransport!");
|
||||
}
|
||||
fPlacer.AddProcessAsSecondDoIt(fParallelTransport);
|
||||
}
|
||||
|
||||
const G4VTrackTerminator *G4ParallelTransportConfigurator::
|
||||
GetTrackTerminator() const {
|
||||
return 0;
|
||||
}
|
||||
@@ -1,113 +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: G4ParallelWeightWindowProcess.cc,v 1.3 2002/05/31 14:50:38 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4ParallelWeightWindowProcess.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ParallelWeightWindowProcess.hh"
|
||||
#include "G4VIStore.hh"
|
||||
#include "G4VParallelStepper.hh"
|
||||
#include "G4VWeightWindowAlgorithm.hh"
|
||||
|
||||
#include "G4Pstring.hh"
|
||||
|
||||
G4ParallelWeightWindowProcess::G4ParallelWeightWindowProcess(G4VIStore &aIstore,
|
||||
G4VParallelStepper &aStepper,
|
||||
G4VWeightWindowAlgorithm &aWWAlgorithm,
|
||||
const G4String &aName)
|
||||
: G4VProcess(aName),
|
||||
fIStore(aIstore),
|
||||
fPStepper(aStepper),
|
||||
fWWAlgorithm(aWWAlgorithm),
|
||||
fNsplit_Weight(G4Nsplit_Weight(0,0)),
|
||||
fInitStep(false)
|
||||
{
|
||||
fParticleChange = new G4ParticleChange;
|
||||
G4VProcess::pParticleChange = fParticleChange;
|
||||
}
|
||||
|
||||
G4ParallelWeightWindowProcess::~G4ParallelWeightWindowProcess()
|
||||
{
|
||||
delete fParticleChange;
|
||||
}
|
||||
|
||||
void G4ParallelWeightWindowProcess::StartTracking(){
|
||||
fInitStep = true;
|
||||
}
|
||||
void G4ParallelWeightWindowProcess::EndTracking(){}
|
||||
|
||||
G4double
|
||||
G4ParallelWeightWindowProcess::
|
||||
PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
*condition = NotForced;
|
||||
G4double stepLength = kInfinity;
|
||||
|
||||
if (aTrack.GetCurrentStepNumber() == 1
|
||||
&& aTrack.GetTrackStatus() != fStopAndKill) {
|
||||
fInitStep = false;
|
||||
G4double importance = fIStore.GetImportance(fPStepper.GetPStep().fPostTouchableKey);
|
||||
G4double weight = aTrack.GetWeight();
|
||||
|
||||
fNsplit_Weight = fWWAlgorithm.Calculate(weight, importance);
|
||||
|
||||
if (aTrack.GetWeight() != fNsplit_Weight.fW ||
|
||||
fNsplit_Weight.fN != 1) {
|
||||
stepLength = 0.;
|
||||
}
|
||||
}
|
||||
|
||||
return stepLength;
|
||||
}
|
||||
|
||||
G4VParticleChange *
|
||||
G4ParallelWeightWindowProcess::PostStepDoIt(const G4Track& aTrack,
|
||||
const G4Step& aStep)
|
||||
{
|
||||
fParticleChange->Initialize(aTrack);
|
||||
|
||||
fImportancePostStepDoIt.DoIt(aTrack, fParticleChange, fNsplit_Weight);
|
||||
|
||||
return fParticleChange;
|
||||
}
|
||||
|
||||
void G4ParallelWeightWindowProcess::Error(const G4String &m)
|
||||
{
|
||||
G4cout << "ERROR - G4ParallelWeightWindowProcess::" << m << G4endl;
|
||||
G4Exception("Program aborted.");
|
||||
}
|
||||
|
||||
void G4ParallelWeightWindowProcess::Warning(const G4String &m)
|
||||
{
|
||||
G4cout << "WARNING - G4ParallelWeightWindowProcess: " << G4endl;
|
||||
G4cout << m << G4endl;
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ProcessPlacer.cc,v 1.6 2002/05/31 10:16:02 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ProcessPlacer.cc,v 1.11 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -37,28 +37,30 @@
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
G4ProcessPlacer::G4ProcessPlacer(const G4String &particlename)
|
||||
: G4VProcessPlacer(particlename),
|
||||
fParticleName(particlename)
|
||||
{
|
||||
G4cout << "+++ G4ProcessPlacer::G4ProcessPlacer: for: " << particlename
|
||||
<< G4endl;
|
||||
}
|
||||
: fParticleName(particlename)
|
||||
{}
|
||||
|
||||
G4ProcessPlacer::~G4ProcessPlacer()
|
||||
{}
|
||||
|
||||
void G4ProcessPlacer::RemoveProcess(G4VProcess *process){
|
||||
G4cout << "=== G4ProcessPlacer::RemoveProcess: for: " << fParticleName
|
||||
<< G4endl;
|
||||
G4cout << " ProcessName: " << process->GetProcessName()
|
||||
<< ", will be removed!" << G4endl;
|
||||
|
||||
G4cout << "The initial Vectors: " << G4endl;
|
||||
G4cout << " The initial Vectors: " << G4endl;
|
||||
PrintPostStepGPILVec();
|
||||
PrintPostStepDoItVec();
|
||||
|
||||
GetProcessManager().RemoveProcess(process);
|
||||
GetProcessManager()->RemoveProcess(process);
|
||||
|
||||
G4cout << "The final Vectors: " << G4endl;
|
||||
G4cout << " The final Vectors: " << G4endl;
|
||||
PrintPostStepGPILVec();
|
||||
PrintPostStepDoItVec();
|
||||
|
||||
G4cout << "================================================" << G4endl;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void G4ProcessPlacer::AddProcessAs(G4VProcess *process, SecondOrLast sol)
|
||||
@@ -71,7 +73,7 @@ void G4ProcessPlacer::AddProcessAs(G4VProcess *process, SecondOrLast sol)
|
||||
|
||||
|
||||
if (sol == eLast) {
|
||||
GetProcessManager().AddProcess(process,
|
||||
GetProcessManager()->AddProcess(process,
|
||||
ordInActive,
|
||||
ordInActive,
|
||||
ordLast);
|
||||
@@ -79,7 +81,7 @@ void G4ProcessPlacer::AddProcessAs(G4VProcess *process, SecondOrLast sol)
|
||||
else if (sol == eSecond) {
|
||||
// get transportation process
|
||||
G4VProcess *transportation =
|
||||
(* (GetProcessManager().GetProcessList()))[0];
|
||||
(* (GetProcessManager()->GetProcessList()))[0];
|
||||
|
||||
if (!transportation) {
|
||||
G4Exception(" G4ProcessPlacer:: could not get process id=0");
|
||||
@@ -90,11 +92,11 @@ void G4ProcessPlacer::AddProcessAs(G4VProcess *process, SecondOrLast sol)
|
||||
}
|
||||
|
||||
// place the given proces as first for the moment
|
||||
GetProcessManager().AddProcess(process);
|
||||
GetProcessManager().SetProcessOrderingToFirst(process,
|
||||
GetProcessManager()->AddProcess(process);
|
||||
GetProcessManager()->SetProcessOrderingToFirst(process,
|
||||
idxPostStep);
|
||||
// place transportation first again
|
||||
GetProcessManager().SetProcessOrderingToFirst(transportation,
|
||||
GetProcessManager()->SetProcessOrderingToFirst(transportation,
|
||||
idxPostStep);
|
||||
}
|
||||
|
||||
@@ -109,21 +111,23 @@ void G4ProcessPlacer::AddProcessAs(G4VProcess *process, SecondOrLast sol)
|
||||
|
||||
void G4ProcessPlacer::AddProcessAsSecondDoIt(G4VProcess *process)
|
||||
{
|
||||
G4cout << "=== G4ProcessPlacer::AddProcessAsSecondDoIt ===" << G4endl;
|
||||
G4cout << "=== G4ProcessPlacer::AddProcessAsSecondDoIt: for: "
|
||||
<< fParticleName << G4endl;
|
||||
AddProcessAs(process, eSecond);
|
||||
}
|
||||
|
||||
void G4ProcessPlacer::AddProcessAsLastDoIt(G4VProcess *process)
|
||||
{
|
||||
G4cout << "=== G4ProcessPlacer::AddProcessAsLastDoIt ===" << G4endl;
|
||||
G4cout << "=== G4ProcessPlacer::AddProcessAsLastDoIt: for: "
|
||||
<< fParticleName << G4endl;
|
||||
AddProcessAs(process, eLast);
|
||||
}
|
||||
|
||||
G4ProcessManager &G4ProcessPlacer::GetProcessManager()
|
||||
G4ProcessManager *G4ProcessPlacer::GetProcessManager()
|
||||
{
|
||||
// get particle iterator to add processes ---------------------
|
||||
G4ParticleTable* theParticleTable;
|
||||
G4ParticleTable::G4PTblDicIterator* theParticleIterator;
|
||||
G4ParticleTable* theParticleTable = 0;
|
||||
G4ParticleTable::G4PTblDicIterator* theParticleIterator = 0;
|
||||
theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
theParticleIterator = theParticleTable->GetIterator();
|
||||
// -------------------------------------------------------
|
||||
@@ -138,31 +142,37 @@ G4ProcessManager &G4ProcessPlacer::GetProcessManager()
|
||||
}
|
||||
}
|
||||
// ---------------------------------------------------------
|
||||
if (!processmanager) G4Exception(" G4ProcessPlacer::GetProcessManager: no ProcessSampler");
|
||||
return *processmanager;
|
||||
if (!processmanager) {
|
||||
G4Exception(" G4ProcessPlacer::GetProcessManager: no ProcessSampler");
|
||||
}
|
||||
return processmanager;
|
||||
}
|
||||
|
||||
|
||||
void G4ProcessPlacer::PrintPostStepGPILVec(){
|
||||
G4cout << "GPIL Vector: " << G4endl;
|
||||
G4ProcessVector* processGPILVec =
|
||||
GetProcessManager().GetPostStepProcessVector(typeGPIL);
|
||||
GetProcessManager()->GetPostStepProcessVector(typeGPIL);
|
||||
PrintProcVec(processGPILVec);
|
||||
}
|
||||
|
||||
void G4ProcessPlacer::PrintPostStepDoItVec(){
|
||||
G4cout << "DoIt Vector: " << G4endl;
|
||||
G4ProcessVector* processDoItVec =
|
||||
GetProcessManager().GetPostStepProcessVector(typeDoIt);
|
||||
GetProcessManager()->GetPostStepProcessVector(typeDoIt);
|
||||
PrintProcVec(processDoItVec);
|
||||
}
|
||||
|
||||
|
||||
void G4ProcessPlacer::PrintProcVec(G4ProcessVector* processVec)
|
||||
{
|
||||
if (!processVec) G4Exception("G4ProcessPlacer::G4ProcessPlacer: no processVec");
|
||||
if (!processVec) {
|
||||
G4Exception("G4ProcessPlacer::G4ProcessPlacer: no processVec");
|
||||
}
|
||||
G4int len = processVec->length();
|
||||
if (len==0) G4Exception("G4ProcessPlacer::G4ProcessPlacer:processVec len = 0");
|
||||
if (len==0) {
|
||||
G4Exception("G4ProcessPlacer::G4ProcessPlacer:processVec len = 0");
|
||||
}
|
||||
for (int pi=0; pi<len; pi++) {
|
||||
G4VProcess *p = (*processVec)[pi];
|
||||
if (p) {
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Transportation.cc,v 1.29 2002/05/17 07:10:23 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4Transportation.cc,v 1.31 2002/11/08 23:52:34 jacek Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 include file implementation
|
||||
@@ -435,6 +435,10 @@ G4VParticleChange* G4Transportation::AlongStepDoIt( const G4Track& track,
|
||||
// Another (sometimes better way) is to use a user-limit maximum Step size
|
||||
// to alleviate this problem ..
|
||||
|
||||
// Introducing smooth curved trajectories (jacek 31/10/2002)
|
||||
fParticleChange.SetPointerToVectorOfAuxiliaryPoints
|
||||
(fFieldPropagator->GimmeTrajectoryVectorAndForgetIt() );
|
||||
|
||||
return &fParticleChange ;
|
||||
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserSpecialCuts.cc,v 1.4 2001/07/11 10:08:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4UserSpecialCuts.cc,v 1.7 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// History
|
||||
|
||||
@@ -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: G4VProcessPlacer.cc,v 1.1 2002/10/16 16:27:42 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VProcessPlacer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VProcessPlacer.hh"
|
||||
|
||||
G4VProcessPlacer::G4VProcessPlacer()
|
||||
{}
|
||||
G4VProcessPlacer::~G4VProcessPlacer()
|
||||
{}
|
||||
@@ -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: G4VSampler.cc,v 1.1 2002/10/16 16:27:42 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VSampler.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VSampler.hh"
|
||||
|
||||
G4VSampler::G4VSampler()
|
||||
{}
|
||||
|
||||
G4VSampler::~G4VSampler()
|
||||
{}
|
||||
@@ -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: G4VSamplerConfigurator.cc,v 1.1 2002/10/16 16:27:42 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VSamplerConfigurator.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "G4VSamplerConfigurator.hh"
|
||||
|
||||
|
||||
G4VSamplerConfigurator::G4VSamplerConfigurator()
|
||||
{}
|
||||
|
||||
G4VSamplerConfigurator::~G4VSamplerConfigurator()
|
||||
{}
|
||||
@@ -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: G4VTrackTerminator.cc,v 1.1 2002/10/16 16:27:42 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VTrackTerminator.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "G4VTrackTerminator.hh"
|
||||
|
||||
G4VTrackTerminator::G4VTrackTerminator()
|
||||
{}
|
||||
G4VTrackTerminator::~G4VTrackTerminator()
|
||||
{}
|
||||
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4WeightCutOffConfigurator.cc,v 1.3 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4WeightCutOffConfigurator
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4WeightCutOffConfigurator.hh"
|
||||
#include "G4WeightCutOffProcess.hh"
|
||||
|
||||
|
||||
G4WeightCutOffConfigurator::
|
||||
G4WeightCutOffConfigurator(const G4String &particlename,
|
||||
G4double wsurvival,
|
||||
G4double wlimit,
|
||||
G4double isource,
|
||||
G4VIStore *istore,
|
||||
const G4VGCellFinder &aGCellfinder)
|
||||
:
|
||||
fPlacer(particlename),
|
||||
fWeightCutOffProcess(new G4WeightCutOffProcess(wsurvival,
|
||||
wlimit,
|
||||
isource,
|
||||
istore,
|
||||
aGCellfinder)),
|
||||
fPlaced(false)
|
||||
{
|
||||
if (!fWeightCutOffProcess) {
|
||||
G4Exception("ERROR:G4WeightCutOffConfigurator::G4WeightCutOffConfigurator: new failed to create G4WeightCutOffProcess!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4WeightCutOffConfigurator::~G4WeightCutOffConfigurator(){
|
||||
if (fPlaced) {
|
||||
fPlacer.RemoveProcess(fWeightCutOffProcess);
|
||||
delete fWeightCutOffProcess;
|
||||
}
|
||||
}
|
||||
|
||||
void G4WeightCutOffConfigurator::
|
||||
Configure(G4VSamplerConfigurator *preConf){
|
||||
fPlacer.AddProcessAsLastDoIt(fWeightCutOffProcess);
|
||||
fPlaced = true;
|
||||
}
|
||||
|
||||
const G4VTrackTerminator *G4WeightCutOffConfigurator::
|
||||
GetTrackTerminator() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4WeightCutOffProcess.cc,v 1.4 2002/11/04 10:47:56 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4WeightCutOffProcess.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4WeightCutOffProcess.hh"
|
||||
#include "G4VScorer.hh"
|
||||
#include "G4GeometryCellStep.hh"
|
||||
#include "G4ParallelGCellFinder.hh"
|
||||
#include "G4MassGCellFinder.hh"
|
||||
#include "G4TouchableHandle.hh"
|
||||
#include "G4VIStore.hh"
|
||||
|
||||
G4WeightCutOffProcess::
|
||||
G4WeightCutOffProcess(G4double wsurvival,
|
||||
G4double wlimit,
|
||||
G4double isource,
|
||||
G4VIStore *istore,
|
||||
const G4VGCellFinder &aGCellFinder,
|
||||
const G4String &aName)
|
||||
:
|
||||
G4VProcess(aName),
|
||||
fParticleChange(new G4ParticleChange),
|
||||
fWeightSurvival(wsurvival),
|
||||
fWeightLimit(wlimit),
|
||||
fSourceImportance(isource),
|
||||
fIStore(istore),
|
||||
fGCellFinder(aGCellFinder)
|
||||
{
|
||||
if (!fParticleChange) {
|
||||
G4Exception("ERROR:G4WeightCutOffProcess::G4WeightCutOffProcess: new failed to create G4ParticleChange!");
|
||||
}
|
||||
G4VProcess::pParticleChange = fParticleChange;
|
||||
}
|
||||
|
||||
G4WeightCutOffProcess::~G4WeightCutOffProcess()
|
||||
{
|
||||
delete fParticleChange;
|
||||
}
|
||||
|
||||
G4double G4WeightCutOffProcess::
|
||||
PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
*condition = Forced;
|
||||
return kInfinity;
|
||||
}
|
||||
|
||||
G4VParticleChange *
|
||||
G4WeightCutOffProcess::PostStepDoIt(const G4Track& aTrack,
|
||||
const G4Step &aStep)
|
||||
{
|
||||
fParticleChange->Initialize(aTrack);
|
||||
G4GeometryCell postCell = fGCellFinder.GetPostGeometryCell(aStep);
|
||||
G4double R = fSourceImportance;
|
||||
if (fIStore) {
|
||||
G4double i = fIStore->GetImportance(postCell);
|
||||
if (i>0) {
|
||||
R/=i;
|
||||
}
|
||||
}
|
||||
G4double w = aTrack.GetWeight();
|
||||
if (w<R*fWeightLimit) {
|
||||
G4double ws = fWeightSurvival*R;
|
||||
G4double p = w/(ws);
|
||||
if (G4UniformRand()<p) {
|
||||
fParticleChange->SetStatusChange(fStopAndKill);
|
||||
}
|
||||
else {
|
||||
fParticleChange->SetWeightChange(ws);
|
||||
}
|
||||
}
|
||||
return fParticleChange;
|
||||
}
|
||||
|
||||
const G4String &G4WeightCutOffProcess::GetName() const {
|
||||
return theProcessName;
|
||||
}
|
||||
|
||||
|
||||
G4double G4WeightCutOffProcess::
|
||||
AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*) {
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
|
||||
G4double G4WeightCutOffProcess::
|
||||
AtRestGetPhysicalInteractionLength(const G4Track& ,
|
||||
G4ForceCondition*) {
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4WeightCutOffProcess::
|
||||
AtRestDoIt(const G4Track&, const G4Step&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4WeightCutOffProcess::
|
||||
AlongStepDoIt(const G4Track&, const G4Step&) {
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user