Compton imaging with the C++ code

The instructions below are outdated. All you should now need to do it run ~dsj/bin/run_imaging in a terminal and it should automatically set the right paths etc and start the most recent version of the code. This is currently 3.16 - please note that this version has been identified as having a bug when fitting multiple peaks in the 3d image.

A slightly more recent guide is available here


Below is a brief guide to using the C++ imaging code. This describes version 3.1 but the idea is the same for all version. The current version is 3.7.
As the code uses the ROOT package to produce the plots, it will only run on a machine that already has ROOT installed.


The latest version of the c++ code allows the user to fit single or multiple peaks in the x and y axes. The Fit panel at the bottom of the GUI allows the user to select the number of peaks to fit on each axis. The number of channels included in the fit can also be modified here. When fitting a single peak, the code automatically identifies the location of the peak. However, when fitting more than one peak, the user must enter the location of the peaks. The fitting range is calculated from the entered peak positions and so a value for each must be entered. As the fit to two peaks has a large number of fit parameters, it is quite difficult to get the code to identify and fit the correct peaks. The only parameters that are directly editable by the user are the peak positions. It is therefore crucial that the correct region is chosen for the fit. If the fit does not look right, try modifying the fit range! A fit to 2 peaks separated by 20 mm is shown below.




Introduction

This code takes a Compton camera data set from either experiment or simulation and produces 1d and 2d intensity V's position plots or Compton images. Traditional Compton imaging codes calculates a mathematical 3d cone surface and projects this into a 3d imaging space to produce an intensity cube. This is then sliced through the z (depth) axis to produce a 2d intensity matrix for that specific z-value. This is both computationally very intensive and time consuming. This code works by calculating the size and position of the 2d conics that are produced when a cone is sliced at a given angle and z-distance. These conics are then projected onto a 2d imaging plane to produce the 2d image (as shown in the image below). At no point is any 3d information processed and so the imaging is many times (~x 200) quicker than traditional codes. 3d information is generated by looping the calculations over several z (depth) slices. The code produces a 2d matrix (slice) of intensity V's position in the xy-plane along with 1d intensity profiles, in the x- and y-axis of this slice through the point of maximum intensity. These 1d profiles are fitted using a custom function to determine the FWHM (position resolution) of the distribution. The FWHM is then plotted for a number of different z distances to get an indication of the source location in depth.



Compiling

It is recommended that the imaging program is simply run from the pre-compiled executable
      
         
    ~dsj/bin/compton3.1

on the university Linux computers, as explained in the section Running the code, below.
This executable will not run on any machine which does not have a standard university ROOT installation.
In this case, the code will have to be recompiled for the specific installation.

If the source code needs to be recompiled, it needs to be done in 2 stages.
The first compiles the code with no details of the required libraries.

    
        g++ -c `root-config --cflags` compton3.1.cpp

The second stage links the compiled code to the libraries.
      
         
    g++ -o compton3.1 `root-config --glibs` compton3.1.o

This will create an executable called compton3.1 in the current directory.

If this does not work, try the following

g++ -c -L/usr/local/root64/root5.32/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic -L/usr/local/root64/root5.32/lib -lGui -pthread -m64 -I/usr/local/root64/root5.32/include -m64 -pthread -lm -ldl -rdynamic -pthread -m64 SiGe_imaging_test.cpp

g++ -o SiGe_imaging_test -L/usr/local/root64/root5.32/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic -L/usr/local/root64/root5.32/lib -lGui -pthread -m64 -I/usr/local/root64/root5.32/include -m64 -pthread -lm -ldl -rdynamic -pthread -m64 SiGe_imaging_test.o



Set up

Before using the code it is necessary to set the system environment variables to point to the location of the ROOT libraries.
If using a university Linux computer, the default location is /usr/local/root-src/lib
If you are using a standalone ROOT installation such as on a laptop the the location may be different.
Two environment variables need to be set. These are ROOTSYS and LD_LIBRARY_PATH.
If you are using this on your personal machines, you will have to find out where ROOT is is installed on your machine and set them appropriately.
These should be set to /usr/local/root-src and /usr/local/root32/root_v5.28.ooa/lib receptively if using the network version of ROOT on the university Linux machines.
This is done using the commands

setenv ROOTSYS /usr/local/root-src
setenv LD_LIBRARY_PATH /usr/local/root64/root5.32/lib

