Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // G4Step << 27 // 23 // 28 // Class description: << 24 // $Id: G4Step.hh,v 1.9 2002/11/01 15:55:30 jacek Exp $ >> 25 // GEANT4 tag $Name: geant4-05-01 $ 29 // 26 // 30 // This class represents the Step of a particl << 27 // 31 // It includes information of: << 28 //--------------------------------------------------------------- >> 29 // >> 30 // G4Step.hh >> 31 // >> 32 // Class Description: >> 33 // This class represents the Step of a particle tracked. >> 34 // It includes information of 32 // 1) List of Step points which compose th 35 // 1) List of Step points which compose the Step, 33 // 2) static information of particle which << 36 // 2) static information of particle which generated the >> 37 // Step, 34 // 3) trackID and parent particle ID of th 38 // 3) trackID and parent particle ID of the Step, 35 // 4) termination condition of the Step. << 39 // 4) termination condition of the Step, >> 40 // >> 41 // Contact: >> 42 // Questions and comments to this code should be sent to >> 43 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp) >> 44 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp) >> 45 // >> 46 // --------------------------------------------------------------- >> 47 // Modified for the new G4ParticleChange 12 Mar. 1998 H.Kurahige >> 48 // Correct treatment of touchable in G4Step::UpdateTrack >> 49 // 12 May. 1998 H.Kurashige >> 50 // --------------------------------------------------------------- >> 51 // Separate implementation of inline functions inti G4Step.icc >> 52 // Add updating mass/charge >> 53 // 6 Oct. 1999 H.Kurashige >> 54 // >> 55 #ifndef G4Step_h >> 56 #define G4Step_h 1 36 57 37 // Authors: << 58 #include <stdlib.h> // Include from 'system' 38 // Katsuya Amako (e-mail: Katsuya.Amako@kek << 59 #include "G4ios.hh" // Include from 'system' 39 // Takashi Sasaki (e-mail: Takashi.Sasaki@ke << 60 #include "g4std/iomanip" // Include from 'system' 40 // Revisions: << 61 #include "globals.hh" // Include from 'global' 41 // Hisaya Kurashige, 1998-2007 << 62 #include "G4ThreeVector.hh" // Include from 'global' 42 // ------------------------------------------- << 63 #include "G4VPhysicalVolume.hh" // Include from 'geometry' 43 #ifndef G4Step_hh << 64 #include "G4StepPoint.hh" // Include from 'track' 44 #define G4Step_hh 1 << 65 #include "G4StepStatus.hh" // Include from 'track' 45 << 66 class G4Polyline; // Forward declaration. 46 #include <cstdlib> // Include fr << 67 class G4Track; // Forward declaration. 47 #include <cmath> // Include fr << 48 #include "G4ios.hh" // Include fr << 49 #include <iomanip> // Include fr << 50 #include "globals.hh" // Include fr << 51 #include "G4ThreeVector.hh" // Include fr << 52 #include "G4VPhysicalVolume.hh" // Include fr << 53 #include "G4StepPoint.hh" // Include fr << 54 #include "G4StepStatus.hh" // Include fr << 55 #include "G4TrackVector.hh" // Include fr << 56 68 57 class G4Polyline; // Forward de << 58 class G4Track; // Forward de << 59 69 >> 70 //////////// 60 class G4Step 71 class G4Step >> 72 //////////// 61 { 73 { 62 public: << 63 G4Step(); << 64 ~G4Step(); << 65 // Constructor/Destructor << 66 74 67 G4Step(const G4Step&); << 75 //-------- 68 G4Step& operator=(const G4Step&); << 76 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 77 205 std::size_t nSecondaryByLastStep = 0; << 78 // Constructor/Destrcutor 206 // number of secondaries which have been << 79 G4Step(); >> 80 ~G4Step(); 207 81 208 std::vector<const G4Track*>* secondaryInCu << 82 //-------- >> 83 public: // WIth description >> 84 >> 85 // Get/Set functions >> 86 // currnet track >> 87 G4Track* GetTrack() const; >> 88 void SetTrack(G4Track* value); >> 89 >> 90 // step points >> 91 G4StepPoint* GetPreStepPoint() const; >> 92 void SetPreStepPoint(G4StepPoint* value); >> 93 >> 94 G4StepPoint* GetPostStepPoint() const; >> 95 void SetPostStepPoint(G4StepPoint* value); >> 96 >> 97 // step length >> 98 G4double GetStepLength() const; >> 99 void SetStepLength(G4double value); >> 100 >> 101 // total energy deposit >> 102 G4double GetTotalEnergyDeposit() const; >> 103 void SetTotalEnergyDeposit(G4double value); >> 104 >> 105 // cotrole flag for stepping >> 106 G4SteppingControl GetControlFlag() const; >> 107 void SetControlFlag(G4SteppingControl StepControlFlag); >> 108 >> 109 // difference of position, time, momentum and energy >> 110 G4ThreeVector GetDeltaPosition() const; >> 111 G4double GetDeltaTime() const; >> 112 >> 113 G4ThreeVector GetDeltaMomentum() const; >> 114 G4double GetDeltaEnergy() const; >> 115 >> 116 // manipulation of total energy deposit >> 117 void AddTotalEnergyDeposit(G4double value); >> 118 void ResetTotalEnergyDeposit(); >> 119 >> 120 >> 121 // Other member functions >> 122 void InitializeStep( G4Track* aValue ); >> 123 // initiaize contents of G4Step >> 124 >> 125 void UpdateTrack( ); >> 126 // update track by using G4Step information >> 127 >> 128 void CopyPostToPreStepPoint( ); >> 129 // copy PostStepPoint to PreStepPoint >> 130 >> 131 G4Polyline* CreatePolyline () const; >> 132 // for visualization >> 133 >> 134 //----------- >> 135 protected: >> 136 //----------- >> 137 >> 138 // Member data >> 139 G4double fTotalEnergyDeposit; >> 140 // Accummulated total energy desposit in the current Step >> 141 >> 142 //--------- >> 143 private: >> 144 //--------- >> 145 >> 146 // Member data >> 147 G4StepPoint* fpPreStepPoint; >> 148 G4StepPoint* fpPostStepPoint; >> 149 G4double fStepLength; >> 150 // Step length which may be updated at each invocation of >> 151 // AlongStepDoIt and PostStepDoIt >> 152 G4Track* fpTrack; >> 153 // >> 154 G4SteppingControl fpSteppingControlFlag; >> 155 // A flag to control SteppingManager behavier from process >> 156 >> 157 >> 158 // Prototyping implementation of smooth representation of curved >> 159 // trajectories. (jacek 30/10/2002) >> 160 public: >> 161 // Auxiliary points are ThreeVectors for now; change to >> 162 // G4VAuxiliaryPoints or some such (jacek 30/10/2002) >> 163 void SetPointerToVectorOfAuxiliaryPoints( G4std::vector<G4ThreeVector>* theNewVectorPointer ) { >> 164 fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer; >> 165 } >> 166 G4std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const { >> 167 return fpVectorOfAuxiliaryPointsPointer; >> 168 } >> 169 private: >> 170 // Explicity including the word "Pointer" in the name as I keep >> 171 // forgetting the * (jacek 30/10/2002) >> 172 G4std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer; 209 173 210 std::vector<G4ThreeVector>* fpVectorOfAuxi << 211 }; 174 }; 212 175 213 #include "G4Step.icc" 176 #include "G4Step.icc" >> 177 214 178 215 #endif 179 #endif 216 180