Added to SVN Repository
This commit is contained in:
4
geant4/LEMuSR/G4Modified/track/CVS/Entries
Normal file
4
geant4/LEMuSR/G4Modified/track/CVS/Entries
Normal file
@ -0,0 +1,4 @@
|
||||
D/include////
|
||||
D/src////
|
||||
/GNUmakefile/1.5/Thu Jul 29 19:00:37 2004//Tgeant4-06-02-ref-01
|
||||
/History/1.70/Thu Jul 29 19:00:37 2004//Tgeant4-06-02-ref-01
|
1
geant4/LEMuSR/G4Modified/track/CVS/Repository
Normal file
1
geant4/LEMuSR/G4Modified/track/CVS/Repository
Normal file
@ -0,0 +1 @@
|
||||
geant4/source/track
|
1
geant4/LEMuSR/G4Modified/track/CVS/Root
Normal file
1
geant4/LEMuSR/G4Modified/track/CVS/Root
Normal file
@ -0,0 +1 @@
|
||||
:pserver:gum@g4cvs.cern.ch:/afs/cern.ch/sw/geant4/cvs
|
1
geant4/LEMuSR/G4Modified/track/CVS/Tag
Normal file
1
geant4/LEMuSR/G4Modified/track/CVS/Tag
Normal file
@ -0,0 +1 @@
|
||||
Ngeant4-06-02-ref-01
|
33
geant4/LEMuSR/G4Modified/track/GNUmakefile
Normal file
33
geant4/LEMuSR/G4Modified/track/GNUmakefile
Normal file
@ -0,0 +1,33 @@
|
||||
# $Id: GNUmakefile,v 1.5 2004/06/11 14:28:12 gcosmo Exp $
|
||||
# ----------------------------------------------------------
|
||||
# GNUmakefile for track library. Gabriele Cosmo, 3/4/1997.
|
||||
# ----------------------------------------------------------
|
||||
|
||||
name := G4track
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../..
|
||||
endif
|
||||
|
||||
GLOBLIBS = libG4particles.lib libG4geometry.lib
|
||||
GLOBLIBS += libG4materials.lib libG4graphics_reps.lib
|
||||
GLOBLIBS += libG4intercoms.lib libG4global.lib
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -DG4TRACK_ALLOC_EXPORT
|
||||
CPPFLAGS += \
|
||||
-I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/global/HEPRandom/include \
|
||||
-I$(G4BASE)/global/HEPGeometry/include \
|
||||
-I$(G4BASE)/intercoms/include \
|
||||
-I$(G4BASE)/particles/management/include \
|
||||
-I$(G4BASE)/materials/include \
|
||||
-I$(G4BASE)/geometry/management/include
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
.PHONY: global
|
||||
|
||||
global: lib
|
||||
|
348
geant4/LEMuSR/G4Modified/track/History
Normal file
348
geant4/LEMuSR/G4Modified/track/History
Normal file
@ -0,0 +1,348 @@
|
||||
$Id: History,v 1.70 2004/06/15 08:19:02 vnivanch Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Category History file
|
||||
---------------------
|
||||
This file should be used by G4 developers and category coordinators
|
||||
to briefly summarize all major modifications introduced in the code
|
||||
and keep track of all category-tags.
|
||||
It DOES NOT substitute the CVS log-message one should put at every
|
||||
committal in the CVS repository !
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Jun. 15, 04 V.Ivanchenko (track-V06-01-05)
|
||||
- G4ParticleChangeForLoss: fix initialization of ParentWeight
|
||||
|
||||
Jun. 11, 04 G.Cosmo (track-V06-01-04)
|
||||
- Use global flag G4TRACK_ALLOC_EXPORT to export extern symbols for DLLs.
|
||||
Modified GNUmakefile and rearranged usage of extern symbols in G4Track.
|
||||
|
||||
Jun. 09, 04 G.Cosmo (track-V06-01-03)
|
||||
- Adopt G4DLLIMPORT/G4DLLEXPORT technique to handle extern simbols for
|
||||
allowing support of DLLs on Windows.
|
||||
- Coworks with "global-V06-01-02b".
|
||||
|
||||
Jun. 07, 04 G.Cosmo (track-V06-01-02)
|
||||
- Export extern symbols for allowing support of DLLs on Windows.
|
||||
Modified G4Track.icc.
|
||||
- GNUmakefile: added definition of GLOBLIBS for DLLs support on Windows.
|
||||
- Coworks with "global-V06-01-02a".
|
||||
|
||||
May. 11, 04 V.Ivanchenko (track-V06-01-01)
|
||||
- G4ParticleChangeForLoss: rename variables according to 00 tag;
|
||||
fix of minor energy non-conservation in case of more than 1
|
||||
processes changing the energy
|
||||
|
||||
May. 08, 04 H.Kurashige (track-V06-01-00)
|
||||
- Add new methods of ProposeXXX (and corresponding GetXXX methods)
|
||||
as replacements of old methods of SetXXXChange and GetXXXChange
|
||||
|
||||
Jan. 20, 04 V.Ivanchenko (track-V06-00-01)
|
||||
- Update G4ParticleChangeForLoss for utilisation in G4VEnergyLossProcess
|
||||
- Minor update G4ParticleChangeForMSC for utilisation in model design of msc
|
||||
- Change of volume in G4ParticleChangeForTransportation only if kinEnergy>0
|
||||
|
||||
Dec. 12, 03 G.Cosmo (track-V06-00-00)
|
||||
- G4VParticleChange[.hh.cc]: removed unnecessary 'const' qualifier to
|
||||
return value in GetAccuracyForWarning() and GetAccuracyForException()
|
||||
causing noisy warnings on Intel-icc compiler.
|
||||
|
||||
Nov. 26, 03 H.Kurashige (track-V05-02-03)
|
||||
- Fixed problem of setting momentum direction for stoppped particle in G4ParticleChange (Vladimir)
|
||||
|
||||
Oct. 4, 03 G.Cosmo (track-V05-02-02)
|
||||
- Modified GNUmakefile:
|
||||
o added dependency to new module "geometry/navigation".
|
||||
- Coworks with "geometry-V05-02-00" and "digits_hits-V05-02-00".
|
||||
|
||||
Jun. 11, 03 H.Kurashige (track-V05-02-01)
|
||||
- Add ExceptionSeverity
|
||||
- Add G4VParticleChange::CheckSecondary
|
||||
- Remove inclusion of G4MaterialCutsCouple
|
||||
|
||||
Jun. 03, 03 G.Cosmo (track-V05-01-03)
|
||||
- Fixed warning in G4ParticleChangeForRadDecay.hh.
|
||||
|
||||
Mar. 20, 03 M.Asai (track-V05-01-02)
|
||||
- Fix copy operator of G4Track not to copy the pointer to user information
|
||||
|
||||
Mar. 20, 03 H.Kurashige (track-V05-01-01)
|
||||
- Correct comments
|
||||
- Fixed unused parameter in G4VParticleChange.cc
|
||||
|
||||
Mar. 5, 02 H.Kurashige (track-V05-00-02)
|
||||
- Fix in G4Step::InitializeStep().
|
||||
Added initialization of fCharge in StepPoint.
|
||||
|
||||
Jan. 24, 02 G.Cosmo (track-V05-00-01)
|
||||
- Fix in G4ParticleChangeForTransport::UpdateStepForPostStep().
|
||||
Added call for setting the material-cuts-couple for pPostStepPoint
|
||||
(V.Ivantchenko).
|
||||
|
||||
Dec. 16, 02 G.Cosmo (track-V05-00-00)
|
||||
- Merged branch "geant4-04-01-ref-02-cuts-branch" to HEAD.
|
||||
Included development for 'cuts-by-region':
|
||||
o Updated G4Track, G4Step, G4StepPoint and G4ParticleChangeForTransport
|
||||
to properly handle new G4MaterialCutsCouple.
|
||||
|
||||
Dec. 04, 02 T.Sasaki (track-V04-01-03)
|
||||
- Initial value for fCharge is given in the constuctor
|
||||
of G4StepPoint.
|
||||
Nov. 20, 02 G.Cosmo (track-V04-01-02)
|
||||
- Patched access to public static data in G4VParticleChange.
|
||||
Added accessors to be used in the kernel to allow porting on
|
||||
Windows DLLs.
|
||||
|
||||
Nov. 1, 02 J.Generowicz (track-V04-01-01)
|
||||
- Added accessors to auxiliary point vector, in both
|
||||
G4Step and G4ParticleChangeForTransport
|
||||
|
||||
Oct. 31, 02 T.Sasaki (track-V04-01-00)
|
||||
- Added StronglyForced flag to G4ForceCondition
|
||||
- set fUndefined for the StepStatus in PostStepPoint after CopyPostToPre
|
||||
|
||||
Feb. 09 ,02 H.Kurashige (track-V04-00-02)
|
||||
- Modify G4Track::GetVelocity to get better performance for massless particles
|
||||
|
||||
Dec. 24 ,01 H.Kurashige (track-V04-00-01)
|
||||
- Remove event biasing mechanism from track category
|
||||
( it is moved to hadronic/models )
|
||||
- Add G4Track::CopyTrackInfo
|
||||
- Modified G4ParticleChange::AddSecondary to use touchable handle
|
||||
- Fixed a bug of changing parent weight in G4ParticleChange::UpdateStepForAlongStep
|
||||
|
||||
Dec. 12, 01 H.Kurashige (track-V04-00-00)
|
||||
- Added initialization of fStepLength in constructors.
|
||||
- Fixed a bug that fStepLength is not copied in assginment operator
|
||||
|
||||
Dec. 10, 01 H.Kurashige (track-V03-02-08)
|
||||
- Modified assignment operator so that fCurrentStepNumber is set to 0
|
||||
|
||||
Nov.27, 01 J. Apostolakis (track-V03-02-07) for H. Kurashige
|
||||
- Modified G4ParticleChange::AddSecondary to use touchable handle - by Hisaya
|
||||
(only one of the AddSecondary methods has been modified - to date)
|
||||
|
||||
Nov.10, 01 (track-V03-02-06)
|
||||
- Fixed bugs in assignment operators in G4Track
|
||||
- Added SetParentWeightByProcess
|
||||
- Added SetSecondaryWeightByProcess
|
||||
|
||||
Nov. 08, 01 G.Cosmo (track-V03-02-05)
|
||||
- Merge changes included in "track-V03-02-02a".
|
||||
|
||||
Oct. 22, 01 H.Kurashige (track-V03-02-04)
|
||||
- Modify to intorduce TouchableHandle (Radovan)
|
||||
|
||||
Oct. 20, 01 H.Kurashige (track-V03-02-03)
|
||||
- Remove "static inline methods"
|
||||
- Disable EventBiasingMechanism
|
||||
|
||||
Oct. 26, 01 G.Cosmo (track-V03-02-02a)
|
||||
- Added implementation to assignment operator in G4ParticleChangeForRadDecay.hh
|
||||
(H.Kurasige)
|
||||
|
||||
Sep. 20, 01 H.Kurashige (track-V03-02-02)
|
||||
- Update to G4Mars5GeVMechanism for STL migration of materials
|
||||
|
||||
Sep. 20, 01 H.Kurashige (track-V03-02-01)
|
||||
- Modify G4Mars5GeVMechanism for STL migration of materials
|
||||
|
||||
Aug. 16, 01 H.Kurashige (track-V03-02-00)
|
||||
- Clean up codes
|
||||
|
||||
Mar 7, 01 H.Kurashige (track-V03-00-04)
|
||||
- Add protection for the zero-momentum case
|
||||
for UpdateStepForAlongStep in ParticleChange (J.A)
|
||||
|
||||
Feb 17, 01 H.Kurashige (track-V03-00-03)
|
||||
- Add Velocity and Setmethod in G4StepPoint
|
||||
- Add SetVelocity in G4Step.::InitializeStep
|
||||
- Modify G4StepPoint::GetVelocity to return correct velocity for optical photon
|
||||
|
||||
Feb 17, 01 H.Kurashige (track-V03-00-02)
|
||||
- Fix G4Track::GetVelocity for Gamma
|
||||
|
||||
Feb 12, 01 H.Kurashige (track-V03-00-01)
|
||||
- Remove thePolarizationChange from G4ParticleChangeForTransport.hh
|
||||
|
||||
|
||||
Feb 07, 01 H.Kurashige (track-V03-00-00)
|
||||
- Add copy constructor to G4Track
|
||||
|
||||
Oct 19, 00 H.kurashige (track-V02-00-01)
|
||||
- Bug fixes in copy constructor of G4ParticleChange
|
||||
|
||||
Oct 18, 00 H.Kurashige (track-V02-00-00)
|
||||
- Add "const" to G4DynamicParticle pointer of returned value of G4Track::GetDynamicParticle
|
||||
|
||||
June 2, 2000 M.Asai (track-V01-01-02)
|
||||
- Add G4VUserTrackInformation class and its pointer data member in G4Track
|
||||
- Add "const" to pointer to G4Step in G4Track (Hisaya)
|
||||
|
||||
June 1 2000 H.Kurashige (track-V01-01-01a)
|
||||
- Removed "const" from the return value type of G4StepPoint::GetPhysicalVolume()
|
||||
|
||||
May 16 2000 H.Kurashige (track-V01-01-01)
|
||||
- Added thePolarizationChange in G4ParticleChangeForTransportation
|
||||
|
||||
May 12 2000 H.Kurashige (track-V01-01-00)
|
||||
- SetTouchable methods has been changed to get "const" pointer
|
||||
|
||||
Feb. 16, 2000 H.Kurashige
|
||||
- Added cashing mechanism of pointer to material in G4StepPoint
|
||||
- Added theMaterialChange in G4ParticleChangeForTransportation
|
||||
- GetTouchable methods has been changed to give "const" pointer
|
||||
|
||||
Feb 13, 2000 H.Kurashige (track-V01-00-01)
|
||||
- Added G4ParticleChangeForRadDecay
|
||||
- Changed G4VParticleChange::AddSecondary to set secondary track weight equal to the primary's one
|
||||
- Removed printing pointers of ParticleChange object in CheckIt methods
|
||||
|
||||
Jan 18, 2000 H.Kurashige (track-V01-00-00)
|
||||
- Fixed bugs in treatment of secondary track weight
|
||||
|
||||
Nov 7, 1999 H.Kurashige (track-V00-01-01)
|
||||
- Added comments for "Software Reference Manual"
|
||||
|
||||
Oct 5, 1999 H,Kurashige (track-V00-01-00)
|
||||
- Added mass/charge change in G4ParticleChange
|
||||
- Modified G4ParticleChange::CheckIt
|
||||
- Separate implementation of inline functions to G4Track.icc and G4Step.icc
|
||||
|
||||
July 14 1999 H.Kurashige (track-01-00-07)
|
||||
- Fixed bugs in G4Mars5GeVMechanism::CreatePion()
|
||||
|
||||
May 6, 1999 H.Kurashige (track-01-00-06)
|
||||
- Modified CheckIt methods of G4VParticleChange and derived classes
|
||||
|
||||
Apr 28, 1999 H.Kurashige (track-01-00-05b)
|
||||
- Protect proton mass against glanular libraly for G4Mars5Gev...(Makoto)
|
||||
- Fixed error messages in G4ParticleChange::CheckIt (Hisaya)
|
||||
- Remove "include/G4VProcess.hh" from G4Step.cc (Hisaya)
|
||||
|
||||
Apr 13, 1999 H.Kurashige (track-01-00-04)
|
||||
- Code polishing according to the messages by CodeWizard
|
||||
- Added new virtual method of G4bool CheckIt(const G4Track&) in G4VParticleChange
|
||||
|
||||
Feb 17, 1999 H.Kurashige (track-01-00-03)
|
||||
- Removed G4Step::ShowStep() (Takashi)
|
||||
- Fixed bugs in G4ParticleChange.icc (Hisaya)
|
||||
|
||||
Feb 9, 1999 H.Kurashige (track-01-00-02)
|
||||
- Modified G4TrackFastVector (Hisaya)
|
||||
- Modified G4ParticleChange::CheckIt (Hisaya)
|
||||
|
||||
Feb 6, 1999 H.Kurashige (track-01-00-01)
|
||||
- Added Get/SetMomentumDirectionChange in G4ParticleChange (Hisaya)
|
||||
- Removed using G4ParticleMomentum (Hisaya)
|
||||
|
||||
December 15, 1998 H.Kurashige (track-00-04-05)
|
||||
- G4ParticleChange::CheckIt is activated in VERBOSE mode (Hisaya)
|
||||
|
||||
December 12, 1998 H.Kurashige (track-00-04-04)
|
||||
- Fixed bugs in G4Mars5GeVMechanism (Hisaya)
|
||||
- Added SwOnAllEB/SwOffAllEB in G4ParticleChange (Hisaya)
|
||||
- Added GetEBMechanis and IsEBActive in G4VParticleChange (Hisaya)
|
||||
|
||||
December 11, 1998 H.Kurashige (track-00-04-03)
|
||||
- Fixed bugs in G4Mars5GeVMechanism (Hisaya)
|
||||
|
||||
December 9, 1998 L.Urban (track-00-04-02)
|
||||
- Added G4ParticleChangeForLoss and G4ParticleChangeForMSC.
|
||||
|
||||
November 18, 98 H.Kurashige (track-00-04-01)A
|
||||
- Added new member of weight in G4Track and removed G4BiasingTag
|
||||
- Added Event Biasing based on MARS
|
||||
- Modified argument type in G4Track
|
||||
( this tag requires particles-00-04-01 tag)
|
||||
|
||||
November 9, 98 H.Kurashige (track-00-03-05)
|
||||
- Added Event Biasing Mechanism in G4VParticleChange
|
||||
|
||||
November 8, 98 H.Kurashige (track-00-03-04)
|
||||
- Added G4BiasingTag as a member of G4Track
|
||||
- Modified G4Step, and G4StepPoint for managing G4BiasingTag
|
||||
|
||||
Octorber 17, 98 H.Kurashige (track-00-03-03)
|
||||
- Fixed bugs in G4VParticleChange and G4ParticleChange
|
||||
|
||||
October 14 19 H.Kurashige (track-00-03-01)
|
||||
- Modified G4ParticleChangeForTransportation for new relocation algorism.
|
||||
(J.Apost.)
|
||||
|
||||
August 31, 98 G.Cosmo (track-00-02-01)
|
||||
- Added "global" phony target to GNUmakefile.
|
||||
- Added comment to G4StepPoint.hh (J.Apostolakis).
|
||||
|
||||
July 20,98 H.Kurashige (track-00-01-05)
|
||||
- Modified G4ParticleChangeForDecay
|
||||
|
||||
July 10, 98 P.Urban (track-00-01-02)
|
||||
- Optimised G4ParticleChangeForTransport. Much less data
|
||||
is copied -> increased performance.
|
||||
|
||||
July 1, 98 H.Kurashige (track-00-07-02)
|
||||
- Moved UpdateStepForAlongStep into G4ParticleChangeForTransport.cc file
|
||||
|
||||
June 30, 98 P. Urban (track-00-07-01)
|
||||
- Some more tracking optimisation results.
|
||||
|
||||
June 22, 98 P. Urban (track-00-06-04)
|
||||
- Preliminary results of tracking optimisation merged into HEAD.
|
||||
|
||||
June 11, 98 G.Cosmo (track-00-06-03)
|
||||
- Tagged track-00-06-03.
|
||||
|
||||
June 11, 98 J.Allison
|
||||
- Added a missing inline keyword to G4Track.hh:341.
|
||||
|
||||
June 8, 98 H.Kurashige
|
||||
- Add GoodForTracking and BelowThreshold flags in G4Track
|
||||
for new COHERENT scheme for the Cuts
|
||||
|
||||
May 12, 98 H.Kurashige
|
||||
- Fix bugs in G4Step, G4ParticleChange
|
||||
Add new class of G4ParticleChangeForTransport
|
||||
|
||||
April 12, 98 H.Kuraashige
|
||||
Implement new scheme of 'Particle Change'. Please see
|
||||
particle_change.asc in geant4alpha/documents/particles+matter/.
|
||||
Following files are modified (or added)
|
||||
G4ParticleChange.hh, .icc, .cc
|
||||
G4VParticleChange.hh, .icc, .cc
|
||||
G4ParticleChangeForDecay.hh, .cc
|
||||
G4Step.hh, G4TrackFastVector.hh
|
||||
|
||||
April 9, 98 G.Cosmo
|
||||
- Porting on DEC-cxx 6.0.
|
||||
Removed meaningless usage of "const" qualifier from functions
|
||||
return type for basic types by value. Modified files:
|
||||
G4ParticleChange.hh, .icc,
|
||||
G4Step.hh, G4StepPoint.hh, G4Track.hh
|
||||
|
||||
March 18, 1998 K. Amako
|
||||
Add following information to G4Track:
|
||||
1.Momentum direction at the start point (vertex position) of the track
|
||||
2.Kinetic energy at the start point (vertex position) of the track
|
||||
3.Pointer to the process which created the current track
|
||||
Due to this, the following files have modififed and committed.
|
||||
1.NewDesignDoc.txt
|
||||
2.G4Track.hh, G4Track.cc
|
||||
3.G4SteppingManager.cc
|
||||
|
||||
|
||||
January 29, 97 K. Amako
|
||||
Following changes have been done and committed/tagged to cvs.
|
||||
Tag# is track-00-03-01.
|
||||
- G4Step.cc: Output format has been changed in showStep().
|
||||
|
||||
December 19, 97 G. Cosmo - (alpha03)
|
||||
|
||||
- Created.
|
25
geant4/LEMuSR/G4Modified/track/include/CVS/Entries
Normal file
25
geant4/LEMuSR/G4Modified/track/include/CVS/Entries
Normal file
@ -0,0 +1,25 @@
|
||||
/G4ForceCondition.hh/1.4/Tue Jan 7 20:02:52 2003//Tgeant4-06-02-ref-01
|
||||
/G4GPILSelection.hh/1.3/Wed Jul 11 10:08:35 2001//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChangeForMSC.hh/1.7/Thu Jul 29 19:00:43 2004//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChangeForRadDecay.hh/1.5/Thu Jul 10 20:47:22 2003//Tgeant4-06-02-ref-01
|
||||
/G4Step.hh/1.10/Thu Jul 10 20:47:22 2003//Tgeant4-06-02-ref-01
|
||||
/G4Step.icc/1.10/Wed Apr 9 00:20:48 2003//Tgeant4-06-02-ref-01
|
||||
/G4StepPoint.hh/1.13/Sat Nov 1 03:24:48 2003//Tgeant4-06-02-ref-01
|
||||
/G4StepPoint.icc/1.8/Fri May 30 19:12:02 2003//Tgeant4-06-02-ref-01
|
||||
/G4StepStatus.hh/1.3/Wed Jul 11 10:08:37 2001//Tgeant4-06-02-ref-01
|
||||
/G4SteppingControl.hh/1.3/Wed Jul 11 10:08:37 2001//Tgeant4-06-02-ref-01
|
||||
/G4Track.hh/1.16/Wed Apr 9 00:20:48 2003//Tgeant4-06-02-ref-01
|
||||
/G4TrackFastVector.hh/1.4/Wed Jul 11 10:08:37 2001//Tgeant4-06-02-ref-01
|
||||
/G4TrackStatus.hh/1.3/Wed Jul 11 10:08:37 2001//Tgeant4-06-02-ref-01
|
||||
/G4VUserTrackInformation.hh/1.4/Fri May 30 19:12:13 2003//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChange.hh/1.10/Thu Jul 29 19:08:17 2004//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChange.icc/1.10/Thu Jul 29 19:08:19 2004//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChangeForDecay.hh/1.6/Thu Jul 29 19:08:21 2004//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChangeForLoss.hh/1.12/Thu Jul 29 19:08:21 2004//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChangeForMSC.icc/1.5/Thu Jul 29 19:08:21 2004//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChangeForTransport.hh/1.13/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChangeForTransport.icc/1.10/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
|
||||
/G4Track.icc/1.13/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
|
||||
/G4VParticleChange.hh/1.11/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
|
||||
/G4VParticleChange.icc/1.11/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
|
||||
D
|
1
geant4/LEMuSR/G4Modified/track/include/CVS/Repository
Normal file
1
geant4/LEMuSR/G4Modified/track/include/CVS/Repository
Normal file
@ -0,0 +1 @@
|
||||
geant4/source/track/include
|
1
geant4/LEMuSR/G4Modified/track/include/CVS/Root
Normal file
1
geant4/LEMuSR/G4Modified/track/include/CVS/Root
Normal file
@ -0,0 +1 @@
|
||||
:pserver:gum@g4cvs.cern.ch:/afs/cern.ch/sw/geant4/cvs
|
1
geant4/LEMuSR/G4Modified/track/include/CVS/Tag
Normal file
1
geant4/LEMuSR/G4Modified/track/include/CVS/Tag
Normal file
@ -0,0 +1 @@
|
||||
Ngeant4-06-02-ref-01
|
68
geant4/LEMuSR/G4Modified/track/include/G4ForceCondition.hh
Normal file
68
geant4/LEMuSR/G4Modified/track/include/G4ForceCondition.hh
Normal file
@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ForceCondition.hh,v 1.4 2002/10/31 23:41:52 tsasaki Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4ForceCondition
|
||||
//
|
||||
// Class Description:
|
||||
// This enumaration specifies possible conditions the three
|
||||
// types of DoIt can be assinged by physics processes.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4ForceCondition_h
|
||||
#define G4ForceCondition_h 1
|
||||
|
||||
/////////////////////
|
||||
enum G4ForceCondition
|
||||
/////////////////////
|
||||
{
|
||||
InActivated,
|
||||
// This PostStepDoit is inactivated by a user
|
||||
Forced,
|
||||
// This PostStepDoIt is forced to invoke if particle is not a state of StopAndKill.
|
||||
NotForced,
|
||||
// This PostStepDoIt is not forced to invoke.
|
||||
Conditionally,
|
||||
// This PostStepDoIt is forced to invoke only when corresponding
|
||||
// AlongStepDoIt limits the Step.
|
||||
ExclusivelyForced,
|
||||
// Only this PostStepDoIt (or AtRestDoIt) is exclusively forced
|
||||
// to invoke - all other DoIt including AlongStepDoIts are ignored.
|
||||
StronglyForced
|
||||
// This PostStepDoIt is really forced to invoke, anyway.
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
63
geant4/LEMuSR/G4Modified/track/include/G4GPILSelection.hh
Normal file
63
geant4/LEMuSR/G4Modified/track/include/G4GPILSelection.hh
Normal file
@ -0,0 +1,63 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4GPILSelection.hh,v 1.3 2001/07/11 10:08:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00-ref-03 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4GPILSelection
|
||||
//
|
||||
// Class Description:
|
||||
// This enumaration is used to control whether a AlongStepProcess
|
||||
// can be a winner of the GPIL race or not.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4GPILSelection_h
|
||||
#define G4GPILSelection_h 1
|
||||
|
||||
/////////////////////
|
||||
enum G4GPILSelection
|
||||
/////////////////////
|
||||
{
|
||||
CandidateForSelection,
|
||||
// This AlongStep process partecipates in the process selection
|
||||
// mechanism, i.e. it can be the winner of the GPIL race.
|
||||
// (this case is default)
|
||||
|
||||
NotCandidateForSelection
|
||||
// This AlongStep process does not partecipate in the
|
||||
// process selection mechanism even when it limits the Step.
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
294
geant4/LEMuSR/G4Modified/track/include/G4ParticleChange.hh
Normal file
294
geant4/LEMuSR/G4Modified/track/include/G4ParticleChange.hh
Normal file
@ -0,0 +1,294 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChange.hh,v 1.10 2004/05/08 15:28:11 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
//
|
||||
// Class Description
|
||||
// This class is a concrete class for ParticleChange which
|
||||
// has all functionality in old scheme.
|
||||
//-
|
||||
// This class contains the results after invocation of a physics process.
|
||||
// This includes final states of parent particle (momentum, energy,
|
||||
// etc) and secondary particles generated by the interaction.
|
||||
// The tracking assumes that all the values of energy and
|
||||
// momentum are in global reference system, therefore all the
|
||||
// needed Lorentz transformations must have been already Done
|
||||
// when filling the data-members of this class.
|
||||
//-
|
||||
// ---------------------------------------------------------------
|
||||
// IMPORTANT NOTE: Although the name of the class and methods are
|
||||
// "Change", what it stores (and returns in get) are the "FINAL"
|
||||
// values of the Position, Momentum, etc.
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// modify AddSecondary methods for "GoodForTracking" flag
|
||||
// 8 June 1998 H.Kurashige
|
||||
// Add Track weight 12 Nov. 1998 H.Kurashige
|
||||
// Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
|
||||
// Add get/SetDynamicMass 5 Oct. 1999 H.Kurashige
|
||||
// Add get/SetDynamicCharge 5 Oct. 1999 H.Kurashige
|
||||
// -------------------------------------------------------------
|
||||
|
||||
#ifndef G4ParticleChange_h
|
||||
#define G4ParticleChange_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
class G4DynamicParticle;
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
class G4ParticleChange: public G4VParticleChange
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
G4ParticleChange();
|
||||
// G4ParticleChange(G4bool useEB);
|
||||
|
||||
// destructor
|
||||
virtual ~G4ParticleChange();
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operaor as protected
|
||||
G4ParticleChange(const G4ParticleChange &right);
|
||||
G4ParticleChange & operator=(const G4ParticleChange &right);
|
||||
|
||||
public:
|
||||
// equal/unequal operator
|
||||
G4bool operator==(const G4ParticleChange &right) const;
|
||||
G4bool operator!=(const G4ParticleChange &right) const;
|
||||
|
||||
public: // with description
|
||||
// ----------------------------------------------------
|
||||
// --- the following methods are for updating G4Step -----
|
||||
// Return the pointer to the G4Step after updating the Step information
|
||||
// by using final state information of the track given by a physics
|
||||
// process
|
||||
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
// A physics process gives the final state of the particle
|
||||
// relative to the initial state at the beginning of the Step,
|
||||
// i.e., based on information of G4Track (or equivalently
|
||||
// the PreStepPoint)
|
||||
// In this method, the differences (delta) between these two states
|
||||
// are calculated, and are accumulated in PostStepPoint.
|
||||
// Take note that the return type of GetMomentumChange is a
|
||||
// pointer to G4ParticleMometum. Also it is a normalized
|
||||
// momentum vector.
|
||||
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// A physics process gives the final state of the particle
|
||||
// based on information of G4Track (or equivalently the PreStepPoint)
|
||||
|
||||
virtual void Initialize(const G4Track&);
|
||||
// Initialize all propoerties by using G4Track information
|
||||
|
||||
protected: // with description
|
||||
G4Step* UpdateStepInfo(G4Step* Step);
|
||||
// Update the G4Step specific attributes
|
||||
// (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
|
||||
|
||||
public: // with description
|
||||
|
||||
// ----------------------------------------------------
|
||||
//--- methods to keep information of the final state--
|
||||
// IMPORTANT NOTE:
|
||||
// These ProposeXXX methods stores (and returns in GetXXX methods)
|
||||
// the "FINAL" values of the Position, Momentum, etc.
|
||||
|
||||
const G4ThreeVector* GetMomentumDirection() const;
|
||||
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
|
||||
void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
|
||||
// Get/Propose the MomentumDirection vector: it is the final momentum direction.
|
||||
|
||||
const G4ThreeVector* GetPolarization() const;
|
||||
void ProposePolarization(G4double Px, G4double Py, G4double Pz);
|
||||
void ProposePolarization(const G4ThreeVector& finalPoralization);
|
||||
// Get/Propose the final Polarization vector.
|
||||
|
||||
G4double GetEnergy() const;
|
||||
void ProposeEnergy(G4double finalEnergy);
|
||||
// Get/Propose the final kinetic energy of the current particle.
|
||||
|
||||
G4double GetProperTime() const;
|
||||
void ProposeProperTime(G4double finalProperTime);
|
||||
// Get/Propose th final eProperTime
|
||||
|
||||
const G4ThreeVector* GetPosition() const;
|
||||
void ProposePosition(G4double x, G4double y, G4double z);
|
||||
void ProposePosition(const G4ThreeVector& finalPosition);
|
||||
// Get/Propose the final position of the current particle.
|
||||
|
||||
G4double GetGlobalTime() const;
|
||||
void ProposeGlobalTime(G4double finalGlobalTime);
|
||||
// Get/Propose the final GlobalTime
|
||||
|
||||
G4double GetMass() const;
|
||||
void ProposeMass(G4double finalMass);
|
||||
// Get/Propose the final dynamical Mass in G4DynamicParticle
|
||||
|
||||
G4double GetCharge() const;
|
||||
void ProposeCharge(G4double finalCharge);
|
||||
// Get/Propose the final dynamical Charge in G4DynamicParticl
|
||||
|
||||
G4double GetWeight() const;
|
||||
void ProposeWeight(G4double finalWeight);
|
||||
// Get/Propose the final Weight of the current particle
|
||||
|
||||
// -- Utility functions --
|
||||
G4ThreeVector GetGlobalPosition(const G4ThreeVector& displacement) const;
|
||||
// Convert the position displacement to the global position.
|
||||
|
||||
G4double GetGlobalTime(G4double timeDelay) const;
|
||||
// Convert the time delay to the global time.
|
||||
|
||||
G4ThreeVector CalcMomentum(G4double energy,
|
||||
G4ThreeVector direction,
|
||||
G4double mass ) const;
|
||||
// Calculate momentum by using Energy, Momentum Direction, and Mass
|
||||
// ----------------------------------------------------
|
||||
|
||||
|
||||
// ----------------------------------------------------
|
||||
// --- methods for adding secondaries
|
||||
void AddSecondary(G4Track* aSecondary);
|
||||
// Add a secondary particle to theListOfSecondaries.
|
||||
|
||||
void AddSecondary(G4DynamicParticle* aSecondary,
|
||||
G4bool IsGoodForTracking = false );
|
||||
// Add a secondary particle to theListOfSecondaries.
|
||||
// position and time are same as thePositionChange and theTimeChange
|
||||
|
||||
void AddSecondary(G4DynamicParticle* aSecondary,
|
||||
G4ThreeVector position,
|
||||
G4bool IsGoodForTracking = false );
|
||||
// Add a secondary particle to theListOfSecondaries.
|
||||
// global time are same as theTimeChange and theTimeChange
|
||||
|
||||
void AddSecondary(G4DynamicParticle* aSecondary,
|
||||
G4double time,
|
||||
G4bool IsGoodForTracking = false );
|
||||
// Add a secondary particle to theListOfSecondaries.
|
||||
// position and are same as thePositionChange
|
||||
// ----------------------------------------------------
|
||||
|
||||
public:
|
||||
// Following methods will be removed in release 7.0
|
||||
// Using ProposeXXXX methods is recommended to setting
|
||||
// properties in G4ParticleChange
|
||||
const G4ThreeVector* GetMomentumDirectionChange() const;
|
||||
void SetMomentumDirectionChange(G4double Px, G4double Py, G4double Pz);
|
||||
void SetMomentumDirectionChange(const G4ThreeVector& Pfinal);
|
||||
const G4ThreeVector* GetMomentum() const;
|
||||
void SetMomentumChange(G4double Px, G4double Py, G4double Pz);
|
||||
void SetMomentumChange(const G4ThreeVector& Pfinal);
|
||||
const G4ThreeVector* GetMomentumChange() const;
|
||||
const G4ThreeVector* GetPolarizationChange() const;
|
||||
void SetPolarizationChange(G4double Px, G4double Py, G4double Pz);
|
||||
void SetPolarizationChange(const G4ThreeVector& finalPoralization);
|
||||
G4double GetEnergyChange() const;
|
||||
void SetEnergyChange(G4double theEnergyChange);
|
||||
G4double GetProperTimeChange() const;
|
||||
void SetProperTimeChange(G4double t);
|
||||
const G4ThreeVector* GetPositionChange() const;
|
||||
void SetPositionChange(G4double x, G4double y, G4double z);
|
||||
void SetPositionChange(const G4ThreeVector& finalPosition);
|
||||
G4double GetTimeChange() const;
|
||||
void SetTimeChange(G4double t);
|
||||
G4double GetMassChange() const;
|
||||
void SetMassChange(G4double mass);
|
||||
G4double GetChargeChange() const;
|
||||
void SetChargeChange(G4double mass);
|
||||
G4double GetWeightChange() const;
|
||||
void SetWeightChange(G4double w);
|
||||
|
||||
public:
|
||||
virtual void DumpInfo() const;
|
||||
|
||||
protected:
|
||||
G4ThreeVector theMomentumDirectionChange;
|
||||
// It is the vector containing the final momentum direction
|
||||
// after the invoked process. The application of the change
|
||||
// of the momentum direction of the particle is not Done here.
|
||||
// The responsibility to apply the change is up the entity
|
||||
// which invoked the process.
|
||||
|
||||
G4ThreeVector thePolarizationChange;
|
||||
// The changed (final) polarization of a given track
|
||||
|
||||
G4double theEnergyChange;
|
||||
// The final kinetic energy of the current track
|
||||
|
||||
G4ThreeVector thePositionChange;
|
||||
// The changed (final) position of a given track
|
||||
|
||||
G4double theTimeChange;
|
||||
// The changed (final) global time of a given track
|
||||
|
||||
G4double theProperTimeChange;
|
||||
// The changed (final) proper time of a given track
|
||||
|
||||
G4double theWeightChange;
|
||||
// The Changed (final) weight of a given track
|
||||
|
||||
G4double theMassChange;
|
||||
// The Changed (final) mass of a given track
|
||||
|
||||
G4double theChargeChange;
|
||||
// The Changed (final) charge of a given track
|
||||
|
||||
const G4Track* theCurrentTrack;
|
||||
|
||||
public:
|
||||
// for Debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
};
|
||||
|
||||
#include "G4ParticleChange.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
355
geant4/LEMuSR/G4Modified/track/include/G4ParticleChange.icc
Normal file
355
geant4/LEMuSR/G4Modified/track/include/G4ParticleChange.icc
Normal file
@ -0,0 +1,355 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChange.icc,v 1.10 2004/05/08 15:28:11 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
inline
|
||||
G4Step* G4ParticleChange::UpdateStepInfo(G4Step* pStep)
|
||||
{
|
||||
return G4VParticleChange::UpdateStepInfo(pStep);
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetEnergy() const
|
||||
{
|
||||
return theEnergyChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposeEnergy(G4double finalEnergy)
|
||||
{
|
||||
theEnergyChange = finalEnergy;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChange::GetMomentumDirection() const
|
||||
{
|
||||
return &theMomentumDirectionChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposeMomentumDirection(
|
||||
G4double Px,
|
||||
G4double Py,
|
||||
G4double Pz )
|
||||
{
|
||||
theMomentumDirectionChange.setX(Px);
|
||||
theMomentumDirectionChange.setY(Py);
|
||||
theMomentumDirectionChange.setZ(Pz);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposeMomentumDirection(const G4ThreeVector& P)
|
||||
{
|
||||
theMomentumDirectionChange = P;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChange::GetPolarization() const
|
||||
{
|
||||
return &thePolarizationChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposePolarization( const G4ThreeVector& finalPoralization)
|
||||
{
|
||||
thePolarizationChange = finalPoralization;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposePolarization(
|
||||
G4double Px,
|
||||
G4double Py,
|
||||
G4double Pz )
|
||||
{
|
||||
thePolarizationChange.setX(Px);
|
||||
thePolarizationChange.setY(Py);
|
||||
thePolarizationChange.setZ(Pz);
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChange::GetPosition() const
|
||||
{
|
||||
return &thePositionChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposePosition(const G4ThreeVector& finalPosition)
|
||||
{
|
||||
thePositionChange= finalPosition;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposePosition(G4double x,G4double y, G4double z)
|
||||
{
|
||||
thePositionChange.setX(x);
|
||||
thePositionChange.setY(y);
|
||||
thePositionChange.setZ(z);
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetProperTime() const
|
||||
{
|
||||
return theProperTimeChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposeProperTime(G4double tau)
|
||||
{
|
||||
theProperTimeChange = tau;
|
||||
}
|
||||
|
||||
inline
|
||||
G4ThreeVector G4ParticleChange::GetGlobalPosition(const G4ThreeVector& displacement) const
|
||||
{
|
||||
return thePositionChange + displacement;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetGlobalTime(G4double timeDelay) const
|
||||
{
|
||||
// Convert the time delay to the global time.
|
||||
return theTimeChange + timeDelay;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetGlobalTime() const
|
||||
{
|
||||
return theTimeChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposeGlobalTime(G4double t)
|
||||
{
|
||||
theTimeChange = t;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetMass() const
|
||||
{
|
||||
return theMassChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposeMass(G4double t)
|
||||
{
|
||||
theMassChange = t;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetCharge() const
|
||||
{
|
||||
return theChargeChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposeCharge(G4double t)
|
||||
{
|
||||
theChargeChange = t;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetWeight() const
|
||||
{
|
||||
return theWeightChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::ProposeWeight(G4double w)
|
||||
{
|
||||
theWeightChange = w;
|
||||
theParentWeight = w;
|
||||
}
|
||||
|
||||
inline
|
||||
G4ThreeVector G4ParticleChange::CalcMomentum(G4double energy,
|
||||
G4ThreeVector direction,
|
||||
G4double mass
|
||||
) const
|
||||
{
|
||||
G4double tMomentum = sqrt(energy*energy + 2*energy*mass);
|
||||
return direction*tMomentum;
|
||||
}
|
||||
|
||||
|
||||
// Following methods will be removed in release 7.0
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetEnergyChange() const
|
||||
{
|
||||
return GetEnergy();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetEnergyChange(G4double energy)
|
||||
{
|
||||
ProposeEnergy(energy);
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChange::GetMomentumChange() const
|
||||
{
|
||||
return GetMomentumDirection();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetMomentumChange(
|
||||
G4double Px,
|
||||
G4double Py,
|
||||
G4double Pz )
|
||||
{
|
||||
ProposeMomentumDirection(Px, Py, Pz);
|
||||
}
|
||||
inline
|
||||
|
||||
void G4ParticleChange::SetMomentumChange(const G4ThreeVector& P)
|
||||
{
|
||||
ProposeMomentumDirection(P);
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChange::GetMomentumDirectionChange() const
|
||||
{
|
||||
return GetMomentumDirection();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetMomentumDirectionChange(
|
||||
G4double Px,
|
||||
G4double Py,
|
||||
G4double Pz )
|
||||
{
|
||||
ProposeMomentumDirection(Px, Py, Pz);
|
||||
}
|
||||
inline
|
||||
|
||||
void G4ParticleChange::SetMomentumDirectionChange(const G4ThreeVector& P)
|
||||
{
|
||||
ProposeMomentumDirection(P);
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChange::GetPolarizationChange() const
|
||||
{
|
||||
return GetPolarization();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetPolarizationChange( const G4ThreeVector& finalPoralization)
|
||||
{
|
||||
ProposePolarization(finalPoralization);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetPolarizationChange(
|
||||
G4double Px,
|
||||
G4double Py,
|
||||
G4double Pz )
|
||||
{
|
||||
ProposePolarization(Px, Py, Pz);
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChange::GetPositionChange() const
|
||||
{
|
||||
return GetPosition();
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetPositionChange(const G4ThreeVector& finalPosition)
|
||||
{
|
||||
ProposePosition(finalPosition);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetPositionChange(G4double x,G4double y, G4double z)
|
||||
{
|
||||
ProposePosition(x, y, z);
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetProperTimeChange() const
|
||||
{
|
||||
return GetProperTime();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetProperTimeChange(G4double tau)
|
||||
{
|
||||
ProposeProperTime(tau);
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetTimeChange() const
|
||||
{
|
||||
return GetGlobalTime();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetTimeChange(G4double t)
|
||||
{
|
||||
ProposeGlobalTime(t);
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetMassChange() const
|
||||
{
|
||||
return GetMass();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetMassChange(G4double t)
|
||||
{
|
||||
ProposeMass(t);
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetChargeChange() const
|
||||
{
|
||||
return GetCharge();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetChargeChange(G4double t)
|
||||
{
|
||||
ProposeCharge(t);
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChange::GetWeightChange() const
|
||||
{
|
||||
return GetWeight();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChange::SetWeightChange(G4double w)
|
||||
{
|
||||
ProposeWeight(w);
|
||||
}
|
@ -0,0 +1,191 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForDecay.hh,v 1.6 2004/05/08 15:28:11 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
//
|
||||
// Class Description
|
||||
// This class is a concrete class for ParticleChange which
|
||||
// has functionality for G4Decay.
|
||||
//
|
||||
// This class contains the results after invocation of the decay process.
|
||||
// This includes secondary particles generated by the interaction.
|
||||
// ------------------------------------------------------------
|
||||
#ifndef G4ParticleChangeForDecay_h
|
||||
#define G4ParticleChangeForDecay_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
class G4DynamicParticle;
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
class G4ParticleChangeForDecay: public G4VParticleChange
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
G4ParticleChangeForDecay();
|
||||
|
||||
// destructor
|
||||
virtual ~G4ParticleChangeForDecay();
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operaor as protected
|
||||
G4ParticleChangeForDecay(const G4ParticleChangeForDecay &right);
|
||||
G4ParticleChangeForDecay & operator=(const G4ParticleChangeForDecay &right);
|
||||
|
||||
public:
|
||||
// equal/unequal operator
|
||||
G4bool operator==(const G4ParticleChangeForDecay &right) const;
|
||||
G4bool operator!=(const G4ParticleChangeForDecay &right) const;
|
||||
|
||||
public: // with description
|
||||
// ----------------------------------------------------
|
||||
// --- the following methods are for updating G4Step -----
|
||||
// Return the pointer to the G4Step after updating the Step information
|
||||
// by using final state information of the track given by a physics
|
||||
// process
|
||||
|
||||
// !!! No effect for AlongSteyp
|
||||
// virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
|
||||
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
|
||||
virtual void Initialize(const G4Track&);
|
||||
// Initialize all propoerties by using G4Track information
|
||||
|
||||
G4double GetGlobalTime() const;
|
||||
void ProposeGlobalTime(G4double t);
|
||||
// Get/Propose the final GlobalTime
|
||||
|
||||
G4double GetGlobalTime(G4double timeDelay) const;
|
||||
// Convert the time delay to the global time.
|
||||
|
||||
const G4ThreeVector* GetPolarization() const;
|
||||
void ProposePolarization(G4double Px, G4double Py, G4double Pz);
|
||||
void ProposePolarization(const G4ThreeVector& finalPoralization);
|
||||
// Get/Propose the final Polarization vector.
|
||||
|
||||
public:
|
||||
// Following methods will be removed in release 7.0
|
||||
// Using ProposeXXXX methods is recommended to setting
|
||||
// properties in G4ParticleChangeForDecay
|
||||
G4double GetTimeChange() const;
|
||||
void SetTimeChange(G4double t);
|
||||
|
||||
public:
|
||||
virtual void DumpInfo() const;
|
||||
|
||||
protected:
|
||||
G4double theTimeChange;
|
||||
// The change of global time of a given particle.
|
||||
|
||||
G4ThreeVector thePolarizationChange;
|
||||
// The changed (final) polarization of a given track
|
||||
|
||||
public:
|
||||
// for Debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
};
|
||||
|
||||
inline
|
||||
G4double G4ParticleChangeForDecay::GetGlobalTime() const
|
||||
{
|
||||
return theTimeChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForDecay::ProposeGlobalTime(G4double t)
|
||||
{
|
||||
theTimeChange = t;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ParticleChangeForDecay::GetGlobalTime(G4double timeDelay) const
|
||||
{
|
||||
// Convert the time delay to the global time.
|
||||
return theTimeChange + timeDelay;
|
||||
}
|
||||
|
||||
// Following methods will be removed in release 7.0
|
||||
inline
|
||||
G4double G4ParticleChangeForDecay::GetTimeChange() const
|
||||
{
|
||||
return theTimeChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForDecay::SetTimeChange(G4double t)
|
||||
{
|
||||
theTimeChange = t;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChangeForDecay::GetPolarization() const
|
||||
{
|
||||
return &thePolarizationChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForDecay::ProposePolarization(const G4ThreeVector& finalPoralization)
|
||||
{
|
||||
thePolarizationChange = finalPoralization;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForDecay::ProposePolarization(
|
||||
G4double Px,
|
||||
G4double Py,
|
||||
G4double Pz )
|
||||
{
|
||||
thePolarizationChange.setX(Px);
|
||||
thePolarizationChange.setY(Py);
|
||||
thePolarizationChange.setZ(Pz);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,223 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForLoss.hh,v 1.12 2004/06/15 08:17:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
//
|
||||
// Modified:
|
||||
// 16.01.04 V.Ivanchenko update for model variant of energy loss
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
// Class Description
|
||||
// This class is a concrete class for ParticleChange for EnergyLoss
|
||||
//
|
||||
#ifndef G4ParticleChangeForLoss_h
|
||||
#define G4ParticleChangeForLoss_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
class G4DynamicParticle;
|
||||
|
||||
class G4ParticleChangeForLoss: public G4VParticleChange
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
G4ParticleChangeForLoss();
|
||||
|
||||
// destructor
|
||||
virtual ~G4ParticleChangeForLoss();
|
||||
|
||||
// with description
|
||||
// ----------------------------------------------------
|
||||
// --- the following methods are for updating G4Step -----
|
||||
|
||||
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// A physics process gives the final state of the particle
|
||||
// based on information of G4Track
|
||||
|
||||
void InitializeForAlongStep(const G4Track&);
|
||||
void InitializeForPostStep(const G4Track&);
|
||||
//Initialize all propoerties by using G4Track information
|
||||
|
||||
void AddSecondary(G4DynamicParticle* aParticle);
|
||||
// Add next secondary
|
||||
|
||||
G4double GetProposedCharge() const;
|
||||
void SetProposedCharge(G4double theCharge);
|
||||
// Get/Set theCharge
|
||||
|
||||
G4double GetCharge() const;
|
||||
void ProposeCharge(G4double finalCharge);
|
||||
// Get/Propose the final dynamical Charge in G4DynamicParticle
|
||||
|
||||
G4double GetProposedKineticEnergy() const;
|
||||
void SetProposedKineticEnergy(G4double proposedKinEnergy);
|
||||
// Get/Set the final kinetic energy of the current particle.
|
||||
|
||||
// G4double GetEnergy() const;
|
||||
// void ProposeEnergy(G4double finalEnergy);
|
||||
// Get/Propose the final kinetic energy of the current particle.
|
||||
|
||||
const G4ThreeVector& GetProposedMomentumDirection() const;
|
||||
void SetProposedMomentumDirection(const G4ThreeVector& dir);
|
||||
const G4ThreeVector& GetMomentumDirection() const;
|
||||
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
|
||||
void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
|
||||
// Get/Propose the MomentumDirection vector: it is the final momentum direction.
|
||||
|
||||
virtual void DumpInfo() const;
|
||||
|
||||
// for Debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operaor as protected
|
||||
G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right);
|
||||
G4ParticleChangeForLoss & operator=(const G4ParticleChangeForLoss &right);
|
||||
|
||||
private:
|
||||
|
||||
const G4Track* currentTrack;
|
||||
// The pointer to G4Track
|
||||
|
||||
G4double proposedKinEnergy;
|
||||
// The final kinetic energy of the current particle.
|
||||
|
||||
G4double currentCharge;
|
||||
// The final charge of the current particle.
|
||||
|
||||
G4ThreeVector proposedMomentumDirection;
|
||||
// The final momentum direction of the current particle.
|
||||
};
|
||||
|
||||
inline G4double G4ParticleChangeForLoss::GetProposedKineticEnergy() const
|
||||
{
|
||||
return proposedKinEnergy;
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::SetProposedKineticEnergy(G4double energy)
|
||||
{
|
||||
proposedKinEnergy = energy;
|
||||
}
|
||||
|
||||
inline G4double G4ParticleChangeForLoss::GetProposedCharge() const
|
||||
{
|
||||
return currentCharge;
|
||||
}
|
||||
|
||||
inline G4double G4ParticleChangeForLoss::GetCharge() const
|
||||
{
|
||||
return currentCharge;
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::SetProposedCharge(G4double theCharge)
|
||||
{
|
||||
currentCharge = theCharge;
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::ProposeCharge(G4double theCharge)
|
||||
{
|
||||
currentCharge = theCharge;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector& G4ParticleChangeForLoss::GetProposedMomentumDirection() const
|
||||
{
|
||||
return proposedMomentumDirection;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector& G4ParticleChangeForLoss::GetMomentumDirection() const
|
||||
{
|
||||
return proposedMomentumDirection;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForLoss::ProposeMomentumDirection(const G4ThreeVector& dir)
|
||||
{
|
||||
proposedMomentumDirection = dir;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForLoss::SetProposedMomentumDirection(const G4ThreeVector& dir)
|
||||
{
|
||||
proposedMomentumDirection = dir;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForLoss::ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
|
||||
{
|
||||
proposedMomentumDirection.setX(Px);
|
||||
proposedMomentumDirection.setY(Py);
|
||||
proposedMomentumDirection.setZ(Pz);
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::InitializeForAlongStep(const G4Track& track)
|
||||
{
|
||||
theStatusChange = track.GetTrackStatus();
|
||||
theLocalEnergyDeposit = 0.0;
|
||||
InitializeSecondaries(track);
|
||||
theParentWeight = track.GetWeight();
|
||||
proposedKinEnergy = track.GetKineticEnergy();
|
||||
currentCharge = track.GetDynamicParticle()->GetCharge();
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::InitializeForPostStep(const G4Track& track)
|
||||
{
|
||||
theStatusChange = track.GetTrackStatus();
|
||||
theLocalEnergyDeposit = 0.0;
|
||||
InitializeSecondaries(track);
|
||||
theParentWeight = track.GetWeight();
|
||||
proposedKinEnergy = track.GetKineticEnergy();
|
||||
currentCharge = track.GetDynamicParticle()->GetCharge();
|
||||
proposedMomentumDirection = track.GetMomentumDirection();
|
||||
currentTrack = &track;
|
||||
}
|
||||
|
||||
inline void G4ParticleChangeForLoss::AddSecondary(G4DynamicParticle* aParticle)
|
||||
{
|
||||
// create track
|
||||
G4Track* aTrack = new G4Track(aParticle, currentTrack->GetGlobalTime(),
|
||||
currentTrack->GetPosition());
|
||||
|
||||
// Touchable handle is copied to keep the pointer
|
||||
aTrack->SetTouchableHandle(currentTrack->GetTouchableHandle());
|
||||
|
||||
// add a secondary
|
||||
G4VParticleChange::AddSecondary(aTrack);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
128
geant4/LEMuSR/G4Modified/track/include/G4ParticleChangeForMSC.hh
Normal file
128
geant4/LEMuSR/G4Modified/track/include/G4ParticleChangeForMSC.hh
Normal file
@ -0,0 +1,128 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForMSC.hh,v 1.7 2004/05/08 15:28:11 kurasige Exp $
|
||||
// GEANT4 tag $ $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// Class Description
|
||||
// This class is special "Particle Change" for Multiple Scattering process
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
// Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
|
||||
// Update for model variant of msc 16 Jan 2004 V.Ivanchenko
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
#ifndef G4ParticleChangeForMSC_h
|
||||
#define G4ParticleChangeForMSC_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
class G4DynamicParticle;
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
class G4ParticleChangeForMSC: public G4VParticleChange
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
G4ParticleChangeForMSC();
|
||||
|
||||
// destructor
|
||||
virtual ~G4ParticleChangeForMSC();
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operaor as protected
|
||||
G4ParticleChangeForMSC(const G4ParticleChangeForMSC &right);
|
||||
G4ParticleChangeForMSC & operator=(const G4ParticleChangeForMSC &right);
|
||||
|
||||
|
||||
public: // with description
|
||||
// ----------------------------------------------------
|
||||
// --- the following methods are for updating G4Step -----
|
||||
// Return the pointer to the G4Step after updating the Step information
|
||||
// by using final state information of the track given by a physics
|
||||
// process
|
||||
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// A physics process gives the final state of the particle
|
||||
// based on information of G4Track (or equivalently the PreStepPoint)
|
||||
|
||||
virtual void Initialize(const G4Track&);
|
||||
// Initialize all propoerties by using G4Track information
|
||||
|
||||
// ----------------------------------------------------
|
||||
//--- methods to keep information of the final state--
|
||||
// IMPORTANT NOTE: Although the name of the class and methods are
|
||||
// "Change", what it stores (and returns in get) are the "FINAL"
|
||||
// values of the Position, Momentum, etc.
|
||||
|
||||
void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
|
||||
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
|
||||
const G4ThreeVector* GetMomentumDirection() const;
|
||||
const G4ThreeVector* GetProposedMomentumDirection() const;
|
||||
void SetProposedMomentumDirection(const G4ThreeVector& Pfinal);
|
||||
// Get/Set theMomentumDirectionChange vector: it is the final momentum direction.
|
||||
|
||||
const G4ThreeVector* GetPosition() const;
|
||||
void ProposePosition(const G4ThreeVector& finalPosition);
|
||||
const G4ThreeVector* GetProposedPosition() const;
|
||||
void SetProposedPosition(const G4ThreeVector& finalPosition);
|
||||
// Get/Set the final position of the current particle.
|
||||
|
||||
public:
|
||||
// Following methods will be removed in release 7.0
|
||||
// Using ProposeXXXX methods is recommended to setting
|
||||
// properties in G4ParticleChangeForMSC
|
||||
void SetMomentumChange(const G4ThreeVector& Pfinal);
|
||||
void SetMomentumChange(G4double Px, G4double Py, G4double Pz);
|
||||
const G4ThreeVector* GetPositionChange() const;
|
||||
void SetPositionChange(const G4ThreeVector& finalPosition);
|
||||
|
||||
public:
|
||||
virtual void DumpInfo() const;
|
||||
// for Debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
|
||||
private:
|
||||
G4ThreeVector theMomentumDirection;
|
||||
// It is the vector containing the final momentum direction
|
||||
// after the invoked process. The application of the change
|
||||
// of the momentum direction of the particle is not Done here.
|
||||
// The responsibility to apply the change is up the entity
|
||||
// which invoked the process.
|
||||
|
||||
G4ThreeVector thePosition;
|
||||
// The changed (final) position of a given particle.
|
||||
|
||||
};
|
||||
|
||||
#include "G4ParticleChangeForMSC.icc"
|
||||
#endif
|
||||
|
@ -0,0 +1,118 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForMSC.icc,v 1.5 2004/05/08 15:28:12 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::ProposeMomentumDirection(const G4ThreeVector& P)
|
||||
{
|
||||
theMomentumDirection = P;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::SetProposedMomentumDirection(const G4ThreeVector& P)
|
||||
{
|
||||
theMomentumDirection = P;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
|
||||
{
|
||||
theMomentumDirection.setX(Px);
|
||||
theMomentumDirection.setY(Py);
|
||||
theMomentumDirection.setZ(Pz);
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChangeForMSC::GetMomentumDirection() const
|
||||
{
|
||||
return &theMomentumDirection;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChangeForMSC::GetProposedMomentumDirection() const
|
||||
{
|
||||
return &theMomentumDirection;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::SetProposedPosition(const G4ThreeVector& P)
|
||||
{
|
||||
thePosition = P;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChangeForMSC::GetPosition() const
|
||||
{
|
||||
return &thePosition;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChangeForMSC::GetProposedPosition() const
|
||||
{
|
||||
return &thePosition;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::ProposePosition(const G4ThreeVector& P)
|
||||
{
|
||||
thePosition = P;
|
||||
}
|
||||
|
||||
|
||||
inline void G4ParticleChangeForMSC::Initialize(const G4Track& track)
|
||||
{
|
||||
theStatusChange = track.GetTrackStatus();
|
||||
theMomentumDirection = track.GetMomentumDirection();
|
||||
thePosition = track.GetPosition();
|
||||
}
|
||||
|
||||
// Following methods will be removed in release 7.0
|
||||
inline
|
||||
void G4ParticleChangeForMSC::SetMomentumChange(const G4ThreeVector& P)
|
||||
{
|
||||
ProposeMomentumDirection(P);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::SetMomentumChange(G4double Px, G4double Py, G4double Pz)
|
||||
{
|
||||
ProposeMomentumDirection(Px, Py, Pz);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForMSC::SetPositionChange(const G4ThreeVector& P)
|
||||
{
|
||||
ProposePosition(P);
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* G4ParticleChangeForMSC::GetPositionChange() const
|
||||
{
|
||||
return GetPosition();
|
||||
}
|
||||
|
@ -0,0 +1,104 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForRadDecay.hh,v 1.5 2003/06/03 08:56:37 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-ref-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 25 Jan. 2000 H.Kurahige
|
||||
//
|
||||
// Class Description
|
||||
// This class is a concrete class for ParticleChange for RadDecay
|
||||
//
|
||||
#ifndef G4ParticleChangeForRadDecay_h
|
||||
#define G4ParticleChangeForRadDecay_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
class G4VTouchable;
|
||||
#include "G4ParticleChange.hh"
|
||||
|
||||
class G4ParticleChangeForRadDecay: public G4ParticleChange
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
G4ParticleChangeForRadDecay(){}
|
||||
|
||||
// destructor
|
||||
virtual ~G4ParticleChangeForRadDecay(){}
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operaor as protected
|
||||
G4ParticleChangeForRadDecay(const G4ParticleChangeForRadDecay &) : G4ParticleChange() {}
|
||||
G4ParticleChangeForRadDecay & operator=(const G4ParticleChangeForRadDecay &){return *this;}
|
||||
|
||||
|
||||
public: // with description
|
||||
void AddSecondary(G4Track* aSecondary);
|
||||
// Add a secondary particle to theListOfSecondaries.
|
||||
// ------------------------------------------------------
|
||||
|
||||
|
||||
};
|
||||
|
||||
inline void G4ParticleChangeForRadDecay::AddSecondary(G4Track *aTrack)
|
||||
{
|
||||
// add a secondary after size check
|
||||
if (theSizeOftheListOfSecondaries > theNumberOfSecondaries) {
|
||||
theListOfSecondaries->SetElement(theNumberOfSecondaries, aTrack);
|
||||
theNumberOfSecondaries++;
|
||||
} 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;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,148 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForTransport.hh,v 1.13 2004/05/08 15:28:13 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 10 May. 1998 H.Kurahige
|
||||
// Added theMaterialChange 16 FEb. 2000 H.Kurahige
|
||||
// Remove thePolarizationChange 12 Feb. 2001 H.Kurashige
|
||||
// Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek
|
||||
// Add MaterialCutsCouple 8 Oct. 2002 H.Kurashige
|
||||
//
|
||||
// Class Description
|
||||
// This class is a concrete class for ParticleChange for transportation
|
||||
//
|
||||
#ifndef G4ParticleChangeForTransport_h
|
||||
#define G4ParticleChangeForTransport_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4TouchableHandle.hh"
|
||||
#include "G4ParticleChange.hh"
|
||||
|
||||
class G4MaterialCutsCouple;
|
||||
|
||||
|
||||
class G4ParticleChangeForTransport: public G4ParticleChange
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
G4ParticleChangeForTransport();
|
||||
|
||||
// destructor
|
||||
virtual ~G4ParticleChangeForTransport();
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operator as protected
|
||||
G4ParticleChangeForTransport(const G4ParticleChangeForTransport &right);
|
||||
G4ParticleChangeForTransport & operator=(const G4ParticleChangeForTransport &right);
|
||||
|
||||
public: // with description
|
||||
// ----------------------------------------------------
|
||||
// --- the following methods are for updating G4Step -----
|
||||
// Return the pointer to the G4Step after updating the Step information
|
||||
// by using final state information of the track given by a physics
|
||||
// process
|
||||
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// A physics process gives the final state of the particle
|
||||
// based on information of G4Track (or equivalently the PreStepPoint)
|
||||
|
||||
virtual void Initialize(const G4Track&);
|
||||
// Initialize all propoerties by using G4Track information
|
||||
|
||||
// ----------------------------------------------------
|
||||
//--- methods to keep information of the final state--
|
||||
// IMPORTANT NOTE: Although the name of the class and methods are
|
||||
// "Change", what it stores (and returns in get) are the "FINAL"
|
||||
// values of the Position, Momentum, etc.
|
||||
|
||||
const G4TouchableHandle& GetTouchableHandle() const;
|
||||
void SetTouchableHandle(const G4TouchableHandle& fTouchable);
|
||||
// Get/Set the touchable of the current particle.
|
||||
// Note: Touchable in PostStepPoint will be updated only after PostStepDoIt
|
||||
|
||||
G4Material* GetMaterialInTouchable() const;
|
||||
void SetMaterialInTouchable(G4Material* fMaterial);
|
||||
// Get/Propose the material in the touchable of the current particle.
|
||||
|
||||
const G4MaterialCutsCouple* GetMaterialCutsCoupleInTouchable() const;
|
||||
void SetMaterialCutsCoupleInTouchable(const G4MaterialCutsCouple* fMaterialCutsCouple);
|
||||
// Get/Set the materialCutsCouple in the touchable of the current particle.
|
||||
|
||||
G4bool GetMomentumChanged() const;
|
||||
void SetMomentumChanged(G4bool b);
|
||||
|
||||
public:
|
||||
// Following methods will be removed in release 7.0
|
||||
// Using ProposeXXXX methods is recommended to setting
|
||||
// properties in G4ParticleChangeForDecay
|
||||
G4Material* GetMaterialChange() const;
|
||||
void SetMaterialChange(G4Material* fMaterial);
|
||||
const G4MaterialCutsCouple* GetMaterialCutsCoupleChange() const;
|
||||
void SetMaterialCutsCoupleChange(const G4MaterialCutsCouple* fMaterialCutsCouple);
|
||||
|
||||
public:
|
||||
virtual void DumpInfo() const;
|
||||
|
||||
protected:
|
||||
G4TouchableHandle theTouchableHandle;
|
||||
// The changed touchable of a given particle.
|
||||
|
||||
public:
|
||||
|
||||
// Prototype implementation of smooth representation of curved trajectories.
|
||||
// Auxiliary points are ThreeVectors for now; change to G4AuxiliaryPoints.
|
||||
|
||||
inline void SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>* theNewVectorPointer );
|
||||
inline std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const;
|
||||
|
||||
private:
|
||||
G4bool isMomentumChanged;
|
||||
// The flag which is set if mometum is changed in this stepi
|
||||
G4Material* theMaterialChange;
|
||||
const G4MaterialCutsCouple* theMaterialCutsCoupleChange;
|
||||
// The material (and MaterialCutsCouple) where given track
|
||||
// currently locates
|
||||
|
||||
private:
|
||||
std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer;
|
||||
};
|
||||
|
||||
#include "G4ParticleChangeForTransport.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,163 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForTransport.icc,v 1.10 2004/05/08 15:28:13 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
inline
|
||||
void G4ParticleChangeForTransport::SetTouchableHandle(const G4TouchableHandle&
|
||||
fTouchable)
|
||||
{
|
||||
theTouchableHandle = fTouchable;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4TouchableHandle& G4ParticleChangeForTransport::GetTouchableHandle() const
|
||||
{
|
||||
return theTouchableHandle;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForTransport::SetMaterialInTouchable(G4Material* fMaterial)
|
||||
{
|
||||
theMaterialChange = fMaterial;
|
||||
}
|
||||
|
||||
inline
|
||||
G4Material* G4ParticleChangeForTransport::GetMaterialInTouchable() const
|
||||
{
|
||||
return theMaterialChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForTransport::SetMaterialCutsCoupleInTouchable(const G4MaterialCutsCouple* fMaterialCutsCouple)
|
||||
{
|
||||
theMaterialCutsCoupleChange = fMaterialCutsCouple;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4MaterialCutsCouple* G4ParticleChangeForTransport::GetMaterialCutsCoupleInTouchable() const
|
||||
{
|
||||
return theMaterialCutsCoupleChange;
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4ParticleChangeForTransport::GetMomentumChanged() const
|
||||
{
|
||||
return isMomentumChanged;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForTransport::SetMomentumChanged(G4bool b)
|
||||
{
|
||||
isMomentumChanged= b;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// functions for Initialization
|
||||
//
|
||||
|
||||
inline void G4ParticleChangeForTransport::Initialize(const G4Track& track)
|
||||
{
|
||||
// use base class's method at first
|
||||
InitializeStatusChange(track);
|
||||
// InitializeLocalEnergyDeposit(track);
|
||||
InitializeSteppingControl(track);
|
||||
// InitializeTrueStepLength(track);
|
||||
// InitializeSecondaries(track);
|
||||
|
||||
// set Energy/Momentum etc. equal to those of the parent particle
|
||||
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
|
||||
// theEnergyChange = pParticle->GetKineticEnergy();
|
||||
// theMomentumChange = pParticle->GetMomentumDirection();
|
||||
thePolarizationChange = pParticle->GetPolarization();
|
||||
// theProperTimeChange = pParticle->GetProperTime();
|
||||
|
||||
// set Position/Time etc. equal to those of the parent track
|
||||
// thePositionChange = track.GetPosition();
|
||||
// theTimeChange = track.GetGlobalTime();
|
||||
|
||||
// set touchable equal to the next touchable of the parent track
|
||||
// not set as for now
|
||||
//theTouchableChange = track.GetNextTouchable();
|
||||
|
||||
// So almost nothing is initialized here.
|
||||
// theMomentumChange, theProperTimeChange, thePositionChange and theTimeChange
|
||||
// are set by G4Transportation::AlongStepDoIt;
|
||||
// the others are not needed.
|
||||
// Take care when implementing the PostStep related things!
|
||||
// (P. Urban)
|
||||
}
|
||||
|
||||
// Prototype implementation of smooth representation of curved trajectories.
|
||||
|
||||
inline void
|
||||
G4ParticleChangeForTransport::
|
||||
SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>*
|
||||
theNewVectorPointer )
|
||||
{
|
||||
fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
|
||||
}
|
||||
|
||||
inline std::vector<G4ThreeVector>*
|
||||
G4ParticleChangeForTransport::GetPointerToVectorOfAuxiliaryPoints() const
|
||||
{
|
||||
return fpVectorOfAuxiliaryPointsPointer;
|
||||
}
|
||||
|
||||
|
||||
// Following methods will be removed in release 7.0
|
||||
inline
|
||||
void G4ParticleChangeForTransport::SetMaterialChange(G4Material* fMaterial)
|
||||
{
|
||||
theMaterialChange = fMaterial;
|
||||
}
|
||||
|
||||
inline
|
||||
G4Material* G4ParticleChangeForTransport::GetMaterialChange() const
|
||||
{
|
||||
return theMaterialChange;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ParticleChangeForTransport::SetMaterialCutsCoupleChange(const G4MaterialCutsCouple* fMaterialCutsCouple)
|
||||
{
|
||||
theMaterialCutsCoupleChange = fMaterialCutsCouple;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4MaterialCutsCouple* G4ParticleChangeForTransport::GetMaterialCutsCoupleChange() const
|
||||
{
|
||||
return theMaterialCutsCoupleChange;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
179
geant4/LEMuSR/G4Modified/track/include/G4Step.hh
Normal file
179
geant4/LEMuSR/G4Modified/track/include/G4Step.hh
Normal file
@ -0,0 +1,179 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Step.hh,v 1.10 2003/06/16 17:12:58 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-ref-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4Step.hh
|
||||
//
|
||||
// Class Description:
|
||||
// This class represents the Step of a particle tracked.
|
||||
// It includes information of
|
||||
// 1) List of Step points which compose the Step,
|
||||
// 2) static information of particle which generated the
|
||||
// Step,
|
||||
// 3) trackID and parent particle ID of the Step,
|
||||
// 4) termination condition of the Step,
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// Modified for the new G4ParticleChange 12 Mar. 1998 H.Kurahige
|
||||
// Correct treatment of touchable in G4Step::UpdateTrack
|
||||
// 12 May. 1998 H.Kurashige
|
||||
// ---------------------------------------------------------------
|
||||
// Separate implementation of inline functions inti G4Step.icc
|
||||
// Add updating mass/charge
|
||||
// 6 Oct. 1999 H.Kurashige
|
||||
//
|
||||
#ifndef G4Step_h
|
||||
#define G4Step_h 1
|
||||
|
||||
#include <stdlib.h> // Include from 'system'
|
||||
#include "G4ios.hh" // Include from 'system'
|
||||
#include <iomanip> // Include from 'system'
|
||||
#include "globals.hh" // Include from 'global'
|
||||
#include "G4ThreeVector.hh" // Include from 'global'
|
||||
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
|
||||
#include "G4StepPoint.hh" // Include from 'track'
|
||||
#include "G4StepStatus.hh" // Include from 'track'
|
||||
class G4Polyline; // Forward declaration.
|
||||
class G4Track; // Forward declaration.
|
||||
|
||||
|
||||
////////////
|
||||
class G4Step
|
||||
////////////
|
||||
{
|
||||
|
||||
//--------
|
||||
public:
|
||||
|
||||
// Constructor/Destrcutor
|
||||
G4Step();
|
||||
~G4Step();
|
||||
|
||||
//--------
|
||||
public: // WIth description
|
||||
|
||||
// Get/Set functions
|
||||
// currnet track
|
||||
G4Track* GetTrack() const;
|
||||
void SetTrack(G4Track* value);
|
||||
|
||||
// step points
|
||||
G4StepPoint* GetPreStepPoint() const;
|
||||
void SetPreStepPoint(G4StepPoint* value);
|
||||
|
||||
G4StepPoint* GetPostStepPoint() const;
|
||||
void SetPostStepPoint(G4StepPoint* value);
|
||||
|
||||
// step length
|
||||
G4double GetStepLength() const;
|
||||
void SetStepLength(G4double value);
|
||||
|
||||
// total energy deposit
|
||||
G4double GetTotalEnergyDeposit() const;
|
||||
void SetTotalEnergyDeposit(G4double value);
|
||||
|
||||
// cotrole flag for stepping
|
||||
G4SteppingControl GetControlFlag() const;
|
||||
void SetControlFlag(G4SteppingControl StepControlFlag);
|
||||
|
||||
// difference of position, time, momentum and energy
|
||||
G4ThreeVector GetDeltaPosition() const;
|
||||
G4double GetDeltaTime() const;
|
||||
|
||||
G4ThreeVector GetDeltaMomentum() const;
|
||||
G4double GetDeltaEnergy() const;
|
||||
|
||||
// manipulation of total energy deposit
|
||||
void AddTotalEnergyDeposit(G4double value);
|
||||
void ResetTotalEnergyDeposit();
|
||||
|
||||
|
||||
// Other member functions
|
||||
void InitializeStep( G4Track* aValue );
|
||||
// initiaize contents of G4Step
|
||||
|
||||
void UpdateTrack( );
|
||||
// update track by using G4Step information
|
||||
|
||||
void CopyPostToPreStepPoint( );
|
||||
// copy PostStepPoint to PreStepPoint
|
||||
|
||||
G4Polyline* CreatePolyline () const;
|
||||
// for visualization
|
||||
|
||||
//-----------
|
||||
protected:
|
||||
//-----------
|
||||
|
||||
// Member data
|
||||
G4double fTotalEnergyDeposit;
|
||||
// Accummulated total energy desposit in the current Step
|
||||
|
||||
//---------
|
||||
private:
|
||||
//---------
|
||||
|
||||
// Member data
|
||||
G4StepPoint* fpPreStepPoint;
|
||||
G4StepPoint* fpPostStepPoint;
|
||||
G4double fStepLength;
|
||||
// Step length which may be updated at each invocation of
|
||||
// AlongStepDoIt and PostStepDoIt
|
||||
G4Track* fpTrack;
|
||||
//
|
||||
G4SteppingControl fpSteppingControlFlag;
|
||||
// A flag to control SteppingManager behavier from process
|
||||
|
||||
|
||||
// Prototyping implementation of smooth representation of curved
|
||||
// trajectories. (jacek 30/10/2002)
|
||||
public:
|
||||
// Auxiliary points are ThreeVectors for now; change to
|
||||
// G4VAuxiliaryPoints or some such (jacek 30/10/2002)
|
||||
void SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>* theNewVectorPointer ) {
|
||||
fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
|
||||
}
|
||||
std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const {
|
||||
return fpVectorOfAuxiliaryPointsPointer;
|
||||
}
|
||||
private:
|
||||
// Explicity including the word "Pointer" in the name as I keep
|
||||
// forgetting the * (jacek 30/10/2002)
|
||||
std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer;
|
||||
|
||||
};
|
||||
|
||||
#include "G4Step.icc"
|
||||
|
||||
|
||||
#endif
|
238
geant4/LEMuSR/G4Modified/track/include/G4Step.icc
Normal file
238
geant4/LEMuSR/G4Modified/track/include/G4Step.icc
Normal file
@ -0,0 +1,238 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Step.icc,v 1.10 2003/03/05 04:42:53 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00-ref-03 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------------
|
||||
// In-line definitions
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
// Get/Set functions
|
||||
inline
|
||||
G4StepPoint* G4Step::GetPreStepPoint() const
|
||||
{
|
||||
return fpPreStepPoint;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Step::SetPreStepPoint(G4StepPoint* value)
|
||||
{
|
||||
fpPreStepPoint = value;
|
||||
}
|
||||
|
||||
inline
|
||||
G4StepPoint* G4Step::GetPostStepPoint() const
|
||||
{
|
||||
return fpPostStepPoint;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Step::SetPostStepPoint(G4StepPoint* value)
|
||||
{
|
||||
fpPostStepPoint = value;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4Step::GetStepLength() const
|
||||
{
|
||||
return fStepLength;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Step::SetStepLength(G4double value)
|
||||
{
|
||||
fStepLength = value;
|
||||
}
|
||||
|
||||
inline
|
||||
G4ThreeVector G4Step::GetDeltaPosition() const
|
||||
{
|
||||
return fpPostStepPoint->GetPosition()
|
||||
- fpPreStepPoint->GetPosition();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4Step::GetDeltaTime() const
|
||||
{
|
||||
return fpPostStepPoint->GetLocalTime()
|
||||
- fpPreStepPoint->GetLocalTime();
|
||||
}
|
||||
|
||||
inline
|
||||
G4ThreeVector G4Step::GetDeltaMomentum() const
|
||||
{
|
||||
return fpPostStepPoint->GetMomentum()
|
||||
- fpPreStepPoint->GetMomentum();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4Step::GetDeltaEnergy() const
|
||||
{
|
||||
return fpPostStepPoint->GetKineticEnergy()
|
||||
- fpPreStepPoint->GetKineticEnergy();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4Step::GetTotalEnergyDeposit() const
|
||||
{
|
||||
return fTotalEnergyDeposit;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Step::SetTotalEnergyDeposit(G4double value)
|
||||
{
|
||||
fTotalEnergyDeposit = value;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Step::AddTotalEnergyDeposit(G4double value)
|
||||
{
|
||||
fTotalEnergyDeposit += value;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Step::ResetTotalEnergyDeposit()
|
||||
{
|
||||
fTotalEnergyDeposit = 0.;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Step::SetControlFlag(G4SteppingControl value)
|
||||
{
|
||||
fpSteppingControlFlag = value;
|
||||
}
|
||||
|
||||
inline
|
||||
G4SteppingControl G4Step::GetControlFlag() const
|
||||
{
|
||||
return fpSteppingControlFlag;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Step::CopyPostToPreStepPoint( )
|
||||
{
|
||||
*(fpPreStepPoint) = *(fpPostStepPoint);
|
||||
fpPostStepPoint->SetStepStatus(fUndefined);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// To implement bi-directional association between G4Step and
|
||||
// and G4Track, a combined usage of 'forward declaration' and
|
||||
// 'include' is necessary.
|
||||
//-------------------------------------------------------------
|
||||
#include "G4Track.hh"
|
||||
|
||||
inline
|
||||
G4Track* G4Step::GetTrack() const
|
||||
{
|
||||
return fpTrack;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Step::SetTrack(G4Track* value)
|
||||
{
|
||||
fpTrack = value;
|
||||
}
|
||||
|
||||
|
||||
// Other member functions
|
||||
inline
|
||||
void G4Step::InitializeStep( G4Track* aValue )
|
||||
{
|
||||
// Initialize G4Step attributes
|
||||
fStepLength = 0.;
|
||||
fTotalEnergyDeposit = 0.;
|
||||
fpTrack = aValue;
|
||||
fpTrack->SetStepLength(0.);
|
||||
|
||||
// Initialize G4StepPoint attributes.
|
||||
// To avoid the circular dependency between G4Track, G4Step
|
||||
// and G4StepPoint, G4Step has to manage the copy actions.
|
||||
fpPreStepPoint->SetPosition(fpTrack->GetPosition());
|
||||
fpPreStepPoint->SetGlobalTime(fpTrack->GetGlobalTime());
|
||||
fpPreStepPoint->SetLocalTime(fpTrack->GetLocalTime());
|
||||
fpPreStepPoint->SetProperTime(fpTrack->GetProperTime());
|
||||
fpPreStepPoint->SetMomentumDirection(fpTrack->GetMomentumDirection());
|
||||
fpPreStepPoint->SetKineticEnergy(fpTrack->GetKineticEnergy());
|
||||
fpPreStepPoint->SetVelocity(fpTrack->GetVelocity());
|
||||
fpPreStepPoint->SetTouchableHandle(fpTrack->GetTouchableHandle());
|
||||
fpPreStepPoint->SetMaterial( fpTrack->GetTouchable()->GetVolume()->GetLogicalVolume()->GetMaterial());
|
||||
fpPreStepPoint->SetMaterialCutsCouple( fpTrack->GetTouchable()->GetVolume()->GetLogicalVolume()->GetMaterialCutsCouple());
|
||||
fpPreStepPoint->SetPolarization(fpTrack->GetPolarization());
|
||||
fpPreStepPoint->SetSafety(0.);
|
||||
fpPreStepPoint->SetStepStatus(fUndefined);
|
||||
fpPreStepPoint->SetProcessDefinedStep(0);
|
||||
fpPreStepPoint->SetMass(fpTrack->GetDynamicParticle()->GetMass());
|
||||
fpPreStepPoint->SetCharge(fpTrack->GetDynamicParticle()->GetCharge());
|
||||
fpPreStepPoint->SetWeight(fpTrack->GetWeight());
|
||||
|
||||
|
||||
(*fpPostStepPoint) = (*fpPreStepPoint);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Step::UpdateTrack( )
|
||||
{
|
||||
// To avoid the circular dependency between G4Track, G4Step
|
||||
// and G4StepPoint, G4Step has to manage the update actions.
|
||||
// position, time
|
||||
fpTrack->SetPosition(fpPostStepPoint->GetPosition());
|
||||
fpTrack->SetGlobalTime(fpPostStepPoint->GetGlobalTime());
|
||||
fpTrack->SetLocalTime(fpPostStepPoint->GetLocalTime());
|
||||
fpTrack->SetProperTime(fpPostStepPoint->GetProperTime());
|
||||
// energy, momentum, polarization
|
||||
fpTrack->SetMomentumDirection(fpPostStepPoint->GetMomentumDirection());
|
||||
fpTrack->SetKineticEnergy(fpPostStepPoint->GetKineticEnergy());
|
||||
fpTrack->SetPolarization(fpPostStepPoint->GetPolarization());
|
||||
// mass charge
|
||||
G4DynamicParticle* pParticle = (G4DynamicParticle*)(fpTrack->GetDynamicParticle());
|
||||
pParticle->SetMass(fpPostStepPoint->GetMass());
|
||||
pParticle->SetCharge(fpPostStepPoint->GetCharge());
|
||||
// step length
|
||||
fpTrack->SetStepLength(fStepLength);
|
||||
// NextTouchable is updated
|
||||
// (G4Track::Touchable points touchable of Pre-StepPoint)
|
||||
fpTrack->SetNextTouchableHandle(fpPostStepPoint->GetTouchableHandle());
|
||||
fpTrack->SetWeight(fpPostStepPoint->GetWeight());
|
||||
|
||||
// set velocity
|
||||
fpPostStepPoint->SetVelocity(fpTrack->GetVelocity());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
208
geant4/LEMuSR/G4Modified/track/include/G4StepPoint.hh
Normal file
208
geant4/LEMuSR/G4Modified/track/include/G4StepPoint.hh
Normal file
@ -0,0 +1,208 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4StepPoint.hh,v 1.13 2003/09/19 19:08:14 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-ref-05 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4StepPoint.hh
|
||||
//
|
||||
// Class Description:
|
||||
// This class represents information associated with the
|
||||
// each end of a Step like the space/time data of the
|
||||
// particle.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// Added fpMaterial 16 FEb. 2000 H.Kurahige
|
||||
// Added fpMaterialCutsCouple 8 Oct. 2002 H.Kurahige
|
||||
|
||||
#ifndef G4StepPoint_h
|
||||
#define G4StepPoint_h 1
|
||||
|
||||
#include "globals.hh" // Include from 'global'
|
||||
#include "G4Allocator.hh" // Include from 'global'
|
||||
#include "G4ThreeVector.hh" // Include from 'geometry'
|
||||
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
|
||||
class G4VProcess;
|
||||
#include "G4SteppingControl.hh"
|
||||
#include "G4StepStatus.hh" // Include from 'track'
|
||||
#include "G4TouchableHandle.hh" // Include from 'geometry'
|
||||
#include "G4Material.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
|
||||
class G4MaterialCutsCouple;
|
||||
/////////////////
|
||||
class G4StepPoint
|
||||
/////////////////
|
||||
{
|
||||
|
||||
//--------
|
||||
public:
|
||||
|
||||
|
||||
// Constructor/Destructor
|
||||
G4StepPoint();
|
||||
|
||||
~G4StepPoint(){};
|
||||
|
||||
//--------
|
||||
|
||||
public: // with description
|
||||
|
||||
// Get/Set functions
|
||||
const G4ThreeVector& GetPosition() const;
|
||||
void SetPosition(const G4ThreeVector& aValue);
|
||||
void AddPosition(const G4ThreeVector& aValue);
|
||||
|
||||
G4double GetLocalTime() const;
|
||||
void SetLocalTime(const G4double aValue);
|
||||
void AddLocalTime(const G4double aValue);
|
||||
// Time since the track is created.
|
||||
|
||||
G4double GetGlobalTime() const;
|
||||
void SetGlobalTime(const G4double aValue);
|
||||
void AddGlobalTime(const G4double aValue);
|
||||
// Time since the event in which the track belongs is created.
|
||||
|
||||
G4double GetProperTime() const;
|
||||
void SetProperTime(const G4double aValue);
|
||||
void AddProperTime(const G4double aValue);
|
||||
// Proper time of the particle.
|
||||
|
||||
const G4ThreeVector& GetMomentumDirection() const;
|
||||
void SetMomentumDirection(const G4ThreeVector& aValue);
|
||||
void AddMomentumDirection(const G4ThreeVector& aValue);
|
||||
// Direction of momentum (should be an unit vector)
|
||||
|
||||
G4ThreeVector GetMomentum() const;
|
||||
// Total momentum of the track
|
||||
|
||||
|
||||
G4double GetTotalEnergy() const;
|
||||
// Total energy of the track
|
||||
|
||||
G4double GetKineticEnergy() const;
|
||||
void SetKineticEnergy(const G4double aValue);
|
||||
void AddKineticEnergy(const G4double aValue);
|
||||
// Kinetic Energy of the track
|
||||
|
||||
G4double GetVelocity() const;
|
||||
void SetVelocity(G4double v);
|
||||
//
|
||||
|
||||
G4double GetBeta() const;
|
||||
// Velocity of the track in unit of c(light velocity)
|
||||
|
||||
G4double GetGamma() const;
|
||||
// Gamma factor (1/sqrt[1-beta*beta]) of the track
|
||||
|
||||
G4VPhysicalVolume* GetPhysicalVolume() const;
|
||||
|
||||
const G4VTouchable* GetTouchable() const;
|
||||
const G4TouchableHandle& GetTouchableHandle() const;
|
||||
void SetTouchableHandle(const G4TouchableHandle& apValue);
|
||||
|
||||
G4Material* GetMaterial() const;
|
||||
void SetMaterial(G4Material*);
|
||||
|
||||
const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
|
||||
void SetMaterialCutsCouple(const G4MaterialCutsCouple*);
|
||||
|
||||
G4double GetSafety() const;
|
||||
void SetSafety(const G4double aValue);
|
||||
|
||||
const G4ThreeVector& GetPolarization() const;
|
||||
void SetPolarization(const G4ThreeVector& aValue);
|
||||
void AddPolarization(const G4ThreeVector& aValue);
|
||||
|
||||
G4StepStatus GetStepStatus() const;
|
||||
void SetStepStatus(const G4StepStatus aValue);
|
||||
|
||||
const G4VProcess* GetProcessDefinedStep() const;
|
||||
// If the pointer is 0, this means the Step is defined
|
||||
// by the user defined limit in the current volume.
|
||||
void SetProcessDefinedStep(G4VProcess* aValue);
|
||||
|
||||
|
||||
G4double GetMass() const;
|
||||
void SetMass(G4double value);
|
||||
|
||||
G4double GetCharge() const;
|
||||
void SetCharge(G4double value);
|
||||
|
||||
void SetWeight(G4double aValue);
|
||||
G4double GetWeight() const;
|
||||
|
||||
public:
|
||||
// copy constructor and assignment operaor as protected
|
||||
G4StepPoint(const G4StepPoint &right);
|
||||
G4StepPoint & operator=(const G4StepPoint &right);
|
||||
|
||||
|
||||
|
||||
//---------
|
||||
private:
|
||||
//---------
|
||||
|
||||
// Member data
|
||||
G4ThreeVector fPosition;
|
||||
G4double fGlobalTime;
|
||||
// Time since event is created
|
||||
G4double fLocalTime;
|
||||
// Time since track is created
|
||||
G4double fProperTime;
|
||||
// Time since track is created (in rest frame of particle)
|
||||
G4ThreeVector fMomentumDirection;
|
||||
G4double fKineticEnergy;
|
||||
G4double fVelocity;
|
||||
// Momentum,energy and velocity
|
||||
G4TouchableHandle fpTouchable;
|
||||
// Touchable Handle
|
||||
G4Material* fpMaterial;
|
||||
// Material of the volmue
|
||||
const G4MaterialCutsCouple* fpMaterialCutsCouple;
|
||||
// MaterialCutsCouple of the volmue
|
||||
G4double fSafety;
|
||||
G4ThreeVector fPolarization;
|
||||
G4StepStatus fStepStatus;
|
||||
// DoIt type which defined the current Step.
|
||||
G4VProcess* fpProcessDefinedStep;
|
||||
// Process which defined the current Step.
|
||||
G4double fMass;
|
||||
// Dynamical mass of the particle
|
||||
G4double fCharge;
|
||||
// Dynamical Charge of the particle
|
||||
G4double fWeight;
|
||||
// Track Weight
|
||||
};
|
||||
|
||||
#include "G4StepPoint.icc"
|
||||
#endif
|
||||
|
174
geant4/LEMuSR/G4Modified/track/include/G4StepPoint.icc
Normal file
174
geant4/LEMuSR/G4Modified/track/include/G4StepPoint.icc
Normal file
@ -0,0 +1,174 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4StepPoint.icc,v 1.8 2003/05/07 20:08:37 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01-ref-02 $
|
||||
//
|
||||
//
|
||||
inline const G4ThreeVector& G4StepPoint::GetPosition() const
|
||||
{ return fPosition; }
|
||||
inline void G4StepPoint::SetPosition(const G4ThreeVector& aValue)
|
||||
{ fPosition = aValue; }
|
||||
inline void G4StepPoint::AddPosition(const G4ThreeVector& aValue)
|
||||
{ fPosition += aValue; }
|
||||
// Position where the track locates
|
||||
|
||||
inline G4double G4StepPoint::GetLocalTime() const
|
||||
{ return fLocalTime; }
|
||||
inline void G4StepPoint::SetLocalTime(const G4double aValue)
|
||||
{ fLocalTime = aValue; }
|
||||
inline void G4StepPoint::AddLocalTime(const G4double aValue)
|
||||
{ fLocalTime += aValue; }
|
||||
// Time since the track is created.
|
||||
|
||||
inline G4double G4StepPoint::GetGlobalTime() const
|
||||
{ return fGlobalTime; }
|
||||
inline void G4StepPoint::SetGlobalTime(const G4double aValue)
|
||||
{ fGlobalTime = aValue; }
|
||||
inline void G4StepPoint::AddGlobalTime(const G4double aValue)
|
||||
{ fGlobalTime += aValue; }
|
||||
// Time since the event in which the track belongs is created.
|
||||
|
||||
inline G4double G4StepPoint::GetProperTime() const
|
||||
{ return fProperTime; }
|
||||
inline void G4StepPoint::SetProperTime(const G4double aValue)
|
||||
{ fProperTime = aValue; }
|
||||
inline void G4StepPoint::AddProperTime(const G4double aValue)
|
||||
{ fProperTime += aValue; }
|
||||
// Proper time of the particle.
|
||||
|
||||
inline const G4ThreeVector& G4StepPoint::GetMomentumDirection() const
|
||||
{ return fMomentumDirection; }
|
||||
inline void G4StepPoint::SetMomentumDirection(const G4ThreeVector& aValue)
|
||||
{ fMomentumDirection = aValue;
|
||||
}
|
||||
inline void G4StepPoint::AddMomentumDirection(const G4ThreeVector& aValue)
|
||||
{ fMomentumDirection += aValue;
|
||||
}
|
||||
// Direction of momentum (should be an unit vector)
|
||||
|
||||
inline G4ThreeVector G4StepPoint::GetMomentum() const
|
||||
{
|
||||
G4double tMomentum = sqrt(fKineticEnergy*fKineticEnergy +
|
||||
2*fKineticEnergy*fMass);
|
||||
return G4ThreeVector(fMomentumDirection.x()*tMomentum,
|
||||
fMomentumDirection.y()*tMomentum,
|
||||
fMomentumDirection.z()*tMomentum);
|
||||
}
|
||||
// Total momentum of the track
|
||||
|
||||
inline G4double G4StepPoint::GetTotalEnergy() const
|
||||
{
|
||||
return fKineticEnergy + fMass;
|
||||
}
|
||||
// Total energy of the track
|
||||
|
||||
inline G4double G4StepPoint::GetKineticEnergy() const
|
||||
{ return fKineticEnergy; }
|
||||
inline void G4StepPoint::SetKineticEnergy(const G4double aValue)
|
||||
{ fKineticEnergy = aValue; }
|
||||
inline void G4StepPoint::AddKineticEnergy(const G4double aValue)
|
||||
{ fKineticEnergy += aValue; }
|
||||
// Kinetic Energy of the track
|
||||
|
||||
inline G4double G4StepPoint::GetVelocity() const
|
||||
{
|
||||
return fVelocity;
|
||||
}
|
||||
inline void G4StepPoint::SetVelocity(G4double v)
|
||||
{
|
||||
fVelocity = v;
|
||||
}
|
||||
|
||||
|
||||
inline G4double G4StepPoint::GetBeta() const
|
||||
{
|
||||
return fVelocity/c_light;
|
||||
}
|
||||
|
||||
// Velocity of the track in unit of c(light velocity)
|
||||
|
||||
inline G4double G4StepPoint::GetGamma() const
|
||||
{ return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; }
|
||||
// Gamma factor (1/sqrt[1-beta*beta]) of the track
|
||||
|
||||
inline G4VPhysicalVolume* G4StepPoint::GetPhysicalVolume() const
|
||||
{ return fpTouchable->GetVolume(); }
|
||||
|
||||
inline const G4VTouchable* G4StepPoint::GetTouchable() const
|
||||
{ return fpTouchable(); }
|
||||
inline const G4TouchableHandle& G4StepPoint::GetTouchableHandle() const
|
||||
{ return fpTouchable; }
|
||||
inline void G4StepPoint::SetTouchableHandle(const G4TouchableHandle& apValue)
|
||||
{ fpTouchable = apValue; }
|
||||
|
||||
inline G4double G4StepPoint::GetSafety() const
|
||||
{ return fSafety; }
|
||||
inline void G4StepPoint::SetSafety(const G4double aValue)
|
||||
{ fSafety = aValue; }
|
||||
|
||||
inline const G4ThreeVector& G4StepPoint::GetPolarization() const
|
||||
{ return fPolarization; }
|
||||
inline void G4StepPoint::SetPolarization(const G4ThreeVector& aValue)
|
||||
{ fPolarization = aValue; }
|
||||
inline void G4StepPoint::AddPolarization(const G4ThreeVector& aValue)
|
||||
{ fPolarization += aValue; }
|
||||
|
||||
inline G4StepStatus G4StepPoint::GetStepStatus() const
|
||||
{ return fStepStatus; }
|
||||
inline void G4StepPoint::SetStepStatus(const G4StepStatus aValue)
|
||||
{ fStepStatus = aValue; }
|
||||
|
||||
inline const G4VProcess* G4StepPoint::GetProcessDefinedStep() const
|
||||
{ return fpProcessDefinedStep; }
|
||||
// If the pointer is 0, this means the Step is defined
|
||||
// by the user defined limit in the current volume.
|
||||
inline void G4StepPoint::SetProcessDefinedStep(G4VProcess* aValue)
|
||||
{ fpProcessDefinedStep = aValue; }
|
||||
|
||||
inline G4double G4StepPoint::GetMass() const
|
||||
{ return fMass; }
|
||||
inline void G4StepPoint::SetMass(G4double value)
|
||||
{ fMass = value; }
|
||||
|
||||
inline G4double G4StepPoint::GetCharge() const
|
||||
{ return fCharge; }
|
||||
inline void G4StepPoint::SetCharge(G4double value)
|
||||
{ fCharge = value; }
|
||||
|
||||
inline G4Material* G4StepPoint::GetMaterial() const
|
||||
{ return fpMaterial; }
|
||||
inline void G4StepPoint::SetMaterial(G4Material* material)
|
||||
{fpMaterial = material; }
|
||||
|
||||
inline
|
||||
const G4MaterialCutsCouple* G4StepPoint::GetMaterialCutsCouple() const
|
||||
{ return fpMaterialCutsCouple; }
|
||||
inline
|
||||
void G4StepPoint::SetMaterialCutsCouple(const G4MaterialCutsCouple* materialCutsCouple)
|
||||
{fpMaterialCutsCouple = materialCutsCouple; }
|
||||
|
||||
inline void G4StepPoint::SetWeight(G4double aValue)
|
||||
{ fWeight = aValue; }
|
||||
inline G4double G4StepPoint::GetWeight() const
|
||||
{ return fWeight; }
|
70
geant4/LEMuSR/G4Modified/track/include/G4StepStatus.hh
Normal file
70
geant4/LEMuSR/G4Modified/track/include/G4StepStatus.hh
Normal file
@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4StepStatus.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00-ref-03 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4StepStatus.hh
|
||||
//
|
||||
// Class Description:
|
||||
// This is an enumerator to define possible sources which
|
||||
// can define the Step length.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4StepStatus_h
|
||||
#define G4StepStatus_h 1
|
||||
|
||||
//////////////////
|
||||
enum G4StepStatus
|
||||
//////////////////
|
||||
{
|
||||
fWorldBoundary,
|
||||
// Step reached the world boundary
|
||||
fGeomBoundary,
|
||||
// Step defined by a geometry boundary
|
||||
fAtRestDoItProc,
|
||||
// Step defined by a PreStepDoItVector
|
||||
fAlongStepDoItProc,
|
||||
// Step defined by a AlongStepDoItVector
|
||||
fPostStepDoItProc,
|
||||
// Step defined by a PostStepDoItVector
|
||||
fUserDefinedLimit,
|
||||
// Step defined by the user Step limit in the logical volume
|
||||
fExclusivelyForcedProc,
|
||||
// Step defined by an exclusively forced PostStepDoIt process
|
||||
fUndefined
|
||||
// Step not defined yet
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
58
geant4/LEMuSR/G4Modified/track/include/G4SteppingControl.hh
Normal file
58
geant4/LEMuSR/G4Modified/track/include/G4SteppingControl.hh
Normal file
@ -0,0 +1,58 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4SteppingControl.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00-ref-03 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4SteppingControl
|
||||
//
|
||||
// Class Description:
|
||||
// This enumaration specifies possible conditions to control
|
||||
// the stepping manager behavier.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4SteppingControl_h
|
||||
#define G4SteppingControl_h 1
|
||||
|
||||
/////////////////////
|
||||
enum G4SteppingControl
|
||||
/////////////////////
|
||||
{
|
||||
NormalCondition,
|
||||
AvoidHitInvocation,
|
||||
// Hit will NOT be called
|
||||
Debug
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
294
geant4/LEMuSR/G4Modified/track/include/G4Track.hh
Normal file
294
geant4/LEMuSR/G4Modified/track/include/G4Track.hh
Normal file
@ -0,0 +1,294 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Track.hh,v 1.16 2002/12/16 11:59:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00-ref-03 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4Track.hh
|
||||
//
|
||||
// Class Description:
|
||||
// This class represents the partilce under tracking.
|
||||
// It includes information related to tracking for examples:
|
||||
// 1) current position/time of the particle,
|
||||
// 2) static particle information,
|
||||
// 3) the pointer to the physical volume where currently
|
||||
// the particle exists
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
// Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek
|
||||
// Add MaterialCutCouple 08 Oct. 2002 H.Kurashige
|
||||
|
||||
#ifndef G4Track_h
|
||||
#define G4Track_h 1
|
||||
|
||||
#include "globals.hh" // Include from 'global'
|
||||
#include "G4ThreeVector.hh" // Include from 'geometry'
|
||||
#include "G4LogicalVolume.hh" // Include from 'geometry'
|
||||
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
|
||||
#include "G4Allocator.hh" // Include from 'particle+matter'
|
||||
#include "G4DynamicParticle.hh" // Include from 'particle+matter'
|
||||
#include "G4TrackStatus.hh" // Include from 'tracking'
|
||||
#include "G4TouchableHandle.hh" // Include from 'geometry'
|
||||
#include "G4VUserTrackInformation.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
|
||||
class G4Step; // Forward declaration
|
||||
class G4MaterialCutsCouple;
|
||||
|
||||
//////////////
|
||||
class G4Track
|
||||
//////////////
|
||||
{
|
||||
|
||||
//--------
|
||||
public: // With description
|
||||
|
||||
// Constructor
|
||||
G4Track();
|
||||
G4Track(G4DynamicParticle* apValueDynamicParticle,
|
||||
G4double aValueTime,
|
||||
const G4ThreeVector& aValuePosition);
|
||||
// aValueTime is a global time
|
||||
G4Track(const G4Track&);
|
||||
// Copy Constructor copys members other than tracking information
|
||||
|
||||
private:
|
||||
// Hide assignment operator as private
|
||||
G4Track& operator=(const G4Track&);
|
||||
|
||||
//--------
|
||||
public: // With description
|
||||
|
||||
// Destrcutor
|
||||
~G4Track();
|
||||
|
||||
// Operators
|
||||
inline void *operator new(size_t);
|
||||
// Override "new" for "G4Allocator".
|
||||
inline void operator delete(void *aTrack);
|
||||
// Override "delete" for "G4Allocator".
|
||||
|
||||
G4bool operator==( const G4Track& );
|
||||
|
||||
//--------
|
||||
public: // With description
|
||||
// Copy information of the track (w/o tracking information)
|
||||
void CopyTrackInfo(const G4Track&);
|
||||
|
||||
// Get/Set functions
|
||||
// track ID
|
||||
G4int GetTrackID() const;
|
||||
void SetTrackID(const G4int aValue);
|
||||
|
||||
G4int GetParentID() const;
|
||||
void SetParentID(const G4int aValue);
|
||||
|
||||
// dynamic particle
|
||||
const G4DynamicParticle* GetDynamicParticle() const;
|
||||
|
||||
// particle definition
|
||||
G4ParticleDefinition* GetDefinition() const;
|
||||
|
||||
// position, time
|
||||
const G4ThreeVector& GetPosition() const;
|
||||
void SetPosition(const G4ThreeVector& aValue);
|
||||
|
||||
G4double GetGlobalTime() const;
|
||||
void SetGlobalTime(const G4double aValue);
|
||||
// Time since the event in which the track belongs is created.
|
||||
|
||||
G4double GetLocalTime() const;
|
||||
void SetLocalTime(const G4double aValue);
|
||||
// Time since the current track is created.
|
||||
|
||||
G4double GetProperTime() const;
|
||||
void SetProperTime(const G4double aValue);
|
||||
// Proper time of the current track
|
||||
|
||||
// volume, material, touchable
|
||||
G4VPhysicalVolume* GetVolume() const;
|
||||
G4VPhysicalVolume* GetNextVolume() const;
|
||||
|
||||
G4Material* GetMaterial() const;
|
||||
G4Material* GetNextMaterial() const;
|
||||
|
||||
const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
|
||||
const G4MaterialCutsCouple* GetNextMaterialCutsCouple() const;
|
||||
|
||||
const G4VTouchable* GetTouchable() const;
|
||||
const G4TouchableHandle& GetTouchableHandle() const;
|
||||
void SetTouchableHandle( const G4TouchableHandle& apValue);
|
||||
|
||||
const G4VTouchable* GetNextTouchable() const;
|
||||
const G4TouchableHandle& GetNextTouchableHandle() const;
|
||||
void SetNextTouchableHandle( const G4TouchableHandle& apValue);
|
||||
|
||||
// energy
|
||||
G4double GetKineticEnergy() const;
|
||||
void SetKineticEnergy(const G4double aValue);
|
||||
|
||||
G4double GetTotalEnergy() const;
|
||||
|
||||
|
||||
// moemtnum
|
||||
const G4ThreeVector& GetMomentumDirection() const;
|
||||
void SetMomentumDirection(const G4ThreeVector& aValue);
|
||||
|
||||
G4ThreeVector GetMomentum() const;
|
||||
|
||||
G4double GetVelocity() const;
|
||||
|
||||
|
||||
// polarization
|
||||
const G4ThreeVector& GetPolarization() const;
|
||||
void SetPolarization(const G4ThreeVector& aValue);
|
||||
|
||||
// track status, flags for tracking
|
||||
G4TrackStatus GetTrackStatus() const;
|
||||
void SetTrackStatus(const G4TrackStatus aTrackStatus);
|
||||
|
||||
G4bool IsBelowThreshold() const;
|
||||
void SetBelowThresholdFlag(G4bool value = true);
|
||||
// The flag of "BelowThreshold" is set to true
|
||||
// if this track energy is below threshold energy
|
||||
// in this material determined by the range cut value
|
||||
|
||||
G4bool IsGoodForTracking() const;
|
||||
void SetGoodForTrackingFlag(G4bool value = true);
|
||||
// The flag of "GoodForTracking" is set by processes
|
||||
// if this track should be tracked
|
||||
// even if the energy is below threshold
|
||||
|
||||
// track length
|
||||
G4double GetTrackLength() const;
|
||||
void AddTrackLength(const G4double aValue);
|
||||
// Accumulated the track length
|
||||
|
||||
// step information
|
||||
const G4Step* GetStep() const;
|
||||
void SetStep(const G4Step* aValue);
|
||||
|
||||
G4int GetCurrentStepNumber() const;
|
||||
void IncrementCurrentStepNumber();
|
||||
|
||||
G4double GetStepLength() const;
|
||||
void SetStepLength(G4double value);
|
||||
// Before the end of the AlongStepDoIt loop,StepLength keeps
|
||||
// the initial value which is determined by the shortest geometrical Step
|
||||
// proposed by a physics process. After finishing the AlongStepDoIt,
|
||||
// it will be set equal to 'StepLength' in G4Step.
|
||||
|
||||
// vertex (,where this track was created) information
|
||||
const G4ThreeVector& GetVertexPosition() const;
|
||||
void SetVertexPosition(const G4ThreeVector& aValue);
|
||||
|
||||
const G4ThreeVector& GetVertexMomentumDirection() const;
|
||||
void SetVertexMomentumDirection(const G4ThreeVector& aValue);
|
||||
|
||||
G4double GetVertexKineticEnergy() const;
|
||||
void SetVertexKineticEnergy(const G4double aValue);
|
||||
|
||||
G4LogicalVolume* GetLogicalVolumeAtVertex() const;
|
||||
void SetLogicalVolumeAtVertex(G4LogicalVolume* );
|
||||
|
||||
const G4VProcess* GetCreatorProcess() const;
|
||||
void SetCreatorProcess(G4VProcess* aValue);
|
||||
|
||||
// track weight
|
||||
// These are methods for manipulating a weight for this track.
|
||||
G4double GetWeight() const;
|
||||
void SetWeight(G4double aValue);
|
||||
|
||||
// User information
|
||||
G4VUserTrackInformation* GetUserInformation() const;
|
||||
void SetUserInformation(G4VUserTrackInformation* aValue);
|
||||
|
||||
//---------
|
||||
private:
|
||||
//---------
|
||||
|
||||
// Member data
|
||||
G4int fCurrentStepNumber; // Total steps number up to now
|
||||
G4ThreeVector fPosition; // Current positon
|
||||
G4double fGlobalTime; // Time since the event is created
|
||||
G4double fLocalTime; // Time since the track is created
|
||||
G4double fTrackLength; // Accumulated track length
|
||||
G4int fParentID;
|
||||
G4int fTrackID;
|
||||
|
||||
G4TouchableHandle fpTouchable;
|
||||
G4TouchableHandle fpNextTouchable;
|
||||
// Touchable Handle
|
||||
|
||||
G4DynamicParticle* fpDynamicParticle;
|
||||
G4TrackStatus fTrackStatus;
|
||||
|
||||
G4bool fBelowThreshold;
|
||||
// This flag is set to true if this track energy is below
|
||||
// threshold energy in this material determined by the range cut value
|
||||
G4bool fGoodForTracking;
|
||||
// This flag is set by processes if this track should be tracked
|
||||
// even if the energy is below threshold
|
||||
|
||||
G4double fStepLength;
|
||||
// Before the end of the AlongStepDoIt loop, this keeps the initial
|
||||
// Step length which is determined by the shortest geometrical Step
|
||||
// proposed by a physics process. After finishing the AlongStepDoIt,
|
||||
// this will be set equal to 'StepLength' in G4Step.
|
||||
|
||||
G4double fWeight;
|
||||
// This is a weight for this track
|
||||
|
||||
const G4Step* fpStep;
|
||||
|
||||
G4ThreeVector fVtxPosition; // (x,y,z) of the vertex
|
||||
G4ThreeVector fVtxMomentumDirection; // Momentum direction at the vertex
|
||||
G4double fVtxKineticEnergy; // Kinetic energy at the vertex
|
||||
G4LogicalVolume* fpLVAtVertex; //Logical Volume at the vertex
|
||||
G4VProcess* fpCreatorProcess; // Process which created the track
|
||||
|
||||
G4VUserTrackInformation* fpUserInformation;
|
||||
};
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
298
geant4/LEMuSR/G4Modified/track/include/G4Track.icc
Normal file
298
geant4/LEMuSR/G4Modified/track/include/G4Track.icc
Normal file
@ -0,0 +1,298 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Track.icc,v 1.10 2002/12/16 11:59:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
//
|
||||
//-----------------------------------------------------------------
|
||||
// Definitions of inline functions
|
||||
//-----------------------------------------------------------------
|
||||
// change GetMaterial 16 Feb. 2000 H.Kurashige
|
||||
|
||||
// Operators
|
||||
extern G4Allocator<G4Track> aTrackAllocator;
|
||||
inline void* G4Track::operator new(size_t)
|
||||
{ void *aTrack;
|
||||
aTrack = (void *) aTrackAllocator.MallocSingle();
|
||||
return aTrack;
|
||||
}
|
||||
// Override "new" for "G4Allocator".
|
||||
|
||||
inline void G4Track::operator delete(void *aTrack)
|
||||
{ aTrackAllocator.FreeSingle((G4Track *) aTrack);}
|
||||
// Override "delete" for "G4Allocator".
|
||||
|
||||
inline G4bool G4Track::operator==( const G4Track& s)
|
||||
{ return (this==&s); }
|
||||
// Define "==" operator because "G4TrackVector" uses
|
||||
// "RWPtrOrderdVector" which requires this.
|
||||
|
||||
// Get/Set functions
|
||||
// dynamic particle
|
||||
inline const G4DynamicParticle* G4Track::GetDynamicParticle() const
|
||||
{ return fpDynamicParticle; }
|
||||
|
||||
// particle definition
|
||||
inline G4ParticleDefinition* G4Track::GetDefinition() const
|
||||
{ return fpDynamicParticle->GetDefinition(); }
|
||||
|
||||
// parent track ID
|
||||
inline G4int G4Track::GetParentID() const
|
||||
{ return fParentID; }
|
||||
|
||||
inline void G4Track::SetParentID(const G4int aValue)
|
||||
{ fParentID = aValue; }
|
||||
|
||||
// current track ID
|
||||
inline G4int G4Track::GetTrackID() const
|
||||
{ return fTrackID; }
|
||||
|
||||
inline void G4Track::SetTrackID(const G4int aValue)
|
||||
{ fTrackID = aValue; }
|
||||
|
||||
// position
|
||||
inline const G4ThreeVector& G4Track::GetPosition() const
|
||||
{ return fPosition; }
|
||||
|
||||
inline void G4Track::SetPosition(const G4ThreeVector& aValue)
|
||||
{ fPosition = aValue; }
|
||||
|
||||
// global time
|
||||
inline G4double G4Track::GetGlobalTime() const
|
||||
{ return fGlobalTime; }
|
||||
|
||||
inline void G4Track::SetGlobalTime(const G4double aValue)
|
||||
{ fGlobalTime = aValue; }
|
||||
// Time since the event in which the track belongs is created.
|
||||
|
||||
// local time
|
||||
inline G4double G4Track::GetLocalTime() const
|
||||
{ return fLocalTime; }
|
||||
|
||||
inline void G4Track::SetLocalTime(const G4double aValue)
|
||||
{ fLocalTime = aValue; }
|
||||
// Time since the current track is created.
|
||||
|
||||
// proper time
|
||||
inline G4double G4Track::GetProperTime() const
|
||||
{ return fpDynamicParticle->GetProperTime(); }
|
||||
|
||||
inline void G4Track::SetProperTime(const G4double aValue)
|
||||
{ fpDynamicParticle->SetProperTime(aValue); }
|
||||
// Proper time of the current track
|
||||
|
||||
// volume
|
||||
inline G4VPhysicalVolume* G4Track::GetVolume() const
|
||||
{ return fpTouchable->GetVolume(); }
|
||||
|
||||
inline G4VPhysicalVolume* G4Track::GetNextVolume() const
|
||||
{ return fpNextTouchable->GetVolume(); }
|
||||
|
||||
// material
|
||||
inline
|
||||
const G4MaterialCutsCouple* G4Track::GetMaterialCutsCouple() const
|
||||
{ return fpStep->GetPreStepPoint()->GetMaterialCutsCouple(); }
|
||||
|
||||
inline
|
||||
const G4MaterialCutsCouple* G4Track::GetNextMaterialCutsCouple() const
|
||||
{ return fpStep->GetPostStepPoint()->GetMaterialCutsCouple(); }
|
||||
|
||||
// material
|
||||
inline G4Material* G4Track::GetMaterial() const
|
||||
{ return fpStep->GetPreStepPoint()->GetMaterial(); }
|
||||
|
||||
inline G4Material* G4Track::GetNextMaterial() const
|
||||
{ return fpStep->GetPostStepPoint()->GetMaterial(); }
|
||||
|
||||
|
||||
// touchable
|
||||
inline const G4VTouchable* G4Track::GetTouchable() const
|
||||
{
|
||||
return fpTouchable();
|
||||
}
|
||||
|
||||
inline const G4TouchableHandle& G4Track::GetTouchableHandle() const
|
||||
{
|
||||
return fpTouchable;
|
||||
}
|
||||
|
||||
inline void G4Track::SetTouchableHandle( const G4TouchableHandle& apValue)
|
||||
{
|
||||
fpTouchable = apValue;
|
||||
}
|
||||
|
||||
inline const G4VTouchable* G4Track::GetNextTouchable() const
|
||||
{
|
||||
return fpNextTouchable();
|
||||
}
|
||||
|
||||
inline const G4TouchableHandle& G4Track::GetNextTouchableHandle() const
|
||||
{
|
||||
return fpNextTouchable;
|
||||
}
|
||||
|
||||
inline void G4Track::SetNextTouchableHandle( const G4TouchableHandle& apValue)
|
||||
{
|
||||
fpNextTouchable = apValue;
|
||||
}
|
||||
|
||||
|
||||
// kinetic energy
|
||||
inline G4double G4Track::GetKineticEnergy() const
|
||||
{ return fpDynamicParticle->GetKineticEnergy(); }
|
||||
|
||||
inline void G4Track::SetKineticEnergy(const G4double aValue)
|
||||
{ fpDynamicParticle->SetKineticEnergy(aValue); }
|
||||
|
||||
// total energy
|
||||
inline G4double G4Track::GetTotalEnergy() const
|
||||
{ return fpDynamicParticle->GetTotalEnergy(); }
|
||||
|
||||
// momentum
|
||||
inline G4ThreeVector G4Track::GetMomentum() const
|
||||
{ return fpDynamicParticle->GetMomentum(); }
|
||||
|
||||
// momentum (direction)
|
||||
inline const G4ThreeVector& G4Track::GetMomentumDirection() const
|
||||
{ return fpDynamicParticle->GetMomentumDirection(); }
|
||||
|
||||
inline void G4Track::SetMomentumDirection(const G4ThreeVector& aValue)
|
||||
{ fpDynamicParticle->SetMomentumDirection(aValue) ;}
|
||||
|
||||
// polarization
|
||||
inline const G4ThreeVector& G4Track::GetPolarization() const
|
||||
{ return fpDynamicParticle->GetPolarization(); }
|
||||
|
||||
inline void G4Track::SetPolarization(const G4ThreeVector& aValue)
|
||||
{ fpDynamicParticle->SetPolarization(aValue.x(),
|
||||
aValue.y(),
|
||||
aValue.z()); }
|
||||
|
||||
// track status
|
||||
inline G4TrackStatus G4Track::GetTrackStatus() const
|
||||
{ return fTrackStatus; }
|
||||
|
||||
inline void G4Track::SetTrackStatus(const G4TrackStatus aTrackStatus)
|
||||
{ fTrackStatus = aTrackStatus; }
|
||||
|
||||
// track length
|
||||
inline G4double G4Track::GetTrackLength() const
|
||||
{ return fTrackLength; }
|
||||
|
||||
inline void G4Track::AddTrackLength(const G4double aValue)
|
||||
{ fTrackLength += aValue; }
|
||||
// Accumulated track length
|
||||
|
||||
// step number
|
||||
inline G4int G4Track::GetCurrentStepNumber() const
|
||||
{ return fCurrentStepNumber; }
|
||||
|
||||
inline void G4Track::IncrementCurrentStepNumber()
|
||||
{ fCurrentStepNumber++; }
|
||||
|
||||
// step length
|
||||
inline G4double G4Track::GetStepLength() const
|
||||
{ return fStepLength; }
|
||||
|
||||
inline void G4Track::SetStepLength(G4double value)
|
||||
{ fStepLength = value; }
|
||||
|
||||
// vertex (where this track was created) information
|
||||
inline const G4ThreeVector& G4Track::GetVertexPosition() const
|
||||
{ return fVtxPosition; }
|
||||
|
||||
inline void G4Track::SetVertexPosition(const G4ThreeVector& aValue)
|
||||
{ fVtxPosition = aValue; }
|
||||
|
||||
inline const G4ThreeVector& G4Track::GetVertexMomentumDirection() const
|
||||
{ return fVtxMomentumDirection; }
|
||||
inline void G4Track::SetVertexMomentumDirection(const G4ThreeVector& aValue)
|
||||
{ fVtxMomentumDirection = aValue ;}
|
||||
|
||||
inline G4double G4Track::GetVertexKineticEnergy() const
|
||||
{ return fVtxKineticEnergy; }
|
||||
|
||||
inline void G4Track::SetVertexKineticEnergy(const G4double aValue)
|
||||
{ fVtxKineticEnergy = aValue; }
|
||||
|
||||
inline G4LogicalVolume* G4Track::GetLogicalVolumeAtVertex() const
|
||||
{ return fpLVAtVertex; }
|
||||
|
||||
inline void G4Track::SetLogicalVolumeAtVertex(G4LogicalVolume* aValue)
|
||||
{ fpLVAtVertex = aValue; }
|
||||
|
||||
inline const G4VProcess* G4Track::GetCreatorProcess() const
|
||||
{ return fpCreatorProcess; }
|
||||
// If the pointer is 0, this means the track is created
|
||||
// by the event generator, i.e. the primary track.If it is not
|
||||
// 0, it points to the process which created this track.
|
||||
|
||||
inline void G4Track::SetCreatorProcess(G4VProcess* aValue)
|
||||
{ fpCreatorProcess = aValue; }
|
||||
|
||||
// flag for "Below Threshold"
|
||||
inline G4bool G4Track::IsBelowThreshold() const
|
||||
{ return fBelowThreshold; }
|
||||
|
||||
inline void G4Track::SetBelowThresholdFlag(G4bool value)
|
||||
{ fBelowThreshold = value; }
|
||||
|
||||
// flag for " Good for Tracking"
|
||||
inline G4bool G4Track::IsGoodForTracking() const
|
||||
{ return fGoodForTracking; }
|
||||
|
||||
inline void G4Track::SetGoodForTrackingFlag(G4bool value)
|
||||
{ fGoodForTracking = value; }
|
||||
|
||||
// track weight
|
||||
inline void G4Track::SetWeight(G4double aValue)
|
||||
{ fWeight = aValue; }
|
||||
|
||||
inline G4double G4Track::GetWeight() const
|
||||
{ return fWeight; }
|
||||
|
||||
// user information
|
||||
inline G4VUserTrackInformation* G4Track::GetUserInformation() const
|
||||
{ return fpUserInformation; }
|
||||
inline void G4Track::SetUserInformation(G4VUserTrackInformation* aValue)
|
||||
{ fpUserInformation = aValue; }
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// To implement bi-directional association between G4Step and
|
||||
// and G4Track, a combined usage of 'forward declaration' and
|
||||
// 'include' is necessary.
|
||||
//-------------------------------------------------------------
|
||||
#include "G4Step.hh"
|
||||
|
||||
inline const G4Step* G4Track::GetStep() const
|
||||
{ return fpStep; }
|
||||
|
||||
inline void G4Track::SetStep(const G4Step* aValue)
|
||||
{ fpStep = (aValue); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
47
geant4/LEMuSR/G4Modified/track/include/G4TrackFastVector.hh
Normal file
47
geant4/LEMuSR/G4Modified/track/include/G4TrackFastVector.hh
Normal file
@ -0,0 +1,47 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4TrackFastVector.hh,v 1.4 2001/07/11 10:08:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00-ref-03 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// History: first implementation, based on object model of
|
||||
// 8 Mar 1997, H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4TrackFastVector_h
|
||||
#define G4TrackFastVector_h 1
|
||||
|
||||
class G4Track;
|
||||
#include "G4FastVector.hh"
|
||||
|
||||
const G4int G4TrackFastVectorSize = 512;
|
||||
typedef G4FastVector<G4Track,G4TrackFastVectorSize> G4TrackFastVector;
|
||||
// Contains pointers to G4Track objects which are
|
||||
// generated by either primary or secondary interaction.
|
||||
|
||||
#endif
|
||||
|
68
geant4/LEMuSR/G4Modified/track/include/G4TrackStatus.hh
Normal file
68
geant4/LEMuSR/G4Modified/track/include/G4TrackStatus.hh
Normal file
@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4TrackStatus.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00-ref-03 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4TrackStatus.hh
|
||||
//
|
||||
// Class Description:
|
||||
// This is an enumerator to define the current status
|
||||
// of the track which is under the transportation.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4TrackStatus_h
|
||||
#define G4TrackStatus_h 1
|
||||
|
||||
//////////////////
|
||||
enum G4TrackStatus
|
||||
//////////////////
|
||||
{
|
||||
|
||||
fAlive, // Continue the tracking
|
||||
fStopButAlive, // Invoke active rest physics processes and
|
||||
// and kill the current track afterward
|
||||
fStopAndKill, // Kill the current track
|
||||
|
||||
fKillTrackAndSecondaries,
|
||||
// Kill the current track and also associated
|
||||
// secondaries.
|
||||
fSuspend, // Suspend the current track
|
||||
fPostponeToNextEvent
|
||||
// Postpones the tracking of thecurrent track
|
||||
// to the next event.
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
283
geant4/LEMuSR/G4Modified/track/include/G4VParticleChange.hh
Normal file
283
geant4/LEMuSR/G4Modified/track/include/G4VParticleChange.hh
Normal file
@ -0,0 +1,283 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VParticleChange.hh,v 1.11 2004/05/08 15:28:13 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
//
|
||||
// Class Description
|
||||
// This class is the abstract class for ParticleChange.
|
||||
//-
|
||||
// The ParticleChange class ontains the results after invocation
|
||||
// of a physics process. This includes final states of parent
|
||||
// particle (momentum, energy, etc) and secondary particles generated
|
||||
// by the interaction.
|
||||
// The tracking assumes that all the values of energy and
|
||||
// momentum are in global reference system, therefore all the
|
||||
// needed Lorentz transformations must have been already Done
|
||||
// when filling the data-members of this class.
|
||||
//-
|
||||
//-
|
||||
// This abstract class has following four virtual methods
|
||||
// virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
||||
// virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
// virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// virtual void Initialize(const G4Track&);
|
||||
// The UpdateStep methods return the pointer to the G4Step
|
||||
// after updating the given Step information by using final state
|
||||
// information of the track given by a physics process.
|
||||
// User must add methods to keep the final state information
|
||||
// in his derived class as well as implement UpdateStep methods
|
||||
// which he want to use.
|
||||
//-
|
||||
// The Initialize methods is provided to refresh the final
|
||||
// state information and should be called by each process
|
||||
// at the beginning of DoIt.
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implement Event Biasing Scheme 9 Nov.,98 H.Kurashige
|
||||
// add CheckIt 13 Apr.,99 H.Kurashige
|
||||
// add accuracy leveles 5 May, 99 H.Kurashige
|
||||
// add check secondaries 11 June, 03 H.Kurashige
|
||||
// add new methods of ProposeXXX 08 May, 04 H.Kurashige
|
||||
#ifndef G4VParticleChange_h
|
||||
#define G4VParticleChange_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
class G4Track;
|
||||
class G4Step;
|
||||
|
||||
#include "G4TrackFastVector.hh"
|
||||
#include "G4TrackStatus.hh"
|
||||
#include "G4SteppingControl.hh"
|
||||
|
||||
|
||||
class G4VParticleChange
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
G4VParticleChange();
|
||||
|
||||
// destructor
|
||||
virtual ~G4VParticleChange();
|
||||
|
||||
// equal/unequal operator
|
||||
G4bool operator==(const G4VParticleChange &right) const;
|
||||
G4bool operator!=(const G4VParticleChange &right) const;
|
||||
// "equal" means that teo objects have the same pointer.
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operaor as protected
|
||||
G4VParticleChange(const G4VParticleChange &right);
|
||||
G4VParticleChange & operator=(const G4VParticleChange &right);
|
||||
|
||||
public: // with description
|
||||
// --- the following methods are for updating G4Step -----
|
||||
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// Return the pointer to the G4Step after updating the Step information
|
||||
// by using final state information of the track given by a physics
|
||||
// process
|
||||
|
||||
protected: // with description
|
||||
G4Step* UpdateStepInfo(G4Step* Step);
|
||||
// Update the G4Step specific attributes
|
||||
// (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
|
||||
|
||||
|
||||
public: // with description
|
||||
virtual void Initialize(const G4Track&);
|
||||
// This methods will be called by each process at the beginning of DoIt
|
||||
// if necessary.
|
||||
|
||||
protected:
|
||||
void InitializeTrueStepLength(const G4Track&);
|
||||
void InitializeLocalEnergyDeposit(const G4Track&);
|
||||
void InitializeSteppingControl(const G4Track&);
|
||||
void InitializeParentWeight(const G4Track&);
|
||||
|
||||
void InitializeStatusChange(const G4Track&);
|
||||
void InitializeSecondaries(const G4Track&);
|
||||
// ------------------------------------------------------
|
||||
|
||||
public: // with description
|
||||
//---- the following methods are for TruePathLength ----
|
||||
G4double GetTrueStepLength() const;
|
||||
void ProposeTrueStepLength(G4double truePathLength);
|
||||
// Get/Propose theTrueStepLength
|
||||
|
||||
//---- the following methods are for LocalEnergyDeposit ----
|
||||
G4double GetLocalEnergyDeposit() const;
|
||||
void ProposeLocalEnergyDeposit(G4double anEnergyPart);
|
||||
// Get/Propose the locally deposited energy
|
||||
|
||||
//---- the following methods are for TrackStatus -----
|
||||
G4TrackStatus GetTrackStatus() const;
|
||||
void ProposeTrackStatus(G4TrackStatus status);
|
||||
// Get/Propose the final TrackStatus of the current particle.
|
||||
// ------------------------------------------------------
|
||||
|
||||
//---- the following methods are for managements of SteppingControl --
|
||||
G4SteppingControl GetSteppingControl() const;
|
||||
void ProposeSteppingControl(G4SteppingControl StepControlFlag);
|
||||
// Set/Propose a flag to control stepping manager behavier
|
||||
// ------------------------------------------------------
|
||||
|
||||
//---- the following methods are for managements of secondaries --
|
||||
void Clear();
|
||||
// Clear the contents of this objects
|
||||
// This method should be called after the Tracking(Stepping)
|
||||
// manager removes all secondaries in theListOfSecondaries
|
||||
|
||||
void SetNumberOfSecondaries(G4int totSecondaries);
|
||||
// SetNumberOfSecondaries must be called just before AddSecondary()
|
||||
// in order to secure memory space for theListOfSecondaries
|
||||
// This method resets theNumberOfSecondaries to 0
|
||||
// (that will be incremented at every AddSecondary() call).
|
||||
|
||||
G4int GetNumberOfSecondaries() const;
|
||||
// Returns the number of secondaries current stored in
|
||||
// G4TrackFastVector.
|
||||
|
||||
G4Track* GetSecondary(G4int anIndex) const;
|
||||
// Returns the pointer to the generated secondary particle
|
||||
// which is specified by an Index.
|
||||
|
||||
void AddSecondary(G4Track* aSecondary);
|
||||
// Add a secondary particle to theListOfSecondaries.
|
||||
// ------------------------------------------------------
|
||||
|
||||
G4double GetParentWeight() const ;
|
||||
// Get weight of the parent (i.e. current) track
|
||||
void ProposeParentWeight(G4double);
|
||||
// Propse new weight of the parent (i.e. current) track
|
||||
|
||||
void SetParentWeightByProcess(G4bool);
|
||||
G4bool IsParentWeightSetByProcess() const;
|
||||
// If fParentWeightByProcess flag is false (true in default),
|
||||
// G4VParticleChange can change the weight of the parent track,
|
||||
// in any DoIt by using SetParentWeight(G4double)
|
||||
|
||||
|
||||
void SetSecondaryWeightByProcess(G4bool);
|
||||
G4bool IsSecondaryWeightSetByProcess() const;
|
||||
// If fSecondaryWeightByProcess flag is false (false in default),
|
||||
// G4VParticleChange set the weight of the secondary tracks
|
||||
// equal to the parent weight when the secondary tracks are added.
|
||||
|
||||
virtual void DumpInfo() const;
|
||||
// Print out information
|
||||
|
||||
void SetVerboseLevel(G4int vLevel);
|
||||
G4int GetVerboseLevel() const;
|
||||
|
||||
public:
|
||||
// Following methods will be removed in release 7.0
|
||||
// Using ProposeXXXX methods is recommended to setting
|
||||
// properties in G4VParticleChange
|
||||
|
||||
void SetTrueStepLength(G4double truePathLength);
|
||||
void SetLocalEnergyDeposit(G4double anEnergyPart);
|
||||
G4TrackStatus GetStatusChange() const;
|
||||
void SetStatusChange(G4TrackStatus status);
|
||||
void SetSteppingControl(G4SteppingControl StepControlFlag);
|
||||
void SetParentWeight(G4double);
|
||||
|
||||
protected:
|
||||
|
||||
G4TrackFastVector* theListOfSecondaries;
|
||||
// The vector of secondaries.
|
||||
|
||||
G4int theNumberOfSecondaries;
|
||||
// The total number of secondaries produced by each process.
|
||||
|
||||
G4int theSizeOftheListOfSecondaries;
|
||||
// TheSizeOftheListOfSecondaries;
|
||||
|
||||
G4TrackStatus theStatusChange;
|
||||
// The changed (final) track status of a given particle.
|
||||
|
||||
G4SteppingControl theSteppingControlFlag;
|
||||
// a flag to control stepping manager behavior
|
||||
|
||||
G4double theLocalEnergyDeposit;
|
||||
// It represents the part of the energy lost for discrete
|
||||
// or semi-continuous processes which is due to secondaries
|
||||
// not generated because they would have been below their cut
|
||||
// threshold.
|
||||
// The sum of the locally deposited energy + the delta-energy
|
||||
// coming from the continuous processes gives the
|
||||
// total energy loss localized in the current Step.
|
||||
|
||||
G4double theTrueStepLength;
|
||||
// The value of "True" Step Length
|
||||
|
||||
G4int verboseLevel;
|
||||
// The Verbose level
|
||||
|
||||
public: // with description
|
||||
// CheckIt method is provided for debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
|
||||
// CheckIt method is activated
|
||||
// if debug flag is set and 'G4VERBOSE' is defined
|
||||
void ClearDebugFlag();
|
||||
void SetDebugFlag();
|
||||
G4bool GetDebugFlag() const;
|
||||
|
||||
protected:
|
||||
// CheckSecondary method is provided for debug
|
||||
G4bool CheckSecondary(G4Track&);
|
||||
|
||||
G4double GetAccuracyForWarning() const;
|
||||
G4double GetAccuracyForException() const;
|
||||
|
||||
protected:
|
||||
G4bool debugFlag;
|
||||
|
||||
// accuracy levels
|
||||
static const G4double accuracyForWarning;
|
||||
static const G4double accuracyForException;
|
||||
|
||||
|
||||
protected:
|
||||
G4double theParentWeight;
|
||||
G4bool fSetSecondaryWeightByProcess;
|
||||
G4bool fSetParentWeightByProcess;
|
||||
};
|
||||
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4VParticleChange.icc"
|
||||
|
||||
#endif
|
345
geant4/LEMuSR/G4Modified/track/include/G4VParticleChange.icc
Normal file
345
geant4/LEMuSR/G4Modified/track/include/G4VParticleChange.icc
Normal file
@ -0,0 +1,345 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VParticleChange.icc,v 1.11 2004/05/08 15:28:13 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//----------------------------------------------------------------
|
||||
// Virtual methods for updating G4Step
|
||||
//
|
||||
|
||||
inline G4Step* G4VParticleChange::UpdateStepInfo(G4Step* pStep)
|
||||
{
|
||||
// Update the G4Step specific attributes
|
||||
pStep->SetStepLength( theTrueStepLength );
|
||||
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
|
||||
pStep->SetControlFlag( theSteppingControlFlag );
|
||||
return pStep;
|
||||
}
|
||||
|
||||
inline
|
||||
G4Step* G4VParticleChange::UpdateStepForAtRest(G4Step* Step)
|
||||
{
|
||||
if (!fSetParentWeightByProcess){
|
||||
Step->GetPostStepPoint()->SetWeight( theParentWeight );
|
||||
}
|
||||
return UpdateStepInfo(Step);
|
||||
}
|
||||
|
||||
inline
|
||||
G4Step* G4VParticleChange::UpdateStepForAlongStep(G4Step* Step)
|
||||
{
|
||||
if (!fSetParentWeightByProcess){
|
||||
G4double newWeight= theParentWeight/(Step->GetPreStepPoint()->GetWeight())*(Step->GetPostStepPoint()->GetWeight());
|
||||
Step->GetPostStepPoint()->SetWeight( newWeight );
|
||||
}
|
||||
return UpdateStepInfo(Step);
|
||||
}
|
||||
|
||||
inline
|
||||
G4Step* G4VParticleChange::UpdateStepForPostStep(G4Step* Step)
|
||||
{
|
||||
if (!fSetParentWeightByProcess){
|
||||
Step->GetPostStepPoint()->SetWeight( theParentWeight );
|
||||
}
|
||||
return UpdateStepInfo(Step);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Set/Get inline functions
|
||||
//
|
||||
inline
|
||||
G4Track* G4VParticleChange::GetSecondary(G4int anIndex) const
|
||||
{
|
||||
return (*theListOfSecondaries)[anIndex];
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4VParticleChange::GetNumberOfSecondaries() const
|
||||
{
|
||||
return theNumberOfSecondaries;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::ProposeTrackStatus(G4TrackStatus aStatus)
|
||||
{
|
||||
theStatusChange = aStatus;
|
||||
}
|
||||
|
||||
inline
|
||||
G4TrackStatus G4VParticleChange::GetTrackStatus() const
|
||||
{
|
||||
return theStatusChange;
|
||||
}
|
||||
|
||||
inline
|
||||
G4SteppingControl G4VParticleChange::GetSteppingControl() const
|
||||
{
|
||||
return theSteppingControlFlag;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::ProposeSteppingControl(G4SteppingControl StepControlFlag)
|
||||
{
|
||||
theSteppingControlFlag = StepControlFlag;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Set/Get inline functions
|
||||
//
|
||||
|
||||
inline
|
||||
G4double G4VParticleChange::GetLocalEnergyDeposit() const
|
||||
{
|
||||
return theLocalEnergyDeposit;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::ProposeLocalEnergyDeposit(G4double anEnergyPart)
|
||||
{
|
||||
theLocalEnergyDeposit = anEnergyPart;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4VParticleChange::GetTrueStepLength() const
|
||||
{
|
||||
return theTrueStepLength;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::ProposeTrueStepLength(G4double aLength)
|
||||
{
|
||||
theTrueStepLength = aLength;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void G4VParticleChange::SetVerboseLevel(G4int vLevel)
|
||||
{
|
||||
verboseLevel = vLevel;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4VParticleChange::GetVerboseLevel() const
|
||||
{
|
||||
return verboseLevel;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4VParticleChange::GetParentWeight() const
|
||||
{
|
||||
return theParentWeight;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// inline functions for Initialization
|
||||
//
|
||||
|
||||
inline
|
||||
void G4VParticleChange::InitializeLocalEnergyDeposit(const G4Track&)
|
||||
{
|
||||
// clear theLocalEnergyDeposited
|
||||
theLocalEnergyDeposit = 0.0;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::InitializeSteppingControl(const G4Track& )
|
||||
{
|
||||
// SteppingControlFlag
|
||||
theSteppingControlFlag = NormalCondition;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::Clear()
|
||||
{
|
||||
theNumberOfSecondaries = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// functions for Initialization
|
||||
//
|
||||
|
||||
inline void G4VParticleChange::InitializeStatusChange(const G4Track& track)
|
||||
{
|
||||
// set TrackStatus equal to the parent track's one
|
||||
theStatusChange = track.GetTrackStatus();
|
||||
}
|
||||
|
||||
inline void G4VParticleChange::InitializeParentWeight(const G4Track& track)
|
||||
{
|
||||
// set the parent track's weight
|
||||
theParentWeight = track.GetWeight();
|
||||
}
|
||||
|
||||
inline void G4VParticleChange::InitializeTrueStepLength(const G4Track& track)
|
||||
{
|
||||
// Reset theTrueStepLength
|
||||
// !! Caution !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
theTrueStepLength = track.GetStep()->GetStepLength();
|
||||
// !! TrueStepLength should be copied from G4Step not G4Track
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
}
|
||||
|
||||
inline void G4VParticleChange::InitializeSecondaries(const G4Track&)
|
||||
{
|
||||
// clear secondaries
|
||||
if (theNumberOfSecondaries>0) {
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>0) {
|
||||
G4cerr << "G4VParticleChange::Initialize() Warning ";
|
||||
G4cerr << "theListOfSecondaries is not empty " << G4endl;
|
||||
G4cerr << "All objects in theListOfSecondaries are destroyed!" << G4endl;
|
||||
}
|
||||
#endif
|
||||
for (G4int index= 0; index<theNumberOfSecondaries; index++){
|
||||
if ( (*theListOfSecondaries)[index] ){
|
||||
delete (*theListOfSecondaries)[index] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
theNumberOfSecondaries = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for handling secondaries
|
||||
//
|
||||
|
||||
inline void G4VParticleChange::SetNumberOfSecondaries(G4int totSecondaries)
|
||||
{
|
||||
// check if tracks still exist in theListOfSecondaries
|
||||
if (theNumberOfSecondaries>0) {
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>0) {
|
||||
G4cerr << "G4VParticleChange::SetNumberOfSecondaries() Warning ";
|
||||
G4cerr << "theListOfSecondaries is not empty ";
|
||||
}
|
||||
#endif
|
||||
for (G4int index= 0; index<theNumberOfSecondaries; index++){
|
||||
if ( (*theListOfSecondaries)[index] ){
|
||||
delete (*theListOfSecondaries)[index] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
theNumberOfSecondaries = 0;
|
||||
theSizeOftheListOfSecondaries = totSecondaries;
|
||||
|
||||
// Initialize ListOfSecondaries
|
||||
theListOfSecondaries->Initialize(totSecondaries);
|
||||
}
|
||||
|
||||
inline void G4VParticleChange::Initialize(const G4Track& track)
|
||||
{
|
||||
InitializeStatusChange(track);
|
||||
InitializeLocalEnergyDeposit(track);
|
||||
InitializeSteppingControl(track);
|
||||
InitializeTrueStepLength(track);
|
||||
InitializeSecondaries(track);
|
||||
InitializeParentWeight(track);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::ClearDebugFlag()
|
||||
{
|
||||
debugFlag = false;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::SetDebugFlag()
|
||||
{
|
||||
debugFlag = true;
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4VParticleChange::GetDebugFlag() const
|
||||
{
|
||||
return debugFlag;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::SetSecondaryWeightByProcess(G4bool flag)
|
||||
{
|
||||
fSetSecondaryWeightByProcess = flag;
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4VParticleChange::IsSecondaryWeightSetByProcess() const
|
||||
{
|
||||
return fSetSecondaryWeightByProcess;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::ProposeParentWeight(G4double w)
|
||||
{
|
||||
theParentWeight = w;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::SetParentWeightByProcess(G4bool flag)
|
||||
{
|
||||
fSetParentWeightByProcess = flag;
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4VParticleChange::IsParentWeightSetByProcess() const
|
||||
{
|
||||
return fSetParentWeightByProcess;
|
||||
}
|
||||
|
||||
// Following methods will be removed in release 7.0
|
||||
inline
|
||||
void G4VParticleChange::SetStatusChange(G4TrackStatus aStatus)
|
||||
{
|
||||
ProposeTrackStatus(aStatus);
|
||||
}
|
||||
|
||||
inline
|
||||
G4TrackStatus G4VParticleChange::GetStatusChange() const
|
||||
{
|
||||
return GetTrackStatus();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::SetSteppingControl(G4SteppingControl StepControlFlag)
|
||||
{
|
||||
ProposeSteppingControl(StepControlFlag);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::SetLocalEnergyDeposit(G4double anEnergyPart)
|
||||
{
|
||||
ProposeLocalEnergyDeposit(anEnergyPart);
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void G4VParticleChange::SetTrueStepLength(G4double aLength)
|
||||
{
|
||||
ProposeTrueStepLength(aLength);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VParticleChange::SetParentWeight(G4double w)
|
||||
{
|
||||
ProposeParentWeight(w);
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VUserTrackInformation.hh,v 1.4 2003/05/09 20:42:27 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01-ref-02 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4VUserTrackInformation
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// Abstract class which the user can derive his/her own concrete
|
||||
// class for toring user's information associating with a G4Track
|
||||
// class object.
|
||||
//
|
||||
// It is user's responsibility
|
||||
// 1) Construct a concrete class object and set the pointer to
|
||||
// proper G4Track object
|
||||
// 2) Concrete class derived from this class is expected to use G4Allocator
|
||||
// for memory management or something equivarent for performance reason
|
||||
//
|
||||
// To set a pointer of a concrete class object to G4Track in
|
||||
// G4UserTrackingAction concrete implementation, given the G4Track
|
||||
// object is available only by "pointer to const", SetUserTrackInformation()
|
||||
// method of G4TrackingManager is available.
|
||||
//
|
||||
// The concrete class object is deleted by Geant4 kernel when
|
||||
// associated G4Track object is deleted.
|
||||
|
||||
|
||||
#ifndef G4VUserTrackInformation_H
|
||||
#define G4VUserTrackInformation_H 1
|
||||
|
||||
class G4VUserTrackInformation
|
||||
{
|
||||
public:
|
||||
G4VUserTrackInformation() {;}
|
||||
virtual ~G4VUserTrackInformation() {;}
|
||||
|
||||
public:
|
||||
virtual void Print() const = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
10
geant4/LEMuSR/G4Modified/track/src/CVS/Entries
Normal file
10
geant4/LEMuSR/G4Modified/track/src/CVS/Entries
Normal file
@ -0,0 +1,10 @@
|
||||
/G4ParticleChangeForDecay.cc/1.9/Sat Nov 1 03:24:48 2003//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChangeForMSC.cc/1.11/Sat Jan 31 02:43:51 2004//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChangeForTransport.cc/1.16/Sat Jan 31 02:43:51 2004//Tgeant4-06-02-ref-01
|
||||
/G4Step.cc/1.5/Wed Jul 11 10:08:39 2001//Tgeant4-06-02-ref-01
|
||||
/G4StepPoint.cc/1.9/Wed Apr 9 00:20:49 2003//Tgeant4-06-02-ref-01
|
||||
/G4VParticleChange.cc/1.16/Sat Jan 31 02:43:51 2004//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChange.cc/1.26/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
|
||||
/G4ParticleChangeForLoss.cc/1.13/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
|
||||
/G4Track.cc/1.21/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
|
||||
D
|
1
geant4/LEMuSR/G4Modified/track/src/CVS/Repository
Normal file
1
geant4/LEMuSR/G4Modified/track/src/CVS/Repository
Normal file
@ -0,0 +1 @@
|
||||
geant4/source/track/src
|
1
geant4/LEMuSR/G4Modified/track/src/CVS/Root
Normal file
1
geant4/LEMuSR/G4Modified/track/src/CVS/Root
Normal file
@ -0,0 +1 @@
|
||||
:pserver:gum@g4cvs.cern.ch:/afs/cern.ch/sw/geant4/cvs
|
1
geant4/LEMuSR/G4Modified/track/src/CVS/Tag
Normal file
1
geant4/LEMuSR/G4Modified/track/src/CVS/Tag
Normal file
@ -0,0 +1 @@
|
||||
Ngeant4-06-02-ref-01
|
517
geant4/LEMuSR/G4Modified/track/src/G4ParticleChange.cc
Normal file
517
geant4/LEMuSR/G4Modified/track/src/G4ParticleChange.cc
Normal file
@ -0,0 +1,517 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChange.cc,v 1.26 2004/05/08 15:28:13 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
// Change default debug flag to false 10 May. 1998 H.Kurahige
|
||||
// Add Track weight 12 Nov. 1998 H.Kurashige
|
||||
// Activate CheckIt method for VERBOSE mode 14 Dec. 1998 H.Kurashige
|
||||
// Modified CheckIt method for time 9 Feb. 1999 H.Kurashige
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4ParticleChange.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4TrackFastVector.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ExceptionSeverity.hh"
|
||||
|
||||
|
||||
G4ParticleChange::G4ParticleChange():G4VParticleChange()
|
||||
{
|
||||
}
|
||||
|
||||
G4ParticleChange::~G4ParticleChange()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChange::~G4ParticleChange() " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// copy constructor
|
||||
G4ParticleChange::G4ParticleChange(const G4ParticleChange &right): G4VParticleChange(right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChange:: copy constructor is called " << G4endl;
|
||||
}
|
||||
theMomentumDirectionChange = right.theMomentumDirectionChange;
|
||||
thePolarizationChange = right.thePolarizationChange;
|
||||
thePositionChange = right.thePositionChange;
|
||||
theTimeChange = right.theTimeChange;
|
||||
theEnergyChange = right.theEnergyChange;
|
||||
theMassChange = right.theMassChange;
|
||||
theChargeChange = right.theChargeChange;
|
||||
theWeightChange = right.theWeightChange;
|
||||
theProperTimeChange = right.theProperTimeChange;
|
||||
}
|
||||
|
||||
// assignemnt operator
|
||||
G4ParticleChange & G4ParticleChange::operator=(const G4ParticleChange &right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChange:: assignment operator is called " << G4endl;
|
||||
}
|
||||
if (this != &right)
|
||||
{
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
|
||||
theMomentumDirectionChange = right.theMomentumDirectionChange;
|
||||
thePolarizationChange = right.thePolarizationChange;
|
||||
thePositionChange = right.thePositionChange;
|
||||
theTimeChange = right.theTimeChange;
|
||||
theEnergyChange = right.theEnergyChange;
|
||||
theMassChange = right.theMassChange;
|
||||
theChargeChange = right.theChargeChange;
|
||||
theWeightChange = right.theWeightChange;
|
||||
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4bool G4ParticleChange::operator==(const G4ParticleChange &right) const
|
||||
{
|
||||
return ((G4VParticleChange *)this == (G4VParticleChange *) &right);
|
||||
}
|
||||
|
||||
G4bool G4ParticleChange::operator!=(const G4ParticleChange &right) const
|
||||
{
|
||||
return ((G4VParticleChange *)this != (G4VParticleChange *) &right);
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for handling secondaries
|
||||
//
|
||||
|
||||
void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
|
||||
G4bool IsGoodForTracking )
|
||||
{
|
||||
// create track
|
||||
G4Track* aTrack = new G4Track(aParticle, theTimeChange, thePositionChange);
|
||||
|
||||
// set IsGoodGorTrackingFlag
|
||||
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
|
||||
|
||||
// Touchable handle is copied to keep the pointer
|
||||
aTrack->SetTouchableHandle(theCurrentTrack->GetTouchableHandle());
|
||||
|
||||
// add a secondary
|
||||
G4VParticleChange::AddSecondary(aTrack);
|
||||
}
|
||||
|
||||
void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
|
||||
G4ThreeVector newPosition,
|
||||
G4bool IsGoodForTracking )
|
||||
{
|
||||
// create track
|
||||
G4Track* aTrack = new G4Track(aParticle, theTimeChange, newPosition);
|
||||
|
||||
// set IsGoodGorTrackingFlag
|
||||
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
|
||||
|
||||
// Touchable is a temporary object, so you cannot keep the pointer
|
||||
aTrack->SetTouchableHandle((G4VTouchable*)0);
|
||||
|
||||
// add a secondary
|
||||
G4VParticleChange::AddSecondary(aTrack);
|
||||
}
|
||||
|
||||
void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
|
||||
G4double newTime,
|
||||
G4bool IsGoodForTracking )
|
||||
{
|
||||
// create track
|
||||
G4Track* aTrack = new G4Track(aParticle, newTime, thePositionChange);
|
||||
|
||||
// set IsGoodGorTrackingFlag
|
||||
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
|
||||
|
||||
// Touchable handle is copied to keep the pointer
|
||||
aTrack->SetTouchableHandle(theCurrentTrack->GetTouchableHandle());
|
||||
|
||||
// add a secondary
|
||||
G4VParticleChange::AddSecondary(aTrack);
|
||||
}
|
||||
|
||||
void G4ParticleChange::AddSecondary(G4Track* aTrack)
|
||||
{
|
||||
// add a secondary
|
||||
G4VParticleChange::AddSecondary(aTrack);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// functions for Initialization
|
||||
//
|
||||
|
||||
void G4ParticleChange::Initialize(const G4Track& track)
|
||||
{
|
||||
// use base class's method at first
|
||||
G4VParticleChange::Initialize(track);
|
||||
theCurrentTrack= &track;
|
||||
|
||||
// set Energy/Momentum etc. equal to those of the parent particle
|
||||
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
|
||||
theEnergyChange = pParticle->GetKineticEnergy();
|
||||
theMomentumDirectionChange = pParticle->GetMomentumDirection();
|
||||
thePolarizationChange = pParticle->GetPolarization();
|
||||
theProperTimeChange = pParticle->GetProperTime();
|
||||
|
||||
// Set mass/charge of DynamicParticle
|
||||
theMassChange = pParticle->GetMass();
|
||||
theChargeChange = pParticle->GetCharge();
|
||||
|
||||
// set Position/Time etc. equal to those of the parent track
|
||||
thePositionChange = track.GetPosition();
|
||||
theTimeChange = track.GetGlobalTime();
|
||||
|
||||
theWeightChange = track.GetWeight();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for updating G4Step
|
||||
//
|
||||
|
||||
G4Step* G4ParticleChange::UpdateStepForAlongStep(G4Step* pStep)
|
||||
{
|
||||
// A physics process always calculates the final state of the
|
||||
// particle relative to the initial state at the beginning
|
||||
// of the Step, i.e., based on information of G4Track (or
|
||||
// equivalently the PreStepPoint).
|
||||
// So, the differences (delta) between these two states have to be
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
// Take note that the return type of GetMomentumDirectionChange is a
|
||||
// pointer to G4ParticleMometum. Also it is a normalized
|
||||
// momentum vector.
|
||||
|
||||
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
G4double mass = theMassChange;
|
||||
|
||||
// Set Mass/Charge
|
||||
pPostStepPoint->SetMass(theMassChange);
|
||||
pPostStepPoint->SetCharge(theChargeChange);
|
||||
|
||||
// calculate new kinetic energy
|
||||
G4double energy = pPostStepPoint->GetKineticEnergy()
|
||||
+ (theEnergyChange - pPreStepPoint->GetKineticEnergy());
|
||||
|
||||
// update kinetic energy and momentum direction
|
||||
if (energy > 0.0) {
|
||||
// calculate new momentum
|
||||
G4ThreeVector pMomentum = pPostStepPoint->GetMomentum()
|
||||
+ ( CalcMomentum(theEnergyChange, theMomentumDirectionChange, mass)
|
||||
- pPreStepPoint->GetMomentum());
|
||||
G4double tMomentum = pMomentum.mag();
|
||||
G4ThreeVector direction(1.0,0.0,0.0);
|
||||
if( tMomentum > 0. ){
|
||||
G4double inv_Momentum= 1.0 / tMomentum;
|
||||
direction= pMomentum * inv_Momentum;
|
||||
}
|
||||
pPostStepPoint->SetMomentumDirection(direction);
|
||||
pPostStepPoint->SetKineticEnergy( energy );
|
||||
} else {
|
||||
// stop case
|
||||
//pPostStepPoint->SetMomentumDirection(G4ThreeVector(1., 0., 0.));
|
||||
pPostStepPoint->SetKineticEnergy(0.0);
|
||||
}
|
||||
|
||||
// update polarization
|
||||
pPostStepPoint->AddPolarization( thePolarizationChange
|
||||
- pPreStepPoint->GetPolarization());
|
||||
|
||||
// update position and time
|
||||
pPostStepPoint->AddPosition( thePositionChange
|
||||
- pPreStepPoint->GetPosition() );
|
||||
pPostStepPoint->AddGlobalTime( theTimeChange
|
||||
- pPreStepPoint->GetGlobalTime());
|
||||
pPostStepPoint->AddLocalTime( theTimeChange
|
||||
- pPreStepPoint->GetGlobalTime());
|
||||
pPostStepPoint->AddProperTime( theProperTimeChange
|
||||
- pPreStepPoint->GetProperTime());
|
||||
|
||||
// update weight
|
||||
G4double newWeight= theWeightChange/(pPreStepPoint->GetWeight())*(pPostStepPoint->GetWeight());
|
||||
pPostStepPoint->SetWeight( newWeight );
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
G4Track* aTrack = pStep->GetTrack();
|
||||
if (debugFlag) CheckIt(*aTrack);
|
||||
#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
}
|
||||
|
||||
G4Step* G4ParticleChange::UpdateStepForPostStep(G4Step* pStep)
|
||||
{
|
||||
// A physics process always calculates the final state of the particle
|
||||
|
||||
// Take note that the return type of GetMomentumChange is a
|
||||
// pointer to G4ParticleMometum. Also it is a normalized
|
||||
// momentum vector.
|
||||
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
G4Track* aTrack = pStep->GetTrack();
|
||||
|
||||
// Set Mass/Charge
|
||||
pPostStepPoint->SetMass(theMassChange);
|
||||
pPostStepPoint->SetCharge(theChargeChange);
|
||||
|
||||
// update kinetic energy and momentum direction
|
||||
pPostStepPoint->SetMomentumDirection(theMomentumDirectionChange);
|
||||
pPostStepPoint->SetKineticEnergy( theEnergyChange );
|
||||
|
||||
// update polarization
|
||||
pPostStepPoint->SetPolarization( thePolarizationChange );
|
||||
|
||||
// update position and time
|
||||
pPostStepPoint->SetPosition( thePositionChange );
|
||||
pPostStepPoint->SetGlobalTime( theTimeChange );
|
||||
pPostStepPoint->AddLocalTime( theTimeChange
|
||||
- aTrack->GetGlobalTime());
|
||||
pPostStepPoint->SetProperTime( theProperTimeChange );
|
||||
|
||||
// update weight
|
||||
pPostStepPoint->SetWeight( theWeightChange );
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (debugFlag) CheckIt(*aTrack);
|
||||
#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
pPostStepPoint->SetCharge(theChargeChange);
|
||||
|
||||
// update kinetic energy and momentum direction
|
||||
pPostStepPoint->SetMomentumDirection(theMomentumDirectionChange);
|
||||
pPostStepPoint->SetKineticEnergy( theEnergyChange );
|
||||
|
||||
// update polarization
|
||||
pPostStepPoint->SetPolarization( thePolarizationChange );
|
||||
|
||||
// update position and time
|
||||
pPostStepPoint->SetPosition( thePositionChange );
|
||||
pPostStepPoint->SetGlobalTime( theTimeChange );
|
||||
pPostStepPoint->AddLocalTime( theTimeChange
|
||||
- aTrack->GetGlobalTime());
|
||||
pPostStepPoint->SetProperTime( theProperTimeChange );
|
||||
|
||||
// update weight
|
||||
pPostStepPoint->SetWeight( theWeightChange );
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (debugFlag) CheckIt(*aTrack);
|
||||
#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for printing messages
|
||||
//
|
||||
|
||||
void G4ParticleChange::DumpInfo() const
|
||||
{
|
||||
// use base-class DumpInfo
|
||||
G4VParticleChange::DumpInfo();
|
||||
|
||||
G4cout.precision(3);
|
||||
|
||||
G4cout << " Mass (GeV) : "
|
||||
<< std::setw(20) << theMassChange/GeV
|
||||
<< G4endl;
|
||||
G4cout << " Charge (eplus) : "
|
||||
<< std::setw(20) << theChargeChange/eplus
|
||||
<< G4endl;
|
||||
G4cout << " Position - x (mm) : "
|
||||
<< std::setw(20) << thePositionChange.x()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Position - y (mm) : "
|
||||
<< std::setw(20) << thePositionChange.y()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Position - z (mm) : "
|
||||
<< std::setw(20) << thePositionChange.z()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Time (ns) : "
|
||||
<< std::setw(20) << theTimeChange/ns
|
||||
<< G4endl;
|
||||
G4cout << " Proper Time (ns) : "
|
||||
<< std::setw(20) << theProperTimeChange/ns
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - x : "
|
||||
<< std::setw(20) << theMomentumDirectionChange.x()
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - y : "
|
||||
<< std::setw(20) << theMomentumDirectionChange.y()
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - z : "
|
||||
<< std::setw(20) << theMomentumDirectionChange.z()
|
||||
<< G4endl;
|
||||
G4cout << " Kinetic Energy (MeV): "
|
||||
<< std::setw(20) << theEnergyChange/MeV
|
||||
<< G4endl;
|
||||
G4cout << " Polarization - x : "
|
||||
<< std::setw(20) << thePolarizationChange.x()
|
||||
<< G4endl;
|
||||
G4cout << " Polarization - y : "
|
||||
<< std::setw(20) << thePolarizationChange.y()
|
||||
<< G4endl;
|
||||
G4cout << " Polarization - z : "
|
||||
<< std::setw(20) << thePolarizationChange.z()
|
||||
<< G4endl;
|
||||
G4cout << " Track Weight : "
|
||||
<< std::setw(20) << theWeightChange
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
G4bool G4ParticleChange::CheckIt(const G4Track& aTrack)
|
||||
{
|
||||
G4bool exitWithError = false;
|
||||
G4double accuracy;
|
||||
|
||||
// No check in case of "fStopAndKill"
|
||||
if (GetTrackStatus() == fStopAndKill ) {
|
||||
return G4VParticleChange::CheckIt(aTrack);
|
||||
}
|
||||
|
||||
// MomentumDirection should be unit vector
|
||||
G4bool itsOKforMomentum = true;
|
||||
if ( theEnergyChange >0.) {
|
||||
accuracy = abs(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;
|
||||
}
|
||||
}
|
||||
|
||||
// Both global and proper time should not go back
|
||||
G4bool itsOKforGlobalTime = true;
|
||||
accuracy = (aTrack.GetGlobalTime()- theTimeChange)/ns;
|
||||
if (accuracy > accuracyForWarning) {
|
||||
#ifdef G4VERBOSE
|
||||
G4cout << " G4ParticleChange::CheckIt : ";
|
||||
G4cout << "the global time goes back !!" << G4endl;
|
||||
G4cout << " Difference: " << accuracy << "[ns] " <<G4endl;
|
||||
#endif
|
||||
itsOKforGlobalTime = false;
|
||||
if (accuracy > accuracyForException) exitWithError = true;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforProperTime && itsOKforGlobalTime;
|
||||
// dump out information of this particle change
|
||||
#ifdef G4VERBOSE
|
||||
if (!itsOK) {
|
||||
G4cout << " G4ParticleChange::CheckIt " <<G4endl;
|
||||
DumpInfo();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Exit with error
|
||||
if (exitWithError) {
|
||||
G4Exception("G4ParticleChange::CheckIt",
|
||||
"200",
|
||||
EventMustBeAborted,
|
||||
"momentum, energy, and/or time was illegal");
|
||||
}
|
||||
//correction
|
||||
if (!itsOKforMomentum) {
|
||||
G4double vmag = theMomentumDirectionChange.mag();
|
||||
theMomentumDirectionChange = (1./vmag)*theMomentumDirectionChange;
|
||||
}
|
||||
if (!itsOKforGlobalTime) {
|
||||
theTimeChange = aTrack.GetGlobalTime();
|
||||
}
|
||||
if (!itsOKforProperTime) {
|
||||
theProperTimeChange = aTrack.GetProperTime();
|
||||
}
|
||||
if (!itsOKforEnergy) {
|
||||
theEnergyChange = 0.0;
|
||||
}
|
||||
|
||||
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
|
||||
return itsOK;
|
||||
}
|
||||
|
||||
|
||||
|
211
geant4/LEMuSR/G4Modified/track/src/G4ParticleChangeForDecay.cc
Normal file
211
geant4/LEMuSR/G4Modified/track/src/G4ParticleChangeForDecay.cc
Normal file
@ -0,0 +1,211 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForDecay.cc,v 1.9 2003/06/19 14:45:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-ref-05 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
// Remove modification of energy/momentum 20 Jul, 1998 H.Kurashige
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4ParticleChangeForDecay.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4TrackFastVector.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ExceptionSeverity.hh"
|
||||
|
||||
G4ParticleChangeForDecay::G4ParticleChangeForDecay():G4VParticleChange()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChangeForDecay::G4ParticleChangeForDecay() " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
G4ParticleChangeForDecay::~G4ParticleChangeForDecay()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChangeForDecay::~G4ParticleChangeForDecay() " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// copy and assignment operators are implemented as "shallow copy"
|
||||
G4ParticleChangeForDecay::G4ParticleChangeForDecay(const G4ParticleChangeForDecay &right): G4VParticleChange(right)
|
||||
{
|
||||
theTimeChange = right.theTimeChange;
|
||||
thePolarizationChange = right.thePolarizationChange;
|
||||
}
|
||||
|
||||
|
||||
G4ParticleChangeForDecay & G4ParticleChangeForDecay::operator=(const G4ParticleChangeForDecay &right)
|
||||
{
|
||||
if (this != &right){
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
|
||||
theTimeChange = right.theTimeChange;
|
||||
thePolarizationChange = right.thePolarizationChange;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4bool G4ParticleChangeForDecay::operator==(const G4ParticleChangeForDecay &right) const
|
||||
{
|
||||
return ((G4VParticleChange *)this == (G4VParticleChange *) &right);
|
||||
}
|
||||
|
||||
G4bool G4ParticleChangeForDecay::operator!=(const G4ParticleChangeForDecay &right) const
|
||||
{
|
||||
return ((G4VParticleChange *)this != (G4VParticleChange *) &right);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for Initialization
|
||||
//
|
||||
void G4ParticleChangeForDecay::Initialize(const G4Track& track)
|
||||
{
|
||||
// use base class's method at first
|
||||
G4VParticleChange::Initialize(track);
|
||||
|
||||
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
|
||||
|
||||
// set Time e equal to those of the parent track
|
||||
theTimeChange = track.GetGlobalTime();
|
||||
|
||||
// set the Polarization equal to those of the parent track
|
||||
thePolarizationChange = pParticle->GetPolarization();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for updating G4Step
|
||||
//
|
||||
|
||||
G4Step* G4ParticleChangeForDecay::UpdateStepForPostStep(G4Step* pStep)
|
||||
{
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
}
|
||||
|
||||
|
||||
G4Step* G4ParticleChangeForDecay::UpdateStepForAtRest(G4Step* pStep)
|
||||
{
|
||||
// A physics process always calculates the final state of the particle
|
||||
|
||||
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
|
||||
// update polarization
|
||||
pPostStepPoint->SetPolarization( thePolarizationChange );
|
||||
|
||||
// update time
|
||||
pPostStepPoint->SetGlobalTime( theTimeChange );
|
||||
pPostStepPoint->AddLocalTime( theTimeChange
|
||||
- pPreStepPoint->GetGlobalTime());
|
||||
pPostStepPoint->AddProperTime( theTimeChange
|
||||
- pPreStepPoint->GetGlobalTime());
|
||||
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
G4Track* aTrack = pStep->GetTrack();
|
||||
if (debugFlag) CheckIt(*aTrack);
|
||||
#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
}
|
||||
|
||||
void G4ParticleChangeForDecay::DumpInfo() const
|
||||
{
|
||||
// Show header
|
||||
G4VParticleChange::DumpInfo();
|
||||
|
||||
G4cout.precision(3);
|
||||
G4cout << " Time (ns) : "
|
||||
<< std::setw(20) << theTimeChange/ns
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
G4bool G4ParticleChangeForDecay::CheckIt(const G4Track& aTrack)
|
||||
{
|
||||
G4bool exitWithError = false;
|
||||
|
||||
G4double accuracy;
|
||||
|
||||
// global time should not go back
|
||||
G4bool itsOK =true;
|
||||
accuracy = -1.0*(theTimeChange - aTrack.GetGlobalTime())/ns;
|
||||
if (accuracy > accuracyForWarning) {
|
||||
#ifdef G4VERBOSE
|
||||
G4cout << " G4ParticleChangeForDecay::CheckIt : ";
|
||||
G4cout << "the global time goes back !!" << G4endl;
|
||||
G4cout << " Difference: " << accuracy << "[ns] " <<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();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Exit with error
|
||||
if (exitWithError) {
|
||||
G4Exception("G4ParticleChangeForDecay::CheckIt",
|
||||
"500",
|
||||
EventMustBeAborted,
|
||||
"time was illegal");
|
||||
}
|
||||
|
||||
// correction
|
||||
if (!itsOK) {
|
||||
theTimeChange = aTrack.GetGlobalTime();
|
||||
}
|
||||
|
||||
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
|
||||
return itsOK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
249
geant4/LEMuSR/G4Modified/track/src/G4ParticleChangeForLoss.cc
Normal file
249
geant4/LEMuSR/G4Modified/track/src/G4ParticleChangeForLoss.cc
Normal file
@ -0,0 +1,249 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForLoss.cc,v 1.13 2004/06/15 08:17:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
// Modified:
|
||||
// 16.01.04 V.Ivanchenko update for model variant of energy loss
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
#include "G4ParticleChangeForLoss.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ExceptionSeverity.hh"
|
||||
|
||||
G4ParticleChangeForLoss::G4ParticleChangeForLoss():G4VParticleChange()
|
||||
{
|
||||
theSteppingControlFlag = NormalCondition;
|
||||
debugFlag = false;
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChangeForLoss::G4ParticleChangeForLoss() " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
G4ParticleChangeForLoss::~G4ParticleChangeForLoss()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChangeForLoss::~G4ParticleChangeForLoss() " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
G4ParticleChangeForLoss::G4ParticleChangeForLoss(
|
||||
const G4ParticleChangeForLoss &right): G4VParticleChange(right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForLoss:: copy constructor is called " << G4endl;
|
||||
}
|
||||
currentTrack = right.currentTrack;
|
||||
proposedKinEnergy = right.proposedKinEnergy;
|
||||
currentCharge = right.currentCharge;
|
||||
//theProposedWeight = right.theProposedWeight;
|
||||
proposedMomentumDirection = right.proposedMomentumDirection;
|
||||
}
|
||||
|
||||
// assignment operator
|
||||
G4ParticleChangeForLoss & G4ParticleChangeForLoss::operator=(
|
||||
const G4ParticleChangeForLoss &right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForLoss:: assignment operator is called " << G4endl;
|
||||
}
|
||||
if (this != &right)
|
||||
{
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
|
||||
currentTrack = right.currentTrack;
|
||||
proposedKinEnergy = right.proposedKinEnergy;
|
||||
currentCharge = right.currentCharge;
|
||||
//theProposedWeight = right.theProposedWeight;
|
||||
proposedMomentumDirection = right.proposedMomentumDirection;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for updating G4Step
|
||||
//
|
||||
|
||||
G4Step* G4ParticleChangeForLoss::UpdateStepForAlongStep(G4Step* pStep)
|
||||
{
|
||||
// A physics process always calculates the final state of the
|
||||
// particle relative to the initial state at the beginning
|
||||
// of the Step, i.e., based on information of G4Track (or
|
||||
// equivalently the PreStepPoint).
|
||||
// So, the differences (delta) between these two states have to be
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
|
||||
// calculate new kinetic energy
|
||||
G4double kinEnergy = pPostStepPoint->GetKineticEnergy()
|
||||
+ (proposedKinEnergy - pPreStepPoint->GetKineticEnergy());
|
||||
|
||||
// update kinetic energy and momentum direction
|
||||
if (kinEnergy < 0.0) {
|
||||
theLocalEnergyDeposit += kinEnergy;
|
||||
kinEnergy = 0.0;
|
||||
}
|
||||
|
||||
pPostStepPoint->SetKineticEnergy( kinEnergy );
|
||||
pPostStepPoint->SetCharge( currentCharge );
|
||||
|
||||
// update weight
|
||||
// this feature is commented out, it should be overwritten in case
|
||||
// if energy loss processes will use biasing
|
||||
// G4double newWeight = theProposedWeight/(pPreStepPoint->GetWeight())*(pPostStepPoint->GetWeight());
|
||||
// pPostStepPoint->SetWeight( newWeight );
|
||||
|
||||
|
||||
// Not necessary to check now
|
||||
//#ifdef G4VERBOSE
|
||||
// if (debugFlag) CheckIt(*aTrack);
|
||||
//#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
|
||||
return pStep;
|
||||
}
|
||||
|
||||
G4Step* G4ParticleChangeForLoss::UpdateStepForPostStep(G4Step* pStep)
|
||||
{
|
||||
// A physics process always calculates the final state of the
|
||||
// particle relative to the initial state at the beginning
|
||||
// of the Step, i.e., based on information of G4Track (or
|
||||
// equivalently the PreStepPoint).
|
||||
// So, the differences (delta) between these two states have to be
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
|
||||
pPostStepPoint->SetKineticEnergy( proposedKinEnergy );
|
||||
pPostStepPoint->SetCharge( currentCharge );
|
||||
pPostStepPoint->SetMomentumDirection( proposedMomentumDirection );
|
||||
|
||||
// update weight
|
||||
// this feature is commented out, it should be overwritten in case
|
||||
// if energy loss processes will use biasing
|
||||
// pPostStepPoint->SetWeight( theProposedWeight );
|
||||
|
||||
// Not necessary to check now
|
||||
//#ifdef G4VERBOSE
|
||||
// if (debugFlag) CheckIt(*aTrack);
|
||||
//#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
|
||||
return pStep;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for printing messages
|
||||
//
|
||||
|
||||
void G4ParticleChangeForLoss::DumpInfo() const
|
||||
{
|
||||
// use base-class DumpInfo
|
||||
G4VParticleChange::DumpInfo();
|
||||
|
||||
G4cout.precision(3);
|
||||
G4cout << " Charge (eplus) : "
|
||||
<< std::setw(20) << currentCharge/eplus
|
||||
<< G4endl;
|
||||
G4cout << " Kinetic Energy (MeV): "
|
||||
<< std::setw(20) << proposedKinEnergy/MeV
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - x : "
|
||||
<< std::setw(20) << proposedMomentumDirection.x()
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - y : "
|
||||
<< std::setw(20) << proposedMomentumDirection.y()
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - z : "
|
||||
<< std::setw(20) << proposedMomentumDirection.z()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
G4bool G4ParticleChangeForLoss::CheckIt(const G4Track& aTrack)
|
||||
{
|
||||
G4bool itsOK = true;
|
||||
G4bool exitWithError = false;
|
||||
|
||||
G4double accuracy;
|
||||
|
||||
// Energy should not be lager than initial value
|
||||
accuracy = ( proposedKinEnergy - aTrack.GetKineticEnergy())/MeV;
|
||||
if (accuracy > accuracyForWarning) {
|
||||
#ifdef G4VERBOSE
|
||||
G4cout << "G4ParticleChangeForLoss::CheckIt: ";
|
||||
G4cout << "KinEnergy become larger than the initial value!" << G4endl;
|
||||
G4cout << " Difference: " << accuracy << "[MeV] " <<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();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Exit with error
|
||||
if (exitWithError) {
|
||||
G4Exception("G4ParticleChangeForLoss::CheckIt",
|
||||
"400",
|
||||
EventMustBeAborted,
|
||||
"energy was illegal");
|
||||
}
|
||||
|
||||
//correction
|
||||
if (!itsOK) {
|
||||
proposedKinEnergy = aTrack.GetKineticEnergy();
|
||||
}
|
||||
|
||||
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
|
||||
return itsOK;
|
||||
}
|
202
geant4/LEMuSR/G4Modified/track/src/G4ParticleChangeForMSC.cc
Normal file
202
geant4/LEMuSR/G4Modified/track/src/G4ParticleChangeForMSC.cc
Normal file
@ -0,0 +1,202 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForMSC.cc,v 1.11 2004/01/20 15:29:41 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-ref-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
// Update for model variant of msc 16 Jan 2004 V.Ivanchenko
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4ParticleChangeForMSC.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ExceptionSeverity.hh"
|
||||
|
||||
G4ParticleChangeForMSC::G4ParticleChangeForMSC():G4VParticleChange()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChangeForMSC::G4ParticleChangeForMSC() " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
G4ParticleChangeForMSC::~G4ParticleChangeForMSC()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChangeForMSC::~G4ParticleChangeForMSC() " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
G4ParticleChangeForMSC::G4ParticleChangeForMSC(
|
||||
const G4ParticleChangeForMSC &right): G4VParticleChange(right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForMSC:: copy constructor is called " << G4endl;
|
||||
}
|
||||
theMomentumDirection = right.theMomentumDirection;
|
||||
thePosition = right.thePosition;
|
||||
}
|
||||
|
||||
// assignment operator
|
||||
G4ParticleChangeForMSC & G4ParticleChangeForMSC::operator=(
|
||||
const G4ParticleChangeForMSC &right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForMSC:: assignment operator is called " << G4endl;
|
||||
}
|
||||
if (this != &right)
|
||||
{
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
|
||||
theMomentumDirection = right.theMomentumDirection;
|
||||
thePosition = right.thePosition;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for updating G4Step
|
||||
//
|
||||
|
||||
G4Step* G4ParticleChangeForMSC::UpdateStepForAlongStep(G4Step* pStep)
|
||||
{
|
||||
// Update the G4Step specific attributes
|
||||
pStep->SetStepLength(theTrueStepLength);
|
||||
theStatusChange = pStep->GetTrack()->GetTrackStatus();
|
||||
return pStep;
|
||||
}
|
||||
|
||||
G4Step* G4ParticleChangeForMSC::UpdateStepForPostStep(G4Step* pStep)
|
||||
{
|
||||
// A physics process always calculates the final state of the particle
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
|
||||
// update momentum direction
|
||||
pPostStepPoint->SetMomentumDirection(theMomentumDirection);
|
||||
|
||||
// update position
|
||||
pPostStepPoint->SetPosition( thePosition );
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
return pStep;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for printing messages
|
||||
//
|
||||
|
||||
void G4ParticleChangeForMSC::DumpInfo() const
|
||||
{
|
||||
// use base-class DumpInfo
|
||||
G4VParticleChange::DumpInfo();
|
||||
|
||||
G4cout.precision(3);
|
||||
G4cout << " Position - x (mm) : "
|
||||
<< std::setw(20) << thePosition.x()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Position - y (mm) : "
|
||||
<< std::setw(20) << thePosition.y()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Position - z (mm) : "
|
||||
<< std::setw(20) << thePosition.z()/mm
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - x : "
|
||||
<< std::setw(20) << theMomentumDirection.x()
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - y : "
|
||||
<< std::setw(20) << theMomentumDirection.y()
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direct - z : "
|
||||
<< std::setw(20) << theMomentumDirection.z()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
|
||||
G4bool G4ParticleChangeForMSC::CheckIt(const G4Track& aTrack)
|
||||
{
|
||||
G4bool itsOK = true;
|
||||
G4bool exitWithError = false;
|
||||
|
||||
G4double accuracy;
|
||||
|
||||
// check
|
||||
|
||||
// MomentumDirection should be unit vector
|
||||
accuracy = abs(theMomentumDirection.mag2()-1.0);
|
||||
if (accuracy > accuracyForWarning) {
|
||||
#ifdef G4VERBOSE
|
||||
G4cout << " G4ParticleChangeForMSC::CheckIt : ";
|
||||
G4cout << "the Momentum Change is not unit vector !!" << G4endl;
|
||||
G4cout << " Difference: " << accuracy << 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();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Exit with error
|
||||
if (exitWithError) {
|
||||
G4Exception("G4ParticleChangeForMSC::CheckIt",
|
||||
"300",
|
||||
EventMustBeAborted,
|
||||
"momentum direction was illegal");
|
||||
}
|
||||
//correction
|
||||
if (!itsOK) {
|
||||
G4double vmag = theMomentumDirection.mag();
|
||||
theMomentumDirection = (1./vmag)*theMomentumDirection;
|
||||
}
|
||||
|
||||
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
|
||||
return itsOK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,240 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParticleChangeForTransport.cc,v 1.16 2004/01/20 15:29:41 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-ref-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 10 May. 1998 H.Kurahige
|
||||
// Correct tratment of fpNextTouchable 12 May. 1998 H.Kurashige
|
||||
// Change to the next volume only if energy>0 19 Jan. 2004 V.Ivanchenko
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4ParticleChangeForTransport.hh"
|
||||
#include "G4TouchableHandle.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4TrackFastVector.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
|
||||
G4ParticleChangeForTransport::G4ParticleChangeForTransport():G4ParticleChange()
|
||||
{
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChangeForTransport::G4ParticleChangeForTransport() " << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
G4ParticleChangeForTransport::~G4ParticleChangeForTransport()
|
||||
{
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChangeForTransport::~G4ParticleChangeForTransport() " << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4ParticleChangeForTransport::G4ParticleChangeForTransport(const G4ParticleChangeForTransport &right):G4ParticleChange(right)
|
||||
{
|
||||
if (verboseLevel>0) {
|
||||
G4cout << "G4ParticleChangeForTransport:: copy constructor is called " << G4endl;
|
||||
}
|
||||
theTouchableHandle = right.theTouchableHandle;
|
||||
}
|
||||
|
||||
// assignemnt operator
|
||||
G4ParticleChangeForTransport & G4ParticleChangeForTransport::operator=(const G4ParticleChangeForTransport &right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForTransport:: assignment operator is called " << G4endl;
|
||||
}
|
||||
if (this != &right)
|
||||
{
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theTouchableHandle = right.theTouchableHandle;
|
||||
theMaterialChange = right.theMaterialChange;
|
||||
theMaterialCutsCoupleChange = right.theMaterialCutsCoupleChange;
|
||||
theMomentumDirectionChange = right.theMomentumDirectionChange;
|
||||
thePolarizationChange = right.thePolarizationChange;
|
||||
thePositionChange = right.thePositionChange;
|
||||
theTimeChange = right.theTimeChange;
|
||||
theEnergyChange = right.theEnergyChange;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for updating G4Step
|
||||
//
|
||||
|
||||
G4Step* G4ParticleChangeForTransport::UpdateStepForAtRest(G4Step* pStep)
|
||||
{
|
||||
// Nothing happens for AtRestDoIt
|
||||
if (verboseLevel>0) {
|
||||
G4cout << "G4ParticleChangeForTransport::UpdateStepForAtRest() is called" << G4endl;
|
||||
G4cout << " Nothing happens for this method " << G4endl;
|
||||
}
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
}
|
||||
|
||||
|
||||
G4Step* G4ParticleChangeForTransport::UpdateStepForAlongStep(G4Step* pStep)
|
||||
{
|
||||
// Smooth curved tajectory representation: let the Step know about
|
||||
// the auxiliary trajectory points (jacek 30/10/2002)
|
||||
pStep->SetPointerToVectorOfAuxiliaryPoints(fpVectorOfAuxiliaryPointsPointer);
|
||||
|
||||
// copy of G4ParticleChange::UpdateStepForAlongStep
|
||||
// i.e. no effect for touchable
|
||||
|
||||
// A physics process always calculates the final state of the
|
||||
// particle relative to the initial state at the beginning
|
||||
// of the Step, i.e., based on information of G4Track (or
|
||||
// equivalently the PreStepPoint).
|
||||
// So, the differences (delta) between these two states have to be
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
// Take note that the return type of GetMomentumChange is a
|
||||
// pointer to G4ThreeVector. Also it is a normalized
|
||||
// momentum vector.
|
||||
|
||||
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
G4Track* aTrack = pStep->GetTrack();
|
||||
G4double mass = aTrack->GetDynamicParticle()->GetMass();
|
||||
|
||||
// uodate kinetic energy
|
||||
// now assume that no energy change in transportation
|
||||
// However it is not true in electric fields
|
||||
// Case for changing energy will be implemented in future
|
||||
|
||||
|
||||
// update momentum direction and energy
|
||||
if (isMomentumChanged) {
|
||||
G4double energy;
|
||||
energy= pPostStepPoint->GetKineticEnergy()
|
||||
+ (theEnergyChange - pPreStepPoint->GetKineticEnergy());
|
||||
|
||||
// calculate new momentum
|
||||
G4ThreeVector pMomentum = pPostStepPoint->GetMomentum()
|
||||
+ ( CalcMomentum(theEnergyChange, theMomentumDirectionChange, mass)
|
||||
- pPreStepPoint->GetMomentum());
|
||||
G4double tMomentum = pMomentum.mag();
|
||||
G4ThreeVector direction(1.0,0.0,0.0);
|
||||
if( tMomentum > 0. ){
|
||||
G4double inv_Momentum= 1.0 / tMomentum;
|
||||
direction= pMomentum * inv_Momentum;
|
||||
}
|
||||
pPostStepPoint->SetMomentumDirection(direction);
|
||||
pPostStepPoint->SetKineticEnergy( energy );
|
||||
}
|
||||
|
||||
// stop case should not occur
|
||||
//pPostStepPoint->SetMomentumDirection(G4ThreeVector(1., 0., 0.));
|
||||
|
||||
|
||||
// update polarization
|
||||
pPostStepPoint->AddPolarization( thePolarizationChange
|
||||
- pPreStepPoint->GetPolarization());
|
||||
|
||||
// update position and time
|
||||
pPostStepPoint->AddPosition( thePositionChange
|
||||
- pPreStepPoint->GetPosition() );
|
||||
pPostStepPoint->AddGlobalTime( theTimeChange
|
||||
- pPreStepPoint->GetGlobalTime());
|
||||
pPostStepPoint->AddLocalTime( theTimeChange
|
||||
- pPreStepPoint->GetGlobalTime());
|
||||
pPostStepPoint->AddProperTime( theProperTimeChange
|
||||
- pPreStepPoint->GetProperTime());
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (debugFlag) CheckIt(*aTrack);
|
||||
#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
//pStep->SetStepLength( theTrueStepLength );
|
||||
// pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
|
||||
pStep->SetControlFlag( theSteppingControlFlag );
|
||||
return pStep;
|
||||
// return UpdateStepInfo(pStep);
|
||||
}
|
||||
|
||||
G4Step* G4ParticleChangeForTransport::UpdateStepForPostStep(G4Step* pStep)
|
||||
{
|
||||
// A physics process always calculates the final state of the particle
|
||||
|
||||
// Change volume if any kinetic energy remanes
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
if(pPostStepPoint->GetKineticEnergy() > 0.0) {
|
||||
|
||||
// update next touchable
|
||||
// (touchable can be changed only at PostStepDoIt)
|
||||
pPostStepPoint->SetTouchableHandle( theTouchableHandle );
|
||||
|
||||
pPostStepPoint->SetMaterial( theMaterialChange );
|
||||
pPostStepPoint->SetMaterialCutsCouple( theMaterialCutsCoupleChange );
|
||||
}
|
||||
// It used to call base class's method
|
||||
// - but this would copy uninitialised data members
|
||||
// return G4ParticleChange::UpdateStepForPostStep(pStep);
|
||||
|
||||
// Copying what the base class does would instead
|
||||
// - also not useful
|
||||
// return G4VParticleChange::UpdateStepInfo(pStep);
|
||||
|
||||
return pStep;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for printing messages
|
||||
//
|
||||
|
||||
void G4ParticleChangeForTransport::DumpInfo() const
|
||||
{
|
||||
// use base-class DumpInfo
|
||||
G4ParticleChange::DumpInfo();
|
||||
|
||||
G4cout.precision(3);
|
||||
G4cout << " Touchable (pointer) : "
|
||||
<< std::setw(20) << theTouchableHandle()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
64
geant4/LEMuSR/G4Modified/track/src/G4Step.cc
Normal file
64
geant4/LEMuSR/G4Modified/track/src/G4Step.cc
Normal file
@ -0,0 +1,64 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Step.cc,v 1.5 2001/07/11 10:08:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00-ref-03 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4Step.cc
|
||||
//
|
||||
// Description:
|
||||
// This class represents the Step of a particle tracked.
|
||||
// It includes information of
|
||||
// 1) List of Step points which compose the Step,
|
||||
// 2) static information of particle which generated the
|
||||
// Step,
|
||||
// 3) trackID and parent particle ID of the Step,
|
||||
// 4) termination condition of the Step,
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
#include "G4Step.hh"
|
||||
|
||||
////////////////
|
||||
G4Step::G4Step()
|
||||
////////////////
|
||||
{
|
||||
fpPreStepPoint = new G4StepPoint();
|
||||
fpPostStepPoint = new G4StepPoint();
|
||||
}
|
||||
|
||||
/////////////////
|
||||
G4Step::~G4Step()
|
||||
/////////////////
|
||||
{
|
||||
delete fpPreStepPoint;
|
||||
delete fpPostStepPoint;
|
||||
}
|
101
geant4/LEMuSR/G4Modified/track/src/G4StepPoint.cc
Normal file
101
geant4/LEMuSR/G4Modified/track/src/G4StepPoint.cc
Normal file
@ -0,0 +1,101 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4StepPoint.cc,v 1.9 2002/12/16 11:59:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00-ref-03 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4StepPoint.cc
|
||||
//
|
||||
// Description:
|
||||
// This class represents information associated with the
|
||||
// each end of a Step like the space/time data of the
|
||||
// particle.
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
#include "G4StepPoint.hh"
|
||||
|
||||
//////////////////////////
|
||||
G4StepPoint::G4StepPoint():
|
||||
//////////////////////////
|
||||
fpTouchable(0), fpMaterial(0), fpMaterialCutsCouple(0),
|
||||
fpProcessDefinedStep(0), fCharge(0.)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
G4StepPoint::G4StepPoint(const G4StepPoint &right):
|
||||
//////////////////////////
|
||||
fPosition(right.fPosition),
|
||||
fGlobalTime(right.fGlobalTime),
|
||||
fLocalTime(right.fLocalTime),
|
||||
fProperTime(right.fProperTime),
|
||||
fMomentumDirection(right.fMomentumDirection),
|
||||
fKineticEnergy(right.fKineticEnergy),
|
||||
fVelocity(right.fVelocity),
|
||||
fpTouchable(right.fpTouchable),
|
||||
fpMaterial(right.fpMaterial),
|
||||
fpMaterialCutsCouple(right.fpMaterialCutsCouple),
|
||||
fSafety(right.fSafety),
|
||||
fPolarization(right.fPolarization),
|
||||
fStepStatus(right.fStepStatus),
|
||||
fpProcessDefinedStep(right.fpProcessDefinedStep),
|
||||
fMass(right.fMass),
|
||||
fCharge(right.fCharge),
|
||||
fWeight(right.fWeight)
|
||||
{}
|
||||
|
||||
|
||||
//////////////////////////
|
||||
G4StepPoint & G4StepPoint::operator=(const G4StepPoint &right)
|
||||
//////////////////////////
|
||||
{
|
||||
if (this != &right) {
|
||||
fPosition = right.fPosition;
|
||||
fGlobalTime = right.fGlobalTime;
|
||||
fLocalTime = right.fLocalTime;
|
||||
fProperTime = right.fProperTime;
|
||||
fMomentumDirection = right.fMomentumDirection;
|
||||
fKineticEnergy = right.fKineticEnergy;
|
||||
fpTouchable = right.fpTouchable;
|
||||
fpMaterial = right.fpMaterial;
|
||||
fpMaterialCutsCouple = right.fpMaterialCutsCouple;
|
||||
fSafety = right.fSafety;
|
||||
fPolarization = right.fPolarization;
|
||||
fStepStatus = right.fStepStatus;
|
||||
fpProcessDefinedStep = right.fpProcessDefinedStep;
|
||||
fMass = right.fMass;
|
||||
fCharge = right.fCharge;
|
||||
fWeight = right.fWeight;
|
||||
fVelocity = right.fVelocity;
|
||||
}
|
||||
return *this;
|
||||
}
|
191
geant4/LEMuSR/G4Modified/track/src/G4Track.cc
Normal file
191
geant4/LEMuSR/G4Modified/track/src/G4Track.cc
Normal file
@ -0,0 +1,191 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Track.cc,v 1.21 2004/06/11 14:28:14 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02-ref-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4Track.cc
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
// Add copy constructor Hisaya Feb. 07 01
|
||||
// Fix GetVelocity Hisaya Feb. 17 01
|
||||
// Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek//
|
||||
|
||||
#include "G4Track.hh"
|
||||
|
||||
G4Allocator<G4Track> aTrackAllocator;
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
G4Track::G4Track(G4DynamicParticle* apValueDynamicParticle,
|
||||
G4double aValueTime,
|
||||
const G4ThreeVector& aValuePosition)
|
||||
///////////////////////////////////////////////////////////
|
||||
: fCurrentStepNumber(0), fPosition(aValuePosition),
|
||||
fGlobalTime(aValueTime), fLocalTime(0.),
|
||||
fTrackLength(0.),
|
||||
fParentID(0), fTrackID(0),
|
||||
fpDynamicParticle(apValueDynamicParticle),
|
||||
fTrackStatus(fAlive),
|
||||
fBelowThreshold(false), fGoodForTracking(false),
|
||||
fStepLength(0.0), fWeight(1.0),
|
||||
fpStep(0),
|
||||
fVtxKineticEnergy(0.0),
|
||||
fpLVAtVertex(0), fpCreatorProcess(0),
|
||||
fpUserInformation(0)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////
|
||||
G4Track::G4Track()
|
||||
//////////////////
|
||||
: fCurrentStepNumber(0),
|
||||
fGlobalTime(0), fLocalTime(0.),
|
||||
fTrackLength(0.),
|
||||
fParentID(0), fTrackID(0),
|
||||
fpDynamicParticle(0),
|
||||
fTrackStatus(fAlive),
|
||||
fBelowThreshold(false), fGoodForTracking(false),
|
||||
fStepLength(0.0), fWeight(1.0),
|
||||
fpStep(0),
|
||||
fVtxKineticEnergy(0.0),
|
||||
fpLVAtVertex(0), fpCreatorProcess(0),
|
||||
fpUserInformation(0)
|
||||
{
|
||||
}
|
||||
//////////////////
|
||||
G4Track::G4Track(const G4Track& right)
|
||||
//////////////////
|
||||
{
|
||||
*this = right;
|
||||
}
|
||||
|
||||
///////////////////
|
||||
G4Track::~G4Track()
|
||||
///////////////////
|
||||
{
|
||||
delete fpDynamicParticle;
|
||||
delete fpUserInformation;
|
||||
}
|
||||
|
||||
//////////////////
|
||||
G4Track & G4Track::operator=(const G4Track &right)
|
||||
//////////////////
|
||||
{
|
||||
if (this != &right) {
|
||||
fPosition = right.fPosition;
|
||||
fGlobalTime = right.fGlobalTime;
|
||||
fLocalTime = right.fLocalTime;
|
||||
fTrackLength = right.fTrackLength;
|
||||
fWeight = right.fWeight;
|
||||
fStepLength = right.fStepLength;
|
||||
|
||||
// Track ID (and Parent ID) is not copied and set to zero for new track
|
||||
fTrackID = 0;
|
||||
fParentID =0;
|
||||
|
||||
// CurrentStepNumber is set to be 0
|
||||
fCurrentStepNumber = 0;
|
||||
|
||||
// dynamic particle information
|
||||
fpDynamicParticle = new G4DynamicParticle(*(right.fpDynamicParticle));
|
||||
|
||||
// track status and flags for tracking
|
||||
fTrackStatus = right.fTrackStatus;
|
||||
fBelowThreshold = right.fBelowThreshold;
|
||||
fGoodForTracking = right.fGoodForTracking;
|
||||
|
||||
// Step information (Step Length, Step Number, pointer to the Step,)
|
||||
// are not copied
|
||||
fpStep=0;
|
||||
|
||||
// vertex information
|
||||
fVtxPosition = right.fVtxPosition;
|
||||
fpLVAtVertex = right.fpLVAtVertex;
|
||||
fVtxKineticEnergy = right.fVtxKineticEnergy;
|
||||
fVtxMomentumDirection = right.fVtxMomentumDirection;
|
||||
|
||||
// CreatorProcess and UserInformation are not copied
|
||||
fpCreatorProcess = 0;
|
||||
fpUserInformation = 0;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
///////////////////
|
||||
void G4Track::CopyTrackInfo(const G4Track& right)
|
||||
//////////////////
|
||||
{
|
||||
*this = right;
|
||||
}
|
||||
|
||||
#include "G4ParticleTable.hh"
|
||||
///////////////////
|
||||
G4double G4Track::GetVelocity() const
|
||||
///////////////////
|
||||
{
|
||||
static G4bool isFirstTime = true;
|
||||
static G4ParticleDefinition* fOpticalPhoton =0;
|
||||
|
||||
if ( isFirstTime ) {
|
||||
isFirstTime = false;
|
||||
// set fOpticalPhoton
|
||||
fOpticalPhoton = G4ParticleTable::GetParticleTable()->FindParticle("opticalphoton");
|
||||
}
|
||||
|
||||
G4double velocity ;
|
||||
|
||||
G4double mass = fpDynamicParticle->GetMass();
|
||||
|
||||
// mass less particle
|
||||
if( mass == 0. ){
|
||||
velocity = c_light ;
|
||||
|
||||
// special case for photons
|
||||
if ( (fOpticalPhoton !=0) &&
|
||||
(fpDynamicParticle->GetDefinition()==fOpticalPhoton) ){
|
||||
G4Material*
|
||||
mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial();
|
||||
|
||||
if(mat->GetMaterialPropertiesTable() != 0){
|
||||
if(mat->GetMaterialPropertiesTable()->GetProperty("RINDEX") != 0 ){
|
||||
// light velocity = c/reflection-index
|
||||
velocity /=
|
||||
mat->GetMaterialPropertiesTable()->GetProperty("RINDEX")->
|
||||
GetProperty(fpDynamicParticle->GetTotalMomentum()) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
G4double T = fpDynamicParticle->GetKineticEnergy();
|
||||
velocity = c_light*sqrt(T*(T+2.*mass))/(T+mass) ;
|
||||
}
|
||||
|
||||
return velocity ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
376
geant4/LEMuSR/G4Modified/track/src/G4VParticleChange.cc
Normal file
376
geant4/LEMuSR/G4Modified/track/src/G4VParticleChange.cc
Normal file
@ -0,0 +1,376 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VParticleChange.cc,v 1.16 2003/12/12 13:12:14 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-ref-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4TrackFastVector.hh"
|
||||
#include "G4ExceptionSeverity.hh"
|
||||
|
||||
const G4double G4VParticleChange::accuracyForWarning = 1.0e-9;
|
||||
const G4double G4VParticleChange::accuracyForException = 0.001;
|
||||
|
||||
G4VParticleChange::G4VParticleChange():
|
||||
theNumberOfSecondaries(0),
|
||||
theSizeOftheListOfSecondaries(G4TrackFastVectorSize),
|
||||
theStatusChange(fAlive),
|
||||
theSteppingControlFlag(NormalCondition),
|
||||
theLocalEnergyDeposit(0.0),
|
||||
verboseLevel(1),
|
||||
theParentWeight(1.0),
|
||||
fSetSecondaryWeightByProcess(false),
|
||||
fSetParentWeightByProcess(true)
|
||||
{
|
||||
debugFlag = false;
|
||||
#ifdef G4VERBOSE
|
||||
// activate CHeckIt if in VERBOSE mode
|
||||
debugFlag = true;
|
||||
#endif
|
||||
theListOfSecondaries = new G4TrackFastVector();
|
||||
}
|
||||
|
||||
G4VParticleChange::~G4VParticleChange() {
|
||||
// check if tracks still exist in theListOfSecondaries
|
||||
if (theNumberOfSecondaries>0) {
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>0) {
|
||||
G4cerr << "G4VParticleChange::~G4VParticleChange() Warning ";
|
||||
G4cerr << "theListOfSecondaries is not empty ";
|
||||
}
|
||||
#endif
|
||||
for (G4int index= 0; index<theNumberOfSecondaries; index++){
|
||||
if ( (*theListOfSecondaries)[index] ) delete (*theListOfSecondaries)[index] ;
|
||||
}
|
||||
}
|
||||
delete theListOfSecondaries;
|
||||
}
|
||||
|
||||
// copy and assignment operators are implemented as "shallow copy"
|
||||
G4VParticleChange::G4VParticleChange(const G4VParticleChange &right):
|
||||
theNumberOfSecondaries(0),
|
||||
theSizeOftheListOfSecondaries(G4TrackFastVectorSize),
|
||||
theStatusChange(fAlive),
|
||||
theSteppingControlFlag(NormalCondition),
|
||||
theLocalEnergyDeposit(0.0),
|
||||
verboseLevel(1),
|
||||
theParentWeight(1.0),
|
||||
fSetSecondaryWeightByProcess(false)
|
||||
{
|
||||
debugFlag = false;
|
||||
#ifdef G4VERBOSE
|
||||
// activate CHeckIt if in VERBOSE mode
|
||||
debugFlag = true;
|
||||
#endif
|
||||
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
fSetParentWeightByProcess = right.fSetParentWeightByProcess;
|
||||
}
|
||||
|
||||
|
||||
G4VParticleChange & G4VParticleChange::operator=(const G4VParticleChange &right)
|
||||
{
|
||||
debugFlag = false;
|
||||
#ifdef G4VERBOSE
|
||||
// activate CHeckIt if in VERBOSE mode
|
||||
debugFlag = true;
|
||||
#endif
|
||||
if (this != &right)
|
||||
{
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
fSetParentWeightByProcess = right.fSetParentWeightByProcess;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4bool G4VParticleChange::operator==(const G4VParticleChange &right) const
|
||||
{
|
||||
return (this == (G4VParticleChange *) &right);
|
||||
}
|
||||
|
||||
|
||||
G4bool G4VParticleChange::operator!=(const G4VParticleChange &right) const
|
||||
{
|
||||
return (this != (G4VParticleChange *) &right);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for printing messages
|
||||
//
|
||||
|
||||
void G4VParticleChange::DumpInfo() const
|
||||
{
|
||||
|
||||
// Show header
|
||||
G4cout.precision(3);
|
||||
G4cout << " -----------------------------------------------"
|
||||
<< G4endl;
|
||||
G4cout << " G4ParticleChange Information " << std::setw(20) << G4endl;
|
||||
G4cout << " -----------------------------------------------"
|
||||
<< G4endl;
|
||||
|
||||
G4cout << " # of 2ndaries : "
|
||||
<< std::setw(20) << theNumberOfSecondaries
|
||||
<< G4endl;
|
||||
|
||||
if (theNumberOfSecondaries >0) {
|
||||
G4cout << " Pointer to 2ndaries : "
|
||||
<< std::setw(20) << GetSecondary(0)
|
||||
<< G4endl;
|
||||
G4cout << " (Showed only 1st one)"
|
||||
<< G4endl;
|
||||
}
|
||||
G4cout << " -----------------------------------------------"
|
||||
<< G4endl;
|
||||
|
||||
G4cout << " Energy Deposit (MeV): "
|
||||
<< std::setw(20) << theLocalEnergyDeposit/MeV
|
||||
<< G4endl;
|
||||
|
||||
G4cout << " Track Status : "
|
||||
<< std::setw(20);
|
||||
if( theStatusChange == fAlive ){
|
||||
G4cout << " Alive";
|
||||
} else if( theStatusChange == fStopButAlive ){
|
||||
G4cout << " StopButAlive";
|
||||
} else if( theStatusChange == fStopAndKill ){
|
||||
G4cout << " StopAndKill";
|
||||
} else if( theStatusChange == fKillTrackAndSecondaries ){
|
||||
G4cout << " KillTrackAndSecondaries";
|
||||
} else if( theStatusChange == fSuspend ){
|
||||
G4cout << " Suspend";
|
||||
} else if( theStatusChange == fPostponeToNextEvent ){
|
||||
G4cout << " PostponeToNextEvent";
|
||||
}
|
||||
G4cout << G4endl;
|
||||
G4cout << " True Path Length (mm) : "
|
||||
<< std::setw(20) << theTrueStepLength/mm
|
||||
<< G4endl;
|
||||
G4cout << " Stepping Control : "
|
||||
<< std::setw(20) << theSteppingControlFlag
|
||||
<< G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
G4bool G4VParticleChange::CheckIt(const G4Track& )
|
||||
{
|
||||
|
||||
G4bool exitWithError = false;
|
||||
G4double accuracy;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// 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
|
||||
#ifdef G4VERBOSE
|
||||
if (! itsOK ){
|
||||
G4cout << " G4VParticleChange::CheckIt " <<G4endl;
|
||||
DumpInfo();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Exit with error
|
||||
if (exitWithError) {
|
||||
G4Exception("G4VParticleChange::CheckIt",
|
||||
"100",
|
||||
EventMustBeAborted,
|
||||
"step length and/or energy deposit was illegal");
|
||||
}
|
||||
|
||||
// correction
|
||||
if ( !itsOKforStepLength ) {
|
||||
theTrueStepLength = (1.e-12)*mm;
|
||||
}
|
||||
if ( !itsOKforEnergy ) {
|
||||
theLocalEnergyDeposit = 0.0;
|
||||
}
|
||||
return itsOK;
|
||||
}
|
||||
|
||||
G4bool G4VParticleChange::CheckSecondary(G4Track& aTrack)
|
||||
{
|
||||
G4bool exitWithError = false;
|
||||
G4double accuracy;
|
||||
|
||||
// MomentumDirection should be unit vector
|
||||
G4bool itsOKforMomentum = true;
|
||||
accuracy = abs((aTrack.GetMomentumDirection()).mag2()-1.0);
|
||||
if (accuracy > accuracyForWarning) {
|
||||
#ifdef G4VERBOSE
|
||||
G4cout << " G4VParticleChange::CheckSecondary : ";
|
||||
G4cout << "the Momentum direction is not unit vector !!" << G4endl;
|
||||
G4cout << " Difference: " << accuracy << G4endl;
|
||||
#endif
|
||||
itsOKforMomentum = false;
|
||||
if (accuracy > accuracyForException) exitWithError = true;
|
||||
}
|
||||
|
||||
// Kinetic Energy should not be negative
|
||||
G4bool itsOKforEnergy;
|
||||
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
|
||||
itsOKforEnergy = false;
|
||||
if (accuracy < accuracyForException) { exitWithError = false;}
|
||||
else { exitWithError = true; }
|
||||
}
|
||||
G4bool itsOKforProperTime = true;
|
||||
//accuracy = (aTrack.GetProperTime())/ns;
|
||||
// if (accuracy > accuracyForWarning) {
|
||||
#ifdef G4VERBOSE
|
||||
// G4cout << " G4VParticleChange::CheckSecondary : ";
|
||||
// G4cout << "the proper time goes back !!" << G4endl;
|
||||
// G4cout << " Difference: " << accuracy << "[ns] " <<G4endl;
|
||||
#endif
|
||||
// itsOKforProperTime = false;
|
||||
// if (accuracy > accuracyForException) exitWithError = true;
|
||||
//}
|
||||
|
||||
// Exit with error
|
||||
if (exitWithError) {
|
||||
G4Exception("G4VParticleChange::CheckSecondary",
|
||||
"10",
|
||||
EventMustBeAborted,
|
||||
"momentum, energy and/or proper time was illegal");
|
||||
}
|
||||
|
||||
G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforProperTime;
|
||||
|
||||
//correction
|
||||
if (!itsOKforMomentum) {
|
||||
G4double vmag = (aTrack.GetMomentumDirection()).mag();
|
||||
aTrack.SetMomentumDirection((1./vmag)*aTrack.GetMomentumDirection());
|
||||
}
|
||||
//if (!itsOKforProperTime) {
|
||||
// aTrack.SetProperTime(0.0);
|
||||
//}
|
||||
if (!itsOKforEnergy) {
|
||||
aTrack.SetKineticEnergy(0.0);
|
||||
}
|
||||
|
||||
return itsOK;
|
||||
}
|
||||
|
||||
|
||||
G4double G4VParticleChange::GetAccuracyForWarning() const
|
||||
{
|
||||
return accuracyForWarning;
|
||||
}
|
||||
|
||||
G4double G4VParticleChange::GetAccuracyForException() const
|
||||
{
|
||||
return accuracyForException;
|
||||
}
|
||||
|
||||
void G4VParticleChange::AddSecondary(G4Track *aTrack)
|
||||
{
|
||||
if (debugFlag) CheckSecondary(*aTrack);
|
||||
|
||||
if (!fSetSecondaryWeightByProcess){
|
||||
// pass the weight of parent track
|
||||
aTrack->SetWeight(theParentWeight);
|
||||
}
|
||||
|
||||
// add a secondary after size check
|
||||
if (theSizeOftheListOfSecondaries > theNumberOfSecondaries) {
|
||||
theListOfSecondaries->SetElement(theNumberOfSecondaries, aTrack);
|
||||
theNumberOfSecondaries++;
|
||||
} 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;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user