for a c-shell or
export ROOTSYS=/usr/local/root-src
export LD_LIBRARY_PATH=/usr/local/root64/root5.32/lib

if using a bash-shell

These commands can be added to your .cshrc / .bashrc files to ensure that they are set every time a terminal is opened.

To check if these have been correctly set use
setenv | grep ROOT
setenv | grep LD

for c-shell and
export | grep ROOT
export | grep LD

for bash-shell

If these are not set correctly you will get an error saying "error while loading shared libraries ...." when the code is run.

NOTE: On the newer 64 bit machines you need to run the following command.
source /usr/local/root64/root5.32/bin/thisroot.csh
in a c-shell
or
source /usr/local/root64/root5.32/bin/thisroot.sh
in a bash shell

On the very newest Debian machines (2013>) it is necessary to run the following commnds before the code can be executed.
setenv ROOTSYS /usr/local/root-src
setenv LD_LIBRARY_PATH /usr/local/root64/root5.32/lib
setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:/user3/dsj/lib


Running the code

There are 3 ways in which the code can be used, these are called Interactive, Option and Batch mode.
In Interactive mode, the program asks the user a series of questions about the data and imaging requirements and produces an image based on the answers given. The user inputs are stored in an option file.
In Option mode a pre-existing option file is read in and image(s) are produced with no input from the user. This is useful if you wish to image some data that has previously been imaged but wish to change only a single parameter such as the energy gate. The option file can be edited directly, saving the user having to re-enter the other information.
In Batch mode a list of option files is given to program. This allows multiple data sets to be imaged with no direct input from the user.
For most users, it is envisaged that Interactive mode will be most commonly used.


Interactive mode

To run the pre-compiled executable on a university Linux machine with a standard ROOT installation type the following command into a terminal

            ~dsj/bin/compton3.1

To run a version of the code that has been compiled independently, assuming that you are in the correct directory, type the following

            ./compton3.1


You will then be presented with a brief description of the code and asked to enter the format of the data you wish to image.

            ********************************************************************************************
            Version 3.1, written by DSJ June 2011. This code reads in a file and
            translates the interaction positions and energies into a Compton image.
            It loops through a specified depth range and produces pseudo 3D information.
            The code saves the entered option in a *.opt file which can then be edited
            and reloaded if different conditions are required. This version has the
            plotting functions built in and does not require the spectra to be imaged
            externally. Slice files are still produced and can be be imaged externally
            as with previous versions if required. Lorentzian fits to the x and y slices
            are also produced and chi-squared/DOF and FWHM values are displayed.
            Spectra and fits are written to a ROOT file for each slice that is imaged.
            *********************************************************************************************

            Enter the format of the data.
                1 = Geant
                2 = Gamos ASCII
                3 = Gamos Binary
                4 = Smartpet
                5 = Smartpet with PSA
                6 = Smartpet with Agata


The user is then required to enter the number corresponding to the format of the data to be imaged.
If the wrong data format is entered, the imaging will not be successful!
The Geant format is a simple ASCII text file which lists absolute positions and energies as z1, y1, x1, e1, z2, y2, x2 and e2 for each Compton event. Z = 0 is defined as the back face of the absorber detector.
The Gamos ASCII format is similar to the Geant format but z = 0 is defined as the source position and so an offset has to be entered to allow the code to invert to z values. This is usually the distance between the source and the back face of the absorber detector.
The Gamos Binary format is the same as the Gamos ASCII format except that the data is stored in binary format.
This is the option to use for raw Gamos output files.
The Smartpet data format is for experimental data taken with the 2 Smartpet detectors in Compton camera mode. This is what was known as the April 2010 format in the Matlab code. Here the strip numbers are converted into a position with no pulse shape analysis.
Smartpet with PSA takes data sorted with pulse shape analysis information and refined the interaction position based upon this additional information.
The PSA values must be included in the data file, they are not calculated within this code.
There are various levels of PSA available defining whether the strip is to be divided in to 1,3,5 or 7 sub-voxels and  whether depth information is to be included.
The Smartpet with Agata format is for data taken using the Smartpet detector as a scatterer and the Agata C009 detector as the absorber. This is very preliminary and should not be expected to give good results!
If the code hangs once data is being processed, it is likely that the format has been incorrectly entered.
More details of these data formats is given here (access required).

A series of questions then follow, the exact questions will depend on the data format being used.
For all formats, the first thing the user will be asked for is the name of the data file that is to be imaged.
            
            Enter the name of the data file to be read in:

