ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
doiPETAnalysis.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file doiPETAnalysis.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 
26 //GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
27 
28 //Authors and contributors
29 
30 // Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
31 
32 // Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
33 // Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
34 // Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
35 
36 // (1) Australian Nuclear Science and Technology Organisation, Australia
37 // (2) University of Wollongong, Australia
38 // (3) National Institute of Radiological Sciences, Japan
39 
40 
41 #ifndef doiPETAnalysis_h
42 #define doiPETAnalysis_h 1
43 
45 #include "globals.hh"
46 #include <vector>
47 #include <time.h>
48 #include <map>
49 #include <set>
50 #include "G4ThreeVector.hh"
51 #include <iostream>
52 #include <fstream>
53 #include <sstream>
54 #include <iterator>
55 #include <vector>
56 #include <algorithm>
57 
58 #ifdef USEROOT
59 #pragma GCC diagnostic push
60 #pragma GCC diagnostic ignored "-Wshadow"
61 #include "TRandom3.h"
62 #include "TFile.h"
63 #include "TNtuple.h"
64 #include "g4root.hh"
65 #include "TROOT.h"
66 #include "TFile.h"
67 #include "TH1.h"
68 #include "TH2.h"
69 #include "TTree.h"
70 #include "TLeaf.h"
71 #include "TSystem.h"
72 #pragma GCC diagnostic pop
73 #endif
74 
76 
77 //class InteractionInformation;
78 
80 {
81 private:
83 
84 public:
86  static doiPETAnalysis* GetInstance();
88  void Open(G4String);
89  void Close();
90  void Delete();
91  void ResetNumberOfHits();
92  void Write(/*G4int, G4int, G4int, G4double*/);
93  void WriteOutput();
94 
95  //void GetIntractionInfomation(InteractionInformation*);
96 
100 
102  void SetEventID(G4int);
103 
104  void BlurringParameters();
106 
107  void PMTPosition();
109  void ReadReflectorPattern();
110 
111  void SetActivity(G4double);
114  void TypeOfOutput(G4String);//Single or coincidence list-mode data
116  //G4double QuantumEffifciency(G4double);
119 
120 private:
123  //std::multimap< G4int, InteractionInformation* > mapBlockInteraction;
124  std::set<G4int> setBlockInteraction;
125 
127 
128 
129 
130  //G4ThreeVector sourcePosition;
131 
132 
133 
134  //
136 
138 
139  //
142 
144 
146 
147  //Virtual position of the PMT
149 
153 
154  //
157 
158  //
161  //
162 
165 
167 
169 
170  //reflector pattern
171  std::vector<G4int> ireflectorLayer1_Tangential;
172  std::vector<G4int> ireflectorLayer1_Axial;
173  std::vector<G4int> ireflectorLayer2_Tangential;
174  std::vector<G4int> ireflectorLayer2_Axial;
175  std::vector<G4int> ireflectorLayer3_Tangential;
176  std::vector<G4int> ireflectorLayer3_Axial;
177  std::vector<G4int> ireflectorLayer4_Tangential;
178  std::vector<G4int> ireflectorLayer4_Axial;
179  std::vector<G4int> doi_table;
180  //
181 
182  //The number of pixes for the 2D position histogram after Anger Logic calculation
185 
186  //source position
190 
191  //interaction position with respect to the crystal axis
193 
194 
196 
197  G4int crystalID;//contineous crystal ID in 3D
199 
201 
202  //Single output
210 
211  //coincidence output
219 
220  //choice for the user
223 
226  std::vector<G4int> eventID_coin;
227  std::vector<G4double> edep_coin;
228  std::vector<G4int>blockID_coin;
229  std::vector<G4int> cryID_axial_coin;
230  std::vector<G4int> cryID_tan_coin;
231  std::vector<G4int> cryDOI_coin;
232  std::vector<G4double> time_coin;
233 
234  //Crystal IDs after Anger Logic calculation
236 
237  //Crystal ID in the 2D position histogram along the axial and tangetial direction
239 
240  //continous crystal ID after after Anger Logic.
242 
243 
244  //Crystal blurring
248 
249  //G4bool variableResolution;
251 
253  std::vector<std::vector<G4double>> energyResolution_cryDependent;
254 
255  G4double crystalEnergyRef;//This 511 keV
260 
268 
271 
272  //
276 
278 
279  //
280  //for output file to write results
281  std::ofstream ofs;
284 
285 #ifdef USEROOT
286  TTree* tSingles;
287  TTree* tCoincidence;
288  //TH1F*hb;
289 #endif
290 
291  //input file to read reflector pattern
292  std::ifstream ifs;
293 };
294 
295 #endif