File indexing completed on 2025-01-31 09:21:58
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
0028
0029
0030
0031
0032
0033
0034 #ifndef doiPETRun_h
0035 #define doiPETRun_h 1
0036
0037 #include "G4Run.hh"
0038 #include "G4VProcess.hh"
0039 #include "globals.hh"
0040
0041 #include <iostream>
0042 #include <fstream>
0043 #include <sstream>
0044 #include <map>
0045 #include <set>
0046 class doiPETDetectorConstruction;
0047 class G4ParticleDefinition;
0048 class doiPETRunAction;
0049
0050
0051 class InteractionInformation;
0052 class doiPETAnalysis;
0053 class doiPETRun : public G4Run
0054 {
0055 public:
0056 doiPETRun();
0057 ~doiPETRun();
0058
0059 public:
0060
0061 void GetIntractionInfomation(InteractionInformation*);
0062 void FindInteractingCrystal();
0063 void Clear();
0064 void OpenRun(G4String);
0065 void GetEventIDRun(G4int);
0066 void CalulateAcquisitionTime();
0067 void SetAnnihilationTime(G4double);
0068 void SetEventID(G4int);
0069 virtual void Merge(const G4Run*);
0070 G4ThreeVector CenterOfMassInteractionPos(const std::vector<G4int>&, const std::vector<G4double>&, G4double, const std::vector<G4ThreeVector>&);
0071
0072
0073 private:
0074
0075 std::multimap< G4int, InteractionInformation* > mapBlockInteraction;
0076 std::set<G4int> setBlockInteraction;
0077 std::ofstream ofs;
0078
0079 std::vector<G4int> crystalID_vec;
0080 std::vector<G4ThreeVector> posInter_vec;
0081 std::vector<G4double>edepInCry_vec;
0082
0083
0084 G4ThreeVector posInterInCrystal;
0085
0086 G4int eventID;
0087 doiPETRunAction* fRunAction;
0088 doiPETAnalysis* fAnalysis;
0089 G4double totalEdep;
0090 G4int blockID, crystalID;
0091
0092 G4double totalTime;
0093 G4double prev_totalTime;
0094 G4double timeInterval;
0095
0096 G4ThreeVector interactionPos;
0097
0098 G4double interactionTime;
0099 G4double timeOfAnnihil;
0100
0101 G4int numberofInteractions;
0102 G4double edep;
0103 G4double edepMax;
0104 G4double edep_AfterCrystalBlurring;
0105
0106 };
0107
0108
0109
0110 class InteractionInformation
0111 {
0112
0113 public:
0114 InteractionInformation(){;};
0115 ~InteractionInformation(){;};
0116
0117
0118 void SetEdep(G4double e) {edep=e;};
0119
0120
0121 void SetBlockNo(G4int n) {blockNo=n;};
0122
0123
0124 void SetCrystalNo(G4int n) {crystalNo=n;};
0125
0126
0127 void SetGlobalTime(G4double t){globalTime=t;};
0128
0129
0130 void SetInteractionPositionInCrystal(G4ThreeVector pos){crystalPosition = pos;};
0131
0132
0133 G4double GetEdep() {return edep;};
0134 G4int GetBlockNo() {return blockNo;};
0135 G4int GetCrystalNo() {return crystalNo;};
0136 G4double GetGlobalTime() {return globalTime;};
0137
0138
0139 G4ThreeVector GetInteractionPositionInCrystal(){return crystalPosition;};
0140
0141
0142 private:
0143 G4double edep;
0144 G4double globalTime;
0145 G4int blockNo;
0146 G4int crystalNo;
0147 G4ThreeVector crystalPosition;
0148
0149 };
0150
0151
0152
0153 #endif
0154