If the data file is not in the same directory as the program is being run from, the full path of the file must be entered.
If the program cannot open the file that is entered, an error message will be displayed and the user will be asked to re-enter the file name.
            
            Enter the name of the data file to be read in: DataforDan.txt
            Unable to open the data file. Please enter a new name:

The user will then be asked if single or multiple slices are required

            Do you wish to produce single or multiple slices? [s/m]

The user should then enter 's' for single or 'm' for multiple slices. Opting for a single slice, the program will produce a 2d plot of the image with no depth information. If multiple slices are produced the code will produce a 2d image for each slice and  estimate the source location in depth from the image quality.

If a single slice is required the user will be asked for the z depth for the slice, in mm. This is the distance between the source and the back face of the absorber detector.

            Enter the Z slice (mm):

If multiple slices are required, the user will be asked for a lower and upper z-values (in mm) and the step size. This defines the z-slices produced.

            Enter the minimum Z value (mm): 200
            Enter the maximum Z value (mm):
300
            Enter the Z step value (mm):
20

The above values will produce a slice at z = 200, 220, 240 ,260, 280 and 300 mm.

For Gamos data format only
If using a Gamos data format, the user will then be asked for the Gamos offset.

            Enter the offset for gamos (mm):

As explained previously, in most cases, this is the distance between the source and the back of the absorber detector.

The code will then ask for the geometry used in the simulations. This is defined in the Gamos input file and must be either a Ring or Stack geometry.

            Is the geometry ring or stack? [r/s]:

The user should enter either 'r' or 's' for Ring or Stack respectively.


For Smartpet with PSA format only
If the data to be imaged is in Smartpet format and has PSA data, a series of questions will be asked on how to process this data.
The first of these will be to determine if the data includes depth of interaction PSA. Depending on the sort code used when the data was sorted, this may or may not be the case.

            Does the data have depth of interaction data (y/n)?

The user will then be asked what level of PSA is required

    
        What level of PSA do you want (1, 3, 5, or 7)?

This determines how precise the PSA is going to be. The number entered refers to the number of sub strips the Smartpet AC and DC strips will be sub-divided into based on the PSA information. a value of 1 is the same a no PSA. a value of 5 separates the 5mm strips into 5 1mm strips etc. Theoretically, the larger this number, the more precise the position information and the better the image.

The user will then be asked what is to be done with events for which no PSA is available.

            Do you want to include non-PSA events in the output? (0 for no, 1 for yes):

For some strips, eg an edge strip, the current PSA implementation is unable to deduce any PSA values.
The user has the option of including these events with no PSA, to improve statistics or rejecting these events to improve the resolution.

For all Smartpet formats
If using a Smartpet data format (with or without PSA) the user will be asked for the separation between the cryostats.

            Enter the separation between the 2 detector cryostats (mm):

The actual distance between the crystals is calculated from this within the code, assuming the standard cryostat sizes.

All formats
The user will then be asked if are any conditions to be applied to the total gamma-ray energy. This allows one to select only events which have deposited the full photopeak energy in the 2 detectors.

            Do you want to gate on the gamma-ray energy? [y/n]:

If the user enters 'y', they will be asked for the lower and upper energy limits. 

            Please enter the lower gamma-ray energy in keV: 120
            Please enter the upper gamma-ray energy in keV:
125

The values entered above will ensure that only gamma rays which deposited 120-125 keV (inclusive) will be used to produce the image.

 The user will then be asked if a condition on the scattering angle will be applied. This is the opening angle of the Compton cone and is calculated from the balance of energies in the scatterer and absorber detectors.

            Do you want to gate on the gamma-ray scattering angle? [y/n]:

If the user selected 'y', they will be asked for a lower and upper angle limit
     
        
    Please enter the lower scattering angle in degrees:
0
            Please enter the upper scattering angle in degrees: 
45

The values entered above will ensure that only gamma rays which scatters between 0 and 45 degrees (inclusive) will be used to produce the image. A default of 0 - 180 degrees is used to prevent back-scattered events from degrading the image.

The user will then be asked a series of questions about the fits that will be performed to the X slice.

            Enter the number of peaks to fit in the X axis (1 or 2)

If the user enters a value of 2, the code will the ask for the position of the centroid of the first and second peaks

            Enter the rough position of peak 1 in the X axis: 330
            Enter the rough position of peak 2 in the X axis: 360


If only one peak is to be fitted, the position of the peak will be automatically be determined by the code.

