toor.GateLink.RootToTor package#
Submodules#
toor.GateLink.RootToTor.addanglestorootfile module#
toor.GateLink.RootToTor.findcoincidencesRoot2Numpy module#
- class toor.GateLink.RootToTor.findcoincidencesRoot2Numpy.GenerateCoincidencesAndAnhnilationsPositions(filename=None, method='time_diff', coincidenceWindow=0.1)[source]#
Bases:
ReadRootFile
This class is used to generate the coincidences and anhnilations positions from the root file data. The coincidences algorithm is based on the time of the events. It assumed that GATE digitizer is used to join multiple events that occur the same detector. For more information about the GATE digitizer, please refer to the GATE documentation. :type filename: :param filename: the path to the root file :type method: :param method: the method used to generate the coincidences. The options are:
SameID: the coincidence is generated when the events have the same ID SameTime: the coincidence is generated when the events have the same time
- Parameters:
coincidenceWindow – the coincidence window in nano seconds
doubleScannerFormat – if the root file returns two arrays for the singles, one for each scanner
_filename – the path to the root file
_method – the method used to generate the coincidences. The options are: SameID: the coincidence is generated when the events have the same ID SameTime: the coincidence is generated when the events have the same time
_coincidenceWindow – the coincidence window in nano seconds
doubleScannerFormat – if the root file returns two arrays for the singles, one for each scanner
_fileBodyData – the list mode data
_coincidences – the coincidences data
_anhnilations – the anhnilations data
_singlesScanner1 – the singles data for the first module
_singlesScanner2 – the singles data for the second module
- findCoincidences(coincidenceWindow=0.1, array_keys=None)[source]#
Slower version: This method is used to find the coincidences in the singles data. :type coincidenceWindow: :param coincidenceWindow: the coincidence window in nano seconds
toor.GateLink.RootToTor.readroot module#
- class toor.GateLink.RootToTor.readroot.ReadRootFile(filename=None)[source]#
Bases:
object
Class to read root files :type filename: :param filename: str
Path to the root file
- Parameters:
_filename – str Path to the root file
_partNumber – int Part number of the root file
_singlesScanner1 – ExtractSingles ExtractSingles object for the singles of the first scanner
_singlesScanner2 – ExtractSingles ExtractSingles object for the singles of the second scanner
_singles – ExtractSingles ExtractSingles object for the singles of the single scanner
_keysUsed – list List of the keys used to create the singles
_doubleScannerFormat – bool True if the root file is in double scanner format
- property doubleScannerFormat#
- property partNumber#
- property singles#
- property singlesScanner1#
- property singlesScanner2#
toor.GateLink.RootToTor.recreatedata module#
toor.GateLink.RootToTor.rootToTor module#
toor.GateLink.RootToTor.rootjoiner module#
toor.GateLink.RootToTor.singlesstruct module#
- class toor.GateLink.RootToTor.singlesstruct.ExtractSingles(parent=None)[source]#
Bases:
object
This class is used to extract the singles data from the root file and to convert into numpy array. :type parent: :param parent: the uproot object containing the singles data
- Parameters:
_parent – the uproot object containing the singles data
_runID – the run ID
_eventID – the event ID
_sourceID – the source ID
_sourcePosX – the source position in x
_sourcePosY – the source position in y
_sourcePosZ – the source position in z
_globalPosX – the global position in x
_globalPosY – the global position in y
_globalPosZ – the global position in z
_time – the time
_energy – the energy
_baseID – the base ID
_level1ID – the level 1 ID (moduleID)
_level2ID – the level 2 ID (submoduleID)
_level3ID – the level 3 ID (crystalID
_level4ID – the level 4 ID (pixelID)
_level5ID – the level 5 ID (?)
_comptonPhantom – the compton phantom
_comptonCrystal – the compton crystal
_comptonDetector – the compton detector
_comptonWorld – the compton world
- _createAllTreeArrays()#
create all the tree arrays from the root file to numpy arrays
- runID()#
get the run ID
- setRunID()#
set the run ID
- eventID()#
get the event ID
- setEventID()#
set the event ID
- sourceID()#
get the source ID
- setSourceID()#
set the source ID
- sourcePosX()#
get the source position in x
- setSourcePosX()#
set the source position in x
- sourcePosY()#
get the source position in y
- setSourcePosY()#
set the source position in y
- sourcePosZ()#
get the source position in z
- setSourcePosZ()#
set the source position in z
- globalPosX()#
get the global position in x
- setGlobalPosX()#
set the global position in x
- globalPosY()#
get the global position in y
- setGlobalPosY()#
set the global position in y
- globalPosZ()#
get the global position in z
- setGlobalPosZ()#
set the global position in z
- time()#
get the time
- setTime()#
set the time
- energy()#
get the energy
- setEnergy()#
set the energy
- baseID()#
get the base ID
- setBaseID()#
set the base ID
- level1ID()#
get the level 1 ID (moduleID)
- setLevel1ID()#
set the level 1 ID (moduleID)
- level2ID()#
get the level 2 ID (submoduleID)
- setLevel2ID()#
set the level 2 ID (submoduleID)
- level3ID()#
get the level 3 ID (crystalID)
- setLevel3ID()#
set the level 3 ID (crystalID)
- level4ID()#
get the level 4 ID (pixelID)
- setLevel4ID()#
set the level 4 ID (pixelID)
- level5ID()#
get the level 5 ID (?)
- setLevel5ID()#
set the level 5 ID (?)
- comptonPhantom()#
get the compton phantom
- setComptonPhantom()#
set the compton phantom
- comptonCrystal()#
get the compton crystal
- setComptonCrystal()#
set the compton crystal
- comptonDetector()#
get the compton detector
- setComptonDetector()#
set the compton detector
- comptonWorld()#
get the compton world
- property baseID#
- property comptonCrystal#
- property comptonPhantom#
- property energy#
- property eventID#
- property globalPosX#
- property globalPosY#
- property globalPosZ#
- property level1ID#
- property level2ID#
- property level3ID#
- property level4ID#
- property level5ID#
- property parent#
- property runID#
- property setBaseID#
- property setComptonCrystal#
- property setComptonPhantom#
- property setEnergy#
- property setEventID#
- property setGlobalPosX#
- property setGlobalPosY#
- property setGlobalPosZ#
- property setLevel1ID#
- property setLevel2ID#
- property setLevel3ID#
- property setLevel4ID#
- property setLevel5ID#
- property setRunID#
- property setSourceID#
- property setSourcePosX#
- property setSourcePosY#
- property setSourcePosZ#
- property setTime#
- property sourceID#
- property sourcePosX#
- property sourcePosY#
- property sourcePosZ#
- property time#