Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
+9 -4
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EvtBiasMechanism.hh,v 1.2 1999/04/13 09:43:20 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4EvtBiasMechanism.hh,v 1.3 1999/11/07 16:31:57 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
@@ -16,6 +16,7 @@
// CERN, CN Division, ASD group
//
// ------------------------------------------------------------
// Class Description
// This is a simple example for Event Biasing
// This mechanism is applied to only particleToBeBiased.
// If a track currently processed is the specifed particle type,
@@ -35,12 +36,16 @@ class G4VParticleChange;
class G4EvtBiasMechanism :public G4VEvtBiasMechanism
{
public:
public: //with description
// constructors
G4EvtBiasMechanism(const G4String& name = "EBSample", G4int mulFactor=10);
G4EvtBiasMechanism(const G4EvtBiasMechanism&);
public:
virtual ~G4EvtBiasMechanism();
public: //with description
// virtual methods derived from G4VEvtBiasMechanism
virtual G4VParticleChange* ApplyMath( G4VParticleChange*, const G4Step& );
virtual G4bool IsApplicable(G4ParticleDefinition*) const;
+4 -4
View File
@@ -1,19 +1,19 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ForceCondition.hh,v 1.1 1999/01/07 16:14:20 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ForceCondition.hh,v 1.2 1999/11/07 16:31:57 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
//
// G4ForceCondition
//
// Description:
// Class Description:
// This enumaration specifies possible conditions the three
// types of DoIt can be assinged by physics processes.
//
+4 -4
View File
@@ -1,19 +1,19 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GPILSelection.hh,v 1.1 1999/01/07 16:14:20 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4GPILSelection.hh,v 1.2 1999/11/07 16:31:58 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
//
// G4GPILSelection
//
// Description:
// Class Description:
// This enumaration is used to control whether a AlongStepProcess
// can be a winner of the GPIL race or not.
//
+10 -5
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Mars5GeVMechanism.hh,v 1.2 1999/04/13 09:43:21 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4Mars5GeVMechanism.hh,v 1.3 1999/11/07 16:31:58 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
@@ -19,11 +19,12 @@
// First Implemention 17 Nov. 1998 M.Asai, H.Kurahige
//
// ------------------------------------------------------------
// Class Description
// This is a Event Biasing mechanism based on MARS code
// This model is applicable to
// proton/neutron/pi+-/K+-/gamma/anti_proton
// with energy < 5.0GeV
//
//*
// Original code is MARS13 written by Nikolai Mokhov (FNAL)
//**************************************************************
//* MARS13: 9. hA EVENT GENERATOR:
@@ -57,12 +58,15 @@ class G4ParticleDefinition;
class G4Mars5GeVMechanism :public G4VEvtBiasMechanism
{
public:
public: // with description
// constructors
G4Mars5GeVMechanism(const G4String& name = "MARS5GeV");
G4Mars5GeVMechanism(const G4Mars5GeVMechanism&);
//destructor
virtual ~G4Mars5GeVMechanism();
// virtual methods derived from G4VEvtBiasMechanism
virtual G4VParticleChange* ApplyMath( G4VParticleChange*, const G4Step& );
virtual G4bool IsApplicable(G4ParticleDefinition*) const;
@@ -100,6 +104,7 @@ class G4Mars5GeVMechanism :public G4VEvtBiasMechanism
public:
enum {FastVectorSize = 16};
typedef G4FastVector<G4DynamicParticle ,FastVectorSize> G4MarsSecondaryVector;
private:
// information of secondary
+30 -10
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChange.hh,v 1.3 1999/04/13 09:43:22 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ParticleChange.hh,v 1.5 1999/11/07 16:31:59 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
@@ -18,9 +18,10 @@
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
//
// Class Description
// This class is a concrete class for ParticleChange which
// has all functionality in old scheme.
//
//-
// This class contains the results after invocation of a physics process.
// This includes final states of parent particle (momentum, energy,
// etc) and secondary particles generated by the interaction.
@@ -28,17 +29,21 @@
// momentum are in global reference system, therefore all the
// needed Lorentz transformations must have been already Done
// when filling the data-members of this class.
//
//-
// ---------------------------------------------------------------
// IMPORTANT NOTE: Although the name of the class and methods are
// "Change", what it stores (and returns in get) are the "FINAL"
// values of the Position, Momentum, etc.
// ------------------------------------------------------------
//
// ------------------------------------------------------------
// modify AddSecondary methods for "GoodForTracking" flag
// 8 June 1998 H.Kurashige
// Add Track weight 12 Nov. 1998 H.Kurashige
// Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
// Add get/SetDynamicMass 5 Oct. 1999 H.Kurashige
// Add get/SetDynamicCharge 5 Oct. 1999 H.Kurashige
// -------------------------------------------------------------
#ifndef G4ParticleChange_h
#define G4ParticleChange_h 1
@@ -69,7 +74,7 @@ class G4ParticleChange: public G4VParticleChange
G4bool operator==(const G4ParticleChange &right) const;
G4bool operator!=(const G4ParticleChange &right) const;
public:
public: // with description
// ----------------------------------------------------
// --- the following methods are for updating G4Step -----
// Return the pointer to the G4Step after updating the Step information
@@ -93,12 +98,12 @@ class G4ParticleChange: public G4VParticleChange
virtual void Initialize(const G4Track&);
// Initialize all propoerties by using G4Track information
protected:
protected: // with description
G4Step* UpdateStepInfo(G4Step* Step);
// Update the G4Step specific attributes
// (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
public:
public: // with description
// ----------------------------------------------------
//--- methods to keep information of the final state--
@@ -135,7 +140,15 @@ class G4ParticleChange: public G4VParticleChange
G4double GetTimeChange() const;
void SetTimeChange(G4double t);
// Get/Set theTimeChange vector.
G4double GetMassChange() const;
void SetMassChange(G4double mass);
// Get/Set theMassChange
G4double GetChargeChange() const;
void SetChargeChange(G4double mass);
// Get/Set theChargeChange
G4double GetWeightChange() const;
void SetWeightChange(G4double w);
// Get/Set theWeightChange
@@ -205,7 +218,14 @@ class G4ParticleChange: public G4VParticleChange
// The changed (final) proper time of a given track
G4double theWeightChange;
// The Chnanged (final) weight of a given track
// The Changed (final) weight of a given track
G4double theMassChange;
// The Changed (final) mass of a given track
G4double theChargeChange;
// The Changed (final) charge of a given track
public:
// these methods is used for switch on/off EB in all ParticleChange objects
+30 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChange.icc,v 1.3 1999/02/18 04:11:59 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ParticleChange.icc,v 1.4.6.1 1999/12/07 20:53:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
inline
@@ -157,6 +157,30 @@ inline
theTimeChange = t;
}
inline
G4double G4ParticleChange::GetMassChange() const
{
return theMassChange;
}
inline
void G4ParticleChange::SetMassChange(G4double t)
{
theMassChange = t;
}
inline
G4double G4ParticleChange::GetChargeChange() const
{
return theChargeChange;
}
inline
void G4ParticleChange::SetChargeChange(G4double t)
{
theChargeChange = t;
}
inline
G4double G4ParticleChange::GetWeightChange() const
{
@@ -189,3 +213,6 @@ inline void G4ParticleChange::SwOffAllEB()
{
fUseEBForAll = false;
}
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForDecay.hh,v 1.3 1999/04/13 09:43:23 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ParticleChangeForDecay.hh,v 1.4 1999/11/07 16:31:59 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
@@ -18,6 +18,7 @@
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
//
// Class Description
// This class is a concrete class for ParticleChange which
// has functionality for G4Decay.
//
@@ -52,7 +53,7 @@ class G4ParticleChangeForDecay: public G4VParticleChange
G4bool operator==(const G4ParticleChangeForDecay &right) const;
G4bool operator!=(const G4ParticleChangeForDecay &right) const;
public:
public: // with description
// ----------------------------------------------------
// --- the following methods are for updating G4Step -----
// Return the pointer to the G4Step after updating the Step information
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForLoss.hh,v 1.2 1999/04/13 09:43:24 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ParticleChangeForLoss.hh,v 1.3 1999/11/07 16:32:00 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
@@ -18,6 +18,7 @@
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
//
// Class Description
// This class is a concrete class for ParticleChange for EnergyLoss
//
#ifndef G4ParticleChangeForLoss_h
@@ -48,7 +49,7 @@ class G4ParticleChangeForLoss: public G4VParticleChange
G4bool operator!=(const G4ParticleChangeForLoss &right) const;
public:
public: // with description
// ----------------------------------------------------
// --- the following methods are for updating G4Step -----
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
@@ -1,11 +1,11 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForMSC.hh,v 1.3 1999/04/13 09:43:25 kurasige Exp $
// $Id: G4ParticleChangeForMSC.hh,v 1.4 1999/11/07 16:32:00 kurasige Exp $
// GEANT4 tag $ $
//
//
@@ -15,6 +15,9 @@
// For information related to this code contact:
// CERN, CN Division, ASD group
//
// Class Description
// This class is special "Particle Change" for Multiple Scattering process
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
// Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
@@ -45,7 +48,7 @@ class G4ParticleChangeForMSC: public G4VParticleChange
G4ParticleChangeForMSC & operator=(const G4ParticleChangeForMSC &right);
public:
public: // with description
// ----------------------------------------------------
// --- the following methods are for updating G4Step -----
// Return the pointer to the G4Step after updating the Step information
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForMSC.icc,v 1.2 1999/02/06 10:44:36 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ParticleChangeForMSC.icc,v 1.2.8.1 1999/12/07 20:53:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForTransport.hh,v 1.1 1999/01/07 16:14:22 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ParticleChangeForTransport.hh,v 1.2 1999/11/07 16:32:01 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
@@ -18,6 +18,7 @@
// ------------------------------------------------------------
// Implemented for the new scheme 10 May. 1998 H.Kurahige
//
// Class Description
// This class is a concrete class for ParticleChange for transportation
//
#ifndef G4ParticleChangeForTransport_h
@@ -42,7 +43,7 @@ class G4ParticleChangeForTransport: public G4ParticleChange
G4ParticleChangeForTransport(const G4ParticleChangeForTransport &right);
G4ParticleChangeForTransport & operator=(const G4ParticleChangeForTransport &right);
public:
public: // with description
// ----------------------------------------------------
// --- the following methods are for updating G4Step -----
// Return the pointer to the G4Step after updating the Step information
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForTransport.icc,v 1.1 1999/01/07 16:14:22 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ParticleChangeForTransport.icc,v 1.1.10.1 1999/12/07 20:53:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
+31 -143
View File
@@ -1,19 +1,19 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Step.hh,v 1.3 1999/04/13 09:43:26 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4Step.hh,v 1.6 1999/11/07 16:32:01 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
//
// G4Step.hh
//
// Description:
// Class Description:
// This class represents the Step of a particle tracked.
// It includes information of
// 1) List of Step points which compose the Step,
@@ -32,6 +32,9 @@
// Correct treatment of touchable in G4Step::UpdateTrack
// 12 May. 1998 H.Kurashige
// ---------------------------------------------------------------
// Separate implementation of inline functions inti G4Step.icc
// Add updating mass/charge
// 6 Oct. 1999 H.Kurashige
//
#ifndef G4Step_h
#define G4Step_h 1
@@ -54,54 +57,62 @@ class G4Step
//--------
public:
//--------
// Constructor/Destrcutor
G4Step();
~G4Step();
//--------
public: // WIth description
// Get/Set functions
// currnet track
G4Track* GetTrack() const;
void SetTrack(G4Track* value);
// step points
G4StepPoint* GetPreStepPoint() const;
void SetPreStepPoint(G4StepPoint* value);
G4StepPoint* GetPostStepPoint() const;
void SetPostStepPoint(G4StepPoint* value);
// step length
G4double GetStepLength() const;
void SetStepLength(G4double value);
G4Track* GetTrack() const;
void SetTrack(G4Track* value);
// total energy deposit
G4double GetTotalEnergyDeposit() const;
void SetTotalEnergyDeposit(G4double value);
// cotrole flag for stepping
G4SteppingControl GetControlFlag() const;
void SetControlFlag(G4SteppingControl StepControlFlag);
// difference of position, time, momentum and energy
G4ThreeVector GetDeltaPosition() const;
G4double GetDeltaTime() const;
G4ThreeVector GetDeltaMomentum() const;
G4double GetDeltaEnergy() const;
G4double GetTotalEnergyDeposit() const;
void SetTotalEnergyDeposit(G4double value);
// manipulation of total energy deposit
void AddTotalEnergyDeposit(G4double value);
void ResetTotalEnergyDeposit();
G4SteppingControl GetControlFlag() const;
void SetControlFlag(G4SteppingControl StepControlFlag);
// Other member functions
void InitializeStep( G4Track* aValue );
// initiaize contents of G4Step
void UpdateTrack( );
// update track by using G4Step information
void CopyPostToPreStepPoint( );
//TS moved to SteppingVerbose
// void ShowStep() const ;
// Print all information of the Step to stdout
// copy PostStepPoint to PreStepPoint
G4Polyline* CreatePolyline () const;
// for visualization
//-----------
protected:
@@ -127,131 +138,8 @@ class G4Step
// A flag to control SteppingManager behavier from process
};
#include "G4Step.icc"
//-----------------------------------------------------------------
// In-line definitions
//-----------------------------------------------------------------
// Get/Set functions
inline G4StepPoint* G4Step::GetPreStepPoint() const
{ return fpPreStepPoint; }
inline void G4Step::SetPreStepPoint(G4StepPoint* value)
{ fpPreStepPoint = value; }
inline G4StepPoint* G4Step::GetPostStepPoint() const
{ return fpPostStepPoint; }
inline void G4Step::SetPostStepPoint(G4StepPoint* value)
{ fpPostStepPoint = value; }
inline G4double G4Step::GetStepLength() const
{ return fStepLength; }
inline void G4Step::SetStepLength(G4double value)
{ fStepLength = value; }
inline G4ThreeVector G4Step::GetDeltaPosition() const
{ return fpPostStepPoint->GetPosition()
- fpPreStepPoint->GetPosition(); }
inline G4double G4Step::GetDeltaTime() const
{ return fpPostStepPoint->GetLocalTime()
- fpPreStepPoint->GetLocalTime(); }
inline G4ThreeVector G4Step::GetDeltaMomentum() const
{ return fpPostStepPoint->GetMomentum()
- fpPreStepPoint->GetMomentum(); }
inline G4double G4Step::GetDeltaEnergy() const
{ return fpPostStepPoint->GetKineticEnergy()
- fpPreStepPoint->GetKineticEnergy(); }
inline G4double G4Step::GetTotalEnergyDeposit() const
{ return fTotalEnergyDeposit; }
inline void G4Step::SetTotalEnergyDeposit(G4double value)
{ fTotalEnergyDeposit = value; }
inline void G4Step::AddTotalEnergyDeposit(G4double value)
{ fTotalEnergyDeposit += value; }
inline void G4Step::ResetTotalEnergyDeposit()
{ fTotalEnergyDeposit = 0.; }
inline void G4Step::SetControlFlag(G4SteppingControl value)
{
fpSteppingControlFlag = value;
}
inline G4SteppingControl G4Step::GetControlFlag() const
{
return fpSteppingControlFlag;
}
inline void G4Step::CopyPostToPreStepPoint( )
{
// Default equal operator is used for copy
*(fpPreStepPoint) = *(fpPostStepPoint);
}
//-------------------------------------------------------------
// To implement bi-directional association between G4Step and
// and G4Track, a combined usage of 'forward declaration' and
// 'include' is necessary.
//-------------------------------------------------------------
#include "G4Track.hh"
inline G4Track* G4Step::GetTrack() const
{ return fpTrack; }
inline void G4Step::SetTrack(G4Track* value)
{ fpTrack = value; }
// Other member functions
inline void G4Step::InitializeStep( G4Track* aValue )
{
// Initialize G4Step attributes
fStepLength = 0.;
fTotalEnergyDeposit = 0.;
fpTrack = aValue;
fpTrack->SetStepLength(0.);
// Initialize G4StepPoint attributes.
// To avoid the circular dependency between G4Track, G4Step
// and G4StepPoint, G4Step has to manage the copy actions.
fpPreStepPoint->SetPosition(fpTrack->GetPosition());
fpPreStepPoint->SetGlobalTime(fpTrack->GetGlobalTime());
fpPreStepPoint->SetLocalTime(fpTrack->GetLocalTime());
fpPreStepPoint->SetProperTime(fpTrack->GetProperTime());
fpPreStepPoint->SetMomentumDirection(fpTrack->GetMomentumDirection());
fpPreStepPoint->SetKineticEnergy(fpTrack->GetKineticEnergy());
fpPreStepPoint->SetTouchable(fpTrack->GetTouchable());
fpPreStepPoint->SetPolarization(fpTrack->GetPolarization());
fpPreStepPoint->SetSafety(0.);
fpPreStepPoint->SetStepStatus(fUndefined);
fpPreStepPoint->SetProcessDefinedStep(0);
fpPreStepPoint->SetMass(fpTrack->GetDynamicParticle()->GetMass());
fpPreStepPoint->SetWeight(fpTrack->GetWeight());
(*fpPostStepPoint) = (*fpPreStepPoint);
}
inline void G4Step::UpdateTrack( )
{
// To avoid the circular dependency between G4Track, G4Step
// and G4StepPoint, G4Step has to manage the update actions.
fpTrack->SetPosition(fpPostStepPoint->GetPosition());
fpTrack->SetGlobalTime(fpPostStepPoint->GetGlobalTime());
fpTrack->SetLocalTime(fpPostStepPoint->GetLocalTime());
fpTrack->SetProperTime(fpPostStepPoint->GetProperTime());
fpTrack->SetMomentumDirection(fpPostStepPoint->GetMomentumDirection());
fpTrack->SetKineticEnergy(fpPostStepPoint->GetKineticEnergy());
fpTrack->SetPolarization(fpPostStepPoint->GetPolarization());
fpTrack->SetStepLength(fStepLength);
// NextTouchable is updated
// (G4Track::Touchable points touchable of Pre-StepPoint)
fpTrack->SetNextTouchable(fpPostStepPoint->GetTouchable());
fpTrack->SetWeight(fpPostStepPoint->GetWeight());
}
#endif
+212
View File
@@ -0,0 +1,212 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Step.icc,v 1.1 1999/10/06 01:21:48 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
//
//-----------------------------------------------------------------
// In-line definitions
//-----------------------------------------------------------------
// Get/Set functions
inline
G4StepPoint* G4Step::GetPreStepPoint() const
{
return fpPreStepPoint;
}
inline
void G4Step::SetPreStepPoint(G4StepPoint* value)
{
fpPreStepPoint = value;
}
inline
G4StepPoint* G4Step::GetPostStepPoint() const
{
return fpPostStepPoint;
}
inline
void G4Step::SetPostStepPoint(G4StepPoint* value)
{
fpPostStepPoint = value;
}
inline
G4double G4Step::GetStepLength() const
{
return fStepLength;
}
inline
void G4Step::SetStepLength(G4double value)
{
fStepLength = value;
}
inline
G4ThreeVector G4Step::GetDeltaPosition() const
{
return fpPostStepPoint->GetPosition()
- fpPreStepPoint->GetPosition();
}
inline
G4double G4Step::GetDeltaTime() const
{
return fpPostStepPoint->GetLocalTime()
- fpPreStepPoint->GetLocalTime();
}
inline
G4ThreeVector G4Step::GetDeltaMomentum() const
{
return fpPostStepPoint->GetMomentum()
- fpPreStepPoint->GetMomentum();
}
inline
G4double G4Step::GetDeltaEnergy() const
{
return fpPostStepPoint->GetKineticEnergy()
- fpPreStepPoint->GetKineticEnergy();
}
inline
G4double G4Step::GetTotalEnergyDeposit() const
{
return fTotalEnergyDeposit;
}
inline
void G4Step::SetTotalEnergyDeposit(G4double value)
{
fTotalEnergyDeposit = value;
}
inline
void G4Step::AddTotalEnergyDeposit(G4double value)
{
fTotalEnergyDeposit += value;
}
inline
void G4Step::ResetTotalEnergyDeposit()
{
fTotalEnergyDeposit = 0.;
}
inline
void G4Step::SetControlFlag(G4SteppingControl value)
{
fpSteppingControlFlag = value;
}
inline
G4SteppingControl G4Step::GetControlFlag() const
{
return fpSteppingControlFlag;
}
inline
void G4Step::CopyPostToPreStepPoint( )
{
// Default equal operator is used for copy
*(fpPreStepPoint) = *(fpPostStepPoint);
}
//-------------------------------------------------------------
// To implement bi-directional association between G4Step and
// and G4Track, a combined usage of 'forward declaration' and
// 'include' is necessary.
//-------------------------------------------------------------
#include "G4Track.hh"
inline
G4Track* G4Step::GetTrack() const
{
return fpTrack;
}
inline
void G4Step::SetTrack(G4Track* value)
{
fpTrack = value;
}
// Other member functions
inline
void G4Step::InitializeStep( G4Track* aValue )
{
// Initialize G4Step attributes
fStepLength = 0.;
fTotalEnergyDeposit = 0.;
fpTrack = aValue;
fpTrack->SetStepLength(0.);
// Initialize G4StepPoint attributes.
// To avoid the circular dependency between G4Track, G4Step
// and G4StepPoint, G4Step has to manage the copy actions.
fpPreStepPoint->SetPosition(fpTrack->GetPosition());
fpPreStepPoint->SetGlobalTime(fpTrack->GetGlobalTime());
fpPreStepPoint->SetLocalTime(fpTrack->GetLocalTime());
fpPreStepPoint->SetProperTime(fpTrack->GetProperTime());
fpPreStepPoint->SetMomentumDirection(fpTrack->GetMomentumDirection());
fpPreStepPoint->SetKineticEnergy(fpTrack->GetKineticEnergy());
fpPreStepPoint->SetTouchable(fpTrack->GetTouchable());
fpPreStepPoint->SetPolarization(fpTrack->GetPolarization());
fpPreStepPoint->SetSafety(0.);
fpPreStepPoint->SetStepStatus(fUndefined);
fpPreStepPoint->SetProcessDefinedStep(0);
fpPreStepPoint->SetMass(fpTrack->GetDynamicParticle()->GetMass());
fpPreStepPoint->SetWeight(fpTrack->GetWeight());
(*fpPostStepPoint) = (*fpPreStepPoint);
}
inline
void G4Step::UpdateTrack( )
{
// To avoid the circular dependency between G4Track, G4Step
// and G4StepPoint, G4Step has to manage the update actions.
// position, time
fpTrack->SetPosition(fpPostStepPoint->GetPosition());
fpTrack->SetGlobalTime(fpPostStepPoint->GetGlobalTime());
fpTrack->SetLocalTime(fpPostStepPoint->GetLocalTime());
fpTrack->SetProperTime(fpPostStepPoint->GetProperTime());
// energy, momentum, polarization
fpTrack->SetMomentumDirection(fpPostStepPoint->GetMomentumDirection());
fpTrack->SetKineticEnergy(fpPostStepPoint->GetKineticEnergy());
fpTrack->SetPolarization(fpPostStepPoint->GetPolarization());
// mass charge
G4DynamicParticle* pParticle = fpTrack->GetDynamicParticle();
pParticle->SetMass(fpPostStepPoint->GetMass());
pParticle->SetCharge(fpPostStepPoint->GetCharge());
// step length
fpTrack->SetStepLength(fStepLength);
// NextTouchable is updated
// (G4Track::Touchable points touchable of Pre-StepPoint)
fpTrack->SetNextTouchable(fpPostStepPoint->GetTouchable());
fpTrack->SetWeight(fpPostStepPoint->GetWeight());
}
+41 -22
View File
@@ -1,19 +1,19 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StepPoint.hh,v 1.2 1999/04/13 09:43:27 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4StepPoint.hh,v 1.4 1999/11/07 16:32:02 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
//
// G4StepPoint.hh
//
// Description:
// Class Description:
// This class represents information associated with the
// each end of a Step like the space/time data of the
// particle.
@@ -46,12 +46,15 @@ class G4StepPoint
//--------
public:
//--------
// Constructor/Destructor
G4StepPoint();
~G4StepPoint();
//--------
public: // with description
// Get/Set functions
inline const G4ThreeVector& GetPosition() const
{ return fPosition; }
@@ -59,7 +62,8 @@ class G4StepPoint
{ fPosition = aValue; }
inline void AddPosition(const G4ThreeVector& aValue)
{ fPosition += aValue; }
// Position where the track locates
inline G4double GetLocalTime() const
{ return fLocalTime; }
inline void SetLocalTime(const G4double aValue)
@@ -92,7 +96,8 @@ class G4StepPoint
inline void AddMomentumDirection(const G4ThreeVector& aValue)
{ fMomentumDirection += aValue;
}
// Direction of momentum (should be an unit vector)
inline G4ThreeVector GetMomentum() const
{
G4double tMomentum = sqrt(fKineticEnergy*fKineticEnergy +
@@ -101,11 +106,13 @@ class G4StepPoint
fMomentumDirection.y()*tMomentum,
fMomentumDirection.z()*tMomentum);
}
// Total momentum of the track
inline G4double GetTotalEnergy() const
{
return fKineticEnergy + fMass;
}
// Total energy of the track
inline G4double GetKineticEnergy() const
{ return fKineticEnergy; }
@@ -113,13 +120,8 @@ class G4StepPoint
{ fKineticEnergy = aValue; }
inline void AddKineticEnergy(const G4double aValue)
{ fKineticEnergy += aValue; }
// Kinetic Energy of the track
// This velocity is the velocity as if in vacuum.
// (So it is not corrected for the refraction index
// in the case of photons - optical or X-rays.)
// In order to get the velocity in the material, use
// GetVelocity of G4Track.
//
inline G4double GetVelocity() const
{
if(fMass==0.){
@@ -132,6 +134,23 @@ class G4StepPoint
return tMomentum/tTotalEnergy*c_light;
}
}
// This velocity is the velocity as if in vacuum.
// (So it is not corrected for the refraction index
// in the case of photons - optical or X-rays.)
// In order to get the velocity in the material, use
// GetVelocity of G4Track.
//
inline G4double GetBeta() const
{ return (fMass==0.) ?
1.0 :
sqrt(fKineticEnergy*fKineticEnergy + 2.0*fKineticEnergy*fMass)
/(fKineticEnergy+fMass); }
// Velocity of the track in unit of c(light velocity)
inline G4double GetGamma() const
{ return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; }
// Gamma factor (1/sqrt[1-beta*beta]) of the track
inline G4VPhysicalVolume* GetPhysicalVolume()
{ return fpTouchable->GetVolume(); }
@@ -165,19 +184,16 @@ class G4StepPoint
inline void SetProcessDefinedStep(G4VProcess* aValue)
{ fpProcessDefinedStep = aValue; }
inline G4double GetGamma() const
{ return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; }
inline G4double GetBeta() const
{ return (fMass==0.) ?
1.0 :
sqrt(fKineticEnergy*fKineticEnergy + 2.0*fKineticEnergy*fMass)
/(fKineticEnergy+fMass); }
inline G4double GetMass() const
{ return fMass; }
inline void SetMass(G4double value)
{ fMass = value; }
inline G4double GetCharge() const
{ return fCharge; }
inline void SetCharge(G4double value)
{ fCharge = value; }
inline G4Material* GetMaterial()
{ return fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial(); }
@@ -211,8 +227,11 @@ class G4StepPoint
// Process which defined the current Step.
G4double fMass;
// Dynamical mass of the particle
G4double fWeight;
G4double fCharge;
// Dynamical Charge of the particle
G4double fWeight;
};
#endif
+4 -4
View File
@@ -1,19 +1,19 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StepStatus.hh,v 1.1 1999/01/07 16:14:23 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4StepStatus.hh,v 1.2 1999/11/07 16:32:02 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
//
// G4StepStatus.hh
//
// Description:
// Class Description:
// This is an enumerator to define possible sources which
// can define the Step length.
//
+4 -4
View File
@@ -1,19 +1,19 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SteppingControl.hh,v 1.1 1999/01/07 16:14:23 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4SteppingControl.hh,v 1.2 1999/11/07 16:32:03 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
//
// G4SteppingControl
//
// Description:
// Class Description:
// This enumaration specifies possible conditions to control
// the stepping manager behavier.
//
+65 -254
View File
@@ -1,19 +1,19 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Track.hh,v 1.2 1999/04/13 09:43:28 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4Track.hh,v 1.5 1999/11/07 16:32:03 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
//
// G4Track.hh
//
// Description:
// Class Description:
// This class represents the partilce under tracking.
// It includes information related to tracking for examples:
// 1) current position/time of the particle,
@@ -50,16 +50,19 @@ class G4Track
{
//--------
public:
//--------
public: // With description
// Constructor/Destrcutor
// Constructor
G4Track();
G4Track(G4DynamicParticle* apValueDynamicParticle,
G4double aValueTime,
const G4ThreeVector& aValuePosition);
// aValueTime is a global time
//--------
public:
// Destrcutor
~G4Track();
// Operators
@@ -72,7 +75,24 @@ class G4Track
// Define "==" operator because "G4TrackVector" uses
//"RWPtrOrderdVector" which requires this.
//--------
public: // With description
// Get/Set functions
// track ID
G4int GetTrackID() const;
void SetTrackID(const G4int aValue);
G4int GetParentID() const;
void SetParentID(const G4int aValue);
// dynamic particle
G4DynamicParticle* GetDynamicParticle() const;
// particle definition
G4ParticleDefinition* GetDefinition() const;
// position, time
const G4ThreeVector& GetPosition() const;
void SetPosition(const G4ThreeVector& aValue);
@@ -88,18 +108,8 @@ class G4Track
void SetProperTime(const G4double aValue);
// Proper time of the current track
G4double GetTrackLength() const;
void AddTrackLength(const G4double aValue);
// Accumulated the track length
G4int GetParentID() const;
void SetParentID(const G4int aValue);
G4int GetTrackID() const;
void SetTrackID(const G4int aValue);
// volume, material, touchable
G4VPhysicalVolume* GetVolume() const;
G4VPhysicalVolume* GetNextVolume() const;
G4Material* GetMaterial() const;
@@ -111,43 +121,62 @@ class G4Track
G4VTouchable* GetNextTouchable() const;
void SetNextTouchable(G4VTouchable* apValue);
// energy
G4double GetKineticEnergy() const;
void SetKineticEnergy(const G4double aValue);
G4double GetVelocity() const;
G4double GetTotalEnergy() const;
// moemtnum
const G4ThreeVector& GetMomentumDirection() const;
void SetMomentumDirection(const G4ThreeVector& aValue);
G4ThreeVector GetMomentum() const;
G4double GetVelocity() const;
// polarization
const G4ThreeVector& GetPolarization() const;
void SetPolarization(const G4ThreeVector& aValue);
// track status, flags for tracking
G4TrackStatus GetTrackStatus() const;
void SetTrackStatus(const G4TrackStatus aTrackStatus);
G4bool IsBelowThreshold() const;
void SetBelowThresholdFlag(G4bool value = true);
// The flag of "BelowThreshold" is set to true
// if this track energy is below threshold energy
// in this material determined by the range cut value
G4bool IsGoodForTracking() const;
void SetGoodForTrackingFlag(G4bool value = true);
// The flag of "GoodForTracking" is set by processes
// if this track should be tracked
// even if the energy is below threshold
// track length
G4double GetTrackLength() const;
void AddTrackLength(const G4double aValue);
// Accumulated the track length
// step information
G4Step* GetStep() const;
void SetStep(G4Step* aValue);
G4int GetCurrentStepNumber() const;
void IncrementCurrentStepNumber();
G4double GetTotalEnergy() const;
G4ThreeVector GetMomentum() const;
G4DynamicParticle* GetDynamicParticle() const;
G4ParticleDefinition* GetDefinition() const;
G4double GetStepLength() const;
void SetStepLength(G4double value);
// Before the end of the AlongStepDoIt loop,StepLength keeps
// the initial value which is determined by the shortest geometrical Step
// proposed by a physics process. After finishing the AlongStepDoIt,
// it will be set equal to 'StepLength' in G4Step.
G4Step* GetStep() const;
void SetStep(G4Step* aValue);
// vertex (,where this track was created) information
const G4ThreeVector& GetVertexPosition() const;
void SetVertexPosition(const G4ThreeVector& aValue);
@@ -163,6 +192,11 @@ class G4Track
const G4VProcess* GetCreatorProcess() const;
void SetCreatorProcess(G4VProcess* aValue);
// track weight
// These are methods for manipulating a weight for this track.
// The track weight is used by G4VEvtBiasMechanism
// to execute inclusive simulation for hadronic/electomagnetic shower
// and neutron transportation etc.
G4double GetWeight() const;
void SetWeight(G4double aValue);
@@ -212,230 +246,7 @@ class G4Track
G4VProcess* fpCreatorProcess; // Process which created the track
};
//-----------------------------------------------------------------
// Definitions of inline functions
//-----------------------------------------------------------------
// Operators
extern G4Allocator<G4Track> aTrackAllocator;
inline void* G4Track::operator new(size_t)
{ void *aTrack;
aTrack = (void *) aTrackAllocator.MallocSingle();
return aTrack;
}
// Override "new" for "G4Allocator".
inline void G4Track::operator delete(void *aTrack)
{ aTrackAllocator.FreeSingle((G4Track *) aTrack);}
// Override "delete" for "G4Allocator".
inline int G4Track::operator==( const G4Track& s)
{ return (this==&s) ? 1 : 0; }
// Define "==" operator because "G4TrackVector" uses
// "RWPtrOrderdVector" which requires this.
// Get/Set functions
inline const G4ThreeVector& G4Track::GetPosition() const
{ return fPosition; }
inline void G4Track::SetPosition(const G4ThreeVector& aValue)
{ fPosition = aValue; }
inline G4double G4Track::GetGlobalTime() const
{ return fGlobalTime; }
inline void G4Track::SetGlobalTime(const G4double aValue)
{ fGlobalTime = aValue; }
// Time since the event in which the track belongs is created.
inline G4double G4Track::GetLocalTime() const
{ return fLocalTime; }
inline void G4Track::SetLocalTime(const G4double aValue)
{ fLocalTime = aValue; }
// Time since the current track is created.
inline G4double G4Track::GetProperTime() const
{ return fpDynamicParticle->GetProperTime(); }
inline void G4Track::SetProperTime(const G4double aValue)
{ fpDynamicParticle->SetProperTime(aValue); }
// Proper time of the current track
inline G4double G4Track::GetTrackLength() const
{ return fTrackLength; }
inline void G4Track::AddTrackLength(const G4double aValue)
{ fTrackLength += aValue; }
// Accumulated track length
inline G4int G4Track::GetParentID() const
{ return fParentID; }
inline void G4Track::SetParentID(const G4int aValue)
{ fParentID = aValue; }
inline G4int G4Track::GetTrackID() const
{ return fTrackID; }
inline void G4Track::SetTrackID(const G4int aValue)
{ fTrackID = aValue; }
inline G4VPhysicalVolume* G4Track::GetVolume() const
{ return fpTouchable->GetVolume(); }
inline G4VPhysicalVolume* G4Track::GetNextVolume() const
{ return fpNextTouchable->GetVolume(); }
inline G4Material* G4Track::GetMaterial() const
{ return fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial(); }
inline G4Material* G4Track::GetNextMaterial() const
{ return fpNextTouchable->GetVolume()->GetLogicalVolume()->GetMaterial(); }
inline G4VTouchable* G4Track::GetTouchable() const
{ return fpTouchable; }
inline void G4Track::SetTouchable(G4VTouchable* apValue)
{ fpTouchable = apValue; }
inline G4VTouchable* G4Track::GetNextTouchable() const
{ return fpNextTouchable; }
inline void G4Track::SetNextTouchable(G4VTouchable* apValue)
{ fpNextTouchable = apValue; }
inline G4double G4Track::GetKineticEnergy() const
{ return fpDynamicParticle->GetKineticEnergy(); }
inline void G4Track::SetKineticEnergy(const G4double aValue)
{ fpDynamicParticle->SetKineticEnergy(aValue); }
inline G4double G4Track::GetVelocity() const
{
G4double velocity ;
G4double mass = fpDynamicParticle->GetMass();
if( mass == 0. )
{
velocity = c_light ;
if((fpDynamicParticle->GetDefinition()->GetParticleName() ==
"gamma")
||
(fpDynamicParticle->GetDefinition()->GetParticleName() ==
"opticalphoton"))
{
G4Material*
mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial();
if(mat->GetMaterialPropertiesTable() != 0)
{
if(mat->GetMaterialPropertiesTable()->GetProperty("RINDEX") != 0 )
velocity /=
mat->GetMaterialPropertiesTable()->GetProperty("RINDEX")->
GetMinProperty() ;
}
}
}
else
{
G4double T = fpDynamicParticle->GetKineticEnergy();
velocity = c_light*sqrt(T*(T+2.*mass))/(T+mass) ;
}
return velocity ;
}
inline const G4ThreeVector& G4Track::GetMomentumDirection() const
{ return fpDynamicParticle->GetMomentumDirection(); }
inline void G4Track::SetMomentumDirection(const G4ThreeVector& aValue)
{ fpDynamicParticle->SetMomentumDirection(aValue) ;}
inline const G4ThreeVector& G4Track::GetPolarization() const
{ return fpDynamicParticle->GetPolarization(); }
inline void G4Track::SetPolarization(const G4ThreeVector& aValue)
{ fpDynamicParticle->SetPolarization(aValue.x(),
aValue.y(),
aValue.z()); }
inline G4TrackStatus G4Track::GetTrackStatus() const
{ return fTrackStatus; }
inline void G4Track::SetTrackStatus(const G4TrackStatus aTrackStatus)
{ fTrackStatus = aTrackStatus; }
inline G4int G4Track::GetCurrentStepNumber() const
{ return fCurrentStepNumber; }
inline void G4Track::IncrementCurrentStepNumber()
{ fCurrentStepNumber++; }
inline G4double G4Track::GetTotalEnergy() const
{ return fpDynamicParticle->GetTotalEnergy(); }
inline G4ThreeVector G4Track::GetMomentum() const
{ return fpDynamicParticle->GetMomentum(); }
inline G4DynamicParticle* G4Track::GetDynamicParticle() const
{ return fpDynamicParticle; }
inline G4ParticleDefinition* G4Track::GetDefinition() const
{ return fpDynamicParticle->GetDefinition(); }
inline G4double G4Track::GetStepLength() const
{ return fStepLength; }
inline void G4Track::SetStepLength(G4double value)
{ fStepLength = value; }
inline const G4ThreeVector& G4Track::GetVertexPosition() const
{ return fVtxPosition; }
inline void G4Track::SetVertexPosition(const G4ThreeVector& aValue)
{ fVtxPosition = aValue; }
inline const G4ThreeVector& G4Track::GetVertexMomentumDirection() const
{ return fVtxMomentumDirection; }
inline void G4Track::SetVertexMomentumDirection(const G4ThreeVector& aValue)
{ fVtxMomentumDirection = aValue ;}
inline G4double G4Track::GetVertexKineticEnergy() const
{ return fVtxKineticEnergy; }
inline void G4Track::SetVertexKineticEnergy(const G4double aValue)
{ fVtxKineticEnergy = aValue; }
inline G4LogicalVolume* G4Track::GetLogicalVolumeAtVertex() const
{ return fpLVAtVertex; }
inline void G4Track::SetLogicalVolumeAtVertex(G4LogicalVolume* aValue)
{ fpLVAtVertex = aValue; }
inline const G4VProcess* G4Track::GetCreatorProcess() const
{ return fpCreatorProcess; }
// If the pointer is 0, this means the track is created
// by the event generator, i.e. the primary track.If it is not
// 0, it points to the process which created this track.
inline void G4Track::SetCreatorProcess(G4VProcess* aValue)
{ fpCreatorProcess = aValue; }
inline G4bool G4Track::IsBelowThreshold() const
{ return fBelowThreshold; }
inline void G4Track::SetBelowThresholdFlag(G4bool value)
{ fBelowThreshold = value; }
inline G4bool G4Track::IsGoodForTracking() const
{ return fGoodForTracking; }
inline void G4Track::SetGoodForTrackingFlag(G4bool value)
{ fGoodForTracking = value; }
inline void G4Track::SetWeight(G4double aValue)
{ fWeight = aValue; }
inline G4double G4Track::GetWeight() const
{ return fWeight; }
//-------------------------------------------------------------
// To implement bi-directional association between G4Step and
// and G4Track, a combined usage of 'forward declaration' and
// 'include' is necessary.
//-------------------------------------------------------------
#include "G4Step.hh"
inline G4Step* G4Track::GetStep() const
{ return fpStep; }
inline void G4Track::SetStep(G4Step* aValue)
{ fpStep = aValue; }
#include "G4Track.icc"
#endif
+258
View File
@@ -0,0 +1,258 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Track.icc,v 1.1 1999/10/06 01:21:50 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//-----------------------------------------------------------------
// Definitions of inline functions
//-----------------------------------------------------------------
// Operators
extern G4Allocator<G4Track> aTrackAllocator;
inline void* G4Track::operator new(size_t)
{ void *aTrack;
aTrack = (void *) aTrackAllocator.MallocSingle();
return aTrack;
}
// Override "new" for "G4Allocator".
inline void G4Track::operator delete(void *aTrack)
{ aTrackAllocator.FreeSingle((G4Track *) aTrack);}
// Override "delete" for "G4Allocator".
inline int G4Track::operator==( const G4Track& s)
{ return (this==&s) ? 1 : 0; }
// Define "==" operator because "G4TrackVector" uses
// "RWPtrOrderdVector" which requires this.
// Get/Set functions
// dynamic particle
inline G4DynamicParticle* G4Track::GetDynamicParticle() const
{ return fpDynamicParticle; }
// particle definition
inline G4ParticleDefinition* G4Track::GetDefinition() const
{ return fpDynamicParticle->GetDefinition(); }
// parent track ID
inline G4int G4Track::GetParentID() const
{ return fParentID; }
inline void G4Track::SetParentID(const G4int aValue)
{ fParentID = aValue; }
// current track ID
inline G4int G4Track::GetTrackID() const
{ return fTrackID; }
inline void G4Track::SetTrackID(const G4int aValue)
{ fTrackID = aValue; }
// position
inline const G4ThreeVector& G4Track::GetPosition() const
{ return fPosition; }
inline void G4Track::SetPosition(const G4ThreeVector& aValue)
{ fPosition = aValue; }
// global time
inline G4double G4Track::GetGlobalTime() const
{ return fGlobalTime; }
inline void G4Track::SetGlobalTime(const G4double aValue)
{ fGlobalTime = aValue; }
// Time since the event in which the track belongs is created.
// local time
inline G4double G4Track::GetLocalTime() const
{ return fLocalTime; }
inline void G4Track::SetLocalTime(const G4double aValue)
{ fLocalTime = aValue; }
// Time since the current track is created.
// proper time
inline G4double G4Track::GetProperTime() const
{ return fpDynamicParticle->GetProperTime(); }
inline void G4Track::SetProperTime(const G4double aValue)
{ fpDynamicParticle->SetProperTime(aValue); }
// Proper time of the current track
// volume
inline G4VPhysicalVolume* G4Track::GetVolume() const
{ return fpTouchable->GetVolume(); }
inline G4VPhysicalVolume* G4Track::GetNextVolume() const
{ return fpNextTouchable->GetVolume(); }
// material
inline G4Material* G4Track::GetMaterial() const
{ return fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial(); }
inline G4Material* G4Track::GetNextMaterial() const
{ return fpNextTouchable->GetVolume()->GetLogicalVolume()->GetMaterial(); }
// touchable
inline G4VTouchable* G4Track::GetTouchable() const
{ return fpTouchable; }
inline void G4Track::SetTouchable(G4VTouchable* apValue)
{ fpTouchable = apValue; }
inline G4VTouchable* G4Track::GetNextTouchable() const
{ return fpNextTouchable; }
inline void G4Track::SetNextTouchable(G4VTouchable* apValue)
{ fpNextTouchable = apValue; }
// kinetic energy
inline G4double G4Track::GetKineticEnergy() const
{ return fpDynamicParticle->GetKineticEnergy(); }
inline void G4Track::SetKineticEnergy(const G4double aValue)
{ fpDynamicParticle->SetKineticEnergy(aValue); }
// total energy
inline G4double G4Track::GetTotalEnergy() const
{ return fpDynamicParticle->GetTotalEnergy(); }
// momentum
inline G4ThreeVector G4Track::GetMomentum() const
{ return fpDynamicParticle->GetMomentum(); }
// momentum (direction)
inline const G4ThreeVector& G4Track::GetMomentumDirection() const
{ return fpDynamicParticle->GetMomentumDirection(); }
inline void G4Track::SetMomentumDirection(const G4ThreeVector& aValue)
{ fpDynamicParticle->SetMomentumDirection(aValue) ;}
// polarization
inline const G4ThreeVector& G4Track::GetPolarization() const
{ return fpDynamicParticle->GetPolarization(); }
inline void G4Track::SetPolarization(const G4ThreeVector& aValue)
{ fpDynamicParticle->SetPolarization(aValue.x(),
aValue.y(),
aValue.z()); }
// track status
inline G4TrackStatus G4Track::GetTrackStatus() const
{ return fTrackStatus; }
inline void G4Track::SetTrackStatus(const G4TrackStatus aTrackStatus)
{ fTrackStatus = aTrackStatus; }
// track length
inline G4double G4Track::GetTrackLength() const
{ return fTrackLength; }
inline void G4Track::AddTrackLength(const G4double aValue)
{ fTrackLength += aValue; }
// Accumulated track length
// step number
inline G4int G4Track::GetCurrentStepNumber() const
{ return fCurrentStepNumber; }
inline void G4Track::IncrementCurrentStepNumber()
{ fCurrentStepNumber++; }
// step length
inline G4double G4Track::GetStepLength() const
{ return fStepLength; }
inline void G4Track::SetStepLength(G4double value)
{ fStepLength = value; }
// vertex (where this track was created) information
inline const G4ThreeVector& G4Track::GetVertexPosition() const
{ return fVtxPosition; }
inline void G4Track::SetVertexPosition(const G4ThreeVector& aValue)
{ fVtxPosition = aValue; }
inline const G4ThreeVector& G4Track::GetVertexMomentumDirection() const
{ return fVtxMomentumDirection; }
inline void G4Track::SetVertexMomentumDirection(const G4ThreeVector& aValue)
{ fVtxMomentumDirection = aValue ;}
inline G4double G4Track::GetVertexKineticEnergy() const
{ return fVtxKineticEnergy; }
inline void G4Track::SetVertexKineticEnergy(const G4double aValue)
{ fVtxKineticEnergy = aValue; }
inline G4LogicalVolume* G4Track::GetLogicalVolumeAtVertex() const
{ return fpLVAtVertex; }
inline void G4Track::SetLogicalVolumeAtVertex(G4LogicalVolume* aValue)
{ fpLVAtVertex = aValue; }
inline const G4VProcess* G4Track::GetCreatorProcess() const
{ return fpCreatorProcess; }
// If the pointer is 0, this means the track is created
// by the event generator, i.e. the primary track.If it is not
// 0, it points to the process which created this track.
inline void G4Track::SetCreatorProcess(G4VProcess* aValue)
{ fpCreatorProcess = aValue; }
// flag for "Below Threshold"
inline G4bool G4Track::IsBelowThreshold() const
{ return fBelowThreshold; }
inline void G4Track::SetBelowThresholdFlag(G4bool value)
{ fBelowThreshold = value; }
// flag for " Good for Tracking"
inline G4bool G4Track::IsGoodForTracking() const
{ return fGoodForTracking; }
inline void G4Track::SetGoodForTrackingFlag(G4bool value)
{ fGoodForTracking = value; }
// track weight
inline void G4Track::SetWeight(G4double aValue)
{ fWeight = aValue; }
inline G4double G4Track::GetWeight() const
{ return fWeight; }
//-------------------------------------------------------------
// To implement bi-directional association between G4Step and
// and G4Track, a combined usage of 'forward declaration' and
// 'include' is necessary.
//-------------------------------------------------------------
#include "G4Step.hh"
inline G4Step* G4Track::GetStep() const
{ return fpStep; }
inline void G4Track::SetStep(G4Step* aValue)
{ fpStep = aValue; }
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TrackFastVector.hh,v 1.2 1999/02/09 14:19:17 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4TrackFastVector.hh,v 1.3 1999/11/07 16:32:04 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
+4 -4
View File
@@ -1,19 +1,19 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TrackStatus.hh,v 1.1 1999/01/07 16:14:24 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4TrackStatus.hh,v 1.2 1999/11/07 16:32:04 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
//
// G4TrackStatus.hh
//
// Description:
// Class Description:
// This is an enumerator to define the current status
// of the track which is under the transportation.
//
+16 -5
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VEvtBiasMechanism.hh,v 1.2 1999/04/13 09:43:29 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VEvtBiasMechanism.hh,v 1.3 1999/11/07 16:32:05 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
@@ -14,6 +14,11 @@
//
// For information related to this code contact:
// CERN, CN Division, ASD group
//
// -------------------------------------------------------
// Class Description
// This class is a base class for all "event biasing mechanism".
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 17 Nov. 1998 H.Kurahige
@@ -31,12 +36,18 @@ class G4ParticleDefinition;
class G4VEvtBiasMechanism
{
public:
public: // with description
// constructors
G4VEvtBiasMechanism(const G4String& name = "");
G4VEvtBiasMechanism(const G4VEvtBiasMechanism& right);
public:
//destructors
virtual ~G4VEvtBiasMechanism();
public: // with description
// pure virtual functions
// ApplyMath method will be invoked in G4VParticleChange::UpdateStepInfo()
@@ -48,7 +59,7 @@ class G4VEvtBiasMechanism
virtual G4bool IsApplicable(G4ParticleDefinition*) const = 0;
//
// name of the biasing mechanism
const G4String& GetName(){ return theEBName;}
// Set/Get Verbose level
+16 -15
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VParticleChange.hh,v 1.3 1999/05/06 11:42:52 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VParticleChange.hh,v 1.4 1999/11/07 16:32:05 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
@@ -17,9 +17,10 @@
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
//
// This class is the abstract class for ParticleChange.
//
// Class Description
// This class is the abstract class for ParticleChange.
//-
// The ParticleChange class ontains the results after invocation
// of a physics process. This includes final states of parent
// particle (momentum, energy, etc) and secondary particles generated
@@ -28,8 +29,8 @@
// momentum are in global reference system, therefore all the
// needed Lorentz transformations must have been already Done
// when filling the data-members of this class.
//
//
//-
//-
// This abstract class has following four virtual methods
// virtual G4Step* UpdateStepForAtRest(G4Step* Step);
// virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
@@ -41,7 +42,7 @@
// User must add methods to keep the final state information
// in his derived class as well as implement UpdateStep methods
// which he want to use.
//
//-
// The Initialize methods is provided to refresh the final
// state information and should be called by each process
// at the beginning of DoIt.
@@ -85,7 +86,7 @@ class G4VParticleChange
G4VParticleChange(const G4VParticleChange &right);
G4VParticleChange & operator=(const G4VParticleChange &right);
public:
public: // with description
// --- the following methods are for updating G4Step -----
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
@@ -94,13 +95,13 @@ class G4VParticleChange
// by using final state information of the track given by a physics
// process
protected:
protected: // with description
G4Step* UpdateStepInfo(G4Step* Step);
// Update the G4Step specific attributes
// (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
public:
public: // with description
virtual void Initialize(const G4Track&);
// This methods will be called by each process at the beginning of DoIt
// if necessary.
@@ -114,8 +115,8 @@ class G4VParticleChange
void InitializeStatusChange(const G4Track&);
void InitializeSecondaries(const G4Track&);
// ------------------------------------------------------
public:
public: // with description
//---- the following methods are for TruePathLength ----
G4double GetTrueStepLength() const;
void SetTrueStepLength(G4double truePathLength);
@@ -202,7 +203,7 @@ class G4VParticleChange
G4int verboseLevel;
// The Verbose level
public:
public: // with description
// CheckIt method is provided for debug
virtual G4bool CheckIt(const G4Track&);
@@ -219,8 +220,8 @@ class G4VParticleChange
static const G4double accuracyForWarning;
static const G4double accuracyForException;
public: // with description
//---- following methods and members are used for Event Biasing
public:
virtual void RegisterEBMechanism(G4VEvtBiasMechanism* );
virtual void SwOnEB();
virtual void SwOffEB();
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VParticleChange.icc,v 1.2 1999/04/13 09:43:31 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VParticleChange.icc,v 1.2.8.1 1999/12/07 20:53:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//----------------------------------------------------------------
// Virtual methods for updating G4Step