Geant4 Cross Reference |
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 // $Id: G4ITStepManager.hh 60427 2012-07-11 16:34:35Z matkara $ 26 // 27 // 27 // Author: Mathieu Karamitros 28 // Author: Mathieu Karamitros 28 29 29 // The code is developed in the framework of t 30 // The code is developed in the framework of the ESA AO7146 30 // 31 // 31 // We would be very happy hearing from you, se 32 // We would be very happy hearing from you, send us your feedback! :) 32 // 33 // 33 // In order for Geant4-DNA to be maintained an 34 // In order for Geant4-DNA to be maintained and still open-source, 34 // article citations are crucial. << 35 // article citations are crucial. 35 // If you use Geant4-DNA chemistry and you pub << 36 // If you use Geant4-DNA chemistry and you publish papers about your software, 36 // in addition to the general paper on Geant4- 37 // in addition to the general paper on Geant4-DNA: 37 // 38 // 38 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 39 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178 39 // 40 // 40 // we would be very happy if you could please 41 // we would be very happy if you could please also cite the following 41 // reference papers on chemistry: 42 // reference papers on chemistry: 42 // 43 // 43 // J. Comput. Phys. 274 (2014) 841-882 44 // J. Comput. Phys. 274 (2014) 841-882 44 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508 << 45 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508 >> 46 >> 47 45 48 46 #ifndef G4Scheduler_h 49 #ifndef G4Scheduler_h 47 #define G4Scheduler_h 50 #define G4Scheduler_h 48 51 >> 52 #include <G4VScheduler.hh> >> 53 #include <vector> >> 54 #include <map> >> 55 #include <memory> >> 56 >> 57 #include "globals.hh" >> 58 49 #include "G4ITModelHandler.hh" 59 #include "G4ITModelHandler.hh" 50 #include "G4ITReaction.hh" << 51 #include "G4ITStepStatus.hh" 60 #include "G4ITStepStatus.hh" 52 #include "G4ITTrackHolder.hh" 61 #include "G4ITTrackHolder.hh" 53 #include "G4VScavengerMaterial.hh" << 54 #include "G4VStateDependent.hh" 62 #include "G4VStateDependent.hh" 55 #include "globals.hh" << 63 #include "G4ITReaction.hh" 56 << 57 #include <G4VScheduler.hh> << 58 << 59 #include <map> << 60 #include <memory> << 61 #include <vector> << 62 64 63 class G4ITTrackingManager; 65 class G4ITTrackingManager; 64 class G4ITModelProcessor; 66 class G4ITModelProcessor; 65 class G4ITStepProcessor; 67 class G4ITStepProcessor; 66 class G4Track; 68 class G4Track; 67 class G4UserTimeStepAction; 69 class G4UserTimeStepAction; 68 class G4SchedulerMessenger; 70 class G4SchedulerMessenger; 69 class G4ITTrackingInteractivity; 71 class G4ITTrackingInteractivity; 70 class G4ITGun; 72 class G4ITGun; 71 73 72 #ifndef compTrackPerID__ 74 #ifndef compTrackPerID__ 73 # define compTrackPerID__ << 75 #define compTrackPerID__ 74 struct compTrackPerID << 76 struct compTrackPerID 75 { << 77 { 76 G4bool operator()(G4Track* rhs, G4Track* l << 78 bool operator()(G4Track* rhs, G4Track* lhs) const 77 { 79 { 78 return rhs->GetTrackID() < lhs->GetTrack 80 return rhs->GetTrackID() < lhs->GetTrackID(); 79 } 81 } 80 }; << 82 }; 81 #endif 83 #endif 82 84 83 /** 85 /** 84 * G4Scheduler synchronizes (in time) track st 86 * G4Scheduler synchronizes (in time) track stepping 85 */ 87 */ 86 class G4Scheduler : public G4VScheduler, publi << 88 class G4Scheduler : 87 { << 89 public G4VScheduler, 88 protected: << 90 public G4VStateDependent 89 ~G4Scheduler() override; << 91 { 90 << 92 protected: 91 public: << 93 virtual ~G4Scheduler(); 92 G4Scheduler(const G4Scheduler&) = delete; << 94 93 G4Scheduler& operator=(const G4Scheduler&) << 95 public: 94 << 96 static G4Scheduler* Instance(); 95 static G4Scheduler* Instance(); << 97 /** DeleteInstance should be used instead 96 /** DeleteInstance should be used instead << 98 * of the destructor 97 * of the destructor << 99 */ 98 */ << 100 static void DeleteInstance(); 99 static void DeleteInstance(); << 101 virtual G4bool Notify(G4ApplicationState requestedState); 100 G4bool Notify(G4ApplicationState requested << 102 101 << 103 virtual void RegisterModel(G4VITStepModel*, double); 102 void RegisterModel(G4VITStepModel*, G4doub << 104 103 << 105 void Initialize(); 104 void Initialize() override; << 106 void ForceReinitialization(); 105 void ForceReinitialization(); << 107 inline bool IsInitialized(); 106 inline G4bool IsInitialized(); << 108 inline bool IsRunning(){return fRunning;} 107 inline G4bool IsRunning() override { retur << 109 void Reset(); 108 void Reset() override; << 110 void Process(); 109 void Process() override; << 111 void ClearList(); 110 void ClearList(); << 112 111 << 113 inline void SetGun(G4ITGun*); 112 inline void SetGun(G4ITGun*) override; << 114 inline G4ITGun* GetGun(); 113 inline G4ITGun* GetGun(); << 115 114 << 116 inline void Stop(); 115 inline void Stop(); << 117 void Clear(); 116 void Clear(); << 118 117 << 119 // To be called only in UserReactionAction::EndProcessing() 118 // To be called only in UserReactionAction << 120 // after fRunning flag has been turned off. 119 // after fRunning flag has been turned off << 121 // This is not done automatically before UserReactionAction::EndProcessing() 120 // This is not done automatically before U << 122 // is called in case one would like to access some track information 121 // is called in case one would like to acc << 123 void EndTracking(); 122 void EndTracking(); << 124 123 << 125 void SetEndTime(const double); 124 void SetEndTime(const G4double) override; << 126 125 << 127 /* Two tracks below the time tolerance are supposed to be 126 /* Two tracks below the time tolerance are << 128 * in the same time slice 127 * in the same time slice << 129 */ 128 */ << 130 inline void SetTimeTolerance(double); 129 inline void SetTimeTolerance(G4double) ove << 131 inline double GetTimeTolerance() const; 130 inline G4double GetTimeTolerance() const o << 132 131 << 133 inline void SetMaxZeroTimeAllowed(int); 132 inline void SetMaxZeroTimeAllowed(G4int) o << 134 inline int GetMaxZeroTimeAllowed() const; 133 inline G4int GetMaxZeroTimeAllowed() const << 135 134 << 136 inline G4ITModelHandler* GetModelHandler(); 135 inline G4ITModelHandler* GetModelHandler() << 137 136 << 138 inline void SetTimeSteps(std::map<double, double>*); 137 inline void SetTimeSteps(std::map<G4double << 139 inline void AddTimeStep(double, double); 138 inline void AddTimeStep(G4double, G4double << 140 inline void SetDefaultTimeStep(double); 139 inline void SetDefaultTimeStep(G4double) o << 141 double GetLimitingTimeStep() const; 140 G4double GetLimitingTimeStep() const overr << 142 inline G4int GetNbSteps() const; 141 inline G4int GetNbSteps() const override; << 143 inline void SetMaxNbSteps(G4int); 142 inline void SetMaxNbSteps(G4int) override; << 144 inline G4int GetMaxNbSteps() const; 143 inline G4int GetMaxNbSteps() const overrid << 145 inline G4double GetStartTime() const; 144 inline G4double GetStartTime() const overr << 146 inline G4double GetEndTime() const; 145 inline G4double GetEndTime() const overrid << 147 virtual inline G4double GetTimeStep() const; 146 inline G4double GetTimeStep() const overri << 148 inline G4double GetPreviousTimeStep() const; 147 inline G4double GetPreviousTimeStep() cons << 149 inline G4double GetGlobalTime() const; 148 inline G4double GetGlobalTime() const over << 150 inline void SetUserAction(G4UserTimeStepAction*); 149 inline void SetUserAction(G4UserTimeStepAc << 151 inline G4UserTimeStepAction* GetUserTimeStepAction() const; 150 inline G4UserTimeStepAction* GetUserTimeSt << 152 151 << 153 // To use with transportation only, no reactions 152 // To use with transportation only, no rea << 154 inline void UseDefaultTimeSteps(G4bool); 153 inline void UseDefaultTimeSteps(G4bool); << 155 inline G4bool AreDefaultTimeStepsUsed(); 154 inline G4bool AreDefaultTimeStepsUsed(); << 156 155 << 157 inline G4ITStepStatus GetStatus() const; 156 inline G4ITStepStatus GetStatus() const; << 158 157 << 159 /* 1 : Reaction information 158 /* 1 : Reaction information << 160 * 2 : (1) + time step information 159 * 2 : (1) + time step information << 161 * 3 : (2) + step info for individual tracks 160 * 3 : (2) + step info for individual trac << 162 * 4 : (2) + trackList processing info + pushed and killed track info 161 * 4 : (2) + trackList processing info + p << 163 */ 162 */ << 164 inline void SetVerbose(int); 163 inline void SetVerbose(G4int) override; << 165 164 << 166 inline int GetVerbose() const; 165 inline G4int GetVerbose() const; << 167 166 << 168 inline void WhyDoYouStop(); 167 inline void WhyDoYouStop(); << 169 168 << 170 void SetInteractivity(G4ITTrackingInteractivity*); 169 void SetInteractivity(G4ITTrackingInteract << 171 inline G4ITTrackingInteractivity* GetInteractivity(); 170 inline G4ITTrackingInteractivity* GetInter << 172 171 << 173 virtual size_t GetNTracks(); 172 virtual size_t GetNTracks(); << 174 >> 175 void GetCollisionType(G4String& interactionType); >> 176 >> 177 void AddWatchedTime(double time) >> 178 { >> 179 fWatchedTimes.insert(time); >> 180 } 173 181 174 void GetCollisionType(G4String& interactio << 182 double GetNextWatchedTime() const; 175 183 176 void AddWatchedTime(G4double time) { fWatc << 184 inline void SetMaxTimeStep(double maxTimeStep) >> 185 { >> 186 fMaxTimeStep = maxTimeStep; >> 187 } 177 188 178 G4double GetNextWatchedTime() const; << 189 inline double GetMaxTimeStep() const >> 190 { >> 191 return fMaxTimeStep; >> 192 } 179 193 180 inline void SetMaxTimeStep(G4double maxTim << 194 protected: 181 195 182 inline G4double GetMaxTimeStep() const { r << 196 void DoProcess(); >> 197 void SynchronizeTracks(); >> 198 void Stepping(); >> 199 >> 200 void FindUserPreDefinedTimeStep(); >> 201 >> 202 bool CanICarryOn(); >> 203 >> 204 void PrintWhyDoYouStop(); >> 205 >> 206 private: >> 207 G4Scheduler(); >> 208 void Create(); >> 209 G4Scheduler(const G4Scheduler&); >> 210 G4Scheduler& operator=(const G4Scheduler&); >> 211 >> 212 G4SchedulerMessenger* fpMessenger; >> 213 >> 214 static G4ThreadLocal G4Scheduler* fgScheduler; >> 215 int fVerbose; >> 216 bool fWhyDoYouStop; >> 217 bool fInitialized; >> 218 bool fRunning; >> 219 G4bool fContinue; >> 220 >> 221 int fNbSteps; >> 222 int fMaxSteps; >> 223 >> 224 G4ITStepStatus fITStepStatus; >> 225 >> 226 // Time members >> 227 G4bool fUseDefaultTimeSteps; >> 228 double fTimeTolerance; >> 229 double fGlobalTime; >> 230 double fTmpGlobalTime; >> 231 double fStartTime; >> 232 double fStopTime; >> 233 double fEndTime; >> 234 double fPreviousTimeStep; >> 235 int fZeroTimeCount; >> 236 int fMaxNZeroTimeStepsAllowed; >> 237 >> 238 double fTimeStep; // The selected minimum time step >> 239 double fMaxTimeStep; >> 240 >> 241 // User steps >> 242 bool fUsePreDefinedTimeSteps; >> 243 double fDefaultMinTimeStep; >> 244 std::map<double, double>* fpUserTimeSteps; >> 245 // One can give time steps in respect to the global time >> 246 mutable double fUserUpperTimeLimit; >> 247 double fDefinedMinTimeStep; >> 248 // selected user time step in respect to the global time >> 249 bool fReachedUserTimeLimit; // if fMinTimeStep == the user time step >> 250 >> 251 std::set<double> fWatchedTimes; >> 252 >> 253 G4UserTimeStepAction* fpUserTimeStepAction; >> 254 >> 255 // ========================================== >> 256 // TO BE REMOVED >> 257 G4ITStepProcessor* fpStepProcessor; >> 258 G4ITModelProcessor* fpModelProcessor; >> 259 G4ITTrackingManager* fpTrackingManager; >> 260 G4ITTrackingInteractivity* fpTrackingInteractivity; >> 261 G4ITReactionSet* fReactionSet; >> 262 G4ITTrackHolder& fTrackContainer; >> 263 G4ITModelHandler* fpModelHandler; >> 264 // ========================================== >> 265 >> 266 double fTSTimeStep; >> 267 // Time calculated by the time stepper in CalculateMinTimeStep() >> 268 double fILTimeStep; >> 269 // Time calculated by the interaction length methods >> 270 // in ComputeInteractionLength() >> 271 >> 272 bool fInteractionStep; >> 273 // Flag : if the step is driven by the interaction with the matter and >> 274 // NOT by the reaction between tracks 183 275 184 inline G4VScavengerMaterial* GetScavengerM << 276 G4ITGun* fpGun; 185 inline void SetScavengerMaterial(std::uniq << 186 { << 187 fpUserScavenger = std::move(scavengerMat << 188 } << 189 277 190 protected: << 278 // ========================================== 191 void DoProcess(); << 279 // 192 void SynchronizeTracks(); << 193 void Stepping(); << 194 << 195 void FindUserPreDefinedTimeStep(); << 196 << 197 G4bool CanICarryOn(); << 198 << 199 void PrintWhyDoYouStop(); << 200 << 201 private: << 202 G4Scheduler(); << 203 void Create(); << 204 << 205 G4SchedulerMessenger* fpMessenger = nullpt << 206 << 207 static G4ThreadLocal G4Scheduler* fgSchedu << 208 G4int fVerbose; << 209 G4bool fWhyDoYouStop; << 210 G4bool fInitialized; << 211 G4bool fRunning; << 212 G4bool fContinue; << 213 << 214 G4int fNbSteps; << 215 G4int fMaxSteps; << 216 << 217 G4ITStepStatus fITStepStatus; << 218 << 219 // Time members << 220 G4bool fUseDefaultTimeSteps; << 221 G4double fTimeTolerance; << 222 G4double fGlobalTime; << 223 G4double fStartTime; << 224 G4double fStopTime; << 225 G4double fEndTime; << 226 G4double fPreviousTimeStep; << 227 G4int fZeroTimeCount; << 228 G4int fMaxNZeroTimeStepsAllowed; << 229 << 230 G4double fTimeStep; // The selected minim << 231 G4double fMaxTimeStep; << 232 << 233 // User steps << 234 G4bool fUsePreDefinedTimeSteps; << 235 G4double fDefaultMinTimeStep; << 236 std::map<G4double, G4double>* fpUserTimeSt << 237 // One can give time steps in respect to t << 238 mutable G4double fUserUpperTimeLimit; << 239 G4double fDefinedMinTimeStep; << 240 // selected user time step in respect to t << 241 G4bool fReachedUserTimeLimit; // if fMinT << 242 << 243 std::set<G4double> fWatchedTimes; << 244 << 245 G4UserTimeStepAction* fpUserTimeStepAction << 246 << 247 std::unique_ptr<G4VScavengerMaterial> fpUs << 248 << 249 // ======================================= << 250 // TO BE REMOVED << 251 G4ITStepProcessor* fpStepProcessor = nullp << 252 G4ITModelProcessor* fpModelProcessor = nul << 253 G4ITTrackingManager* fpTrackingManager = n << 254 G4ITTrackingInteractivity* fpTrackingInter << 255 G4ITReactionSet* fReactionSet = nullptr; << 256 G4ITTrackHolder& fTrackContainer; << 257 G4ITModelHandler* fpModelHandler = nullptr << 258 // ======================================= << 259 << 260 G4double fTSTimeStep; << 261 // Time calculated by the time stepper in << 262 G4double fILTimeStep; << 263 // Time calculated by the interaction leng << 264 // in ComputeInteractionLength() << 265 << 266 G4bool fInteractionStep; << 267 // Flag : if the step is driven by the int << 268 // NOT by the reaction between tracks << 269 << 270 G4ITGun* fpGun; << 271 << 272 // ======================================= << 273 // Hoang << 274 G4bool fResetScavenger; << 275 280 276 public: << 277 void ResetScavenger(bool); << 278 }; 281 }; 279 282 280 inline G4bool G4Scheduler::IsInitialized() << 283 inline bool G4Scheduler::IsInitialized() 281 { 284 { 282 return fInitialized; 285 return fInitialized; 283 } 286 } 284 287 285 inline G4ITModelHandler* G4Scheduler::GetModel 288 inline G4ITModelHandler* G4Scheduler::GetModelHandler() 286 { 289 { 287 return fpModelHandler; 290 return fpModelHandler; 288 } 291 } 289 292 290 inline void G4Scheduler::SetEndTime(const G4do << 293 inline void G4Scheduler::SetEndTime(const double __endtime) 291 { 294 { 292 fEndTime = __endtime; 295 fEndTime = __endtime; 293 } 296 } 294 297 295 inline void G4Scheduler::SetTimeSteps(std::map << 298 inline >> 299 void G4Scheduler::SetTimeSteps(std::map<double, double>* steps) 296 { 300 { 297 fUsePreDefinedTimeSteps = true; 301 fUsePreDefinedTimeSteps = true; 298 fpUserTimeSteps = steps; 302 fpUserTimeSteps = steps; 299 } 303 } 300 304 301 inline void G4Scheduler::AddTimeStep(G4double << 305 inline void G4Scheduler::AddTimeStep(double startingTime, double timeStep) 302 { 306 { 303 if (fpUserTimeSteps == nullptr) { << 307 if (fpUserTimeSteps == 0) 304 fpUserTimeSteps = new std::map<G4double, G << 308 { >> 309 fpUserTimeSteps = new std::map<double, double>(); 305 fUsePreDefinedTimeSteps = true; 310 fUsePreDefinedTimeSteps = true; 306 } 311 } 307 312 308 (*fpUserTimeSteps)[startingTime] = timeStep; 313 (*fpUserTimeSteps)[startingTime] = timeStep; 309 } 314 } 310 315 311 inline G4int G4Scheduler::GetNbSteps() const 316 inline G4int G4Scheduler::GetNbSteps() const 312 { 317 { 313 return fNbSteps; 318 return fNbSteps; 314 } 319 } 315 320 316 inline void G4Scheduler::SetMaxNbSteps(G4int m 321 inline void G4Scheduler::SetMaxNbSteps(G4int maxSteps) 317 { 322 { 318 fMaxSteps = maxSteps; 323 fMaxSteps = maxSteps; 319 } 324 } 320 325 321 inline G4int G4Scheduler::GetMaxNbSteps() cons 326 inline G4int G4Scheduler::GetMaxNbSteps() const 322 { 327 { 323 return fMaxSteps; 328 return fMaxSteps; 324 } 329 } 325 330 326 inline G4double G4Scheduler::GetStartTime() co 331 inline G4double G4Scheduler::GetStartTime() const 327 { 332 { 328 return fStartTime; 333 return fStartTime; 329 } 334 } 330 335 331 inline G4double G4Scheduler::GetEndTime() cons 336 inline G4double G4Scheduler::GetEndTime() const 332 { 337 { 333 return fEndTime; 338 return fEndTime; 334 } 339 } 335 340 336 inline G4double G4Scheduler::GetTimeStep() con 341 inline G4double G4Scheduler::GetTimeStep() const 337 { 342 { 338 return fTimeStep; 343 return fTimeStep; 339 } 344 } 340 345 341 inline void G4Scheduler::SetDefaultTimeStep(G4 << 346 inline void G4Scheduler::SetDefaultTimeStep(double timeStep) 342 { 347 { 343 fDefaultMinTimeStep = timeStep; 348 fDefaultMinTimeStep = timeStep; 344 } 349 } 345 350 346 inline G4double G4Scheduler::GetGlobalTime() c 351 inline G4double G4Scheduler::GetGlobalTime() const 347 { 352 { 348 return fGlobalTime; 353 return fGlobalTime; 349 } 354 } 350 355 351 inline void G4Scheduler::SetUserAction(G4UserT << 356 inline >> 357 void G4Scheduler::SetUserAction(G4UserTimeStepAction* userITAction) 352 { 358 { 353 fpUserTimeStepAction = userITAction; 359 fpUserTimeStepAction = userITAction; 354 } 360 } 355 361 356 inline G4UserTimeStepAction* G4Scheduler::GetU 362 inline G4UserTimeStepAction* G4Scheduler::GetUserTimeStepAction() const 357 { 363 { 358 return fpUserTimeStepAction; 364 return fpUserTimeStepAction; 359 } 365 } 360 366 361 inline void G4Scheduler::SetVerbose(G4int verb << 367 inline void G4Scheduler::SetVerbose(int verbose) 362 { 368 { 363 fVerbose = verbose; 369 fVerbose = verbose; 364 } 370 } 365 371 366 inline G4int G4Scheduler::GetVerbose() const << 372 inline int G4Scheduler::GetVerbose() const 367 { 373 { 368 return fVerbose; 374 return fVerbose; 369 } 375 } 370 376 371 inline void G4Scheduler::SetMaxZeroTimeAllowed << 377 inline >> 378 void G4Scheduler::SetMaxZeroTimeAllowed(int maxTimeStepAllowed) 372 { 379 { 373 fMaxNZeroTimeStepsAllowed = maxTimeStepAllow 380 fMaxNZeroTimeStepsAllowed = maxTimeStepAllowed; 374 } 381 } 375 382 376 inline G4int G4Scheduler::GetMaxZeroTimeAllowe << 383 inline int G4Scheduler::GetMaxZeroTimeAllowed() const 377 { 384 { 378 return fMaxNZeroTimeStepsAllowed; 385 return fMaxNZeroTimeStepsAllowed; 379 } 386 } 380 387 381 inline void G4Scheduler::SetTimeTolerance(G4do << 388 inline void G4Scheduler::SetTimeTolerance(double time) 382 { 389 { 383 fTimeTolerance = time; 390 fTimeTolerance = time; 384 } 391 } 385 392 386 inline G4double G4Scheduler::GetTimeTolerance( << 393 inline double G4Scheduler::GetTimeTolerance() const 387 { 394 { 388 return fTimeTolerance; 395 return fTimeTolerance; 389 } 396 } 390 397 391 inline G4double G4Scheduler::GetPreviousTimeSt 398 inline G4double G4Scheduler::GetPreviousTimeStep() const 392 { 399 { 393 return fPreviousTimeStep; 400 return fPreviousTimeStep; 394 } 401 } 395 402 396 inline G4ITStepStatus G4Scheduler::GetStatus() 403 inline G4ITStepStatus G4Scheduler::GetStatus() const 397 { 404 { 398 return fITStepStatus; 405 return fITStepStatus; 399 } 406 } 400 407 401 inline void G4Scheduler::Stop() 408 inline void G4Scheduler::Stop() 402 { 409 { 403 fContinue = false; 410 fContinue = false; 404 } 411 } 405 412 406 inline G4ITTrackingInteractivity* G4Scheduler: 413 inline G4ITTrackingInteractivity* G4Scheduler::GetInteractivity() 407 { 414 { 408 return fpTrackingInteractivity; 415 return fpTrackingInteractivity; 409 } 416 } 410 417 411 inline void G4Scheduler::SetGun(G4ITGun* gun) 418 inline void G4Scheduler::SetGun(G4ITGun* gun) 412 { 419 { 413 fpGun = gun; 420 fpGun = gun; 414 } 421 } 415 422 416 inline G4ITGun* G4Scheduler::GetGun() 423 inline G4ITGun* G4Scheduler::GetGun() 417 { 424 { 418 return fpGun; 425 return fpGun; 419 } 426 } 420 427 421 inline void G4Scheduler::WhyDoYouStop() 428 inline void G4Scheduler::WhyDoYouStop() 422 { 429 { 423 fWhyDoYouStop = true; 430 fWhyDoYouStop = true; 424 } 431 } 425 432 426 inline void G4Scheduler::UseDefaultTimeSteps(G 433 inline void G4Scheduler::UseDefaultTimeSteps(G4bool flag) 427 { 434 { 428 fUseDefaultTimeSteps = flag; 435 fUseDefaultTimeSteps = flag; 429 } 436 } 430 437 431 inline G4bool G4Scheduler::AreDefaultTimeSteps 438 inline G4bool G4Scheduler::AreDefaultTimeStepsUsed() 432 { 439 { 433 return (!fUseDefaultTimeSteps && !fUsePreDef << 440 return (fUseDefaultTimeSteps == false && fUsePreDefinedTimeSteps == false); 434 } << 435 << 436 inline void G4Scheduler::ResetScavenger(bool v << 437 { << 438 fResetScavenger = value; << 439 } 441 } 440 442 441 #endif 443 #endif 442 444