Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // 28 // 29 //-------------------------------------------- 30 // 31 // G4FastStep.hh 32 // 33 // Description: 34 // The G4FastStep class insures a friendly 35 // to manage the primary/secondaries final 36 // Fast Simulation Models. This includes fi 37 // particle (normalized direction of the mo 38 // secondary particles generated by the par 39 // 40 // The G4FastStep class acts also as the G4 41 // for the Fast Simulation Process. So it i 42 // the G4VParticleChange class and redefine 43 // methods : 44 // 45 // virtual G4Step* UpdateStepForAtRest(G4S 46 // virtual G4Step* UpdateStepForAlongStep( 47 // virtual G4Step* UpdateStepForPostStep(G 48 // virtual void Initialize(const G4Track&) 49 // 50 // History: 51 // Oct 97: Verderi && MoraDeFreitas - First 52 // Dec 97: Verderi - ForceSteppingHitInvoca 53 // Set/GetTotalEnergyDepo 54 // Apr 98: MoraDeFreitas - G4FastStep becom 55 // for the Fast Simulatio 56 // Nov 04: Verderi - Add ProposeXXX methods 57 // for backward compatibi 58 // 59 //-------------------------------------------- 60 61 #ifndef G4FastStep_h 62 #define G4FastStep_h 63 64 #include "G4ParticleMomentum.hh" 65 #include "G4ThreeVector.hh" 66 #include "G4ios.hh" 67 #include "globals.hh" 68 class G4DynamicParticle; 69 #include "G4FastTrack.hh" 70 #include "G4VParticleChange.hh" 71 72 //------------------------------------------- 73 // 74 // G4FastStep class 75 // 76 //------------------------------------------- 77 78 // Class Description: 79 // The final state of the particles after par 80 // reference. This final state is described a 81 // parameterisation has been invoked. 82 // 83 // To facilitate the developers work, changes 84 // momentum/polarization can be specified in 85 // global one. 86 // The default is local system coordinates. 87 // 88 89 class G4FastStep : public G4VParticleChange 90 { 91 public: // Without description 92 //------------------------ 93 // Constructor/Destructor 94 //------------------------ 95 G4FastStep() = default; 96 ~G4FastStep() override = default; 97 98 G4FastStep(const G4FastStep& right) = dele 99 G4FastStep& operator=(const G4FastStep& ri 100 101 // Set the kinetic energy of the primary t 102 // used by the stepping. 103 void KillPrimaryTrack(); 104 105 // -- Methods used to change the position, 106 // the momentum, time etc... of the primar 107 // .. space and time: 108 109 // Set the primary track final position. 110 void ProposePrimaryTrackFinalPosition(cons 111 112 // Set the primary track final position -- 113 [[deprecated("use ProposePrimaryTrackFinal 114 void SetPrimaryTrackFinalPosition(const G4 115 116 // Set the primary track final time. 117 void ProposePrimaryTrackFinalTime(G4double 118 119 // Set the primary track final time -- mai 120 [[deprecated("use ProposePrimaryTrackFinal 121 void SetPrimaryTrackFinalTime(G4double); 122 123 // Set the primary final track Proper Time 124 void ProposePrimaryTrackFinalProperTime(G4 125 126 // Set the primary final track Proper Time 127 [[deprecated("use ProposePrimaryTrackPrope 128 void SetPrimaryTrackFinalProperTime(G4doub 129 130 // .. dynamics: 131 132 // Be careful: the Track Final Momentum me 133 // of the momentum! 134 void ProposePrimaryTrackFinalMomentumDirec 135 136 137 // Set the primary track final momentum -- 138 // ProposePrimaryTrackMomentumDirection(.. 139 [[deprecated("use ProposePrimaryTrackMomen 140 void SetPrimaryTrackFinalMomentum(const G4 141 142 // Set the primary track final kinetic ene 143 void ProposePrimaryTrackFinalKineticEnergy 144 145 // Set the primary track final kinetic ene 146 [[deprecated("use ProposePrimaryTrackFinal 147 void SetPrimaryTrackFinalKineticEnergy(G4d 148 149 // Set the primary track final kinetic ene 150 void ProposePrimaryTrackFinalKineticEnergy 151 152 153 // Set the primary track final kinetic ene 154 // compatibility. 155 [[deprecated("use ProposePrimaryTrackFinal 156 void SetPrimaryTrackFinalKineticEnergyAndD 157 158 159 // Set the primary track final polarizatio 160 void ProposePrimaryTrackFinalPolarization( 161 162 // Set the primary track final polarizatio 163 [[deprecated("use ProposePrimaryTrackFinal 164 void SetPrimaryTrackFinalPolarization(cons 165 166 // Set the true path length of the primary 167 void ProposePrimaryTrackPathLength(G4doubl 168 169 // Set the true path length of the primary 170 // compatibility. 171 [[deprecated("use ProposePrimaryTrackPathL 172 void SetPrimaryTrackPathLength(G4double); 173 174 // Set the weight applied for event biasin 175 void ProposePrimaryTrackFinalEventBiasingW 176 177 // Set the weight applied for event biasin 178 [[deprecated("use ProposePrimaryTrackFinal 179 void SetPrimaryTrackFinalEventBiasingWeigh 180 181 // ------------------------------ 182 // -- Management of secondaries: 183 // ------------------------------ 184 185 // --------------------------------------- 186 // -- The creation of secondaries is Done 187 // -- 1) Give the total number of sec 188 // -- that the FastStep returns 189 // -- to the tracking using: 190 // -- SetNumberOfSecondaryTracks() 191 // -- 192 // -- 2) Invoke the CreateSecondaryTr 193 // -- to create one secondary at e 194 // --------------------------------------- 195 196 // Set the total number of secondaries tha 197 // -- Total Number of secondaries to be cr 198 // -- (to be called first) 199 void SetNumberOfSecondaryTracks(G4int); 200 201 // Returns the number of secondaries effec 202 // -- Number of secondaries effectively st 203 // -- (incremented at each CreateSecondary 204 // -- call) 205 G4int GetNumberOfSecondaryTracks(); 206 207 // -- Create a secondary: the arguments ar 208 // -- * G4DynamicsParticle: see header 209 // -- (allow to 210 // -- the normalized direction of momentum 211 // -- * G4ThreeVector : Polarizati 212 // -- * G4ThreeVector : Position 213 // -- * G4double : Time 214 // -- * G4bool : says if Po 215 // -- local coor 216 // -- Returned value: pointer to the track 217 G4Track* CreateSecondaryTrack(const G4Dyna 218 G4bool local 219 220 //-- Create a secondary: the difference wi 221 //-- is that the Polarization is not given 222 //-- in the G4DynamicParticle. 223 //-- Returned value: pointer to the track 224 G4Track* CreateSecondaryTrack(const G4Dyna 225 G4bool local 226 227 // Returns a pointer on the i-th secondary 228 G4Track* GetSecondaryTrack(G4int); 229 230 //---------------------------------------- 231 // 232 // Total energy deposit in the "fast Ste 233 // (a default should be provided in futu 234 // which can be: 235 // delta energy of primary - 236 // energy of the secondaries) 237 // This allow the user to Store a consis 238 // information in the G4Trajectory. 239 // 240 //---------------------------------------- 241 // Set the total energy deposited. 242 void ProposeTotalEnergyDeposited(G4double 243 244 // Set the total energy deposited -- kept 245 // It should be the delta energy of primar 246 [[deprecated("use ProposeTotalEnergyDeposi 247 void SetTotalEnergyDeposited(G4double anEn 248 249 // Returns the total energy deposited. 250 G4double GetTotalEnergyDeposited() const; 251 252 // Control of the stepping manager Hit inv 253 // 254 // In a usual parameterisation, the contro 255 // responsability in his G4VFastSimulation 256 // 257 // However, in the particular case the G4F 258 // replacement only (ie replaces all the * 259 // G4Step), the user can delegate to the G 260 // the Hit()method of the current sensitiv 261 // 262 // By default, the G4SteppingManager is as 263 // parameterisation is invoked. 264 void ForceSteppingHitInvocation(); 265 266 // ======================================= 267 // Stepping interface. 268 // ======================================= 269 // --- the following methods are for updat 270 // Return the pointer to the G4Step after 271 // by using final state information of the 272 // 273 // The Fast Simulation Mechanism doesn't c 274 // state on the AlongDoIt loop, so the def 275 // virtual G4Step* UpdateStepForAlongStep( 276 277 G4Step* UpdateStepForAtRest(G4Step* Step) 278 G4Step* UpdateStepForPostStep(G4Step* Step 279 280 // A Model gives the final state of the pa 281 // based on information of G4FastTrack. So 282 // Initialize method is an interface to th 283 // G4FastSimulationManager to Initialize t 284 // G4FastStep. 285 286 void Initialize(const G4FastTrack&); 287 288 // for Debug 289 void DumpInfo() const override; 290 G4bool CheckIt(const G4Track&) override; 291 292 private: 293 //======================================== 294 // Private Internal methods (implementatio 295 //======================================== 296 297 // G4FastStep should never be Initialized 298 // but we must define it to avoid compiler 299 void Initialize(const G4Track&) override; 300 301 // -- Utility functions -- 302 //--- methods to keep information of the f 303 // IMPORTANT NOTE: Although the name of t 304 // "Change", what it stores (and returns 305 // values of the Position, the normalize 306 // etc. 307 308 // Set theMomentumChange vector: it is the 309 // direction. 310 void SetMomentumChange(G4double Px, G4doub 311 void SetMomentumChange(const G4ThreeVector 312 313 //======================================== 314 // Data members. 315 //======================================== 316 // theMomentumChange is the vector contai 317 // direction after the invoked process. T 318 // of the momentum direction of the parti 319 // The responsibility to apply the change 320 // which invoked the process. 321 G4ParticleMomentum theMomentumChange; 322 323 // The changed (final) polarization of a 324 G4ThreeVector thePolarizationChange; 325 326 // The final kinetic energy of the curren 327 G4double theEnergyChange = 0.0; 328 329 // The changed (final) position of a give 330 G4ThreeVector thePositionChange; 331 332 // The changed (final) global time of a g 333 G4double theTimeChange = 0.0; 334 335 // The changed (final) proper time of a g 336 G4double theProperTimeChange = 0.0; 337 338 // The reference G4FastTrack 339 const G4FastTrack* fFastTrack = nullptr; 340 341 // weight for event biasing mechanism: 342 G4double theWeightChange = 0.0; 343 }; 344 345 //******************************************** 346 // 347 // Inline functions 348 // 349 //******************************************** 350 351 #include "G4FastStep.icc" 352 353 #endif 354