The above questions will then be repeated for the Y axis.

The code will then ask for the range of channels to be fitted in both the X and Y axes.

            Enter the number of channels to be fitted in the X axis:
            Enter the number of channels to be fitted in the Y axis:

If the user has opted to fit one peak, the fit will be performed over a range of half the entered number of channels either side of the point of maximum intensity. E.g. if the user enters a range of 300 channels, and the peak is located in channel 300, the fit will be between channels 150 and 450. If the user has chosen to fit 2 peaks, the range will be centred around the point half way between the 2 peaks. E.g. if the peaks are located at 330 and 360 and the range is 200, the fit will be performed between 245 to 445.

The user will then be asked to enter the number of events to be used to construct the image. This is useful is one wishes to evaluate the effect of the number of cones on the final image quality and also allows a sub-section of a large data set to be imaged.

            Enter the number of events to process (0 for all events):

The number entered is the number of cones that are used in the final image and so events which do not pass any energy or angle gates applied will not be counted. If the number entered is greater than the number of events in the data file, imaging will stop when the end of file is reached. If the user wishes to image all events in the file the value of '0' should be entered here.

Once all of the above questions have been answered, an option file will be created in the current directory. This file stores all of the answers that have been entered for future reference. It will have a name that is comprised of the name of the data file entered with the extension '.opt' appended to it. For example if the file name was 'compton.out' the option file will be called 'compton.out.opt'. This option file can also be used to re-run a previously imaged data set and is described in more detail in the section Option mode below.

A series of images will then be produced showing the intensity as a function of position,as desribed in the section Images and Plots below.


Option mode

Once the Compton imaging code has been used in interactive mode, as described above, an option file is produced which contains the users responses to the inputs requested by the program.

The format of the option file is as shown below.

            Compton.out
            3
            235 r
            0
            0 -1 q
            200 300 20
            120 125
            0 45
            300 300
            -1
            300 200

            2 1
            330 360
            0 0

A description of each of these parameters is also included in the option file.

            -------------------
             The above values relate to...
 
              Filename
              Data format (1 = geant, 2 = gamos ascii, 3 = gamos binary, 4 = sp, 5 = sp with psa, 6 = sp & agata)
              Offset for Gamos (mm) & Gamos geometry (r)ing or (s)tack (q = not set)
              Cryostat separation for smartpet (mm)
              Level of PSA for smartpet data with PSA (1, 3, 5 or 7) & Keep or reject non PSA events (0 reject, 1 keep, -1 not set) & use depth of interaction information (q = not set)
              Minimum Z depth      Maximum Z depth      Z step size
              Min and Max energy gate (keV)
              Min and Max angle gate (degrees)
              X and Y offset of source location (mm)
              Number of events to image (-1 = all)
              The number of channels included in fits - half of this number must be <= the offsets defined above
              Number of peaks to fit in the X and Y axes
              Position of peaks 1 and 2 in the X axis (these will not be used if the number of peaks above is set to 1)
              Position of peaks 1 and 2 in the Y axis (these will not be used if the number of peaks above is set to 1)

Not all of the parameters are required by the program (for example if the format is 1 (Geant), the value for the Gamos offset is not required) however a value must be specified as it acts as a placeholder so that the program knows it has not missed any necessary information. In the above example the inputfile file 'Compton.out' is in Gamos Binary format and has a Gamos offset of 235 mm. Slices will be produced from z = 200 - 300 in 20 mm steps. Only data which has a total energy of 120-125 keV inclusive and a scattering angle between 0-45 degrees will be imaged. The plots will be offset by 300 mm in x and y so that the 0,0 position in Gamos is at 300,300 in the plots and the fits to the x and y slices will be over 300 channels (channel of maximum intensity +/-150).

If the user wished to repeat a previous image the option file can be specified at run time in the command line and all the required values will be read directly from it. The user will not be required to re-enter any data.
This is done by declaring the name of the option file when the code is executed from the command line. For example, the command

             ~dsj/bin/compton3.1 Compton.out.opt

will start the program in Options mode and tell it to read the option file Compton.out.opt.
The code will then proceed to produce plots as explained in the section Images and Plots below.

