$Id: GSUtil.html,v 1.3 2002/11/12 22:38:07 tl Exp $
GammaSphere ROOT sorter
GAMMASPHERE ROOT sorter GSUtil
GSUtil
In general you should use rootn.exe rather than root because
we often use shared memory.
By issuing the command
.L ~tl/bin/GSUtil_cc_v3.10.02.so
in rootn.exe, a number of useful utilities are loaded into the root
session. Below is a list of them. The '_v3.10.02' string specifies the
version of ROOT the utilities were compiles from.
Consult
Hints and Kinks for instruction on how we setup ROOT for a
specific version of ROOT on the Solaris machines at ANL.
The source code for GSUtil_cc.so can be found
here
GSSort control Utilities
A number of commands are available to 'control' the GSSort
sorting program from inside rootn.exe without having
to go into another session window. They are typically
accomplished by signaling GSSort using the Solaris
utility "pkill".
- startsort("sortengine","chatfile", "logfile");
-> start GSSort (= specified version of GSSort)
with chatfile "chatfile". A window will pop up and show the
output from GSSort. The output will also be logged to
"logfile". Note: YOU MUST RELOAD THE SHARED MEMORY FILE
AGAIN AFTER A RESTART OF THE GSSORT SORTER TO SEE THE NEW
DATA. Exapmple: startsort("GSSort_3.10.02","gsfma137.chat",
"gsfma137.log")
- stopsort(); ->
Stops GSSort gracefully, with a data dump, sorting statics etc
- killsort(); ->
Stops GSSort cold (KILL -9)
- update(); ->
Signals GSSort to update the shared memory
- setdumpinterval(dt); ->
Instructs GSSort to set the time between automatically
updating the shared memory (or diskfile) to dt minutes.
Example: setdumpinterval(1)
- zapall(); ->
zaps all spectra in the shared memory. This command has no effect if
you are just looking at an old map file, i.e., not sorting.
- zap("spname"); ->
zaps spectrum "spname" in shared memory. This command has no effect if
you are just looking at an old map file, i.e., not sorting.
- te("fn"); ->
edits (using textedit) the file "fn" (e.g., a chat script) in a popup
window
- printevents(); ->
print events in the sorting window. Good for debugging electronics
or just see that the events are ok.
- setbeta(beta); ->
change the beta value in the sort (on the fly). After the change,
you will want to use the zap command.
- zapcounters(); ->
Tells GSSort to zap its counters so
it is easier to see if there are problems
with the data as it is coming in right now.
- ; ->
- ; ->
- ; ->
- ; ->
- ; ->
- ; ->
Other Utilities
- sload("name"); ->
load (or rather attach) the shared memory "name" to
the rootn.exe session. It will do a close() first.
Set "name" to whatever you called the shared memory
map using the 'sharedmem' chatscript option.
NOTE: whenever you restart your sorting program
[stopsort(), startsort("","","")], you must do an sload again
or you will be looking at old stuff...
- dload("name"); ->
read the root disk file with called "name" into
the rootn.exe session. It will do a close() first.
- dmake("name"); ->
create root disk file "name", It will do a close() first.
- close(); ->
will close the shared memory or diskfile
- mkcanvas(); ->
set up "c1" canvas with useful properties. If an old
one exists, it will be deleted before a new canvas is
set up. The name of the canvas will be "c1".
- ls(); ->
list the spectra available in the rootn.exe shared memory
or disk file.
- d1("name",lo,hi); ->
display 1D spectrum between lo and hi channels. Destroys
old displayed spectrum.
- d1o("name",lo,hi); ->
as d1() but does not destroy old displayed spectrum. I.e., it will
overlay the spectrum.
- md1("List","GenNam",xmin,xmax[,wait]); ->
utility to overlay many spectra. "List" contains a list of the module
numbers to display in the format shown in the example below. "GenNam"
is the generic name of the spectra, I.e., in the example below, the
spectra will be: ehi005,ehi007,ehi008,ehi009, etc. xmin and xmax are
the display limits to use.
Example:
md1("7-9,11-52,54-57,59-109","tge",3700,4200,0);
The y scale is set by the first spectrum (so make sure that
one has counts).
The meaning of wait is
wait=0: don't wait; true overlay;
wait=1: overlay, but you must hit return for every spectrum;
wait=2: display each spectrum clearing everytime;
wait=3: as 2, but you hit return for each spectrum;
Note: the overlay options: wait=0 and wait=1 can be quite slow
if you display a lot of spectra. The 'movie' versions
of the esample above:
md1("7-9,11-52,54-57,59-109","tge",3700,4200,2);
is much faster.
- showlimits; ->
shows that x and y limits are set for 1D displays
- setxlimits(lo,hi); ->
set the x limits from lo to hi
- unsetxlimits; ->
set x limits to 'auto'
- setylimits(lo,hi); ->
set the y limits from lo to hi
- unsetylimits; ->
set y limits to 'auto'
- d2("name",xlo,xhi,ylo,yhi); ->
display 2D spectrum between lo and hi channels
- ft1("name",lo,hi,p1); ->
fit a single peak, at channel p1, with a quadratic background between
the limits of lo and hi. You must display the spectrum first using
the d1() command. This function is not much more than a prototype
at the moment, it needs more work to be really useful. We also need
to be able to fit more than one peak.
- pjx("2Dname","proname",lo,hi); ->
project on the x-axis from 2D histogram "2Dname" with y-axis
gate between lo and hi. Final spectrum is called "proname"
- pjy("2Dname","proname",lo,hi); ->
project on the y-axis from 2D histogram "2Dname" with x-axis
gate between lo and hi. Final spectrum is called "proname"
- gate("name","pname",p1,w1,bf); ->
extract a gate from lo=p1-w1 to hi=p1+w1 on the gamma-gamma matrix
called "name" and subtract "bf" fraction of the total projection.
Write the result into spectrum "pname". If bf=1.0, the resulting
spectrum will have no net counts. If bf=0.0, the resulting
spectrum will not have any background subtracted.
- wrspe("root name","spe name"); ->
write 1D root spectrum spectrum "root name" out in Radford
spe format as spectrum "spe name".
- rdspe("spe name","root name"); ->
read "spe name" 1D spectrum in Radford spe format into root
as spectrum "root name".
- rdmat("name"); ->
read a matrix in Torben mat format into root.
- tgealign("old","new",pos,w1) ; ->
find the germanium time offsets to line up all peaks in
position "pos". "old" is the name of the file that
contains the current offsets and "new" is the name of the
new offset file. "w1" is the number of channels around the
maximum channel used to find a mean position of the time
peak. If "old" is set to "DUMMY", no old file is read in
and the offsets are assumed to be zero.
- tbgoalign("old","new",pos,w1) ; ->
find the BGO time offsets to line up all peaks in position
"pos". "old" is the name of the file that contains the
current offsets and "new" is the name of the new offset
file. "w1" is the number of channels around the maximum
channel used to find a mean position of the time peak. If
"old" is set to "DUMMY", no old file is read in and the
offsets are assumed to be zero.
- ehialign(oldf, newf, kevch, sgain, w1, source,cut); ->
find the germanium hires energy calibration parameters
using a 207Bi source for calibration (Energies: 569.702 keV
and 1063.662 keV). "oldf" is the old calibration parameter
file and "newf" is the file to which the new calibration
parameters are written. "kevch" is the desired gain in
kev/ch. "sgain" is the gain that you specified in the
GSSort chatfile with "hiresdatamult". "w1" is the number of
channels around the max channel of the peaks that you want
to use to define a mean position of the two source peaks
(typically 2-3). Source must be one of "207Bi", "60Co" or "88Y".
cut is the lowest channel to use.
- eloalign(oldf, newf, kevch, w1, source,cut); ->
find the germanium lores energy calibration parameters
using a 207Bi source for calibration (Energies: 569.702 keV
and 1063.662 keV). "oldf" is the old calibration parameter
file and "newf" is the file to which the new calibration
parameters are written. "kevch" is the desired gain in
kev/ch. "w1" is the number of channels around the max
channel of the peaks that you want to use to define a mean
position of the two source peaks (typically 2-3).
Source must be one of "207Bi", "60Co" or "88Y".
- esidealign(oldf, newf, kevch, w1, source,cut); ->
find the germanium side channel energy calibration
parameters using a 207Bi source for calibration (Energies:
569.702 keV and 1063.662 keV). "oldf" is the old
calibration parameter file and "newf" is the file to which
the new calibration parameters are written. "kevch" is the
desired gain in kev/ch. "w1" is the number of channels
around the max channel of the peaks that you want to use to
define a mean position of the two source peaks (typically
2-3). Source must be one of "207Bi", "60Co" or "88Y".
- del("name") ; ->
delete a TH1D (1 dimensional) spectrum. If it resides in
shared memory the utility quietly ignores you since you
cannot delete shared memory spectra from inside rootn.exe.
- add1("h1","h2",af) ; ->
add TH1D (1 dimensional) spectrum "h2" to "h1". If "h1"
does not exist, it will be created with the same x-axis as
"h2". Optionally 'af' can be specified as the factor to
multiply "h2" with before addition (this allows for
subtraction of spectra using negative 'af' values). Use
del("h1") to delete "h1" first if you want to add up from
scratch.
- version(); ->
display rcs version number of src file
- mk2dwin(histname); ->
display the 2D histogram "histname" and allow the user to
create a 2Dwindow (bananagate) on it. Use "save2dwin" to
save the 2dwin.
- save2dwin(winname); ->
save the 2Dwindow (bananagate) created with "mk2dwin" to a
file so that it can be read by GSSort and used to gate
spectra. "winname" is both the diskfile name as well as the
2dwin name.
- d2dwin(winname,hist); ->
utility to dislay the 2dwin "winname" on top of the 2D
histogram "hist". The 2dwin is read from the diskfile
"winname".
- lsrootfile(histname); ->
list the content of a rootfile. Will also list the content
of a 2dwin file; but it cannot list the content of a shared
memory map file.
- confirm(); ->
function used to temporary halt execution in a script file.
E.g., to make a number of 2d windows and write them out you
can have a sequence of commands like:
{mk2dwin(histname);confirm();save2dwin(winname);........}
....oops, this doesn't work yet. Not sure why!
- ; ->
- ; ->
- ; ->
- ; ->