G4Step.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 //
00032 // G4Step.hh
00033 //
00034 // Class Description:
00035 //   This class represents the Step of a particle tracked.
00036 //   It includes information of 
00037 //     1) List of Step points which compose the Step,
00038 //     2) static information of particle which generated the 
00039 //        Step, 
00040 //     3) trackID and parent particle ID of the Step,
00041 //     4) termination condition of the Step,
00042 //
00043 // Contact:
00044 //   Questions and comments to this code should be sent to
00045 //     Katsuya Amako  (e-mail: Katsuya.Amako@kek.jp)
00046 //     Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
00047 //
00048 // ---------------------------------------------------------------
00049 //   Modified for the new G4ParticleChange          12 Mar. 1998  H.Kurahige
00050 //   Correct treatment of touchable in G4Step::UpdateTrack
00051 //                                                  12 May. 1998 H.Kurashige
00052 // ---------------------------------------------------------------
00053 //   Separate implementation of inline functions inti G4Step.icc
00054 //   Add updating mass/charge                        6 Oct. 1999 H.Kurashige
00055 //   add nonIonizingEnergyLoss                      26 Mar. 2007 H.Kurashige 
00056 //
00057 //   Repository test - Dennis Wright
00058 //
00059 #ifndef G4Step_h
00060 #define G4Step_h 1
00061 
00062 #include <stdlib.h>                 // Include from 'system'
00063 #include <cmath>                    // Include from 'system'
00064 #include "G4ios.hh"                 // Include from 'system'
00065 #include <iomanip>                  // Include from 'system'
00066 #include "globals.hh"               // Include from 'global'
00067 #include "G4ThreeVector.hh"         // Include from 'global'
00068 #include "G4VPhysicalVolume.hh"     // Include from 'geometry'
00069 #include "G4StepPoint.hh"           // Include from 'track'
00070 #include "G4StepStatus.hh"          // Include from 'track'
00071 class G4Polyline;                   // Forward declaration.
00072 class G4Track;                      // Forward declaration.
00073 #include "G4TrackVector.hh"           // Include from 'tracking'
00074 
00076 class G4Step
00078 {
00079 
00080 //--------
00081    public:
00082 
00083 // Constructor/Destrcutor
00084    G4Step();
00085    ~G4Step();
00086 
00087 // Copy Counstructor and assignment operator
00088    G4Step(const G4Step& );
00089    G4Step & operator=(const G4Step &);   
00090 
00091 //--------
00092    public: // WIth description
00093 
00094 // Get/Set functions 
00095    // currnet track
00096    G4Track* GetTrack() const;
00097    void SetTrack(G4Track* value);
00098 
00099    // step points 
00100    G4StepPoint* GetPreStepPoint() const;
00101    void SetPreStepPoint(G4StepPoint* value);
00102 
00103    G4StepPoint* GetPostStepPoint() const;
00104    void SetPostStepPoint(G4StepPoint* value);
00105 
00106    // step length
00107    G4double GetStepLength() const;
00108    void SetStepLength(G4double value);
00109     // Before the end of the AlongStepDoIt loop,StepLength keeps
00110     // the initial value which is determined by the shortest geometrical Step
00111     // proposed by a physics process. After finishing the AlongStepDoIt,
00112     // it will be set equal to 'StepLength' in G4Step. 
00113 
00114    // total energy deposit 
00115    G4double GetTotalEnergyDeposit() const;
00116    void SetTotalEnergyDeposit(G4double value);
00117 
00118    // total non-ionizing energy deposit 
00119    G4double GetNonIonizingEnergyDeposit() const;
00120    void SetNonIonizingEnergyDeposit(G4double value);
00121 
00122    // cotrole flag for stepping
00123    G4SteppingControl GetControlFlag() const;
00124    void SetControlFlag(G4SteppingControl StepControlFlag);
00125 
00126     // manipulation of total energy deposit 
00127    void AddTotalEnergyDeposit(G4double value);
00128    void ResetTotalEnergyDeposit();
00129 
00130    // manipulation of non-ionizng energy deposit 
00131    void AddNonIonizingEnergyDeposit(G4double value);
00132    void ResetNonIonizingEnergyDeposit();
00133 
00134 
00135   // Get/Set/Clear flag for initial/last step
00136    // NOTE:  following flags are not used 
00137    //        will be ready in later release
00138    G4bool IsFirstStepInVolume() const;
00139    G4bool IsLastStepInVolume() const;
00140 
00141    void SetFirstStepFlag();
00142    void ClearFirstStepFlag();
00143    void SetLastStepFlag();
00144    void ClearLastStepFlag();
00145 
00146   // difference of position, time, momentum and energy
00147    G4ThreeVector GetDeltaPosition() const;
00148    G4double GetDeltaTime() const;
00149 
00150   // These methods will be deleted 
00151   // NOTE: use  GetTotalEnergyDeposit() to obtain 
00152   //       energy loss in the material 
00153   // 
00154    G4ThreeVector GetDeltaMomentum() const;
00155    G4double GetDeltaEnergy() const;
00156 
00157 
00158 // Other member functions
00159    void InitializeStep( G4Track* aValue );
00160    // initiaize contents of G4Step
00161 
00162    void UpdateTrack( );
00163    // update track by using G4Step information
00164 
00165    void CopyPostToPreStepPoint( );
00166    // copy PostStepPoint to PreStepPoint 
00167   
00168    G4Polyline* CreatePolyline () const;
00169    // for visualization
00170 
00171 //-----------
00172    protected:
00173 //-----------
00174 
00175 // Member data
00176    G4double fTotalEnergyDeposit;
00177      // Accummulated total energy desposit in the current Step
00178 
00179    G4double fNonIonizingEnergyDeposit;
00180      // Accummulated non-ionizing energy desposit in the current Step
00181 
00182 //---------
00183    private:
00184 //---------
00185 
00186 // Member data
00187    G4StepPoint* fpPreStepPoint;
00188    G4StepPoint* fpPostStepPoint;
00189    G4double fStepLength;
00190      // Step length which may be updated at each invocation of 
00191      // AlongStepDoIt and PostStepDoIt
00192    G4Track* fpTrack;
00193      //
00194    G4SteppingControl fpSteppingControlFlag;     
00195     // A flag to control SteppingManager behavier from process
00196 
00197   // flag for initial/last step
00198    G4bool fFirstStepInVolume;
00199    G4bool fLastStepInVolume;
00200 
00201 // Secondary buckets
00202 public:
00203   // secodaries in the current step
00204    const std::vector<const G4Track*>* GetSecondaryInCurrentStep() const; 
00205 
00206    // NOTE: Secondary bucket of the Step contains  
00207    //       all secondaries during tracking the current track 
00208    //       (i.e. NOT secondaries produced in the current step)
00209    // all following methods give same object (i.e. G4TrackVector  )
00210    // but 2nd one will create bucket in addition  
00211    const G4TrackVector* GetSecondary() const ;
00212    G4TrackVector* GetfSecondary();
00213    G4TrackVector* NewSecondaryVector();
00214 
00215    // just delete secondary bucket
00216    //  NOTE: G4Track objects inside the bucket are not deleted 
00217    void DeleteSecondaryVector();
00218 
00219    // Add secondary tracks to the bucket 
00220    void SetSecondary( G4TrackVector* value);
00221 
00222 private: 
00223    // Secondaty bucket implemented by using  std::vector of G4Track*   
00224    G4TrackVector* fSecondary;
00225 
00226    // number of secondaries which have been created by the last step
00227    G4int  nSecondaryByLastStep;
00228 
00229    typedef const G4Track* CT;
00230    std::vector<CT>* secondaryInCurrentStep;
00231 
00232   // Prototyping implementation of smooth representation of curved
00233   // trajectories. (jacek 30/10/2002)
00234 public:
00235   // Auxiliary points are ThreeVectors for now; change to
00236   // G4VAuxiliaryPoints or some such (jacek 30/10/2002)
00237   void SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>* theNewVectorPointer ) {
00238     fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
00239   }
00240   std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const {
00241     return fpVectorOfAuxiliaryPointsPointer;
00242   }
00243 private:
00244   // Explicity including the word "Pointer" in the name as I keep
00245   // forgetting the * (jacek 30/10/2002)
00246   std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer;
00247 
00248 };
00249 
00250 #include "G4Step.icc"
00251 
00252 
00253 #endif

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