This mode is especially useful if a set of images have already been produced and the user wishes to slightly modify the calculations, for example to change the energy or angle gates. Rather than re-entering all the data, the option file can be modified directly and then the calculations re-run. As the name of the ROOT files produced is constructed from the data file name and the z-slice values, if a calculation is re-run with a different set of parameters, such as energy gates, from the same data set,  the existing ROOT files will be overwritten. For this reason it is recommended that a new directory is created for each set of calculations.
It is also possible to avoid the data being over-written by copying the data file to a file with a different name. This copy can then be deleted once the calculations have been finished. For example, if a file with the name Compton.out was to be imaged with gates on the scattering angles of 0-45 degrees and then again with 45-90, the file Compton.out could be copied to Compton_0-45.out  and also Compton-45-90.out. If these were then declared as the data file name in the option files a set of ROOT files name Compton_0-45.out*.root and Compton_45-90.out*.root would be produced. Compton_0-45.out and Compton-45-90.out could then be deleted when the calculations had completed.

Three of the values that can be specified in the option file cannot be changed when the code is used in interactive mode, these are the  X and Y offset of source location and the number of channels included in fits. It is expected that the user will have to modify these only in response to the results given by an initial calculation. For example the default fit range of 300 may not be wide enough and may lead to a bad fit result (see the section Fitting below). However, the user will need to perform an initial calculation to determine if this is the case or not. This can then be changed in response to the initial calculation by editing the option file.


Batch mode

Batch mode is similar to Options mode in that the code reads all the parameters from an option file and so does not require any input from the user once it has been executed. The difference is that once the imaging of a given data file has been completed, the ROOT session is closed down and the terminal reset. This enables a batch file script to be created and run which runs the imaging code over a number of different data sets without having to manually specify the option file for each run. For example the Nov 2010 Smartpet Compton camera experiment collected many different data sets with varying source positions. If one was to require an image from each data set it would be a time consuming and tedious job to manually enter the details for each run using the code in Interactive mode. It become much easier if the code is used in Option mode as one option file can be created and then edited to suit each run but the user then has to sit and restart the code with the different option files for each run. In batch mode, the user generates a file which lists the option files from which images are to be generated. The imaging code then processes each option file in turn. This means that a list of many large data files or many slices could be processed with no input from the user, for example overnight.

Batch mode is called by passing the name of the option file as in Option mode by with an additional '0' afterwards to specify it is in batch mode.
 
             ./Compton3.1 Compton.out.opt 0

A script can then be used to run the imaging code in batch mode. The format of which is thus

            ~dsj/bin/compton3.1 Compton.out.opt 0
            ~dsj/bin/compton3.1 Compton1.out.opt 0
            ~dsj/bin/compton3.1 Smartpet.out.opt 0


This will call the imaging code 3 times in batch mode. The first time it is called it will process an option file called Compton.out.opt, the second time it will process a file called Compton1.out.opt and the third time it will process a file called Smartpet.out.opt. Each of these can be completely different data set. It should be noted however, that each time a ROOT file is created it's name is constructed from the data file name and the z-slice value so if a number of different images are to be produced from the same data, the results of each previous calculation will be over written by the last. For this reason it is recommended that a separate folder is created for each set of images. It is also possible to avoid the data being over-written by copying the data file to a file with a different name. This copy can then be deleted once the calculations have been finished. For example, if a file with the name Compton.out was to be imaged with gates on the scattering angles of 0-45 degrees and then again with 45-90, the file Compton.out could be copied to Compton_0-45.out  and also Compton-45-90.out. If these were then declared as the data file name in the option files a set of ROOT files name Compton_0-45.out*.root and Compton_45-90.out*.root would be produced. Compton_0-45.out and Compton-45-90.out could then be deleted when the calculations had completed.


Images and Plots

The Compton imaging code will then read through the data file and determine the total number of events and the number of events which pass the entered energy and angle gates. Each of the accepted events will then be reconstructed into a Compton image for each specified z slice. For each slice a 2d plot of intensity in the xy-plane is produced, along with a slice through this in both the x- and y-planes. These x and y planes are then fitted assuming a Lorentzian peak on a quadratic background. The FWHM and Chi-squared/DOF for each fit are displayed. For each z value, a ROOT file is produced which contains the 2s and 1d intensity plots along with the fits. These files will have a name that is constructed from the name of the initial data file, the z-slice value and the extention '.root'. So for example imaging the data file 'compton.out' at slice 240 will result in a file named 'compton.out.s240.root'.  The code will then display the plots on the screen in a series of ROOT windows. The plots can be accessed at a later date by following the instructions given in the section Accessing the created ROOT files. A sample of the 2d and 1d intensity plots are shown below.



