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
+30 -2
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.91 2004/02/05 12:59:16 asaim Exp $
$Id: History,v 1.98 2004/12/07 08:28:55 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,7 +17,35 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
- Add G4UserStepLimit to handle MaxAllowedStep in G4UserLimits (H.K.)
Dec. 7th, 2004, G.Cosmo transport-V06-02-05
-----------------------
- Implemented migration to <cmath>.
Nov. 23th, 2004, J.Apostolakis transport-V06-02-04
------------------------------
- Added Threshold energy for not abandoning stuck particles quickly.
Oct. 19th, H.Kurashige transport-V06-02-03
----------------------
- Migrated processes to new G4VParticleChange interface.
Sep. 9th, M.Maire
-----------------
- Apply tracking cut only if Rmin or Emin > DBL_MIN in G4UserSpecialCuts.
Oct. 8th, M.Asai transport-V06-02-02
----------------
- A protection is added in G4Transportation.cc for an application with parameterized
volume but without any EM process.
Aug. 27th, M.Asai transport-V06-02-01
-----------------
- A pointer to sensitive detector is added in G4ParticleChangeForTransport.
- G4Transportation takes care of this pointer.
Jul. 26th, M.Asai transport-V06-02-00
-----------------
- Introduce G4UserStepLimit to handle MaxAllowedStep in G4UserLimits.
Feb. 5th, M.Asai transport-V06-00-00
----------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4MImportanceConfigurator.hh,v 1.5 2003/11/26 14:51:47 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.hh,v 1.5 2003/11/26 14:51:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4MScoreConfigurator
@@ -22,7 +22,7 @@
//
//
// $Id: G4MScoreProcess.hh,v 1.8 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4MScoreProcess
@@ -22,7 +22,7 @@
//
//
// $Id: G4MWeightWindowConfigurator.hh,v 1.5 2003/11/26 14:51:48 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.hh,v 1.2 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelGCellFinder
@@ -22,7 +22,7 @@
//
//
// $Id: G4MassGeometrySampler.hh,v 1.6 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4MassGeometrySampler
@@ -22,7 +22,7 @@
//
//
// $Id: G4MassImportanceProcess.hh,v 1.9 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4MassImportanceProcess
@@ -22,7 +22,7 @@
//
//
// $Id: G4MassWeightWindowProcess.hh,v 1.4 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4MassWeioghtWindowProcess
@@ -22,7 +22,7 @@
//
//
// $Id: G4PImportanceConfigurator.hh,v 1.5 2003/11/26 14:51:48 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.hh,v 1.5 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4PScoreConfigurator
@@ -22,7 +22,7 @@
//
//
// $Id: G4PScoreProcess.hh,v 1.8 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4PIScoreProcess
@@ -22,7 +22,7 @@
//
//
// $Id: G4PWeightWindowConfigurator.hh,v 1.4 2003/11/26 14:51:48 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.hh,v 1.2 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelGCellFinder
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelGeometrySampler.hh,v 1.7 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelGeometrySampler
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelImportanceProcess.hh,v 1.11 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelImportanceProcess
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelTransport.hh,v 1.8 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelTransport
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelTransportConfigurator.hh,v 1.4 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelTransportConfigurator
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelWWnTransportProcess.hh,v 1.4 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelWWnTransportProcess
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelWeightWindowProcess.hh,v 1.9 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelWeightWindowProcess
@@ -22,7 +22,7 @@
//
//
// $Id: G4PlaceOfAction.hh,v 1.3 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4PlaceOfAction
@@ -22,7 +22,7 @@
//
//
// $Id: G4ProcessPlacer.hh,v 1.7 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4ProcessPlacer
@@ -22,7 +22,7 @@
//
//
// $Id: G4SamplingPostStepAction.hh,v 1.1 2003/11/26 14:51:27 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4SamplingPostStepAction
@@ -0,0 +1,109 @@
//
// ********************************************************************
// * 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.hh,v 1.1 2004/07/26 00:42:59 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// class description
//
// A "process" to be registered to the process manager of each particle,
// in the UserPhysicsList, in order to take into account the MaxAllowedStep
// defined in the G4UserLimits object attached to a logical volume.
//
// ------------------------------------------------------------
// 23 Jan. 2004 H.Kurashige
// ------------------------------------------------------------
#ifndef G4StepLimiter_h
#define G4StepLimiter_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4VProcess.hh"
class G4StepLimiter : public G4VProcess
{
public: // with description
G4StepLimiter(const G4String& processName ="StepLimiter" );
~G4StepLimiter();
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
);
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
public: // without description
// no operation in AtRestGPIL
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
){ return -1.0; };
// no operation in AtRestDoIt
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
){return 0;};
// no operation in AlongStepGPIL
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double ,
G4double ,
G4double& ,
G4GPILSelection*
){ return -1.0; };
// no operation in AlongStepDoIt
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
private:
// hide assignment operator as private
G4StepLimiter(G4StepLimiter&);
G4StepLimiter& operator=(const G4StepLimiter& right);
};
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: G4TrackTerminator.hh,v 1.2 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// ----------------------------------------------------------------------
// Class G4TrackTerminator
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Transportation.hh,v 1.9 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4Transportation.hh,v 1.10 2004/11/23 17:45:43 japost Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// ------------------------------------------------------------
@@ -92,11 +92,29 @@ class G4Transportation : public G4VProcess
void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
// Access/set the assistant class that Propagate in a Field.
void SetVerboseLevel( G4int verboseLevel );
G4int GetVerboseLevel() const;
inline void SetVerboseLevel( G4int verboseLevel );
inline G4int GetVerboseLevel() const;
// Level of warnings regarding eg energy conservation
// in field integration.
inline G4double GetThresholdWarningEnergy() const;
inline G4double GetThresholdImportantEnergy() const;
inline G4int GetThresholdTrials() const;
inline void SetThresholdWarningEnergy( G4double newEnWarn );
inline void SetThresholdImportantEnergy( G4double newEnImp );
inline void SetThresholdTrials(G4int newMaxTrials );
// Get/Set parameters for killing loopers:
// Above 'important' energy a 'looping' particle in field will
// *NOT* be abandoned, except after fThresholdTrials attempts.
// Below Warning energy, no verbosity for looping particles is issued
inline G4double GetMaxEnergyKilled() const;
inline G4double GetSumEnergyKilled() const;
inline void ResetKilledStatistics( G4int report = 1);
// Statistics for tracks killed (currently due to looping in field)
public: // without description
G4double AtRestGetPhysicalInteractionLength(
@@ -156,6 +174,25 @@ class G4Transportation : public G4VProcess
G4double endpointDistance;
// Thresholds for looping particles:
//
G4double fThreshold_Warning_Energy; // Warn above this energy
G4double fThreshold_Important_Energy; // Hesitate above this
G4int fThresholdTrials; // for this no of trials
// Above 'important' energy a 'looping' particle in field will
// *NOT* be abandoned, except after fThresholdTrials attempts.
G4double fUnimportant_Energy;
// Below this energy, no verbosity for looping particles is issued
// Counter for steps in which particle reports 'looping',
// if it is above 'Important' Energy
G4int fNoLooperTrials;
// Statistics for tracks abandoned
G4double fSumEnergyKilled;
G4double fMaxEnergyKilled;
// Verbosity
G4int fVerboseLevel;
// Verbosity level for warnings
// eg about energy non-conservation in magnetic field.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Transportation.icc,v 1.7 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4Transportation.icc,v 1.8 2004/11/23 17:45:43 japost Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
@@ -64,3 +64,62 @@ inline G4int G4Transportation::GetVerboseLevel( ) const
{
return fVerboseLevel;
}
inline G4double G4Transportation::GetThresholdWarningEnergy() const
{
return fThreshold_Warning_Energy;
}
inline G4double G4Transportation::GetThresholdImportantEnergy() const
{
return fThreshold_Important_Energy;
}
inline G4int G4Transportation::GetThresholdTrials() const
{
return fThresholdTrials;
}
inline void G4Transportation::SetThresholdWarningEnergy( G4double newEnWarn )
{
fThreshold_Warning_Energy= newEnWarn;
}
inline void G4Transportation::SetThresholdImportantEnergy( G4double newEnImp )
{
fThreshold_Important_Energy = newEnImp;
}
inline void G4Transportation::SetThresholdTrials(G4int newMaxTrials )
{
fThresholdTrials = newMaxTrials;
}
// Get/Set parameters for killing loopers:
// Above 'important' energy a 'looping' particle in field will
// *NOT* be abandoned, except after fThresholdTrials attempts.
// Below Warning energy, no verbosity for looping particles is issued
inline G4double G4Transportation::GetMaxEnergyKilled() const
{
return fMaxEnergyKilled;
}
inline G4double G4Transportation::GetSumEnergyKilled() const
{
return fSumEnergyKilled;
}
inline void G4Transportation::ResetKilledStatistics(G4int report)
{
if( report ) {
G4cout << " G4Transportation: Statistics for looping particles " << G4endl;
G4cout << " Sum of energy of loopers killed: " << fSumEnergyKilled << G4endl;
G4cout << " Max energy of loopers killed: " << fMaxEnergyKilled << G4endl;
}
fSumEnergyKilled= 0;
fMaxEnergyKilled= -1.0*GeV;
}
// Statistics for tracks killed (currently due to looping in field)
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4UserSpecialCuts.hh,v 1.7 2003/11/26 14:51:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4UserSpecialCuts.hh,v 1.8 2004/09/09 10:48:08 maire Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// class description
//
@@ -30,9 +29,8 @@
// in the UserPhysicsList, in order to take into account the user limits
// defined in the G4UserLimits object attached to a logical volume.
// ------------------------------------------------------------
// 15 April 1998 M.Maire
// ------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4UserSpecialCuts_h
#define G4UserSpecialCuts_h 1
@@ -42,6 +40,8 @@
class G4LossTableManager;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4UserSpecialCuts : public G4VProcess
{
public: // with description
@@ -100,5 +100,7 @@ class G4UserSpecialCuts : public G4VProcess
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: G4VProcessPlacer.hh,v 1.8 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 G4VProcessPlacer
@@ -22,7 +22,7 @@
//
//
// $Id: G4VSampler.hh,v 1.9 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 G4VSampler
@@ -22,7 +22,7 @@
//
//
// $Id: G4VSamplerConfigurator.hh,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 G4VSamplerConfigurator
@@ -22,7 +22,7 @@
//
//
// $Id: G4VTrackTerminator.hh,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 G4VTrackTerminator
@@ -22,7 +22,7 @@
//
//
// $Id: G4WeightCutOffConfigurator.hh,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 G4WeightCutOffConfigurator
@@ -22,7 +22,7 @@
//
//
// $Id: G4WeightCutOffProcess.hh,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 $
//
// ----------------------------------------------------------------------
// Class G4WeightCutOffProcess
@@ -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;