Import Geant4 6.1.0 source tree
This commit is contained in:
+12
-2
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.61 2003/11/27 03:51:13 kurasige Exp $
|
||||
$Id: History,v 1.63 2004/01/20 15:29:41 vnivanch Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,7 +17,17 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Nov. 26, 03 H.Kurashige(track-V05-02-03)
|
||||
Jan. 20, 04 V.Ivanchenko (track-V06-00-01)
|
||||
- Update G4ParticleChangeForLoss for utilisation in G4VEnergyLossProcess
|
||||
- Minor update G4ParticleChangeForMSC for utilisation in model design of msc
|
||||
- Change of volume in G4ParticleChangeForTransportation only if kinEnergy>0
|
||||
|
||||
Dec. 12, 03 G.Cosmo (track-V06-00-00)
|
||||
- G4VParticleChange[.hh.cc]: removed unnecessary 'const' qualifier to
|
||||
return value in GetAccuracyForWarning() and GetAccuracyForException()
|
||||
causing noisy warnings on Intel-icc compiler.
|
||||
|
||||
Nov. 26, 03 H.Kurashige (track-V05-02-03)
|
||||
- Fixed problem of setting momentum direction for stoppped particle in G4ParticleChange (Vladimir)
|
||||
|
||||
Oct. 4, 03 G.Cosmo (track-V05-02-02)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ForceCondition.hh,v 1.4 2002/10/31 23:41:52 tsasaki Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4GPILSelection.hh,v 1.3 2001/07/11 10:08:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChange.hh,v 1.9 2001/11/21 14:05:57 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChange.icc,v 1.9 2001/10/20 08:07:49 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
inline
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForDecay.hh,v 1.5 2001/07/11 10:08:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -21,17 +21,22 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForLoss.hh,v 1.4 2001/07/11 10:08:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// $Id: G4ParticleChangeForLoss.hh,v 1.5 2004/01/20 15:29:41 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
//
|
||||
// Modified:
|
||||
// 16.01.04 V.Ivanchenko update for model variant of energy loss
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
// Class Description
|
||||
// This class is a concrete class for ParticleChange for EnergyLoss
|
||||
//
|
||||
@@ -40,80 +45,132 @@
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
class G4DynamicParticle;
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
class G4DynamicParticle;
|
||||
|
||||
class G4ParticleChangeForLoss: public G4VParticleChange
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
G4ParticleChangeForLoss();
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
G4ParticleChangeForLoss();
|
||||
|
||||
// destructor
|
||||
virtual ~G4ParticleChangeForLoss();
|
||||
// destructor
|
||||
virtual ~G4ParticleChangeForLoss();
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operaor as protected
|
||||
G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right);
|
||||
G4ParticleChangeForLoss & operator=(const G4ParticleChangeForLoss &right);
|
||||
// with description
|
||||
// ----------------------------------------------------
|
||||
// --- the following methods are for updating G4Step -----
|
||||
|
||||
public:
|
||||
// equal/unequal operator
|
||||
G4bool operator==(const G4ParticleChangeForLoss &right) const;
|
||||
G4bool operator!=(const G4ParticleChangeForLoss &right) const;
|
||||
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// A physics process gives the final state of the particle
|
||||
// based on information of G4Track
|
||||
|
||||
void InitializeForAlongStep(const G4Track&);
|
||||
void InitializeForPostStep(const G4Track&);
|
||||
//Initialize all propoerties by using G4Track information
|
||||
|
||||
public: // with description
|
||||
// ----------------------------------------------------
|
||||
// --- the following methods are for updating G4Step -----
|
||||
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
|
||||
virtual void Initialize(const G4Track&);
|
||||
// Initialize all propoerties by using G4Track information
|
||||
void AddSecondary(G4DynamicParticle* aParticle);
|
||||
// Add next secondary
|
||||
|
||||
G4double GetEnergyChange() const;
|
||||
void SetEnergyChange(G4double theEnergyChange);
|
||||
// Get/Set the final kinetic energy of the current particle.
|
||||
G4double GetProposedCharge() const;
|
||||
void SetProposedCharge(G4double theCharge);
|
||||
// Get/Set theCharge
|
||||
|
||||
|
||||
public:
|
||||
virtual void DumpInfo() const;
|
||||
G4double GetProposedKineticEnergy() const;
|
||||
void SetProposedKineticEnergy(G4double kinEnergy);
|
||||
// Get/Set the final kinetic energy of the current particle.
|
||||
|
||||
protected:
|
||||
G4double theEnergyChange;
|
||||
// The final kinetic energy of the current particle.
|
||||
|
||||
public:
|
||||
// for Debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
const G4ThreeVector& GetProposedMomentumDirection() const;
|
||||
void SetProposedMomentumDirection(const G4ThreeVector& dir);
|
||||
|
||||
virtual void DumpInfo() const;
|
||||
|
||||
// for Debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operaor as protected
|
||||
G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right);
|
||||
G4ParticleChangeForLoss & operator=(const G4ParticleChangeForLoss &right);
|
||||
|
||||
private:
|
||||
|
||||
const G4Track* currentTrack;
|
||||
// The pointer to G4Track
|
||||
G4double kinEnergy;
|
||||
// The final kinetic energy of the current particle.
|
||||
G4double currentCharge;
|
||||
// The final charge of the current particle.
|
||||
G4ThreeVector proposedMomentumDirection;
|
||||
// The final momentum direction of the current particle.
|
||||
};
|
||||
|
||||
inline
|
||||
G4double G4ParticleChangeForLoss::GetEnergyChange() const
|
||||
inline G4double G4ParticleChangeForLoss::GetProposedKineticEnergy() const
|
||||
{
|
||||
return theEnergyChange;
|
||||
return kinEnergy;
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::SetProposedKineticEnergy(G4double energy)
|
||||
{
|
||||
kinEnergy = energy;
|
||||
}
|
||||
|
||||
inline G4double G4ParticleChangeForLoss::GetProposedCharge() const
|
||||
{
|
||||
return currentCharge;
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::SetProposedCharge(G4double theCharge)
|
||||
{
|
||||
currentCharge = theCharge;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForLoss::SetEnergyChange(G4double Energy)
|
||||
const G4ThreeVector& G4ParticleChangeForLoss::GetProposedMomentumDirection() const
|
||||
{
|
||||
theEnergyChange = Energy;
|
||||
return proposedMomentumDirection;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForLoss::SetProposedMomentumDirection(const G4ThreeVector& dir)
|
||||
{
|
||||
proposedMomentumDirection = dir;
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::InitializeForAlongStep(const G4Track& track)
|
||||
{
|
||||
theStatusChange = track.GetTrackStatus();
|
||||
theLocalEnergyDeposit = 0.0;
|
||||
InitializeSecondaries(track);
|
||||
kinEnergy = track.GetKineticEnergy();
|
||||
currentCharge = track.GetDynamicParticle()->GetCharge();
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::InitializeForPostStep(const G4Track& track)
|
||||
{
|
||||
theStatusChange = track.GetTrackStatus();
|
||||
theLocalEnergyDeposit = 0.0;
|
||||
InitializeSecondaries(track);
|
||||
kinEnergy = track.GetKineticEnergy();
|
||||
currentCharge = track.GetDynamicParticle()->GetCharge();
|
||||
proposedMomentumDirection = track.GetMomentumDirection();
|
||||
currentTrack = &track;
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::AddSecondary(G4DynamicParticle* aParticle)
|
||||
{
|
||||
// create track
|
||||
G4Track* aTrack = new G4Track(aParticle, currentTrack->GetGlobalTime(),
|
||||
currentTrack->GetPosition());
|
||||
|
||||
// Touchable handle is copied to keep the pointer
|
||||
aTrack->SetTouchableHandle(currentTrack->GetTouchableHandle());
|
||||
|
||||
// add a secondary
|
||||
G4VParticleChange::AddSecondary(aTrack);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForMSC.hh,v 1.5 2001/07/11 10:08:36 gunter Exp $
|
||||
// $Id: G4ParticleChangeForMSC.hh,v 1.6 2004/01/20 15:29:41 vnivanch Exp $
|
||||
// GEANT4 tag $ $
|
||||
//
|
||||
//
|
||||
@@ -34,7 +34,8 @@
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
// Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
|
||||
// Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
|
||||
// Update for model variant of msc 16 Jan 2004 V.Ivanchenko
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
#ifndef G4ParticleChangeForMSC_h
|
||||
@@ -64,63 +65,109 @@ class G4ParticleChangeForMSC: public G4VParticleChange
|
||||
|
||||
public: // with description
|
||||
// ----------------------------------------------------
|
||||
// --- the following methods are for updating G4Step -----
|
||||
// --- the following methods are for updating G4Step -----
|
||||
// Return the pointer to the G4Step after updating the Step information
|
||||
// by using final state information of the track given by a physics
|
||||
// process
|
||||
// process
|
||||
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// A physics process gives the final state of the particle
|
||||
// A physics process gives the final state of the particle
|
||||
// based on information of G4Track (or equivalently the PreStepPoint)
|
||||
|
||||
|
||||
virtual void Initialize(const G4Track&);
|
||||
// Initialize all propoerties by using G4Track information
|
||||
|
||||
|
||||
|
||||
// ----------------------------------------------------
|
||||
//--- methods to keep information of the final state--
|
||||
// IMPORTANT NOTE: Although the name of the class and methods are
|
||||
// "Change", what it stores (and returns in get) are the "FINAL"
|
||||
// "Change", what it stores (and returns in get) are the "FINAL"
|
||||
// values of the Position, Momentum, etc.
|
||||
|
||||
const G4ThreeVector* GetMomentumChange() const;
|
||||
void SetMomentumChange(G4double Px, G4double Py, G4double Pz);
|
||||
void SetMomentumChange(const G4ThreeVector& Pfinal);
|
||||
const G4ThreeVector* GetMomentumDirectionChange() const;
|
||||
void SetMomentumDirectionChange(G4double Px, G4double Py, G4double Pz);
|
||||
void SetMomentumDirectionChange(const G4ThreeVector& Pfinal);
|
||||
void SetMomentumChange(G4double Px, G4double Py, G4double Pz);
|
||||
const G4ThreeVector* GetProposedMomentumDirection() const;
|
||||
void SetProposedMomentumDirection(const G4ThreeVector& Pfinal);
|
||||
// Get/Set theMomentumDirectionChange vector: it is the final momentum direction.
|
||||
|
||||
const G4ThreeVector* GetPositionChange() const;
|
||||
void SetPositionChange(G4double x, G4double y, G4double z);
|
||||
void SetPositionChange(const G4ThreeVector& finalPosition);
|
||||
const G4ThreeVector* GetProposedPosition() const;
|
||||
void SetProposedPosition(const G4ThreeVector& finalPosition);
|
||||
// Get/Set the final position of the current particle.
|
||||
|
||||
public:
|
||||
virtual void DumpInfo() const;
|
||||
// for Debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
|
||||
protected:
|
||||
G4ThreeVector theMomentumDirectionChange;
|
||||
private:
|
||||
G4ThreeVector theMomentumDirection;
|
||||
// It is the vector containing the final momentum direction
|
||||
// after the invoked process. The application of the change
|
||||
// of the momentum direction of the particle is not Done here.
|
||||
// The responsibility to apply the change is up the entity
|
||||
// which invoked the process.
|
||||
|
||||
G4ThreeVector thePositionChange;
|
||||
|
||||
G4ThreeVector thePosition;
|
||||
// The changed (final) position of a given particle.
|
||||
|
||||
public:
|
||||
// for Debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
|
||||
};
|
||||
|
||||
#include "G4ParticleChangeForMSC.icc"
|
||||
inline
|
||||
void G4ParticleChangeForMSC::SetMomentumChange(const G4ThreeVector& P)
|
||||
{
|
||||
theMomentumDirection = P;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::SetProposedMomentumDirection(const G4ThreeVector& P)
|
||||
{
|
||||
theMomentumDirection = P;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::SetMomentumChange(G4double Px, G4double Py, G4double Pz)
|
||||
{
|
||||
theMomentumDirection.setX(Px);
|
||||
theMomentumDirection.setY(Py);
|
||||
theMomentumDirection.setZ(Pz);
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChangeForMSC::GetProposedMomentumDirection() const
|
||||
{
|
||||
return &theMomentumDirection;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::SetProposedPosition(const G4ThreeVector& P)
|
||||
{
|
||||
thePosition = P;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChangeForMSC::GetProposedPosition() const
|
||||
{
|
||||
return &thePosition;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::SetPositionChange(const G4ThreeVector& P)
|
||||
{
|
||||
thePosition = P;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChangeForMSC::GetPositionChange() const
|
||||
{
|
||||
return &thePosition;
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForMSC::Initialize(const G4Track& track)
|
||||
{
|
||||
theStatusChange = track.GetTrackStatus();
|
||||
theMomentumDirection = track.GetMomentumDirection();
|
||||
thePosition = track.GetPosition();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForMSC.icc,v 1.4 2001/07/11 10:08:36 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForRadDecay.hh,v 1.5 2003/06/03 08:56:37 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForTransport.hh,v 1.12 2003/09/19 19:08:14 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForTransport.icc,v 1.9 2003/06/16 17:12:57 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
inline
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Step.hh,v 1.10 2003/06/16 17:12:58 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Step.icc,v 1.10 2003/03/05 04:42:53 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4StepPoint.hh,v 1.13 2003/09/19 19:08:14 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4StepPoint.icc,v 1.8 2003/05/07 20:08:37 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
inline const G4ThreeVector& G4StepPoint::GetPosition() const
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4StepStatus.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SteppingControl.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Track.hh,v 1.16 2002/12/16 11:59:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Track.icc,v 1.10 2002/12/16 11:59:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//-----------------------------------------------------------------
|
||||
// Definitions of inline functions
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TrackFastVector.hh,v 1.4 2001/07/11 10:08:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TrackStatus.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VParticleChange.hh,v 1.9 2003/06/11 07:16:28 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// $Id: G4VParticleChange.hh,v 1.10 2003/12/12 13:12:13 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -245,8 +245,8 @@ class G4VParticleChange
|
||||
// CheckSecondary method is provided for debug
|
||||
G4bool CheckSecondary(G4Track&);
|
||||
|
||||
const G4double GetAccuracyForWarning() const;
|
||||
const G4double GetAccuracyForException() const;
|
||||
G4double GetAccuracyForWarning() const;
|
||||
G4double GetAccuracyForException() const;
|
||||
|
||||
protected:
|
||||
G4bool debugFlag;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VParticleChange.icc,v 1.10 2003/06/11 07:16:28 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
//
|
||||
//----------------------------------------------------------------
|
||||
// Virtual methods for updating G4Step
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserTrackInformation.hh,v 1.4 2003/05/09 20:42:27 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChange.cc,v 1.24 2003/11/24 10:27:52 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForDecay.cc,v 1.9 2003/06/19 14:45:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -21,28 +21,31 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForLoss.cc,v 1.8 2003/06/19 14:45:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// $Id: G4ParticleChangeForLoss.cc,v 1.9 2004/01/20 15:29:41 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
// --------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Modified:
|
||||
// 16.01.04 V.Ivanchenko update for model variant of energy loss
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
#include "G4ParticleChangeForLoss.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4TrackFastVector.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ExceptionSeverity.hh"
|
||||
|
||||
G4ParticleChangeForLoss::G4ParticleChangeForLoss():G4VParticleChange()
|
||||
{
|
||||
theSteppingControlFlag = NormalCondition;
|
||||
debugFlag = false;
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
@@ -51,7 +54,7 @@ G4ParticleChangeForLoss::G4ParticleChangeForLoss():G4VParticleChange()
|
||||
#endif
|
||||
}
|
||||
|
||||
G4ParticleChangeForLoss::~G4ParticleChangeForLoss()
|
||||
G4ParticleChangeForLoss::~G4ParticleChangeForLoss()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
@@ -60,17 +63,21 @@ G4ParticleChangeForLoss::~G4ParticleChangeForLoss()
|
||||
#endif
|
||||
}
|
||||
|
||||
// copy constructor
|
||||
G4ParticleChangeForLoss::G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right): G4VParticleChange(right)
|
||||
G4ParticleChangeForLoss::G4ParticleChangeForLoss(
|
||||
const G4ParticleChangeForLoss &right): G4VParticleChange(right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForLoss:: copy constructor is called " << G4endl;
|
||||
}
|
||||
theEnergyChange = right.theEnergyChange;
|
||||
currentTrack = right.currentTrack;
|
||||
kinEnergy = right.kinEnergy;
|
||||
currentCharge = right.currentCharge;
|
||||
proposedMomentumDirection = right.proposedMomentumDirection;
|
||||
}
|
||||
|
||||
// assignemnt operator
|
||||
G4ParticleChangeForLoss & G4ParticleChangeForLoss::operator=(const G4ParticleChangeForLoss &right)
|
||||
// assignment operator
|
||||
G4ParticleChangeForLoss & G4ParticleChangeForLoss::operator=(
|
||||
const G4ParticleChangeForLoss &right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForLoss:: assignment operator is called " << G4endl;
|
||||
@@ -81,33 +88,19 @@ G4ParticleChangeForLoss & G4ParticleChangeForLoss::operator=(const G4ParticleCha
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
|
||||
theEnergyChange = right.theEnergyChange;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit ;
|
||||
|
||||
currentTrack = right.currentTrack;
|
||||
kinEnergy = right.kinEnergy;
|
||||
currentCharge = right.currentCharge;
|
||||
proposedMomentumDirection = right.proposedMomentumDirection;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// functions for Initialization
|
||||
//
|
||||
|
||||
void G4ParticleChangeForLoss::Initialize(const G4Track& track)
|
||||
{
|
||||
// use base class's method at first
|
||||
G4VParticleChange::Initialize(track);
|
||||
|
||||
// set Energy equal to those of the parent particle
|
||||
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
|
||||
theEnergyChange = pParticle->GetKineticEnergy();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for updating G4Step
|
||||
// methods for updating G4Step
|
||||
//
|
||||
|
||||
G4Step* G4ParticleChangeForLoss::UpdateStepForAlongStep(G4Step* pStep)
|
||||
@@ -115,37 +108,59 @@ G4Step* G4ParticleChangeForLoss::UpdateStepForAlongStep(G4Step* pStep)
|
||||
// A physics process always calculates the final state of the
|
||||
// particle relative to the initial state at the beginning
|
||||
// of the Step, i.e., based on information of G4Track (or
|
||||
// equivalently the PreStepPoint).
|
||||
// equivalently the PreStepPoint).
|
||||
// So, the differences (delta) between these two states have to be
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
|
||||
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
G4Track* aTrack = pStep->GetTrack();
|
||||
|
||||
// calculate new kinetic energy
|
||||
G4double energy = pPostStepPoint->GetKineticEnergy()
|
||||
+ (theEnergyChange - pPreStepPoint->GetKineticEnergy());
|
||||
G4double energy = pPostStepPoint->GetKineticEnergy()
|
||||
+ (kinEnergy - pStep->GetPreStepPoint()->GetKineticEnergy());
|
||||
|
||||
// update kinetic energy and momentum direction
|
||||
if (energy > 0.0) {
|
||||
pPostStepPoint->SetKineticEnergy( energy );
|
||||
} else {
|
||||
// stop case
|
||||
pPostStepPoint->SetKineticEnergy(0.0);
|
||||
}
|
||||
if (energy < 0.0) energy = 0.0;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (debugFlag) CheckIt(*aTrack);
|
||||
#endif
|
||||
pPostStepPoint->SetKineticEnergy( energy );
|
||||
pPostStepPoint->SetCharge( currentCharge );
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
// Not necessary to check now
|
||||
//#ifdef G4VERBOSE
|
||||
// if (debugFlag) CheckIt(*aTrack);
|
||||
//#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
|
||||
return pStep;
|
||||
}
|
||||
|
||||
G4Step* G4ParticleChangeForLoss::UpdateStepForPostStep(G4Step* pStep)
|
||||
{
|
||||
// A physics process always calculates the final state of the
|
||||
// particle relative to the initial state at the beginning
|
||||
// of the Step, i.e., based on information of G4Track (or
|
||||
// equivalently the PreStepPoint).
|
||||
// So, the differences (delta) between these two states have to be
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
|
||||
pPostStepPoint->SetKineticEnergy( kinEnergy );
|
||||
pPostStepPoint->SetCharge( currentCharge );
|
||||
pPostStepPoint->SetMomentumDirection( proposedMomentumDirection );
|
||||
|
||||
// Not necessary to check now
|
||||
//#ifdef G4VERBOSE
|
||||
// if (debugFlag) CheckIt(*aTrack);
|
||||
//#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
|
||||
return pStep;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for printing messages
|
||||
// methods for printing messages
|
||||
//
|
||||
|
||||
void G4ParticleChangeForLoss::DumpInfo() const
|
||||
@@ -154,8 +169,20 @@ void G4ParticleChangeForLoss::DumpInfo() const
|
||||
G4VParticleChange::DumpInfo();
|
||||
|
||||
G4cout.precision(3);
|
||||
G4cout << " Kinetic Energy (MeV): "
|
||||
<< std::setw(20) << theEnergyChange/MeV
|
||||
G4cout << " Charge (eplus) : "
|
||||
<< std::setw(20) << currentCharge/eplus
|
||||
<< G4endl;
|
||||
G4cout << " Kinetic Energy (MeV): "
|
||||
<< std::setw(20) << kinEnergy/MeV
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - x : "
|
||||
<< std::setw(20) << proposedMomentumDirection.x()
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - y : "
|
||||
<< std::setw(20) << proposedMomentumDirection.y()
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - z : "
|
||||
<< std::setw(20) << proposedMomentumDirection.z()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
@@ -167,11 +194,11 @@ G4bool G4ParticleChangeForLoss::CheckIt(const G4Track& aTrack)
|
||||
G4double accuracy;
|
||||
|
||||
// Energy should not be lager than initial value
|
||||
accuracy = ( theEnergyChange - aTrack.GetKineticEnergy())/MeV;
|
||||
accuracy = ( kinEnergy - aTrack.GetKineticEnergy())/MeV;
|
||||
if (accuracy > accuracyForWarning) {
|
||||
#ifdef G4VERBOSE
|
||||
G4cout << " G4ParticleChangeForLoss::CheckIt : ";
|
||||
G4cout << "the energy becoes larger than the initial value !!" << G4endl;
|
||||
G4cout << "G4ParticleChangeForLoss::CheckIt: ";
|
||||
G4cout << "KinEnergy become larger than the initial value!" << G4endl;
|
||||
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
|
||||
#endif
|
||||
itsOK = false;
|
||||
@@ -180,8 +207,8 @@ G4bool G4ParticleChangeForLoss::CheckIt(const G4Track& aTrack)
|
||||
|
||||
// dump out information of this particle change
|
||||
#ifdef G4VERBOSE
|
||||
if (!itsOK) {
|
||||
G4cout << " G4ParticleChangeForLoss::CheckIt " <<G4endl;
|
||||
if (!itsOK) {
|
||||
G4cout << "G4ParticleChangeForLoss::CheckIt " << G4endl;
|
||||
DumpInfo();
|
||||
}
|
||||
#endif
|
||||
@@ -196,21 +223,9 @@ G4bool G4ParticleChangeForLoss::CheckIt(const G4Track& aTrack)
|
||||
|
||||
//correction
|
||||
if (!itsOK) {
|
||||
theEnergyChange = aTrack.GetKineticEnergy();
|
||||
kinEnergy = aTrack.GetKineticEnergy();
|
||||
}
|
||||
|
||||
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
|
||||
return itsOK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForMSC.cc,v 1.10 2003/06/19 14:45:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// $Id: G4ParticleChangeForMSC.cc,v 1.11 2004/01/20 15:29:41 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -32,12 +32,12 @@
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
// Update for model variant of msc 16 Jan 2004 V.Ivanchenko
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4ParticleChangeForMSC.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4TrackFastVector.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ExceptionSeverity.hh"
|
||||
|
||||
@@ -50,7 +50,7 @@ G4ParticleChangeForMSC::G4ParticleChangeForMSC():G4VParticleChange()
|
||||
#endif
|
||||
}
|
||||
|
||||
G4ParticleChangeForMSC::~G4ParticleChangeForMSC()
|
||||
G4ParticleChangeForMSC::~G4ParticleChangeForMSC()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
@@ -65,9 +65,8 @@ G4ParticleChangeForMSC::G4ParticleChangeForMSC(
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForMSC:: copy constructor is called " << G4endl;
|
||||
}
|
||||
theMomentumDirectionChange = right.theMomentumDirectionChange;
|
||||
thePositionChange = right.thePositionChange;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
theMomentumDirection = right.theMomentumDirection;
|
||||
thePosition = right.thePosition;
|
||||
}
|
||||
|
||||
// assignment operator
|
||||
@@ -78,86 +77,51 @@ G4ParticleChangeForMSC & G4ParticleChangeForMSC::operator=(
|
||||
G4cout << "G4ParticleChangeForMSC:: assignment operator is called " << G4endl;
|
||||
}
|
||||
if (this != &right)
|
||||
{
|
||||
{
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
|
||||
|
||||
theMomentumDirectionChange = right.theMomentumDirectionChange;
|
||||
thePositionChange = right.thePositionChange;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
|
||||
theMomentumDirection = right.theMomentumDirection;
|
||||
thePosition = right.thePosition;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// functions for Initialization
|
||||
//
|
||||
|
||||
void G4ParticleChangeForMSC::Initialize(const G4Track& track)
|
||||
{
|
||||
// use base class's method at first
|
||||
G4VParticleChange::Initialize(track);
|
||||
|
||||
// set Energy/Momentum etc. equal to those of the parent particle
|
||||
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
|
||||
theMomentumDirectionChange = pParticle->GetMomentumDirection();
|
||||
|
||||
// set Position equal to those of the parent track
|
||||
thePositionChange = track.GetPosition();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for updating G4Step
|
||||
// methods for updating G4Step
|
||||
//
|
||||
|
||||
G4Step* G4ParticleChangeForMSC::UpdateStepForAlongStep(G4Step* pStep)
|
||||
{
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
pStep->SetStepLength(theTrueStepLength) ;
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
pStep->SetStepLength(theTrueStepLength);
|
||||
theStatusChange = pStep->GetTrack()->GetTrackStatus();
|
||||
return pStep;
|
||||
}
|
||||
|
||||
G4Step* G4ParticleChangeForMSC::UpdateStepForPostStep(G4Step* pStep)
|
||||
{
|
||||
{
|
||||
// A physics process always calculates the final state of the particle
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
|
||||
// Take note that the return type of GetMomentumChange is a
|
||||
// pointer to G4ParticleMometum. Also it is a normalized
|
||||
// momentum vector.
|
||||
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
G4Track* aTrack = pStep->GetTrack();
|
||||
|
||||
// update momentum direction
|
||||
pPostStepPoint->SetMomentumDirection(theMomentumDirectionChange);
|
||||
pPostStepPoint->SetMomentumDirection(theMomentumDirection);
|
||||
|
||||
// update position
|
||||
pPostStepPoint->SetPosition( thePositionChange );
|
||||
// update position
|
||||
pPostStepPoint->SetPosition( thePosition );
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (debugFlag) CheckIt(*aTrack);
|
||||
#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
// Update the G4Step specific attributes
|
||||
return pStep;
|
||||
}
|
||||
|
||||
G4Step* G4ParticleChangeForMSC::UpdateStepForAtRest(G4Step* pStep)
|
||||
{
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for printing messages
|
||||
// methods for printing messages
|
||||
//
|
||||
|
||||
void G4ParticleChangeForMSC::DumpInfo() const
|
||||
@@ -166,23 +130,23 @@ void G4ParticleChangeForMSC::DumpInfo() const
|
||||
G4VParticleChange::DumpInfo();
|
||||
|
||||
G4cout.precision(3);
|
||||
G4cout << " Position - x (mm) : "
|
||||
<< std::setw(20) << thePositionChange.x()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Position - y (mm) : "
|
||||
<< std::setw(20) << thePositionChange.y()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Position - z (mm) : "
|
||||
<< std::setw(20) << thePositionChange.z()/mm
|
||||
G4cout << " Position - x (mm) : "
|
||||
<< std::setw(20) << thePosition.x()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direction - x : "
|
||||
<< std::setw(20) << theMomentumDirectionChange.x()
|
||||
G4cout << " Position - y (mm) : "
|
||||
<< std::setw(20) << thePosition.y()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direction - y : "
|
||||
<< std::setw(20) << theMomentumDirectionChange.y()
|
||||
G4cout << " Position - z (mm) : "
|
||||
<< std::setw(20) << thePosition.z()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direction - z : "
|
||||
<< std::setw(20) << theMomentumDirectionChange.z()
|
||||
G4cout << " Momentum Direct - x : "
|
||||
<< std::setw(20) << theMomentumDirection.x()
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - y : "
|
||||
<< std::setw(20) << theMomentumDirection.y()
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - z : "
|
||||
<< std::setw(20) << theMomentumDirection.z()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
@@ -194,10 +158,10 @@ G4bool G4ParticleChangeForMSC::CheckIt(const G4Track& aTrack)
|
||||
|
||||
G4double accuracy;
|
||||
|
||||
// check
|
||||
// check
|
||||
|
||||
// MomentumDirection should be unit vector
|
||||
accuracy = abs(theMomentumDirectionChange.mag2()-1.0);
|
||||
accuracy = abs(theMomentumDirection.mag2()-1.0);
|
||||
if (accuracy > accuracyForWarning) {
|
||||
#ifdef G4VERBOSE
|
||||
G4cout << " G4ParticleChangeForMSC::CheckIt : ";
|
||||
@@ -210,7 +174,7 @@ G4bool G4ParticleChangeForMSC::CheckIt(const G4Track& aTrack)
|
||||
|
||||
// dump out information of this particle change
|
||||
#ifdef G4VERBOSE
|
||||
if (!itsOK) {
|
||||
if (!itsOK) {
|
||||
G4cout << " G4ParticleChangeForMSC::CheckIt " <<G4endl;
|
||||
DumpInfo();
|
||||
}
|
||||
@@ -225,11 +189,10 @@ G4bool G4ParticleChangeForMSC::CheckIt(const G4Track& aTrack)
|
||||
}
|
||||
//correction
|
||||
if (!itsOK) {
|
||||
G4double vmag = theMomentumDirectionChange.mag();
|
||||
theMomentumDirectionChange = (1./vmag)*theMomentumDirectionChange;
|
||||
G4double vmag = theMomentumDirection.mag();
|
||||
theMomentumDirection = (1./vmag)*theMomentumDirection;
|
||||
}
|
||||
|
||||
|
||||
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
|
||||
return itsOK;
|
||||
}
|
||||
|
||||
@@ -21,18 +21,19 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForTransport.cc,v 1.15 2003/06/16 17:13:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// $Id: G4ParticleChangeForTransport.cc,v 1.16 2004/01/20 15:29:41 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 10 May. 1998 H.Kurahige
|
||||
// Correct tratment of fpNextTouchable 12 May. 1998 H.Kurashige
|
||||
// Change to the next volume only if energy>0 19 Jan. 2004 V.Ivanchenko
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4ParticleChangeForTransport.hh"
|
||||
@@ -93,17 +94,17 @@ G4ParticleChangeForTransport & G4ParticleChangeForTransport::operator=(const G4P
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for updating G4Step
|
||||
// methods for updating G4Step
|
||||
//
|
||||
|
||||
G4Step* G4ParticleChangeForTransport::UpdateStepForAtRest(G4Step* pStep)
|
||||
{
|
||||
{
|
||||
// Nothing happens for AtRestDoIt
|
||||
if (verboseLevel>0) {
|
||||
G4cout << "G4ParticleChangeForTransport::UpdateStepForAtRest() is called" << G4endl;
|
||||
G4cout << " Nothing happens for this method " << G4endl;
|
||||
G4cout << "G4ParticleChangeForTransport::UpdateStepForAtRest() is called" << G4endl;
|
||||
G4cout << " Nothing happens for this method " << G4endl;
|
||||
}
|
||||
// Update the G4Step specific attributes
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
}
|
||||
|
||||
@@ -120,39 +121,39 @@ G4Step* G4ParticleChangeForTransport::UpdateStepForAlongStep(G4Step* pStep)
|
||||
// A physics process always calculates the final state of the
|
||||
// particle relative to the initial state at the beginning
|
||||
// of the Step, i.e., based on information of G4Track (or
|
||||
// equivalently the PreStepPoint).
|
||||
// equivalently the PreStepPoint).
|
||||
// So, the differences (delta) between these two states have to be
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
// Take note that the return type of GetMomentumChange is a
|
||||
// pointer to G4ThreeVector. Also it is a normalized
|
||||
// pointer to G4ThreeVector. Also it is a normalized
|
||||
// momentum vector.
|
||||
|
||||
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
G4Track* aTrack = pStep->GetTrack();
|
||||
G4double mass = aTrack->GetDynamicParticle()->GetMass();
|
||||
|
||||
|
||||
// uodate kinetic energy
|
||||
// now assume that no energy change in transportation
|
||||
// However it is not true in electric fields
|
||||
// Case for changing energy will be implemented in future
|
||||
|
||||
|
||||
|
||||
// update momentum direction and energy
|
||||
if (isMomentumChanged) {
|
||||
G4double energy;
|
||||
energy= pPostStepPoint->GetKineticEnergy()
|
||||
+ (theEnergyChange - pPreStepPoint->GetKineticEnergy());
|
||||
energy= pPostStepPoint->GetKineticEnergy()
|
||||
+ (theEnergyChange - pPreStepPoint->GetKineticEnergy());
|
||||
|
||||
// calculate new momentum
|
||||
G4ThreeVector pMomentum = pPostStepPoint->GetMomentum()
|
||||
G4ThreeVector pMomentum = pPostStepPoint->GetMomentum()
|
||||
+ ( CalcMomentum(theEnergyChange, theMomentumDirectionChange, mass)
|
||||
- pPreStepPoint->GetMomentum());
|
||||
G4double tMomentum = pMomentum.mag();
|
||||
G4ThreeVector direction(1.0,0.0,0.0);
|
||||
G4ThreeVector direction(1.0,0.0,0.0);
|
||||
if( tMomentum > 0. ){
|
||||
G4double inv_Momentum= 1.0 / tMomentum;
|
||||
G4double inv_Momentum= 1.0 / tMomentum;
|
||||
direction= pMomentum * inv_Momentum;
|
||||
}
|
||||
pPostStepPoint->SetMomentumDirection(direction);
|
||||
@@ -166,22 +167,22 @@ G4Step* G4ParticleChangeForTransport::UpdateStepForAlongStep(G4Step* pStep)
|
||||
// update polarization
|
||||
pPostStepPoint->AddPolarization( thePolarizationChange
|
||||
- pPreStepPoint->GetPolarization());
|
||||
|
||||
|
||||
// update position and time
|
||||
pPostStepPoint->AddPosition( thePositionChange
|
||||
pPostStepPoint->AddPosition( thePositionChange
|
||||
- pPreStepPoint->GetPosition() );
|
||||
pPostStepPoint->AddGlobalTime( theTimeChange
|
||||
- pPreStepPoint->GetGlobalTime());
|
||||
pPostStepPoint->AddLocalTime( theTimeChange
|
||||
- pPreStepPoint->GetGlobalTime());
|
||||
pPostStepPoint->AddProperTime( theProperTimeChange
|
||||
pPostStepPoint->AddLocalTime( theTimeChange
|
||||
- pPreStepPoint->GetGlobalTime());
|
||||
pPostStepPoint->AddProperTime( theProperTimeChange
|
||||
- pPreStepPoint->GetProperTime());
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (debugFlag) CheckIt(*aTrack);
|
||||
#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
// Update the G4Step specific attributes
|
||||
//pStep->SetStepLength( theTrueStepLength );
|
||||
// pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
|
||||
pStep->SetControlFlag( theSteppingControlFlag );
|
||||
@@ -190,31 +191,33 @@ G4Step* G4ParticleChangeForTransport::UpdateStepForAlongStep(G4Step* pStep)
|
||||
}
|
||||
|
||||
G4Step* G4ParticleChangeForTransport::UpdateStepForPostStep(G4Step* pStep)
|
||||
{
|
||||
{
|
||||
// A physics process always calculates the final state of the particle
|
||||
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
// Change volume if any kinetic energy remanes
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
if(pPostStepPoint->GetKineticEnergy() > 0.0) {
|
||||
|
||||
// update next touchable
|
||||
// (touchable can be changed only at PostStepDoIt)
|
||||
pPostStepPoint->SetTouchableHandle( theTouchableHandle );
|
||||
// update next touchable
|
||||
// (touchable can be changed only at PostStepDoIt)
|
||||
pPostStepPoint->SetTouchableHandle( theTouchableHandle );
|
||||
|
||||
pPostStepPoint->SetMaterial( theMaterialChange );
|
||||
pPostStepPoint->SetMaterialCutsCouple( theMaterialCutsCoupleChange );
|
||||
|
||||
// It used to call base class's method
|
||||
pPostStepPoint->SetMaterial( theMaterialChange );
|
||||
pPostStepPoint->SetMaterialCutsCouple( theMaterialCutsCoupleChange );
|
||||
}
|
||||
// It used to call base class's method
|
||||
// - but this would copy uninitialised data members
|
||||
// return G4ParticleChange::UpdateStepForPostStep(pStep);
|
||||
|
||||
// Copying what the base class does would instead
|
||||
// Copying what the base class does would instead
|
||||
// - also not useful
|
||||
// return G4VParticleChange::UpdateStepInfo(pStep);
|
||||
|
||||
return pStep;
|
||||
return pStep;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for printing messages
|
||||
// methods for printing messages
|
||||
//
|
||||
|
||||
void G4ParticleChangeForTransport::DumpInfo() const
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Step.cc,v 1.5 2001/07/11 10:08:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4StepPoint.cc,v 1.9 2002/12/16 11:59:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Track.cc,v 1.19 2003/05/20 22:24:41 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VParticleChange.cc,v 1.15 2003/06/19 14:45:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
// $Id: G4VParticleChange.cc,v 1.16 2003/12/12 13:12:14 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -325,12 +325,12 @@ G4bool G4VParticleChange::CheckSecondary(G4Track& aTrack)
|
||||
}
|
||||
|
||||
|
||||
const G4double G4VParticleChange::GetAccuracyForWarning() const
|
||||
G4double G4VParticleChange::GetAccuracyForWarning() const
|
||||
{
|
||||
return accuracyForWarning;
|
||||
}
|
||||
|
||||
const G4double G4VParticleChange::GetAccuracyForException() const
|
||||
G4double G4VParticleChange::GetAccuracyForException() const
|
||||
{
|
||||
return accuracyForException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user