If multiple slices are requested, the program will display the intensity plots for each slice as they are calculated. Once it have calculated the final z-slice plots  it will display a series of plots showing the FWHM and Chi-squared/DOF as a function of the z-slice distance. From there it is possible to estimate the the source to detector distance as the calculated FWHM and Chi-square/DOF will be minimised at the source location, as explained in the section Fitting below.  These plots will be stored in a ROOT file, the name of which is constructed from the name of the data file with the suffix 'FWHMvZ.root' so for the data file 'compton.out' the plots will be saved in a file called 'compton.out.FWHMvZ.root. Note that this file will not be produced if a single slice is imaged.

In addition to these ROOT plots, the code also produces a slice file in the old Matlab format. These files are created to allow direct comparison with the Matlab results. These can be imaged with the existing AlexRoot*.cpp codes or using the new c++ plotting code I developed which is described here (access required).
These legacy imaging files are ASCII files with 800 x 800 intensity values written sequentially. The name of these files is constructed from the name of the original data file with the suffix '.s*' where * is the z-slice that is being imaged. For example, the input file  'compton.out' imaged at slice z = 235 will produce a legacy imaging file with the name 'compton.out.s235'.


Fitting

The 1d intensity plots through x and y are automatically fitted assuming a function consisting of a Lorentzian peak on a quadratic background.
The program performs a Chi-squared minimisation of the function to determine the best possible fit. The resulting FWHM and Chi-squared/DOF for the fit are displayed in the terminal and are written in to the produced images. The error quote in the FWHM is only the error attributed to that parameter in the fitting procedure. It does not account for any other experimental uncertainties such as the choice of z-slice etc and should not be used as an estimation of the error in the resolution.

If the requested fit range is beyond the range of the available data, the fit range will be truncated and an warning will be displayed.
A typical fit to a single peak is shown below.


If multiple slices are produced from a single data set, the FWHM and Chi-squared/DOF will be plotted as a function of the z-slice values. This allows the position of the source in depth to be estimated. The source location is identified as the area with the greatest overlap of the Compton cones, it is obvious, therefore, that for the z-slice which corresponds to the correct source position, the image will be 'in focus' and the FWHM will be minimal. If the imaged slice is not in the same distance as the source, the image will become less focused and the FWHM will be increased. The further away the z-slice is from the source location, the more out of focus, the image will be and the larger the FWHM will be. Therefore, by plotting the FWHM as a function of Z value a parabolic distribution should be observed, the source location can be identified as the minimum of this distribution. As the image transitions between in and out of focus, the resulting profiles in the x and y direction becomes less like the ideal Lorentzian-peak-on-a-quadratic-background assumed by the fit function. Thus the Chi-squared/DOF distribution follows the same pattern as the FWHM, with the minima giving the likely location of the source. In the figures below the source in located at z = 235 mm.

If 2 peaks are fitted, the FWHM of peak 1 will be plotted. The FWHM value for peak 2 is displayed in the terminal window and so a similar plot can be produced manually for peak 2 if required.




Accessing the created ROOT files

Once a data set has been imaged and the plots created, they are automatically saved in a ROOT file. For each slice that is imaged, a ROOT file will be created each of which contains the 2d xy-intensity plot, the x and y 1d-intensity plots and the x and y fits.  If the code is used to produce multiple slices, an additional ROOT file will be produced which contains the FWHM and Chi-squared/DOF plots for both the x and y slices as a function of z.
These ROOT files can be accessed from within a terminal by typing the command 'root' to start a new ROOT session.
A ROOT command line will the be displayed. Entering the command

            TBrowser t;

will open a ROOT object browser window. This is shown in the figure below.




The panel on the left hand side will display the file structure and any ROOT files.
Double clicking on the ROOT file of interest will display the contents of that file. These are the plots that were created earlier.
Double clicking on one of these plots will cause it to be displayed in a new window. These can then be modified as required just like any other ROOT plot.

A brief guide to some usefull ROOT functions is given here.


Zooming in and out of an image.

Once a ROOT image has been opened, it is easy to change the range of the x and y axis to zoom in and out of the image. This is done by left clicking on the axis to be expanded at the point to be expanded from and dragging the cursor to the point that it is to be expanded to and then releasing the mouse button.
To reset the range to the default values, right click on the axis of interest and select Unzoom.
To specify a precise range right click on the axis and select SetRangeUser. Enter the lower value in the ufirst box and the upper value into the ulast box then press ok.