Import Geant4 0.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:09:25 +02:00
parent b97f8d0df7
commit aaa409b6ee
2922 changed files with 55107 additions and 81674 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 2.1 1998/08/22 01:33:47 gcosmo Exp $
# $Id: GNUmakefile,v 1.1 1999/01/07 16:14:19 gunter Exp $
# ----------------------------------------------------------
# GNUmakefile for track library. Gabriele Cosmo, 3/4/1997.
# ----------------------------------------------------------
+25 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 2.13 1998/12/15 13:45:31 kurasige Exp $
$Id: History,v 1.9 1999/05/06 11:42:48 kurasige Exp $
-------------------------------------------------------------------
=========================================================
@@ -16,6 +16,30 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 6, 1999 H.Kurashige (track-01-00-06)
- Modified CheckIt methods of G4VParticleChange and derived classes
Apr 28, 1999 H.Kurashige (track-01-00-05b)
- Protect proton mass against glanular libraly for G4Mars5Gev...(Makoto)
- Fixed error messages in G4ParticleChange::CheckIt (Hisaya)
- Remove "include/G4VProcess.hh" from G4Step.cc (Hisaya)
Apr 13, 1999 H.Kurashige (track-01-00-04)
- Code polishing according to the messages by CodeWizard
- Added new virtual method of G4bool CheckIt(const G4Track&) in G4VParticleChange
Feb 17, 1999 H.Kurashige (track-01-00-03)
- Removed G4Step::ShowStep() (Takashi)
- Fixed bugs in G4ParticleChange.icc (Hisaya)
Feb 9, 1999 H.Kurashige (track-01-00-02)
- Modified G4TrackFastVector (Hisaya)
- Modified G4ParticleChange::CheckIt (Hisaya)
Feb 6, 1999 H.Kurashige (track-01-00-01)
- Added Get/SetMomentumDirectionChange in G4ParticleChange (Hisaya)
- Removed using G4ParticleMomentum (Hisaya)
December 15, 1998 H.Kurashige (track-00-04-05)
- G4ParticleChange::CheckIt is activated in VERBOSE mode (Hisaya)
+21 -9
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EvtBiasMechanism.hh,v 2.2 1998/11/18 11:06:26 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4EvtBiasMechanism.hh,v 1.2 1999/04/13 09:43:20 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -17,6 +17,11 @@
//
// ------------------------------------------------------------
// 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,
// ApplyMath methods multiply all secondaries in particle change
// by factor of MultiplicationForSecondaries with their weights of
// (parent weight)/(MultiplicationForSecondaries)
#ifndef G4EvtBiasMechanism_h
#define G4EvtBiasMechanism_h 1
@@ -34,28 +39,35 @@ class G4EvtBiasMechanism :public G4VEvtBiasMechanism
G4EvtBiasMechanism(const G4String& name = "EBSample", G4int mulFactor=10);
G4EvtBiasMechanism(const G4EvtBiasMechanism&);
~G4EvtBiasMechanism();
virtual ~G4EvtBiasMechanism();
virtual G4VParticleChange* ApplyMath( G4VParticleChange*, const G4Step& );
virtual G4bool IsApplicable(G4ParticleDefinition*) const;
// Set/Get particle type to be biased
void SetParticleBiased( G4ParticleDefinition* );
const G4ParticleDefinition* GetParticleBiased( ) const;
void SetParticleBiased( G4ParticleDefinition* );
G4ParticleDefinition* GetParticleBiased( ) const;
virtual G4bool IsApplicable(G4ParticleDefinition*) const;
private:
G4ParticleDefinition* particleToBeBiased;
const G4int MultiplicationForSecondaries;
};
inline G4bool G4EvtBiasMechanism::IsApplicable(G4ParticleDefinition* particle) const
inline
G4bool G4EvtBiasMechanism::IsApplicable(G4ParticleDefinition* particle) const
{
return (particle == particleToBeBiased);
}
inline void G4EvtBiasMechanism::SetParticleBiased(G4ParticleDefinition* particle)
inline
void G4EvtBiasMechanism::SetParticleBiased(G4ParticleDefinition* particle)
{
particleToBeBiased = particle;
}
inline G4ParticleDefinition* G4EvtBiasMechanism::GetParticleBiased() const
inline
const G4ParticleDefinition* G4EvtBiasMechanism::GetParticleBiased() const
{
return particleToBeBiased;
}
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ForceCondition.hh,v 2.1 1998/07/12 03:08:43 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ForceCondition.hh,v 1.1 1999/01/07 16:14:20 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GPILSelection.hh,v 2.1 1998/07/12 03:08:43 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4GPILSelection.hh,v 1.1 1999/01/07 16:14:20 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
+6 -6
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Mars5GeVMechanism.hh,v 2.3 1998/12/11 20:52:56 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Mars5GeVMechanism.hh,v 1.2 1999/04/13 09:43:21 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -61,7 +61,7 @@ class G4Mars5GeVMechanism :public G4VEvtBiasMechanism
G4Mars5GeVMechanism(const G4String& name = "MARS5GeV");
G4Mars5GeVMechanism(const G4Mars5GeVMechanism&);
~G4Mars5GeVMechanism();
virtual ~G4Mars5GeVMechanism();
virtual G4VParticleChange* ApplyMath( G4VParticleChange*, const G4Step& );
virtual G4bool IsApplicable(G4ParticleDefinition*) const;
@@ -121,7 +121,7 @@ class G4Mars5GeVMechanism :public G4VEvtBiasMechanism
MarsMUplus, MarsMUminus, MarsGAM, MarsEminus, MarsEplus, MarsAP,
MarsPI0, MarsD, MarsT, MarsHe3, MarsHe4 };
G4int GetMarsEncoding(G4ParticleDefinition* )const;
G4int GetMarsEncoding(const G4ParticleDefinition* )const;
const G4String& GetParticleName(G4int marsEncoding) const;
G4ParticleDefinition* GetParticleDefinition(G4int marsEncoding) const;
@@ -161,7 +161,7 @@ class G4Mars5GeVMechanism :public G4VEvtBiasMechanism
#include "G4ParticleTable.hh"
inline
G4int G4Mars5GeVMechanism::GetMarsEncoding(G4ParticleDefinition* particle) const{
G4int G4Mars5GeVMechanism::GetMarsEncoding(const G4ParticleDefinition* particle) const{
const G4String& name = particle->GetParticleName();
G4int encoding = MarsUndefined;
if (name == "proton") {
@@ -270,7 +270,7 @@ inline
G4ParticleDefinition* G4Mars5GeVMechanism::GetParticleDefinition(G4int encoding) const
{
G4String name = GetParticleName(encoding);
G4ParticleDefinition* particle = NULL;
G4ParticleDefinition* particle = 0;
if (name != "None") {
particle = theParticleTable->FindParticle(name);
}
+12 -9
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChange.hh,v 2.6 1998/12/11 22:18:58 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChange.hh,v 1.3 1999/04/13 09:43:22 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -37,6 +37,7 @@
// 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
// -------------------------------------------------------------
#ifndef G4ParticleChange_h
#define G4ParticleChange_h 1
@@ -44,7 +45,7 @@
#include "globals.hh"
#include "G4ios.hh"
#include "G4ThreeVector.hh"
#include "G4ParticleMomentum.hh"
#include "G4ThreeVector.hh"
class G4DynamicParticle;
#include "G4VParticleChange.hh"
@@ -105,10 +106,13 @@ class G4ParticleChange: public G4VParticleChange
// "Change", what it stores (and returns in get) are the "FINAL"
// values of the Position, Momentum, etc.
const G4ParticleMomentum* GetMomentumChange() const;
const G4ThreeVector* GetMomentumDirectionChange() const;
void SetMomentumDirectionChange(G4double Px, G4double Py, G4double Pz);
void SetMomentumDirectionChange(const G4ThreeVector& Pfinal);
const G4ThreeVector* GetMomentumChange() const;
void SetMomentumChange(G4double Px, G4double Py, G4double Pz);
void SetMomentumChange(const G4ThreeVector& Pfinal);
// Get/Set theMomentumChange vector: it is the final momentum direction.
// Get/Set theMomentumDirectionChange vector: it is the final momentum direction.
const G4ThreeVector* GetPolarizationChange() const;
void SetPolarizationChange(G4double Px, G4double Py, G4double Pz);
@@ -145,7 +149,7 @@ class G4ParticleChange: public G4VParticleChange
// Convert the time delay to the global time.
G4ThreeVector CalcMomentum(G4double energy,
G4ParticleMomentum direction,
G4ThreeVector direction,
G4double mass ) const;
// Calculate momentum by using Energy, Momentum Direction, and Mass
// ----------------------------------------------------
@@ -178,7 +182,7 @@ class G4ParticleChange: public G4VParticleChange
virtual void DumpInfo() const;
protected:
G4ParticleMomentum theMomentumChange;
G4ThreeVector theMomentumDirectionChange;
// 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.
@@ -213,8 +217,7 @@ class G4ParticleChange: public G4VParticleChange
public:
// for Debug
G4bool debugFlag;
G4bool CheckIt(const G4Track&);
virtual G4bool CheckIt(const G4Track&);
};
#include "G4ParticleChange.icc"
+32 -9
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChange.icc,v 2.2 1998/12/11 20:52:59 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChange.icc,v 1.3 1999/02/18 04:11:59 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
inline
@@ -30,9 +30,9 @@ inline
}
inline
const G4ParticleMomentum* G4ParticleChange::GetMomentumChange() const
const G4ThreeVector* G4ParticleChange::GetMomentumChange() const
{
return &theMomentumChange;
return &theMomentumDirectionChange;
}
inline
@@ -41,15 +41,38 @@ inline
G4double Py,
G4double Pz )
{
theMomentumChange.setX(Px);
theMomentumChange.setY(Py);
theMomentumChange.setZ(Pz);
theMomentumDirectionChange.setX(Px);
theMomentumDirectionChange.setY(Py);
theMomentumDirectionChange.setZ(Pz);
}
inline
void G4ParticleChange::SetMomentumChange(const G4ThreeVector& P)
{
theMomentumChange = P;
theMomentumDirectionChange = P;
}
inline
const G4ThreeVector* G4ParticleChange::GetMomentumDirectionChange() const
{
return &theMomentumDirectionChange;
}
inline
void G4ParticleChange::SetMomentumDirectionChange(
G4double Px,
G4double Py,
G4double Pz )
{
theMomentumDirectionChange.setX(Px);
theMomentumDirectionChange.setY(Py);
theMomentumDirectionChange.setZ(Pz);
}
inline
void G4ParticleChange::SetMomentumDirectionChange(const G4ThreeVector& P)
{
theMomentumDirectionChange = P;
}
inline
@@ -148,7 +171,7 @@ inline
inline
G4ThreeVector G4ParticleChange::CalcMomentum(G4double energy,
G4ParticleMomentum direction,
G4ThreeVector direction,
G4double mass
) const
{
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForDecay.hh,v 2.2 1998/07/13 17:28:32 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChangeForDecay.hh,v 1.3 1999/04/13 09:43:23 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -30,7 +30,6 @@
#include "globals.hh"
#include "G4ios.hh"
#include "G4ThreeVector.hh"
#include "G4ParticleMomentum.hh"
class G4DynamicParticle;
#include "G4VParticleChange.hh"
@@ -60,7 +59,7 @@ class G4ParticleChangeForDecay: public G4VParticleChange
// by using final state information of the track given by a physics
// process
// !!! No effect for AlongStep
// !!! No effect for AlongSteyp
// virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
@@ -79,7 +78,10 @@ class G4ParticleChangeForDecay: public G4VParticleChange
protected:
G4double theTimeChange;
// The change of global time of a given particle.
public:
// for Debug
virtual G4bool CheckIt(const G4Track&);
};
inline
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForLoss.hh,v 2.1 1998/12/02 17:19:26 urban Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChangeForLoss.hh,v 1.2 1999/04/13 09:43:24 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -70,8 +70,7 @@ class G4ParticleChangeForLoss: public G4VParticleChange
public:
// for Debug
G4bool debugFlag;
G4bool CheckIt(const G4Track&);
virtual G4bool CheckIt(const G4Track&);
};
inline
+16 -6
View File
@@ -5,7 +5,7 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForMSC.hh,v 2.1 1998/12/02 17:19:24 urban Exp $
// $Id: G4ParticleChangeForMSC.hh,v 1.3 1999/04/13 09:43:25 kurasige Exp $
// GEANT4 tag $ $
//
//
@@ -17,6 +17,7 @@
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
// Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
//
// -------------------------------------------------------------
#ifndef G4ParticleChangeForMSC_h
@@ -25,7 +26,7 @@
#include "globals.hh"
#include "G4ios.hh"
#include "G4ThreeVector.hh"
#include "G4ParticleMomentum.hh"
#include "G4ThreeVector.hh"
class G4DynamicParticle;
#include "G4VParticleChange.hh"
@@ -66,10 +67,13 @@ class G4ParticleChangeForMSC: public G4VParticleChange
// "Change", what it stores (and returns in get) are the "FINAL"
// values of the Position, Momentum, etc.
const G4ParticleMomentum* GetMomentumChange() const;
const G4ThreeVector* GetMomentumChange() const;
void SetMomentumChange(G4double Px, G4double Py, G4double Pz);
void SetMomentumChange(const G4ThreeVector& Pfinal);
// Get/Set theMomentumChange vector: it is the final momentum direction.
const G4ThreeVector* GetMomentumDirectionChange() const;
void SetMomentumDirectionChange(G4double Px, G4double Py, G4double Pz);
void SetMomentumDirectionChange(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);
@@ -80,7 +84,7 @@ class G4ParticleChangeForMSC: public G4VParticleChange
virtual void DumpInfo() const;
protected:
G4ParticleMomentum theMomentumChange;
G4ThreeVector theMomentumDirectionChange;
// 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.
@@ -89,7 +93,11 @@ class G4ParticleChangeForMSC: public G4VParticleChange
G4ThreeVector thePositionChange;
// The changed (final) position of a given particle.
public:
// for Debug
virtual G4bool CheckIt(const G4Track&);
};
#include "G4ParticleChangeForMSC.icc"
@@ -97,3 +105,5 @@ class G4ParticleChangeForMSC: public G4VParticleChange
#endif
@@ -5,15 +5,15 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForMSC.icc,v 2.1 1998/12/02 17:19:25 urban Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChangeForMSC.icc,v 1.2 1999/02/06 10:44:36 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
inline
const G4ParticleMomentum* G4ParticleChangeForMSC::GetMomentumChange() const
const G4ThreeVector* G4ParticleChangeForMSC::GetMomentumChange() const
{
return &theMomentumChange;
return &theMomentumDirectionChange;
}
inline
@@ -22,15 +22,37 @@ inline
G4double Py,
G4double Pz )
{
theMomentumChange.setX(Px);
theMomentumChange.setY(Py);
theMomentumChange.setZ(Pz);
theMomentumDirectionChange.setX(Px);
theMomentumDirectionChange.setY(Py);
theMomentumDirectionChange.setZ(Pz);
}
inline
void G4ParticleChangeForMSC::SetMomentumChange(const G4ThreeVector& P)
{
theMomentumChange = P;
theMomentumDirectionChange = P;
}
inline
const G4ThreeVector* G4ParticleChangeForMSC::GetMomentumDirectionChange() const
{
return &theMomentumDirectionChange;
}
inline
void G4ParticleChangeForMSC::SetMomentumDirectionChange(
G4double Px,
G4double Py,
G4double Pz )
{
theMomentumDirectionChange.setX(Px);
theMomentumDirectionChange.setY(Py);
theMomentumDirectionChange.setZ(Pz);
}
inline
void G4ParticleChangeForMSC::SetMomentumDirectionChange(const G4ThreeVector& P)
{
theMomentumDirectionChange = P;
}
inline
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForTransport.hh,v 2.3 1998/07/13 17:28:33 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChangeForTransport.hh,v 1.1 1999/01/07 16:14:22 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForTransport.icc,v 2.1 1998/07/10 11:11:51 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChangeForTransport.icc,v 1.1 1999/01/07 16:14:22 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
+5 -4
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Step.hh,v 2.4 1998/11/18 11:06:30 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Step.hh,v 1.3 1999/04/13 09:43:26 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
@@ -96,7 +96,8 @@ class G4Step
void CopyPostToPreStepPoint( );
void ShowStep() const ;
//TS moved to SteppingVerbose
// void ShowStep() const ;
// Print all information of the Step to stdout
G4Polyline* CreatePolyline () const;
@@ -227,7 +228,7 @@ class G4Step
fpPreStepPoint->SetPolarization(fpTrack->GetPolarization());
fpPreStepPoint->SetSafety(0.);
fpPreStepPoint->SetStepStatus(fUndefined);
fpPreStepPoint->SetProcessDefinedStep(NULL);
fpPreStepPoint->SetProcessDefinedStep(0);
fpPreStepPoint->SetMass(fpTrack->GetDynamicParticle()->GetMass());
fpPreStepPoint->SetWeight(fpTrack->GetWeight());
+3 -3
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StepPoint.hh,v 2.4 1998/11/18 11:06:32 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4StepPoint.hh,v 1.2 1999/04/13 09:43:27 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
@@ -160,7 +160,7 @@ class G4StepPoint
inline const G4VProcess* GetProcessDefinedStep() const
{ return fpProcessDefinedStep; }
// If the pointer is NULL, this means the Step is defined
// If the pointer is 0, this means the Step is defined
// by the user defined limit in the current volume.
inline void SetProcessDefinedStep(G4VProcess* aValue)
{ fpProcessDefinedStep = aValue; }
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StepStatus.hh,v 2.1 1998/07/12 03:08:48 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4StepStatus.hh,v 1.1 1999/01/07 16:14:23 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SteppingControl.hh,v 2.1 1998/07/12 03:08:49 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4SteppingControl.hh,v 1.1 1999/01/07 16:14:23 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
+14 -8
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Track.hh,v 2.4 1998/11/18 11:06:34 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Track.hh,v 1.2 1999/04/13 09:43:28 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
@@ -138,7 +138,7 @@ class G4Track
G4ThreeVector GetMomentum() const;
const G4DynamicParticle* GetDynamicParticle() const;
G4DynamicParticle* GetDynamicParticle() const;
G4ParticleDefinition* GetDefinition() const;
@@ -319,9 +319,9 @@ class G4Track
{
G4Material*
mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial();
if(mat->GetMaterialPropertiesTable() != NULL)
if(mat->GetMaterialPropertiesTable() != 0)
{
if(mat->GetMaterialPropertiesTable()->GetProperty("RINDEX") != NULL )
if(mat->GetMaterialPropertiesTable()->GetProperty("RINDEX") != 0 )
velocity /=
mat->GetMaterialPropertiesTable()->GetProperty("RINDEX")->
GetMinProperty() ;
@@ -367,7 +367,7 @@ class G4Track
inline G4ThreeVector G4Track::GetMomentum() const
{ return fpDynamicParticle->GetMomentum(); }
inline const G4DynamicParticle* G4Track::GetDynamicParticle() const
inline G4DynamicParticle* G4Track::GetDynamicParticle() const
{ return fpDynamicParticle; }
inline G4ParticleDefinition* G4Track::GetDefinition() const
@@ -400,9 +400,9 @@ class G4Track
inline const G4VProcess* G4Track::GetCreatorProcess() const
{ return fpCreatorProcess; }
// If the pointer is NULL, this means the track is created
// If the pointer is 0, this means the track is created
// by the event generator, i.e. the primary track.If it is not
// NULL, it points to the process which created this track.
// 0, it points to the process which created this track.
inline void G4Track::SetCreatorProcess(G4VProcess* aValue)
{ fpCreatorProcess = aValue; }
@@ -447,3 +447,9 @@ class G4Track
+3 -8
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TrackFastVector.hh,v 2.1 1998/07/13 17:28:35 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4TrackFastVector.hh,v 1.2 1999/02/09 14:19:17 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -21,16 +21,11 @@
#ifndef G4TrackFastVector_h
#define G4TrackFastVector_h 1
#include "globals.hh"
#include "G4ios.hh"
class G4Track;
#include "G4FastVector.hh"
const G4int G4TrackFastVectorSize = 512;
class G4TrackFastVector:
public G4FastVector<G4Track,G4TrackFastVectorSize>
{};
typedef G4FastVector<G4Track,G4TrackFastVectorSize> G4TrackFastVector;
// Contains pointers to G4Track objects which are
// generated by either primary or secondary interaction.
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TrackStatus.hh,v 2.0 1998/07/02 17:28:38 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4TrackStatus.hh,v 1.1 1999/01/07 16:14:24 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
+21 -9
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VEvtBiasMechanism.hh,v 2.3 1998/11/18 11:06:35 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VEvtBiasMechanism.hh,v 1.2 1999/04/13 09:43:29 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -32,17 +32,29 @@ class G4ParticleDefinition;
class G4VEvtBiasMechanism
{
public:
G4VEvtBiasMechanism(const G4String& name = ""){ theEBName = name;}
G4VEvtBiasMechanism(const G4VEvtBiasMechanism& right){ theEBName = right.theEBName;}
G4VEvtBiasMechanism(const G4String& name = "");
G4VEvtBiasMechanism(const G4VEvtBiasMechanism& right);
virtual ~G4VEvtBiasMechanism(){};
virtual ~G4VEvtBiasMechanism();
virtual G4VParticleChange* ApplyMath( G4VParticleChange*, const G4Step& ) =0;
virtual G4bool IsApplicable(G4ParticleDefinition*) const = 0;
// pure virtual functions
G4String GetName(){ return theEBName;}
G4int GetVerboseLevel() { return verboseLevel; }
// ApplyMath method will be invoked in G4VParticleChange::UpdateStepInfo()
// if G4VParticleChange::fUseEB is set
virtual G4VParticleChange* ApplyMath( G4VParticleChange*, const G4Step& ) =0;
// IsApplicable method returns 'true' if this Event Bias Mechanism is
// valid for the particle type
virtual G4bool IsApplicable(G4ParticleDefinition*) const = 0;
//
const G4String& GetName(){ return theEBName;}
// Set/Get Verbose level
G4int GetVerboseLevel() const { return verboseLevel; }
void SetVerboseLevel(G4int value) { verboseLevel = value; }
private:
G4String theEBName;
+26 -10
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VParticleChange.hh,v 2.5 1998/12/11 20:53:00 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VParticleChange.hh,v 1.3 1999/05/06 11:42:52 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -48,8 +48,8 @@
//
// ------------------------------------------------------------
// Implement Event Biasing Scheme 9 Nov.,98 H.Kurashige
// add CheckIt 13 Apr.,99 H.Kurashige
// add accuracy leveles 5 May, 99 H.Kurashige
#ifndef G4VParticleChange_h
#define G4VParticleChange_h 1
@@ -79,6 +79,11 @@ class G4VParticleChange
G4bool operator==(const G4VParticleChange &right) const;
G4bool operator!=(const G4VParticleChange &right) const;
// "equal" means that teo objects have the same pointer.
protected:
// hide copy constructor and assignment operaor as protected
G4VParticleChange(const G4VParticleChange &right);
G4VParticleChange & operator=(const G4VParticleChange &right);
public:
// --- the following methods are for updating G4Step -----
@@ -197,11 +202,22 @@ class G4VParticleChange
G4int verboseLevel;
// The Verbose level
protected:
// hide copy constructor and assignment operaor as protected
G4VParticleChange(const G4VParticleChange &right);
G4VParticleChange & operator=(const G4VParticleChange &right);
public:
// CheckIt method is provided for debug
virtual G4bool CheckIt(const G4Track&);
// CheckIt method is activated
// if debug flag is set and 'G4VERBOSE' is defined
void ClearDebugFlag();
void SetDebugFlag();
G4bool GetDebugFlag() const;
protected:
G4bool debugFlag;
// accuracy levels
static const G4double accuracyForWarning;
static const G4double accuracyForException;
//---- following methods and members are used for Event Biasing
public:
@@ -209,7 +225,7 @@ class G4VParticleChange
virtual void SwOnEB();
virtual void SwOffEB();
virtual G4bool IsEBActive() const;
virtual G4VEvtBiasMechanism* GetEBMechanism() const;
virtual G4VEvtBiasMechanism* GetEBMechanism();
protected:
G4VEvtBiasMechanism* theEBMechanism;
+22 -4
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VParticleChange.icc,v 2.6 1998/12/11 20:53:01 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VParticleChange.icc,v 1.2 1999/04/13 09:43:31 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//----------------------------------------------------------------
// Virtual methods for updating G4Step
@@ -264,7 +264,7 @@ inline
inline
void G4VParticleChange::SwOnEB()
{
if (theEBMechanism!=NULL) fUseEB = true;
if (theEBMechanism!=0) fUseEB = true;
}
inline
@@ -280,7 +280,25 @@ inline
}
inline
G4VEvtBiasMechanism* G4VParticleChange::GetEBMechanism() const
G4VEvtBiasMechanism* G4VParticleChange::GetEBMechanism()
{
return theEBMechanism;
}
inline
void G4VParticleChange::ClearDebugFlag()
{
debugFlag = false;
}
inline
void G4VParticleChange::SetDebugFlag()
{
debugFlag = true;
}
inline
G4bool G4VParticleChange::GetDebugFlag() const
{
return debugFlag;
}
+4 -4
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EvtBiasMechanism.cc,v 2.3 1998/11/18 11:06:41 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4EvtBiasMechanism.cc,v 1.2 1999/04/13 09:44:26 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// --------------------------------------------------------------
@@ -29,7 +29,7 @@
G4EvtBiasMechanism::G4EvtBiasMechanism(const G4String& name, G4int mulFactor):
G4VEvtBiasMechanism(name),
MultiplicationForSecondaries(mulFactor),
particleToBeBiased(NULL)
particleToBeBiased(0)
{
}
@@ -47,7 +47,7 @@ G4EvtBiasMechanism::~G4EvtBiasMechanism()
G4VParticleChange* G4EvtBiasMechanism::ApplyMath( G4VParticleChange* pChange,
const G4Step& aStep )
{
if (particleToBeBiased != NULL) {
if (particleToBeBiased != 0) {
G4int currentNumberOfSecondaries = pChange->GetNumberOfSecondaries();
G4int totalNumberOfSecondaries = currentNumberOfSecondaries;
G4int idx;
+4 -3
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Mars5GeVMechanism.cc,v 2.4 1998/12/12 12:52:49 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Mars5GeVMechanism.cc,v 1.2 1999/04/24 09:02:22 asaim Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -55,7 +55,8 @@ G4Mars5GeVMechanism::G4Mars5GeVMechanism(const G4String& name):
EthForIncident(5.0*GeV)
{
theParticleTable = G4ParticleTable::GetParticleTable();
ProtonMass = theParticleTable->FindParticle("proton")->GetPDGMass();
G4ParticleDefinition* pProton = theParticleTable->FindParticle("proton");
if(pProton) ProtonMass = pProton->GetPDGMass();
// set some constants
selec3.Eth = 1.0*MeV;
+96 -59
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChange.cc,v 2.10 1998/12/16 12:21:47 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChange.cc,v 1.6 1999/05/06 11:42:54 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// --------------------------------------------------------------
@@ -21,6 +21,7 @@
// Change default debug flag to false 10 May. 1998 H.Kurahige
// Add Track weight 12 Nov. 1998 H.Kurashige
// Activate CheckIt method for VERBOSE mode 14 Dec. 1998 H.Kurashige
// Modified CheckIt method for time 9 Feb. 1999 H.Kurashige
// --------------------------------------------------------------
#include "G4ParticleChange.hh"
@@ -33,28 +34,18 @@ G4bool G4ParticleChange::fUseEBForAll = false;
G4ParticleChange::G4ParticleChange():G4VParticleChange(false)
{
debugFlag = false;
#ifdef G4VERBOSE
// activate CHeckIt if in VERBOSE mode
debugFlag = true;
#endif
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cerr << "G4ParticleChange::G4ParticleChange() " << endl;
G4cout << "G4ParticleChange::G4ParticleChange() " << endl;
}
#endif
}
G4ParticleChange::G4ParticleChange(G4bool useEB):G4VParticleChange(useEB)
{
debugFlag = false;
#ifdef G4VERBOSE
// activate CHeckIt if in VERBOSE mode
debugFlag = true;
#endif
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cerr << "G4ParticleChange::G4ParticleChange() " << endl;
G4cout << "G4ParticleChange::G4ParticleChange() " << endl;
}
#endif
}
@@ -63,7 +54,7 @@ G4ParticleChange::~G4ParticleChange()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cerr << "G4ParticleChange::~G4ParticleChange() " << endl;
G4cout << "G4ParticleChange::~G4ParticleChange() " << endl;
}
#endif
}
@@ -72,9 +63,9 @@ G4ParticleChange::~G4ParticleChange()
G4ParticleChange::G4ParticleChange(const G4ParticleChange &right): G4VParticleChange(right)
{
if (verboseLevel>1) {
G4cerr << "G4ParticleChange:: copy constructor is called " << endl;
G4cout << "G4ParticleChange:: copy constructor is called " << endl;
}
theMomentumChange = right.theMomentumChange;
theMomentumDirectionChange = right.theMomentumDirectionChange;
thePolarizationChange = right.thePolarizationChange;
thePositionChange = right.thePositionChange;
theTimeChange = right.theTimeChange;
@@ -86,7 +77,7 @@ G4ParticleChange::G4ParticleChange(const G4ParticleChange &right): G4VParticleCh
G4ParticleChange & G4ParticleChange::operator=(const G4ParticleChange &right)
{
if (verboseLevel>1) {
G4cerr << "G4ParticleChange:: assignment operator is called " << endl;
G4cout << "G4ParticleChange:: assignment operator is called " << endl;
}
if (this != &right)
{
@@ -94,7 +85,7 @@ G4ParticleChange & G4ParticleChange::operator=(const G4ParticleChange &right)
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theMomentumChange = right.theMomentumChange;
theMomentumDirectionChange = right.theMomentumDirectionChange;
thePolarizationChange = right.thePolarizationChange;
thePositionChange = right.thePositionChange;
theTimeChange = right.theTimeChange;
@@ -132,7 +123,7 @@ void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
// Touchable is a temporary object, so you cannot keep the pointer
aTrack->SetTouchable(NULL);
aTrack->SetTouchable(0);
// add a secondary
G4VParticleChange::AddSecondary(aTrack);
@@ -149,7 +140,7 @@ void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
// Touchable is a temporary object, so you cannot keep the pointer
aTrack->SetTouchable(NULL);
aTrack->SetTouchable(0);
// add a secondary
G4VParticleChange::AddSecondary(aTrack);
@@ -166,7 +157,7 @@ void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
// Touchable is a temporary object, so you cannot keep the pointer
aTrack->SetTouchable(NULL);
aTrack->SetTouchable(0);
// add a secondary
G4VParticleChange::AddSecondary(aTrack);
@@ -190,7 +181,7 @@ void G4ParticleChange::Initialize(const G4Track& track)
// set Energy/Momentum etc. equal to those of the parent particle
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
theEnergyChange = pParticle->GetKineticEnergy();
theMomentumChange = pParticle->GetMomentumDirection();
theMomentumDirectionChange = pParticle->GetMomentumDirection();
thePolarizationChange = pParticle->GetPolarization();
theProperTimeChange = pParticle->GetProperTime();
@@ -214,7 +205,7 @@ G4Step* G4ParticleChange::UpdateStepForAlongStep(G4Step* pStep)
// So, the differences (delta) between these two states have to be
// calculated and be accumulated in PostStepPoint.
// Take note that the return type of GetMomentumChange is a
// Take note that the return type of GetMomentumDirectionChange is a
// pointer to G4ParticleMometum. Also it is a normalized
// momentum vector.
@@ -231,7 +222,7 @@ G4Step* G4ParticleChange::UpdateStepForAlongStep(G4Step* pStep)
if (energy > 0.0) {
// calculate new momentum
G4ThreeVector pMomentum = pPostStepPoint->GetMomentum()
+ ( CalcMomentum(theEnergyChange, theMomentumChange, mass)
+ ( CalcMomentum(theEnergyChange, theMomentumDirectionChange, mass)
- pPreStepPoint->GetMomentum());
G4double tMomentum = pMomentum.mag();
G4ThreeVector direction( pMomentum.x()/tMomentum,
@@ -262,7 +253,9 @@ G4Step* G4ParticleChange::UpdateStepForAlongStep(G4Step* pStep)
// update weight if use EB
pPostStepPoint->SetWeight( theWeightChange );
#ifdef G4VERBOSE
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
@@ -282,7 +275,7 @@ G4Step* G4ParticleChange::UpdateStepForPostStep(G4Step* pStep)
G4double mass = aTrack->GetDynamicParticle()->GetMass();
// update kinetic energy and momentum direction
pPostStepPoint->SetMomentumDirection(theMomentumChange);
pPostStepPoint->SetMomentumDirection(theMomentumDirectionChange);
pPostStepPoint->SetKineticEnergy( theEnergyChange );
// update polarization
@@ -298,7 +291,9 @@ G4Step* G4ParticleChange::UpdateStepForPostStep(G4Step* pStep)
// update weight if use EB
pPostStepPoint->SetWeight( theWeightChange );
#ifdef G4VERBOSE
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
@@ -315,7 +310,7 @@ G4Step* G4ParticleChange::UpdateStepForAtRest(G4Step* pStep)
G4double mass = aTrack->GetDynamicParticle()->GetMass();
// update kinetic energy and momentum direction
pPostStepPoint->SetMomentumDirection(theMomentumChange);
pPostStepPoint->SetMomentumDirection(theMomentumDirectionChange);
pPostStepPoint->SetKineticEnergy( theEnergyChange );
// update polarization
@@ -331,7 +326,9 @@ G4Step* G4ParticleChange::UpdateStepForAtRest(G4Step* pStep)
// update weight if use EB
pPostStepPoint->SetWeight( theWeightChange );
#ifdef G4VERBOSE
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
@@ -363,13 +360,13 @@ void G4ParticleChange::DumpInfo() const
<< setw(20) << theProperTimeChange/ns
<< endl;
G4cout << " Momentum Direct - x : "
<< setw(20) << theMomentumChange.x()
<< setw(20) << theMomentumDirectionChange.x()
<< endl;
G4cout << " Momentum Direct - y : "
<< setw(20) << theMomentumChange.y()
<< setw(20) << theMomentumDirectionChange.y()
<< endl;
G4cout << " Momentum Direct - z : "
<< setw(20) << theMomentumChange.z()
<< setw(20) << theMomentumDirectionChange.z()
<< endl;
G4cout << " Kinetic Energy (MeV): "
<< setw(20) << theEnergyChange/MeV
@@ -392,45 +389,85 @@ void G4ParticleChange::DumpInfo() const
G4bool G4ParticleChange::CheckIt(const G4Track& aTrack)
{
G4bool itsOK = true;
// if (theEnergyChange > aTrack.GetKineticEnergy()) {
// G4cout << " !!! the energy becomes larger than the initial energy !!!"
// << " : " << (theEnergyChange -aTrack.GetKineticEnergy())/MeV
// << "MeV " <<endl;
// itsOK = false;
// }
if ( (theEnergyChange >0.) &&
( abs(theMomentumChange.mag2()-1.0) > perMillion ) ){
G4cout << " !!! the Momentum Change is not unit vector !!!!"
<< " : " << theMomentumChange.mag()
<< endl;
itsOK = false;
G4bool exitWithError = false;
G4double accuracy;
// check
// MomentumDirection should be unit vector
G4bool itsOKforMomentum = true;
if ( theEnergyChange >0.) {
accuracy = abs(theMomentumDirectionChange.mag2()-1.0);
if (accuracy > accuracyForWarning) {
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the Momentum Change is not unit vector !!" << endl;
G4cout << " Difference: " << accuracy << endl;
itsOKforMomentum = false;
if (accuracy > accuracyForException) exitWithError = true;
}
}
if (theTimeChange < aTrack.GetGlobalTime()) {
G4cout << " !!! the global time goes back !!!"
<< " : " << aTrack.GetGlobalTime()/ns
<< " -> " << theTimeChange/ns
<< "[ns] " <<endl;
itsOK = false;
// Both global and proper time should not go back
G4bool itsOKforGlobalTime = true;
accuracy = (aTrack.GetGlobalTime()- theTimeChange)/ns;
if (accuracy > accuracyForWarning) {
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the global time goes back !!" << endl;
G4cout << " Difference: " << accuracy << "[ns] " <<endl;
itsOKforGlobalTime = false;
if (accuracy > accuracyForException) exitWithError = true;
}
if (theProperTimeChange < aTrack.GetProperTime()) {
G4cout << " !!! the poper time goes back !!!"
<< " : " << aTrack.GetProperTime()/ns
<< " -> " << theProperTimeChange/ns
<< "[ns] " <<endl;
itsOK = false;
G4bool itsOKforProperTime = true;
accuracy = (aTrack.GetProperTime() - theProperTimeChange )/ns;
if (accuracy > accuracyForWarning) {
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the proper time goes back !!" << endl;
G4cout << " Difference: " << accuracy << "[ns] " <<endl;
itsOKforProperTime = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// Kinetic Energy should not be negative
G4bool itsOKforEnergy = true;
accuracy = -1.0*theEnergyChange/MeV;
if (accuracy > accuracyForWarning) {
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the kinetic energy is negative !!" << endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<endl;
itsOKforEnergy = false;
if (accuracy > accuracyForException) exitWithError = true;
}
G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforProperTime && itsOKforGlobalTime;
// dump out information of this particle change
if (!itsOK) {
G4cout << " G4ParticleChange::CheckIt " <<endl;
G4cout << " pointer : " << this <<endl ;
DumpInfo();
G4Exception("G4ParticleChange::CheckIt");
}
// Exit with error
if (exitWithError) G4Exception("G4ParticleChange::CheckIt");
//correction
if (!itsOKforMomentum) {
G4double vmag = theMomentumDirectionChange.mag();
theMomentumDirectionChange = (1./vmag)*theMomentumDirectionChange;
}
if (!itsOKforGlobalTime) {
theTimeChange = aTrack.GetGlobalTime();
}
if (!itsOKforProperTime) {
theProperTimeChange = aTrack.GetProperTime();
}
if (!itsOKforEnergy) {
theEnergyChange = 0.0;
}
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
return itsOK;
}
+51 -8
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForDecay.cc,v 2.2 1998/07/20 06:11:57 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChangeForDecay.cc,v 1.3 1999/05/06 11:42:55 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// --------------------------------------------------------------
@@ -31,7 +31,7 @@ G4ParticleChangeForDecay::G4ParticleChangeForDecay():G4VParticleChange()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cerr << "G4ParticleChangeForDecay::G4ParticleChangeForDecay() " << endl;
G4cout << "G4ParticleChangeForDecay::G4ParticleChangeForDecay() " << endl;
}
#endif
}
@@ -40,22 +40,21 @@ G4ParticleChangeForDecay::~G4ParticleChangeForDecay()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cerr << "G4ParticleChangeForDecay::~G4ParticleChangeForDecay() " << endl;
G4cout << "G4ParticleChangeForDecay::~G4ParticleChangeForDecay() " << endl;
}
#endif
}
// copy and assignment operators are implemented as "shallow copy"
G4ParticleChangeForDecay::G4ParticleChangeForDecay(const G4ParticleChangeForDecay &right)
G4ParticleChangeForDecay::G4ParticleChangeForDecay(const G4ParticleChangeForDecay &right): G4VParticleChange(right)
{
*this = right;
theTimeChange = right.theTimeChange;
}
G4ParticleChangeForDecay & G4ParticleChangeForDecay::operator=(const G4ParticleChangeForDecay &right)
{
if (this != &right)
{
if (this != &right){
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
@@ -63,6 +62,8 @@ G4ParticleChangeForDecay & G4ParticleChangeForDecay::operator=(const G4ParticleC
theTrueStepLength = right.theTrueStepLength;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
theTimeChange = right.theTimeChange;
}
return *this;
}
@@ -117,6 +118,12 @@ G4Step* G4ParticleChangeForDecay::UpdateStepForAtRest(G4Step* pStep)
pPostStepPoint->AddProperTime( theTimeChange
- pPreStepPoint->GetGlobalTime());
#ifdef G4VERBOSE
G4Track* aTrack = pStep->GetTrack();
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
}
@@ -132,6 +139,42 @@ void G4ParticleChangeForDecay::DumpInfo() const
<< endl;
}
G4bool G4ParticleChangeForDecay::CheckIt(const G4Track& aTrack)
{
G4bool exitWithError = false;
G4double accuracy;
// global time should not go back
G4bool itsOK =true;
accuracy = -1.0*(theTimeChange - aTrack.GetGlobalTime())/ns;
if (accuracy > accuracyForWarning) {
G4cout << " G4ParticleChangeForDecay::CheckIt : ";
G4cout << "the global time goes back !!" << endl;
G4cout << " Difference: " << accuracy << "[ns] " <<endl;
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// dump out information of this particle change
if (!itsOK) {
G4cout << " G4ParticleChangeForDecay::CheckIt " <<endl;
G4cout << " pointer : " << this <<endl ;
DumpInfo();
}
// Exit with error
if (exitWithError) G4Exception("G4ParticleChangeForDecay::CheckIt");
// correction
if (!itsOK) {
theTimeChange = aTrack.GetGlobalTime();
}
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
return itsOK;
}
+46 -11
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForLoss.cc,v 2.1 1998/12/02 17:20:26 urban Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChangeForLoss.cc,v 1.3 1999/05/06 11:42:56 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// --------------------------------------------------------------
@@ -31,7 +31,7 @@ G4ParticleChangeForLoss::G4ParticleChangeForLoss():G4VParticleChange()
debugFlag = false;
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cerr << "G4ParticleChangeForLoss::G4ParticleChangeForLoss() " << endl;
G4cout << "G4ParticleChangeForLoss::G4ParticleChangeForLoss() " << endl;
}
#endif
}
@@ -40,7 +40,7 @@ G4ParticleChangeForLoss::~G4ParticleChangeForLoss()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cerr << "G4ParticleChangeForLoss::~G4ParticleChangeForLoss() " << endl;
G4cout << "G4ParticleChangeForLoss::~G4ParticleChangeForLoss() " << endl;
}
#endif
}
@@ -49,7 +49,7 @@ G4ParticleChangeForLoss::~G4ParticleChangeForLoss()
G4ParticleChangeForLoss::G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right): G4VParticleChange(right)
{
if (verboseLevel>1) {
G4cerr << "G4ParticleChangeForLoss:: copy constructor is called " << endl;
G4cout << "G4ParticleChangeForLoss:: copy constructor is called " << endl;
}
theEnergyChange = right.theEnergyChange;
}
@@ -58,10 +58,18 @@ G4ParticleChangeForLoss::G4ParticleChangeForLoss(const G4ParticleChangeForLoss &
G4ParticleChangeForLoss & G4ParticleChangeForLoss::operator=(const G4ParticleChangeForLoss &right)
{
if (verboseLevel>1) {
G4cerr << "G4ParticleChangeForLoss:: assignment operator is called " << endl;
G4cout << "G4ParticleChangeForLoss:: assignment operator is called " << endl;
}
if (this != &right)
{
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theTrueStepLength = right.theTrueStepLength;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
theEnergyChange = right.theEnergyChange;
theLocalEnergyDeposit = right.theLocalEnergyDeposit ;
}
@@ -113,7 +121,9 @@ G4Step* G4ParticleChangeForLoss::UpdateStepForAlongStep(G4Step* pStep)
pPostStepPoint->SetKineticEnergy(0.0);
}
#ifdef G4VERBOSE
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
@@ -137,17 +147,36 @@ void G4ParticleChangeForLoss::DumpInfo() const
G4bool G4ParticleChangeForLoss::CheckIt(const G4Track& aTrack)
{
G4bool itsOK = true;
if (theEnergyChange > aTrack.GetKineticEnergy()) {
G4cout << " !!! the energy becomes larger than the initial energy !!!"
<< " : " << (theEnergyChange -aTrack.GetKineticEnergy())/MeV
<< "MeV " <<endl;
G4bool exitWithError = false;
G4double accuracy;
// Energy should not be lager than initial value
accuracy = ( theEnergyChange - aTrack.GetKineticEnergy())/MeV;
if (accuracy > accuracyForWarning) {
G4cout << " G4ParticleChangeForLoss::CheckIt : ";
G4cout << "the energy becoes larger than the initial value !!" << endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<endl;
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// dump out information of this particle change
if (!itsOK) {
G4cout << " G4ParticleChange::CheckIt " <<endl;
G4cout << " G4ParticleChangeForLoss::CheckIt " <<endl;
G4cout << " pointer : " << this <<endl ;
DumpInfo();
}
// Exit with error
if (exitWithError) G4Exception("G4ParticleChangeForLoss::CheckIt");
//correction
if (!itsOK) {
theEnergyChange = aTrack.GetKineticEnergy();
}
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
return itsOK;
}
@@ -156,3 +185,9 @@ G4bool G4ParticleChangeForLoss::CheckIt(const G4Track& aTrack)
+72 -20
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForMSC.cc,v 2.1 1998/12/02 17:20:25 urban Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChangeForMSC.cc,v 1.4 1999/05/06 11:42:57 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// --------------------------------------------------------------
@@ -30,7 +30,7 @@ G4ParticleChangeForMSC::G4ParticleChangeForMSC():G4VParticleChange()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cerr << "G4ParticleChangeForMSC::G4ParticleChangeForMSC() " << endl;
G4cout << "G4ParticleChangeForMSC::G4ParticleChangeForMSC() " << endl;
}
#endif
}
@@ -39,7 +39,7 @@ G4ParticleChangeForMSC::~G4ParticleChangeForMSC()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cerr << "G4ParticleChangeForMSC::~G4ParticleChangeForMSC() " << endl;
G4cout << "G4ParticleChangeForMSC::~G4ParticleChangeForMSC() " << endl;
}
#endif
}
@@ -48,9 +48,11 @@ G4ParticleChangeForMSC::G4ParticleChangeForMSC(
const G4ParticleChangeForMSC &right): G4VParticleChange(right)
{
if (verboseLevel>1) {
G4cerr << "G4ParticleChangeForMSC:: copy constructor is called " << endl;
G4cout << "G4ParticleChangeForMSC:: copy constructor is called " << endl;
}
*this = right;
theMomentumDirectionChange = right.theMomentumDirectionChange;
thePositionChange = right.thePositionChange;
theTrueStepLength = right.theTrueStepLength;
}
// assignment operator
@@ -58,11 +60,19 @@ G4ParticleChangeForMSC & G4ParticleChangeForMSC::operator=(
const G4ParticleChangeForMSC &right)
{
if (verboseLevel>1) {
G4cerr << "G4ParticleChangeForMSC:: assignment operator is called " << endl;
G4cout << "G4ParticleChangeForMSC:: assignment operator is called " << endl;
}
if (this != &right)
{
theMomentumChange = right.theMomentumChange;
{
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;
}
@@ -80,7 +90,7 @@ void G4ParticleChangeForMSC::Initialize(const G4Track& track)
// set Energy/Momentum etc. equal to those of the parent particle
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
theMomentumChange = pParticle->GetMomentumDirection();
theMomentumDirectionChange = pParticle->GetMomentumDirection();
// set Position equal to those of the parent track
thePositionChange = track.GetPosition();
@@ -112,11 +122,15 @@ G4Step* G4ParticleChangeForMSC::UpdateStepForPostStep(G4Step* pStep)
G4Track* aTrack = pStep->GetTrack();
// update momentum direction
pPostStepPoint->SetMomentumDirection(theMomentumChange);
pPostStepPoint->SetMomentumDirection(theMomentumDirectionChange);
// update position
pPostStepPoint->SetPosition( thePositionChange );
#ifdef G4VERBOSE
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
}
@@ -147,20 +161,58 @@ void G4ParticleChangeForMSC::DumpInfo() const
G4cout << " Position - z (mm) : "
<< setw(20) << thePositionChange.z()/mm
<< endl;
G4cout << " Momentum Direct - x : "
<< setw(20) << theMomentumChange.x()
G4cout << " Momentum Direction - x : "
<< setw(20) << theMomentumDirectionChange.x()
<< endl;
G4cout << " Momentum Direct - y : "
<< setw(20) << theMomentumChange.y()
G4cout << " Momentum Direction - y : "
<< setw(20) << theMomentumDirectionChange.y()
<< endl;
G4cout << " Momentum Direct - z : "
<< setw(20) << theMomentumChange.z()
G4cout << " Momentum Direction - z : "
<< setw(20) << theMomentumDirectionChange.z()
<< endl;
}
G4bool G4ParticleChangeForMSC::CheckIt(const G4Track& aTrack)
{
G4bool itsOK = true;
G4bool exitWithError = false;
G4double accuracy;
// check
// MomentumDirection should be unit vector
accuracy = abs(theMomentumDirectionChange.mag2()-1.0);
if (accuracy > accuracyForWarning) {
G4cout << " G4ParticleChangeForMSC::CheckIt : ";
G4cout << "the Momentum Change is not unit vector !!" << endl;
G4cout << " Difference: " << accuracy << endl;
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// dump out information of this particle change
if (!itsOK) {
G4cout << " G4ParticleChangeForMSC::CheckIt " <<endl;
G4cout << " pointer : " << this <<endl ;
DumpInfo();
}
// Exit with error
if (exitWithError) G4Exception("G4ParticleChangeForMSC::CheckIt");
//correction
if (!itsOK) {
G4double vmag = theMomentumDirectionChange.mag();
theMomentumDirectionChange = (1./vmag)*theMomentumDirectionChange;
}
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
return itsOK;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleChangeForTransport.cc,v 2.8 1998/11/10 19:05:18 japost Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleChangeForTransport.cc,v 1.4 1999/05/06 11:42:57 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// --------------------------------------------------------------
@@ -31,14 +31,14 @@
G4ParticleChangeForTransport::G4ParticleChangeForTransport():G4ParticleChange()
{
if (verboseLevel>2) {
G4cerr << "G4ParticleChangeForTransport::G4ParticleChangeForTransport() " << endl;
G4cout << "G4ParticleChangeForTransport::G4ParticleChangeForTransport() " << endl;
}
}
G4ParticleChangeForTransport::~G4ParticleChangeForTransport()
{
if (verboseLevel>2) {
G4cerr << "G4ParticleChangeForTransport::~G4ParticleChangeForTransport() " << endl;
G4cout << "G4ParticleChangeForTransport::~G4ParticleChangeForTransport() " << endl;
}
}
@@ -46,7 +46,7 @@ G4ParticleChangeForTransport::~G4ParticleChangeForTransport()
G4ParticleChangeForTransport::G4ParticleChangeForTransport(const G4ParticleChangeForTransport &right):G4ParticleChange(right)
{
if (verboseLevel>0) {
G4cerr << "G4ParticleChangeForTransport:: copy constructor is called " << endl;
G4cout << "G4ParticleChangeForTransport:: copy constructor is called " << endl;
}
theTouchableChange = right.theTouchableChange;
}
@@ -55,7 +55,7 @@ G4ParticleChangeForTransport::G4ParticleChangeForTransport(const G4ParticleChang
G4ParticleChangeForTransport & G4ParticleChangeForTransport::operator=(const G4ParticleChangeForTransport &right)
{
if (verboseLevel>1) {
G4cerr << "G4ParticleChangeForTransport:: assignment operator is called " << endl;
G4cout << "G4ParticleChangeForTransport:: assignment operator is called " << endl;
}
if (this != &right)
{
@@ -64,7 +64,7 @@ G4ParticleChangeForTransport & G4ParticleChangeForTransport::operator=(const G4P
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theTouchableChange = right.theTouchableChange;
theMomentumChange = right.theMomentumChange;
theMomentumDirectionChange = right.theMomentumDirectionChange;
thePolarizationChange = right.thePolarizationChange;
thePositionChange = right.thePositionChange;
theTimeChange = right.theTimeChange;
@@ -84,8 +84,8 @@ G4Step* G4ParticleChangeForTransport::UpdateStepForAtRest(G4Step* pStep)
{
// Nothing happens for AtRestDoIt
if (verboseLevel>0) {
G4cerr << "G4ParticleChangeForTransport::UpdateStepForAtRest() is called" << endl;
G4cerr << " Nothing happens for this method " << endl;
G4cout << "G4ParticleChangeForTransport::UpdateStepForAtRest() is called" << endl;
G4cout << " Nothing happens for this method " << endl;
}
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
@@ -105,13 +105,13 @@ G4Step* G4ParticleChangeForTransport::UpdateStepForAlongStep(G4Step* pStep)
// calculated and be accumulated in PostStepPoint.
// Take note that the return type of GetMomentumChange is a
// pointer to G4ParticleMomentum. Also it is a normalized
// pointer to G4ThreeVector. Also it is a normalized
// momentum vector.
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
G4Track* aTrack = pStep->GetTrack();
G4double mass = mass = aTrack->GetDynamicParticle()->GetMass();
G4double mass = aTrack->GetDynamicParticle()->GetMass();
// uodate kinetic energy
// now assume that no energy change in transportation
@@ -127,7 +127,7 @@ G4Step* G4ParticleChangeForTransport::UpdateStepForAlongStep(G4Step* pStep)
// calculate new momentum
G4ThreeVector pMomentum = pPostStepPoint->GetMomentum()
+ ( CalcMomentum(theEnergyChange, theMomentumChange, mass)
+ ( CalcMomentum(theEnergyChange, theMomentumDirectionChange, mass)
- pPreStepPoint->GetMomentum());
G4double tMomentum_inv = 1.0 / pMomentum.mag();
pPostStepPoint->SetMomentumDirection(pMomentum*tMomentum_inv);
@@ -205,4 +205,3 @@ void G4ParticleChangeForTransport::DumpInfo() const
+2 -140
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Step.cc,v 2.3 1998/11/18 11:06:46 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Step.cc,v 1.3 1999/04/28 12:28:45 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
@@ -30,7 +30,6 @@
// ---------------------------------------------------------------
#include "G4Step.hh"
#include "G4VProcess.hh"
////////////////
G4Step::G4Step()
@@ -47,140 +46,3 @@ G4Step::~G4Step()
delete fpPreStepPoint;
delete fpPostStepPoint;
}
/////////////////////////////
void G4Step::ShowStep() const
/////////////////////////////
{
// Show header
G4cout << endl;
G4cout << " ++G4Step Information " << endl;
G4cout.precision(3);
// Show G4Step specific information
G4cout << " Address of G4Track : " << fpTrack << endl;
G4cout << " Step Length (mm) : " << fpTrack->GetStepLength() << endl;
G4cout << " Energy Deposit (MeV) : " << fTotalEnergyDeposit << endl;
// Show G4StepPoint specific information
G4cout << " -------------------------------------------------------"
<< "----------------" << endl;
G4cout << " StepPoint Information " << setw(20) << "PreStep"
<< setw(20) << "PostStep" << endl;
G4cout << " -------------------------------------------------------"
<< "----------------" << endl;
G4cout << " Position - x (mm) : "
<< setw(20) << fpPreStepPoint->GetPosition().x()
<< setw(20) << fpPostStepPoint->GetPosition().x() << endl;
G4cout << " Position - y (mm) : "
<< setw(20) << fpPreStepPoint->GetPosition().y()
<< setw(20) << fpPostStepPoint->GetPosition().y() << endl;
G4cout << " Position - z (mm) : "
<< setw(20) << fpPreStepPoint->GetPosition().z()
<< setw(20) << fpPostStepPoint->GetPosition().z() << endl;
G4cout << " Global Time (ns) : "
<< setw(20) << fpPreStepPoint->GetGlobalTime()
<< setw(20) << fpPostStepPoint->GetGlobalTime() << endl;
G4cout << " Local Time (ns) : "
<< setw(20) << fpPreStepPoint->GetLocalTime()
<< setw(20) << fpPostStepPoint->GetLocalTime() << endl;
G4cout << " Proper Time (ns) : "
<< setw(20) << fpPreStepPoint->GetProperTime()
<< setw(20) << fpPostStepPoint->GetProperTime() << endl;
G4cout << " Momentum Direct - x : "
<< setw(20) << fpPreStepPoint->GetMomentumDirection().x()
<< setw(20) << fpPostStepPoint->GetMomentumDirection().x() << endl;
G4cout << " Momentum Direct - y : "
<< setw(20) << fpPreStepPoint->GetMomentumDirection().y()
<< setw(20) << fpPostStepPoint->GetMomentumDirection().y() << endl;
G4cout << " Momentum Direct - z : "
<< setw(20) << fpPreStepPoint->GetMomentumDirection().z()
<< setw(20) << fpPostStepPoint->GetMomentumDirection().z() << endl;
G4cout << " Momentum - x (MeV/c): "
<< setw(20) << fpPreStepPoint->GetMomentum().x()
<< setw(20) << fpPostStepPoint->GetMomentum().x() << endl;
G4cout << " Momentum - y (MeV/c): "
<< setw(20) << fpPreStepPoint->GetMomentum().y()
<< setw(20) << fpPostStepPoint->GetMomentum().y() << endl;
G4cout << " Momentum - z (MeV/c): "
<< setw(20) << fpPreStepPoint->GetMomentum().z()
<< setw(20) << fpPostStepPoint->GetMomentum().z() << endl;
G4cout << " Total Energy (MeV) : "
<< setw(20) << fpPreStepPoint->GetTotalEnergy()
<< setw(20) << fpPostStepPoint->GetTotalEnergy() << endl;
G4cout << " Kinetic Energy (MeV): "
<< setw(20) << fpPreStepPoint->GetKineticEnergy()
<< setw(20) << fpPostStepPoint->GetKineticEnergy() << endl;
G4cout << " Velocity (mm/ns) : "
<< setw(20) << fpPreStepPoint->GetVelocity()
<< setw(20) << fpPostStepPoint->GetVelocity() << endl;
G4cout << " Volume Name : "
<< setw(20) << fpPreStepPoint->GetPhysicalVolume()->GetName()
<< setw(20) << fpPostStepPoint->GetPhysicalVolume()->GetName() << endl;
G4cout << " Safety (mm) : "
<< setw(20) << fpPreStepPoint->GetSafety()
<< setw(20) << fpPostStepPoint->GetSafety() << endl;
G4cout << " Polarization - x : "
<< setw(20) << fpPreStepPoint->GetPolarization().x()
<< setw(20) << fpPostStepPoint->GetPolarization().x() << endl;
G4cout << " Polarization - y : "
<< setw(20) << fpPreStepPoint->GetPolarization().y()
<< setw(20) << fpPostStepPoint->GetPolarization().y() << endl;
G4cout << " Polarization - Z : "
<< setw(20) << fpPreStepPoint->GetPolarization().z()
<< setw(20) << fpPostStepPoint->GetPolarization().z() << endl;
G4cout << " Weight : "
<< setw(20) << fpPreStepPoint->GetWeight()
<< setw(20) << fpPostStepPoint->GetWeight() << endl;
G4cout << " Step Status : " ;
G4StepStatus tStepStatus = fpPreStepPoint->GetStepStatus();
if( tStepStatus == fGeomBoundary ){
G4cout << setw(20) << "Geom Limit";
} else if ( tStepStatus == fAlongStepDoItProc ){
G4cout << setw(20) << "AlongStep Proc.";
} else if ( tStepStatus == fPostStepDoItProc ){
G4cout << setw(20) << "PostStep Proc";
} else if ( tStepStatus == fAtRestDoItProc ){
G4cout << setw(20) << "AtRest Proc";
} else if ( tStepStatus == fUndefined ){
G4cout << setw(20) << "Undefined";
}
tStepStatus = fpPostStepPoint->GetStepStatus();
if( tStepStatus == fGeomBoundary ){
G4cout << setw(20) << "Geom Limit";
} else if ( tStepStatus == fAlongStepDoItProc ){
G4cout << setw(20) << "AlongStep Proc.";
} else if ( tStepStatus == fPostStepDoItProc ){
G4cout << setw(20) << "PostStep Proc";
} else if ( tStepStatus == fAtRestDoItProc ){
G4cout << setw(20) << "AtRest Proc";
} else if ( tStepStatus == fUndefined ){
G4cout << setw(20) << "Undefined";
}
G4cout << endl;
G4cout << " Process defined Step: " ;
if( fpPreStepPoint->GetProcessDefinedStep() == NULL ){
G4cout << setw(20) << "Undefined";
} else {
G4cout << setw(20) << fpPreStepPoint->GetProcessDefinedStep()
->GetProcessName();
}
if( fpPostStepPoint->GetProcessDefinedStep() == NULL){
G4cout << setw(20) << "Undefined";
} else {
G4cout << setw(20) << fpPostStepPoint->GetProcessDefinedStep()
->GetProcessName();
}
G4cout << endl;
G4cout << " -------------------------------------------------------"
<< "----------------" << endl;
}
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StepPoint.cc,v 2.1 1998/07/12 03:08:56 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4StepPoint.cc,v 1.1 1999/01/07 16:14:27 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Track.cc,v 2.2 1998/11/18 11:06:48 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Track.cc,v 1.1 1999/01/07 16:14:27 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
+49
View File
@@ -0,0 +1,49 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VEvtBiasMechanism.cc,v 1.1 1999/04/13 09:47:11 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 13 Apr. 1999 H.Kurahige
#include "G4VEvtBiasMechanism.hh"
G4VEvtBiasMechanism::G4VEvtBiasMechanism(const G4String& name):
theEBName(name)
{
}
G4VEvtBiasMechanism::G4VEvtBiasMechanism(const G4VEvtBiasMechanism& right)
{
theEBName = right.theEBName;
}
G4VEvtBiasMechanism::~G4VEvtBiasMechanism()
{
}
+101 -8
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VParticleChange.cc,v 2.3 1998/11/18 11:06:49 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VParticleChange.cc,v 1.3 1999/05/06 11:42:58 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// --------------------------------------------------------------
@@ -25,6 +25,9 @@
#include "G4TrackFastVector.hh"
#include "G4Mars5GeVMechanism.hh"
const G4double G4VParticleChange::accuracyForWarning = 1.0e-9;
const G4double G4VParticleChange::accuracyForException = 0.001;
G4VParticleChange::G4VParticleChange():
theNumberOfSecondaries(0),
theSizeOftheListOfSecondaries(G4TrackFastVectorSize),
@@ -32,10 +35,15 @@ G4VParticleChange::G4VParticleChange():
theSteppingControlFlag(NormalCondition),
theLocalEnergyDeposit(0.0),
theParentWeight(1.0),
theEBMechanism(NULL),
theEBMechanism(0),
fUseEB(false),
verboseLevel(1)
{
debugFlag = false;
#ifdef G4VERBOSE
// activate CHeckIt if in VERBOSE mode
debugFlag = true;
#endif
theListOfSecondaries = new G4TrackFastVector();
}
@@ -46,10 +54,16 @@ G4VParticleChange::G4VParticleChange(G4bool useEB):
theSteppingControlFlag(NormalCondition),
theLocalEnergyDeposit(0.0),
theParentWeight(1.0),
fUseEB(useEB),
verboseLevel(1)
{
theListOfSecondaries = new G4TrackFastVector();
fUseEB = useEB;
// debug flag (activate CheckIt() )
debugFlag = false;
#ifdef G4VERBOSE
// activate CHeckIt if in VERBOSE mode
debugFlag = true;
#endif
theListOfSecondaries = new G4TrackFastVector();
// register G4EvtBiasMechanism as a default
theEBMechanism = new G4Mars5GeVMechanism();
}
@@ -67,19 +81,44 @@ G4VParticleChange::~G4VParticleChange() {
if ( (*theListOfSecondaries)[index] ) delete (*theListOfSecondaries)[index] ;
}
}
if (theEBMechanism !=NULL) delete theEBMechanism;
if (theEBMechanism !=0) delete theEBMechanism;
delete theListOfSecondaries;
}
// copy and assignment operators are implemented as "shallow copy"
G4VParticleChange::G4VParticleChange(const G4VParticleChange &right)
G4VParticleChange::G4VParticleChange(const G4VParticleChange &right):
theNumberOfSecondaries(0),
theSizeOftheListOfSecondaries(G4TrackFastVectorSize),
theStatusChange(fAlive),
theSteppingControlFlag(NormalCondition),
theLocalEnergyDeposit(0.0),
theParentWeight(1.0),
fUseEB(false),
verboseLevel(1)
{
*this = right;
debugFlag = false;
#ifdef G4VERBOSE
// activate CHeckIt if in VERBOSE mode
debugFlag = true;
#endif
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theTrueStepLength = right.theTrueStepLength;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
}
G4VParticleChange & G4VParticleChange::operator=(const G4VParticleChange &right)
{
debugFlag = false;
#ifdef G4VERBOSE
// activate CHeckIt if in VERBOSE mode
debugFlag = true;
#endif
if (this != &right)
{
theListOfSecondaries = right.theListOfSecondaries;
@@ -136,6 +175,7 @@ void G4VParticleChange::DumpInfo() const
G4cout << " Energy Deposit (MeV): "
<< setw(20) << theLocalEnergyDeposit/MeV
<< endl;
G4cout << " Track Status : "
<< setw(20);
if( theStatusChange == fAlive ){
@@ -167,6 +207,59 @@ void G4VParticleChange::DumpInfo() const
G4cout << endl;
}
G4bool G4VParticleChange::CheckIt(const G4Track& aTrack)
{
G4bool exitWithError = false;
G4double accuracy;
G4double newEnergyDeposit;
// Energy deposit should not be negative
G4bool itsOKforEnergy = true;
accuracy = -1.0*theLocalEnergyDeposit/MeV;
if (accuracy > accuracyForWarning) {
G4cout << " G4VParticleChange::CheckIt : ";
G4cout << "the energy deposit is negative !!" << endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<endl;
itsOKforEnergy = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// true path length should not be negative
G4bool itsOKforStepLength = true;
accuracy = -1.0*theTrueStepLength/mm;
if (accuracy > accuracyForWarning) {
G4cout << " G4VParticleChange::CheckIt : ";
G4cout << "the true step length is negative !!" << endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<endl;
itsOKforStepLength = false;
if (accuracy > accuracyForException) exitWithError = true;
}
G4bool itsOK = itsOKforStepLength && itsOKforEnergy ;
// dump out information of this particle change
if (! itsOK ){
G4cout << " G4VParticleChange::CheckIt " <<endl;
G4cout << " pointer : " << this <<endl ;
DumpInfo();
}
// Exit with error
if (exitWithError) G4Exception("G4VParticleChange::CheckIt");
// correction
if ( !itsOKforStepLength ) {
theTrueStepLength = (1.e-12)*mm;
}
if ( !itsOKforEnergy ) {
theLocalEnergyDeposit = 0.0;
}
return itsOK;
}