Import Geant4 7.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 11:11:55 +02:00
parent e083ffb441
commit 516dbf1a58
5914 changed files with 202605 additions and 71141 deletions
@@ -22,7 +22,7 @@
//
//
// $Id: G4MImportanceConfigurator.cc,v 1.5 2003/11/26 14:51:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4MImportanceConfigurator
@@ -22,7 +22,7 @@
//
//
// $Id: G4MScoreConfigurator.cc,v 1.7 2003/11/26 14:51:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4MScoreConfigurator
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MScoreProcess.cc,v 1.11 2003/11/26 14:51:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4MScoreProcess.cc,v 1.12 2004/10/19 00:59:39 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -92,7 +92,7 @@ G4MScoreProcess::PostStepDoIt(const G4Track& aTrack, const G4Step &aStep)
if (fKillTrack)
{
fKillTrack = false;
pParticleChange->SetStatusChange(fStopAndKill);
pParticleChange->ProposeTrackStatus(fStopAndKill);
}
return G4VProcess::pParticleChange;
@@ -22,7 +22,7 @@
//
//
// $Id: G4MWeightWindowConfigurator.cc,v 1.4 2003/11/26 14:51:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4MWeightWindowConfigurator
@@ -22,7 +22,7 @@
//
//
// $Id: G4MassGCellFinder.cc,v 1.3 2003/11/26 14:51:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4MassGeometrySampler.cc,v 1.11 2003/11/26 14:51:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MassImportanceProcess.cc,v 1.16 2003/11/26 14:51:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4MassImportanceProcess.cc,v 1.17 2004/10/19 00:59:39 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -114,7 +114,7 @@ G4MassImportanceProcess::PostStepDoIt(const G4Track &aTrack,
void G4MassImportanceProcess::KillTrack() const
{
fParticleChange->SetStatusChange(fStopAndKill);
fParticleChange->ProposeTrackStatus(fStopAndKill);
}
const G4String &G4MassImportanceProcess::GetName() const
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MassWeightWindowProcess.cc,v 1.4 2003/11/26 14:51:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4MassWeightWindowProcess.cc,v 1.5 2004/10/19 00:59:39 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -115,7 +115,7 @@ G4MassWeightWindowProcess::PostStepDoIt(const G4Track &aTrack,
void G4MassWeightWindowProcess::KillTrack() const
{
fParticleChange->SetStatusChange(fStopAndKill);
fParticleChange->ProposeTrackStatus(fStopAndKill);
}
const G4String &G4MassWeightWindowProcess::GetName() const
@@ -22,7 +22,7 @@
//
//
// $Id: G4PImportanceConfigurator.cc,v 1.6 2003/11/26 14:51:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4PImportanceConfigurator
@@ -22,7 +22,7 @@
//
//
// $Id: G4PScoreConfigurator.cc,v 1.7 2003/11/26 14:51:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4PScoreConfigurator
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PScoreProcess.cc,v 1.8 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4PScoreProcess.cc,v 1.9 2004/10/19 00:59:39 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -74,7 +74,7 @@ G4PScoreProcess::PostStepDoIt(const G4Track& aTrack, const G4Step &aStep)
if (fKillTrack)
{
fKillTrack = false;
pParticleChange->SetStatusChange(fStopAndKill);
pParticleChange->ProposeTrackStatus(fStopAndKill);
}
return G4VProcess::pParticleChange;
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4PWeightWindowConfigurator.cc,v 1.4 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4PWeightWindowConfigurator
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelGCellFinder.cc,v 1.3 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelGeometrySampler.cc,v 1.10 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ParallelImportanceProcess.cc,v 1.16 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4ParallelImportanceProcess.cc,v 1.17 2004/10/19 00:59:39 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -90,7 +90,7 @@ void G4ParallelImportanceProcess::Error(const G4String &m)
void G4ParallelImportanceProcess::KillTrack() const
{
fParticleChange->SetStatusChange(fStopAndKill);
fParticleChange->ProposeTrackStatus(fStopAndKill);
}
const G4String &G4ParallelImportanceProcess::GetName() const
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelTransport.cc,v 1.12 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelTransportConfigurator.cc,v 1.5 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelTransportConfigurator
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ParallelWWnTransportProcess.cc,v 1.3 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4ParallelWWnTransportProcess.cc,v 1.4 2004/10/19 00:59:39 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -93,7 +93,7 @@ void G4ParallelWWnTransportProcess::Error(const G4String &m)
void G4ParallelWWnTransportProcess::KillTrack() const
{
fParticleChange->SetStatusChange(fStopAndKill);
fParticleChange->ProposeTrackStatus(fStopAndKill);
}
const G4String &G4ParallelWWnTransportProcess::GetName() const
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ParallelWeightWindowProcess.cc,v 1.10 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4ParallelWeightWindowProcess.cc,v 1.11 2004/10/19 00:59:39 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -114,7 +114,7 @@ void G4ParallelWeightWindowProcess::Error(const G4String &m)
void G4ParallelWeightWindowProcess::KillTrack() const
{
fParticleChange->SetStatusChange(fStopAndKill);
fParticleChange->ProposeTrackStatus(fStopAndKill);
}
const G4String &G4ParallelWeightWindowProcess::GetName() const
@@ -22,7 +22,7 @@
//
//
// $Id: G4ProcessPlacer.cc,v 1.14 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SamplingPostStepAction.cc,v 1.1 2003/11/26 14:51:12 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4SamplingPostStepAction.cc,v 1.2 2004/10/19 00:59:40 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -62,7 +62,7 @@ void G4SamplingPostStepAction::DoIt(const G4Track& aTrack,
else if (nw.fN==1)
{
// don't split, but weight may be changed !
aParticleChange->SetWeightChange(nw.fW);
aParticleChange->ProposeWeight(nw.fW);
}
else if (nw.fN==0)
{
@@ -89,7 +89,7 @@ void G4SamplingPostStepAction::Split(const G4Track &aTrack,
const G4Nsplit_Weight &nw,
G4ParticleChange *aParticleChange)
{
aParticleChange->SetWeightChange(nw.fW);
aParticleChange->ProposeWeight(nw.fW);
aParticleChange->SetNumberOfSecondaries(nw.fN-1);
for (G4int i=1;i<nw.fN;i++)
@@ -0,0 +1,107 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4StepLimiter.cc,v 1.1 2004/07/26 00:42:59 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// --------------------------------------------------------------
// History
//
// 23-01-04 first implementation (H.Kurashige)
// --------------------------------------------------------------
#include "G4StepLimiter.hh"
#include "G4Step.hh"
#include "G4UserLimits.hh"
#include "G4VParticleChange.hh"
////////////////////////////////////
G4StepLimiter::G4StepLimiter(const G4String& aName)
: G4VProcess(aName)
{
if (verboseLevel>1) {
G4cout << GetProcessName() << " is created "<< G4endl;
}
}
////////////////////////
G4StepLimiter::~G4StepLimiter()
{
}
////////////////////////
G4StepLimiter::G4StepLimiter(G4StepLimiter& right)
: G4VProcess(right)
{
}
////////////////
G4double
G4StepLimiter::PostStepGetPhysicalInteractionLength(
const G4Track& aTrack,
G4double, // previousStepSize
G4ForceCondition* condition )
{
// condition is set to "Not Forced"
*condition = NotForced;
G4double proposedStep = DBL_MAX;
G4UserLimits* pUserLimits =
aTrack.GetVolume()->GetLogicalVolume()->GetUserLimits();
if (pUserLimits) {
// max allowed step length
//
proposedStep = pUserLimits->GetMaxAllowedStep(aTrack);
if (proposedStep < 0.) proposedStep =0.;
}
return proposedStep;
}
///////////////
G4VParticleChange*
G4StepLimiter::PostStepDoIt( const G4Track& aTrack,
const G4Step& )
// Do Nothing
//
{
aParticleChange.Initialize(aTrack);
return &aParticleChange;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Transportation.cc,v 1.44 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4Transportation.cc,v 1.51 2004/12/07 08:28:39 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
// ------------------------------------------------------------
// GEANT 4 include file implementation
@@ -37,6 +37,7 @@
//
// =======================================================================
// Modified:
// 11 Aug 2004, M.Asai: Add G4VSensitiveDetector* for updating stepPoint.
// 21 June 2003, J.Apostolakis: Calling field manager with
// track, to enable it to configure its accuracy
// 13 May 2003, J.Apostolakis: Zero field areas now taken into
@@ -46,9 +47,8 @@
// 20 Febr 2001, J.Apostolakis: update for new FieldTrack
// 22 Sept 2000, V.Grichine: update of Kinetic Energy
// 9 June 1999, J.Apostolakis & S.Giani: protect full relocation
// used in DEBUG for track that started on surface
// and went step < tolerance. Also forced fast
// relocation in all DEBUG cases
// in DEBUG for track starting on surface that
// goes step < tolerance.
// Created: 19 March 1997, J. Apostolakis
// =======================================================================
@@ -56,6 +56,7 @@
#include "G4ProductionCutsTable.hh"
#include "G4ParticleTable.hh"
#include "G4ChordFinder.hh"
class G4VSensitiveDetector;
//////////////////////////////////////////////////////////////////////////
//
@@ -66,6 +67,13 @@ G4Transportation::G4Transportation( G4int verboseLevel )
fParticleIsLooping( false ),
fPreviousSftOrigin (0.,0.,0.),
fPreviousSafety ( 0.0 ),
fThreshold_Warning_Energy( 100 * MeV ),
fThreshold_Important_Energy( 250 * MeV ),
fThresholdTrials( 10 ),
fUnimportant_Energy( 1 * MeV ),
fNoLooperTrials(0),
fSumEnergyKilled( 0.0 ), fMaxEnergyKilled( 0.0 ),
fVerboseLevel( verboseLevel )
{
G4TransportationManager* transportMgr ;
@@ -94,6 +102,11 @@ G4Transportation::G4Transportation( G4int verboseLevel )
G4Transportation::~G4Transportation()
{
if( (fVerboseLevel > 0) && (fSumEnergyKilled > 0.0 ) ){
G4cout << " G4Transportation: Statistics for looping particles " << G4endl;
G4cout << " Sum of energy of loopers killed: " << fSumEnergyKilled << G4endl;
G4cout << " Max energy of loopers killed: " << fMaxEnergyKilled << G4endl;
}
}
//////////////////////////////////////////////////////////////////////////
@@ -119,6 +132,9 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
//
fPreviousSafety = 0.0 ;
fPreviousSftOrigin = G4ThreeVector(0.,0.,0.) ;
// reset counter for looping particles in field
fNoLooperTrials= 0;
// ChordFinder reset internal state
//
@@ -147,9 +163,9 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
// G4double theTime = track.GetGlobalTime() ;
// The Step Point safety is now generalised to mean the limit of assumption
// of all processes, so it is not the previous Step's geometrical safety.
// We calculate the starting point's safety here.
// The Step Point safety can be limited by other geometries and/or the
// assumptions of any process - it's not always the geometrical safety.
// We calculate the starting point's isotropic safety here.
//
G4ThreeVector OriginShift = startPosition - fPreviousSftOrigin ;
G4double MagSqShift = OriginShift.mag2() ;
@@ -159,7 +175,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
}
else
{
currentSafety = fPreviousSafety - sqrt(MagSqShift) ;
currentSafety = fPreviousSafety - std::sqrt(MagSqShift) ;
}
// Is the particle charged ?
@@ -335,7 +351,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
G4double endEnergy= fTransportEndKineticEnergy;
static G4int no_inexact_steps=0, no_large_ediff;
G4double absEdiff = fabs(startEnergy- endEnergy);
G4double absEdiff = std::fabs(startEnergy- endEnergy);
if( absEdiff > perMillion * endEnergy )
{
no_inexact_steps++;
@@ -343,31 +359,24 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
}
if( fVerboseLevel > 1 )
{
if( fabs(startEnergy- endEnergy) > perThousand * endEnergy )
if( std::fabs(startEnergy- endEnergy) > perThousand * endEnergy )
{
static G4int no_warnings= 0, warnModulo=1, moduloFactor= 10;
no_large_ediff ++;
if( (no_large_ediff% warnModulo) == 0 )
{
no_warnings++;
G4cout << "WARNING - G4Transportation::AlongStepGetPIL()"
<< G4endl
<< " Energy changed in Step, more than 1/1000: "
<< G4endl
<< " Start= " << startEnergy
<< G4endl
<< " End= " << endEnergy
<< G4endl
G4cout << "WARNING - G4Transportation::AlongStepGetPIL()" << G4endl
<< " Energy changed in Step, more than 1/1000: " << G4endl
<< " Start= " << startEnergy << G4endl
<< " End= " << endEnergy << G4endl
<< " Relative change= "
<< (startEnergy-endEnergy)/startEnergy << G4endl;
G4cout << " Energy has been corrected -- however, review"
<< " field propagation parameters for accuracy."
<< G4endl;
G4cerr << "ERROR - G4Transportation::AlongStepGetPIL()"
<< G4endl
<< " field propagation parameters for accuracy." << G4endl;
G4cerr << "ERROR - G4Transportation::AlongStepGetPIL()" << G4endl
<< " Bad 'endpoint'. Energy change detected"
<< " and corrected,"
<< G4endl
<< " and corrected," << G4endl
<< " occurred already "
<< no_large_ediff << " times." << G4endl;
if( no_large_ediff == warnModulo * moduloFactor )
@@ -424,7 +433,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
#endif
}
fParticleChange.SetTrueStepLength(geometryStepLength) ;
fParticleChange.ProposeTrueStepLength(geometryStepLength) ;
return geometryStepLength ;
}
@@ -441,12 +450,12 @@ G4VParticleChange* G4Transportation::AlongStepDoIt( const G4Track& track,
// Code for specific process
//
fParticleChange.SetPositionChange(fTransportEndPosition) ;
fParticleChange.SetMomentumChange(fTransportEndMomentumDir) ;
fParticleChange.SetEnergyChange(fTransportEndKineticEnergy) ;
fParticleChange.ProposePosition(fTransportEndPosition) ;
fParticleChange.ProposeMomentumDirection(fTransportEndMomentumDir) ;
fParticleChange.ProposeEnergy(fTransportEndKineticEnergy) ;
fParticleChange.SetMomentumChanged(fMomentumChanged) ;
fParticleChange.SetPolarizationChange(fTransportEndSpin);
fParticleChange.ProposePolarization(fTransportEndSpin);
G4double deltaTime = 0.0 ;
@@ -492,15 +501,15 @@ G4VParticleChange* G4Transportation::AlongStepDoIt( const G4Track& track,
deltaTime = fCandidateEndGlobalTime - startTime ;
}
fParticleChange.SetTimeChange( fCandidateEndGlobalTime ) ;
fParticleChange.ProposeGlobalTime( fCandidateEndGlobalTime ) ;
// Now Correct by Lorentz factor to get "proper" deltaTime
G4double restMass = track.GetDynamicParticle()->GetMass() ;
G4double deltaProperTime = deltaTime*( restMass/track.GetTotalEnergy() ) ;
fParticleChange.SetProperTimeChange(track.GetProperTime() + deltaProperTime) ;
//fParticleChange. SetTrueStepLength( track.GetStepLength() ) ;
fParticleChange.ProposeProperTime(track.GetProperTime() + deltaProperTime) ;
//fParticleChange. ProposeTrueStepLength( track.GetStepLength() ) ;
// If the particle is caught looping or is stuck (in very difficult
// boundaries) in a magnetic field (doing many steps)
@@ -508,16 +517,34 @@ G4VParticleChange* G4Transportation::AlongStepDoIt( const G4Track& track,
//
if ( fParticleIsLooping )
{
// Kill the looping particle
//
fParticleChange.SetStatusChange( fStopAndKill ) ;
G4double endEnergy= fTransportEndKineticEnergy;
if( (endEnergy < fThreshold_Important_Energy)
|| (fNoLooperTrials >= fThresholdTrials ) ){
// Kill the looping particle
//
fParticleChange.ProposeTrackStatus( fStopAndKill ) ;
// 'Bare' statistics
fSumEnergyKilled += endEnergy;
if( endEnergy > fMaxEnergyKilled) { fMaxEnergyKilled= endEnergy; }
#ifdef G4VERBOSE
G4cout << " G4Transportation is killing track that is looping or stuck "
<< G4endl
<< " This track has " << track.GetKineticEnergy()
<< " MeV energy." << G4endl;
if( (fVerboseLevel > 1) ||
( endEnergy > fThreshold_Warning_Energy ) ) {
G4cout << " G4Transportation is killing track that is looping or stuck "
<< G4endl
<< " This track has " << track.GetKineticEnergy() / MeV
<< " MeV energy." << G4endl;
}
#endif
// ClearNumberOfInteractionLengthLeft() ;
fNoLooperTrials=0;
}
else{
fNoLooperTrials ++;
}
}else{
fNoLooperTrials=0;
}
// Another (sometimes better way) is to use a user-limit maximum Step size
@@ -558,7 +585,7 @@ G4VParticleChange* G4Transportation::PostStepDoIt( const G4Track& track,
// to corresponding members in G4Track)
// fParticleChange.Initialize(track) ; // To initialise TouchableChange
fParticleChange.SetStatusChange(track.GetTrackStatus()) ;
fParticleChange.ProposeTrackStatus(track.GetTrackStatus()) ;
// If the Step was determined by the volume boundary,
// logically relocate the particle
@@ -580,7 +607,7 @@ G4VParticleChange* G4Transportation::PostStepDoIt( const G4Track& track,
//
if( fCurrentTouchableHandle->GetVolume() == 0 )
{
fParticleChange.SetStatusChange( fStopAndKill ) ;
fParticleChange.ProposeTrackStatus( fStopAndKill ) ;
}
retCurrentTouchable = fCurrentTouchableHandle ;
fParticleChange.SetTouchableHandle( fCurrentTouchableHandle ) ;
@@ -687,12 +714,19 @@ G4VParticleChange* G4Transportation::PostStepDoIt( const G4Track& track,
const G4VPhysicalVolume* pNewVol = retCurrentTouchable->GetVolume() ;
const G4Material* pNewMaterial = 0 ;
if( pNewVol != 0 ) pNewMaterial= pNewVol->GetLogicalVolume()->GetMaterial() ;
const G4VSensitiveDetector* pNewSensitiveDetector = 0 ;
if( pNewVol != 0 )
{
pNewMaterial= pNewVol->GetLogicalVolume()->GetMaterial();
pNewSensitiveDetector= pNewVol->GetLogicalVolume()->GetSensitiveDetector();
}
// ( <const_cast> pNewMaterial ) ;
// ( <const_cast> pNewSensitiveDetector) ;
fParticleChange.SetMaterialChange( (G4Material *) pNewMaterial ) ;
fParticleChange.SetMaterialInTouchable( (G4Material *) pNewMaterial ) ;
fParticleChange.SetSensitiveDetectorInTouchable( (G4VSensitiveDetector *) pNewSensitiveDetector ) ;
const G4MaterialCutsCouple* pNewMaterialCutsCouple = 0;
if( pNewVol != 0 )
@@ -700,7 +734,7 @@ G4VParticleChange* G4Transportation::PostStepDoIt( const G4Track& track,
pNewMaterialCutsCouple=pNewVol->GetLogicalVolume()->GetMaterialCutsCouple();
}
if( pNewVol!=0 && pNewMaterialCutsCouple->GetMaterial()!=pNewMaterial )
if( pNewVol!=0 && pNewMaterialCutsCouple!=0 && pNewMaterialCutsCouple->GetMaterial()!=pNewMaterial )
{
// for parametrized volume
//
@@ -709,7 +743,7 @@ G4VParticleChange* G4Transportation::PostStepDoIt( const G4Track& track,
->GetMaterialCutsCouple(pNewMaterial,
pNewMaterialCutsCouple->GetProductionCuts());
}
fParticleChange.SetMaterialCutsCoupleChange( pNewMaterialCutsCouple );
fParticleChange.SetMaterialCutsCoupleInTouchable( pNewMaterialCutsCouple );
// temporarily until Get/Set Material of ParticleChange,
// and StepPoint can be made const.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4UserSpecialCuts.cc,v 1.12 2004/01/23 02:47:51 kurasige Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4UserSpecialCuts.cc,v 1.14 2004/10/19 00:59:40 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// --------------------------------------------------------------
// History
@@ -31,6 +31,7 @@
// 07-04-03 migrade to cut per region (V.Ivanchenko)
// 18-09-03 substitute manager for the loss tables (V.Ivanchenko)
// 23-01-04 add protection for charged geantino in range cut (H.Kurashige)
// 09-09-04 tracking cut applied only if Rmin or Emin > DBL_MIN
// --------------------------------------------------------------
#include "G4UserSpecialCuts.hh"
@@ -98,24 +99,30 @@ PostStepGetPhysicalInteractionLength( const G4Track& aTrack,
// min remaining range
// (only for charged particle except for chargedGeantino)
//
G4ParticleDefinition* Particle = aTrack.GetDefinition();
if ( (Particle->GetPDGCharge() != 0.)
&& (Particle->GetParticleType() != "geantino"))
{
G4double Ekine = aTrack.GetKineticEnergy();
G4double Ekine = aTrack.GetKineticEnergy();
const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple();
G4double RangeNow = theLossTableManager->GetRange(Particle,Ekine,couple);
temp = (RangeNow - pUserLimits->GetUserMinRange(aTrack));
if (temp < 0.) return 0.;
if (ProposedStep > temp) ProposedStep = temp;
G4double Rmin = pUserLimits->GetUserMinRange(aTrack);
if (Rmin > DBL_MIN) {
temp = RangeNow - Rmin;
if (temp < 0.) return 0.;
if (ProposedStep > temp) ProposedStep = temp;
}
// min kinetic energy (only for charged particle)
//
G4double Emin = pUserLimits->GetUserMinEkine(aTrack);
G4double Rmin = theLossTableManager->GetRange(Particle,Emin,couple);
temp = RangeNow - Rmin;
if (temp < 0.) return 0.;
if (ProposedStep > temp) ProposedStep = temp;
if (Emin > DBL_MIN) {
Rmin = theLossTableManager->GetRange(Particle,Emin,couple);
temp = RangeNow - Rmin;
if (temp < 0.) return 0.;
if (ProposedStep > temp) ProposedStep = temp;
}
}
}
return ProposedStep;
@@ -131,9 +138,9 @@ G4UserSpecialCuts::PostStepDoIt( const G4Track& aTrack,
//
{
aParticleChange.Initialize(aTrack);
aParticleChange.SetEnergyChange(0.) ;
aParticleChange.SetLocalEnergyDeposit (aTrack.GetKineticEnergy()) ;
aParticleChange.SetStatusChange(fStopAndKill);
aParticleChange.ProposeEnergy(0.) ;
aParticleChange.ProposeLocalEnergyDeposit(aTrack.GetKineticEnergy()) ;
aParticleChange.ProposeTrackStatus(fStopAndKill);
return &aParticleChange;
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4VProcessPlacer.cc,v 1.2 2003/04/02 16:59:20 dressel Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4VSampler.cc,v 1.2 2003/04/02 16:59:25 dressel Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4VSamplerConfigurator.cc,v 1.2 2003/04/02 16:59:25 dressel Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4VTrackTerminator.cc,v 1.3 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4WeightCutOffConfigurator.cc,v 1.5 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4WeightCutOffConfigurator
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4WeightCutOffProcess.cc,v 1.6 2003/11/26 14:51:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4WeightCutOffProcess.cc,v 1.7 2004/10/19 00:59:40 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -98,11 +98,11 @@ G4WeightCutOffProcess::PostStepDoIt(const G4Track& aTrack,
G4double p = w/(ws);
if (G4UniformRand()<p)
{
fParticleChange->SetStatusChange(fStopAndKill);
fParticleChange->ProposeTrackStatus(fStopAndKill);
}
else
{
fParticleChange->SetWeightChange(ws);
fParticleChange->ProposeWeight(ws);
}
}
return fParticleChange;