Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
+79
View File
@@ -17,6 +17,85 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
- November 8, 2012 I.Hrivnacova (track-V09-05-20)
- Fixed G4Track: added initialisation of useGivenVelocity where missing
- Sep. 23, 2012 H.Kurashige (track-V09-05-19)
- Add UseGivenVelocity methods to skip CalculateVelocity
- August 27, 2012 H.Kurashige (track-V09-05-18)
- Fix a bug in copy constructor of G4VUUserTrackInformation (Problem #1346)
- August 11, 2012 H.Kurashige (track-V09-05-17)
- Fix a bug in G4VParticleChange::CheckSecondary
theParentGlobalTime is set to time at the pre-step point
- August 9, 2012 V.Ivanchenko (track-V09-05-16)
(should be accompned by a new EM tag of emutils-V09-05-31)
- G4ParticleChangeForMSC - allowed modification of position and
direction AlongStep
- June 26, 2012 G.Cosmo (track-V09-05-13)
- Additional protection for parameter not used in G4VParticleChange when
G4_NO_VERBOSE is set.
- June 20, 2012 G.Cosmo (track-V09-05-12)
- Protect variable used for verbosity within G4VERBOSE in G4ParticleChange
and G4VParticleChange. Fixes compilation warnings when G4_NO_VERBOSE is
set.
- June 13, 2012 G.Cosmo (track-V09-05-11)
- Explicitly use inclusion of headers for system of units and physical
constants, in plan to remove implicit inclusion from globals.hh.
- June 09, 2012 H.Kurashige (track-V09-05-10)
- Fixed G4VelocityTable::Interpolation()
- May 23, 2012 G.Cosmo (track-V09-05-09)
- Fixed trivial cases of variable shadowing.
- May 15, 2012 H.Kurashige (track-V09-05-08)
- Modify way of handling parent weight in AlongStep
in accumulated way (same manner for other prperties)
- May 1st, 2012 H.Kurashige (track-V09-05-07)
- Add global time check for secondaries in G4VParticleChange
- Modify output messages for CheckIt and CheckSecondary
- Add G4Exception in G4ParticleChangeForRadDecay:: AddSecondary
- April 30, 2012 H.Kurashige (track-V09-05-06)
- Fixed the bug in G4ParticleChange::AddSecondary.
(Problem#1305 The local time of the parent was set before)
- April 29, 2012 H.Kurashige (track-V09-05-05)
- Fix treatment of weights in ParticleChange
(Problem#1283)
- February 3rd, 2012 J.Apostolakis (track-V09-05-04)
- G4FieldTrackUpdator::Update method must reset the RestMass,
because it is used to Initialise each track by ParallelWorldScoringProcess,
(as well as update during stepping a track.)
Requires tag 'field-V09-05-03' of geometry/magneticfield
- January 21st, 2012 H.Kurashige (track-V09-05-03)
- G4Track::CalculateVelocityForOpticalPhoton() has been reverted
Modification of Optical process solves Problem #1275
- January 9th, 2012 H.Kurashige (track-V09-05-02)
- Use GetNextMaterial instead of GetMaterial
in G4Track::CalculateVelocityForOpticalPhoton()
(Problem #1275)
- December 22nd, 2011 H.Kurashige (track-V09-05-01)
- Set 'false' to SecondaryWeightByProcess in default
(Problem #1273)
- December 9th, 2011 H.Kurashige (track-V09-05-00)
- Fix Coverity defects
(Modify copy constructor/assignment operator for G4VParticleChange and derived classes)
(Add copy constructor/assignment operator for G4VUserTrackInformation)
- November 9th, 2011 H.Kurashige (track-V09-04-13)
- Fix Coverity defects
(copy constructor/assignment operator for G4Step/G4StepPoint)
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4FieldTrackUpdator.hh,v 1.2 2006-12-13 15:49:43 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// M. Asai - first implementation Apr/28/2006
//
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ForceCondition.hh,v 1.5 2006-06-29 21:14:11 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GPILSelection.hh,v 1.4 2006-06-29 21:14:13 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChange.hh,v 1.13 2007-03-11 07:19:06 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// ------------------------------------------------------------
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChange.icc,v 1.14 2007-03-11 07:19:06 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
inline
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForDecay.hh,v 1.10 2010-07-21 09:30:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForGamma.hh,v 1.9 2008-01-11 19:57:12 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// ------------------------------------------------------------
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForLoss.hh,v 1.22 2009-06-17 17:25:57 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// ------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForMSC.hh,v 1.9 2006-06-29 21:14:25 gunter Exp $
// $Id$
// GEANT4 tag $ $
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForMSC.icc,v 1.7 2006-06-29 21:14:27 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForRadDecay.hh,v 1.7 2006-06-29 21:14:29 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// ------------------------------------------------------------
@@ -78,11 +77,14 @@ inline void G4ParticleChangeForRadDecay::AddSecondary(G4Track *aTrack)
} else {
#ifdef G4VERBOSE
if (verboseLevel>0) {
G4cerr << "G4VParticleChange::AddSecondary() Warning ";
G4cerr << "theListOfSecondaries is full !! " << G4endl;
G4cerr << " The object will not be added in theListOfSecondaries" << G4endl;
G4cout << "G4VParticleChange::AddSecondary() Warning ";
G4cout << "theListOfSecondaries is full !! " << G4endl;
G4cout << " The track is deleted " << G4endl;
}
#endif
G4Exception("G4ParticleChangeForRadDecay::AddSecondary",
"TRACK101", JustWarning,
"Secondary Bug is full. The track is deleted");
}
}
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForTransport.hh,v 1.17 2010-07-21 09:30:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// ------------------------------------------------------------
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForTransport.icc,v 1.13 2006-06-29 21:14:33 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
inline
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Step.hh,v 1.23 2010-11-10 08:42:47 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Step.icc,v 1.23 2010-11-10 08:42:47 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
+4 -3
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4StepPoint.hh,v 1.19 2008-10-24 08:22:20 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
@@ -49,8 +48,10 @@
#ifndef G4StepPoint_h
#define G4StepPoint_h 1
#include <cmath> // Include from 'system'
#include <CLHEP/Units/PhysicalConstants.h>
#include "globals.hh" // Include from 'global'
#include <cmath> // Include from 'system'
#include "G4Allocator.hh" // Include from 'global'
#include "G4ThreeVector.hh" // Include from 'geometry'
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
+2 -3
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4StepPoint.icc,v 1.14 2008-10-24 08:22:20 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
inline
@@ -126,7 +125,7 @@ inline
inline
G4double G4StepPoint::GetBeta() const
{ return fVelocity/c_light; }
{ return fVelocity/CLHEP::c_light; }
// Velocity of the track in unit of c(light velocity)
inline
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4StepStatus.hh,v 1.4 2006-06-29 21:14:43 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4SteppingControl.hh,v 1.4 2006-06-29 21:14:45 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
+10 -3
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Track.hh,v 1.23 2010-11-08 21:25:38 asaim Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
@@ -182,6 +181,9 @@ public: // With description
G4double CalculateVelocity() const;
G4double CalculateVelocityForOpticalPhoton() const;
G4bool UseGivenVelocity() const;
void UseGivenVelocity(G4bool val);
// polarization
const G4ThreeVector& GetPolarization() const;
void SetPolarization(const G4ThreeVector& aValue);
@@ -307,7 +309,12 @@ public: // With description
G4bool is_OpticalPhoton;
static G4VelocityTable* velTable;
};
G4bool useGivenVelocity;
// do not calclulate velocity and just use current fVelocity
// if this flag is set
};
#include "G4Track.icc"
+11 -6
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Track.icc,v 1.21 2010-11-08 21:25:38 asaim Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//-----------------------------------------------------------------
// Definitions of inline functions
@@ -58,8 +57,8 @@
{ aTrackAllocator.FreeSingle((G4Track *) aTrack);}
// Override "delete" for "G4Allocator".
inline G4bool G4Track::operator==( const G4Track& s)
{ return (this==&s); }
inline G4bool G4Track::operator==( const G4Track& trk)
{ return (this==&trk); }
// Define "==" operator because "G4TrackVector" uses
// "RWPtrOrderdVector" which requires this.
@@ -126,8 +125,14 @@
{ return fVelocity; }
inline void G4Track::SetVelocity(G4double val)
{ fVelocity = val; }
{ fVelocity = val; }
inline G4bool G4Track::UseGivenVelocity() const
{ return useGivenVelocity;}
inline void G4Track::UseGivenVelocity(G4bool val)
{ useGivenVelocity = val;}
// volume
inline G4VPhysicalVolume* G4Track::GetVolume() const
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4TrackFastVector.hh,v 1.5 2006-06-29 21:14:51 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// ------------------------------------------------------------
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4TrackStatus.hh,v 1.4 2006-06-29 21:14:53 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4TrackVector.hh,v 1.4 2010-11-10 08:42:47 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//---------------------------------------------------------------
//
+29 -14
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VParticleChange.hh,v 1.16 2007-03-25 22:54:52 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// ------------------------------------------------------------
@@ -74,6 +73,7 @@
// add flag for first/last step in volume 30 Oct. 2006 H.Kurashige
// add nonIonizingEnergyLoss 26 Mar 2007 H.Kurashige
// modify/fix bugs related to weight 17 Sep. 2011 H.Kurashige
// fix bugs related to weight 29 Apr. 2012 H.Kurashige
//
#ifndef G4VParticleChange_h
@@ -135,6 +135,7 @@ class G4VParticleChange
void InitializeLocalEnergyDeposit(const G4Track&);
void InitializeSteppingControl(const G4Track&);
void InitializeParentWeight(const G4Track&);
void InitializeParentGlobalTime(const G4Track&);
void InitializeStatusChange(const G4Track&);
void InitializeSecondaries(const G4Track&);
@@ -205,22 +206,33 @@ class G4VParticleChange
void ProposeWeight(G4double finalWeight);
void ProposeParentWeight(G4double finalWeight);
// Propse new weight of the parent (i.e. current) track
// As for AlongStepDoIt, the parent weight will be set
// in accumulated manner
// i.e.) If two processes propose weight of W1 and W2 respectively
// for the track with initial weight of W0
// the final weight is set to
// (W1/W0) * (W2/W0) * W0
void SetSecondaryWeightByProcess(G4bool);
G4bool IsSecondaryWeightSetByProcess() const;
// In default (fSecondaryWeightByProcess flag is true),
// In default (fSecondaryWeightByProcess flag is false),
// the weight of secondary tracks will be set to
// the parent weight
// If fSecondaryWeightByProcess flag is true,
// the weight of secondary tracks will not be changed
// by the ParticleChange
// (i.e. the process determine the secodary weight)
// If fSecondaryWeightByProcess flag is false, the weight of
// secondary tracks will be set to the parent weight
// NOTE:
// Make sure that only one processe in AlongStepDoIt
// proposes the parent weight,
// If several processes in AlongStepDoIt proposes
// the parent weight and add secondaties with
// fSecondaryWeightByProcess is set to false,
// secondary weights may be wrong
void SetParentWeightByProcess(G4bool);
// Weight of parent track can be changed only via ParticleChange
// If you set this flag to 'false',
// the weight of the parent track will not be modified,
// but the proposed weight is applied to secondaries
// (if SetSecondaryWeightByProcess is set to false)
G4bool IsParentWeightSetByProcess() const;
// Obsolete
virtual void DumpInfo() const;
// Print out information
@@ -258,8 +270,8 @@ class G4VParticleChange
// non-ionizing energu deposit is defined as
// a part of local energy deposit, which does not cause
// ionization of atoms
G4double theTrueStepLength;
G4double theTrueStepLength;
// The value of "True" Step Length
@@ -269,12 +281,15 @@ class G4VParticleChange
G4double theParentWeight;
// Weight ofparent track
G4bool isParentWeightSetByProcess;
G4bool isParentWeightProposed;
// flags for Weight ofparent track
G4bool fSetSecondaryWeightByProcess;
// flag for setting weight of secondaries
G4double theParentGlobalTime;
// global time of the parent.
// This is used only for checking
G4int verboseLevel;
// The Verbose level
+9 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VParticleChange.icc,v 1.16 2007-03-25 22:54:52 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// remove obsolete methods of SetXXX 19 Sep, 04 H.Kurashige
//----------------------------------------------------------------
@@ -202,6 +201,13 @@ inline void G4VParticleChange::InitializeParentWeight(const G4Track& track)
isParentWeightProposed = false;
}
inline void G4VParticleChange::InitializeParentGlobalTime(const G4Track& track)
{
// set the parent track's global time at the pre-step point
theParentGlobalTime = track.GetStep()->GetPreStepPoint()->GetGlobalTime();
}
inline void G4VParticleChange::InitializeTrueStepLength(const G4Track& track)
{
// Reset theTrueStepLength
@@ -276,6 +282,7 @@ inline void G4VParticleChange::Initialize(const G4Track& track)
InitializeTrueStepLength(track);
InitializeSecondaries(track);
InitializeParentWeight(track);
InitializeParentGlobalTime(track);
InitializeStepInVolumeFlags(track);
}
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VUserTrackInformation.hh,v 1.9 2010-03-09 02:49:44 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
@@ -66,6 +65,10 @@ class G4VUserTrackInformation
// String is provided to indicate Type of UserTrackInfo class
// User is recommended to set the type of his/her class
G4VUserTrackInformation(const G4VUserTrackInformation&);
G4VUserTrackInformation& operator=(const G4VUserTrackInformation&);
virtual ~G4VUserTrackInformation();
virtual void Print() const {};
+3 -4
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VelocityTable.hh,v 1.4 2011-08-10 08:42:47 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//---------------------------------------------------------------
//
@@ -79,7 +78,7 @@ class G4VelocityTable
size_t FindBinLocation(G4double theEnergy) const;
// Find the bin# in which theEnergy belongs - pure virtual function
G4double Interpolation(G4int lastBin) const;
G4double Interpolation() const;
G4double edgeMin; // Energy of first point
G4double edgeMax; // Energy of the last point
@@ -107,7 +106,7 @@ class G4VelocityTable
};
inline
G4double G4VelocityTable::Interpolation(G4int lastBin) const
G4double G4VelocityTable::Interpolation() const
{
// Linear interpolation is used to get the value. If the give energy
// is in the highest bin, no interpolation will be Done. Because
+9 -8
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4FieldTrackUpdator.cc,v 1.2 2006-12-13 15:49:45 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// M. Asai - first implementation Apr/28/2006
//
@@ -66,12 +65,14 @@ void G4FieldTrackUpdator::Update(G4FieldTrack* ftrk,const G4Track* trk)
trk->GetMomentumDirection(),
trk->GetKineticEnergy()
);
ftrk->SetChargeAndMoments(
trk->GetDynamicParticle()->GetCharge()
);
ftrk->SetSpin(
trk->GetDynamicParticle()->GetPolarization()
);
const G4DynamicParticle* ptDynamicParticle= trk->GetDynamicParticle();
ftrk->SetChargeAndMoments( ptDynamicParticle->GetCharge() );
// The charge can change during tracking
ftrk->SetSpin( ptDynamicParticle->GetPolarization() );
// The following properties must be updated ONCE for each new track (at least)
ftrk->SetRestMass(ptDynamicParticle->GetMass());
}
+127 -90
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChange.cc,v 1.32 2010-07-21 09:30:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// --------------------------------------------------------------
@@ -44,6 +43,8 @@
// --------------------------------------------------------------
#include "G4ParticleChange.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4TrackFastVector.hh"
@@ -51,8 +52,12 @@
#include "G4ExceptionSeverity.hh"
G4ParticleChange::G4ParticleChange()
: G4VParticleChange(), theEnergyChange(0.),
: G4VParticleChange(),
theMomentumDirectionChange(),
thePolarizationChange(),
theEnergyChange(0.),
theVelocityChange(0.), isVelocityChanged(false),
thePositionChange(),
theGlobalTime0(0.), theLocalTime0(0.),
theTimeChange(0.), theProperTimeChange(0.),
theMassChange(0.), theChargeChange(0.),
@@ -115,9 +120,12 @@ G4ParticleChange & G4ParticleChange::operator=(const G4ParticleChange &right)
}
delete theListOfSecondaries;
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theListOfSecondaries = new G4TrackFastVector();
theNumberOfSecondaries = right.theNumberOfSecondaries;
for (G4int index = 0; index<theNumberOfSecondaries; index++){
G4Track* newTrack = new G4Track(*((*right.theListOfSecondaries)[index] ));
theListOfSecondaries->SetElement(index, newTrack); }
theStatusChange = right.theStatusChange;
theCurrentTrack = right.theCurrentTrack;
@@ -161,7 +169,7 @@ void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
G4bool IsGoodForTracking )
{
// create track
G4Track* aTrack = new G4Track(aParticle, theTimeChange, thePositionChange);
G4Track* aTrack = new G4Track(aParticle, GetGlobalTime(), thePositionChange);
// set IsGoodGorTrackingFlag
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
@@ -178,7 +186,7 @@ void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
G4bool IsGoodForTracking )
{
// create track
G4Track* aTrack = new G4Track(aParticle, theTimeChange, newPosition);
G4Track* aTrack = new G4Track(aParticle, GetGlobalTime(), newPosition);
// set IsGoodGorTrackingFlag
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
@@ -314,20 +322,8 @@ G4Step* G4ParticleChange::UpdateStepForAlongStep(G4Step* pStep)
pPostStepPoint->AddProperTime( theProperTimeChange
- pPreStepPoint->GetProperTime());
if (isParentWeightProposed) {
// update weight
G4double newWeight= theParentWeight/(pPreStepPoint->GetWeight())
* (pPostStepPoint->GetWeight());
if (isParentWeightSetByProcess) pPostStepPoint->SetWeight( newWeight );
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(newWeight); ;
}
}
}
if (isParentWeightProposed ){
pPostStepPoint->SetWeight( theParentWeight );
}
#ifdef G4VERBOSE
@@ -348,7 +344,6 @@ G4Step* G4ParticleChange::UpdateStepForPostStep(G4Step* pStep)
// momentum vector.
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
G4Track* aTrack = pStep->GetTrack();
// Set Mass/Charge
pPostStepPoint->SetMass(theMassChange);
@@ -370,20 +365,12 @@ G4Step* G4ParticleChange::UpdateStepForPostStep(G4Step* pStep)
pPostStepPoint->SetLocalTime( theTimeChange );
pPostStepPoint->SetProperTime( theProperTimeChange );
if (isParentWeightProposed) {
// update weight
if( isParentWeightSetByProcess) pPostStepPoint->SetWeight( theParentWeight );
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(theParentWeight); ;
}
}
}
if (isParentWeightProposed ){
pPostStepPoint->SetWeight( theParentWeight );
}
#ifdef G4VERBOSE
G4Track* aTrack = pStep->GetTrack();
if (debugFlag) CheckIt(*aTrack);
#endif
@@ -397,7 +384,6 @@ G4Step* G4ParticleChange::UpdateStepForAtRest(G4Step* pStep)
// A physics process always calculates the final state of the particle
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
G4Track* aTrack = pStep->GetTrack();
// Set Mass/Charge
pPostStepPoint->SetMass(theMassChange);
@@ -419,20 +405,12 @@ G4Step* G4ParticleChange::UpdateStepForAtRest(G4Step* pStep)
pPostStepPoint->SetLocalTime( theTimeChange );
pPostStepPoint->SetProperTime( theProperTimeChange );
if (isParentWeightProposed ) {
// update weight
if (isParentWeightSetByProcess) pPostStepPoint->SetWeight( theParentWeight );
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(theParentWeight); ;
}
}
}
if (isParentWeightProposed ){
pPostStepPoint->SetWeight( theParentWeight );
}
#ifdef G4VERBOSE
G4Track* aTrack = pStep->GetTrack();
if (debugFlag) CheckIt(*aTrack);
#endif
@@ -509,24 +487,35 @@ G4bool G4ParticleChange::CheckIt(const G4Track& aTrack)
{
G4bool exitWithError = false;
G4double accuracy;
static G4int nError = 0;
#ifdef G4VERBOSE
const G4int maxError = 30;
#endif
// No check in case of "fStopAndKill"
if (GetTrackStatus() == fStopAndKill ) {
return G4VParticleChange::CheckIt(aTrack);
}
if (GetTrackStatus() == fStopAndKill ) return G4VParticleChange::CheckIt(aTrack);
// MomentumDirection should be unit vector
G4bool itsOKforMomentum = true;
if ( theEnergyChange >0.) {
accuracy = std::fabs(theMomentumDirectionChange.mag2()-1.0);
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the Momentum Change is not unit vector !!" << G4endl;
G4cout << " Difference: " << accuracy << G4endl;
#endif
itsOKforMomentum = false;
if (accuracy > accuracyForException) exitWithError = true;
nError += 1;
exitWithError = exitWithError || (accuracy > accuracyForException);
#ifdef G4VERBOSE
if (nError < maxError) {
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the Momentum Change is not unit vector !!"
<< " Difference: " << accuracy << G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
}
#endif
}
}
@@ -534,67 +523,118 @@ G4bool G4ParticleChange::CheckIt(const G4Track& aTrack)
G4bool itsOKforGlobalTime = true;
accuracy = (aTrack.GetLocalTime()- theTimeChange)/ns;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the local time goes back !!" << G4endl;
G4cout << " Difference: " << accuracy << "[ns] " <<G4endl;
#endif
itsOKforGlobalTime = false;
if (accuracy > accuracyForException) exitWithError = true;
nError += 1;
exitWithError = exitWithError || (accuracy > accuracyForException);
#ifdef G4VERBOSE
if (nError < maxError) {
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the local time goes back !!"
<< " Difference: " << accuracy << "[ns] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<< " global time=" << aTrack.GetGlobalTime()/ns
<< " local time=" << aTrack.GetLocalTime()/ns
<< " proper time=" << aTrack.GetProperTime()/ns
<< G4endl;
}
#endif
}
G4bool itsOKforProperTime = true;
accuracy = (aTrack.GetProperTime() - theProperTimeChange )/ns;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the proper time goes back !!" << G4endl;
G4cout << " Difference: " << accuracy << "[ns] " <<G4endl;
#endif
itsOKforProperTime = false;
if (accuracy > accuracyForException) exitWithError = true;
nError += 1;
exitWithError = exitWithError || (accuracy > accuracyForException);
#ifdef G4VERBOSE
if (nError < maxError) {
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the proper time goes back !!"
<< " Difference: " << accuracy << "[ns] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<< " global time=" << aTrack.GetGlobalTime()/ns
<< " local time=" << aTrack.GetLocalTime()/ns
<< " proper time=" << aTrack.GetProperTime()/ns
<<G4endl;
}
#endif
}
// Kinetic Energy should not be negative
G4bool itsOKforEnergy = true;
accuracy = -1.0*theEnergyChange/MeV;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the kinetic energy is negative !!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
#endif
itsOKforEnergy = false;
if (accuracy > accuracyForException) exitWithError = true;
nError += 1;
exitWithError = exitWithError || (accuracy > accuracyForException);
#ifdef G4VERBOSE
if (nError < maxError) {
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the kinetic energy is negative !!"
<< " Difference: " << accuracy << "[MeV] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
}
#endif
}
// Velocity should not be less than c_light
G4bool itsOKforVelocity = true;
if (theVelocityChange < 0.) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the velocity is negative !!" << G4endl;
G4cout << " Velocity: " << theVelocityChange/c_light <<G4endl;
#endif
itsOKforVelocity = false;
nError += 1;
exitWithError = true;
#ifdef G4VERBOSE
if (nError < maxError) {
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the velocity is negative !!"
<< " Velocity: " << theVelocityChange/c_light <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
}
#endif
}
accuracy = theVelocityChange/c_light - 1.0;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the velocity is greater than c_light !!" << G4endl;
G4cout << " Velocity: " << theVelocityChange/c_light <<G4endl;
#endif
itsOKforVelocity = false;
if (accuracy > accuracyForException) exitWithError = true;
}
nError += 1;
exitWithError = exitWithError || (accuracy > accuracyForException);
#ifdef G4VERBOSE
if (nError < maxError) {
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the velocity is greater than c_light !!" << G4endl;
G4cout << " Velocity: " << theVelocityChange/c_light <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
}
#endif
}
G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforVelocity && itsOKforProperTime && itsOKforGlobalTime;
// dump out information of this particle change
#ifdef G4VERBOSE
if (!itsOK) {
G4cout << " G4ParticleChange::CheckIt " <<G4endl;
DumpInfo();
}
#endif
@@ -611,7 +651,7 @@ G4bool G4ParticleChange::CheckIt(const G4Track& aTrack)
theMomentumDirectionChange = (1./vmag)*theMomentumDirectionChange;
}
if (!itsOKforGlobalTime) {
theTimeChange = aTrack.GetGlobalTime();
theTimeChange = aTrack.GetLocalTime();
}
if (!itsOKforProperTime) {
theProperTimeChange = aTrack.GetProperTime();
@@ -626,6 +666,3 @@ G4bool G4ParticleChange::CheckIt(const G4Track& aTrack)
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
return itsOK;
}
+23 -42
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForDecay.cc,v 1.12 2010-07-21 09:30:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// --------------------------------------------------------------
@@ -39,6 +38,7 @@
// --------------------------------------------------------------
#include "G4ParticleChangeForDecay.hh"
#include "G4SystemOfUnits.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4TrackFastVector.hh"
@@ -65,7 +65,6 @@ G4ParticleChangeForDecay::~G4ParticleChangeForDecay()
#endif
}
// copy and assignment operators are implemented as "shallow copy"
G4ParticleChangeForDecay::G4ParticleChangeForDecay(const G4ParticleChangeForDecay &right): G4VParticleChange(right)
{
theGlobalTime0 = right.theGlobalTime0;
@@ -90,10 +89,12 @@ G4ParticleChangeForDecay & G4ParticleChangeForDecay::operator=(const G4ParticleC
}
}
delete theListOfSecondaries;
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theListOfSecondaries = new G4TrackFastVector();
theNumberOfSecondaries = right.theNumberOfSecondaries;
for (G4int index = 0; index<theNumberOfSecondaries; index++){
G4Track* newTrack = new G4Track(*((*right.theListOfSecondaries)[index] ));
theListOfSecondaries->SetElement(index, newTrack); }
theStatusChange = right.theStatusChange;
theTrueStepLength = right.theTrueStepLength;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
@@ -144,20 +145,8 @@ void G4ParticleChangeForDecay::Initialize(const G4Track& track)
G4Step* G4ParticleChangeForDecay::UpdateStepForPostStep(G4Step* pStep)
{
if (isParentWeightProposed) {
// update weight
if (isParentWeightSetByProcess) {
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
pPostStepPoint->SetWeight( theParentWeight );
}
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(theParentWeight); ;
}
}
}
if (isParentWeightProposed ){
pStep->GetPostStepPoint()->SetWeight( theParentWeight );
}
// Update the G4Step specific attributes
@@ -184,18 +173,7 @@ G4Step* G4ParticleChangeForDecay::UpdateStepForAtRest(G4Step* pStep)
if (debugFlag) CheckIt(*aTrack);
#endif
if (isParentWeightProposed ) {
// update weight
if (isParentWeightSetByProcess) pPostStepPoint->SetWeight( theParentWeight );
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(theParentWeight); ;
}
}
}
}
if (isParentWeightProposed )pPostStepPoint->SetWeight( theParentWeight );
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
@@ -218,25 +196,28 @@ G4bool G4ParticleChangeForDecay::CheckIt(const G4Track& aTrack)
G4double accuracy;
// global time should not go back
// local time should not go back
G4bool itsOK =true;
accuracy = -1.0*(theTimeChange - theLocalTime0)/ns;
if (accuracy > accuracyForWarning) {
itsOK = false;
exitWithError = (accuracy > accuracyForException);
#ifdef G4VERBOSE
G4cout << " G4ParticleChangeForDecay::CheckIt : ";
G4cout << "the global time goes back !!" << G4endl;
G4cout << " Difference: " << accuracy << "[ns] " <<G4endl;
G4cout << "the local time goes back !!"
<< " Difference: " << accuracy << "[ns] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
#endif
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// dump out information of this particle change
#ifdef G4VERBOSE
if (!itsOK) {
G4cout << " G4ParticleChangeForDecay::CheckIt " <<G4endl;
DumpInfo();
}
if (!itsOK) DumpInfo();
#endif
// Exit with error
@@ -248,7 +229,7 @@ G4bool G4ParticleChangeForDecay::CheckIt(const G4Track& aTrack)
// correction
if (!itsOK) {
theTimeChange = aTrack.GetGlobalTime();
theTimeChange = aTrack.GetLocalTime();
}
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
+24 -38
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForGamma.cc,v 1.4 2010-07-21 09:30:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// --------------------------------------------------------------
@@ -41,6 +40,7 @@
// ------------------------------------------------------------
//
#include "G4ParticleChangeForGamma.hh"
#include "G4SystemOfUnits.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4DynamicParticle.hh"
@@ -101,10 +101,12 @@ G4ParticleChangeForGamma & G4ParticleChangeForGamma::operator=(
}
}
delete theListOfSecondaries;
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theListOfSecondaries = new G4TrackFastVector();
theNumberOfSecondaries = right.theNumberOfSecondaries;
for (G4int index = 0; index<theNumberOfSecondaries; index++){
G4Track* newTrack = new G4Track(*((*right.theListOfSecondaries)[index] ));
theListOfSecondaries->SetElement(index, newTrack); }
theStatusChange = right.theStatusChange;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
@@ -126,21 +128,11 @@ G4Step* G4ParticleChangeForGamma::UpdateStepForAtRest(G4Step* pStep)
{
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
pStep->SetStepLength( 0.0 );
if (isParentWeightProposed) {
if (isParentWeightSetByProcess) {
// update weight
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
pPostStepPoint->SetWeight( theParentWeight );
}
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(theParentWeight); ;
}
}
}
if (isParentWeightProposed ){
pStep->GetPostStepPoint()->SetWeight( theParentWeight );
}
return pStep;
}
@@ -152,18 +144,9 @@ G4Step* G4ParticleChangeForGamma::UpdateStepForPostStep(G4Step* pStep)
pPostStepPoint->SetPolarization( proposedPolarization );
if (isParentWeightProposed ){
// update weight
if (isParentWeightSetByProcess) pPostStepPoint->SetWeight( theParentWeight );
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(theParentWeight); ;
}
}
}
pPostStepPoint->SetWeight( theParentWeight );
}
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
pStep->AddNonIonizingEnergyDeposit( theNonIonizingEnergyDeposit );
return pStep;
@@ -214,21 +197,24 @@ G4bool G4ParticleChangeForGamma::CheckIt(const G4Track& aTrack)
// Energy should not be lager than initial value
accuracy = ( proposedKinEnergy - aTrack.GetKineticEnergy())/MeV;
if (accuracy > accuracyForWarning) {
itsOK = false;
exitWithError = (accuracy > accuracyForException);
#ifdef G4VERBOSE
G4cout << "G4ParticleChangeForGamma::CheckIt: ";
G4cout << "KinEnergy become larger than the initial value!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
G4cout << "KinEnergy become larger than the initial value!"
<< " Difference: " << accuracy << "[MeV] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<< G4endl;
#endif
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// dump out information of this particle change
#ifdef G4VERBOSE
if (!itsOK) {
G4cout << "G4ParticleChangeForGamma::CheckIt " << G4endl;
DumpInfo();
}
if (!itsOK) DumpInfo();
#endif
// Exit with error
+22 -38
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForLoss.cc,v 1.18 2010-07-21 09:30:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// --------------------------------------------------------------
@@ -43,6 +42,7 @@
// ------------------------------------------------------------
//
#include "G4ParticleChangeForLoss.hh"
#include "G4SystemOfUnits.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4DynamicParticle.hh"
@@ -108,16 +108,17 @@ G4ParticleChangeForLoss & G4ParticleChangeForLoss::operator=(
}
}
delete theListOfSecondaries;
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theListOfSecondaries = new G4TrackFastVector();
theNumberOfSecondaries = right.theNumberOfSecondaries;
for (G4int index = 0; index<theNumberOfSecondaries; index++){
G4Track* newTrack = new G4Track(*((*right.theListOfSecondaries)[index] ));
theListOfSecondaries->SetElement(index, newTrack); }
theStatusChange = right.theStatusChange;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
theParentWeight = right.theParentWeight;
isParentWeightProposed = right.isParentWeightProposed;
isParentWeightSetByProcess = right.isParentWeightSetByProcess;
fSetSecondaryWeightByProcess = right.fSetSecondaryWeightByProcess;
currentTrack = right.currentTrack;
@@ -166,21 +167,24 @@ G4bool G4ParticleChangeForLoss::CheckIt(const G4Track& aTrack)
// Energy should not be lager than initial value
accuracy = ( proposedKinEnergy - aTrack.GetKineticEnergy())/MeV;
if (accuracy > accuracyForWarning) {
itsOK = false;
exitWithError = (accuracy > accuracyForException);
#ifdef G4VERBOSE
G4cout << "G4ParticleChangeForLoss::CheckIt: ";
G4cout << "KinEnergy become larger than the initial value!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
G4cout << "KinEnergy become larger than the initial value!"
<< " Difference: " << accuracy << "[MeV] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
#endif
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// dump out information of this particle change
#ifdef G4VERBOSE
if (!itsOK) {
G4cout << "G4ParticleChangeForLoss::CheckIt " << G4endl;
DumpInfo();
}
if (!itsOK) DumpInfo();
#endif
// Exit with error
@@ -224,20 +228,8 @@ G4Step* G4ParticleChangeForLoss::UpdateStepForAlongStep(G4Step* pStep)
pPostStepPoint->SetVelocity(pStep->GetTrack()->CalculateVelocity());
pStep->GetTrack()->SetKineticEnergy(pStep->GetPreStepPoint()->GetKineticEnergy());
if (isParentWeightProposed) {
// update weight
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
G4double newWeight= theParentWeight/(pPreStepPoint->GetWeight())
* (pPostStepPoint->GetWeight());
if (isParentWeightSetByProcess) pPostStepPoint->SetWeight( newWeight );
if (!fSetSecondaryWeightByProcess) {
//Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(newWeight); ;
}
}
}
if (isParentWeightProposed ){
pPostStepPoint->SetWeight( theParentWeight );
}
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
@@ -255,16 +247,8 @@ G4Step* G4ParticleChangeForLoss::UpdateStepForPostStep(G4Step* pStep)
pPostStepPoint->SetVelocity(pStep->GetTrack()->CalculateVelocity());
pPostStepPoint->SetPolarization( proposedPolarization );
if (isParentWeightProposed) {
if (isParentWeightSetByProcess) pPostStepPoint->SetWeight( theParentWeight );
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight( theParentWeight );
}
}
}
if (isParentWeightProposed ){
pPostStepPoint->SetWeight( theParentWeight );
}
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
+23 -11
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForMSC.cc,v 1.15 2010-07-21 09:30:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// --------------------------------------------------------------
@@ -39,6 +38,7 @@
// --------------------------------------------------------------
#include "G4ParticleChangeForMSC.hh"
#include "G4SystemOfUnits.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4DynamicParticle.hh"
@@ -106,12 +106,21 @@ G4Step* G4ParticleChangeForMSC::UpdateStepForAlongStep(G4Step* pStep)
// Update the G4Step specific attributes
pStep->SetStepLength(theTrueStepLength);
theStatusChange = pStep->GetTrack()->GetTrackStatus();
// Multiple scattering calculates the final state of the particle
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
// update momentum direction
pPostStepPoint->SetMomentumDirection(theMomentumDirection);
// update position
pPostStepPoint->SetPosition( thePosition );
return pStep;
}
G4Step* G4ParticleChangeForMSC::UpdateStepForPostStep(G4Step* pStep)
{
// A physics process always calculates the final state of the particle
// Multiple scattering calculates the final state of the particle
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
// update momentum direction
@@ -169,21 +178,24 @@ G4bool G4ParticleChangeForMSC::CheckIt(const G4Track& aTrack)
// MomentumDirection should be unit vector
accuracy = std::fabs(theMomentumDirection.mag2()-1.0);
if (accuracy > accuracyForWarning) {
itsOK = false;
exitWithError = (accuracy > accuracyForException);
#ifdef G4VERBOSE
G4cout << " G4ParticleChangeForMSC::CheckIt : ";
G4cout << "the Momentum Change is not unit vector !!" << G4endl;
G4cout << " Difference: " << accuracy << G4endl;
G4cout << "the Momentum Change is not unit vector !!"
<< " Difference: " << accuracy << G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
#endif
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// dump out information of this particle change
#ifdef G4VERBOSE
if (!itsOK) {
G4cout << " G4ParticleChangeForMSC::CheckIt " <<G4endl;
DumpInfo();
}
if (!itsOK) DumpInfo();
#endif
// Exit with error
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForTransport.cc,v 1.20 2010-07-21 09:30:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// --------------------------------------------------------------
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Step.cc,v 1.11 2010-10-30 07:49:08 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4StepPoint.cc,v 1.15 2010-10-30 07:49:09 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
+12 -7
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Track.cc,v 1.35 2010-09-21 00:33:05 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
@@ -41,6 +40,7 @@
// Use G4VelocityTable 17 AUg. 2011 H.Kurashige
#include "G4Track.hh"
#include "G4PhysicalConstants.hh"
#include "G4ParticleTable.hh"
#include "G4VelocityTable.hh"
@@ -71,7 +71,8 @@ G4Track::G4Track(G4DynamicParticle* apValueDynamicParticle,
fpUserInformation(0),
prev_mat(0), groupvel(0),
prev_velocity(0.0), prev_momentum(0.0),
is_OpticalPhoton(false)
is_OpticalPhoton(false),
useGivenVelocity(false)
{
static G4bool isFirstTime = true;
static G4ParticleDefinition* fOpticalPhoton =0;
@@ -107,7 +108,8 @@ G4Track::G4Track()
fpUserInformation(0),
prev_mat(0), groupvel(0),
prev_velocity(0.0), prev_momentum(0.0),
is_OpticalPhoton(false)
is_OpticalPhoton(false),
useGivenVelocity(false)
{
}
//////////////////
@@ -128,7 +130,8 @@ G4Track::G4Track(const G4Track& right)
fpUserInformation(0),
prev_mat(0), groupvel(0),
prev_velocity(0.0), prev_momentum(0.0),
is_OpticalPhoton(false)
is_OpticalPhoton(false),
useGivenVelocity(false)
{
*this = right;
}
@@ -190,7 +193,8 @@ G4Track & G4Track::operator=(const G4Track &right)
prev_velocity = right.prev_velocity;
prev_momentum = right.prev_momentum;
is_OpticalPhoton = right.is_OpticalPhoton;
is_OpticalPhoton = right.is_OpticalPhoton;
useGivenVelocity = right.useGivenVelocity;
}
return *this;
}
@@ -206,7 +210,8 @@ void G4Track::CopyTrackInfo(const G4Track& right)
G4double G4Track::CalculateVelocity() const
///////////////////
{
if (useGivenVelocity) return fVelocity;
G4double velocity = c_light ;
G4double mass = fpDynamicParticle->GetMass();
+168 -130
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VParticleChange.cc,v 1.22 2010-07-21 09:30:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// --------------------------------------------------------------
@@ -37,6 +36,7 @@
// --------------------------------------------------------------
#include "G4VParticleChange.hh"
#include "G4SystemOfUnits.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4TrackFastVector.hh"
@@ -45,7 +45,8 @@
const G4double G4VParticleChange::accuracyForWarning = 1.0e-9;
const G4double G4VParticleChange::accuracyForException = 0.001;
G4VParticleChange::G4VParticleChange():
G4VParticleChange::G4VParticleChange()
:theListOfSecondaries(0),
theNumberOfSecondaries(0),
theSizeOftheListOfSecondaries(G4TrackFastVectorSize),
theStatusChange(fAlive),
@@ -56,9 +57,9 @@ G4VParticleChange::G4VParticleChange():
theFirstStepInVolume(false),
theLastStepInVolume(false),
theParentWeight(1.0),
isParentWeightSetByProcess(true),
isParentWeightProposed(false),
fSetSecondaryWeightByProcess(true),
fSetSecondaryWeightByProcess(false),
theParentGlobalTime(0.0),
verboseLevel(1),
debugFlag(false)
{
@@ -85,25 +86,30 @@ G4VParticleChange::~G4VParticleChange() {
delete theListOfSecondaries;
}
// copy and assignment operators are implemented as "shallow copy"
G4VParticleChange::G4VParticleChange(const G4VParticleChange &right):
theListOfSecondaries(right.theListOfSecondaries),
theNumberOfSecondaries(right.theNumberOfSecondaries),
theSizeOftheListOfSecondaries(right.theSizeOftheListOfSecondaries),
theStatusChange( right.theStatusChange),
theSteppingControlFlag(right.theSteppingControlFlag),
theLocalEnergyDeposit(right.theLocalEnergyDeposit),
theNonIonizingEnergyDeposit(right.theNonIonizingEnergyDeposit),
theTrueStepLength(right.theTrueStepLength),
theFirstStepInVolume( right.theFirstStepInVolume),
theLastStepInVolume(right.theLastStepInVolume),
theParentWeight(right.theParentWeight),
isParentWeightSetByProcess(true),
isParentWeightProposed(false),
fSetSecondaryWeightByProcess(right.fSetSecondaryWeightByProcess),
verboseLevel(right.verboseLevel),
debugFlag(right.debugFlag)
G4VParticleChange::G4VParticleChange(const G4VParticleChange &right)
:theListOfSecondaries(0),
theNumberOfSecondaries(0),
theSizeOftheListOfSecondaries(G4TrackFastVectorSize),
theStatusChange( right.theStatusChange),
theSteppingControlFlag(right.theSteppingControlFlag),
theLocalEnergyDeposit(right.theLocalEnergyDeposit),
theNonIonizingEnergyDeposit(right.theNonIonizingEnergyDeposit),
theTrueStepLength(right.theTrueStepLength),
theFirstStepInVolume( right.theFirstStepInVolume),
theLastStepInVolume(right.theLastStepInVolume),
theParentWeight(right.theParentWeight),
isParentWeightProposed(false),
fSetSecondaryWeightByProcess(right.fSetSecondaryWeightByProcess),
theParentGlobalTime(0.0),
verboseLevel(right.verboseLevel),
debugFlag(right.debugFlag)
{
theListOfSecondaries = new G4TrackFastVector();
theNumberOfSecondaries = right.theNumberOfSecondaries;
for (G4int index = 0; index<theNumberOfSecondaries; index++){
G4Track* newTrack = new G4Track(*((*right.theListOfSecondaries)[index] ));
theListOfSecondaries->SetElement(index, newTrack);
}
}
@@ -122,10 +128,13 @@ G4VParticleChange & G4VParticleChange::operator=(const G4VParticleChange &right)
}
}
delete theListOfSecondaries;
theListOfSecondaries = right.theListOfSecondaries;
theListOfSecondaries = new G4TrackFastVector();
theNumberOfSecondaries = right.theNumberOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
for (G4int index = 0; index<theNumberOfSecondaries; index++){
G4Track* newTrack = new G4Track(*((*right.theListOfSecondaries)[index] ));
theListOfSecondaries->SetElement(index, newTrack);
}
theStatusChange = right.theStatusChange;
theSteppingControlFlag = right.theSteppingControlFlag;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
@@ -136,10 +145,11 @@ G4VParticleChange & G4VParticleChange::operator=(const G4VParticleChange &right)
theLastStepInVolume = right.theLastStepInVolume;
theParentWeight = right.theParentWeight;
isParentWeightSetByProcess = right.isParentWeightSetByProcess;
isParentWeightProposed = right.isParentWeightProposed;
fSetSecondaryWeightByProcess = right.fSetSecondaryWeightByProcess;
theParentGlobalTime = right.theParentGlobalTime;
verboseLevel = right.verboseLevel;
debugFlag = right.debugFlag;
@@ -157,12 +167,15 @@ G4bool G4VParticleChange::operator!=(const G4VParticleChange &right) const
{
return (this != (G4VParticleChange *) &right);
}
void G4VParticleChange::AddSecondary(G4Track *aTrack)
{
if (debugFlag) CheckSecondary(*aTrack);
// add a secondary after size check
if (theSizeOftheListOfSecondaries > theNumberOfSecondaries) {
// Set weight of secondary tracks
if (!fSetSecondaryWeightByProcess) aTrack->SetWeight(theParentWeight);
theListOfSecondaries->SetElement(theNumberOfSecondaries, aTrack);
theNumberOfSecondaries++;
} else {
@@ -206,18 +219,7 @@ G4Step* G4VParticleChange::UpdateStepInfo(G4Step* pStep)
G4Step* G4VParticleChange::UpdateStepForAtRest(G4Step* Step)
{
if (isParentWeightProposed ){
if (isParentWeightSetByProcess) {
Step->GetPostStepPoint()->SetWeight( theParentWeight );
}
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(theParentWeight); ;
}
}
}
Step->GetPostStepPoint()->SetWeight( theParentWeight );
}
return UpdateStepInfo(Step);
}
@@ -226,42 +228,19 @@ G4Step* G4VParticleChange::UpdateStepForAtRest(G4Step* Step)
G4Step* G4VParticleChange::UpdateStepForAlongStep(G4Step* Step)
{
if (isParentWeightProposed ){
// Weight is relaclulated
G4double newWeight= theParentWeight/(Step->GetPreStepPoint()->GetWeight())*(Step->GetPostStepPoint()->GetWeight());
if (isParentWeightSetByProcess) {
Step->GetPostStepPoint()->SetWeight( newWeight );
}
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(newWeight); ;
}
}
}
}
G4double initialWeight = Step->GetPreStepPoint()->GetWeight();
G4double currentWeight = Step->GetPostStepPoint()->GetWeight();
G4double finalWeight = (theParentWeight/initialWeight)*currentWeight;
Step->GetPostStepPoint()->SetWeight( finalWeight );
}
return UpdateStepInfo(Step);
}
G4Step* G4VParticleChange::UpdateStepForPostStep(G4Step* Step)
{
if (isParentWeightProposed) {
if (isParentWeightSetByProcess) {
Step->GetPostStepPoint()->SetWeight( theParentWeight );
}
if (!fSetSecondaryWeightByProcess) {
// Set weight of secondary tracks
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) {
((*theListOfSecondaries)[index])->SetWeight(theParentWeight); ;
}
}
}
if (isParentWeightProposed ){
Step->GetPostStepPoint()->SetWeight( theParentWeight );
}
return UpdateStepInfo(Step);
}
@@ -334,43 +313,67 @@ void G4VParticleChange::DumpInfo() const
G4cout.precision(olprc);
}
G4bool G4VParticleChange::CheckIt(const G4Track& )
G4bool G4VParticleChange::CheckIt(const G4Track&
#ifdef G4VERBOSE
aTrack
#endif
)
{
G4bool exitWithError = false;
G4double accuracy;
static G4int nError = 0;
#ifdef G4VERBOSE
const G4int maxError = 30;
#endif
// Energy deposit should not be negative
G4bool itsOKforEnergy = true;
accuracy = -1.0*theLocalEnergyDeposit/MeV;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4VParticleChange::CheckIt : ";
G4cout << "the energy deposit is negative !!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
#endif
itsOKforEnergy = false;
if (accuracy > accuracyForException) exitWithError = true;
nError += 1;
exitWithError = (accuracy > accuracyForException);
#ifdef G4VERBOSE
if (nError < maxError) {
G4cout << " G4VParticleChange::CheckIt : ";
G4cout << "the energy deposit is negative !!"
<< " Difference: " << accuracy << "[MeV] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
}
#endif
}
// true path length should not be negative
G4bool itsOKforStepLength = true;
accuracy = -1.0*theTrueStepLength/mm;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4VParticleChange::CheckIt : ";
G4cout << "the true step length is negative !!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
#endif
itsOKforStepLength = false;
if (accuracy > accuracyForException) exitWithError = true;
}
G4bool itsOK = itsOKforStepLength && itsOKforEnergy ;
// dump out information of this particle change
nError += 1;
exitWithError = (accuracy > accuracyForException);
#ifdef G4VERBOSE
if (! itsOK ){
G4cout << " G4VParticleChange::CheckIt " <<G4endl;
if (nError < maxError) {
G4cout << " G4VParticleChange::CheckIt : ";
G4cout << "the true step length is negative !!"
<< " Difference: " << accuracy << "[MeV] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
}
#endif
}
#ifdef G4VERBOSE
if (!itsOKforStepLength || !itsOKforEnergy ){
// dump out information of this particle change
DumpInfo();
}
#endif
@@ -379,7 +382,7 @@ G4bool G4VParticleChange::CheckIt(const G4Track& )
if (exitWithError) {
G4Exception("G4VParticleChange::CheckIt",
"TRACK001", EventMustBeAborted,
"Step length and/or energy deposit was illegal");
"Step length and/or energy deposit was illegal");
}
// correction
@@ -389,51 +392,99 @@ G4bool G4VParticleChange::CheckIt(const G4Track& )
if ( !itsOKforEnergy ) {
theLocalEnergyDeposit = 0.0;
}
return itsOK;
return (itsOKforStepLength && itsOKforEnergy );
}
G4bool G4VParticleChange::CheckSecondary(G4Track& aTrack)
{
G4bool exitWithError = false;
G4double accuracy;
static G4int nError = 0;
#ifdef G4VERBOSE
const G4int maxError = 30;
#endif
// MomentumDirection should be unit vector
G4bool itsOKforMomentum = true;
accuracy = std::fabs((aTrack.GetMomentumDirection()).mag2()-1.0);
if (accuracy > accuracyForWarning) {
if (aTrack.GetKineticEnergy()>0.){
accuracy = std::fabs((aTrack.GetMomentumDirection()).mag2()-1.0);
if (accuracy > accuracyForWarning) {
itsOKforMomentum = false;
nError += 1;
exitWithError = exitWithError || (accuracy > accuracyForException);
#ifdef G4VERBOSE
G4cout << " G4VParticleChange::CheckSecondary : ";
G4cout << "the Momentum direction is not unit vector !!" << G4endl;
G4cout << " Difference: " << accuracy << G4endl;
if (nError < maxError) {
G4cout << " G4VParticleChange::CheckSecondary : ";
G4cout << "the Momentum direction is not unit vector !! "
<< " Difference: " << accuracy << G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
}
#endif
itsOKforMomentum = false;
if (accuracy > accuracyForException) exitWithError = true;
}
}
// Kinetic Energy should not be negative
G4bool itsOKforEnergy;
G4bool itsOKforEnergy = true;
accuracy = -1.0*(aTrack.GetKineticEnergy())/MeV;
if (accuracy < accuracyForWarning) {
itsOKforEnergy = true;
} else {
#ifdef G4VERBOSE
G4cout << " G4VParticleChange::CheckSecondary : ";
G4cout << "the kinetic energy is negative !!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
#endif
if (accuracy > accuracyForWarning) {
itsOKforEnergy = false;
if (accuracy < accuracyForException) { exitWithError = false;}
else { exitWithError = true; }
nError += 1;
exitWithError = exitWithError || (accuracy > accuracyForException);
#ifdef G4VERBOSE
if (nError < maxError) {
G4cout << " G4VParticleChange::CheckSecondary : ";
G4cout << "the kinetic energy is negative !!"
<< " Difference: " << accuracy << "[MeV] " <<G4endl;
G4cout << " G4VParticleChange::CheckSecondary : ";
G4cout << "the global time of secondary is earlier than the parent !!"
<< " Difference: " << accuracy << "[ns] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<<G4endl;
}
#endif
}
// Check timing of secondaries
G4bool itsOKforTiming = true;
accuracy = (theParentGlobalTime - aTrack.GetGlobalTime())/ns;
if (accuracy > accuracyForWarning){
itsOKforTiming = false;
nError += 1;
exitWithError = (accuracy > accuracyForException);
#ifdef G4VERBOSE
if (nError < maxError) {
G4cout << " G4VParticleChange::CheckSecondary : ";
G4cout << "the global time of secondary goes back comapared to the parent !!"
<< " Difference: " << accuracy << "[ns] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
<< ", " << aTrack.GetPosition().y()/m
<< ", " << aTrack.GetPosition().z()/m
<< " time=" << aTrack.GetGlobalTime()/ns
<< " parent time=" << theParentGlobalTime/ns
<<G4endl;
}
#endif
}
// Exit with error
if (exitWithError) {
G4Exception("G4VParticleChange::CheckSecondary",
"TRACK002", EventMustBeAborted,
"Momentum, and/or energy was illegal");
"TRACK001", EventMustBeAborted,
"Secondary with illegal energy/momentum ");
}
G4bool itsOK = itsOKforMomentum && itsOKforEnergy;
G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforTiming;
//correction
if (!itsOKforMomentum) {
@@ -459,28 +510,15 @@ G4double G4VParticleChange::GetAccuracyForException() const
}
/////////////////////////////////////////////////////////
void G4VParticleChange::SetParentWeightByProcess(G4bool val)
///////////////////////////////////////////////////////////
//Obsolete methods for parent weight
/////////////////////
void G4VParticleChange::SetParentWeightByProcess(G4bool )
{
isParentWeightSetByProcess = val;
}
G4bool G4VParticleChange::IsParentWeightSetByProcess() const
{
return isParentWeightSetByProcess;
return true;
}
+19 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VUserTrackInformation.cc,v 1.4 2010-03-09 02:49:44 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// --------------------------------------------------------------
@@ -46,6 +45,24 @@ G4VUserTrackInformation::~G4VUserTrackInformation()
if (pType!=0) delete pType;
}
G4VUserTrackInformation::G4VUserTrackInformation(const G4VUserTrackInformation& right)
:pType(0)
{
if (right.pType!=0) pType = new G4String(*(right.pType));
}
G4VUserTrackInformation& G4VUserTrackInformation::operator=(const G4VUserTrackInformation& right)
{
if (this != &right) {
if (pType !=0) delete pType;
if (right.pType) pType = new G4String(*(right.pType));
else pType=0;
}
return *this;
}
const G4String& G4VUserTrackInformation::GetType() const
{
static const G4String NOTYPE="NONE";
+4 -4
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VelocityTable.cc,v 1.11 2010-10-30 07:49:08 kurasige Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//---------------------------------------------------------------
@@ -41,6 +40,7 @@
//
#include "G4VelocityTable.hh"
#include "G4PhysicalConstants.hh"
#include "G4StateManager.hh"
#include "G4ApplicationState.hh"
@@ -132,7 +132,7 @@ G4double G4VelocityTable::Value(G4double theEnergy)
} else if( theEnergy < lastEnergy
&& theEnergy >= binVector[lastBin]) {
lastEnergy = theEnergy;
lastValue = Interpolation(lastBin);
lastValue = Interpolation();
} else if( theEnergy <= edgeMin ) {
lastBin = 0;
@@ -147,7 +147,7 @@ G4double G4VelocityTable::Value(G4double theEnergy)
} else {
lastBin = FindBinLocation(theEnergy);
lastEnergy = theEnergy;
lastValue = Interpolation(lastBin);
lastValue = Interpolation();
}
return lastValue;