Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,531 @@
|
||||
// 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: G4SteppingManager.hh,v 2.4 1998/08/26 01:55:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4SteppingManager.hh
|
||||
//
|
||||
// Description:
|
||||
// This class represents the manager who steers to move the give
|
||||
// particle from the TrackingManger by one Step.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
|
||||
|
||||
#include <rw/tvordvec.h> // Include from 'RogueWave'
|
||||
|
||||
class G4SteppingManager;
|
||||
|
||||
#ifndef G4SteppingManager_h
|
||||
#define G4SteppingManager_h 1
|
||||
|
||||
#include "G4ios.hh" // Include from 'system'
|
||||
#include <iomanip.h> // Include from 'system'
|
||||
#include "globals.hh" // Include from 'global'
|
||||
#include "Randomize.hh" // Include from 'global'
|
||||
#include "G4Navigator.hh" // Include from 'geometry'
|
||||
#include "G4LogicalVolume.hh" // Include from 'geometry'
|
||||
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
|
||||
//#include "G4VSensitiveDetector.hh" // Include from 'hits/digi'
|
||||
class G4VSensitiveDetector;
|
||||
#include "G4ProcessManager.hh" // Include from 'piim'
|
||||
//#include "G4DynamicParticleVector.hh" // Include from 'piim'
|
||||
//#include "G4Hit.hh" // Include from 'Hit/dig'
|
||||
|
||||
#include "G4Track.hh" // Include from 'tracking'
|
||||
#include "G4TrackVector.hh" // Include from 'tracking'
|
||||
#include "G4TrackStatus.hh" // Include from 'tracking'
|
||||
#include "G4StepStatus.hh" // Include from 'tracking'
|
||||
#include "G4UserSteppingAction.hh" // Include from 'tracking'
|
||||
#include "G4Step.hh" // Include from 'tracking'
|
||||
#include "G4StepPoint.hh" // Include from 'tracking'
|
||||
#include "G4SteppingVerbose.hh" // Include from 'tracking'
|
||||
#include "G4VTouchable.hh" // Include from 'geometry'
|
||||
#include "G4TouchableHistory.hh" // Include from 'geometry'
|
||||
|
||||
// must be changed in elegant way
|
||||
static const G4int SIZEofSelectedDoIt=100;
|
||||
// RogueWave Tools.h++
|
||||
typedef RWTValOrderedVector<G4int>
|
||||
G4SelectedAtRestDoItVector;
|
||||
typedef RWTValOrderedVector<G4int>
|
||||
G4SelectedAlongStepDoItVector;
|
||||
typedef RWTValOrderedVector<G4int>
|
||||
G4SelectedPostStepDoItVector;
|
||||
|
||||
|
||||
///////////////////////
|
||||
class G4SteppingManager
|
||||
///////////////////////
|
||||
{
|
||||
//--------
|
||||
public:
|
||||
//--------
|
||||
|
||||
// Constructor/Destructor
|
||||
|
||||
G4SteppingManager();
|
||||
// SteppingManger should be dynamically persistent, therefore
|
||||
// you need to invoke new() when you call this constructor.
|
||||
// "Secodary track vector" will be dynamically created by this
|
||||
// cosntructor. "G4UserSteppingAction" will be also constructed
|
||||
// in this constructor, and "this" pointer will be passed to
|
||||
// "G4UserSteppingAction".
|
||||
|
||||
~G4SteppingManager();
|
||||
|
||||
// Get/Set functions
|
||||
|
||||
G4TrackVector* GetSecondary() const;
|
||||
void SetUserAction(G4UserSteppingAction* apAction);
|
||||
G4Track* GetTrack() const;
|
||||
void SetVerboseLevel(G4int vLevel);
|
||||
G4Step* GetStep() const;
|
||||
|
||||
|
||||
// Other member functions
|
||||
|
||||
G4StepStatus Stepping();
|
||||
// Steers to move the give particle from the TrackingManger
|
||||
// by one Step.
|
||||
|
||||
void SetInitialStep(G4Track* valueTrack);
|
||||
// Sets up initial track information (enegry, position, etc) to
|
||||
// the PreStepPoint of the G4Step. This funciton has to be called
|
||||
// just once before the stepping loop in the "TrackingManager".
|
||||
|
||||
void GetProcessNumber();
|
||||
|
||||
// Get methods
|
||||
G4double GetPhysicalStep();
|
||||
G4double GetGeometricalStep();
|
||||
G4double GetCorrectedStep();
|
||||
G4bool GetPreStepPointIsGeom();
|
||||
G4bool GetFirstStep();
|
||||
G4StepStatus GetfStepStatus();
|
||||
G4double GetTempInitVelocity();
|
||||
G4double GetTempVelocity();
|
||||
G4double GetMass();
|
||||
G4double GetsumEnergyChange();
|
||||
G4VParticleChange* GetfParticleChange();
|
||||
G4Track* GetfTrack();
|
||||
G4TrackVector* GetfSecondary();
|
||||
G4Step* GetfStep();
|
||||
G4StepPoint* GetfPreStepPoint();
|
||||
G4StepPoint* GetfPostStepPoint();
|
||||
G4VPhysicalVolume* GetfCurrentVolume();
|
||||
G4VSensitiveDetector* GetfSensitive();
|
||||
G4VProcess* GetfCurrentProcess();
|
||||
G4ProcessVector* GetfAtRestDoItVector();
|
||||
G4ProcessVector* GetfAlongStepDoItVector();
|
||||
G4ProcessVector* GetfPostStepDoItVector();
|
||||
G4ProcessVector* GetfAlongStepGetPhysIntVector();
|
||||
G4ProcessVector* GetfPostStepGetPhysIntVector();
|
||||
G4ProcessVector* GetfAtRestGetPhysIntVector();
|
||||
G4double GetcurrentMinimumStep();
|
||||
G4double GetnumberOfInteractionLengthLeft();
|
||||
size_t GetfAtRestDoItProcTriggered();
|
||||
size_t GetfAlongStepDoItProcTriggered();
|
||||
size_t GetfPostStepDoItProcTriggered();
|
||||
G4int GetfN2ndariesAtRestDoIt();
|
||||
G4int GetfN2ndariesAlongStepDoIt();
|
||||
G4int GetfN2ndariesPostStepDoIt();
|
||||
G4Navigator* GetfNavigator();
|
||||
G4int GetverboseLevel();
|
||||
size_t GetMAXofAtRestLoops();
|
||||
size_t GetMAXofAlongStepLoops();
|
||||
size_t GetMAXofPostStepLoops();
|
||||
G4SelectedAtRestDoItVector* GetfSelectedAtRestDoItVector();
|
||||
G4SelectedAlongStepDoItVector* GetfSelectedAlongStepDoItVector();
|
||||
G4SelectedPostStepDoItVector* GetfSelectedPostStepDoItVector();
|
||||
G4double GetfPreviousStepSize();
|
||||
G4VTouchable* GetfTouchable1();
|
||||
G4VTouchable* GetfTouchable2();
|
||||
G4bool GetfIsTouchable1Free();
|
||||
G4bool GetfIsTouchable2Free();
|
||||
G4SteppingControl GetStepControlFlag();
|
||||
G4Navigator GetNavigator();
|
||||
G4UserSteppingAction* GetUserAction();
|
||||
G4double GetphysIntLength();
|
||||
G4ForceCondition GetfCondition();
|
||||
G4GPILSelection GetfGPILSelection();
|
||||
|
||||
|
||||
//---------
|
||||
private:
|
||||
//---------
|
||||
|
||||
// Member functions
|
||||
|
||||
void DefinePhysicalStepLength();
|
||||
// Calculate corresponding physical length from the mean free path
|
||||
// left for each discrete phyiscs process. The minimum allowable
|
||||
// Step for each continious process will be also calculated.
|
||||
void InvokeAtRestDoItProcs();
|
||||
void InvokeAlongStepDoItProcs();
|
||||
void InvokePostStepDoItProcs();
|
||||
void SetNavigator(G4Navigator* value);
|
||||
G4double CalculateSafety();
|
||||
// Return the estimated safety value at the PostStepPoint
|
||||
G4VTouchable* GetFreeTouchable();
|
||||
// Get Touchable which is free, i.e. not assigined to Track/StepPoint
|
||||
// If no free touchable is availabe, the NULL will be returned
|
||||
// Once you get a Touchable, it will be set to NotFree.
|
||||
void SetAnotherTouchableFree(G4VTouchable* value);
|
||||
// Set the partner of the given Touchable to be free. For example,
|
||||
// the argument has fTouchable1, then fTouchable2 will be set to
|
||||
// free. The state of fTouchable1 is intact.
|
||||
|
||||
|
||||
// Member data
|
||||
|
||||
G4UserSteppingAction* fUserSteppingAction;
|
||||
|
||||
G4SteppingVerbose* fVerbose;
|
||||
|
||||
G4double PhysicalStep;
|
||||
G4double GeometricalStep;
|
||||
G4double CorrectedStep;
|
||||
G4bool PreStepPointIsGeom;
|
||||
G4bool FirstStep;
|
||||
G4StepStatus fStepStatus;
|
||||
|
||||
G4double TempInitVelocity;
|
||||
G4double TempVelocity;
|
||||
G4double Mass;
|
||||
|
||||
G4double sumEnergyChange;
|
||||
|
||||
G4VParticleChange* fParticleChange;
|
||||
G4Track* fTrack;
|
||||
G4TrackVector* fSecondary;
|
||||
G4Step* fStep;
|
||||
G4StepPoint* fPreStepPoint;
|
||||
G4StepPoint* fPostStepPoint;
|
||||
|
||||
G4VPhysicalVolume* fCurrentVolume;
|
||||
G4VSensitiveDetector* fSensitive;
|
||||
G4VProcess* fCurrentProcess;
|
||||
// The pointer to the process of which DoIt or
|
||||
// GetPhysicalInteractionLength has been just executed.
|
||||
|
||||
|
||||
G4ProcessVector* fAtRestDoItVector;
|
||||
G4ProcessVector* fAlongStepDoItVector;
|
||||
G4ProcessVector* fPostStepDoItVector;
|
||||
|
||||
G4ProcessVector* fAtRestGetPhysIntVector;
|
||||
G4ProcessVector* fAlongStepGetPhysIntVector;
|
||||
G4ProcessVector* fPostStepGetPhysIntVector;
|
||||
|
||||
size_t MAXofAtRestLoops;
|
||||
size_t MAXofAlongStepLoops;
|
||||
size_t MAXofPostStepLoops;
|
||||
|
||||
G4double currentMinimumStep;
|
||||
G4double numberOfInteractionLengthLeft;
|
||||
|
||||
size_t fAtRestDoItProcTriggered;
|
||||
size_t fAlongStepDoItProcTriggered;
|
||||
size_t fPostStepDoItProcTriggered;
|
||||
|
||||
G4int fN2ndariesAtRestDoIt;
|
||||
G4int fN2ndariesAlongStepDoIt;
|
||||
G4int fN2ndariesPostStepDoIt;
|
||||
// These are the numbers of secondaries generated by the process
|
||||
// just executed.
|
||||
|
||||
G4Navigator *fNavigator;
|
||||
|
||||
G4int verboseLevel;
|
||||
|
||||
G4SelectedAtRestDoItVector *fSelectedAtRestDoItVector;
|
||||
G4SelectedAlongStepDoItVector *fSelectedAlongStepDoItVector;
|
||||
G4SelectedPostStepDoItVector *fSelectedPostStepDoItVector;
|
||||
|
||||
G4double fPreviousStepSize;
|
||||
|
||||
G4VTouchable* fTouchable1;
|
||||
G4VTouchable* fTouchable2;
|
||||
G4bool fIsTouchable1Free;
|
||||
G4bool fIsTouchable2Free;
|
||||
|
||||
G4SteppingControl StepControlFlag;
|
||||
|
||||
G4double proposedSafety;
|
||||
// This keeps the minimum safety value proposed by AlongStepGPILs.
|
||||
G4ThreeVector endpointSafOrigin;
|
||||
G4double endpointSafety;
|
||||
// To get the true safety value at the PostStepPoint, you have
|
||||
// to subtract the distance to 'endpointSafOrigin' from this value.
|
||||
G4double physIntLength;
|
||||
G4ForceCondition fCondition;
|
||||
G4GPILSelection fGPILSelection;
|
||||
// Above three variables are for the method
|
||||
// DefinePhysicalStepLength(). To pass these information to
|
||||
// the method Verbose, they are kept at here. Need a more
|
||||
// elegant mechanism.
|
||||
|
||||
};
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
//
|
||||
// Inline function
|
||||
//
|
||||
//*******************************************************************
|
||||
|
||||
inline G4double G4SteppingManager::GetPhysicalStep(){
|
||||
return PhysicalStep;
|
||||
}
|
||||
|
||||
inline G4double G4SteppingManager::GetGeometricalStep(){
|
||||
return GeometricalStep;
|
||||
}
|
||||
|
||||
inline G4double G4SteppingManager::GetCorrectedStep(){
|
||||
return CorrectedStep;
|
||||
}
|
||||
inline G4bool G4SteppingManager::GetPreStepPointIsGeom(){
|
||||
return PreStepPointIsGeom;
|
||||
}
|
||||
|
||||
inline G4bool G4SteppingManager::GetFirstStep(){
|
||||
return FirstStep;
|
||||
}
|
||||
|
||||
inline G4StepStatus G4SteppingManager::GetfStepStatus(){
|
||||
return fStepStatus;
|
||||
}
|
||||
|
||||
inline G4double G4SteppingManager::GetTempInitVelocity(){
|
||||
return TempInitVelocity;
|
||||
}
|
||||
inline G4double G4SteppingManager::GetTempVelocity(){
|
||||
return TempVelocity;
|
||||
}
|
||||
inline G4double G4SteppingManager::GetMass(){
|
||||
return Mass;
|
||||
}
|
||||
|
||||
inline G4double G4SteppingManager::GetsumEnergyChange(){
|
||||
return sumEnergyChange;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4SteppingManager::GetfParticleChange(){
|
||||
return fParticleChange;
|
||||
}
|
||||
|
||||
inline G4Track* G4SteppingManager::GetfTrack(){
|
||||
return fTrack;
|
||||
}
|
||||
|
||||
inline G4TrackVector* G4SteppingManager::GetfSecondary(){
|
||||
return fSecondary;
|
||||
}
|
||||
inline G4Step* G4SteppingManager::GetfStep(){
|
||||
return fStep;
|
||||
}
|
||||
inline G4StepPoint* G4SteppingManager::GetfPreStepPoint(){
|
||||
return fPreStepPoint;
|
||||
}
|
||||
inline G4StepPoint* G4SteppingManager::GetfPostStepPoint(){
|
||||
return fPostStepPoint;
|
||||
}
|
||||
|
||||
inline G4VPhysicalVolume* G4SteppingManager::GetfCurrentVolume(){
|
||||
return fCurrentVolume;
|
||||
}
|
||||
inline G4VSensitiveDetector* G4SteppingManager::GetfSensitive(){
|
||||
return fSensitive;
|
||||
}
|
||||
inline G4VProcess* G4SteppingManager::GetfCurrentProcess(){
|
||||
return fCurrentProcess;
|
||||
}
|
||||
|
||||
inline G4ProcessVector* G4SteppingManager::GetfAtRestDoItVector(){
|
||||
return fAtRestDoItVector;
|
||||
}
|
||||
inline G4ProcessVector* G4SteppingManager::GetfAlongStepDoItVector(){
|
||||
return fAlongStepDoItVector;
|
||||
}
|
||||
inline G4ProcessVector* G4SteppingManager::GetfPostStepDoItVector(){
|
||||
return fPostStepDoItVector;
|
||||
}
|
||||
|
||||
inline G4ProcessVector* G4SteppingManager::GetfAtRestGetPhysIntVector(){
|
||||
return fAtRestGetPhysIntVector;
|
||||
}
|
||||
|
||||
inline G4ProcessVector* G4SteppingManager::GetfAlongStepGetPhysIntVector(){
|
||||
return fAlongStepGetPhysIntVector;
|
||||
}
|
||||
|
||||
inline G4ProcessVector* G4SteppingManager::GetfPostStepGetPhysIntVector(){
|
||||
return fPostStepGetPhysIntVector;
|
||||
}
|
||||
|
||||
inline size_t G4SteppingManager::GetMAXofAtRestLoops(){
|
||||
return MAXofAtRestLoops;
|
||||
}
|
||||
inline size_t G4SteppingManager::GetMAXofAlongStepLoops(){
|
||||
return MAXofAlongStepLoops;
|
||||
}
|
||||
inline size_t G4SteppingManager::GetMAXofPostStepLoops(){
|
||||
return MAXofPostStepLoops;
|
||||
}
|
||||
|
||||
inline G4double G4SteppingManager::GetcurrentMinimumStep(){
|
||||
return currentMinimumStep;
|
||||
}
|
||||
inline G4double G4SteppingManager::GetnumberOfInteractionLengthLeft(){
|
||||
return numberOfInteractionLengthLeft;
|
||||
}
|
||||
|
||||
inline size_t G4SteppingManager::GetfAtRestDoItProcTriggered(){
|
||||
return fAtRestDoItProcTriggered;
|
||||
}
|
||||
inline size_t G4SteppingManager::GetfAlongStepDoItProcTriggered(){
|
||||
return fAtRestDoItProcTriggered;
|
||||
}
|
||||
inline size_t G4SteppingManager::GetfPostStepDoItProcTriggered(){
|
||||
return fPostStepDoItProcTriggered;
|
||||
}
|
||||
inline G4int G4SteppingManager::GetfN2ndariesAtRestDoIt(){
|
||||
return fN2ndariesAtRestDoIt;
|
||||
}
|
||||
inline G4int G4SteppingManager::GetfN2ndariesAlongStepDoIt(){
|
||||
return fN2ndariesAlongStepDoIt;
|
||||
}
|
||||
inline G4int G4SteppingManager::GetfN2ndariesPostStepDoIt(){
|
||||
return fN2ndariesPostStepDoIt;
|
||||
}
|
||||
|
||||
inline G4Navigator* G4SteppingManager::GetfNavigator(){
|
||||
return fNavigator;
|
||||
}
|
||||
inline G4int G4SteppingManager::GetverboseLevel(){
|
||||
return verboseLevel;
|
||||
}
|
||||
|
||||
inline G4SelectedAtRestDoItVector* G4SteppingManager::GetfSelectedAtRestDoItVector(){
|
||||
return fSelectedAtRestDoItVector;
|
||||
}
|
||||
|
||||
inline G4SelectedAlongStepDoItVector* G4SteppingManager::GetfSelectedAlongStepDoItVector(){
|
||||
return fSelectedAlongStepDoItVector;
|
||||
}
|
||||
|
||||
inline G4SelectedPostStepDoItVector* G4SteppingManager::GetfSelectedPostStepDoItVector(){
|
||||
return fSelectedPostStepDoItVector;
|
||||
}
|
||||
|
||||
inline G4double G4SteppingManager::GetfPreviousStepSize(){
|
||||
return fPreviousStepSize;
|
||||
}
|
||||
|
||||
inline G4VTouchable* G4SteppingManager::GetfTouchable1(){
|
||||
return fTouchable1;
|
||||
}
|
||||
inline G4VTouchable* G4SteppingManager::GetfTouchable2(){
|
||||
return fTouchable2;
|
||||
}
|
||||
inline G4bool G4SteppingManager::GetfIsTouchable1Free(){
|
||||
return fIsTouchable1Free;
|
||||
}
|
||||
inline G4bool G4SteppingManager::GetfIsTouchable2Free(){
|
||||
return fIsTouchable2Free;
|
||||
}
|
||||
|
||||
inline G4SteppingControl G4SteppingManager::GetStepControlFlag(){
|
||||
return StepControlFlag;
|
||||
}
|
||||
inline G4double G4SteppingManager::GetphysIntLength(){
|
||||
return physIntLength;
|
||||
}
|
||||
inline G4ForceCondition G4SteppingManager::GetfCondition(){
|
||||
return fCondition;
|
||||
}
|
||||
inline G4GPILSelection G4SteppingManager::GetfGPILSelection(){
|
||||
return fGPILSelection;
|
||||
}
|
||||
|
||||
|
||||
inline G4TrackVector* G4SteppingManager::GetSecondary() const {
|
||||
return fSecondary;
|
||||
}
|
||||
|
||||
inline void G4SteppingManager::SetNavigator(G4Navigator* value){
|
||||
fNavigator = value;
|
||||
}
|
||||
|
||||
inline void G4SteppingManager::SetUserAction(G4UserSteppingAction* apAction){
|
||||
if (fUserSteppingAction) delete fUserSteppingAction;
|
||||
fUserSteppingAction = apAction;
|
||||
}
|
||||
inline G4UserSteppingAction* G4SteppingManager::GetUserAction(){
|
||||
return fUserSteppingAction;
|
||||
}
|
||||
|
||||
inline G4Track* G4SteppingManager::GetTrack() const {
|
||||
return fTrack;
|
||||
}
|
||||
|
||||
inline void G4SteppingManager::SetVerboseLevel(G4int vLevel){
|
||||
verboseLevel = vLevel;
|
||||
}
|
||||
|
||||
inline G4Step* G4SteppingManager::GetStep() const {
|
||||
return fStep;
|
||||
}
|
||||
|
||||
inline G4double G4SteppingManager::CalculateSafety(){
|
||||
return max( endpointSafety -
|
||||
(endpointSafOrigin - fPostStepPoint->GetPosition()).mag(),
|
||||
0.);
|
||||
}
|
||||
|
||||
inline G4VTouchable* G4SteppingManager::GetFreeTouchable(){
|
||||
if(fIsTouchable1Free){
|
||||
fIsTouchable1Free = false;
|
||||
return fTouchable1;
|
||||
}
|
||||
else if(fIsTouchable2Free){
|
||||
fIsTouchable2Free = false;
|
||||
return fTouchable2;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
inline void G4SteppingManager::SetAnotherTouchableFree(G4VTouchable* value){
|
||||
if(value == fTouchable1){
|
||||
fIsTouchable2Free = true;
|
||||
}
|
||||
else if(value == fTouchable2){
|
||||
fIsTouchable1Free = true;
|
||||
}
|
||||
}
|
||||
|
||||
#include "G4SteppingManager.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,549 @@
|
||||
// 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: G4SteppingManager.icc,v 2.5 1998/11/18 17:46:43 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4SteppingManager.icc
|
||||
//
|
||||
// Description:
|
||||
// This class represents the manager who steers to move the give
|
||||
// particle from the TrackingManger by one Step.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ForceCondition.hh"
|
||||
#include "G4GPILSelection.hh"
|
||||
#include "G4SteppingControl.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4UserLimits.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
inline void G4SteppingManager::GetProcessNumber()
|
||||
/////////////////////////////////////////////////
|
||||
{
|
||||
|
||||
G4ProcessManager* pm= fTrack->GetDefinition()->GetProcessManager();
|
||||
|
||||
// AtRestDoits
|
||||
MAXofAtRestLoops = pm->GetAtRestProcessVector()->entries();
|
||||
fAtRestDoItVector = pm->GetAtRestProcessVector(typeDoIt);
|
||||
fAtRestGetPhysIntVector = pm->GetAtRestProcessVector(typeGPIL);
|
||||
|
||||
// AlongStepDoits
|
||||
MAXofAlongStepLoops = pm->GetAlongStepProcessVector()->entries();
|
||||
fAlongStepDoItVector = pm->GetAlongStepProcessVector(typeDoIt);
|
||||
fAlongStepGetPhysIntVector = pm->GetAlongStepProcessVector(typeGPIL);
|
||||
|
||||
// PostStepDoits
|
||||
MAXofPostStepLoops = pm->GetPostStepProcessVector()->entries();
|
||||
fPostStepDoItVector = pm->GetPostStepProcessVector(typeDoIt);
|
||||
fPostStepGetPhysIntVector = pm->GetPostStepProcessVector(typeGPIL);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************
|
||||
//
|
||||
// Private Member Functions
|
||||
//
|
||||
// ************************************************************************
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
inline void G4SteppingManager::DefinePhysicalStepLength()
|
||||
/////////////////////////////////////////////////////////
|
||||
{
|
||||
|
||||
// ReSet the counter etc.
|
||||
PhysicalStep = DBL_MAX; // Initialize by a huge number
|
||||
physIntLength = DBL_MAX; // Initialize by a huge number
|
||||
#ifdef G4VERBOSE
|
||||
// !!!!! Verbose
|
||||
if(verboseLevel>0) fVerbose->DPSLStarted();
|
||||
#endif
|
||||
|
||||
// Obtain the user defined maximum allowed Step in the volume
|
||||
// 1997.12.13 adds argument for GetMaxAllowedStep by K.Kurashige
|
||||
G4UserLimits* ul= fCurrentVolume->GetLogicalVolume()->GetUserLimits();
|
||||
if (ul) {
|
||||
physIntLength = ul->GetMaxAllowedStep(*fTrack);
|
||||
#ifdef G4VERBOSE
|
||||
// !!!!! Verbose
|
||||
if(verboseLevel>0) fVerbose->DPSLUserLimit();
|
||||
#endif
|
||||
}
|
||||
|
||||
if(physIntLength < PhysicalStep ){
|
||||
PhysicalStep = physIntLength;
|
||||
fStepStatus = fUserDefinedLimit;
|
||||
fStep->GetPostStepPoint()
|
||||
->SetProcessDefinedStep(NULL);
|
||||
// Take note that the process pointer is 'NULL' if the Step
|
||||
// is defined by the user defined limit.
|
||||
}
|
||||
|
||||
// GetPhysicalInteractionLength for PostStep
|
||||
fPostStepDoItProcTriggered = MAXofPostStepLoops;
|
||||
|
||||
for(size_t np=0; np < MAXofPostStepLoops; np++){
|
||||
fCurrentProcess = (*fPostStepGetPhysIntVector)(np);
|
||||
if (fCurrentProcess== NULL) {
|
||||
(*fSelectedPostStepDoItVector)(np) = 0;
|
||||
continue;
|
||||
} // NULL means the process is inactivated by a user on fly.
|
||||
|
||||
physIntLength = fCurrentProcess->
|
||||
PostStepGetPhysicalInteractionLength( *fTrack,
|
||||
fPreviousStepSize,
|
||||
&fCondition );
|
||||
#ifdef G4VERBOSE
|
||||
// !!!!! Verbose
|
||||
if(verboseLevel>0) fVerbose->DPSLPostStep();
|
||||
#endif
|
||||
|
||||
switch (fCondition) {
|
||||
case ExclusivelyForced:
|
||||
(*fSelectedPostStepDoItVector)(np) = 4;
|
||||
fStepStatus = fExclusivelyForcedProc;
|
||||
fStep->GetPostStepPoint()
|
||||
->SetProcessDefinedStep(fCurrentProcess);
|
||||
break;
|
||||
case Conditionally:
|
||||
(*fSelectedPostStepDoItVector)(np) = 3;
|
||||
break;
|
||||
case Forced:
|
||||
(*fSelectedPostStepDoItVector)(np) = 2;
|
||||
break;
|
||||
default:
|
||||
(*fSelectedPostStepDoItVector)(np) = 0;
|
||||
if(physIntLength < PhysicalStep ){
|
||||
PhysicalStep = physIntLength;
|
||||
fStepStatus = fPostStepDoItProc;
|
||||
fPostStepDoItProcTriggered = G4int(np);
|
||||
fStep->GetPostStepPoint()
|
||||
->SetProcessDefinedStep(fCurrentProcess);
|
||||
}
|
||||
}
|
||||
if (fCondition==ExclusivelyForced) return; // Take note the 'return' at here !!!
|
||||
}
|
||||
|
||||
if(fPostStepDoItProcTriggered<MAXofPostStepLoops)
|
||||
(*fSelectedPostStepDoItVector)(fPostStepDoItProcTriggered) = 1;
|
||||
|
||||
|
||||
// GetPhysicalInteractionLength for AlongStep
|
||||
proposedSafety = DBL_MAX;
|
||||
G4double safetyProposedToAndByProcess = proposedSafety;
|
||||
|
||||
for(size_t kp=0; kp < MAXofAlongStepLoops; kp++){
|
||||
fCurrentProcess = (*fAlongStepGetPhysIntVector)(kp);
|
||||
if (fCurrentProcess== NULL) continue;
|
||||
// NULL means the process is inactivated by a user on fly.
|
||||
|
||||
physIntLength = fCurrentProcess->
|
||||
AlongStepGetPhysicalInteractionLength( *fTrack,
|
||||
fPreviousStepSize,
|
||||
PhysicalStep,
|
||||
safetyProposedToAndByProcess,
|
||||
&fGPILSelection );
|
||||
#ifdef G4VERBOSE
|
||||
// !!!!! Verbose
|
||||
if(verboseLevel>0) fVerbose->DPSLAlongStep();
|
||||
#endif
|
||||
if(physIntLength < PhysicalStep){
|
||||
PhysicalStep = physIntLength;
|
||||
|
||||
// Check if the process wants to be the GPIL winner. For example,
|
||||
// multi-scattering proposes Step limit, but won't be the winner.
|
||||
if(fGPILSelection==CandidateForSelection){
|
||||
fStepStatus = fAlongStepDoItProc;
|
||||
fStep->GetPostStepPoint()
|
||||
->SetProcessDefinedStep(fCurrentProcess);
|
||||
}
|
||||
|
||||
// Transportation is assumed to be the last process in the vector
|
||||
if(kp == MAXofAlongStepLoops-1) fStepStatus = fGeomBoundary;
|
||||
}
|
||||
|
||||
// Make sure to check the safety, even if Step is not limited
|
||||
// by this process. J. Apostolakis, June 20, 1998
|
||||
//
|
||||
if (safetyProposedToAndByProcess < proposedSafety)
|
||||
// proposedSafety keeps the smallest value:
|
||||
proposedSafety = safetyProposedToAndByProcess;
|
||||
else
|
||||
// safetyProposedToAndByProcess always proposes a valid safety:
|
||||
safetyProposedToAndByProcess = proposedSafety;
|
||||
|
||||
}
|
||||
} // void G4SteppingManager::DefinePhysicalStepLength() //
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
inline void G4SteppingManager::InvokeAtRestDoItProcs()
|
||||
//////////////////////////////////////////////////////
|
||||
{
|
||||
|
||||
// Select the rest process which has the shortest time before
|
||||
// it is invoked. In rest processes, GetPhysicalInteractionLength()
|
||||
// returns the time before a process occurs.
|
||||
G4double lifeTime, shortestLifeTime;
|
||||
|
||||
fN2ndariesAtRestDoIt = 0;
|
||||
shortestLifeTime = DBL_MAX;
|
||||
|
||||
for( size_t ri=0 ; ri < MAXofAtRestLoops ; ri++ ){
|
||||
fCurrentProcess = (*fAtRestGetPhysIntVector)(ri);
|
||||
if (fCurrentProcess== NULL) {
|
||||
(*fSelectedAtRestDoItVector)(ri) = 0;
|
||||
continue;
|
||||
} // NULL means the process is inactivated by a user on fly.
|
||||
|
||||
lifeTime =
|
||||
fCurrentProcess->AtRestGetPhysicalInteractionLength(
|
||||
*fTrack,
|
||||
&fCondition );
|
||||
if(fCondition==Forced){
|
||||
(*fSelectedAtRestDoItVector)(ri) = 2;
|
||||
}
|
||||
else{
|
||||
(*fSelectedAtRestDoItVector)(ri) = 0;
|
||||
if(lifeTime < shortestLifeTime ){
|
||||
shortestLifeTime = lifeTime;
|
||||
fAtRestDoItProcTriggered = G4int(int(ri));
|
||||
}
|
||||
}
|
||||
}
|
||||
(*fSelectedAtRestDoItVector)(fAtRestDoItProcTriggered) = 1;
|
||||
|
||||
fStep->SetStepLength( 0. ); //the particle has stopped
|
||||
fTrack->SetStepLength( 0. );
|
||||
|
||||
// invoke selected process
|
||||
for(size_t np=0; np < MAXofAtRestLoops; np++){
|
||||
//
|
||||
// Note: DoItVector has inverse order against GetPhysIntVector
|
||||
// and SelectedAtRestDoItVector.
|
||||
//
|
||||
if((*fSelectedAtRestDoItVector)(MAXofAtRestLoops-np-1) != 0){
|
||||
|
||||
|
||||
fCurrentProcess = (*fAtRestDoItVector)(np);
|
||||
fParticleChange
|
||||
= fCurrentProcess->AtRestDoIt( *fTrack, *fStep);
|
||||
|
||||
// Set the current process as a process which defined this Step length
|
||||
fStep->GetPostStepPoint()
|
||||
->SetProcessDefinedStep(fCurrentProcess);
|
||||
|
||||
// Update Step
|
||||
fParticleChange->UpdateStepForAtRest(fStep);
|
||||
|
||||
// Now Store the secondaries from ParticleChange to SecondaryList
|
||||
G4Track* tempSecondaryTrack;
|
||||
G4bool tApplyCutFlag;
|
||||
G4double tProdThreshold;
|
||||
G4Material* tMaterial;
|
||||
G4double tBelowCutEnergyAndSafety;
|
||||
|
||||
fN2ndariesAtRestDoIt = fParticleChange->GetNumberOfSecondaries();
|
||||
|
||||
for(G4int DSecLoop=0 ; DSecLoop< fN2ndariesAtRestDoIt; DSecLoop++){
|
||||
tempSecondaryTrack = fParticleChange->GetSecondary(DSecLoop);
|
||||
tApplyCutFlag = tempSecondaryTrack->GetDefinition()
|
||||
->GetApplyCutsFlag();
|
||||
|
||||
// Check if the particle should be passed without coherent cut
|
||||
if(tApplyCutFlag){
|
||||
tBelowCutEnergyAndSafety = false;
|
||||
tMaterial = fPostStepPoint->GetMaterial();
|
||||
tProdThreshold = tempSecondaryTrack->GetDefinition()
|
||||
-> GetEnergyThreshold(tMaterial);
|
||||
|
||||
if( tempSecondaryTrack->GetKineticEnergy()<tProdThreshold ){
|
||||
G4double currentRange
|
||||
= G4EnergyLossTables::GetRange(
|
||||
tempSecondaryTrack->GetDefinition(),
|
||||
tempSecondaryTrack->GetKineticEnergy(),
|
||||
tMaterial
|
||||
);
|
||||
if (currentRange < CalculateSafety() ){
|
||||
tBelowCutEnergyAndSafety = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( tBelowCutEnergyAndSafety ){
|
||||
if( !(tempSecondaryTrack->IsGoodForTracking()) ){
|
||||
|
||||
//// G4cout << "!! Warning - G4SteppingManager:" << endl;
|
||||
//// << " This physics process generated a secondary"
|
||||
//// << " of which energy is below cut but"
|
||||
//// << " GoodForTracking is off !!!!!" << endl;
|
||||
|
||||
// Add kinetic energy to the total energy deposit
|
||||
fStep->AddTotalEnergyDeposit(
|
||||
tempSecondaryTrack->GetKineticEnergy() );
|
||||
tempSecondaryTrack->SetKineticEnergy(0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If this 2ndry particle has 'zero' kinetic energy, make sure
|
||||
// it invokes a rest process at the beginning of the tracking
|
||||
if(tempSecondaryTrack->GetKineticEnergy() <= 0.){
|
||||
tempSecondaryTrack->SetTrackStatus( fStopButAlive );
|
||||
}
|
||||
|
||||
// Set parentID
|
||||
tempSecondaryTrack->SetParentID( fTrack->GetTrackID() );
|
||||
|
||||
// Set the process pointer which created this track
|
||||
tempSecondaryTrack->SetCreatorProcess( fCurrentProcess );
|
||||
|
||||
fSecondary->insert( tempSecondaryTrack );
|
||||
}
|
||||
|
||||
// clear ParticleChange
|
||||
fParticleChange->Clear();
|
||||
|
||||
} //if(fSelectedAtRestDoItVector(np) != 0){
|
||||
} //for(size_t np=0; np < MAXofAtRestLoops; np++){
|
||||
|
||||
fStep->UpdateTrack();
|
||||
|
||||
fTrack->SetTrackStatus( fStopAndKill );
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
inline void G4SteppingManager::InvokeAlongStepDoItProcs()
|
||||
/////////////////////////////////////////////////////////
|
||||
{
|
||||
|
||||
// If the current Step is defined by a 'ExclusivelyForced'
|
||||
// PostStepDoIt, then don't invoke any AlongStepDoIt
|
||||
if(fStepStatus == fExclusivelyForcedProc){
|
||||
return; // Take note 'return' at here !!!
|
||||
}
|
||||
|
||||
// Invoke the all active continuous processes
|
||||
fN2ndariesAlongStepDoIt = 0;
|
||||
|
||||
for( size_t ci=0 ; ci<MAXofAlongStepLoops ; ci++ ){
|
||||
fCurrentProcess = (*fAlongStepDoItVector)(ci);
|
||||
if (fCurrentProcess== NULL) continue;
|
||||
// NULL means the process is inactivated by a user on fly.
|
||||
|
||||
fParticleChange
|
||||
= fCurrentProcess->AlongStepDoIt( *fTrack, *fStep );
|
||||
|
||||
// Update the PostStepPoint of Step according to ParticleChange
|
||||
fParticleChange->UpdateStepForAlongStep(fStep);
|
||||
#ifdef G4VERBOSE
|
||||
// !!!!! Verbose
|
||||
if(verboseLevel>0) fVerbose->AlongStepDoItOneByOne();
|
||||
#endif
|
||||
|
||||
// Now Store the secondaries from ParticleChange to SecondaryList
|
||||
G4Track* tempSecondaryTrack;
|
||||
G4bool tApplyCutFlag;
|
||||
G4double tProdThreshold;
|
||||
G4Material* tMaterial;
|
||||
G4double tBelowCutEnergyAndSafety;
|
||||
|
||||
fN2ndariesAlongStepDoIt = fParticleChange->GetNumberOfSecondaries();
|
||||
|
||||
for(G4int DSecLoop=0 ; DSecLoop< fN2ndariesAlongStepDoIt; DSecLoop++){
|
||||
tempSecondaryTrack = fParticleChange->GetSecondary(DSecLoop);
|
||||
tApplyCutFlag = tempSecondaryTrack->GetDefinition()
|
||||
->GetApplyCutsFlag();
|
||||
|
||||
// Check if the particle should be passed without coherent cut
|
||||
if(tApplyCutFlag){
|
||||
tBelowCutEnergyAndSafety = false;
|
||||
tMaterial = fPostStepPoint->GetMaterial();
|
||||
tProdThreshold = tempSecondaryTrack->GetDefinition()
|
||||
-> GetEnergyThreshold(tMaterial);
|
||||
|
||||
if( tempSecondaryTrack->GetKineticEnergy()<tProdThreshold ){
|
||||
G4double currentRange
|
||||
= G4EnergyLossTables::GetRange(
|
||||
tempSecondaryTrack->GetDefinition(),
|
||||
tempSecondaryTrack->GetKineticEnergy(),
|
||||
tMaterial
|
||||
);
|
||||
if (currentRange < CalculateSafety() ){
|
||||
tBelowCutEnergyAndSafety = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( tBelowCutEnergyAndSafety ){
|
||||
if( !(tempSecondaryTrack->IsGoodForTracking()) ){
|
||||
|
||||
//// G4cout << "!! Warning - G4SteppingManager:" << endl;
|
||||
//// << " This physics process generated a secondary"
|
||||
//// << " of which energy is below cut but"
|
||||
//// << " GoodForTracking is off !!!!!" << endl;
|
||||
|
||||
// Add kinetic energy to the total energy deposit
|
||||
fStep->AddTotalEnergyDeposit(
|
||||
tempSecondaryTrack->GetKineticEnergy() );
|
||||
tempSecondaryTrack->SetKineticEnergy(0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If this 2ndry particle has 'zero' kinetic energy, make sure
|
||||
// it invokes a rest process at the beginning of the tracking
|
||||
if(tempSecondaryTrack->GetKineticEnergy() <= 0.){
|
||||
tempSecondaryTrack->SetTrackStatus( fStopButAlive );
|
||||
}
|
||||
|
||||
// Set parentID
|
||||
tempSecondaryTrack->SetParentID( fTrack->GetTrackID() );
|
||||
|
||||
// Set the process pointer which created this track
|
||||
tempSecondaryTrack->SetCreatorProcess( fCurrentProcess );
|
||||
|
||||
fSecondary->insert( tempSecondaryTrack );
|
||||
}
|
||||
|
||||
// Set the track status according to what the process defined
|
||||
fTrack->SetTrackStatus( fParticleChange->GetStatusChange() );
|
||||
|
||||
// clear ParticleChange
|
||||
fParticleChange->Clear();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
inline void G4SteppingManager::InvokePostStepDoItProcs()
|
||||
////////////////////////////////////////////////////////
|
||||
{
|
||||
|
||||
// Invoke the specified discrete processes
|
||||
fN2ndariesPostStepDoIt = 0;
|
||||
|
||||
for(size_t np=0; np < MAXofPostStepLoops; np++){
|
||||
//
|
||||
// Note: DoItVector has inverse order against GetPhysIntVector
|
||||
// and SelectedPostStepDoItVector.
|
||||
//
|
||||
size_t npGPIL = MAXofPostStepLoops-np-1;
|
||||
|
||||
G4int tmp= (*fSelectedPostStepDoItVector)(npGPIL);
|
||||
if(tmp != 0){
|
||||
|
||||
if ( ((tmp == 1) && (fStepStatus == fPostStepDoItProc)) ||
|
||||
((tmp == 2) && (fStepStatus != fExclusivelyForcedProc)) ||
|
||||
((tmp == 3) && (fStepStatus == fAlongStepDoItProc)) ||
|
||||
((tmp == 4) && (fStepStatus == fExclusivelyForcedProc)) ) {
|
||||
|
||||
fCurrentProcess = (*fPostStepDoItVector)(np);
|
||||
fParticleChange
|
||||
= fCurrentProcess->PostStepDoIt( *fTrack, *fStep);
|
||||
|
||||
// Update PostStepPoint of Step according to ParticleChange
|
||||
fParticleChange->UpdateStepForPostStep(fStep);
|
||||
#ifdef G4VERBOSE
|
||||
// !!!!! Verbose
|
||||
if(verboseLevel>0) fVerbose->PostStepDoItOneByOne();
|
||||
#endif
|
||||
// Update G4Track according to ParticleChange after each PostStepDoIt
|
||||
fStep->UpdateTrack();
|
||||
|
||||
// Update safety after each invocation of PostStepDoIts
|
||||
fStep->GetPostStepPoint()->SetSafety( CalculateSafety() );
|
||||
|
||||
// Now Store the secondaries from ParticleChange to SecondaryList
|
||||
G4Track* tempSecondaryTrack;
|
||||
G4bool tApplyCutFlag;
|
||||
G4double tProdThreshold;
|
||||
G4Material* tMaterial;
|
||||
G4double tBelowCutEnergyAndSafety;
|
||||
|
||||
fN2ndariesPostStepDoIt = fParticleChange->GetNumberOfSecondaries();
|
||||
|
||||
for(G4int DSecLoop=0 ; DSecLoop< fN2ndariesPostStepDoIt; DSecLoop++){
|
||||
tempSecondaryTrack = fParticleChange->GetSecondary(DSecLoop);
|
||||
tApplyCutFlag = tempSecondaryTrack->GetDefinition()
|
||||
->GetApplyCutsFlag();
|
||||
|
||||
// Check if the particle should be passed without coherent cut
|
||||
if(tApplyCutFlag){
|
||||
tBelowCutEnergyAndSafety = false;
|
||||
tMaterial = fPostStepPoint->GetMaterial();
|
||||
tProdThreshold = tempSecondaryTrack->GetDefinition()
|
||||
-> GetEnergyThreshold(tMaterial);
|
||||
|
||||
if( tempSecondaryTrack->GetKineticEnergy()<tProdThreshold ){
|
||||
G4double currentRange
|
||||
= G4EnergyLossTables::GetRange(
|
||||
tempSecondaryTrack->GetDefinition(),
|
||||
tempSecondaryTrack->GetKineticEnergy(),
|
||||
tMaterial
|
||||
);
|
||||
if (currentRange < CalculateSafety() ){
|
||||
tBelowCutEnergyAndSafety = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( tBelowCutEnergyAndSafety ){
|
||||
if( !(tempSecondaryTrack->IsGoodForTracking()) ){
|
||||
|
||||
//// G4cout << "!! Warning - G4SteppingManager:" << endl;
|
||||
//// << " This physics process generated a secondary"
|
||||
//// << " of which energy is below cut but"
|
||||
//// << " GoodForTracking is off !!!!!" << endl;
|
||||
|
||||
// Add kinetic energy to the total energy deposit
|
||||
fStep->AddTotalEnergyDeposit(
|
||||
tempSecondaryTrack->GetKineticEnergy() );
|
||||
tempSecondaryTrack->SetKineticEnergy(0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If this 2ndry particle has 'zero' kinetic energy, make sure
|
||||
// it invokes a rest process at the beginning of the tracking
|
||||
if(tempSecondaryTrack->GetKineticEnergy() <= 0.){
|
||||
tempSecondaryTrack->SetTrackStatus( fStopButAlive );
|
||||
}
|
||||
|
||||
// Set parentID
|
||||
tempSecondaryTrack->SetParentID( fTrack->GetTrackID() );
|
||||
|
||||
// Set the process pointer which created this track
|
||||
tempSecondaryTrack->SetCreatorProcess( fCurrentProcess );
|
||||
|
||||
fSecondary->insert( tempSecondaryTrack );
|
||||
}
|
||||
|
||||
// Set the track status according to what the process defined
|
||||
fTrack->SetTrackStatus( fParticleChange->GetStatusChange() );
|
||||
|
||||
// clear ParticleChange
|
||||
fParticleChange->Clear();
|
||||
}
|
||||
} //if(*fSelectedPostStepDoItVector(np) != 0){
|
||||
|
||||
// Exit from PostStepLoop if the track has been killed
|
||||
if(fTrack->GetTrackStatus() == fStopAndKill) break;
|
||||
|
||||
} //for(size_t np=0; np < MAXofPostStepLoops; np++){
|
||||
}
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
// 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: G4SteppingVerbose.hh,v 2.2 1998/08/26 02:36:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4SteppingVerbose.hh
|
||||
//
|
||||
// Description:
|
||||
// This class manages the vervose outputs in G4SteppingManager.
|
||||
//
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
class G4SteppingVerbose;
|
||||
|
||||
#ifndef G4SteppingVerose_h
|
||||
#define G4SteppingVerose_h 1
|
||||
#include <rw/tvordvec.h> // Include from 'RogueWave'
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip.h>
|
||||
|
||||
#include "globals.hh" // Include from 'global'
|
||||
#include "G4Navigator.hh" // Include from 'geometry'
|
||||
#include "G4LogicalVolume.hh" // Include from 'geometry'
|
||||
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
|
||||
#include "G4VSensitiveDetector.hh" // Include from 'hits/digi'
|
||||
#include "G4ProcessManager.hh" // Include from 'piim'
|
||||
class G4SteppingManager; // Include from 'tracking'
|
||||
#include "G4Track.hh" // Include from 'tracking'
|
||||
#include "G4TrackVector.hh" // Include from 'tracking'
|
||||
#include "G4TrackStatus.hh" // Include from 'tracking'
|
||||
#include "G4StepStatus.hh" // Include from 'tracking'
|
||||
#include "G4UserSteppingAction.hh" // Include from 'tracking'
|
||||
#include "G4Step.hh" // Include from 'tracking'
|
||||
#include "G4StepPoint.hh" // Include from 'tracking'
|
||||
#include "G4VTouchable.hh" // Include from 'geometry'
|
||||
#include "G4TouchableHistory.hh" // Include from 'geometry'
|
||||
|
||||
|
||||
class G4SteppingVerbose{
|
||||
public:
|
||||
// Constructor/Destructor
|
||||
G4SteppingVerbose();
|
||||
G4SteppingVerbose(G4SteppingManager*);
|
||||
~G4SteppingVerbose();
|
||||
//
|
||||
void NewStep();
|
||||
void CopyState();
|
||||
void AtRestDoItInvoked();
|
||||
void AlongStepDoItAllDone();
|
||||
void PostStepDoItAllDone();
|
||||
void AlongStepDoItOneByOne();
|
||||
void PostStepDoItOneByOne();
|
||||
void StepInfo();
|
||||
void TrackingStarted();
|
||||
void DPSLStarted();
|
||||
void DPSLUserLimit();
|
||||
void DPSLPostStep();
|
||||
void DPSLAlongStep();
|
||||
void DPSLAlongStepDoItOneByOne();
|
||||
void DPSLPostStepDoItOneByOne();
|
||||
void VerboseTrack();
|
||||
void VerboseParticleChange();
|
||||
|
||||
//
|
||||
// Member data
|
||||
private:
|
||||
G4SteppingManager* fManager;
|
||||
|
||||
G4UserSteppingAction* fUserSteppingAction;
|
||||
|
||||
G4SteppingVerbose* fVerbose;
|
||||
|
||||
G4double PhysicalStep;
|
||||
G4double GeometricalStep;
|
||||
G4double CorrectedStep;
|
||||
G4bool PreStepPointIsGeom;
|
||||
G4bool FirstStep;
|
||||
G4StepStatus fStepStatus;
|
||||
|
||||
G4double TempInitVelocity;
|
||||
G4double TempVelocity;
|
||||
G4double Mass;
|
||||
|
||||
G4double sumEnergyChange;
|
||||
|
||||
G4VParticleChange* fParticleChange;
|
||||
G4Track* fTrack;
|
||||
G4TrackVector* fSecondary;
|
||||
G4Step* fStep;
|
||||
G4StepPoint* fPreStepPoint;
|
||||
G4StepPoint* fPostStepPoint;
|
||||
|
||||
G4VPhysicalVolume* fCurrentVolume;
|
||||
G4VSensitiveDetector* fSensitive;
|
||||
G4VProcess* fCurrentProcess;
|
||||
// The pointer to the process of which DoIt or
|
||||
// GetPhysicalInteractionLength has been just executed.
|
||||
|
||||
|
||||
G4ProcessVector* fAtRestDoItVector;
|
||||
G4ProcessVector* fAlongStepDoItVector;
|
||||
G4ProcessVector* fPostStepDoItVector;
|
||||
|
||||
G4ProcessVector* fAtRestGetPhysIntVector;
|
||||
G4ProcessVector* fAlongStepGetPhysIntVector;
|
||||
G4ProcessVector* fPostStepGetPhysIntVector;
|
||||
|
||||
size_t MAXofAtRestLoops;
|
||||
size_t MAXofAlongStepLoops;
|
||||
size_t MAXofPostStepLoops;
|
||||
|
||||
G4double currentMinimumStep;
|
||||
G4double numberOfInteractionLengthLeft;
|
||||
|
||||
size_t fAtRestDoItProcTriggered;
|
||||
size_t fAlongStepDoItProcTriggered;
|
||||
size_t fPostStepDoItProcTriggered;
|
||||
|
||||
G4int fN2ndariesAtRestDoIt;
|
||||
G4int fN2ndariesAlongStepDoIt;
|
||||
G4int fN2ndariesPostStepDoIt;
|
||||
// These are the numbers of secondaries generated by the process
|
||||
// just executed.
|
||||
|
||||
G4Navigator *fNavigator;
|
||||
|
||||
G4int verboseLevel;
|
||||
|
||||
typedef RWTValOrderedVector<G4int>
|
||||
G4SelectedAtRestDoItVector;
|
||||
typedef RWTValOrderedVector<G4int>
|
||||
G4SelectedAlongStepDoItVector;
|
||||
typedef RWTValOrderedVector<G4int>
|
||||
G4SelectedPostStepDoItVector;
|
||||
G4SelectedAtRestDoItVector *fSelectedAtRestDoItVector;
|
||||
G4SelectedAlongStepDoItVector *fSelectedAlongStepDoItVector;
|
||||
G4SelectedPostStepDoItVector *fSelectedPostStepDoItVector;
|
||||
|
||||
G4double fPreviousStepSize;
|
||||
|
||||
G4VTouchable* fTouchable1;
|
||||
G4VTouchable* fTouchable2;
|
||||
G4bool fIsTouchable1Free;
|
||||
G4bool fIsTouchable2Free;
|
||||
|
||||
G4SteppingControl StepControlFlag;
|
||||
|
||||
G4double physIntLength;
|
||||
G4ForceCondition fCondition;
|
||||
G4GPILSelection fGPILSelection;
|
||||
// Above three variables are for the method
|
||||
// DefinePhysicalStepLength(). To pass these information to
|
||||
// the method Verbose, they are kept at here. Need a more
|
||||
// elegant mechanism.
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
// 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: G4TrackVector.hh,v 2.2 1998/08/26 01:55:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4TrackVector.hh
|
||||
//
|
||||
// Description:
|
||||
// This class keeps a List of G4Track objects. It is implemented
|
||||
// as a RougeWave pointer ordered vector.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4TrackVector_h
|
||||
#define G4TrackVector_h 1
|
||||
|
||||
#include <rw/tpordvec.h> // Include from 'RogueWave'
|
||||
#include "G4Track.hh" // Include form 'tracking'
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
typedef RWTPtrOrderedVector<G4Track> G4TrackVector;
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
#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: G4TrackingManager.hh,v 2.1 1998/07/12 03:09:00 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4TrackingManager.hh
|
||||
//
|
||||
// Description:
|
||||
// This class represents the manager who steers the tracking
|
||||
// of a particle given from the event manager.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
class G4TrackingManager;
|
||||
|
||||
#ifndef G4TrackingManager_h
|
||||
#define G4TrackingManager_h 1
|
||||
|
||||
#include "globals.hh" // Include from 'global'
|
||||
/////#include "G4Hit.hh" // Include from 'Hit/dig'
|
||||
#include "G4SteppingManager.hh" // Include from 'tracking'
|
||||
#include "G4Track.hh" // Include from 'tracking'
|
||||
#include "G4TrackVector.hh" // Include from 'tracking'
|
||||
#include "G4TrackStatus.hh" // Include from 'tracking'
|
||||
#include "G4StepStatus.hh" // Include from 'tracking'
|
||||
#include "G4UserTrackingAction.hh" // Include from 'tracking'
|
||||
#include "G4UserSteppingAction.hh" // Include from 'tracking'
|
||||
#include "G4Trajectory.hh" // Include from 'tracking'
|
||||
|
||||
|
||||
////////////////////////
|
||||
class G4TrackingManager
|
||||
////////////////////////
|
||||
{
|
||||
|
||||
//--------
|
||||
public:
|
||||
//--------
|
||||
|
||||
// Constructor/Destructor
|
||||
|
||||
G4TrackingManager();
|
||||
// TrackingManger should be dynamic persistent, therefore you
|
||||
// need to invoke new() when you call this constructor.
|
||||
// "G4SteppingManger' and "G4UserTrackingAction" will be
|
||||
// constructed in this constructor. "This" pointer will be
|
||||
// passed to "G4UserTrackingAction".
|
||||
|
||||
~G4TrackingManager();
|
||||
|
||||
// Get/Set functions
|
||||
|
||||
G4Track* GetTrack() const;
|
||||
|
||||
G4bool GetStoreTrajectory() const;
|
||||
void SetStoreTrajectory(G4bool value);
|
||||
|
||||
G4SteppingManager* GetSteppingManager() const;
|
||||
|
||||
G4UserTrackingAction* GetUserTrackingAction() const;
|
||||
|
||||
G4Trajectory* GimmeTrajectory() const;
|
||||
|
||||
G4TrackVector* GimmeSecondaries() const;
|
||||
|
||||
void SetNavigator(G4Navigator* apValue);
|
||||
|
||||
void SetUserAction(G4UserTrackingAction* apAction);
|
||||
void SetUserAction(G4UserSteppingAction* apAction);
|
||||
|
||||
void SetVerboseLevel(G4int vLevel);
|
||||
G4int GetVerboseLevel() const;
|
||||
|
||||
// Other member functions
|
||||
|
||||
void ProcessOneTrack(G4Track* apValueG4Track);
|
||||
// Invoking this function, a G4Track given by the argument
|
||||
// will be tracked.
|
||||
|
||||
void EventAborted();
|
||||
// Invoking this function, the current tracking will be
|
||||
// aborted immediately. The tracking will return the
|
||||
// G4TrackStatus in 'fUserKillTrackAndSecondaries'.
|
||||
// By this the EventManager deletes the current track and all
|
||||
// its accoicated csecondaries.
|
||||
|
||||
//---------
|
||||
private:
|
||||
//---------
|
||||
|
||||
// Member functions
|
||||
|
||||
void Verbose(G4String select);
|
||||
// Output messages according to the current value of the
|
||||
// Verbose level.
|
||||
|
||||
// Member data
|
||||
|
||||
G4Track* fpTrack;
|
||||
G4SteppingManager* fpSteppingManager;
|
||||
G4UserTrackingAction* fpUserTrackingAction;
|
||||
G4Trajectory* fpTrajectory;
|
||||
G4bool StoreTrajectory;
|
||||
G4int verboseLevel;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
//
|
||||
// Inline function
|
||||
//
|
||||
//*******************************************************************
|
||||
|
||||
inline G4Track* G4TrackingManager::GetTrack() const {
|
||||
return fpTrack;
|
||||
}
|
||||
|
||||
inline G4bool G4TrackingManager::GetStoreTrajectory() const {
|
||||
return StoreTrajectory;
|
||||
}
|
||||
|
||||
inline void G4TrackingManager::SetStoreTrajectory(G4bool value){
|
||||
StoreTrajectory = value;
|
||||
}
|
||||
|
||||
inline G4SteppingManager* G4TrackingManager::GetSteppingManager() const {
|
||||
return fpSteppingManager;
|
||||
}
|
||||
|
||||
inline G4UserTrackingAction* G4TrackingManager::GetUserTrackingAction() const {
|
||||
return fpUserTrackingAction;
|
||||
}
|
||||
|
||||
inline G4Trajectory* G4TrackingManager::GimmeTrajectory() const {
|
||||
return fpTrajectory ;
|
||||
}
|
||||
|
||||
inline G4TrackVector* G4TrackingManager::GimmeSecondaries() const {
|
||||
return fpSteppingManager->GetSecondary();
|
||||
}
|
||||
|
||||
inline void G4TrackingManager::SetUserAction(G4UserTrackingAction* apAction){
|
||||
if (fpUserTrackingAction) delete fpUserTrackingAction;
|
||||
fpUserTrackingAction = apAction;
|
||||
apAction->SetTrackingManagerPointer(this);
|
||||
}
|
||||
|
||||
inline void G4TrackingManager::SetUserAction(G4UserSteppingAction* apAction){
|
||||
fpSteppingManager->SetUserAction(apAction);
|
||||
apAction->SetSteppingManagerPointer(fpSteppingManager);
|
||||
}
|
||||
|
||||
inline void G4TrackingManager::SetVerboseLevel(G4int vLevel){
|
||||
verboseLevel = vLevel;
|
||||
fpSteppingManager -> SetVerboseLevel( vLevel );
|
||||
}
|
||||
|
||||
|
||||
inline G4int G4TrackingManager::GetVerboseLevel() const {
|
||||
return verboseLevel;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,69 @@
|
||||
// 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: G4TrackingMessenger.hh,v 2.3 1998/07/12 03:55:58 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4TrackingMessenger.hh
|
||||
//
|
||||
// Description:
|
||||
// This is a messenger class to interface to exchange information
|
||||
// between tracking/stepping and UI.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Makoto Asai (e-mail: asai@kekvax.kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4TrackingMessenger_h
|
||||
#define G4TrackingMessenger_h 1
|
||||
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithABool;
|
||||
class G4TrackingManager;
|
||||
class G4SteppingManager;
|
||||
#include "G4UImessenger.hh"
|
||||
///////////////////////////////////////////////
|
||||
class G4TrackingMessenger: public G4UImessenger
|
||||
///////////////////////////////////////////////
|
||||
{
|
||||
|
||||
//--------
|
||||
public:
|
||||
//--------
|
||||
|
||||
G4TrackingMessenger(G4TrackingManager* trMan);
|
||||
~G4TrackingMessenger();
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
G4String GetCurrentValue(G4UIcommand * command);
|
||||
|
||||
//---------
|
||||
private:
|
||||
//---------
|
||||
|
||||
G4TrackingManager* trackingManager;
|
||||
G4SteppingManager* steppingManager;
|
||||
|
||||
// commands
|
||||
G4UIdirectory * TrackingDirectory;
|
||||
G4UIcmdWithoutParameter * AbortCmd;
|
||||
G4UIcmdWithoutParameter * ResumeCmd;
|
||||
G4UIcmdWithAnInteger * StoreTrajectoryCmd;
|
||||
G4UIcmdWithAnInteger * VerboseCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
// 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: G4Trajectory.hh,v 2.2 1998/07/13 17:28:53 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4Trajectory.hh
|
||||
//
|
||||
// Description:
|
||||
// This class represents the trajectory of a particle tracked.
|
||||
// It includes information of
|
||||
// 1) List of trajectory points which compose the trajectory,
|
||||
// 2) static information of particle which generated the
|
||||
// trajectory,
|
||||
// 3) trackID and parent particle ID of the trajectory,
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Makoto Asai (e-mail: asai@kekvax.kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
class G4Trajectory;
|
||||
|
||||
#ifndef G4Trajectory_h
|
||||
#define G4Trajectory_h 1
|
||||
|
||||
#include <stdlib.h> // Include from 'system'
|
||||
#include "G4ios.hh" // Include from 'system'
|
||||
#include <rw/tvordvec.h> // RWTValOrderedVector
|
||||
#include "globals.hh" // Include from 'global'
|
||||
#include "G4ParticleDefinition.hh" // Include from 'particle+matter'
|
||||
#include "G4TrajectoryPoint.hh" // Include from 'tracking'
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
class G4Polyline; // Forward declaration.
|
||||
|
||||
///////////////////
|
||||
class G4Trajectory
|
||||
///////////////////
|
||||
{
|
||||
|
||||
//--------
|
||||
public:
|
||||
//--------
|
||||
|
||||
// Constructor/Destrcutor
|
||||
G4Trajectory(G4Track* aTrack);
|
||||
G4Trajectory(G4Trajectory &);
|
||||
~G4Trajectory();
|
||||
|
||||
// Operators
|
||||
inline int operator == (const G4Trajectory& right){return (this==&right);};
|
||||
|
||||
// Get/Set functions
|
||||
inline G4int GetTrackID() const
|
||||
{ return fTrackID; }
|
||||
inline G4int GetParentID() const
|
||||
{ return fParentID; }
|
||||
inline G4String GetParticleName() const
|
||||
{ return ParticleName; }
|
||||
inline G4double GetCharge() const
|
||||
{ return PDGCharge; }
|
||||
inline G4int GetPDGEncoding() const
|
||||
{ return PDGEncoding; }
|
||||
|
||||
// Other member functions
|
||||
void ShowTrajectory();
|
||||
// Print all information of the trajectory to stdout
|
||||
|
||||
void DrawTrajectory(G4int i_mode=0);
|
||||
|
||||
void AppendStep(G4Step* aStep);
|
||||
|
||||
G4ParticleDefinition* GetParticleDefinition();
|
||||
|
||||
//---------
|
||||
private:
|
||||
//---------
|
||||
|
||||
RWTValOrderedVector<G4TrajectoryPoint> positionRecord;
|
||||
G4int fTrackID;
|
||||
G4int fParentID;
|
||||
G4String ParticleName;
|
||||
G4double PDGCharge;
|
||||
G4int PDGEncoding;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
// 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: G4TrajectoryPoint.hh,v 2.1 1998/07/12 03:09:01 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4TrajectoryPoint.hh
|
||||
//
|
||||
// Description:
|
||||
// This class represents the trajectory of a particle tracked.
|
||||
// It includes information of
|
||||
// 1) List of trajectory points which compose the trajectory,
|
||||
// 2) static information of particle which generated the
|
||||
// trajectory,
|
||||
// 3) trackID and parent particle ID of the trajectory,
|
||||
// 4) termination condition of the trajectory.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
class G4TrajectoryPoint;
|
||||
|
||||
#ifndef G4TrajectoryPoint_h
|
||||
#define G4TrajectoryPoint_h 1
|
||||
|
||||
#include "globals.hh" // Include from 'global'
|
||||
#include "G4ThreeVector.hh" // Include from 'geometry'
|
||||
#include "G4Allocator.hh" // Include from 'particle+matter'
|
||||
|
||||
|
||||
////////////////////////
|
||||
class G4TrajectoryPoint
|
||||
////////////////////////
|
||||
{
|
||||
|
||||
//--------
|
||||
public:
|
||||
//--------
|
||||
|
||||
// Constructor/Destructor
|
||||
G4TrajectoryPoint();
|
||||
G4TrajectoryPoint(G4ThreeVector pos);
|
||||
G4TrajectoryPoint(const G4TrajectoryPoint &right);
|
||||
~G4TrajectoryPoint();
|
||||
|
||||
// Operators
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aTrajectoryPoint);
|
||||
inline int operator==(const G4TrajectoryPoint& right) const
|
||||
{ return (this==&right); };
|
||||
|
||||
// Get/Set functions
|
||||
inline const G4ThreeVector GetPosition() const
|
||||
{ return fPosition; };
|
||||
|
||||
|
||||
//---------
|
||||
private:
|
||||
//---------
|
||||
|
||||
// Member data
|
||||
G4ThreeVector fPosition;
|
||||
|
||||
};
|
||||
|
||||
|
||||
extern G4Allocator<G4TrajectoryPoint> aTrajectoryPointAllocator;
|
||||
|
||||
inline void* G4TrajectoryPoint::operator new(size_t)
|
||||
{
|
||||
void *aTrajectoryPoint;
|
||||
aTrajectoryPoint = (void *) aTrajectoryPointAllocator.MallocSingle();
|
||||
return aTrajectoryPoint;
|
||||
}
|
||||
|
||||
inline void G4TrajectoryPoint::operator delete(void *aTrajectoryPoint)
|
||||
{
|
||||
aTrajectoryPointAllocator.FreeSingle((G4TrajectoryPoint *) aTrajectoryPoint);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// 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: G4UserSteppingAction.hh,v 2.0 1998/07/02 17:29:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4UserSteppingAction.hh
|
||||
//
|
||||
// Description:
|
||||
// This class represents actions taken place by the user at each
|
||||
// end of stepping.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
class G4UserSteppingAction;
|
||||
|
||||
#ifndef G4UserSteppingAction_h
|
||||
#define G4UserSteppingAction_h 1
|
||||
|
||||
#include "globals.hh" // Include from 'global'
|
||||
#include "G4Track.hh" // Include from 'tracking'
|
||||
class G4SteppingManager; // Forward declaration
|
||||
|
||||
///////////////////////////
|
||||
class G4UserSteppingAction
|
||||
///////////////////////////
|
||||
{
|
||||
|
||||
//--------
|
||||
public:
|
||||
//--------
|
||||
|
||||
// Constructor and destructors
|
||||
G4UserSteppingAction(){}
|
||||
virtual ~G4UserSteppingAction(){}
|
||||
|
||||
// Member functions
|
||||
void SetSteppingManagerPointer(G4SteppingManager* pValue);
|
||||
virtual void UserSteppingAction(){}
|
||||
|
||||
//-----------
|
||||
protected:
|
||||
//-----------
|
||||
|
||||
// Member functions
|
||||
inline const G4SteppingManager* GetSteppingManager() {
|
||||
return fpSteppingManager;
|
||||
}
|
||||
inline G4SteppingManager* GetOmnipotentSteppingManager() {
|
||||
return fpSteppingManager;
|
||||
}
|
||||
|
||||
//---------
|
||||
private:
|
||||
//---------
|
||||
|
||||
// Member data
|
||||
G4SteppingManager* fpSteppingManager;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
// 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: G4UserTrackingAction.hh,v 2.0 1998/07/02 17:29:18 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4UserTrackingAction.hh
|
||||
//
|
||||
// Description:
|
||||
// This class represents actions taken place by the user at each
|
||||
// end of stepping.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
class G4UserTrackingAction;
|
||||
|
||||
#ifndef G4UserTrackingAction_h
|
||||
#define G4UserTrackingAction_h 1
|
||||
|
||||
class G4TrackingManager; // Forward declaration
|
||||
|
||||
///////////////////////////
|
||||
class G4UserTrackingAction
|
||||
///////////////////////////
|
||||
{
|
||||
|
||||
//--------
|
||||
public:
|
||||
//--------
|
||||
|
||||
// Constructor & Destructor
|
||||
G4UserTrackingAction(){};
|
||||
virtual ~G4UserTrackingAction(){}
|
||||
|
||||
// Member functions
|
||||
void SetTrackingManagerPointer(G4TrackingManager* pValue);
|
||||
virtual void PreUserTrackingAction(){}
|
||||
virtual void PostUserTrackingAction(){}
|
||||
|
||||
//-----------
|
||||
protected:
|
||||
//-----------
|
||||
|
||||
// Member functions
|
||||
inline const G4TrackingManager* GetTrackingManager() {
|
||||
return fpTrackingManager;
|
||||
}
|
||||
inline G4TrackingManager* GetOmnipotentTrackingManager() {
|
||||
return fpTrackingManager;
|
||||
}
|
||||
|
||||
//---------
|
||||
private:
|
||||
//---------
|
||||
|
||||
// Member data
|
||||
G4TrackingManager* fpTrackingManager;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user