G4ParticleChange.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // 
00030 // ------------------------------------------------------------
00031 //      GEANT 4 class header file 
00032 //
00033 // 
00034 // ------------------------------------------------------------
00035 //   Implemented for the new scheme                 23 Mar. 1998  H.Kurahige
00036 //
00037 // Class Description
00038 //  This class is a concrete class for ParticleChange which
00039 //  has all functionality in old scheme.
00040 //-
00041 //  This class contains the results after invocation of a physics process.
00042 //  This includes final states of parent particle (momentum, energy,
00043 //  etc) and secondary particles generated by the interaction.
00044 //  The tracking assumes that all the values of energy and
00045 //  momentum are in global reference system, therefore all the
00046 //  needed Lorentz transformations must have been already Done
00047 //  when filling the data-members of this class.
00048 //-
00049 //  ---------------------------------------------------------------
00050 //  IMPORTANT NOTE: Although the name of the class and methods are
00051 //   "Change", what it stores (and returns in get) are the "FINAL" 
00052 //   values of the Position, Momentum, etc.
00053 // 
00054 //  ------------------------------------------------------------
00055 //  modify AddSecondary methods for "GoodForTracking" flag 
00056 //                                                 8 June 1998 H.Kurashige
00057 //   Add Track weight                              12 Nov. 1998  H.Kurashige
00058 //   Add Get/SetMomentumDirectionChange             6 Feb. 1999 H.Kurashige 
00059 //   Add Get/SetDynamicMass                        5 Oct. 1999 H.Kurashige
00060 //   Add Get/SetDynamicCharge                       5 Oct. 1999 H.Kurashige
00061 //   Rename SetXXX methods to ProposeXXX   DynamicCharge  Oct. 2005 H.Kurashige
00062 //   Add get/ProposeMagneticMoment                  Mar 2007 H.Kurashige
00063 //   Fix treatment of weight                        Mar 2007 H.Kurashige
00064 //   Add  Get/ProposeVelocity                       Apr 2011 H.Kurashige
00065 // -------------------------------------------------------------
00066  
00067 #ifndef G4ParticleChange_h
00068 #define G4ParticleChange_h 1
00069 
00070 #include "globals.hh"
00071 #include "G4ios.hh"
00072 #include "G4ThreeVector.hh"
00073 #include "G4ThreeVector.hh"
00074 class G4DynamicParticle;
00075 #include "G4VParticleChange.hh"
00076 
00077 class G4ParticleChange: public G4VParticleChange
00078 { 
00079   public:
00080     // default constructor
00081     G4ParticleChange();
00082 //    G4ParticleChange(G4bool useEB);
00083 
00084     // destructor
00085     virtual ~G4ParticleChange();
00086 
00087   protected:
00088     // hide copy constructor and assignment operaor as protected
00089     G4ParticleChange(const G4ParticleChange &right);
00090     G4ParticleChange & operator=(const G4ParticleChange &right);
00091 
00092   public:
00093     // equal/unequal operator
00094     G4bool operator==(const G4ParticleChange &right) const;
00095     G4bool operator!=(const G4ParticleChange &right) const;
00096 
00097   public: // with description
00098     // ----------------------------------------------------
00099     // --- the following methods are for updating G4Step -----   
00100     // Return the pointer to the G4Step after updating the Step information
00101     // by using final state information of the track given by a physics
00102     // process    
00103     virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
00104     // A physics process gives the final state of the particle 
00105     // relative to the initial state at the beginning of the Step,
00106     // i.e., based on information of G4Track (or equivalently 
00107     // the PreStepPoint)
00108     // In this method, the differences (delta) between these two states 
00109     // are calculated, and are accumulated in PostStepPoint.
00110     // Take note that the return type of GetMomentumChange is a
00111     // pointer to G4ParticleMometum. Also it is a normalized 
00112     // momentum vector.
00113     virtual G4Step* UpdateStepForAtRest(G4Step* Step);
00114     virtual G4Step* UpdateStepForPostStep(G4Step* Step);
00115     // A physics process gives the final state of the particle 
00116     // based on information of G4Track (or equivalently the PreStepPoint)
00117  
00118     virtual void Initialize(const G4Track&);
00119     // Initialize all propoerties by using G4Track information
00120 
00121   protected: // with description
00122     G4Step* UpdateStepInfo(G4Step* Step);
00123     //  Update the G4Step specific attributes 
00124     //  (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
00125 
00126   public:     // with description
00127     
00128     // ----------------------------------------------------
00129     //--- methods to keep information of the final state--
00130     //  IMPORTANT NOTE: 
00131     //  These ProposeXXX methods stores (and returns in GetXXX methods) 
00132     //   the "FINAL" values of the Position, Momentum, etc.
00133 
00134     const G4ThreeVector* GetMomentumDirection() const;
00135     void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
00136     void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
00137     // Get/Propose the MomentumDirection vector: it is the final momentum direction.
00138 
00139     const G4ThreeVector* GetPolarization() const;
00140     void  ProposePolarization(G4double Px, G4double Py, G4double Pz);
00141     void  ProposePolarization(const G4ThreeVector& finalPoralization);
00142     // Get/Propose the final Polarization vector.
00143 
00144     G4double GetEnergy() const;
00145     void ProposeEnergy(G4double finalEnergy);
00146     // Get/Propose the final kinetic energy of the current particle.
00147 
00148     G4double GetVelocity() const;
00149     void ProposeVelocity(G4double finalVelocity);
00150     // Get/Propose the final velocity of the current particle.
00151 
00152     G4double GetProperTime() const;
00153     void ProposeProperTime(G4double finalProperTime);
00154     //  Get/Propose th final ProperTime 
00155 
00156     const G4ThreeVector* GetPosition() const;
00157     void ProposePosition(G4double x, G4double y, G4double z);
00158     void ProposePosition(const G4ThreeVector& finalPosition);
00159     //  Get/Propose the final position of the current particle.
00160 
00161     void     ProposeGlobalTime(G4double t);
00162     void     ProposeLocalTime(G4double t);
00163     //  Get/Propose the final global/local Time
00164     // NOTE: DO NOT INVOKE both methods in a step
00165     //       Each method affects both local and global time 
00166 
00167     G4double GetGlobalTime(G4double timeDelay=0.0) const;
00168     G4double GetLocalTime(G4double timeDelay=0.0) const;
00169     //  Convert the time delay to the glocbal/local time.
00170     //  Can get  the final global/local  Time without argument
00171  
00172     G4double GetMass() const;
00173     void ProposeMass(G4double finalMass);
00174     //   Get/Propose the final dynamical Mass in G4DynamicParticle
00175 
00176     G4double GetCharge() const;
00177     void ProposeCharge(G4double finalCharge);
00178     //   Get/Propose the final dynamical Charge in G4DynamicParticle
00179 
00180     G4double GetMagneticMoment() const;
00181     void ProposeMagneticMoment(G4double finalMagneticMoment);
00182     //   Get/Propose the final MagneticMoment in G4DynamicParticle
00183   
00184     G4ThreeVector GetGlobalPosition(const G4ThreeVector& displacement) const;
00185     //  Convert the position displacement to the global position.
00186 
00187     G4ThreeVector CalcMomentum(G4double           energy,
00188                                G4ThreeVector direction,
00189                                G4double           mass      ) const;
00190     //  Calculate momentum by using Energy, Momentum Direction, and Mass 
00191 
00192 
00193 
00194     // ----------------------------------------------------
00195     // --- methods for adding secondaries
00196     void AddSecondary(G4Track* aSecondary);
00197     //  Add a secondary particle to theListOfSecondaries.
00198 
00199     void AddSecondary(G4DynamicParticle* aSecondary,
00200                       G4bool             IsGoodForTracking = false );
00201     //  Add a secondary particle to theListOfSecondaries.
00202     //  position and time are same as thePositionChange and theTimeChange 
00203 
00204     void AddSecondary(G4DynamicParticle* aSecondary, 
00205                       G4ThreeVector      position,
00206                       G4bool             IsGoodForTracking = false   );
00207     //  Add a secondary particle to theListOfSecondaries.
00208     //  global time are same as theTimeChange and theTimeChange 
00209 
00210     void AddSecondary(G4DynamicParticle* aSecondary, 
00211                       G4double           time,
00212                       G4bool             IsGoodForTracking = false );
00213     //  Add a secondary particle to theListOfSecondaries.
00214     //  position and are same as thePositionChange  
00215     // ----------------------------------------------------
00216 
00217   public:
00218     virtual void DumpInfo() const;
00219 
00220   protected:
00221     G4ThreeVector theMomentumDirectionChange;
00222     //  It is the vector containing the final momentum direction
00223     //  after the invoked process. The application of the change
00224     //  of the momentum direction of the particle is not Done here.
00225     //  The responsibility to apply the change is up the entity
00226     //  which invoked the process.
00227 
00228     G4ThreeVector thePolarizationChange;
00229     //  The changed (final) polarization of a given track
00230     
00231     G4double theEnergyChange;
00232     //  The final kinetic energy of the current track
00233     
00234     G4double theVelocityChange;
00235     G4bool isVelocityChanged;
00236     //  The final velocity of the current track
00237 
00238    G4ThreeVector thePositionChange;
00239     //  The changed (final) position of a given track
00240     
00241     G4double theGlobalTime0;
00242     //  The global time at Initial.
00243     G4double theLocalTime0;
00244     //  The local time at Initial.
00245 
00246     G4double theTimeChange;
00247     //  The change of local time of a given particle.
00248     
00249     G4double theProperTimeChange;
00250     //  The changed (final) proper time of a given track
00251     
00252     G4double theMassChange;
00253     //  The Changed (final) mass of a given track
00254 
00255     G4double theChargeChange;
00256     //  The Changed (final) charge of a given track
00257  
00258     G4double theMagneticMomentChange;
00259     //  The Changed (final) MagneticMoment of a given track
00260   
00261     const G4Track* theCurrentTrack;
00262     
00263   public:
00264     // for Debug 
00265     virtual G4bool CheckIt(const G4Track&);
00266 };
00267 
00268 #include "G4ParticleChange.icc"
00269 
00270 #endif
00271 
00272 
00273 
00274 
00275 
00276 
00277 
00278 
00279 
00280 
00281 
00282 
00283 
00284 
00285 
00286 

Generated on Mon May 27 17:49:15 2013 for Geant4 by  doxygen 1.4.7