Import Geant4 10.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2018-12-07 15:15:39 +01:00
parent 6aa23be517
commit db49709b53
11370 changed files with 187480 additions and 160142 deletions
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Authors and contributors
// Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
#ifndef doiPETActionInitialization_h
#define doiPETActionInitialization_h 1
#include "G4VUserActionInitialization.hh"
//
class doiPETActionInitialization : public G4VUserActionInitialization
{
public:
doiPETActionInitialization();
virtual ~doiPETActionInitialization();
virtual void BuildForMaster() const;
virtual void Build() const;
//virtual G4VSteppingVerbose* InitializeSteppingVerbose() const;
private:
// doiPETDetectorConstruction* fDetector;
};
//
//////////////////////////////////////////////////////////////
#endif
@@ -0,0 +1,295 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Authors and contributors
// Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
#ifndef doiPETAnalysis_h
#define doiPETAnalysis_h 1
#include "doiPETGlobalParameters.hh"
#include "globals.hh"
#include <vector>
#include <time.h>
#include <map>
#include <set>
#include "G4ThreeVector.hh"
#include <iostream>
#include <fstream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#ifdef USEROOT
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#include "TRandom3.h"
#include "TFile.h"
#include "TNtuple.h"
#include "g4root.hh"
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TH2.h"
#include "TTree.h"
#include "TLeaf.h"
#include "TSystem.h"
#pragma GCC diagnostic pop
#endif
class doiPETAnalysisMessenger;
//class InteractionInformation;
class doiPETAnalysis
{
private:
doiPETAnalysis();
public:
~doiPETAnalysis();
static doiPETAnalysis* GetInstance();
void FindInteractingCrystal();
void Open(G4String);
void Close();
void Delete();
void ResetNumberOfHits();
void Write(/*G4int, G4int, G4int, G4double*/);
void WriteOutput();
//void GetIntractionInfomation(InteractionInformation*);
void GetParentParticleName(G4String);
void GetSizeOfDetector (G4double, G4double, G4double);
void GetScatterIndexInPhantom(G4double);
void SetSourcePosition(G4ThreeVector);//
void SetEventID(G4int);
void BlurringParameters();
void GetTimeOfAnnihilation(G4double);
void PMTPosition();
void AngerLogic(G4int, G4int, G4int, G4double, G4double, G4double, G4double);
void ReadReflectorPattern();
void SetActivity(G4double);
void SetIsotopeHalfLife(G4double);
void CrystalIDAfterAngerLogic(G4int, G4int, G4int);
void TypeOfOutput(G4String);//Single or coincidence list-mode data
void CalulateAcquisitionTime();
//G4double QuantumEffifciency(G4double);
G4double QuantumEffifciency(G4double, G4int, G4int);
void ReadOut(G4int, G4int, G4double, G4double, G4ThreeVector, G4double);
private:
static doiPETAnalysis* instance;
doiPETAnalysisMessenger* fAnalysisMessenger;
//std::multimap< G4int, InteractionInformation* > mapBlockInteraction;
std::set<G4int> setBlockInteraction;
G4double upperThreshold, lowerThreshold;
//G4ThreeVector sourcePosition;
//
G4int scatterIndex;
G4String parentParticleName;//
//
G4int numberofInteractions;
G4int countCoincidence;
G4int numberOfBlocks_total;
G4double sizeOfDetector_DOI,sizeOfDetector_axial,sizeOfDetector_tangential;
//Virtual position of the PMT
G4double signalPMT1, signalPMT2, signalPMT3, signalPMT4;
G4double posPMT1x, posPMT2x, posPMT3x, posPMT4x;
G4double posPMT1y, posPMT2y, posPMT3y, posPMT4y;
G4double posPMT1z, posPMT2z, posPMT3z, posPMT4z;
//
G4double signalPMT1z, signalPMT2z, signalPMT3z, signalPMT4z;
G4double signalPMT1y, signalPMT2y, signalPMT3y, signalPMT4y;
//
G4double signalZplus, signalZminus;
G4double signalYplus, signalYminus;
//
G4double dist1z, dist2z, dist3z, dist4z, distz;
G4double dist1y, dist2y, dist3y, dist4y, disty;
G4double shiftCoeff;
G4double PositionAngerZ, PositionAngerY;
//reflector pattern
std::vector<G4int> ireflectorLayer1_Tangential;
std::vector<G4int> ireflectorLayer1_Axial;
std::vector<G4int> ireflectorLayer2_Tangential;
std::vector<G4int> ireflectorLayer2_Axial;
std::vector<G4int> ireflectorLayer3_Tangential;
std::vector<G4int> ireflectorLayer3_Axial;
std::vector<G4int> ireflectorLayer4_Tangential;
std::vector<G4int> ireflectorLayer4_Axial;
std::vector<G4int> doi_table;
//
//The number of pixes for the 2D position histogram after Anger Logic calculation
G4int numberOfPixel_axial;
G4int numberOfPixel_tan;
//source position
G4double spositionX;
G4double spositionY;
G4double spositionZ;
//interaction position with respect to the crystal axis
G4ThreeVector interactionPos;
G4double interactionTime;
G4int crystalID;//contineous crystal ID in 3D
G4int crystalID_2D;
G4int prev_eventID;
//Single output
G4int eventID;
G4int blockID;
G4int crystalID_axial;
G4int crystalID_tangential;
G4int DOI_ID;
G4double timeStamp;
G4double totalEdep;
//coincidence output
G4int eventID0, eventID1;
G4int blockID0, blockID1;
G4int crystalID_axial0, crystalID_axial1;
G4int crystalID_tangential0, crystalID_tangential1;
G4int DOI_ID0, DOI_ID1;
G4double timeStamp0, timeStamp1;
G4double totalEdep0, totalEdep1;
//choice for the user
G4bool getSinglesData;
G4bool getCoincidenceData;
G4String outputData;
G4int numberOfHit;
std::vector<G4int> eventID_coin;
std::vector<G4double> edep_coin;
std::vector<G4int>blockID_coin;
std::vector<G4int> cryID_axial_coin;
std::vector<G4int> cryID_tan_coin;
std::vector<G4int> cryDOI_coin;
std::vector<G4double> time_coin;
//Crystal IDs after Anger Logic calculation
G4int crystalIDNew_DOI, crystalIDNew_tan, crystalIDNew_axial;
//Crystal ID in the 2D position histogram along the axial and tangetial direction
G4int crystalID_in2D_posHist_axial, crystalID_in2D_posHist_tan;
//continous crystal ID after after Anger Logic.
G4int crystalID_in2D_posHist;
//Crystal blurring
G4double crystalResolution;
G4double crystalResolutionMin;//
G4double crystalResolutionMax;//
//G4bool variableResolution;
G4bool fixedResolution;
G4double energyResolution_fixed;
std::vector<std::vector<G4double>> energyResolution_cryDependent;
G4double crystalEnergyRef;//This 511 keV
G4double crystalQuantumEfficiency;//
G4double edep_AfterCrystalBlurring;
G4double crystalCoeff;
G4double sigma_energyResolution;
G4double totalTime;
G4double prev_totalTime;
G4double timeInterval;
G4double time_annihil;
G4double time_tof;
G4double block_DeadTime;
G4double module_DeadTime;
G4double *blockTime;
G4double *moduleTime;
//
G4double activityNow;
G4double InitialActivity;
G4double halfLife;
G4String simulationType;
//
//for output file to write results
std::ofstream ofs;
G4String asciiFileName;
G4String rootFileName;
#ifdef USEROOT
TTree* tSingles;
TTree* tCoincidence;
//TH1F*hb;
#endif
//input file to read reflector pattern
std::ifstream ifs;
};
#endif
@@ -0,0 +1,77 @@
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Contributors
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
#ifndef doiPETAnalysisMessenger_h
#define doiPETAnalysisMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class doiPETDetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADouble;
class G4UIcmdWithoutParameter;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWith3VectorAndUnit;
class doiPETAnalysisMessenger : public G4UImessenger
{
public:
doiPETAnalysisMessenger(doiPETAnalysis* );
~doiPETAnalysisMessenger();
void SetNewValue(G4UIcommand* ,G4String );
private:
doiPETAnalysis* ptrAnalysis;
G4UIdirectory *Dir;
G4UIcmdWithADoubleAndUnit* changeActivityCmd;
G4UIcmdWithADoubleAndUnit* changeHalfLifeCmd;
//G4UIcmdWithAString* ChooseOutputTypeCmd;
};
#endif
@@ -0,0 +1,300 @@
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Contributors
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
#ifndef doiPETDetectorConstruction_h
#define doiPETDetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
#include "G4UnitsTable.hh"
#include "G4Element.hh"
#include "doiPETGlobalParameters.hh"
class G4Material;
class G4VPhysicalVolume;
class G4LogicalVolume;
//
class doiPETAnalysis;
class doiPETDetectorConstructionMessenger;
/// Detector construction class to define materials and geometry.
///
/// Crystals are positioned in Ring, with an appropriate rotation matrix.
/// Several copies of Ring are placed in the full detector.
class doiPETDetectorConstruction : public G4VUserDetectorConstruction
{
public:
doiPETDetectorConstruction();
virtual ~doiPETDetectorConstruction();
public:
virtual G4VPhysicalVolume* Construct();
void ConstructPhantom(G4LogicalVolume*);
void ChangePhantom(G4String choice);
void SetPhantomPosition(G4ThreeVector);
void SetPhantomRadius(G4double);
void SetPhantomLength(G4double);
private:
void DefineMaterials();
doiPETDetectorConstructionMessenger* fDetectorMessenger;
doiPETAnalysis* pAnalysis;
G4LogicalVolume* phantom_logicalV;
G4VPhysicalVolume* phantom_physicalV;
G4LogicalVolume* gelatin_logicalV;
G4VPhysicalVolume* gelatin_physicalV;
//wolrd
G4LogicalVolume* world_logicalV;
G4VPhysicalVolume* world_physicalV;
//detector block
G4LogicalVolume* blockDetector_logicalV;
G4VPhysicalVolume* blockDetector_physicalV;
//air volume to fill the detector block
G4LogicalVolume* airBox_logicalV;
G4VPhysicalVolume* airBox_physicalV;
//crystals
G4LogicalVolume* crystal_logicalV;
G4VPhysicalVolume* crystal_physicalV;
//water
G4LogicalVolume* water_logicalV;
G4VPhysicalVolume* water_physicalV;
//lung
G4LogicalVolume* lung_logicalV;
G4VPhysicalVolume* lung_physicalV;
//test line phantom
G4LogicalVolume* test_logicalV;
G4VPhysicalVolume* test_physicalV;
G4LogicalVolume* lung_logicalV_PMMA;
G4VPhysicalVolume* lung_physicalVPMMA;
//cold regions
G4LogicalVolume* coldRegion_logicalV;
G4VPhysicalVolume* coldRegion_physicalV;
//
//Surrounding PMMA for hot sphere
G4LogicalVolume* hotSpherePMMA_logicalV;
G4VPhysicalVolume* hotSpherePMMA_physicalV;
//hot water phantom (activity is distributed)
G4LogicalVolume* hotSphereWater_logicalV;
G4VPhysicalVolume* hotSphereWater_physicalV;
//surrounding PMMA cold sphere
G4LogicalVolume* coldSpherePMMA_logicalV;
G4VPhysicalVolume* coldSpherePMMA_physicalV;
//cold Water phantom in the cold PMMA sphere
G4LogicalVolume* coldSphereWater_logicalV;
G4VPhysicalVolume* coldSphereWater_physicalV;
//fillable polyethylene phantom for sensitivity
G4LogicalVolume* phantomPE_logicalV;
G4VPhysicalVolume* phantomPE_physicalV;
//Image quality phantom for small animal NEMA NU-4
G4LogicalVolume* waterPhantom_logicalV;
G4VPhysicalVolume* WaterPhantom_physicalV;
G4LogicalVolume* rod_phantom_logicalV;
G4VPhysicalVolume* rod_phantom_physicalV;
G4LogicalVolume* chamberPMMA_logicalV;
G4VPhysicalVolume* chamberPMMA_physicalV;
//
G4LogicalVolume* chamberWater_logicalV;
G4VPhysicalVolume* chamberWater_physicalV;
//
G4LogicalVolume* chamberAir_logicalV;
G4VPhysicalVolume* chamberAir_physicalV;
//Dimension of the sphere
G4double spherePositionX, spherePositionY, spherePositionZ;
G4double sphereDiameter;
G4double distanceFromCenter;
G4int numberOfSpheres;
G4double sphereWallThickness;
G4double zOffsetSpherePhantom;
G4String PhantomType;
//materials
G4Material* air;
G4Material* pmma;
G4Material* water;
G4Material* polyethylene;
G4Material* polyethylene_NEMA;
G4Material* inflatedLung;
G4Material* polystyrene;
G4Material* Aluminum;
//elements for GSO
G4Element* O;
G4Element* Si;
G4Element* Gd;
G4Material* GSO;
G4Material* crystalMaterial;
//G4Material* phantomMaterial;
G4bool fCheckOverlaps;
G4bool isotopes;
//size of world
G4double worldSizeX;
G4double worldSizeY;
G4double worldSizeZ;
//The following is moved to doiPETGlobalParameters.hh
//G4int numberOfCrystal_DOI;
//G4int numberOfCrystal_tangential;
//G4int numberOfCrystal_axial;
////
//G4double sizeOfCrystal_DOI;
//G4double sizeOfCrystal_tangential;
//G4double sizeOfCrystal_axial;
////
//G4double crystalGap_DOI;
//G4double crystalGap_tangential;
//G4double crystalGap_axial;
G4double sizeOfAirBox_DOI;
G4double sizeOfAirBox_axial;
G4double sizeOfAirBox_tangential;
G4double sizeOfBlockDetector_DOI;
G4double sizeOfBlockDetector_axial;
G4double sizeOfBlockDetector_tangential;
//G4double AluminumCoverThickness;
//G4int numberOfPETDetector;
//G4int numberOfRings;
//G4double scannerRadius;
G4double thetaDetector; //The azimuthal angle for arranging the detector in the PET ring
//G4double ringGap;
G4int blockIndex;
G4int AlCase_Index;
G4int crystalIndex;
//detector position
G4double detectorPositionX;
G4double detectorPositionY;
G4double detectorPositionZ;
//crystal position
G4double crystalPositionX;
G4double crystalPositionY;
G4double crystalPositionZ;
G4ThreeVector phantomPosition;
//
G4double phantomRadius;
G4double phantomLength;
//Phantom dimension for rectangular box (placed for therapy study)
G4double phantomSizeX, phantomSizeY, phantomSizeZ;
//the following is to make the body phantom
G4double yOffsetBodyPhantom;
G4double zOffsetBodyPhantom;
G4double lengthOfBodyPhantom; //Interior length ( = 180m mm) + wallthickness (= 3mm)
G4double radiusOfBodyPhantom;
G4double wallThicknessOfBodyPhantom;
G4double radiusOfLungPhantom;
//Test phantom defnition. The phantom has the same as that that of NECR phantom except
G4double hieghtOfTestPhantom;
G4double diameterOfTestPhantom;
//To the cylindrical phantom to make the body phantom
G4double radiusOfSmallcyl;
G4double boxWidth;
G4double boxHeight;
//Image quality phantom for small animals
G4double waterPhantomRadius;
G4double waterPhantomLength;
G4double rodPhantomLength;
G4double rodDiameter;
G4int numberOfRods;
//Declare position for the rod phantoms
G4double rodPositionX, rodPositionY, rodPositionZ;
//Declare position for cold region chanmbers
G4double chamberPositionX, chamberPositionY, chamberPositionZ;
G4double chamberPhantomLength;
G4double chamberDiameter;
G4double wallThicknessOfChamber;
};
/////////////////////////////////////////////////////////////////////////////////////////
#endif
@@ -0,0 +1,82 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Authors and contributors
// Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
#ifndef doiPETDetectorConstructionMessenger_h
#define doiPETDetectorConstructionMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class doiPETDetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADouble;
class G4UIcmdWithoutParameter;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWith3VectorAndUnit;
class doiPETDetectorConstructionMessenger : public G4UImessenger
{
public:
doiPETDetectorConstructionMessenger(doiPETDetectorConstruction* );
~doiPETDetectorConstructionMessenger();
void SetNewValue(G4UIcommand* ,G4String );
private:
doiPETDetectorConstruction* Detector;
G4UIdirectory *Dir;
G4UIcmdWithAString* ChoosePhantomCmd;
G4UIcmdWith3VectorAndUnit *changeThePhantomPositionCmd;
G4UIcmdWithADoubleAndUnit* changePhantomRadiusCmd;
G4UIcmdWithADoubleAndUnit* changePhantomLengthCmd;
};
#endif
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Authors and contributors
// Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
#ifndef doiPETEventAction_h
#define doiPETEventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
#include <map>
#include <set>
/// Event action class
class doiPETEventAction : public G4UserEventAction
{
public:
doiPETEventAction();
virtual ~doiPETEventAction();
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
private:
G4int eventID;
G4int printModulo;
};
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Authors and contributors
// Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
//The header file consists of specification if the scanner geometry
//Number of crystals (scintillators) in the DOI (x), tangential (y) and axial (z) direction.
#define numberOfCrystal_DOI 4
#define numberOfCrystal_tangential 16
#define numberOfCrystal_axial 16
//size of the crystals in the DOI (x), tangential (y) and axial (z) direction.
#define sizeOfCrystal_DOI 7.5*mm
#define sizeOfCrystal_tangential 2.8*mm
#define sizeOfCrystal_axial 2.8*mm
//Inter crystal gap between crystals.
#define crystalGap_DOI 0.0*mm
#define crystalGap_tangential 0.08*mm
#define crystalGap_axial 0.08*mm
//Define Aluminum thickness cover for the detector
#define AluminumCoverThickness 0.3 * mm
//Number of PET detectors per ring
#define numberOfDetector_perRing 40
//Number of rings in the PET system
#define numberOfRings 4
//Radius of the PET system. Note that the radius is defined between to opposing sensitive detectors (It does not include detector block cover).
#define scannerRadius 330 * mm
//Gap between two adjacent rings. There are three gaps in four ring PET system
#define ringGap 10.4 * mm
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Authors and contributors
// Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
#ifndef doiPETPhysicsList_h
#define doiPETPhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "G4VModularPhysicsList.hh"
#include "G4EmConfigurator.hh"
#include "globals.hh"
class doiPETPhysicsList: public G4VModularPhysicsList
{
public:
doiPETPhysicsList();
~doiPETPhysicsList();
void ConstructParticle();
void ConstructProcess();
void SelectModel(G4String val);
protected:
void SetCuts();
private:
G4VPhysicsConstructor* emPhysicsList;
G4VPhysicsConstructor* decayPhysicsList;
G4VPhysicsConstructor* raddecayList;
};
#endif
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Authors and contributors
// Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
#ifndef doiPETPrimaryGeneratorAction_h
#define doiPETPrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4ParticleGun.hh"
#include "globals.hh"
class G4ParticleGun;
class G4GeneralParticleSource;
class G4Event;
/// The primary generator action class
class doiPETPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
doiPETPrimaryGeneratorAction();
void ActivityValue();
virtual ~doiPETPrimaryGeneratorAction();
virtual void GeneratePrimaries(G4Event*);
const G4GeneralParticleSource* GetParticleGun() const { return fParticleGun; }
private:
G4GeneralParticleSource* fParticleGun;
};
#endif
@@ -0,0 +1,149 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file electromagnetic/TestEm11/include/doiPETRun.hh
/// \brief Definition of the doiPETRun class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef doiPETRun_h
#define doiPETRun_h 1
#include "G4Run.hh"
#include "G4VProcess.hh"
#include "globals.hh"
#include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <set>
class doiPETDetectorConstruction;
class G4ParticleDefinition;
class doiPETRunAction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class InteractionInformation;
class doiPETAnalysis;
class doiPETRun : public G4Run
{
public:
doiPETRun(/*doiPETDetectorConstruction**/);
~doiPETRun();
public:
//
void GetIntractionInfomation(InteractionInformation*);
void FindInteractingCrystal();
void Clear();
void OpenRun(G4String);
void GetEventIDRun(G4int);
void CalulateAcquisitionTime();
void SetAnnihilationTime(G4double);
void SetEventID(G4int);
virtual void Merge(const G4Run*);
// void EndOfRun();
private:
std::multimap< G4int, InteractionInformation* > mapBlockInteraction;
std::set<G4int> setBlockInteraction;
std::ofstream ofs;
G4int eventID;
doiPETRunAction* fRunAction;
doiPETAnalysis* fAnalysis;
G4double totalEdep;
G4int blockID, crystalID;
//
G4double activityNow;
G4double InitialActivity;
G4double halfLife;
G4double totalTime;
G4double prev_totalTime;
G4double timeInterval;
G4ThreeVector interactionPos;
//
G4double interactionTime;
G4double timeOfAnnihil;
G4int numberofInteractions;
G4double edep;
G4double edepMax;
G4double edep_AfterCrystalBlurring;
};
//The following is to get interaction information
class InteractionInformation
{
public:
InteractionInformation(){;};
~InteractionInformation(){;};
//set energy deposition
void SetEdep(G4double e) {edep=e;};
//set block number
void SetBlockNo(G4int n) {blockNo=n;};
//set crystal ID (this is continuous numbering of crystals)
void SetCrystalNo(G4int n) {crystalNo=n;};
//set global time
void SetGlobalTime(G4double t){globalTime=t;};
//set interaction position with respect to the crystal axis (local position)
void SetInteractionPositionInCrystal(G4ThreeVector pos){crystalPosition = pos;};
G4double GetEdep() {return edep;};
G4int GetBlockNo() {return blockNo;};
G4int GetCrystalNo() {return crystalNo;};
G4double GetGlobalTime() {return globalTime;};
//Interaction position in the detector
G4ThreeVector GetInteractionPositionInCrystal(){return crystalPosition;};
private:
G4double edep;
G4double globalTime;
G4int blockNo;
G4int crystalNo;
G4ThreeVector crystalPosition;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Authors and contributors
// Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
#ifndef doiPETRunAction_h
#define doiPETRunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
class doiPETDetectorConstruction;
class doiPETRun;
class doiPETPrimaryGeneratorAction;
//class HistoManager;
/// doiPETRun action class
class doiPETRunAction : public G4UserRunAction
{
public:
//doiPETRunAction();
doiPETRunAction(/*doiPETDetectorConstruction*, doiPETPrimaryGeneratorAction**/);
virtual ~doiPETRunAction();
virtual G4Run* GenerateRun();
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
private:
doiPETRun* fRun;
//HistoManager* fHistoManager;
};
#endif
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//GEANT4 - Depth-of-Interaction enabled Positron emission tomography (PET) advanced example
//Authors and contributors
// Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
// Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
// Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
// Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
// (1) Australian Nuclear Science and Technology Organisation, Australia
// (2) University of Wollongong, Australia
// (3) National Institute of Radiological Sciences, Japan
#ifndef doiPETSteppingAction_h
#define doiPETSteppingAction_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
class doiPETEventAction;
class doiPETSteppingAction : public G4UserSteppingAction
{
public:
doiPETSteppingAction();
virtual ~doiPETSteppingAction();
virtual void UserSteppingAction(const G4Step*);
private:
//
};
#endif