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 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /track/include/G4Step.hh (Version 11.3.0) and /track/include/G4Step.hh (Version 9.6)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // G4Step                                      << 
 27 //                                                 26 //
 28 // Class description:                          <<  27 // $Id$
 29 //                                                 28 //
 30 // This class represents the Step of a particl <<  29 //
 31 // It includes information of:                 <<  30 //---------------------------------------------------------------
                                                   >>  31 //
                                                   >>  32 // G4Step.hh
                                                   >>  33 //
                                                   >>  34 // Class Description:
                                                   >>  35 //   This class represents the Step of a particle tracked.
                                                   >>  36 //   It includes information of 
 32 //     1) List of Step points which compose th     37 //     1) List of Step points which compose the Step,
 33 //     2) static information of particle which <<  38 //     2) static information of particle which generated the 
                                                   >>  39 //        Step, 
 34 //     3) trackID and parent particle ID of th     40 //     3) trackID and parent particle ID of the Step,
 35 //     4) termination condition of the Step.   <<  41 //     4) termination condition of the Step,
 36                                                <<  42 //
 37 // Authors:                                    <<  43 // Contact:
 38 //   Katsuya Amako  (e-mail: Katsuya.Amako@kek <<  44 //   Questions and comments to this code should be sent to
 39 //   Takashi Sasaki (e-mail: Takashi.Sasaki@ke <<  45 //     Katsuya Amako  (e-mail: Katsuya.Amako@kek.jp)
 40 // Revisions:                                  <<  46 //     Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
 41 //   Hisaya Kurashige, 1998-2007               <<  47 //
 42 // ------------------------------------------- <<  48 // ---------------------------------------------------------------
 43 #ifndef G4Step_hh                              <<  49 //   Modified for the new G4ParticleChange          12 Mar. 1998  H.Kurahige
 44 #define G4Step_hh 1                            <<  50 //   Correct treatment of touchable in G4Step::UpdateTrack
 45                                                <<  51 //                                                  12 May. 1998 H.Kurashige
 46 #include <cstdlib>               // Include fr <<  52 // ---------------------------------------------------------------
 47 #include <cmath>                 // Include fr <<  53 //   Separate implementation of inline functions inti G4Step.icc
 48 #include "G4ios.hh"              // Include fr <<  54 //   Add updating mass/charge                        6 Oct. 1999 H.Kurashige
 49 #include <iomanip>               // Include fr <<  55 //   add nonIonizingEnergyLoss                      26 Mar. 2007 H.Kurashige 
 50 #include "globals.hh"            // Include fr <<  56 //
 51 #include "G4ThreeVector.hh"      // Include fr <<  57 //   Repository test - Dennis Wright
 52 #include "G4VPhysicalVolume.hh"  // Include fr <<  58 //
 53 #include "G4StepPoint.hh"        // Include fr <<  59 #ifndef G4Step_h
 54 #include "G4StepStatus.hh"       // Include fr <<  60 #define G4Step_h 1
 55 #include "G4TrackVector.hh"      // Include fr << 
 56                                                    61 
 57 class G4Polyline;                // Forward de <<  62 #include <stdlib.h>                 // Include from 'system'
 58 class G4Track;                   // Forward de <<  63 #include <cmath>                    // Include from 'system'
                                                   >>  64 #include "G4ios.hh"                 // Include from 'system'
                                                   >>  65 #include <iomanip>                  // Include from 'system'
                                                   >>  66 #include "globals.hh"               // Include from 'global'
                                                   >>  67 #include "G4ThreeVector.hh"         // Include from 'global'
                                                   >>  68 #include "G4VPhysicalVolume.hh"     // Include from 'geometry'
                                                   >>  69 #include "G4StepPoint.hh"           // Include from 'track'
                                                   >>  70 #include "G4StepStatus.hh"          // Include from 'track'
                                                   >>  71 class G4Polyline;                   // Forward declaration.
                                                   >>  72 class G4Track;                      // Forward declaration.
                                                   >>  73 #include "G4TrackVector.hh"           // Include from 'tracking'
 59                                                    74 
                                                   >>  75 ////////////
 60 class G4Step                                       76 class G4Step
                                                   >>  77 ////////////
 61 {                                                  78 {
 62   public:                                      << 
 63     G4Step();                                  << 
 64    ~G4Step();                                  << 
 65       // Constructor/Destructor                << 
 66                                                    79 
 67     G4Step(const G4Step&);                     <<  80 //--------
 68     G4Step& operator=(const G4Step&);          <<  81    public:
 69       // Copy Constructor and assignment opera << 
 70                                                << 
 71     inline G4Track* GetTrack() const;          << 
 72     inline void SetTrack(G4Track* value);      << 
 73       // Current track                         << 
 74                                                << 
 75     inline G4StepPoint* GetPreStepPoint() cons << 
 76     inline void SetPreStepPoint(G4StepPoint* v << 
 77     inline G4StepPoint* ResetPreStepPoint(G4St << 
 78       // Pre-Step points                       << 
 79       // If Set method is invoked, the previou << 
 80       // If Reset method is invoked, the previ << 
 81       // but its pointer is returned. Thus it' << 
 82       // properly delete it.                   << 
 83                                                << 
 84     inline G4StepPoint* GetPostStepPoint() con << 
 85     inline void SetPostStepPoint(G4StepPoint*  << 
 86     inline G4StepPoint* ResetPostStepPoint(G4S << 
 87       // Post-Step points                      << 
 88       // If Set method is invoked, the previou << 
 89       // If Reset method is invoked, the previ << 
 90       // but its pointer is returned. Thus it' << 
 91       // properly delete it.                   << 
 92                                                << 
 93     inline G4double GetStepLength() const;     << 
 94     inline void SetStepLength(G4double value); << 
 95       // Before the end of the AlongStepDoIt l << 
 96       // the initial value which is determined << 
 97       // proposed by a physics process. After  << 
 98       // it will be set equal to 'StepLength'  << 
 99                                                << 
100     inline G4double GetTotalEnergyDeposit() co << 
101     inline void SetTotalEnergyDeposit(G4double << 
102       // Total energy deposit                  << 
103                                                << 
104     inline G4double GetNonIonizingEnergyDeposi << 
105     inline void SetNonIonizingEnergyDeposit(G4 << 
106       // Total non-ionizing energy deposit     << 
107                                                << 
108     inline G4SteppingControl GetControlFlag()  << 
109     inline void SetControlFlag(G4SteppingContr << 
110       // Control flag for stepping             << 
111                                                << 
112     inline void AddTotalEnergyDeposit(G4double << 
113     inline void ResetTotalEnergyDeposit();     << 
114       // Manipulation of total energy deposit  << 
115                                                << 
116     inline void AddNonIonizingEnergyDeposit(G4 << 
117     inline void ResetNonIonizingEnergyDeposit( << 
118       // Manipulation of non-ionizing energy d << 
119                                                << 
120     inline G4bool IsFirstStepInVolume() const; << 
121     inline G4bool IsLastStepInVolume() const;  << 
122                                                << 
123     inline void SetFirstStepFlag();            << 
124     inline void ClearFirstStepFlag();          << 
125     inline void SetLastStepFlag();             << 
126     inline void ClearLastStepFlag();           << 
127       // Get/Set/Clear flag for initial/last s << 
128       // NOTE: flags are not used              << 
129                                                << 
130     inline G4ThreeVector GetDeltaPosition() co << 
131     inline G4double GetDeltaTime() const;      << 
132       // Difference of position, time, momentu << 
133                                                << 
134     inline G4ThreeVector GetDeltaMomentum() co << 
135     inline G4double GetDeltaEnergy() const;    << 
136       // These methods provide difference betw << 
137       // at a step, it is incorrect to use the << 
138       // deposition in media during the step,  << 
139       // be produced. For energy deposition us << 
140                                                << 
141     inline void InitializeStep(G4Track* aValue << 
142       // Initialize contents of G4Step         << 
143                                                << 
144     inline void UpdateTrack();                 << 
145       // Update track by using G4Step informat << 
146                                                << 
147     inline void CopyPostToPreStepPoint();      << 
148       // Copy PostStepPoint to PreStepPoint    << 
149                                                << 
150     inline void SetPointerToVectorOfAuxiliaryP << 
151     inline std::vector<G4ThreeVector>* GetPoin << 
152       // Auxiliary points modifiers            << 
153                                                << 
154   // --- Secondary buckets ---                 << 
155                                                << 
156     inline std::size_t GetNumberOfSecondariesI << 
157       // Secondaries in the current step       << 
158                                                << 
159     const std::vector<const G4Track*>* GetSeco << 
160                                                << 
161     inline const G4TrackVector* GetSecondary() << 
162     inline G4TrackVector* GetfSecondary();     << 
163     inline G4TrackVector* NewSecondaryVector() << 
164       // NOTE: Secondary bucket of the Step co << 
165       //       all secondaries during tracking << 
166       //       (i.e. NOT secondaries produced  << 
167       // all these methods give same object (i << 
168       // but 2nd one will create bucket in add << 
169                                                << 
170     inline void DeleteSecondaryVector();       << 
171       // Just delete secondary bucket          << 
172       // NOTE: G4Track objects inside the buck << 
173                                                << 
174     inline void SetSecondary(G4TrackVector* va << 
175       // Add secondary tracks to the bucket    << 
176                                                << 
177   protected:                                   << 
178                                                << 
179     G4double fTotalEnergyDeposit = 0.0;        << 
180       // Accumulated total energy deposit in t << 
181                                                << 
182     G4double fNonIonizingEnergyDeposit = 0.0;  << 
183      // Accumulated non-ionizing energy deposi << 
184                                                << 
185   private:                                     << 
186                                                << 
187     G4StepPoint* fpPreStepPoint = nullptr;     << 
188     G4StepPoint* fpPostStepPoint = nullptr;    << 
189     G4double fStepLength = 0.0;                << 
190       // Step length which may be updated at e << 
191       // AlongStepDoIt and PostStepDoIt        << 
192                                                << 
193     G4Track* fpTrack = nullptr;                << 
194                                                << 
195     G4SteppingControl fpSteppingControlFlag =  << 
196       // A flag to control SteppingManager beh << 
197                                                << 
198     G4bool fFirstStepInVolume = false;         << 
199     G4bool fLastStepInVolume = false;          << 
200       // Flags for initial/last step           << 
201                                                << 
202     G4TrackVector* fSecondary = nullptr;       << 
203       // Secondary bucket implemented by using << 
204                                                    82 
205     std::size_t nSecondaryByLastStep = 0;      <<  83 // Constructor/Destrcutor
206       // number of secondaries which have been <<  84    G4Step();
                                                   >>  85    ~G4Step();
207                                                    86 
208     std::vector<const G4Track*>* secondaryInCu <<  87 // Copy Counstructor and assignment operator
                                                   >>  88    G4Step(const G4Step& );
                                                   >>  89    G4Step & operator=(const G4Step &);   
                                                   >>  90 
                                                   >>  91 //--------
                                                   >>  92    public: // WIth description
                                                   >>  93 
                                                   >>  94 // Get/Set functions 
                                                   >>  95    // currnet track
                                                   >>  96    G4Track* GetTrack() const;
                                                   >>  97    void SetTrack(G4Track* value);
                                                   >>  98 
                                                   >>  99    // step points 
                                                   >> 100    G4StepPoint* GetPreStepPoint() const;
                                                   >> 101    void SetPreStepPoint(G4StepPoint* value);
                                                   >> 102 
                                                   >> 103    G4StepPoint* GetPostStepPoint() const;
                                                   >> 104    void SetPostStepPoint(G4StepPoint* value);
                                                   >> 105 
                                                   >> 106    // step length
                                                   >> 107    G4double GetStepLength() const;
                                                   >> 108    void SetStepLength(G4double value);
                                                   >> 109     // Before the end of the AlongStepDoIt loop,StepLength keeps
                                                   >> 110     // the initial value which is determined by the shortest geometrical Step
                                                   >> 111     // proposed by a physics process. After finishing the AlongStepDoIt,
                                                   >> 112     // it will be set equal to 'StepLength' in G4Step. 
                                                   >> 113 
                                                   >> 114    // total energy deposit 
                                                   >> 115    G4double GetTotalEnergyDeposit() const;
                                                   >> 116    void SetTotalEnergyDeposit(G4double value);
                                                   >> 117 
                                                   >> 118    // total non-ionizing energy deposit 
                                                   >> 119    G4double GetNonIonizingEnergyDeposit() const;
                                                   >> 120    void SetNonIonizingEnergyDeposit(G4double value);
                                                   >> 121 
                                                   >> 122    // cotrole flag for stepping
                                                   >> 123    G4SteppingControl GetControlFlag() const;
                                                   >> 124    void SetControlFlag(G4SteppingControl StepControlFlag);
                                                   >> 125 
                                                   >> 126     // manipulation of total energy deposit 
                                                   >> 127    void AddTotalEnergyDeposit(G4double value);
                                                   >> 128    void ResetTotalEnergyDeposit();
                                                   >> 129 
                                                   >> 130    // manipulation of non-ionizng energy deposit 
                                                   >> 131    void AddNonIonizingEnergyDeposit(G4double value);
                                                   >> 132    void ResetNonIonizingEnergyDeposit();
                                                   >> 133 
                                                   >> 134 
                                                   >> 135   // Get/Set/Clear flag for initial/last step
                                                   >> 136    // NOTE:  following flags are not used 
                                                   >> 137    //        will be ready in later release
                                                   >> 138    G4bool IsFirstStepInVolume() const;
                                                   >> 139    G4bool IsLastStepInVolume() const;
                                                   >> 140 
                                                   >> 141    void SetFirstStepFlag();
                                                   >> 142    void ClearFirstStepFlag();
                                                   >> 143    void SetLastStepFlag();
                                                   >> 144    void ClearLastStepFlag();
                                                   >> 145 
                                                   >> 146   // difference of position, time, momentum and energy
                                                   >> 147    G4ThreeVector GetDeltaPosition() const;
                                                   >> 148    G4double GetDeltaTime() const;
                                                   >> 149 
                                                   >> 150   // These methods will be deleted 
                                                   >> 151   // NOTE: use  GetTotalEnergyDeposit() to obtain 
                                                   >> 152   //       energy loss in the material 
                                                   >> 153   // 
                                                   >> 154    G4ThreeVector GetDeltaMomentum() const;
                                                   >> 155    G4double GetDeltaEnergy() const;
                                                   >> 156 
                                                   >> 157 
                                                   >> 158 // Other member functions
                                                   >> 159    void InitializeStep( G4Track* aValue );
                                                   >> 160    // initiaize contents of G4Step
                                                   >> 161 
                                                   >> 162    void UpdateTrack( );
                                                   >> 163    // update track by using G4Step information
                                                   >> 164 
                                                   >> 165    void CopyPostToPreStepPoint( );
                                                   >> 166    // copy PostStepPoint to PreStepPoint 
                                                   >> 167   
                                                   >> 168    G4Polyline* CreatePolyline () const;
                                                   >> 169    // for visualization
                                                   >> 170 
                                                   >> 171 //-----------
                                                   >> 172    protected:
                                                   >> 173 //-----------
                                                   >> 174 
                                                   >> 175 // Member data
                                                   >> 176    G4double fTotalEnergyDeposit;
                                                   >> 177      // Accummulated total energy desposit in the current Step
                                                   >> 178 
                                                   >> 179    G4double fNonIonizingEnergyDeposit;
                                                   >> 180      // Accummulated non-ionizing energy desposit in the current Step
                                                   >> 181 
                                                   >> 182 //---------
                                                   >> 183    private:
                                                   >> 184 //---------
                                                   >> 185 
                                                   >> 186 // Member data
                                                   >> 187    G4StepPoint* fpPreStepPoint;
                                                   >> 188    G4StepPoint* fpPostStepPoint;
                                                   >> 189    G4double fStepLength;
                                                   >> 190      // Step length which may be updated at each invocation of 
                                                   >> 191      // AlongStepDoIt and PostStepDoIt
                                                   >> 192    G4Track* fpTrack;
                                                   >> 193      //
                                                   >> 194    G4SteppingControl fpSteppingControlFlag;     
                                                   >> 195     // A flag to control SteppingManager behavier from process
                                                   >> 196 
                                                   >> 197   // flag for initial/last step
                                                   >> 198    G4bool fFirstStepInVolume;
                                                   >> 199    G4bool fLastStepInVolume;
                                                   >> 200 
                                                   >> 201 // Secondary buckets
                                                   >> 202 public:
                                                   >> 203   // secodaries in the current step
                                                   >> 204    const std::vector<const G4Track*>* GetSecondaryInCurrentStep() const; 
                                                   >> 205 
                                                   >> 206    // NOTE: Secondary bucket of the Step contains  
                                                   >> 207    //       all secondaries during tracking the current track 
                                                   >> 208    //       (i.e. NOT secondaries produced in the current step)
                                                   >> 209    // all following methods give same object (i.e. G4TrackVector  )
                                                   >> 210    // but 2nd one will create bucket in addition  
                                                   >> 211    const G4TrackVector* GetSecondary() const ;
                                                   >> 212    G4TrackVector* GetfSecondary();
                                                   >> 213    G4TrackVector* NewSecondaryVector();
                                                   >> 214 
                                                   >> 215    // just delete secondary bucket
                                                   >> 216    //  NOTE: G4Track objects inside the bucket are not deleted 
                                                   >> 217    void DeleteSecondaryVector();
                                                   >> 218 
                                                   >> 219    // Add secondary tracks to the bucket 
                                                   >> 220    void SetSecondary( G4TrackVector* value);
                                                   >> 221 
                                                   >> 222 private: 
                                                   >> 223    // Secondaty bucket implemented by using  std::vector of G4Track*   
                                                   >> 224    G4TrackVector* fSecondary;
                                                   >> 225 
                                                   >> 226    // number of secondaries which have been created by the last step
                                                   >> 227    G4int  nSecondaryByLastStep;
                                                   >> 228 
                                                   >> 229    typedef const G4Track* CT;
                                                   >> 230    std::vector<CT>* secondaryInCurrentStep;
                                                   >> 231 
                                                   >> 232   // Prototyping implementation of smooth representation of curved
                                                   >> 233   // trajectories. (jacek 30/10/2002)
                                                   >> 234 public:
                                                   >> 235   // Auxiliary points are ThreeVectors for now; change to
                                                   >> 236   // G4VAuxiliaryPoints or some such (jacek 30/10/2002)
                                                   >> 237   void SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>* theNewVectorPointer ) {
                                                   >> 238     fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
                                                   >> 239   }
                                                   >> 240   std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const {
                                                   >> 241     return fpVectorOfAuxiliaryPointsPointer;
                                                   >> 242   }
                                                   >> 243 private:
                                                   >> 244   // Explicity including the word "Pointer" in the name as I keep
                                                   >> 245   // forgetting the * (jacek 30/10/2002)
                                                   >> 246   std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer;
209                                                   247 
210     std::vector<G4ThreeVector>* fpVectorOfAuxi << 
211 };                                                248 };
212                                                   249 
213 #include "G4Step.icc"                             250 #include "G4Step.icc"
                                                   >> 251 
214                                                   252 
215 #endif                                            253 #endif
216                                                   254