File indexing completed on 2025-01-18 09:58:08
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #ifndef G4DNAEventScheduler_hh
0028 #define G4DNAEventScheduler_hh 1
0029
0030 #include <G4VScheduler.hh>
0031 #include <vector>
0032 #include <map>
0033 #include <memory>
0034 #include "globals.hh"
0035 #include "G4ITModelHandler.hh"
0036 #include "G4ITStepStatus.hh"
0037 #include "G4ITTrackHolder.hh"
0038 #include "G4VStateDependent.hh"
0039 #include "G4ITReaction.hh"
0040 #include "G4DNAEventSet.hh"
0041 #include "G4DNAUpdateSystemModel.hh"
0042 #include "G4H2O2.hh"
0043 #include <CLHEP/Units/SystemOfUnits.h>
0044 class G4VITStepModel;
0045 class G4DNAGillespieDirectMethod;
0046 class G4UserMeshAction;
0047 class IEventScheduler
0048 {
0049 public:
0050 IEventScheduler() = default;
0051 virtual ~IEventScheduler() = default;
0052 };
0053
0054 class G4DNAEventScheduler : public IEventScheduler
0055 {
0056 public:
0057 using MolType = const G4MolecularConfiguration*;
0058 using MapList = std::map<MolType, size_t>;
0059 using MapCounter = std::map<MolType, G4int>;
0060 G4DNAEventScheduler();
0061 ~G4DNAEventScheduler() override;
0062 G4DNAEventScheduler(const G4DNAEventScheduler&) = delete;
0063 G4DNAEventScheduler& operator=(const G4DNAEventScheduler& right) = delete;
0064 void Initialize(const G4DNABoundingBox& boundingBox, G4int pixel);
0065 void InitializeInMesh();
0066 void Voxelizing();
0067 void ReVoxelizing(G4int);
0068 void SetEndTime(const G4double&);
0069 G4double GetStartTime() const;
0070 G4double GetEndTime() const;
0071 G4double GetTimeStep() const;
0072 void SetStartTime(G4double time);
0073
0074 inline void SetVerbose(G4int verbose) { fVerbose = verbose; }
0075 inline G4int GetVerbose() const;
0076 void Stepping();
0077 void SetChangeMesh(G4bool change) { fSetChangeMesh = change; }
0078
0079 void Reset();
0080 void ResetInMesh();
0081 void RunInMesh();
0082 void Run();
0083
0084 void AddTimeToRecord(const G4double& time);
0085
0086 void RecordTime();
0087 void ClearAndReChargeCounter();
0088 void PrintRecordTime();
0089 void Stop();
0090 void SetMaxNbSteps(G4int);
0091 std::map<G4double , MapCounter> GetCounterMap() const;
0092 G4DNAMesh* GetMesh() const;
0093 G4int GetPixels() const;
0094 void SetUserMeshAction(std::unique_ptr<G4UserMeshAction>);
0095 static G4bool CheckingReactionRadius(G4double resolution);
0096
0097 private:
0098 G4int fVerbose = 0;
0099 G4bool fInitialized = false;
0100 G4double fStartTime = 1 * CLHEP::picosecond;
0101 G4double fEndTime = 10000 * CLHEP::second;
0102 G4int fStepNumber = 0;
0103 G4int fMaxStep = INT_MAX;
0104 G4bool fRunning = true;
0105 G4double fTimeStep = DBL_MAX;
0106 G4double fGlobalTime = 1 * CLHEP::picosecond;
0107 G4double fJumpingNumber = 0;
0108 G4double fReactionNumber = 0;
0109 G4int fPixel = 0;
0110 G4bool fIsChangeMesh = false;
0111 G4bool fSetChangeMesh = true;
0112 G4int fStepNumberInMesh = 0;
0113 G4double fTransferTime = 0.;
0114 const G4double C = 20;
0115 const G4double D = G4H2O2::Definition()->GetDiffusionCoefficient();
0116
0117 std::unique_ptr<G4DNAMesh> fpMesh;
0118 std::unique_ptr<G4DNAGillespieDirectMethod> fpGillespieReaction;
0119 std::unique_ptr<G4DNAEventSet> fpEventSet;
0120 std::unique_ptr<G4DNAUpdateSystemModel> fpUpdateSystem;
0121 std::unique_ptr<G4UserMeshAction> fpUserMeshAction;
0122
0123 std::map<G4double , MapCounter> fCounterMap;
0124 std::set<G4double> fTimeToRecord;
0125 std::set<G4double>::iterator fLastRecoredTime;
0126 void ResetEventSet();
0127 void LastRegisterForCounter();
0128 };
0129 #endif