Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,277 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4IVContinuousDiscreteProcess.hh,v 2.5 1998/10/16 13:21:31 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 8 Mar. 1997 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
// modified 26 Mar. 1997 H.Kurashige
|
||||
// modified 16 Apr. 1997 L.Urban
|
||||
// modified AlongStepGPIL etc. 17 Dec. 1997 H.Kurashige
|
||||
// fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
|
||||
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
|
||||
|
||||
#ifndef G4IVContinuousDiscreteProcess_h
|
||||
#define G4IVContinuousDiscreteProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
class G4IVContinuousDiscreteProcess : public G4VProcess
|
||||
{
|
||||
// Abstract class which defines the public behavior of
|
||||
// discrete physics interactions.
|
||||
public:
|
||||
|
||||
G4IVContinuousDiscreteProcess(const G4String& ,
|
||||
G4ProcessType aType = fNotDefined );
|
||||
G4IVContinuousDiscreteProcess(G4IVContinuousDiscreteProcess &);
|
||||
|
||||
~G4IVContinuousDiscreteProcess();
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
) ;
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
// no operation in AtRestDoIt
|
||||
G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4ForceCondition*
|
||||
) { return -1.0; };
|
||||
|
||||
// no operation in AtRestDoIt
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
|
||||
protected:
|
||||
virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety
|
||||
)=0;
|
||||
private:
|
||||
// this is the returnd value of G4GPILSelection in
|
||||
// the arguments of AlongStepGPIL()
|
||||
G4GPILSelection valueGPILSelection;
|
||||
|
||||
protected:
|
||||
//------------------------------------------------------
|
||||
virtual void SubtractNumberOfInteractionLengthLeft(
|
||||
G4double previousStepSize) ;
|
||||
|
||||
// these two methods are set/get methods for valueGPILSelection
|
||||
void SetGPILSelection(G4GPILSelection selection)
|
||||
{ valueGPILSelection = selection;};
|
||||
|
||||
G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator as private
|
||||
G4IVContinuousDiscreteProcess();
|
||||
G4IVContinuousDiscreteProcess & operator=(const G4IVContinuousDiscreteProcess &right);
|
||||
|
||||
protected:
|
||||
G4PhysicsTable* theNlambdaTable ;
|
||||
G4PhysicsTable* theInverseNlambdaTable ;
|
||||
G4double BIGSTEP ;
|
||||
};
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
|
||||
|
||||
inline void G4IVContinuousDiscreteProcess::
|
||||
SubtractNumberOfInteractionLengthLeft(
|
||||
G4double
|
||||
)
|
||||
{
|
||||
// dummy routine
|
||||
;
|
||||
}
|
||||
|
||||
inline G4double G4IVContinuousDiscreteProcess::
|
||||
PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{// get particle,particle type,kin.energy,material,mat.index
|
||||
G4double nl,nlold,range,rangeold,rangenext,
|
||||
KineticEnergyOld,KineticEnergyNext,value;
|
||||
G4bool isOut;
|
||||
const G4DynamicParticle* particle = track.GetDynamicParticle();
|
||||
const G4ParticleDefinition* particletype = particle->GetDefinition() ;
|
||||
G4double KineticEnergy = particle->GetKineticEnergy();
|
||||
G4Material* material = track.GetMaterial();
|
||||
const G4MaterialTable* theMaterialTable =
|
||||
G4Material::GetMaterialTable();
|
||||
G4int materialindex = material->GetIndex();
|
||||
|
||||
nl = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergy,isOut);
|
||||
range = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergy,material) ;
|
||||
|
||||
if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
|
||||
// beggining of tracking (or just after DoIt of this process)
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
} else {
|
||||
// subtract NumberOfInteractionLengthLeft
|
||||
|
||||
rangeold = range + previousStepSize ;
|
||||
KineticEnergyOld = G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
particletype,
|
||||
rangeold,material);
|
||||
nlold = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergyOld,isOut);
|
||||
|
||||
if(nlold < nl) {
|
||||
#ifdef G4VERBOSE
|
||||
if(verboseLevel>2) {
|
||||
G4cout << GetProcessName() << " PostStepGPIL : Nlambda has been" <<
|
||||
" increased at update.Nlambda old/new :" << nlold <<
|
||||
" " << nl << endl;
|
||||
G4cout << "(theNumberOfInteractionLengthLeft has been increased!)" << endl;
|
||||
|
||||
G4cout << " correction : Nlambda old=new ........." << endl;
|
||||
}
|
||||
#endif
|
||||
//corr. of num errror
|
||||
nlold = nl ;
|
||||
}
|
||||
|
||||
theNumberOfInteractionLengthLeft -= nlold-nl ;
|
||||
|
||||
if(theNumberOfInteractionLengthLeft<perMillion)
|
||||
theNumberOfInteractionLengthLeft=0.;
|
||||
}
|
||||
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
if(nl <= theNumberOfInteractionLengthLeft){
|
||||
value = BIGSTEP ;
|
||||
} else {
|
||||
KineticEnergyNext = (*theInverseNlambdaTable)[materialindex]->
|
||||
GetValue(nl-theNumberOfInteractionLengthLeft,isOut);
|
||||
rangenext = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergyNext,material);
|
||||
|
||||
value = range - rangenext ;
|
||||
|
||||
if(range<rangenext) {
|
||||
#ifdef G4VERBOSE
|
||||
if(verboseLevel>2) {
|
||||
G4cout << GetProcessName() << " PostStepGPIL: Step < 0.!, Step=" <<
|
||||
value << endl;
|
||||
G4cout << "range,rangenext:" << range << " " << rangenext << endl ;
|
||||
G4cout << "correction : rangenext=range ....." << endl;
|
||||
}
|
||||
#endif
|
||||
//corr. of num error
|
||||
rangenext = range ;
|
||||
value = range - rangenext ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline G4VParticleChange* G4IVContinuousDiscreteProcess::PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4IVContinuousDiscreteProcess::AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
inline G4double G4IVContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
)
|
||||
{
|
||||
// GPILSelection is set to defaule value of CandidateForSelection
|
||||
valueGPILSelection = CandidateForSelection;
|
||||
|
||||
// get Step limit proposed by the process
|
||||
G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety);
|
||||
|
||||
// set return value for G4GPILSelection
|
||||
*selection = valueGPILSelection;
|
||||
|
||||
if (verboseLevel>1){
|
||||
G4cout << "G4IVContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<endl;
|
||||
}
|
||||
return steplength ;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4IVRestDiscreteProcess.hh,v 2.5 1998/10/16 13:21:32 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 8 Mar. 1997 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef G4IVRestDiscreteProcess_h
|
||||
#define G4IVRestDiscreteProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
|
||||
class G4IVRestDiscreteProcess : public G4VProcess
|
||||
{
|
||||
// Abstract class which defines the public behavior of
|
||||
// rest + discrete physics interactions.
|
||||
public:
|
||||
|
||||
G4IVRestDiscreteProcess(const G4String& ,
|
||||
G4ProcessType aType = fNotDefined );
|
||||
G4IVRestDiscreteProcess(G4IVRestDiscreteProcess &);
|
||||
|
||||
~G4IVRestDiscreteProcess();
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4ForceCondition*
|
||||
);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
// no operation in AlongStepDoIt
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*
|
||||
){ return -1.0; };
|
||||
|
||||
// no operation in AlongStepDoIt
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
|
||||
protected:
|
||||
virtual void SubtractNumberOfInteractionLengthLeft(
|
||||
G4double previousStepSize) ;
|
||||
|
||||
virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
|
||||
// Calculates the mean life-time (i.e. for decays) of the
|
||||
// particle at rest due to the occurence of the given process,
|
||||
// or converts the probability of interaction (i.e. for
|
||||
// annihilation) into the life-time of the particle for the
|
||||
// occurence of the given process.
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator as private
|
||||
G4IVRestDiscreteProcess();
|
||||
G4IVRestDiscreteProcess & operator=(const G4IVRestDiscreteProcess &right);
|
||||
|
||||
|
||||
protected:
|
||||
G4PhysicsTable* theNlambdaTable ;
|
||||
G4PhysicsTable* theInverseNlambdaTable ;
|
||||
G4double BIGSTEP ;
|
||||
|
||||
|
||||
};
|
||||
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
#include "Randomize.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
|
||||
inline
|
||||
void G4IVRestDiscreteProcess::SubtractNumberOfInteractionLengthLeft(
|
||||
G4double )
|
||||
{
|
||||
// dummy routine
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
inline G4double G4IVRestDiscreteProcess::
|
||||
PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{// get particle,particle type,kin.energy,material,mat.index
|
||||
G4double nl,nlold,range,rangeold,rangenext,
|
||||
KineticEnergyOld,KineticEnergyNext,value;
|
||||
G4bool isOut;
|
||||
const G4DynamicParticle* particle = track.GetDynamicParticle();
|
||||
const G4ParticleDefinition* particletype = particle->GetDefinition() ;
|
||||
G4double KineticEnergy = particle->GetKineticEnergy();
|
||||
G4Material* material = track.GetMaterial();
|
||||
const G4MaterialTable* theMaterialTable =
|
||||
G4Material::GetMaterialTable();
|
||||
G4int materialindex = material->GetIndex();
|
||||
|
||||
nl = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergy,isOut);
|
||||
range = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergy,material) ;
|
||||
|
||||
if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
|
||||
// beggining of tracking (or just after DoIt of this process)
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
} else {
|
||||
// subtract NumberOfInteractionLengthLeft
|
||||
|
||||
rangeold = range + previousStepSize ;
|
||||
KineticEnergyOld = G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
particletype,
|
||||
rangeold,material);
|
||||
nlold = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergyOld,isOut);
|
||||
|
||||
if(nlold < nl) {
|
||||
#ifdef G4VERBOSE
|
||||
if(verboseLevel>2) {
|
||||
G4cout << GetProcessName() << " PostStepGPIL : Nlambda has been" <<
|
||||
" increased at update.Nlambda old/new :" << nlold <<
|
||||
" " << nl << endl;
|
||||
G4cout << "(theNumberOfInteractionLengthLeft has been increased!)" << endl;
|
||||
|
||||
G4cout << " correction : Nlambda old=new ........." << endl;
|
||||
|
||||
}
|
||||
#endif
|
||||
//corr. of num errror
|
||||
nlold = nl ;
|
||||
}
|
||||
|
||||
theNumberOfInteractionLengthLeft -= nlold-nl ;
|
||||
|
||||
if(theNumberOfInteractionLengthLeft<perMillion)
|
||||
theNumberOfInteractionLengthLeft=0.;
|
||||
}
|
||||
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
if(nl <= theNumberOfInteractionLengthLeft){
|
||||
value = BIGSTEP ;
|
||||
} else {
|
||||
KineticEnergyNext = (*theInverseNlambdaTable)[materialindex]->
|
||||
GetValue(nl-theNumberOfInteractionLengthLeft,isOut);
|
||||
rangenext = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergyNext,material);
|
||||
|
||||
value = range - rangenext ;
|
||||
|
||||
if(range<rangenext) {
|
||||
#ifdef G4VERBOSE
|
||||
if(verboseLevel>2) {
|
||||
G4cout << GetProcessName() << " PostStepGPIL: Step < 0.!, Step=" <<
|
||||
value << endl;
|
||||
G4cout << "range,rangenext:" << range << " " << rangenext << endl ;
|
||||
G4cout << "correction : rangenext=range ....." << endl;
|
||||
}
|
||||
#endif
|
||||
//corr. of num error
|
||||
rangenext = range ;
|
||||
value = range - rangenext ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
inline G4VParticleChange* G4IVRestDiscreteProcess::PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// reset NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
inline G4double G4IVRestDiscreteProcess::AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
// beggining of tracking
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
// get mean life time
|
||||
currentInteractionLength = GetMeanLifeTime(track, condition);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ((currentInteractionLength <0.0) || (verboseLevel>2)){
|
||||
G4cout << "G4IVRestDiscreteProcess::AtRestGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
return theNumberOfInteractionLengthLeft * currentInteractionLength;
|
||||
}
|
||||
|
||||
|
||||
inline G4VParticleChange* G4IVRestDiscreteProcess::AtRestDoIt(
|
||||
const G4Track&,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4ProcTblElement.hh,v 2.3 1998/08/16 02:36:48 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 4th Aug 1998, H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4ProcTblElement_h
|
||||
#define G4ProcTblElement_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
|
||||
class G4ProcTblElement
|
||||
{
|
||||
// this class is used by G4ProcessTable ONLY for booking !!!
|
||||
private:
|
||||
G4ProcTblElement();
|
||||
|
||||
public:
|
||||
G4ProcTblElement(const G4ProcTblElement& right);
|
||||
G4ProcTblElement(G4VProcess* aProcess);
|
||||
// Constructors
|
||||
|
||||
~G4ProcTblElement();
|
||||
// Destructor
|
||||
|
||||
G4ProcTblElement & operator=(G4ProcTblElement &right);
|
||||
// Assignment operator
|
||||
|
||||
G4int operator==(const G4ProcTblElement &right) const;
|
||||
G4int operator!=(const G4ProcTblElement &right) const;
|
||||
// equal / unequal operator
|
||||
|
||||
typedef RWTPtrOrderedVector<G4ProcessManager> G4ProcMgrVector;
|
||||
|
||||
G4int Length() const ;
|
||||
void Insert(G4ProcessManager* aProcMgr);
|
||||
void Remove(G4ProcessManager* aProcMgr);
|
||||
|
||||
G4VProcess* GetProcess() const;
|
||||
G4String GetProcessName() const;
|
||||
|
||||
G4ProcessManager* GetProcessManager(G4int index) const;
|
||||
G4ProcMgrVector* GetProcMgrVector() const;
|
||||
|
||||
G4int GetIndex(const G4ProcessManager* pManager) const ;
|
||||
G4bool Contains(const G4ProcessManager* pManager) const ;
|
||||
|
||||
private:
|
||||
G4VProcess* pProcess;
|
||||
// pointer to G4VProcess
|
||||
|
||||
G4ProcMgrVector* pProcMgrVector;
|
||||
};
|
||||
|
||||
#include "G4ProcTblElement.icc"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//////////////////////////
|
||||
inline
|
||||
G4ProcTblElement::G4ProcMgrVector* G4ProcTblElement::GetProcMgrVector() const
|
||||
{
|
||||
return pProcMgrVector;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4bool G4ProcTblElement::Contains(const G4ProcessManager* pManager) const
|
||||
{
|
||||
return pProcMgrVector->contains(pManager);
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4int G4ProcTblElement::GetIndex(const G4ProcessManager* pManager) const
|
||||
{
|
||||
if ( Contains(pManager) ) return pProcMgrVector->index(pManager);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4int G4ProcTblElement::Length() const
|
||||
{
|
||||
if (pProcMgrVector != NULL) return pProcMgrVector->length();
|
||||
else return -1;
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4ProcessManager* G4ProcTblElement::GetProcessManager(G4int index) const
|
||||
{
|
||||
if (pProcMgrVector != NULL) {
|
||||
if ((index < pProcMgrVector->length()) && (index>=0)){
|
||||
return (*pProcMgrVector)(index);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4VProcess* G4ProcTblElement::GetProcess() const
|
||||
{
|
||||
return pProcess;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
void G4ProcTblElement::Insert(G4ProcessManager* aProcMgr)
|
||||
{
|
||||
if (pProcMgrVector != NULL) pProcMgrVector->insert(aProcMgr);
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
void G4ProcTblElement::Remove(G4ProcessManager* aProcMgr)
|
||||
{
|
||||
if (pProcMgrVector != NULL) pProcMgrVector->remove(aProcMgr);
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4String G4ProcTblElement::GetProcessName() const
|
||||
{
|
||||
return pProcess->GetProcessName();
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4ProcessAttribute.hh,v 2.1 1998/07/13 17:27:35 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1997, H.Kurashige
|
||||
// ---------------- G4ProcessAttribute -----------------
|
||||
// History:
|
||||
// adds copy constructor 27 June 1998 H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4ProcessAttribute_h
|
||||
#define G4ProcessAttribute_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
|
||||
class G4ProcessAttribute
|
||||
{
|
||||
// this class is used by G4ProcessManager ONLY for booking !!!
|
||||
public:
|
||||
G4ProcessAttribute();
|
||||
G4ProcessAttribute(const G4VProcess* aProcess);
|
||||
G4ProcessAttribute(const G4ProcessAttribute &right);
|
||||
// Constructors
|
||||
|
||||
~G4ProcessAttribute();
|
||||
// Destructor
|
||||
|
||||
G4ProcessAttribute & operator=(G4ProcessAttribute &right);
|
||||
// Assignment operator
|
||||
|
||||
G4int operator==(const G4ProcessAttribute &right) const;
|
||||
G4int operator!=(const G4ProcessAttribute &right) const;
|
||||
// equal / unequal operator
|
||||
|
||||
G4VProcess* pProcess;
|
||||
// pointer to G4VProcess
|
||||
|
||||
G4bool isActive;
|
||||
// flag for activation/inactivation
|
||||
|
||||
G4int idxProcessList;
|
||||
// index to a ProcessVector for theProcessList and
|
||||
|
||||
G4int idxProcVector[G4ProcessManager::SizeOfProcVectorArray];
|
||||
// index to ProcessVectors for "Doit"s and "GetPhysicalInteractionLength"s
|
||||
// -1 : not applicable
|
||||
|
||||
G4int ordProcVector[G4ProcessManager::SizeOfProcVectorArray];
|
||||
// ordering parameter
|
||||
};
|
||||
|
||||
inline
|
||||
G4ProcessAttribute::G4ProcessAttribute(const G4VProcess* aProcess):
|
||||
pProcess((G4VProcess*)aProcess),
|
||||
isActive(true)
|
||||
{
|
||||
idxProcessList = -1;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessAttribute::operator==(const G4ProcessAttribute &right) const
|
||||
{
|
||||
return this->pProcess == right.pProcess;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessAttribute::operator!=(const G4ProcessAttribute &right) const
|
||||
{
|
||||
return this->pProcess != right.pProcess;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,455 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4ProcessManager.hh,v 2.4 1998/10/17 04:58:56 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ---------------- G4ProcessManager -----------------
|
||||
// History:
|
||||
// revised by G.Cosmo, 06 May 1996
|
||||
// Added vector of processes at rest, 06 May 1996
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 8 Jan. 1997 H.Kurahige
|
||||
// 20 Apr. 1997 M.Asai
|
||||
// 14 June 1997 H.Kurahige
|
||||
// Add SetProcessOrdering methods 27 Mar 1998 H.Kurahige
|
||||
// Add copy constructor (deep copy) 28 June 1998 H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4ProcessManager_h
|
||||
#define G4ProcessManager_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
class G4ProcessManagerMessenger;
|
||||
class G4ProcessAttribute;
|
||||
|
||||
enum G4ProcessVectorTypeIndex
|
||||
{
|
||||
typeGPIL = 0, typeDoIt =1
|
||||
};
|
||||
|
||||
enum G4ProcessVectorDoItIndex
|
||||
{
|
||||
idxAll = -1,
|
||||
idxAtRest = 0, idxAlongStep = 1, idxPostStep =2
|
||||
};
|
||||
|
||||
enum G4ProcessVectorOrdering
|
||||
{
|
||||
ordInActive = -1,
|
||||
ordDefault = INT_MAX/2,
|
||||
ordLast = INT_MAX
|
||||
};
|
||||
|
||||
class G4ProcessManager
|
||||
{
|
||||
// It collects all physics a particle can undertake as seven vectors.
|
||||
// These vectors are
|
||||
// one vector for all processes (called as "process List")
|
||||
// two vectors for processes with AtRestGetPhysicalInteractionLength
|
||||
// and AtRestDoIt
|
||||
// two vectors for processes with AlongStepGetPhysicalInteractionLength
|
||||
// and AlongStepDoIt
|
||||
// two vectors for processes with PostStepGetPhysicalInteractionLength
|
||||
// and PostStepDoIt
|
||||
// The tracking will message three types of GetPhysicalInteractionLength
|
||||
// in order to limit the Step and select the occurence of processes.
|
||||
// It will message the corresponding DoIt() to apply the selected
|
||||
// processes. In addition, the Tracking will limit the Step
|
||||
// and select the occurence of the processes according to
|
||||
// the shortest physical interaction length computed (except for
|
||||
// processes at rest, for which the Tracking will select the
|
||||
// occurence of the process which returns the shortest mean
|
||||
// life-time from the GetPhysicalInteractionLength()).
|
||||
|
||||
public:
|
||||
// copy constructor
|
||||
G4ProcessManager(G4ProcessManager &right);
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator
|
||||
G4ProcessManager & operator=(G4ProcessManager &right);
|
||||
G4ProcessManager();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
G4ProcessManager(const G4ParticleDefinition* aParticleType);
|
||||
// Constructor
|
||||
|
||||
~G4ProcessManager();
|
||||
// Destructor
|
||||
|
||||
G4int operator==(const G4ProcessManager &right) const;
|
||||
G4int operator!=(const G4ProcessManager &right) const;
|
||||
|
||||
G4ProcessVector* GetProcessList() const;
|
||||
// Returns the address of the vector of all processes
|
||||
|
||||
G4int GetProcessListLength() const;
|
||||
// Returns the number of process in the ProcessVector
|
||||
|
||||
G4int GetProcessIndex(G4VProcess *) const;
|
||||
// Returns the index of the process in the process List
|
||||
|
||||
// --------------------------------------
|
||||
|
||||
G4ProcessVector* GetProcessVector(
|
||||
G4ProcessVectorDoItIndex idx,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
// Returns the address of the vector of processes
|
||||
|
||||
G4ProcessVector* GetAtRestProcessVector(
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
// Returns the address of the vector of processes for
|
||||
// AtRestGetPhysicalInteractionLength idx =0
|
||||
// AtRestGetPhysicalDoIt idx =1
|
||||
G4ProcessVector* GetAlongStepProcessVector(
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
// Returns the address of the vector of processes for
|
||||
// AlongStepGetPhysicalInteractionLength idx =0
|
||||
// AlongStepGetPhysicalDoIt idx =1
|
||||
|
||||
G4ProcessVector* GetPostStepProcessVector(
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
// Returns the address of the vector of processes for
|
||||
// PostStepGetPhysicalInteractionLength idx =0
|
||||
// PostStepGetPhysicalDoIt idx =1
|
||||
|
||||
G4int GetProcessVectorIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorDoItIndex idx,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4int GetAtRestIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4int GetAlongStepIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4int GetPostStepIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
// Returns the index for GPIL/DoIt process vector of the process
|
||||
|
||||
G4int AddProcess(
|
||||
G4VProcess *aProcess,
|
||||
G4int ordAtRestDoIt = ordInActive,
|
||||
G4int ordAlongSteptDoIt = ordInActive,
|
||||
G4int ordPostStepDoIt = ordInActive
|
||||
);
|
||||
// Add a process to the process List
|
||||
// return values are index to the List. Negative return value
|
||||
// indicates that the process has not be added due to some errors
|
||||
// The first argument is a pointer to process.
|
||||
// Following arguments are ordering parameters of the process in
|
||||
// process vectors. If value is negative, the process is
|
||||
// not added to the corresponding process vector.
|
||||
|
||||
// following methods are provided for simple processes
|
||||
// AtRestProcess has only AtRestDoIt
|
||||
// ContinuousProcess has only AlongStepDoIt
|
||||
// DiscreteProcess has only PostStepDoIt
|
||||
// if ord is not specified, the process is
|
||||
// added at the end of List of processvectors for
|
||||
// both DoIt and GetPhysicalInteractionLength
|
||||
|
||||
G4int AddRestProcess(G4VProcess *aProcess, G4int ord = ordDefault);
|
||||
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord = ordDefault);
|
||||
G4int AddContinuousProcess(G4VProcess *aProcess, G4int ord = ordDefault);
|
||||
|
||||
// Methods for setting ordering parameters
|
||||
// Altanative methods for setting ordering parameters
|
||||
// Note: AddProcess method should precede these methods
|
||||
|
||||
G4int GetProcessOrdering(
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt
|
||||
);
|
||||
|
||||
void SetProcessOrdering(
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt,
|
||||
G4int ordDoIt = ordDefault
|
||||
);
|
||||
// Set ordering parameter for DoIt specified by typeDoIt.
|
||||
|
||||
void SetProcessOrderingToFirst(
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt
|
||||
);
|
||||
// Set ordering parameter to the first of all processes
|
||||
// for DoIt specified by idDoIt.
|
||||
// Note: If you use this method for two processes,
|
||||
// a process called later will be first.
|
||||
|
||||
void SetProcessOrderingToLast(
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt
|
||||
);
|
||||
// Set ordering parameter to the last of all processes
|
||||
// for DoIt specified by idDoIt.
|
||||
// Note: If you use this method for two processes,
|
||||
// a process called later will be the last one.
|
||||
|
||||
G4VProcess* RemoveProcess(G4VProcess *aProcess);
|
||||
G4VProcess* RemoveProcess(G4int index);
|
||||
// Removes a process from the process List.
|
||||
// return value is pointer to the removed process.
|
||||
// (NULL value will be returned in case of errors)
|
||||
|
||||
G4VProcess* SetProcessActivation(G4VProcess *aProcess, G4bool fActive);
|
||||
G4VProcess* SetProcessActivation(G4int index, G4bool fActive);
|
||||
// Set activation flag.
|
||||
// return value is pointer to the applied process.
|
||||
// (NULL value will be returned in case of errors)
|
||||
|
||||
G4ParticleDefinition* GetParticleType() const;
|
||||
// get the particle type
|
||||
void SetParticleType(const G4ParticleDefinition*);
|
||||
// set the particle type
|
||||
|
||||
void StartTracking();
|
||||
void EndTracking();
|
||||
// these two methods are used by G4TrackingManager
|
||||
// in order to inform Start/End of tracking for each track
|
||||
// to the process manager and all physics processes
|
||||
|
||||
private:
|
||||
G4ProcessAttribute* GetAttribute(G4int index) const;
|
||||
G4ProcessAttribute* GetAttribute(G4VProcess *aProcess) const;
|
||||
// get Pointer to ProcessAttribute
|
||||
|
||||
G4VProcess* ActivateProcess(G4int index);
|
||||
G4VProcess* InActivateProcess(G4int index);
|
||||
// Activate/InActivateProcess Process
|
||||
|
||||
private:
|
||||
const G4ParticleDefinition* theParticleType;
|
||||
// particle which has this process manager object
|
||||
|
||||
G4int numberOfProcesses;
|
||||
G4ProcessVector* theProcessList;
|
||||
// vector for all processes (called as "process List")
|
||||
|
||||
public:
|
||||
enum {SizeOfProcVectorArray = 6};
|
||||
private:
|
||||
G4ProcessVector* theProcVector[SizeOfProcVectorArray];
|
||||
// vector for processes with GetPhysicalInteractionLength/DoIt
|
||||
|
||||
typedef RWTPtrOrderedVector<G4ProcessAttribute> G4ProcessAttrVector;
|
||||
G4ProcessAttrVector* theAttrVector;
|
||||
// vector for process attribute
|
||||
|
||||
protected:
|
||||
G4int InsertAt(G4int position, G4VProcess* process, G4int ivec);
|
||||
// insert process at position in theProcVector[ivec]
|
||||
|
||||
G4int RemoveAt(G4int position, G4VProcess* process, G4int ivec);
|
||||
// remove process at position in theProcVector[ivec]
|
||||
|
||||
G4int FindInsertPosition(G4int ord, G4int ivec);
|
||||
// find insert position according to ordering parameter
|
||||
// in theProcVector[ivec]
|
||||
|
||||
G4int GetProcessVectorId(G4ProcessVectorDoItIndex idx,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL) const;
|
||||
|
||||
private:
|
||||
G4bool duringTracking;
|
||||
void CreateGPILvectors();
|
||||
void SetIndexToProcessVector(G4int ivec);
|
||||
|
||||
public:
|
||||
void DumpInfo();
|
||||
void SetVerboseLevel(G4int value);
|
||||
G4int GetVerboseLevel() const;
|
||||
|
||||
protected:
|
||||
G4int verboseLevel;
|
||||
// controle flag for output message
|
||||
// 0: Silent
|
||||
// 1: Warning message
|
||||
// 2: More
|
||||
|
||||
private:
|
||||
static G4ProcessManagerMessenger* fProcessManagerMessenger;
|
||||
static G4int counterOfObjects;
|
||||
};
|
||||
#include "G4ProcessAttribute.hh"
|
||||
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
inline
|
||||
void G4ProcessManager::SetParticleType(const G4ParticleDefinition* aParticle)
|
||||
{
|
||||
theParticleType = aParticle;
|
||||
}
|
||||
|
||||
inline
|
||||
G4ProcessVector* G4ProcessManager::GetProcessList() const
|
||||
{
|
||||
return theProcessList;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessManager::GetProcessListLength() const
|
||||
{
|
||||
return numberOfProcesses;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessManager::GetProcessIndex(G4VProcess* aProcess) const
|
||||
{
|
||||
G4int idx = theProcessList->index(aProcess);
|
||||
if (idx>=numberOfProcesses) idx = -1;
|
||||
return idx;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessManager::GetProcessVectorId(G4ProcessVectorDoItIndex idx,
|
||||
G4ProcessVectorTypeIndex typ) const
|
||||
{
|
||||
if ( idx == idxAtRest ) {
|
||||
if (typ == typeGPIL) { return 0; }
|
||||
else { return 1; }
|
||||
} else if ( idx == idxAlongStep ) {
|
||||
if (typ == typeGPIL) { return 2; }
|
||||
else { return 3; }
|
||||
} else if ( idx == idxPostStep ) {
|
||||
if (typ == typeGPIL) { return 4; }
|
||||
else { return 5; }
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
G4ProcessVector* G4ProcessManager::GetProcessVector(
|
||||
G4ProcessVectorDoItIndex idx,
|
||||
G4ProcessVectorTypeIndex typ
|
||||
) const
|
||||
{
|
||||
G4int ivec = GetProcessVectorId(idx, typ);
|
||||
if ( ivec >=0 ) {
|
||||
return theProcVector[ivec];
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
G4ProcessVector* G4ProcessManager::GetAtRestProcessVector(G4ProcessVectorTypeIndex typ) const
|
||||
{
|
||||
if (typ == typeGPIL) { return theProcVector[0]; }
|
||||
else { return theProcVector[1]; }
|
||||
}
|
||||
|
||||
inline
|
||||
G4ProcessVector* G4ProcessManager::GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ) const
|
||||
{
|
||||
if (typ == typeGPIL) { return theProcVector[2]; }
|
||||
else { return theProcVector[3]; }
|
||||
}
|
||||
|
||||
inline
|
||||
G4ProcessVector* G4ProcessManager::GetPostStepProcessVector(G4ProcessVectorTypeIndex typ) const
|
||||
{
|
||||
if (typ == typeGPIL) { return theProcVector[4]; }
|
||||
else { return theProcVector[5]; }
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessManager::GetAtRestIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorTypeIndex typ
|
||||
) const
|
||||
{
|
||||
return GetProcessVectorIndex(aProcess, idxAtRest, typ);
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessManager::GetAlongStepIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorTypeIndex typ
|
||||
) const
|
||||
{
|
||||
return GetProcessVectorIndex(aProcess, idxAlongStep, typ);
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessManager::GetPostStepIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorTypeIndex typ
|
||||
) const
|
||||
{
|
||||
return GetProcessVectorIndex(aProcess, idxPostStep, typ);
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessManager::AddRestProcess(G4VProcess *aProcess,G4int ord)
|
||||
{
|
||||
return AddProcess(aProcess, ord, ordInActive, ordInActive);
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessManager::AddContinuousProcess(G4VProcess *aProcess,G4int ord)
|
||||
{
|
||||
return AddProcess(aProcess, ordInActive, ord, ordInActive);
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessManager::AddDiscreteProcess(G4VProcess *aProcess,G4int ord)
|
||||
{
|
||||
return AddProcess(aProcess, ordInActive, ordInActive, ord);
|
||||
}
|
||||
|
||||
inline
|
||||
G4ParticleDefinition* G4ProcessManager::GetParticleType() const
|
||||
{
|
||||
return (G4ParticleDefinition* )theParticleType;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void G4ProcessManager::SetVerboseLevel(G4int value)
|
||||
{
|
||||
verboseLevel = value;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessManager::GetVerboseLevel() const
|
||||
{
|
||||
return verboseLevel;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4ProcessManagerMessenger.hh,v 2.2 1998/07/12 03:43:41 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4ProcessManagerMessenger.hh
|
||||
//
|
||||
// Description:
|
||||
// This is a messenger class to interface to exchange information
|
||||
// between ProcessManager and UI.
|
||||
//
|
||||
// /particle/process/ Process Manager control commands.
|
||||
// Commands :
|
||||
// dump * dump process manager information.
|
||||
// Verbose * Set Verbose Level for Process Manager and/or process
|
||||
// Activate * Activate process
|
||||
// inactivate * Inctivate process
|
||||
//
|
||||
// History:
|
||||
// 13 June 1997, H. Kurashige : The 1st version created.
|
||||
// 10 Nov. 1997 H. Kurashige : fixed bugs
|
||||
// 08 Jan. 1998, H. Kurashige : new UIcommand
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4ProcessManagerMessenger_h
|
||||
#define G4ProcessManagerMessenger_h 1
|
||||
|
||||
class G4ParticleDefinition;
|
||||
class G4ParticleTable;
|
||||
class G4ProcessManager;
|
||||
class G4ProcessVector;
|
||||
class G4VProcess;
|
||||
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcommand;
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ProcessManagerMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
G4ProcessManagerMessenger(G4ParticleTable* pTable = NULL);
|
||||
~G4ProcessManagerMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
G4String GetCurrentValue(G4UIcommand * command);
|
||||
|
||||
private:
|
||||
G4ProcessManagerMessenger(const G4ProcessManagerMessenger&){};
|
||||
|
||||
private:
|
||||
G4ParticleDefinition* SetCurrentParticle();
|
||||
|
||||
private:
|
||||
G4ParticleTable* theParticleTable;
|
||||
G4ParticleDefinition* currentParticle;
|
||||
G4VProcess* currentProcess;
|
||||
G4ProcessManager* theManager;
|
||||
G4ProcessVector* theProcessList;
|
||||
|
||||
G4UIdirectory * thisDirectory;
|
||||
G4UIcmdWithAnInteger * dumpCmd;
|
||||
G4UIcommand * verboseCmd;
|
||||
G4UIcmdWithAnInteger * activateCmd;
|
||||
G4UIcmdWithAnInteger * inactivateCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4ProcessTable.hh,v 2.5 1998/08/17 03:35:36 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 4th Aug 1998, H.Kurashige
|
||||
//
|
||||
// History:
|
||||
// Added G4ProcessTableMesseneger 16 Aug. 1998, H.Kurashige
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4ProcessTable_h
|
||||
#define G4ProcessTable_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
#include <rw/tvordvec.h>
|
||||
|
||||
#include "G4ProcTblElement.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
class G4ProcessTableMessenger;
|
||||
|
||||
class G4ProcessTable
|
||||
{
|
||||
// this class is used by G4ProcessTable ONLY for booking !!!
|
||||
public:
|
||||
G4ProcessTable();
|
||||
// Constructors
|
||||
|
||||
~G4ProcessTable();
|
||||
// Destructor
|
||||
|
||||
private:
|
||||
G4ProcessTable(const G4ProcessTable &right);
|
||||
G4ProcessTable & operator=(const G4ProcessTable &right);
|
||||
// Assignment operator
|
||||
G4int operator==(const G4ProcessTable &right) const;
|
||||
G4int operator!=(const G4ProcessTable &right) const;
|
||||
// equal / unequal operator
|
||||
|
||||
public:
|
||||
static G4ProcessTable* GetProcessTable();
|
||||
// return the pointer to G4ProcessTable object
|
||||
// G4ProcessTable is a "singleton" and can get its pointer by this function
|
||||
|
||||
G4int Length() const;
|
||||
G4int Insert(G4VProcess* aProcess, G4ProcessManager* aProcMgr);
|
||||
G4int Remove(G4VProcess* aProcess, G4ProcessManager* aProcMgr);
|
||||
// insert and remove methods
|
||||
// each process object is registered with information of process managers
|
||||
// that use it.
|
||||
|
||||
G4VProcess* FindProcess(const G4String& processName,
|
||||
const G4String& particleName) const;
|
||||
G4VProcess* FindProcess(const G4String& processName,
|
||||
const G4ParticleDefinition* particle) const;
|
||||
G4VProcess* FindProcess(const G4String& processName,
|
||||
const G4ProcessManager* processManager) const;
|
||||
// return the process pointer
|
||||
|
||||
G4ProcessVector* FindProcesses();
|
||||
G4ProcessVector* FindProcesses( const G4ProcessManager* processManager );
|
||||
G4ProcessVector* FindProcesses( const G4String& processName );
|
||||
G4ProcessVector* FindProcesses( G4ProcessType processType );
|
||||
// return pointer of a process vector
|
||||
// which includes processes specified
|
||||
// Note:: User is responsible to delete this process vector object
|
||||
|
||||
void SetProcessActivation( const G4String& processName,
|
||||
G4bool fActive);
|
||||
void SetProcessActivation( const G4String& processName,
|
||||
const G4String& particleName,
|
||||
G4bool fActive );
|
||||
void SetProcessActivation( const G4String& processName,
|
||||
G4ParticleDefinition* particle,
|
||||
G4bool fActive );
|
||||
void SetProcessActivation( const G4String& processName,
|
||||
G4ProcessManager* processManager,
|
||||
G4bool fActive );
|
||||
void SetProcessActivation( G4ProcessType processType,
|
||||
G4bool fActive );
|
||||
void SetProcessActivation( G4ProcessType processType,
|
||||
const G4String& particleName,
|
||||
G4bool fActive );
|
||||
void SetProcessActivation( G4ProcessType processType,
|
||||
G4ParticleDefinition* particle,
|
||||
G4bool fActive );
|
||||
void SetProcessActivation( G4ProcessType processType,
|
||||
G4ProcessManager* processManager,
|
||||
G4bool fActive );
|
||||
|
||||
public:
|
||||
typedef RWTPtrOrderedVector<G4ProcTblElement> G4ProcTableVector;
|
||||
typedef RWTValOrderedVector<G4String> G4ProcNameVector;
|
||||
|
||||
G4ProcNameVector* GetNameList() const;
|
||||
|
||||
|
||||
G4ProcTableVector* GetProcTableVector();
|
||||
|
||||
private:
|
||||
G4ProcTableVector* Find( G4ProcTableVector* procTableVector,
|
||||
const G4String& processName );
|
||||
G4ProcTableVector* Find( G4ProcTableVector* procTableVector,
|
||||
G4ProcessType processType );
|
||||
// return pointer of a ProcTableVector
|
||||
// which includes ProcTbleElement specified
|
||||
|
||||
G4ProcessVector* ExtractProcesses( G4ProcTableVector* procTableVector);
|
||||
|
||||
public:
|
||||
void DumpInfo(G4VProcess* process, G4ParticleDefinition* particle=NULL);
|
||||
|
||||
public:
|
||||
G4UImessenger* CreateMessenger();
|
||||
void DeleteMessenger();
|
||||
|
||||
|
||||
public:
|
||||
void SetVerboseLevel(G4int value);
|
||||
G4int GetVerboseLevel() const;
|
||||
|
||||
|
||||
private:
|
||||
static G4ProcessTable* fProcessTable;
|
||||
G4ProcessTableMessenger* fProcTblMessenger;
|
||||
|
||||
private:
|
||||
G4ProcTableVector* fProcTblVector;
|
||||
G4ProcNameVector* fProcNameVector;
|
||||
// list of G4ProcTblElement
|
||||
|
||||
G4ProcTableVector* tmpTblVector;
|
||||
// used only internaly for temporary buffer.
|
||||
|
||||
private:
|
||||
G4int verboseLevel;
|
||||
// controle flag for output message
|
||||
// 0: Silent
|
||||
// 1: Warning message
|
||||
// 2: More
|
||||
};
|
||||
|
||||
inline
|
||||
void G4ProcessTable::SetVerboseLevel(G4int value)
|
||||
{
|
||||
verboseLevel = value;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessTable::GetVerboseLevel() const
|
||||
{
|
||||
return verboseLevel;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ProcessTable::Length() const
|
||||
{
|
||||
return fProcTblVector->length();
|
||||
}
|
||||
|
||||
#include "G4ProcessTable.icc"
|
||||
#endif
|
||||
@@ -0,0 +1,94 @@
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4ProcessTable::G4ProcNameVector* G4ProcessTable::GetNameList() const
|
||||
{
|
||||
return fProcNameVector;
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4ProcessTable::G4ProcTableVector* G4ProcessTable::GetProcTableVector()
|
||||
{
|
||||
return fProcTblVector;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4VProcess* G4ProcessTable::FindProcess(const G4String& processName,
|
||||
const G4ParticleDefinition* particle)
|
||||
const
|
||||
{
|
||||
if ( particle == NULL ) return NULL;
|
||||
else return FindProcess(processName, particle->GetProcessManager());
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4VProcess* G4ProcessTable::FindProcess(const G4String& processName,
|
||||
const G4String& particleName) const
|
||||
{
|
||||
return FindProcess(processName,
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(particleName));
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
void G4ProcessTable::SetProcessActivation(
|
||||
const G4String& processName,
|
||||
G4ParticleDefinition* particle,
|
||||
G4bool fActive)
|
||||
{
|
||||
if ( particle != NULL ) {
|
||||
SetProcessActivation(processName, particle->GetProcessManager(), fActive);
|
||||
}
|
||||
}
|
||||
//////////////////////////
|
||||
inline
|
||||
void G4ProcessTable::SetProcessActivation(
|
||||
const G4String& processName,
|
||||
const G4String& particleName,
|
||||
G4bool fActive )
|
||||
{
|
||||
if (particleName == "ALL" ) {
|
||||
SetProcessActivation( processName , fActive);
|
||||
} else {
|
||||
SetProcessActivation(
|
||||
processName,
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(particleName),
|
||||
fActive );
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
void G4ProcessTable::SetProcessActivation(
|
||||
G4ProcessType processType,
|
||||
G4ParticleDefinition* particle,
|
||||
G4bool fActive)
|
||||
{
|
||||
if ( particle != NULL ) {
|
||||
SetProcessActivation( processType, particle->GetProcessManager(), fActive);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
void G4ProcessTable::SetProcessActivation(
|
||||
G4ProcessType processType,
|
||||
const G4String& particleName ,
|
||||
G4bool fActive)
|
||||
{
|
||||
if ((particleName == "ALL" )||(particleName == "all" )) {
|
||||
SetProcessActivation( processType, fActive );
|
||||
} else {
|
||||
SetProcessActivation(
|
||||
processType,
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(particleName),
|
||||
fActive );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4ProcessTableMessenger.hh,v 2.2 1998/08/17 03:35:37 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4ProcessTableMessenger.hh
|
||||
//
|
||||
// Description:
|
||||
// This is a messenger class to interface to exchange information
|
||||
// between ProcessTable and UI.
|
||||
//
|
||||
// /process/ Process Table control commands.
|
||||
// Commands :
|
||||
// list * :Dump process name registered.
|
||||
// verbose * :Set Verbose Level for Process Table
|
||||
// activate * :Activate process
|
||||
// inactivate * :Inctivate process
|
||||
// dump * :Dump process information
|
||||
//
|
||||
// History:
|
||||
// 15 Aug. 1998, H. Kurashige
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4ProcessTableMessenger_h
|
||||
#define G4ProcessTableMessenger_h 1
|
||||
|
||||
class G4ProcessTable;
|
||||
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithAString;
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4ProcessType.hh"
|
||||
|
||||
class G4ProcessTableMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
G4ProcessTableMessenger(G4ProcessTable* pTable);
|
||||
~G4ProcessTableMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
G4String GetCurrentValue(G4UIcommand * command);
|
||||
|
||||
private:
|
||||
G4String GetProcessTypeName(G4ProcessType aType) const;
|
||||
G4int GetProcessType(const G4String& aTypeName) const;
|
||||
static G4int NumberOfProcessType;
|
||||
void SetNumberOfProcessType();
|
||||
|
||||
private:
|
||||
G4ProcessTableMessenger(const G4ProcessTableMessenger&){};
|
||||
G4ProcessTableMessenger(){};
|
||||
|
||||
private:
|
||||
G4ProcessTable* theProcessTable;
|
||||
|
||||
G4UIdirectory * thisDirectory;
|
||||
G4UIcmdWithAnInteger * verboseCmd;
|
||||
G4UIcmdWithAString * listCmd;
|
||||
G4UIcommand * dumpCmd;
|
||||
G4UIcommand * activateCmd;
|
||||
G4UIcommand * inactivateCmd;
|
||||
|
||||
G4String currentProcessTypeName;
|
||||
G4String currentProcessName;
|
||||
G4String currentParticleName;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4ProcessType.hh,v 2.1 1998/08/16 02:36:50 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4ProcessType.hh
|
||||
//
|
||||
// Description:
|
||||
// This is an enumerator to define process type
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4ProcessType_h
|
||||
#define G4ProcessType_h 1
|
||||
|
||||
enum G4ProcessType
|
||||
{
|
||||
fNotDefined,
|
||||
fTransportation,
|
||||
fElectromagnetic,
|
||||
fOptical,
|
||||
fHadronic,
|
||||
fPhotolepton_hadron,
|
||||
fDecay,
|
||||
fGeneral,
|
||||
fParameterisation,
|
||||
fUserDefined
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4ProcessVector.hh,v 2.1 1998/07/13 17:27:37 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4ProcessVector_h
|
||||
#define G4ProcessVector_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
class G4ProcessVector : public RWTPtrOrderedVector<G4VProcess>
|
||||
{
|
||||
// Is a container for pointers to physics process objects. Its
|
||||
// functionality is derived from RWTPtrOrderedVector<T>.
|
||||
|
||||
public:
|
||||
|
||||
G4ProcessVector(size_t capac=RWDEFAULT_CAPACITY)
|
||||
: RWTPtrOrderedVector<G4VProcess>(capac) {;}
|
||||
// Constructor.
|
||||
|
||||
virtual ~G4ProcessVector() {;}
|
||||
// Destructor.
|
||||
|
||||
G4bool operator==(const G4ProcessVector &right) const
|
||||
{
|
||||
return (this == (G4ProcessVector *) &right);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,222 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4VContinuousDiscreteProcess.hh,v 2.4 1998/10/16 13:21:35 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 8 Mar. 1997 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
// modified 26 Mar. 1997 H.Kurashige
|
||||
// modified 16 Apr. 1997 L.Urban
|
||||
// modified AlongStepGPIL etc. 17 Dec. 1997 H.Kurashige
|
||||
// fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
|
||||
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
|
||||
|
||||
#ifndef G4VContinuousDiscreteProcess_h
|
||||
#define G4VContinuousDiscreteProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
class G4VContinuousDiscreteProcess : public G4VProcess
|
||||
{
|
||||
// Abstract class which defines the public behavior of
|
||||
// discrete physics interactions.
|
||||
public:
|
||||
|
||||
G4VContinuousDiscreteProcess(const G4String& ,
|
||||
G4ProcessType aType = fNotDefined );
|
||||
G4VContinuousDiscreteProcess(G4VContinuousDiscreteProcess &);
|
||||
|
||||
~G4VContinuousDiscreteProcess();
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
);
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
// no operation in AtRestDoIt
|
||||
G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4ForceCondition*
|
||||
) { return -1.0; };
|
||||
|
||||
// no operation in AtRestDoIt
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
protected:
|
||||
virtual G4double GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)=0;
|
||||
// Calculates from the macroscopic cross section a mean
|
||||
// free path, the value is returned in units of distance.
|
||||
|
||||
protected:
|
||||
virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety
|
||||
)=0;
|
||||
private:
|
||||
// this is the returnd value of G4GPILSelection in
|
||||
// the arguments of AlongStepGPIL()
|
||||
G4GPILSelection valueGPILSelection;
|
||||
|
||||
protected:
|
||||
// these two methods are set/get methods for valueGPILSelection
|
||||
void SetGPILSelection(G4GPILSelection selection)
|
||||
{ valueGPILSelection = selection;};
|
||||
|
||||
G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator as private
|
||||
G4VContinuousDiscreteProcess();
|
||||
G4VContinuousDiscreteProcess & operator=(const G4VContinuousDiscreteProcess &right);
|
||||
|
||||
};
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
inline G4double G4VContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
|
||||
// beggining of tracking (or just after DoIt of this process)
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
} else {
|
||||
// subtract NumberOfInteractionLengthLeft
|
||||
SubtractNumberOfInteractionLengthLeft(previousStepSize);
|
||||
if(theNumberOfInteractionLengthLeft<perMillion)
|
||||
theNumberOfInteractionLengthLeft=0.;
|
||||
}
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
// get mean free path
|
||||
currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ((currentInteractionLength <=0.0) || (verboseLevel>2)){
|
||||
G4cout << "G4VContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]" <<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
G4double value = theNumberOfInteractionLengthLeft * currentInteractionLength;
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>1){
|
||||
G4cout << "G4VContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "InteractionLength= " << value/cm <<"[cm] " <<endl;
|
||||
}
|
||||
#endif
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
inline G4VParticleChange* G4VContinuousDiscreteProcess::PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4VContinuousDiscreteProcess::AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
inline G4double G4VContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
)
|
||||
{
|
||||
// GPILSelection is set to defaule value of CandidateForSelection
|
||||
valueGPILSelection = CandidateForSelection;
|
||||
|
||||
// get Step limit proposed by the process
|
||||
G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety);
|
||||
|
||||
// set return value for G4GPILSelection
|
||||
*selection = valueGPILSelection;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>1){
|
||||
G4cout << "G4VContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<endl;
|
||||
}
|
||||
#endif
|
||||
return steplength ;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4VContinuousProcess.hh,v 2.4 1998/10/16 13:21:35 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// add G4VContinuousProcess(const G4String&) 24 Jul 1996, Hisaya kurashige
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 18 Dec. 1996 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
// modified 25 Feb. 1997 H.Kurahige
|
||||
// modified 8 Mar. 1997 H.Kurashige
|
||||
// modified 22 Mar. 1997 H.Kurashige
|
||||
// modified 26 Mar. 1997 H.Kurashige
|
||||
// modified AlongStepGPIL etc. 17 Dec. 1997 H.Kurashige
|
||||
// fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
|
||||
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
|
||||
|
||||
#ifndef G4VContinuousProcess_h
|
||||
#define G4VContinuousProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
class G4VContinuousProcess : public G4VProcess
|
||||
{
|
||||
// Abstract class which defines the public behavior of
|
||||
// Continuous physics interactions.
|
||||
public:
|
||||
|
||||
G4VContinuousProcess(const G4String& ,
|
||||
G4ProcessType aType = fNotDefined );
|
||||
G4VContinuousProcess(G4VContinuousProcess &);
|
||||
|
||||
~G4VContinuousProcess();
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& proposedSafety,
|
||||
G4GPILSelection* selection
|
||||
);
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
// no operation in AtRestDoIt and PostStepDoIt
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double,
|
||||
G4ForceCondition*
|
||||
){ return -1.0; };
|
||||
|
||||
G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4ForceCondition*
|
||||
) { return -1.0; };
|
||||
|
||||
// no operation in AtRestDoIt and PostStepDoIt
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
|
||||
protected:
|
||||
virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety
|
||||
)=0;
|
||||
|
||||
private:
|
||||
// this is the returnd value of G4GPILSelection in
|
||||
// the arguments of AlongStepGPIL()
|
||||
G4GPILSelection valueGPILSelection;
|
||||
|
||||
protected:
|
||||
// these two methods are set/get methods for valueGPILSelection
|
||||
// these two methods are set/get methods for valueGPILSelection
|
||||
void SetGPILSelection(G4GPILSelection selection)
|
||||
{ valueGPILSelection = selection;};
|
||||
|
||||
G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
|
||||
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator as private
|
||||
G4VContinuousProcess();
|
||||
G4VContinuousProcess & operator=(const G4VContinuousProcess &right);
|
||||
|
||||
};
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
inline G4double G4VContinuousProcess::AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
)
|
||||
{
|
||||
// GPILSelection is set to defaule value of CandidateForSelection
|
||||
valueGPILSelection = CandidateForSelection;
|
||||
|
||||
// get Step limit proposed by the process
|
||||
G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety);
|
||||
|
||||
// set return value for G4GPILSelection
|
||||
*selection = valueGPILSelection;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>1){
|
||||
G4cout << "G4VContinuousProcess::AlongStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
return steplength ;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4VContinuousProcess::AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4VDiscreteProcess.hh,v 2.5 1998/10/17 07:04:16 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// add G4VDiscreteProcess(const G4String&) 24 Jul 1996, Hisaya kurashige
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 18 Dec. 1996 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
// modified 25 Feb. 1997 H.Kurahige
|
||||
// modified 8 Mar. 1997 H.Kurahige
|
||||
// modified 26 Mar. 1997 H.Kurahige
|
||||
// modified 16 Apr. 1997 L.Urban
|
||||
// modified 17 Dec. 1997 L.Urban
|
||||
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
|
||||
|
||||
#ifndef G4VDiscreteProcess_h
|
||||
#define G4VDiscreteProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
class G4VDiscreteProcess : public G4VProcess
|
||||
{
|
||||
// Abstract class which defines the public behavior of
|
||||
// discrete physics interactions.
|
||||
public:
|
||||
|
||||
G4VDiscreteProcess(const G4String& ,
|
||||
G4ProcessType aType = fNotDefined );
|
||||
G4VDiscreteProcess(G4VDiscreteProcess &);
|
||||
|
||||
~G4VDiscreteProcess();
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
// 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; };
|
||||
|
||||
// no operation in AtRestDoIt and AlongStepDoIt
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
|
||||
protected:
|
||||
virtual G4double GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)=0;
|
||||
// Calculates from the macroscopic cross section a mean
|
||||
// free path, the value is returned in units of distance.
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator as private
|
||||
G4VDiscreteProcess();
|
||||
G4VDiscreteProcess & operator=(const G4VDiscreteProcess &right);
|
||||
|
||||
};
|
||||
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
inline G4double G4VDiscreteProcess::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
|
||||
// beggining of tracking (or just after DoIt of this process)
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
} else {
|
||||
// subtract NumberOfInteractionLengthLeft
|
||||
SubtractNumberOfInteractionLengthLeft(previousStepSize);
|
||||
if(theNumberOfInteractionLengthLeft<perMillion)
|
||||
theNumberOfInteractionLengthLeft=0.;
|
||||
}
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
// get mean free path
|
||||
currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ((currentInteractionLength <=0.0) || (verboseLevel>2)){
|
||||
G4cout << "G4VDiscreteProcess::PostStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]" <<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
G4double value = theNumberOfInteractionLengthLeft * currentInteractionLength;
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>1){
|
||||
G4cout << "G4VDiscreteProcess::PostStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "InteractionLength= " << value/cm <<"[cm] " <<endl;
|
||||
}
|
||||
#endif
|
||||
return value;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4VDiscreteProcess::PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4VProcess.hh,v 2.4 1998/08/10 13:12:32 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 18 Dec. 1996 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
// change DoIt/GetPIL arguments type 20 Mar. 1997 H.Kurashige
|
||||
// modified AlongStepGPIL 17 Dec. 1997 H.Kurashige
|
||||
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
|
||||
// Add process trype 27 Mar. 1998 H.Kurashige
|
||||
// Remove thePhysicsTable 2 Aug. 1998 H.Kurashige
|
||||
|
||||
#ifndef G4VProcess_h
|
||||
#define G4VProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
class G4ParticleDefinition;
|
||||
class G4DynamicParticle;
|
||||
class G4Track;
|
||||
class G4Step;
|
||||
|
||||
#include "G4PhysicsTable.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4ForceCondition.hh"
|
||||
#include "G4GPILSelection.hh"
|
||||
#include "G4ParticleChange.hh"
|
||||
#include "G4ProcessType.hh"
|
||||
|
||||
class G4VProcess
|
||||
{
|
||||
// A virtual class for physics process objects. It defines
|
||||
// public methods which describe the behavior of a
|
||||
// physics process.
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator as private
|
||||
// do not hide default constructor for alpha version
|
||||
// G4VProcess G4VProcess();
|
||||
G4VProcess & operator=(const G4VProcess &right);
|
||||
|
||||
public:
|
||||
// constructor requires the process name and type
|
||||
G4VProcess(const G4String& aName = "NoName",
|
||||
G4ProcessType aType = fNotDefined );
|
||||
|
||||
// copy constructor copys the name but does not copy the
|
||||
// physics table (NULL pointer is assigned)
|
||||
G4VProcess(G4VProcess &right);
|
||||
|
||||
virtual ~G4VProcess();
|
||||
|
||||
G4int operator==(const G4VProcess &right) const;
|
||||
G4int operator!=(const G4VProcess &right) const;
|
||||
|
||||
virtual G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& track,
|
||||
const G4Step& stepData
|
||||
) = 0;
|
||||
|
||||
virtual G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& track,
|
||||
const G4Step& stepData
|
||||
) = 0;
|
||||
virtual G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& track,
|
||||
const G4Step& stepData
|
||||
) = 0;
|
||||
// A virtual base class function that has to be overridden
|
||||
// by any subclass. The DoIt method actually performs the
|
||||
// physics process and determines either momentum change
|
||||
// of the production of secondaries etc.
|
||||
// arguments
|
||||
// const G4Track& track:
|
||||
// reference to the current G4Track information
|
||||
// const G4Step& stepData:
|
||||
// reference to the current G4Step information
|
||||
|
||||
virtual G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& proposedSafety,
|
||||
G4GPILSelection* selection) = 0;
|
||||
|
||||
virtual G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4ForceCondition* condition
|
||||
) = 0;
|
||||
|
||||
virtual G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
) = 0;
|
||||
|
||||
// Returns the Step-size (actual length) which is allowed
|
||||
// by "this" process. (for AtRestGetPhysicalInteractionLength,
|
||||
// return value is Step-time) The NumberOfInteractionLengthLeft is
|
||||
// recalculated by using previousStepSize and the Step-size is
|
||||
// calucalted accoding to the resultant NumberOfInteractionLengthLeft.
|
||||
// using NumberOfInteractionLengthLeft, which is recalculated at
|
||||
// arguments
|
||||
// const G4Track& track:
|
||||
// reference to the current G4Track information
|
||||
// G4double* previousStepSize:
|
||||
// the Step-size (actual length) of the previous Step
|
||||
// of this track. Negative calue indicates that
|
||||
// NumberOfInteractionLengthLeft must be reset.
|
||||
// the current physical interaction legth of this process
|
||||
// G4ForceCondition* condition:
|
||||
// the flag indicates DoIt of this process is forced
|
||||
// to be called
|
||||
// Forced: Corresponding DoIt is forced
|
||||
// NotForced: Corresponding DoIt is called
|
||||
// if the Step size of this Step is determined
|
||||
// by this process
|
||||
// !! AlongStepDoIt is always called !!
|
||||
// G4double& currentMinimumStep:
|
||||
// this value is used for transformation of
|
||||
// true path length to geometrical path length
|
||||
|
||||
virtual G4bool IsApplicable(const G4ParticleDefinition&){return true;};
|
||||
// Returns true if this process object is applicable to
|
||||
// the particle type
|
||||
|
||||
virtual void BuildPhysicsTable(const G4ParticleDefinition&){};
|
||||
// Messaged by the Particle definition (via the Process manager)
|
||||
// whenever cross section tables have to be rebuilt (i.e. if new
|
||||
// materials have been defined).
|
||||
// It is overloaded by individual processes when they need physics
|
||||
// tables.
|
||||
|
||||
// Processes which Build (for example in their
|
||||
// constructors) physics tables independent of cuts
|
||||
// should preferably use a
|
||||
// private void BuildThePhysicsTable()
|
||||
// function. Not another BuildPhysicsTable, please.
|
||||
|
||||
G4String GetProcessName() const;
|
||||
// Returns the name of the process.
|
||||
|
||||
G4ProcessType GetProcessType() const;
|
||||
// Returns the process type.
|
||||
|
||||
void SetProcessType(G4ProcessType );
|
||||
// Set the process type.
|
||||
|
||||
static G4String GetProcessTypeName(G4ProcessType );
|
||||
// Returns the process type name
|
||||
|
||||
virtual void StartTracking();
|
||||
virtual void EndTracking();
|
||||
// inform Start/End of tracking for each track to the physics process
|
||||
|
||||
protected:
|
||||
//--- Removed ----//
|
||||
// G4PhysicsTable* thePhysicsTable;
|
||||
// A Physics Table can be either a cross-sections table or
|
||||
// an energy table (or can be used for other specific
|
||||
// purposes).
|
||||
|
||||
G4VParticleChange* pParticleChange;
|
||||
// The pointer to G4VParticleChange object
|
||||
// which is modified and returned by address by the DoIt() method.
|
||||
// This pointer should be set in each physics process
|
||||
// after construction of derived class object.
|
||||
|
||||
G4ParticleChange aParticleChange;
|
||||
// This object is kept for compatibility with old scheme
|
||||
// This will be removed in future
|
||||
|
||||
G4double theNumberOfInteractionLengthLeft;
|
||||
// The flight length left for the current tracking particle
|
||||
// in unit of "Interaction length".
|
||||
|
||||
G4double currentInteractionLength;
|
||||
// The InteractionLength in the current material
|
||||
|
||||
public:
|
||||
virtual void ResetNumberOfInteractionLengthLeft();
|
||||
// reset (determine the value of)NumberOfInteractionLengthLeft
|
||||
|
||||
protected:
|
||||
virtual void SubtractNumberOfInteractionLengthLeft(
|
||||
G4double previousStepSize
|
||||
);
|
||||
// subtract NumberOfInteractionLengthLeft by the value corresponding to
|
||||
// previousStepSize
|
||||
|
||||
virtual void ClearNumberOfInteractionLengthLeft();
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
// !!! This method should be at the end of PostStepDoIt()
|
||||
// !!! and AtRestDoIt
|
||||
|
||||
private:
|
||||
G4String theProcessName;
|
||||
// The name of the process
|
||||
|
||||
G4ProcessType theProcessType;
|
||||
// The type of the process
|
||||
|
||||
public:
|
||||
virtual void DumpInfo() const;
|
||||
|
||||
public:
|
||||
void SetVerboseLevel(G4int value);
|
||||
G4int GetVerboseLevel() const;
|
||||
|
||||
protected:
|
||||
G4int verboseLevel;
|
||||
// controle flag for output message
|
||||
// 0: Silent
|
||||
// 1: Warning message
|
||||
// 2: More
|
||||
|
||||
};
|
||||
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
#include "Randomize.hh"
|
||||
|
||||
inline G4String G4VProcess::GetProcessName() const
|
||||
{
|
||||
return theProcessName;
|
||||
}
|
||||
|
||||
inline
|
||||
G4ProcessType G4VProcess::GetProcessType() const
|
||||
{
|
||||
return theProcessType;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VProcess::SetProcessType(G4ProcessType aType)
|
||||
{
|
||||
theProcessType = aType;
|
||||
}
|
||||
|
||||
inline void G4VProcess::SetVerboseLevel(G4int value)
|
||||
{
|
||||
verboseLevel = value;
|
||||
}
|
||||
|
||||
inline G4int G4VProcess::GetVerboseLevel() const
|
||||
{
|
||||
return verboseLevel;
|
||||
}
|
||||
|
||||
inline void G4VProcess::ResetNumberOfInteractionLengthLeft()
|
||||
{
|
||||
theNumberOfInteractionLengthLeft = -log( G4UniformRand() );
|
||||
}
|
||||
|
||||
inline void G4VProcess::ClearNumberOfInteractionLengthLeft()
|
||||
{
|
||||
theNumberOfInteractionLengthLeft = -1.0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,264 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4VRestContinuousDiscreteProcess.hh,v 2.4 1998/10/16 13:21:37 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 8 Mar. 1997 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
// modified 26 Mar. 1997 H.Kurahige
|
||||
// modified 16 Apr. 1997 L.Urban
|
||||
// modified AlongStepGPIL etc. 17 Dec. 1997 H.Kurashige
|
||||
// fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
|
||||
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
|
||||
|
||||
|
||||
#ifndef G4VRestContinuousDiscreteProcess_h
|
||||
#define G4VRestContinuousDiscreteProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
class G4VRestContinuousDiscreteProcess : public G4VProcess
|
||||
{
|
||||
// Abstract class which defines the public behavior of
|
||||
// discrete physics interactions.
|
||||
public:
|
||||
|
||||
G4VRestContinuousDiscreteProcess(const G4String& ,
|
||||
G4ProcessType aType = fNotDefined );
|
||||
G4VRestContinuousDiscreteProcess(G4VRestContinuousDiscreteProcess &);
|
||||
|
||||
~G4VRestContinuousDiscreteProcess();
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
);
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4ForceCondition*
|
||||
);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
protected:
|
||||
virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
|
||||
// Calculates the mean life-time (i.e. for decays) of the
|
||||
// particle at rest due to the occurence of the given process,
|
||||
// or converts the probability of interaction (i.e. for
|
||||
// annihilation) into the life-time of the particle for the
|
||||
// occurence of the given process.
|
||||
|
||||
virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety
|
||||
)=0;
|
||||
private:
|
||||
// this is the returnd value of G4GPILSelection in
|
||||
// the arguments of AlongStepGPIL()
|
||||
G4GPILSelection valueGPILSelection;
|
||||
|
||||
protected:
|
||||
// these two methods are set/get methods for valueGPILSelection
|
||||
// these two methods are set/get methods for valueGPILSelection
|
||||
void SetGPILSelection(G4GPILSelection selection)
|
||||
{ valueGPILSelection = selection;};
|
||||
|
||||
G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
|
||||
|
||||
protected:
|
||||
virtual G4double GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)=0;
|
||||
// Calculates from the macroscopic cross section a mean
|
||||
// free path, the value is returned in units of distance.
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator as private
|
||||
G4VRestContinuousDiscreteProcess();
|
||||
G4VRestContinuousDiscreteProcess & operator=(const G4VRestContinuousDiscreteProcess &right);
|
||||
|
||||
};
|
||||
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
inline G4double G4VRestContinuousDiscreteProcess::AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
// beggining of tracking
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
// get mean life time
|
||||
currentInteractionLength = GetMeanLifeTime(track, condition);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ((currentInteractionLength <0.0) || (verboseLevel>2)){
|
||||
G4cout << "G4VRestContinuousDiscreteProcess::AtRestGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
return theNumberOfInteractionLengthLeft * currentInteractionLength;
|
||||
}
|
||||
|
||||
|
||||
inline G4VParticleChange* G4VRestContinuousDiscreteProcess::AtRestDoIt(
|
||||
const G4Track&,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
inline G4double G4VRestContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
)
|
||||
{
|
||||
// GPILSelection is set to defaule value of CandidateForSelection
|
||||
valueGPILSelection = CandidateForSelection;
|
||||
|
||||
// get Step limit proposed by the process
|
||||
G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety);
|
||||
|
||||
// set return value for G4GPILSelection
|
||||
*selection = valueGPILSelection;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>1){
|
||||
G4cout << "G4VRestContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<endl;
|
||||
}
|
||||
#endif
|
||||
return steplength ;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4VRestContinuousDiscreteProcess::AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
inline G4double G4VRestContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
|
||||
// beggining of tracking (or just after DoIt of this process)
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
} else {
|
||||
// subtract NumberOfInteractionLengthLeft
|
||||
SubtractNumberOfInteractionLengthLeft(previousStepSize);
|
||||
if(theNumberOfInteractionLengthLeft<perMillion)
|
||||
theNumberOfInteractionLengthLeft=0.;
|
||||
}
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
// get mean free path
|
||||
currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ((currentInteractionLength <=0.0) || (verboseLevel>2)){
|
||||
G4cout << "G4VRestContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]" <<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
G4double value = theNumberOfInteractionLengthLeft * currentInteractionLength;
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>1){
|
||||
G4cout << "G4VRestContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "InteractionLength= " << value/cm <<"[cm] " <<endl;
|
||||
}
|
||||
#endif
|
||||
return value;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4VRestContinuousDiscreteProcess::PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4VRestContinuousProcess.hh,v 2.5 1998/10/16 13:21:38 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 8 Mar. 1997 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
// modified 26 Mar. 1997 H.Kurahige
|
||||
// modified 16 Apr. 1997 L.Urban
|
||||
// modified 18 Sep. 1997 H.Kurashige
|
||||
// modified AlongStepGPIL etc. 17 Dec. 1997 H.Kurashige
|
||||
// fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
|
||||
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
|
||||
|
||||
#ifndef G4VRestContinuousProcess_h
|
||||
#define G4VRestContinuousProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
class G4VRestContinuousProcess : public G4VProcess
|
||||
{
|
||||
// Abstract class which defines the public behavior of
|
||||
// discrete physics interactions.
|
||||
public:
|
||||
|
||||
G4VRestContinuousProcess(const G4String& ,
|
||||
G4ProcessType aType = fNotDefined );
|
||||
G4VRestContinuousProcess(G4VRestContinuousProcess &);
|
||||
|
||||
~G4VRestContinuousProcess();
|
||||
|
||||
G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4ForceCondition*
|
||||
);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
);
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
// no operation in PostStepDoIt
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4double ,
|
||||
G4ForceCondition*
|
||||
){ return -1.0; };
|
||||
|
||||
// no operation in PostStepDoIt
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
protected:
|
||||
virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety
|
||||
)=0;
|
||||
private:
|
||||
// this is the returnd value of G4GPILSelection in
|
||||
// the arguments of AlongStepGPIL()
|
||||
G4GPILSelection valueGPILSelection;
|
||||
|
||||
protected:
|
||||
// these two methods are set/get methods for valueGPILSelection
|
||||
void SetGPILSelection(G4GPILSelection selection)
|
||||
{ valueGPILSelection = selection;};
|
||||
|
||||
G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
|
||||
|
||||
protected:
|
||||
|
||||
virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
|
||||
// Calculates the mean life-time (i.e. for decays) of the
|
||||
// particle at rest due to the occurence of the given process,
|
||||
// or converts the probability of interaction (i.e. for
|
||||
// annihilation) into the life-time of the particle for the
|
||||
// occurence of the given process.
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator as private
|
||||
G4VRestContinuousProcess();
|
||||
G4VRestContinuousProcess & operator=(const G4VRestContinuousProcess &right);
|
||||
|
||||
};
|
||||
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
inline G4double G4VRestContinuousProcess::AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
)
|
||||
{
|
||||
// GPILSelection is set to defaule value of CandidateForSelection
|
||||
valueGPILSelection = CandidateForSelection;
|
||||
|
||||
// get Step limit proposed by the process
|
||||
G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety);
|
||||
|
||||
// set return value for G4GPILSelection
|
||||
*selection = valueGPILSelection;
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>1){
|
||||
G4cout << "G4VRestContinuousProcess::AlongStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<endl;
|
||||
}
|
||||
#endif
|
||||
return steplength ;
|
||||
}
|
||||
|
||||
inline G4double G4VRestContinuousProcess::AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
// beggining of tracking
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
// get mean life time
|
||||
currentInteractionLength = GetMeanLifeTime(track, condition);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ((currentInteractionLength <0.0) || (verboseLevel>2)){
|
||||
G4cout << "G4VRestContinuousProcess::AtRestGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
return theNumberOfInteractionLengthLeft * currentInteractionLength;
|
||||
}
|
||||
|
||||
|
||||
inline G4VParticleChange* G4VRestContinuousProcess::AtRestDoIt(
|
||||
const G4Track&,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4VRestContinuousProcess::AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4VRestDiscreteProcess.hh,v 2.4 1998/10/16 13:21:39 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 8 Mar. 1997 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
// modified 26 Mar. 1997 H.Kurahige
|
||||
// modified 16 Apr. 1997 L.Urban
|
||||
// modified 16 Dec. 1997 L.Urban
|
||||
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
|
||||
|
||||
|
||||
#ifndef G4VRestDiscreteProcess_h
|
||||
#define G4VRestDiscreteProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
|
||||
class G4VRestDiscreteProcess : public G4VProcess
|
||||
{
|
||||
// Abstract class which defines the public behavior of
|
||||
// rest + discrete physics interactions.
|
||||
public:
|
||||
|
||||
G4VRestDiscreteProcess(const G4String& ,
|
||||
G4ProcessType aType = fNotDefined );
|
||||
G4VRestDiscreteProcess(G4VRestDiscreteProcess &);
|
||||
|
||||
~G4VRestDiscreteProcess();
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4ForceCondition*
|
||||
);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
// no operation in AlongStepDoIt
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*
|
||||
){ return -1.0; };
|
||||
|
||||
// no operation in AlongStepDoIt
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
|
||||
protected:
|
||||
virtual G4double GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)=0;
|
||||
// Calculates from the macroscopic cross section a mean
|
||||
// free path, the value is returned in units of distance.
|
||||
|
||||
virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
|
||||
// Calculates the mean life-time (i.e. for decays) of the
|
||||
// particle at rest due to the occurence of the given process,
|
||||
// or converts the probability of interaction (i.e. for
|
||||
// annihilation) into the life-time of the particle for the
|
||||
// occurence of the given process.
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator as private
|
||||
G4VRestDiscreteProcess();
|
||||
G4VRestDiscreteProcess & operator=(const G4VRestDiscreteProcess &right);
|
||||
|
||||
};
|
||||
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
#include "Randomize.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
inline
|
||||
G4double G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
|
||||
// beggining of tracking (or just after DoIt of this process)
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
} else {
|
||||
// subtract NumberOfInteractionLengthLeft
|
||||
SubtractNumberOfInteractionLengthLeft(previousStepSize);
|
||||
if(theNumberOfInteractionLengthLeft<perMillion)
|
||||
theNumberOfInteractionLengthLeft=0.;
|
||||
}
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
// get mean free path
|
||||
currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ((currentInteractionLength <=0.0) || (verboseLevel>2)){
|
||||
G4cout << "G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]" <<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
G4double value = theNumberOfInteractionLengthLeft * currentInteractionLength;
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>1){
|
||||
G4cout << "G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "InteractionLength= " << value/cm <<"[cm] " <<endl;
|
||||
}
|
||||
#endif
|
||||
return value;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4VRestDiscreteProcess::PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// reset NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
inline G4double G4VRestDiscreteProcess::AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
// beggining of tracking
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
// get mean life time
|
||||
currentInteractionLength = GetMeanLifeTime(track, condition);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ((currentInteractionLength <0.0) || (verboseLevel>2)){
|
||||
G4cout << "G4VRestDiscreteProcess::AtRestGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
return theNumberOfInteractionLengthLeft * currentInteractionLength;
|
||||
}
|
||||
|
||||
|
||||
inline G4VParticleChange* G4VRestDiscreteProcess::AtRestDoIt(
|
||||
const G4Track&,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4VRestProcess.hh,v 2.4 1998/10/16 13:21:40 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 18 Dec. 1996 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
// modified 25 Feb. 1997 H.Kurahige
|
||||
// modified 8 Mar. 1997 H.Kurahige
|
||||
// modified 26 Mar. 1997 H.Kurahige
|
||||
// modified 16 Apr. 1997 L.Urban
|
||||
// modified 17 Dec. 1997 L.Urban
|
||||
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
|
||||
|
||||
|
||||
#ifndef G4VRestProcess_h
|
||||
#define G4VRestProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
|
||||
class G4VRestProcess : public G4VProcess
|
||||
{
|
||||
// Abstract class which defines the public behavior of
|
||||
// physics interactions at rest.
|
||||
|
||||
public:
|
||||
G4VRestProcess(const G4String& ,
|
||||
G4ProcessType aType = fNotDefined );
|
||||
G4VRestProcess(G4VRestProcess& );
|
||||
|
||||
~G4VRestProcess();
|
||||
|
||||
G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
// no operation in PostStepDoIt and AlongStepDoIt
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& ,
|
||||
G4GPILSelection*
|
||||
){ return -1.0; };
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4double ,
|
||||
G4ForceCondition*
|
||||
) { return -1.0; };
|
||||
|
||||
// no operation in PostStepDoIt and AlongStepDoIt
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
) {return NULL;};
|
||||
|
||||
protected:
|
||||
|
||||
virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
|
||||
// Calculates the mean life-time (i.e. for decays) of the
|
||||
// particle at rest due to the occurence of the given process,
|
||||
// or converts the probability of interaction (i.e. for
|
||||
// annihilation) into the life-time of the particle for the
|
||||
// occurence of the given process.
|
||||
|
||||
private:
|
||||
// hide default constructor and assignment operator as private
|
||||
G4VRestProcess();
|
||||
G4VRestProcess & operator=(const G4VRestProcess &right);
|
||||
};
|
||||
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
inline G4double G4VRestProcess::AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
// beggining of tracking
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
// get mean life time
|
||||
currentInteractionLength = GetMeanLifeTime(track, condition);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ((currentInteractionLength <0.0) || (verboseLevel>2)){
|
||||
G4cout << "G4VRestProcess::AtRestGetPhysicalInteractionLength ";
|
||||
G4cout << "[ " << GetProcessName() << "]" <<endl;
|
||||
track.GetDynamicParticle()->DumpInfo();
|
||||
G4cout << " in Material " << track.GetMaterial()->GetName() <<endl;
|
||||
G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
return theNumberOfInteractionLengthLeft * currentInteractionLength;
|
||||
}
|
||||
|
||||
|
||||
inline G4VParticleChange* G4VRestProcess::AtRestDoIt(
|
||||
const G4Track&,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user