Warning, file /geant4/examples/advanced/doiPET/include/doiPETAnalysis.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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
0035
0036
0037
0038
0039
0040
0041 #ifndef doiPETAnalysis_h
0042 #define doiPETAnalysis_h 1
0043
0044 #include "doiPETGlobalParameters.hh"
0045 #include "globals.hh"
0046 #include <vector>
0047 #include <time.h>
0048 #include <map>
0049 #include <set>
0050 #include "G4ThreeVector.hh"
0051 #include <iostream>
0052 #include <fstream>
0053 #include <sstream>
0054 #include <iterator>
0055 #include <vector>
0056 #include <algorithm>
0057 #include "G4AnalysisManager.hh"
0058
0059
0060 const G4int MaxNtCol = 17;
0061
0062 class doiPETAnalysisMessenger;
0063
0064
0065
0066 class doiPETAnalysis
0067 {
0068 private:
0069 doiPETAnalysis();
0070
0071 public:
0072 ~doiPETAnalysis();
0073 static doiPETAnalysis* GetInstance();
0074 void FindInteractingCrystal();
0075 void Open(G4String);
0076 void Close();
0077 void Delete();
0078 void ResetNumberOfHits();
0079 void Write();
0080 void WriteOutput();
0081
0082
0083
0084 void GetParentParticleName(G4String);
0085 void GetSizeOfDetector (G4double, G4double, G4double);
0086 void SetScatterIndexInPhantom(G4int);
0087
0088 void SetSourcePosition(G4ThreeVector);
0089 void SetEventID(G4int);
0090
0091 void BlurringParameters();
0092 void GetTimeOfAnnihilation(G4double);
0093
0094
0095 void PMTPosition();
0096 void AngerLogic(G4double, G4double, G4double, G4double, G4double, G4bool);
0097 void ReadReflectorPattern();
0098 void PrepareDOILookUpTable(G4String);
0099
0100 void SetActivity(G4double);
0101 void SetIsotopeHalfLife(G4double);
0102 void CrystalIDAfterAngerLogic(G4int, G4int, G4int);
0103 void TypeOfOutput(G4String);
0104 void CalulateAcquisitionTime();
0105
0106 G4double QuantumEffifciency(G4double, G4int, G4int);
0107 void ReadOut(G4int, G4int, G4double, G4double, G4ThreeVector, G4double);
0108
0109
0110 void book();
0111
0112
0113 void FillListModeEvent();
0114 void finish();
0115
0116
0117
0118 private:
0119 static doiPETAnalysis* instance;
0120 doiPETAnalysisMessenger* fAnalysisMessenger;
0121
0122 std::set<G4int> setBlockInteraction;
0123
0124 G4double upperThreshold, lowerThreshold;
0125 G4double triggerEnergy;
0126
0127
0128 G4bool factoryOn;
0129 G4int fNtColId[MaxNtCol];
0130
0131
0132
0133
0134
0135
0136
0137
0138 G4int scatterIndex;
0139
0140 G4String parentParticleName;
0141
0142
0143 G4int numberofInteractions;
0144 G4int countCoincidence;
0145
0146 G4int numberOfBlocks_total;
0147
0148 G4double sizeOfDetector_DOI,sizeOfDetector_axial,sizeOfDetector_tangential;
0149
0150
0151 G4double signalPMT1, signalPMT2, signalPMT3, signalPMT4;
0152
0153 G4double posPMT1x, posPMT2x, posPMT3x, posPMT4x;
0154 G4double posPMT1y, posPMT2y, posPMT3y, posPMT4y;
0155 G4double posPMT1z, posPMT2z, posPMT3z, posPMT4z;
0156
0157
0158 G4double signalPMT1z, signalPMT2z, signalPMT3z, signalPMT4z;
0159 G4double signalPMT1y, signalPMT2y, signalPMT3y, signalPMT4y;
0160
0161
0162 G4double signalZplus, signalZminus;
0163 G4double signalYplus, signalYminus;
0164
0165
0166 G4double dist1z, dist2z, dist3z, dist4z, distz;
0167 G4double dist1y, dist2y, dist3y, dist4y, disty;
0168
0169 G4double shiftCoeff;
0170
0171 G4double PositionAngerZ, PositionAngerY;
0172
0173
0174 std::vector<G4int> ireflectorLayer1_Tangential;
0175 std::vector<G4int> ireflectorLayer1_Axial;
0176 std::vector<G4int> ireflectorLayer2_Tangential;
0177 std::vector<G4int> ireflectorLayer2_Axial;
0178 std::vector<G4int> ireflectorLayer3_Tangential;
0179 std::vector<G4int> ireflectorLayer3_Axial;
0180 std::vector<G4int> ireflectorLayer4_Tangential;
0181 std::vector<G4int> ireflectorLayer4_Axial;
0182 std::vector<G4int> doi_table;
0183
0184
0185
0186 G4int numberOfPixel_axial;
0187 G4int numberOfPixel_tan;
0188
0189
0190 G4double spositionX;
0191 G4double spositionY;
0192 G4double spositionZ;
0193
0194
0195 G4ThreeVector interactionPos;
0196
0197
0198 G4double intPosX;
0199 G4double intPosY;
0200 G4double intPosZ;
0201
0202
0203 G4double interactionTime;
0204
0205 G4int crystalID;
0206 G4int crystalID_2D;
0207
0208 G4int prev_eventID;
0209
0210
0211 G4int eventID;
0212 G4int blockID;
0213 G4int crystalID_axial;
0214 G4int crystalID_tangential;
0215 G4int DOI_ID;
0216 G4double timeStamp;
0217 G4double totalEdep;
0218
0219
0220 G4int eventID0, eventID1;
0221 G4int blockID0, blockID1;
0222 G4int crystalID_axial0, crystalID_axial1;
0223 G4int crystalID_tangential0, crystalID_tangential1;
0224 G4int DOI_ID0, DOI_ID1;
0225 G4double timeStamp0, timeStamp1;
0226 G4double totalEdep0, totalEdep1;
0227 G4double sposX, sposY, sposZ;
0228
0229 G4bool getSinglesData;
0230 G4bool getCoincidenceData;
0231
0232
0233 G4bool ApplyAngerLogic;
0234
0235 G4double PMTblurring_tan;
0236 G4double PMTblurring_axial;
0237
0238 G4String outputData;
0239 G4int numberOfHit;
0240 std::vector<G4int> eventID_coin;
0241 std::vector<G4double> edep_coin;
0242 std::vector<G4int>blockID_coin;
0243 std::vector<G4int> cryID_axial_coin;
0244 std::vector<G4int> cryID_tan_coin;
0245 std::vector<G4int> cryDOI_coin;
0246 std::vector<G4double> time_coin;
0247
0248
0249 G4int crystalIDNew_DOI, crystalIDNew_tan, crystalIDNew_axial;
0250
0251
0252 G4int crystalID_in2D_posHist_axial, crystalID_in2D_posHist_tan;
0253
0254
0255 G4int crystalID_in2D_posHist;
0256
0257
0258
0259 G4double crystalResolution;
0260 G4double crystalResolutionMin;
0261 G4double crystalResolutionMax;
0262
0263
0264 G4bool fixedResolution;
0265 G4bool isDOIlookUpTablePrepared;
0266
0267 G4double energyResolution_fixed;
0268 std::vector<std::vector<G4double>> energyResolution_cryDependent;
0269
0270 G4double crystalEnergyRef;
0271 G4double crystalQuantumEfficiency;
0272 G4double edep_AfterCrystalBlurring;
0273 G4double crystalCoeff;
0274 G4double sigma_energyResolution;
0275
0276 G4double totalTime;
0277 G4double prev_totalTime;
0278 G4double timeInterval;
0279 G4double time_annihil;
0280 G4double time_tof;
0281 G4double block_DeadTime;
0282 G4double module_DeadTime;
0283
0284 G4double *blockTime;
0285 G4double *moduleTime;
0286
0287
0288 G4double activityNow;
0289 G4double InitialActivity;
0290 G4double halfLife;
0291
0292 G4String simulationType;
0293
0294
0295
0296 std::ofstream ofs;
0297 G4String asciiFileName;
0298 G4String rootFileName;
0299
0300
0301
0302
0303
0304
0305
0306
0307
0308 std::ifstream ifs;
0309 };
0310
0311 #endif
0312