Index: /trunk/source/track/GNUmakefile
===================================================================
--- /trunk/source/track/GNUmakefile	(revision 826)
+++ /trunk/source/track/GNUmakefile	(revision 826)
@@ -0,0 +1,34 @@
+# $Id: GNUmakefile,v 1.6 2006/04/28 13:45:48 asaim 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/magneticfield/include \
+            -I$(G4BASE)/geometry/management/include
+
+include $(G4INSTALL)/config/common.gmk
+
+.PHONY: global
+ 
+global: lib
+
Index: /trunk/source/track/History
===================================================================
--- /trunk/source/track/History	(revision 826)
+++ /trunk/source/track/History	(revision 826)
@@ -0,0 +1,439 @@
+$Id: History,v 1.100 2008/01/12 12:00:25 kurasige 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 *
+     ----------------------------------------------------------
+Jan. 12, 2008 Hisaya Kurashige (track-V09-01-00)
+- add non-ionizing energy loss to EM physics (V.Ivanchenko)
+
+Oct. 02, 2007 Hisaya Kurashige (track-V09-00-02)
+- Add protection in G4Track::GetVolume to avoid core dump
+
+Aug. 07, 2007 Hisaya Kurashige (track-V09-00-01)
+- Add  get method for non-ionizing energy deposit in G4Step
+
+
+Mar 30, 07 Hisaya Kurashige (track-V08-02-02)
+- Fix weight treatment in G4ParticleChange
+
+Mar 26, 07 Hisaya Kurashige (track-V08-02-01)
+- Added Non-Ionizing Energy Deposit in G4Step and G4VParticleChange
+
+Mar 11, 07 Hisaya Kurashige (track-V08-02-00)
+- Added magnetic moment in G4DynamicParticle (co-work with particles-V08-02-00)
+- Fixed treatment of parent's weight in G4ParticleChange 
+
+Nov  3, 06 J.Apostolakis (track-V08-01-04)
+- New methods first/lastStepInVolume flag in G4Step, G4VParticleChange  by Hisaya
+- Revised UpdateStepForPostStep by John Apostolakis
+
+Oct 31, 06 G.Cosmo (track-V08-01-03)
+- Made operator=() inline.
+
+Aug 29, 06 H.Kurashige (track-V08-01-02)
+- Add methods for setting polarization and modifying weight
+    for G4ParticleChangeFoeGamma and  G4ParticleChangeForLoss 
+          (V.Ivanchenko)
+
+July 17, 06 M.Asai (track-V08-01-01)
+- Re-tagged for G4Step and G4TrackVector only.
+
+June 09, 06 M.Asai (track-V08-01-00)
+- tagged for G4FieldTrackUpdator, G4Step and G4TrackVector.
+
+June 09, 06 T.Sasaki
+- G4Step now has secondary vector
+- G4TrackVector was moved from tracking category 
+
+June 09, 06 M.Asai
+- Introducing G4FieldTrackUpdator class.
+- GNUmakefile now includes geometry/magneticfield
+
+June 07, 06 V.Ivanchenko (track-V08-00-03)
+-  G4ParticleChangeForLoss - remove momentum change AlongStep
+
+Mar. 29, 06 H.Kurashige (track-V08-00-02)
+-  Improve G4Track::GetVelocity for optical photon 
+
+Feb. 08, 06 H.Kurashige (track-V08-00-01)
+-  add ProposeMomentumDirection AlongStep and ProposeWeight PostStep in 
+    G4ParticleChangeForLoss (V.Ivantchenko)
+
+Dec. 20, 05 .Kurashige (track-V08-00-00)
+-  G4ParticleChangeForRadDecay is now derived from G4ParticleChangeForDecay
+
+Dec 05, 05 mma (track-V07-01-02)
+- G4ParticleChangeForGamma : apply UpdateStepForPostStep in any case
+  
+Nov 26, 05 H.Kurashige (track-V07-01-01)
+- Fix GetVelocity : use the material pointer in PreStepPoint
+
+May 30, 05 V.Ivantchenko (track-V07-00-02)
+- Fix in G4ParticleChangeForGamma : add UpdateStepForAtRest method
+
+May 12, 05 P.Gumplinger (track-V07-00-01)
+- Fix GetVelocity (bug report #741) courtesy of  Horton-Smith
+
+Apr. 15, 05 V.Ivantchenko (track-V07-00-00)
+- Add a new class of G4ParticleChangeForGamma
+- Modify 4ParticleChangeForLoss
+ 
+Dec. 02, 04 H.Kurashige (track-V06-02-04)
+- migration to cmath 
+
+Nov. 25, 04 M.Asai (track-V06-02-03)
+- Fix destructor of G4VUserTrackInformation.
+
+Oct. 19, 04 H.Kurashige (track-V06-02-02) 
+- Remove obsolete methods from G4ParticleChange
+
+Sep. 17, 04 P.Gumplinger (track-V06-02-01)
+- Modified G4ParticleChangeForDecay (add thePolarizationChange and methods)
+
+Aug. 27, 04 M.Asai (track-V06-02-00)
+- A pointer to sensitive detector is added in G4StepPoint and
+  G4ParticleChangeForTransport.
+- G4Step is taking care of setting the above pointer.
+
+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.
Index: /trunk/source/track/include/G4FieldTrackUpdator.hh
===================================================================
--- /trunk/source/track/include/G4FieldTrackUpdator.hh	(revision 826)
+++ /trunk/source/track/include/G4FieldTrackUpdator.hh	(revision 826)
@@ -0,0 +1,70 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4FieldTrackUpdator.hh,v 1.2 2006/12/13 15:49:43 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+//   M. Asai - first implementation Apr/28/2006
+//
+//---------------------------------------------------------------
+//
+// G4FieldTrackUpdator.hh
+//
+//---------------------------------------------------------------
+
+#ifndef G4FieldTrackUpdator_h
+#define G4FieldTrackUpdator_h 1
+
+class G4FieldTrack;
+class G4Track;
+
+class G4FieldTrackUpdator 
+{
+ private:
+  G4FieldTrackUpdator() {;}
+  ~G4FieldTrackUpdator() {;}
+
+ public:
+  static G4FieldTrack* CreateFieldTrack(const G4Track*);
+  static void Update(G4FieldTrack*,const G4Track*);
+};
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /trunk/source/track/include/G4ForceCondition.hh
===================================================================
--- /trunk/source/track/include/G4ForceCondition.hh	(revision 826)
+++ /trunk/source/track/include/G4ForceCondition.hh	(revision 826)
@@ -0,0 +1,71 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ForceCondition.hh,v 1.5 2006/06/29 21:14:11 gunter 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
+
+
Index: /trunk/source/track/include/G4GPILSelection.hh
===================================================================
--- /trunk/source/track/include/G4GPILSelection.hh	(revision 826)
+++ /trunk/source/track/include/G4GPILSelection.hh	(revision 826)
@@ -0,0 +1,66 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4GPILSelection.hh,v 1.4 2006/06/29 21:14:13 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+// 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
+
+
Index: /trunk/source/track/include/G4ParticleChange.hh
===================================================================
--- /trunk/source/track/include/G4ParticleChange.hh	(revision 826)
+++ /trunk/source/track/include/G4ParticleChange.hh	(revision 826)
@@ -0,0 +1,278 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChange.hh,v 1.13 2007/03/11 07:19:06 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// ------------------------------------------------------------
+//	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
+//   Rename SetXXX methods to ProposeXXX   DynamicCharge  Oct. 2005 H.Kurashige
+//   Add get/ProposeMagneticMoment                  Mar 2007 H.Kurashige
+//   Fix treatment of weight                        Mar 2007 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 G4DynamicParticle
+
+    G4double GetMagneticMoment() const;
+    void ProposeMagneticMoment(G4double finalMagneticMoment);
+    //   Get/Propose the final MagneticMoment in G4DynamicParticle
+  
+    G4double GetWeight() const;
+    void ProposeWeight(G4double finalWeight);
+    //   Get/Propose the final Weight of the parent 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:
+    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
+    
+    // Obsolete   Mar 2007
+    // 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
+ 
+    G4double theMagneticMomentChange;
+    //  The Changed (final) MagneticMoment of a given track
+  
+    const G4Track* theCurrentTrack;
+    
+  public:
+    // for Debug 
+    virtual G4bool CheckIt(const G4Track&);
+};
+
+#include "G4ParticleChange.icc"
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /trunk/source/track/include/G4ParticleChange.icc
===================================================================
--- /trunk/source/track/include/G4ParticleChange.icc	(revision 826)
+++ /trunk/source/track/include/G4ParticleChange.icc	(revision 826)
@@ -0,0 +1,212 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChange.icc,v 1.14 2007/03/11 07:19:06 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+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::GetMagneticMoment() const
+{
+  return theMagneticMomentChange;
+}
+ 
+inline
+  void G4ParticleChange::ProposeMagneticMoment(G4double finalMagneticMoment)
+{
+  theMagneticMomentChange = finalMagneticMoment;
+}
+  
+inline 
+  G4double  G4ParticleChange::GetWeight() const
+{
+  return  G4VParticleChange::GetParentWeight();
+}
+
+inline 
+  void G4ParticleChange::ProposeWeight(G4double w)
+{
+  G4VParticleChange::ProposeParentWeight(w);
+}
+
+inline  
+  G4ThreeVector G4ParticleChange::CalcMomentum(G4double          energy,
+			    	              G4ThreeVector   direction,
+			                      G4double           mass      
+					      ) const
+{
+  G4double tMomentum = std::sqrt(energy*energy + 2*energy*mass);
+  return direction*tMomentum; 
+}
+
Index: /trunk/source/track/include/G4ParticleChangeForDecay.hh
===================================================================
--- /trunk/source/track/include/G4ParticleChangeForDecay.hh	(revision 826)
+++ /trunk/source/track/include/G4ParticleChangeForDecay.hh	(revision 826)
@@ -0,0 +1,175 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForDecay.hh,v 1.9 2006/06/29 21:14:19 gunter Exp $
+// GEANT4 tag $Name:  $
+
+//
+// 
+// ------------------------------------------------------------
+//	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:
+    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;
+}
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /trunk/source/track/include/G4ParticleChangeForGamma.hh
===================================================================
--- /trunk/source/track/include/G4ParticleChangeForGamma.hh	(revision 826)
+++ /trunk/source/track/include/G4ParticleChangeForGamma.hh	(revision 826)
@@ -0,0 +1,238 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForGamma.hh,v 1.9 2008/01/11 19:57:12 vnivanch Exp $
+// GEANT4 tag $Name:  $
+//
+//
+// ------------------------------------------------------------
+//	GEANT 4 class header file
+//
+//
+// ------------------------------------------------------------
+// 15 April 2005 V.Ivanchenko for gamma EM processes
+//
+// Modified:
+// 30.05.05 : add   UpdateStepForAtRest (V.Ivanchenko)
+// 04.12.05 : apply UpdateStepForPostStep in any case (mma) 
+// 26.08.06 : Add->Set polarization; 
+//            add const method to access track; 
+//            add weight modification (V.Ivanchenko) 
+//
+// ------------------------------------------------------------
+//
+//  Class Description
+//  This class is a concrete class for ParticleChange for gamma processes
+//
+#ifndef G4ParticleChangeForGamma_h
+#define G4ParticleChangeForGamma_h 1
+
+#include "globals.hh"
+#include "G4ios.hh"
+#include "G4VParticleChange.hh"
+
+class G4DynamicParticle;
+
+class G4ParticleChangeForGamma: public G4VParticleChange
+{
+public:
+  // default constructor
+  G4ParticleChangeForGamma();
+
+  // destructor
+  virtual ~G4ParticleChangeForGamma();
+
+  // with description
+  // ----------------------------------------------------
+  // --- the following methods are for updating G4Step -----
+
+  G4Step* UpdateStepForAtRest(G4Step* pStep);
+  G4Step* UpdateStepForPostStep(G4Step* Step);
+  // A physics process gives the final state of the particle
+  // based on information of G4Track
+
+  void InitializeForPostStep(const G4Track&);
+  //Initialize all propoerties by using G4Track information
+
+  void AddSecondary(G4DynamicParticle* aParticle);
+  // Add next secondary
+
+  G4double GetProposedKineticEnergy() const;
+  void SetProposedKineticEnergy(G4double proposedKinEnergy);
+  // Get/Set the final kinetic energy of the current particle.
+
+  const G4ThreeVector& GetProposedMomentumDirection() 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& GetProposedPolarization() const;
+  void ProposePolarization(const G4ThreeVector& dir);
+  void ProposePolarization(G4double Px, G4double Py, G4double Pz);
+
+  const G4Track* GetCurrentTrack() const;
+
+  virtual void DumpInfo() const;
+
+  // for Debug
+  virtual G4bool CheckIt(const G4Track&);
+
+protected:
+  // hide copy constructor and assignment operaor as protected
+  G4ParticleChangeForGamma(const G4ParticleChangeForGamma &right);
+  G4ParticleChangeForGamma & operator=(const G4ParticleChangeForGamma &right);
+
+private:
+
+  const G4Track* currentTrack;
+  // The pointer to G4Track
+
+  G4double proposedKinEnergy;
+  //  The final kinetic energy of the current particle.
+
+  G4ThreeVector proposedMomentumDirection;
+  //  The final momentum direction of the current particle.
+
+  G4ThreeVector proposedPolarization;
+  //  The final polarization of the current particle.
+};
+
+// ------------------------------------------------------------
+
+inline G4double G4ParticleChangeForGamma::GetProposedKineticEnergy() const
+{
+  return proposedKinEnergy;
+}
+
+inline void G4ParticleChangeForGamma::SetProposedKineticEnergy(G4double energy)
+{
+  proposedKinEnergy = energy;
+}
+
+inline
+ const G4ThreeVector& G4ParticleChangeForGamma::GetProposedMomentumDirection() const
+{
+  return proposedMomentumDirection;
+}
+
+inline
+ void G4ParticleChangeForGamma::ProposeMomentumDirection(const G4ThreeVector& dir)
+{
+  proposedMomentumDirection = dir;
+}
+
+inline
+ void G4ParticleChangeForGamma::ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
+{
+  proposedMomentumDirection.setX(Px);
+  proposedMomentumDirection.setY(Py);
+  proposedMomentumDirection.setZ(Pz);
+}
+
+inline const G4Track* G4ParticleChangeForGamma::GetCurrentTrack() const
+{
+  return currentTrack;
+}
+
+inline
+ const G4ThreeVector& G4ParticleChangeForGamma::GetProposedPolarization() const
+{
+  return proposedPolarization;
+}
+
+inline
+ void G4ParticleChangeForGamma::ProposePolarization(const G4ThreeVector& dir)
+{
+  proposedPolarization = dir;
+}
+
+inline
+ void G4ParticleChangeForGamma::ProposePolarization(G4double Px, G4double Py, G4double Pz)
+{
+  proposedPolarization.setX(Px);
+  proposedPolarization.setY(Py);
+  proposedPolarization.setZ(Pz);
+}
+
+inline void G4ParticleChangeForGamma::InitializeForPostStep(const G4Track& track)
+{
+  theStatusChange = track.GetTrackStatus();
+  theLocalEnergyDeposit = 0.0;
+  theNonIonizingEnergyDeposit = 0.0;
+  InitializeSecondaries(track);
+  theParentWeight = track.GetWeight();
+  proposedKinEnergy = track.GetKineticEnergy();
+  proposedMomentumDirection = track.GetMomentumDirection();
+  proposedPolarization = track.GetPolarization();
+  currentTrack = &track;
+}
+
+//----------------------------------------------------------------
+// method for updating G4Step
+//
+
+inline G4Step* G4ParticleChangeForGamma::UpdateStepForAtRest(G4Step* pStep)
+{
+  pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
+  pStep->SetStepLength( 0.0 );
+  if (!fSetParentWeightByProcess)
+    pStep->GetPostStepPoint()->SetWeight( theParentWeight );
+  return pStep;
+}
+
+inline G4Step* G4ParticleChangeForGamma::UpdateStepForPostStep(G4Step* pStep)
+{
+  G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
+  pPostStepPoint->SetKineticEnergy( proposedKinEnergy );
+  pPostStepPoint->SetMomentumDirection( proposedMomentumDirection );
+  pPostStepPoint->SetPolarization( proposedPolarization );
+
+  // update weight
+  // this feature is commented out, it should be overwritten in case
+  // if energy loss processes will use biasing
+  if (!fSetParentWeightByProcess)
+    pPostStepPoint->SetWeight( theParentWeight );
+  
+  pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
+  pStep->AddNonIonizingEnergyDeposit( theNonIonizingEnergyDeposit );
+  return pStep;
+}
+
+inline void G4ParticleChangeForGamma::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
+
Index: /trunk/source/track/include/G4ParticleChangeForLoss.hh
===================================================================
--- /trunk/source/track/include/G4ParticleChangeForLoss.hh	(revision 826)
+++ /trunk/source/track/include/G4ParticleChangeForLoss.hh	(revision 826)
@@ -0,0 +1,314 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForLoss.hh,v 1.20 2008/01/11 19:57:12 vnivanch Exp $
+// GEANT4 tag $Name:  $
+//
+//
+// ------------------------------------------------------------
+//	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
+//   15.04.05 V.Ivanchenko inline update methods
+//   30.01.06 V.Ivanchenko add ProposedMomentumDirection for AlongStep
+//                         and ProposeWeight for PostStep
+//   07.06.06 V.Ivanchenko RemoveProposedMomentumDirection from AlongStep
+//   28.08.06 V.Ivanchenko Add access to current track and polarizaion
+//
+// ------------------------------------------------------------
+//
+//  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 -----
+
+  G4Step* UpdateStepForAlongStep(G4Step* Step);
+  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.
+
+  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.
+
+  const G4ThreeVector& GetProposedPolarization() const;
+  void ProposePolarization(const G4ThreeVector& dir);
+  void ProposePolarization(G4double Px, G4double Py, G4double Pz);
+
+  const G4Track* GetCurrentTrack() const;
+
+  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.
+
+  G4ThreeVector proposedPolarization;
+  //  The final polarization 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 const G4Track* G4ParticleChangeForLoss::GetCurrentTrack() const
+{
+  return currentTrack;
+}
+
+inline
+ const G4ThreeVector& G4ParticleChangeForLoss::GetProposedPolarization() const
+{
+  return proposedPolarization;
+}
+
+inline
+ void G4ParticleChangeForLoss::ProposePolarization(const G4ThreeVector& dir)
+{
+  proposedPolarization = dir;
+}
+
+inline
+ void G4ParticleChangeForLoss::ProposePolarization(G4double Px, G4double Py, G4double Pz)
+{
+  proposedPolarization.setX(Px);
+  proposedPolarization.setY(Py);
+  proposedPolarization.setZ(Pz);
+}
+
+inline void G4ParticleChangeForLoss::InitializeForAlongStep(const G4Track& track)
+{
+  theStatusChange = track.GetTrackStatus();
+  theLocalEnergyDeposit = 0.0;
+  theNonIonizingEnergyDeposit = 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;
+  theNonIonizingEnergyDeposit = 0.0;
+  InitializeSecondaries(track);
+  theParentWeight = track.GetWeight();
+  proposedKinEnergy = track.GetKineticEnergy();
+  currentCharge = track.GetDynamicParticle()->GetCharge();
+  proposedMomentumDirection = track.GetMomentumDirection();
+  proposedPolarization = track.GetPolarization();
+  currentTrack = &track;
+}
+
+//----------------------------------------------------------------
+// methods for updating G4Step
+//
+
+inline G4Step* G4ParticleChangeForLoss::UpdateStepForAlongStep(G4Step* pStep)
+{
+  G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
+
+  // accumulate change of the kinetic energy
+  G4double kinEnergy = pPostStepPoint->GetKineticEnergy() +
+    (proposedKinEnergy - pStep->GetPreStepPoint()->GetKineticEnergy());
+
+  // update kinetic energy and charge
+  if (kinEnergy < DBL_MIN) {
+    theLocalEnergyDeposit += kinEnergy;
+    kinEnergy = 0.0;
+  } else {
+    pPostStepPoint->SetCharge( currentCharge );
+  }
+  pPostStepPoint->SetKineticEnergy( kinEnergy );
+
+  // update weight 
+  // this feature is commented out, it should be overwritten in case
+  // if energy loss processes will use biasing
+  //  G4double newWeight = theParentWeight*(pPostStepPoint->GetWeight())
+  //  /(pPreStepPoint->GetWeight());
+  // pPostStepPoint->SetWeight( newWeight );
+  pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
+  pStep->AddNonIonizingEnergyDeposit( theNonIonizingEnergyDeposit );
+  return pStep;
+}
+
+inline G4Step* G4ParticleChangeForLoss::UpdateStepForPostStep(G4Step* pStep)
+{
+  G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
+  pPostStepPoint->SetCharge( currentCharge );
+  pPostStepPoint->SetMomentumDirection( proposedMomentumDirection );
+  pPostStepPoint->SetKineticEnergy( proposedKinEnergy );
+  pPostStepPoint->SetPolarization( proposedPolarization );
+  // update weight if process cannot do that
+  if (!fSetParentWeightByProcess)
+    pPostStepPoint->SetWeight( theParentWeight );
+
+  pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
+  pStep->AddNonIonizingEnergyDeposit( theNonIonizingEnergyDeposit );
+  return pStep;
+}
+
+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
+
Index: /trunk/source/track/include/G4ParticleChangeForMSC.hh
===================================================================
--- /trunk/source/track/include/G4ParticleChangeForMSC.hh	(revision 826)
+++ /trunk/source/track/include/G4ParticleChangeForMSC.hh	(revision 826)
@@ -0,0 +1,122 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForMSC.hh,v 1.9 2006/06/29 21:14:25 gunter 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:
+    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
+
Index: /trunk/source/track/include/G4ParticleChangeForMSC.icc
===================================================================
--- /trunk/source/track/include/G4ParticleChangeForMSC.icc	(revision 826)
+++ /trunk/source/track/include/G4ParticleChangeForMSC.icc	(revision 826)
@@ -0,0 +1,96 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForMSC.icc,v 1.7 2006/06/29 21:14:27 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+
+
+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();
+}
+
Index: /trunk/source/track/include/G4ParticleChangeForRadDecay.hh
===================================================================
--- /trunk/source/track/include/G4ParticleChangeForRadDecay.hh	(revision 826)
+++ /trunk/source/track/include/G4ParticleChangeForRadDecay.hh	(revision 826)
@@ -0,0 +1,107 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForRadDecay.hh,v 1.7 2006/06/29 21:14:29 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// ------------------------------------------------------------
+//	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 "G4ParticleChangeForDecay.hh"
+
+class G4ParticleChangeForRadDecay: public G4ParticleChangeForDecay
+{ 
+  public:
+    // default constructor
+    G4ParticleChangeForRadDecay(){}
+
+    // destructor
+    virtual ~G4ParticleChangeForRadDecay(){}
+
+  protected:
+    // hide copy constructor and assignment operaor as protected
+    G4ParticleChangeForRadDecay(const G4ParticleChangeForRadDecay &) : G4ParticleChangeForDecay() {}
+    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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /trunk/source/track/include/G4ParticleChangeForTransport.hh
===================================================================
--- /trunk/source/track/include/G4ParticleChangeForTransport.hh	(revision 826)
+++ /trunk/source/track/include/G4ParticleChangeForTransport.hh	(revision 826)
@@ -0,0 +1,147 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForTransport.hh,v 1.16 2006/06/29 21:14:31 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// ------------------------------------------------------------
+//	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 G4VSensitiveDetector;
+
+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.
+
+    G4VSensitiveDetector* GetSensitiveDetectorInTouchable() const;
+    void SetSensitiveDetectorInTouchable(G4VSensitiveDetector* fSensitiveDetector);
+    //  Get/Set the sensitive detector in the touchable of the current particle.
+
+    G4bool GetMomentumChanged() const;
+    void SetMomentumChanged(G4bool b);
+
+  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;
+    G4VSensitiveDetector* theSensitiveDetectorChange;
+     // The material (and MaterialCutsCouple) where given track
+     // currently locates
+
+  private:
+    std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer;
+};
+
+#include "G4ParticleChangeForTransport.icc"
+
+#endif
+
+
+
+
+
+
Index: /trunk/source/track/include/G4ParticleChangeForTransport.icc
===================================================================
--- /trunk/source/track/include/G4ParticleChangeForTransport.icc	(revision 826)
+++ /trunk/source/track/include/G4ParticleChangeForTransport.icc	(revision 826)
@@ -0,0 +1,149 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForTransport.icc,v 1.13 2006/06/29 21:14:33 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+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 
+ void G4ParticleChangeForTransport::SetSensitiveDetectorInTouchable(G4VSensitiveDetector* fSensitiveDetector)
+{
+  theSensitiveDetectorChange =   fSensitiveDetector;
+}
+
+inline 
+ G4VSensitiveDetector* G4ParticleChangeForTransport::GetSensitiveDetectorInTouchable() const
+{
+  return theSensitiveDetectorChange;
+}
+
+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;
+}
+
+
+
+
+
+
Index: /trunk/source/track/include/G4Step.hh
===================================================================
--- /trunk/source/track/include/G4Step.hh	(revision 826)
+++ /trunk/source/track/include/G4Step.hh	(revision 826)
@@ -0,0 +1,222 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4Step.hh,v 1.19 2008/01/12 12:00:25 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+// 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
+//   add nonIonizingEnergyLoss                      26 Mar. 2007 H.Kurashige 
+//
+//   Repository test - Dennis Wright
+//
+#ifndef G4Step_h
+#define G4Step_h 1
+
+#include <stdlib.h>                 // Include from 'system'
+#include <cmath>                    // 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.
+#include "G4TrackVector.hh"           // Include from 'tracking'
+
+////////////
+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);
+    // 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. 
+
+   // total energy deposit 
+   G4double GetTotalEnergyDeposit() const;
+   void SetTotalEnergyDeposit(G4double value);
+
+   // total non-ionizing energy deposit 
+   G4double GetNonIonizingEnergyDeposit() const;
+   void SetNonIonizingEnergyDeposit(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();
+
+   // manipulation of non-ionizng energy deposit 
+   void AddNonIonizingEnergyDeposit(G4double value);
+   void ResetNonIonizingEnergyDeposit();
+
+
+  // Get/Set/Clear flag for initial/last step
+   G4bool IsFirstStepInVolume() const;
+   G4bool IsLastStepInVolume() const;
+
+   void SetFirstStepFlag();
+   void ClearFirstStepFlag();
+   void SetLastStepFlag();
+   void ClearLastStepFlag();
+
+// 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
+
+   G4double fNonIonizingEnergyDeposit;
+     // Accummulated non-ionizing 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
+
+  // flag for initial/last step
+   G4bool fFirstStepInVolume;
+   G4bool fLastStepInVolume;
+
+// Secondary buckets
+public:
+   G4TrackVector* GetSecondary() const;
+   G4TrackVector* GetfSecondary();
+   G4TrackVector* NewSecondaryVector();
+   void DeleteSecondaryVector();
+   void SetSecondary( G4TrackVector* value);
+private:    
+   G4TrackVector* fSecondary;
+
+  // 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
Index: /trunk/source/track/include/G4Step.icc
===================================================================
--- /trunk/source/track/include/G4Step.icc	(revision 826)
+++ /trunk/source/track/include/G4Step.icc	(revision 826)
@@ -0,0 +1,303 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4Step.icc,v 1.18 2007/08/08 05:58:21 kurasige Exp $
+// GEANT4 tag $Name: geant4-09-01-patch-02 $
+//
+//
+//---------------------------------------------------------------
+//
+//-----------------------------------------------------------------
+//  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 
+ G4double G4Step::GetNonIonizingEnergyDeposit() const
+ { 
+   return fNonIonizingEnergyDeposit; 
+ }
+
+inline 
+ void G4Step::SetNonIonizingEnergyDeposit(G4double value)
+ { 
+   fNonIonizingEnergyDeposit = value;   
+ }
+
+inline 
+ void G4Step::AddTotalEnergyDeposit(G4double value)
+ {
+   fTotalEnergyDeposit += value;   
+ }
+
+inline 
+ void G4Step::ResetTotalEnergyDeposit()
+ { 
+   fTotalEnergyDeposit = 0.; 
+ }
+
+inline 
+ void G4Step::AddNonIonizingEnergyDeposit(G4double value)
+ { 
+   fNonIonizingEnergyDeposit += value;   
+ }
+
+inline 
+ void G4Step::ResetNonIonizingEnergyDeposit()
+ { 
+   fNonIonizingEnergyDeposit = 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.;
+   fNonIonizingEnergyDeposit = 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->SetSensitiveDetector( fpTrack->GetTouchable()->GetVolume()->GetLogicalVolume()->GetSensitiveDetector());
+   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());
+}
+
+inline G4TrackVector* G4Step::GetfSecondary()  {
+   return fSecondary;
+    }
+inline G4TrackVector* G4Step::GetSecondary() const {
+   return fSecondary;
+    }
+inline void G4Step::SetSecondary(G4TrackVector* value)  {
+   fSecondary=value;
+    }
+inline G4TrackVector* G4Step::NewSecondaryVector()  {
+   fSecondary=new G4TrackVector();
+   return fSecondary;
+    }
+inline void G4Step::DeleteSecondaryVector()  {
+   delete fSecondary;
+    }
+
+inline G4bool G4Step::IsFirstStepInVolume() const
+{
+   return fFirstStepInVolume;
+}
+
+inline G4bool G4Step::IsLastStepInVolume() const
+{
+   return fLastStepInVolume;
+}
+
+
+ inline  void G4Step::SetFirstStepFlag()
+{
+   fFirstStepInVolume = true;
+}
+  
+ inline  void G4Step::ClearFirstStepFlag()
+{
+   fFirstStepInVolume = false;
+}
+
+ inline  void G4Step::SetLastStepFlag()
+{
+   fLastStepInVolume = true;
+}
+  
+ inline  void G4Step::ClearLastStepFlag()
+{
+   fLastStepInVolume = false;
+}
+
Index: /trunk/source/track/include/G4StepPoint.hh
===================================================================
--- /trunk/source/track/include/G4StepPoint.hh	(revision 826)
+++ /trunk/source/track/include/G4StepPoint.hh	(revision 826)
@@ -0,0 +1,222 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4StepPoint.hh,v 1.18 2007/03/11 07:19:06 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+// 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
+//     Hisaya Kurashige  
+//
+// ---------------------------------------------------------------
+//   Added fpMaterial                       16 FEb. 2000  H.Kurahige
+//   Added fpMaterialCutsCouple              8 Oct. 2002  H.Kurahige
+//   Added fMagneticMoment                      Mar 2007  H.Kurashige
+
+#ifndef G4StepPoint_h
+#define G4StepPoint_h 1
+
+#include "globals.hh"                // Include from 'global'
+#include <cmath>                    // Include from 'system'
+#include "G4Allocator.hh"            // Include from 'global'
+#include "G4ThreeVector.hh"          // Include from 'geometry'
+#include "G4VPhysicalVolume.hh"      // Include from 'geometry'
+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 G4VSensitiveDetector;
+/////////////////
+class G4StepPoint
+///////////////// 
+{
+
+//--------
+   public:
+
+
+// Constructor/Destructor
+   G4StepPoint();
+
+   ~G4StepPoint(){}
+
+//--------
+   
+  public: // with description 
+
+// Get/Set functions
+  inline const G4ThreeVector& GetPosition() const;
+  inline void SetPosition(const G4ThreeVector& aValue);
+  inline void AddPosition(const G4ThreeVector& aValue);
+
+  inline G4double GetLocalTime() const;
+  inline void SetLocalTime(const G4double aValue);
+  inline void AddLocalTime(const G4double aValue);
+      // Time since the track is created.
+     
+  inline G4double GetGlobalTime() const;
+  inline void SetGlobalTime(const G4double aValue);
+  inline void AddGlobalTime(const G4double aValue);
+      // Time since the event in which the track belongs is created.
+     
+  inline G4double GetProperTime() const;
+  inline void SetProperTime(const G4double aValue);
+  inline void AddProperTime(const G4double aValue);
+      // Proper time of the particle.
+     
+  inline const G4ThreeVector& GetMomentumDirection() const;
+  inline void SetMomentumDirection(const G4ThreeVector& aValue);
+  inline void AddMomentumDirection(const G4ThreeVector& aValue);
+     // Direction of momentum  (should be an unit vector)
+    
+  inline G4ThreeVector GetMomentum() const;
+      // Total momentum of the track
+
+  
+  inline G4double GetTotalEnergy() const;
+     // Total energy of the track
+
+  inline G4double GetKineticEnergy() const;
+  inline void SetKineticEnergy(const G4double aValue);
+  inline void AddKineticEnergy(const G4double aValue);
+     // Kinetic Energy of the track
+
+  inline G4double GetVelocity() const;
+  inline void SetVelocity(G4double v);
+   //
+
+  inline G4double GetBeta() const;
+    // Velocity of the track in unit of c(light velocity)
+
+  inline G4double GetGamma() const;
+     // Gamma factor (1/sqrt[1-beta*beta]) of the track    
+
+  inline G4VPhysicalVolume* GetPhysicalVolume() const;
+
+  inline const G4VTouchable* GetTouchable() const;
+  inline const G4TouchableHandle& GetTouchableHandle() const;
+  inline void  SetTouchableHandle(const G4TouchableHandle& apValue);
+
+  inline G4Material* GetMaterial() const;
+  inline void SetMaterial(G4Material*);
+
+  inline const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
+  inline void SetMaterialCutsCouple(const G4MaterialCutsCouple*);
+
+  inline G4VSensitiveDetector* GetSensitiveDetector() const;
+  inline void SetSensitiveDetector(G4VSensitiveDetector*);
+
+  inline G4double GetSafety() const;
+  inline void SetSafety(const G4double aValue);
+
+  inline const G4ThreeVector& GetPolarization() const;
+  inline void SetPolarization(const G4ThreeVector& aValue);
+  inline void AddPolarization(const G4ThreeVector& aValue);
+
+  inline G4StepStatus GetStepStatus() const;
+  inline void SetStepStatus(const G4StepStatus aValue);
+
+  inline const G4VProcess* GetProcessDefinedStep() const;
+     // If the pointer is 0, this means the Step is defined
+     // by the user defined limit in the current volume.
+  inline void SetProcessDefinedStep(G4VProcess* aValue);
+
+  
+  inline G4double GetMass() const;
+  inline void SetMass(G4double value);
+
+  inline G4double GetCharge() const;
+  inline void SetCharge(G4double value);
+
+  inline G4double GetMagneticMoment() const;
+  inline void SetMagneticMoment(G4double value);
+
+  inline void SetWeight(G4double aValue);
+  inline G4double GetWeight() const;
+
+  public:
+  // copy constructor and assignment operator as protected
+  G4StepPoint(const G4StepPoint &right);
+  inline 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
+   G4VSensitiveDetector* fpSensitiveDetector;
+   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 fMagneticMoment;
+      // Dynamical MagneticMoment of the particle
+   G4double fWeight;
+      // Track Weight
+};
+
+#include "G4StepPoint.icc"
+
+#endif
Index: /trunk/source/track/include/G4StepPoint.icc
===================================================================
--- /trunk/source/track/include/G4StepPoint.icc	(revision 826)
+++ /trunk/source/track/include/G4StepPoint.icc	(revision 826)
@@ -0,0 +1,217 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4StepPoint.icc,v 1.13 2007/03/11 07:19:06 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+//
+
+   inline 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;
+       fpSensitiveDetector = right.fpSensitiveDetector;
+       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;
+   }
+
+   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 = std::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 G4double G4StepPoint::GetMagneticMoment() const
+   {
+     return fMagneticMoment;
+   }
+   inline void G4StepPoint::SetMagneticMoment(G4double value)
+   {
+     fMagneticMoment = 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 G4VSensitiveDetector* G4StepPoint::GetSensitiveDetector() const
+   { return fpSensitiveDetector; }
+   inline void G4StepPoint::SetSensitiveDetector(G4VSensitiveDetector* aValue)
+   { fpSensitiveDetector = aValue; }
+
+   inline void G4StepPoint::SetWeight(G4double aValue)
+   { fWeight = aValue; }
+   inline G4double G4StepPoint::GetWeight() const
+   { return fWeight; }
Index: /trunk/source/track/include/G4StepStatus.hh
===================================================================
--- /trunk/source/track/include/G4StepStatus.hh	(revision 826)
+++ /trunk/source/track/include/G4StepStatus.hh	(revision 826)
@@ -0,0 +1,73 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4StepStatus.hh,v 1.4 2006/06/29 21:14:43 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+// 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
+
+
Index: /trunk/source/track/include/G4SteppingControl.hh
===================================================================
--- /trunk/source/track/include/G4SteppingControl.hh	(revision 826)
+++ /trunk/source/track/include/G4SteppingControl.hh	(revision 826)
@@ -0,0 +1,61 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4SteppingControl.hh,v 1.4 2006/06/29 21:14:45 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+// 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
+
+
Index: /trunk/source/track/include/G4Track.hh
===================================================================
--- /trunk/source/track/include/G4Track.hh	(revision 826)
+++ /trunk/source/track/include/G4Track.hh	(revision 826)
@@ -0,0 +1,298 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4Track.hh,v 1.18 2006/06/29 21:14:47 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+// 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 <cmath>                      // Include from 'system'
+#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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /trunk/source/track/include/G4Track.icc
===================================================================
--- /trunk/source/track/include/G4Track.icc	(revision 826)
+++ /trunk/source/track/include/G4Track.icc	(revision 826)
@@ -0,0 +1,309 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4Track.icc,v 1.15 2007/10/02 00:46:21 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+//-----------------------------------------------------------------
+// Definitions of inline functions
+//-----------------------------------------------------------------
+//   change GetMaterial        16 Feb. 2000  H.Kurashige
+
+#if defined G4TRACK_ALLOC_EXPORT
+  extern G4DLLEXPORT G4Allocator<G4Track> aTrackAllocator;
+#else
+  extern G4DLLIMPORT G4Allocator<G4Track> aTrackAllocator;
+#endif
+
+// Operators
+
+   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
+   { if ( fpTouchable ==0 ) return 0; 
+     return fpTouchable->GetVolume(); }
+
+   inline G4VPhysicalVolume* G4Track::GetNextVolume() const
+   {  if ( fpNextTouchable ==0 ) return 0; 
+     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); }
+
+
+
+
+
Index: /trunk/source/track/include/G4TrackFastVector.hh
===================================================================
--- /trunk/source/track/include/G4TrackFastVector.hh	(revision 826)
+++ /trunk/source/track/include/G4TrackFastVector.hh	(revision 826)
@@ -0,0 +1,50 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4TrackFastVector.hh,v 1.5 2006/06/29 21:14:51 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// ------------------------------------------------------------
+//	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
+
Index: /trunk/source/track/include/G4TrackStatus.hh
===================================================================
--- /trunk/source/track/include/G4TrackStatus.hh	(revision 826)
+++ /trunk/source/track/include/G4TrackStatus.hh	(revision 826)
@@ -0,0 +1,71 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4TrackStatus.hh,v 1.4 2006/06/29 21:14:53 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+// 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
+
+
Index: /trunk/source/track/include/G4TrackVector.hh
===================================================================
--- /trunk/source/track/include/G4TrackVector.hh	(revision 826)
+++ /trunk/source/track/include/G4TrackVector.hh	(revision 826)
@@ -0,0 +1,58 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4TrackVector.hh,v 1.2 2006/07/17 13:48:28 asaim Exp $
+// GEANT4 tag $Name:  $
+//
+//---------------------------------------------------------------
+//
+//  G4TrackVector.hh
+//
+//  class description:
+//    This class keeps a List of G4Track objects. It is implemented 
+//    as a RougeWave pointer ordered vector.
+//
+// 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 G4TrackVector_h
+#define G4TrackVector_h 1
+
+#include <vector>
+//#include "G4Track.hh"              // Include form 'tracking'
+class G4Track;
+
+///////////////////////////////////////////////////
+typedef std::vector<G4Track*> G4TrackVector;
+///////////////////////////////////////////////////
+
+#endif
+
+
Index: /trunk/source/track/include/G4VParticleChange.hh
===================================================================
--- /trunk/source/track/include/G4VParticleChange.hh	(revision 826)
+++ /trunk/source/track/include/G4VParticleChange.hh	(revision 826)
@@ -0,0 +1,303 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4VParticleChange.hh,v 1.16 2007/03/25 22:54:52 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// ------------------------------------------------------------
+//	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  
+//   remove obsolete methods of SetXXX  19  Sep, 04 H.Kurashige  
+//   add flag for first/last step in volume 30 Oct. 2006 H.Kurashige
+//   add nonIonizingEnergyLoss          26 Mar 2007 H.Kurashige 
+//
+
+#ifndef G4VParticleChange_h
+#define G4VParticleChange_h 1
+
+#include "globals.hh"
+#include "G4ios.hh"
+#include <cmath>
+
+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&);
+    void InitializeStepInVolumeFlags(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 nonIonizingEnergyDeposit  ----   
+    G4double GetNonIonizingEnergyDeposit() const;
+    void ProposeNonIonizingEnergyDeposit(G4double anEnergyPart);
+    //  Get/Propose the non-ionizing 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 initial/last step
+    G4bool GetFirstStepInVolume() const;
+    G4bool GetLastStepInVolume() const;
+    void   ProposeFirstStepInVolume(G4bool flag);
+    void   ProposeLastStepInVolume(G4bool flag);
+
+    //---- 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  ProposeParentWeight(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;
+
+  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 theNonIonizingEnergyDeposit;
+    //   non-ionizing energu deposit is defined as 
+    //   a part of local energy deposit, which does not cause
+    //   ionization of atoms
+
+   G4double theTrueStepLength;
+    //  The value of "True" Step Length
+    
+
+  // flag for initial/last step
+   G4bool theFirstStepInVolume;
+   G4bool theLastStepInVolume;
+
+
+    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
Index: /trunk/source/track/include/G4VParticleChange.icc
===================================================================
--- /trunk/source/track/include/G4VParticleChange.icc	(revision 826)
+++ /trunk/source/track/include/G4VParticleChange.icc	(revision 826)
@@ -0,0 +1,368 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4VParticleChange.icc,v 1.16 2007/03/25 22:54:52 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+//   remove obsolete methods of SetXXX  19  Sep, 04 H.Kurashige  
+//----------------------------------------------------------------
+// Virtual methods for updating G4Step 
+//
+
+inline G4Step* G4VParticleChange::UpdateStepInfo(G4Step* pStep)
+{
+  // Update the G4Step specific attributes
+  pStep->SetStepLength( theTrueStepLength );
+  pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
+  pStep->AddNonIonizingEnergyDeposit( theNonIonizingEnergyDeposit );
+  pStep->SetControlFlag( theSteppingControlFlag );
+
+  if (theFirstStepInVolume) {pStep->SetFirstStepFlag();}
+  else                      {pStep->ClearFirstStepFlag();} 
+  if (theLastStepInVolume)  {pStep->SetLastStepFlag();}
+  else                      {pStep->ClearLastStepFlag();} 
+
+  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;
+}
+
+inline     
+G4bool G4VParticleChange::GetFirstStepInVolume() const
+{
+   return theFirstStepInVolume;
+}
+
+inline
+G4bool G4VParticleChange::GetLastStepInVolume() const
+{
+  return theLastStepInVolume;
+}
+   
+inline 
+void   G4VParticleChange::ProposeFirstStepInVolume(G4bool flag)
+{
+    theFirstStepInVolume = flag;
+}
+
+inline 
+void   G4VParticleChange::ProposeLastStepInVolume(G4bool flag)
+{
+     theLastStepInVolume = flag;
+}
+
+//----------------------------------------------------------------
+// Set/Get inline functions
+//
+
+inline 
+ G4double G4VParticleChange::GetLocalEnergyDeposit() const
+{
+  return theLocalEnergyDeposit;
+}
+
+inline 
+ void G4VParticleChange::ProposeLocalEnergyDeposit(G4double anEnergyPart)
+{
+  theLocalEnergyDeposit = anEnergyPart;
+}
+
+inline 
+ G4double G4VParticleChange::GetNonIonizingEnergyDeposit() const
+{
+  return theNonIonizingEnergyDeposit;
+}
+
+inline 
+ void G4VParticleChange::ProposeNonIonizingEnergyDeposit(G4double anEnergyPart)
+{
+  theNonIonizingEnergyDeposit = 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;
+  theNonIonizingEnergyDeposit = 0.0;
+}
+
+inline
+ void G4VParticleChange::InitializeSteppingControl(const G4Track& )
+{
+  // SteppingControlFlag
+  theSteppingControlFlag = NormalCondition;     
+}
+
+inline 
+ void G4VParticleChange::Clear()
+{
+  theNumberOfSecondaries = 0;
+  theFirstStepInVolume = false;
+  theLastStepInVolume = false;
+}
+
+//----------------------------------------------------------------
+// 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
+  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+}
+
+//----------------------------------------------------------------
+// methods for initialize
+inline
+void G4VParticleChange::InitializeStepInVolumeFlags(const G4Track& track)
+{
+   const G4Step* aStep = track.GetStep();
+   theFirstStepInVolume = aStep-> IsFirstStepInVolume();
+   theLastStepInVolume  = aStep-> IsLastStepInVolume();
+}
+
+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);
+  InitializeStepInVolumeFlags(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;
+}
+
Index: /trunk/source/track/include/G4VUserTrackInformation.hh
===================================================================
--- /trunk/source/track/include/G4VUserTrackInformation.hh	(revision 826)
+++ /trunk/source/track/include/G4VUserTrackInformation.hh	(revision 826)
@@ -0,0 +1,70 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4VUserTrackInformation.hh,v 1.6 2006/06/29 21:14:59 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+// 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
+
Index: /trunk/source/track/src/G4FieldTrackUpdator.cc
===================================================================
--- /trunk/source/track/src/G4FieldTrackUpdator.cc	(revision 826)
+++ /trunk/source/track/src/G4FieldTrackUpdator.cc	(revision 826)
@@ -0,0 +1,77 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4FieldTrackUpdator.cc,v 1.2 2006/12/13 15:49:45 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+//   M. Asai - first implementation Apr/28/2006
+//
+//---------------------------------------------------------------
+//
+// G4FieldTrackUpdator.cc
+//
+//---------------------------------------------------------------
+
+#include "globals.hh"
+#include "G4FieldTrackUpdator.hh"
+#include "G4ThreeVector.hh"
+#include "G4Track.hh"
+#include "G4DynamicParticle.hh"
+#include "G4TrackStatus.hh"
+#include "G4FieldTrack.hh"
+
+G4FieldTrack* G4FieldTrackUpdator::CreateFieldTrack(const G4Track* trk)
+{
+  G4FieldTrack* ftrk = new G4FieldTrack(
+    trk->GetPosition(),
+    trk->GetGlobalTime(),
+    trk->GetMomentumDirection(),
+    trk->GetKineticEnergy(),
+    trk->GetDynamicParticle()->GetMass(),
+    trk->GetDynamicParticle()->GetCharge(),
+    trk->GetDynamicParticle()->GetPolarization(),
+    0.0                   // magnetic dipole moment to be implemented
+    );
+  return ftrk;
+}
+
+void G4FieldTrackUpdator::Update(G4FieldTrack* ftrk,const G4Track* trk)
+{
+  ftrk->UpdateState(
+    trk->GetPosition(),     
+    trk->GetGlobalTime(),
+    trk->GetMomentumDirection(),
+    trk->GetKineticEnergy()
+    );
+  ftrk->SetChargeAndMoments(
+    trk->GetDynamicParticle()->GetCharge()
+    );
+  ftrk->SetSpin(
+    trk->GetDynamicParticle()->GetPolarization()
+    );
+}
+
+
Index: /trunk/source/track/src/G4ParticleChange.cc
===================================================================
--- /trunk/source/track/src/G4ParticleChange.cc	(revision 826)
+++ /trunk/source/track/src/G4ParticleChange.cc	(revision 826)
@@ -0,0 +1,542 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChange.cc,v 1.30 2007/03/30 01:03:53 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// --------------------------------------------------------------
+//	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
+//   Rename SetXXX methods to ProposeXXX   DynamicCharge  Oct. 2005 H.Kurashige
+//   Add get/ProposeMagneticMoment                  Mar 2007 H.Kurashige
+// --------------------------------------------------------------
+
+#include "G4ParticleChange.hh"
+#include "G4Track.hh"
+#include "G4Step.hh"
+#include "G4TrackFastVector.hh"
+#include "G4DynamicParticle.hh"
+#include "G4ExceptionSeverity.hh"
+
+
+G4ParticleChange::G4ParticleChange():G4VParticleChange()
+{
+  G4VParticleChange::SetSecondaryWeightByProcess(false);
+  G4VParticleChange::SetParentWeightByProcess(false);
+
+}
+
+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;
+   theMagneticMomentChange = right.theMagneticMomentChange;
+   //   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;
+      theMagneticMomentChange = right.theMagneticMomentChange;
+      // 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/MagneticMoment  of DynamicParticle
+  theMassChange = pParticle->GetMass();
+  theChargeChange = pParticle->GetCharge();
+  theMagneticMomentChange = pParticle->GetMagneticMoment();
+
+  // 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/MagneticMoment 
+  pPostStepPoint->SetMass(theMassChange);
+  pPostStepPoint->SetCharge(theChargeChange);  
+  pPostStepPoint->SetMagneticMoment(theMagneticMomentChange);  
+ 
+  // 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
+  if (!fSetParentWeightByProcess){
+    G4double newWeight= theParentWeight/(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);  
+  pPostStepPoint->SetMagneticMoment(theMagneticMomentChange);  
+ 
+  // 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
+  if (!fSetParentWeightByProcess){
+    pPostStepPoint->SetWeight( theParentWeight );
+  }
+
+
+#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);  
+  pPostStepPoint->SetMagneticMoment(theMagneticMomentChange);  
+ 
+  // 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 
+  if (!fSetParentWeightByProcess){
+    pPostStepPoint->SetWeight( theParentWeight );
+  }
+
+#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 << "        MagneticMoment   : " 
+         << std::setw(20) << theMagneticMomentChange << G4endl;
+  G4cout << "                :  = " << std::setw(20) 
+         << theMagneticMomentChange*2.*theMassChange/c_squared/eplus/hbar_Planck 
+         <<  "*[e hbar]/[2 m]" 
+         << 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;
+}
+
+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 = std::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;
+}
+
+
+
Index: /trunk/source/track/src/G4ParticleChangeForDecay.cc
===================================================================
--- /trunk/source/track/src/G4ParticleChangeForDecay.cc	(revision 826)
+++ /trunk/source/track/src/G4ParticleChangeForDecay.cc	(revision 826)
@@ -0,0 +1,214 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForDecay.cc,v 1.11 2006/06/29 21:15:03 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// --------------------------------------------------------------
+//	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;
+}
+
+
+
+
+
Index: /trunk/source/track/src/G4ParticleChangeForGamma.cc
===================================================================
--- /trunk/source/track/src/G4ParticleChangeForGamma.cc	(revision 826)
+++ /trunk/source/track/src/G4ParticleChangeForGamma.cc	(revision 826)
@@ -0,0 +1,168 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForGamma.cc,v 1.3 2006/08/28 16:10:29 vnivanch Exp $
+// GEANT4 tag $Name:  $
+//
+//
+// --------------------------------------------------------------
+//	GEANT 4 class implementation file
+//
+// ------------------------------------------------------------
+//   15 April 2005 V.Ivanchenko for gamma EM processes
+// --------------------------------------------------------------
+//
+//   Modified::
+//   28.08.06 V.Ivanchenko Add access to current track and polarizaion
+//
+// ------------------------------------------------------------
+//
+#include "G4ParticleChangeForGamma.hh"
+#include "G4Track.hh"
+#include "G4Step.hh"
+#include "G4DynamicParticle.hh"
+#include "G4ExceptionSeverity.hh"
+
+G4ParticleChangeForGamma::G4ParticleChangeForGamma():G4VParticleChange()
+{
+  theSteppingControlFlag = NormalCondition;
+  debugFlag = false;
+#ifdef G4VERBOSE
+  if (verboseLevel>2) {
+    G4cout << "G4ParticleChangeForGamma::G4ParticleChangeForGamma() " << G4endl;
+  }
+#endif
+}
+
+G4ParticleChangeForGamma::~G4ParticleChangeForGamma()
+{
+#ifdef G4VERBOSE
+  if (verboseLevel>2) {
+    G4cout << "G4ParticleChangeForGamma::~G4ParticleChangeForGamma() " << G4endl;
+  }
+#endif
+}
+
+G4ParticleChangeForGamma::G4ParticleChangeForGamma(
+             const G4ParticleChangeForGamma &right): G4VParticleChange(right)
+{
+  if (verboseLevel>1) 
+    G4cout << "G4ParticleChangeForGamma::  copy constructor is called " << G4endl;
+  
+  currentTrack = right.currentTrack;
+  proposedKinEnergy = right.proposedKinEnergy;
+  proposedMomentumDirection = right.proposedMomentumDirection;
+  proposedPolarization = right.proposedPolarization;
+}
+
+// assignment operator
+G4ParticleChangeForGamma & G4ParticleChangeForGamma::operator=(
+			   const G4ParticleChangeForGamma &right)
+{
+  if (verboseLevel>1) 
+    G4cout << "G4ParticleChangeForGamma:: 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;
+    theParentWeight = right.theParentWeight;
+
+    currentTrack = right.currentTrack;
+    proposedKinEnergy = right.proposedKinEnergy;
+    proposedMomentumDirection = right.proposedMomentumDirection;
+    proposedPolarization = right.proposedPolarization;
+  }
+  return *this;
+}
+
+//----------------------------------------------------------------
+// methods for printing messages
+//
+
+void G4ParticleChangeForGamma::DumpInfo() const
+{
+// use base-class DumpInfo
+  G4VParticleChange::DumpInfo();
+
+  G4cout.precision(3);
+  G4cout << "        Kinetic Energy (MeV): "
+       << std::setw(20) << proposedKinEnergy/MeV
+       << G4endl;
+  G4cout << "        Momentum Direction: "
+       << std::setw(20) << proposedMomentumDirection
+       << G4endl;
+  G4cout << "        Polarization: "
+       << std::setw(20) << proposedPolarization
+       << G4endl;
+}
+
+G4bool G4ParticleChangeForGamma::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 << "G4ParticleChangeForGamma::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 << "G4ParticleChangeForGamma::CheckIt " << G4endl;
+    DumpInfo();
+  }
+#endif
+
+  // Exit with error
+  if (exitWithError) {
+    G4Exception("G4ParticleChangeForGamma::CheckIt",
+		"400",
+		EventMustBeAborted,
+		"energy was  illegal");
+  }
+
+  //correction
+  if (!itsOK) {
+    proposedKinEnergy = aTrack.GetKineticEnergy();
+  }
+
+  itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
+  return itsOK;
+}
Index: /trunk/source/track/src/G4ParticleChangeForLoss.cc
===================================================================
--- /trunk/source/track/src/G4ParticleChangeForLoss.cc	(revision 826)
+++ /trunk/source/track/src/G4ParticleChangeForLoss.cc	(revision 826)
@@ -0,0 +1,176 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForLoss.cc,v 1.16 2006/08/28 16:10:29 vnivanch Exp $
+// GEANT4 tag $Name:  $
+//
+//
+// --------------------------------------------------------------
+//	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
+//   15.04.05 V.Ivanchenko inline update methods
+//   28.08.06 V.Ivanchenko Add access to current track and polarizaion
+//
+// ------------------------------------------------------------
+//
+#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;
+  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;
+    theParentWeight = right.theParentWeight;
+
+    currentTrack = right.currentTrack;
+    proposedKinEnergy = right.proposedKinEnergy;
+    currentCharge = right.currentCharge;
+    proposedMomentumDirection = right.proposedMomentumDirection;
+  }
+  return *this;
+}
+
+//----------------------------------------------------------------
+// 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;
+}
Index: /trunk/source/track/src/G4ParticleChangeForMSC.cc
===================================================================
--- /trunk/source/track/src/G4ParticleChangeForMSC.cc	(revision 826)
+++ /trunk/source/track/src/G4ParticleChangeForMSC.cc	(revision 826)
@@ -0,0 +1,205 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForMSC.cc,v 1.13 2006/06/29 21:15:09 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// --------------------------------------------------------------
+//	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 = std::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;
+}
+
+
+
+
Index: /trunk/source/track/src/G4ParticleChangeForTransport.cc
===================================================================
--- /trunk/source/track/src/G4ParticleChangeForTransport.cc	(revision 826)
+++ /trunk/source/track/src/G4ParticleChangeForTransport.cc	(revision 826)
@@ -0,0 +1,250 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4ParticleChangeForTransport.cc,v 1.19 2006/11/03 17:45:04 japost Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// --------------------------------------------------------------
+//	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;
+      theSensitiveDetectorChange = right.theSensitiveDetectorChange;
+      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 only if some kinetic energy remains
+  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 );
+    pPostStepPoint->SetSensitiveDetector( theSensitiveDetectorChange );
+  }
+  if( this->GetLastStepInVolume() ){
+    pStep->SetLastStepFlag();
+  }else{
+    pStep->ClearLastStepFlag(); 
+  }
+  // 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; 
+}
+
+
+
+
+
+
+
+
Index: /trunk/source/track/src/G4Step.cc
===================================================================
--- /trunk/source/track/src/G4Step.cc	(revision 826)
+++ /trunk/source/track/src/G4Step.cc	(revision 826)
@@ -0,0 +1,70 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4Step.cc,v 1.7 2006/10/30 09:50:13 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+//  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();
+
+  fFirstStepInVolume =false;
+  fLastStepInVolume = false;
+}
+
+/////////////////
+G4Step::~G4Step()
+/////////////////
+{
+  delete fpPreStepPoint;
+  delete fpPostStepPoint;
+}
Index: /trunk/source/track/src/G4StepPoint.cc
===================================================================
--- /trunk/source/track/src/G4StepPoint.cc	(revision 826)
+++ /trunk/source/track/src/G4StepPoint.cc	(revision 826)
@@ -0,0 +1,78 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4StepPoint.cc,v 1.13 2007/03/11 07:19:06 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+//  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
+//     Hisaya Kurashige  
+//
+// ---------------------------------------------------------------
+
+#include "G4StepPoint.hh"
+
+//////////////////////////
+G4StepPoint::G4StepPoint():
+//////////////////////////
+  fpTouchable(0), fpMaterial(0), fpMaterialCutsCouple(0), fpSensitiveDetector(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),
+  fpSensitiveDetector(right.fpSensitiveDetector),
+  fSafety(right.fSafety),
+  fPolarization(right.fPolarization),
+  fStepStatus(right.fStepStatus),
+  fpProcessDefinedStep(right.fpProcessDefinedStep),
+  fMass(right.fMass),
+  fCharge(right.fCharge),
+  fMagneticMoment(right.fMagneticMoment),
+  fWeight(right.fWeight)
+{}
Index: /trunk/source/track/src/G4Track.cc
===================================================================
--- /trunk/source/track/src/G4Track.cc	(revision 826)
+++ /trunk/source/track/src/G4Track.cc	(revision 826)
@@ -0,0 +1,221 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4Track.cc,v 1.30 2007/10/02 00:46:21 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+//
+//---------------------------------------------------------------
+//
+//  G4Track.cc
+//
+//---------------------------------------------------------------
+//   Add copy constructor            Hisaya Feb. 07 01
+//   Fix GetVelocity                 Hisaya Feb. 17 01
+//   Modification for G4TouchableHandle             22 Oct. 2001  R.Chytracek//
+//   Fix GetVelocity (bug report #741)   Horton-Smith Apr 14 2005
+
+#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;
+  
+  static G4Material*               prev_mat =0;
+  static G4MaterialPropertyVector* groupvel =0;
+  static G4double                  prev_velocity =0;
+  static G4double                  prev_momentum =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=0; 
+       G4bool update_groupvel = false;
+       if ( this->GetStep() ){
+	  mat= this->GetMaterial();         //   Fix for repeated volumes
+       }else{
+          if (fpTouchable!=0){ 
+            mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial();
+          }
+        }
+       // check if previous step is in the same volume
+       //  and get new GROUPVELOVITY table if necessary 
+       if ((mat != prev_mat)||(groupvel==0)) {
+	 groupvel = 0;
+	 if(mat->GetMaterialPropertiesTable() != 0)
+	   groupvel = mat->GetMaterialPropertiesTable()->GetProperty("GROUPVEL");
+	 update_groupvel = true;
+       }
+       prev_mat = mat;
+       
+       if  (groupvel != 0 ) {
+	 // light velocity = c/(rindex+d(rindex)/d(log(E_phot)))
+	 // values stored in GROUPVEL material properties vector
+	 velocity =  prev_velocity;
+ 	 
+	 // check if momentum is same as in the previous step
+         //  and calculate group velocity if necessary 
+ 	 if( update_groupvel || (fpDynamicParticle->GetTotalMomentum() != prev_momentum) ) {
+	   velocity =
+	     groupvel->GetProperty(fpDynamicParticle->GetTotalMomentum());
+	   prev_velocity = velocity;
+	   prev_momentum = fpDynamicParticle->GetTotalMomentum();
+	 }
+       }
+     }
+
+  } else {
+    G4double T = fpDynamicParticle->GetKineticEnergy();
+    velocity = c_light*std::sqrt(T*(T+2.*mass))/(T+mass);
+  }
+                                                                                
+  return velocity ;
+}
Index: /trunk/source/track/src/G4VParticleChange.cc
===================================================================
--- /trunk/source/track/src/G4VParticleChange.cc	(revision 826)
+++ /trunk/source/track/src/G4VParticleChange.cc	(revision 826)
@@ -0,0 +1,402 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4VParticleChange.cc,v 1.20 2007/03/25 22:54:52 kurasige Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// --------------------------------------------------------------
+//	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),
+   theNonIonizingEnergyDeposit(0.0),
+   theFirstStepInVolume(false),
+   theLastStepInVolume(false),
+   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),
+   theNonIonizingEnergyDeposit(0.0),
+   theFirstStepInVolume(false),
+   theLastStepInVolume(false),
+   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;
+  theNonIonizingEnergyDeposit = right.theNonIonizingEnergyDeposit;
+  theSteppingControlFlag = right.theSteppingControlFlag;
+  fSetParentWeightByProcess = right.fSetParentWeightByProcess;    
+
+  theFirstStepInVolume = right.theFirstStepInVolume;
+  theLastStepInVolume =  right.theLastStepInVolume;
+}
+
+
+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;
+      theNonIonizingEnergyDeposit = right.theNonIonizingEnergyDeposit;
+      theSteppingControlFlag = right.theSteppingControlFlag;
+      fSetParentWeightByProcess = right.fSetParentWeightByProcess;    
+
+      theFirstStepInVolume = right.theFirstStepInVolume;
+      theLastStepInVolume =  right.theLastStepInVolume;
+   }
+   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 << "        Non-ionizing Energy Deposit (MeV): " 
+       << std::setw(20) << theNonIonizingEnergyDeposit/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;   
+  if (theFirstStepInVolume) {
+    G4cout << "    First Step In the voulme  : "  << G4endl;
+  }
+  if (theLastStepInVolume) {
+    G4cout << "    Last Step In the voulme  : "  << 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 = std::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
+  }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /trunk/source/track/src/G4VUserTrackInformation.cc
===================================================================
--- /trunk/source/track/src/G4VUserTrackInformation.cc	(revision 826)
+++ /trunk/source/track/src/G4VUserTrackInformation.cc	(revision 826)
@@ -0,0 +1,38 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * 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.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4VUserTrackInformation.cc,v 1.2 2006/06/29 21:15:21 gunter Exp $
+// GEANT4 tag $Name:  $
+//
+// 
+// --------------------------------------------------------------
+
+#include "G4VUserTrackInformation.hh"
+
+G4VUserTrackInformation::G4VUserTrackInformation()
+{;}
+G4VUserTrackInformation::~G4VUserTrackInformation()
+{;}
