[Gate-users] Gate-users Digest, Vol 62, Issue 19

Rajaram, Ramya (H USA) ramya.rajaram at siemens.com
Mon Jul 18 23:32:48 CEST 2011

Hi Arda,

Inside Root's TBrowser, right-click on say, the Singles tree and
"StartViewer". This opens a TreeViewer with all the leaves. Make sure
the "Scan" box (top right) in the TreeViewer is checked, then
right-click on say, comptVolName and then "Scan". A file called
Singles-scan.dat is created in the working directory that now contains
the data.  (As of now, I don't know how to set the file name inside Root
other than just going back to the working directory and renaming a file
before creating another output file). If the "Scan" box in the
TreeViewer is not checked, then there is a continuous verbose output of
the data on the screen. 

The other option is to have the ascii output enabled in your macro. This
way, you get all the data you need in the Singles and Hits files.

Hope that helps,


-----Original Message-----
From: gate-users-bounces at lists.opengatecollaboration.org
[mailto:gate-users-bounces at lists.opengatecollaboration.org] On Behalf Of
gate-users-request at lists.opengatecollaboration.org
Sent: Monday, July 18, 2011 4:46 PM
To: gate-users at lists.opengatecollaboration.org
Subject: Gate-users Digest, Vol 62, Issue 19

Send Gate-users mailing list submissions to
	gate-users at lists.opengatecollaboration.org

To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to
	gate-users-request at lists.opengatecollaboration.org

You can reach the person managing the list at
	gate-users-owner at lists.opengatecollaboration.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gate-users digest..."

Today's Topics:

   1. Using Multicore Computers to Run GATE Simulations
      Simultaneously (Geron Bindseil)
   2. Reading root histogram values (Konik, Arda)


Message: 1
Date: Mon, 18 Jul 2011 12:34:55 -0400
From: Geron Bindseil <geron9 at gmail.com>
To: gate-users <gate-users at lists.opengatecollaboration.org>
Subject: [Gate-users] Using Multicore Computers to Run GATE
	Simulations	Simultaneously
<CA+Y8gNL35F9tDmvaW53+DniHOmAJuhVhRYRbwW4chrA7yeK=ZQ at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Dear Gate Users:

A couple days ago I mentioned I had written a script for running
Gate simulations simultaneously on multicore computers. Many people have
written asking for this script, so I decided to send it over the list in
case anyone else could benefit from it.

I have attached an example Perl script and README file that explains how
run multiple GATE simulations simultaneously on one computer with more
one logical CPU. This method runs a set of Gate simulations with
parameters and if the number of simulations to be run are greater than
number of logical CPUs, the script will wait until a CPU is available
starting the next Gate simulation.

N.B. In my response to a question on July 16, I accidentally gave the
incorrect syntax for the terminal command ("<" should have been ">").
correct syntax for storing the output in a file (rather than printing it
the terminal is): "Gate -a ParameterName ParameterValue my_macro.mac >
terminal_output.out". If you just want to run a bunch of macros
simultaneously in the background manually, you can do so by inserting an
ampersand "&" at the end of each command.

Kind Regards,


Geron Bindseil
PhD Candidate, Physics
University of Western Ontario
London, Ontario, Canada
-------------- next part --------------
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}

\f0\fs24 \cf0 Using Multicore Computers to Run GATE Simulations
Geron Bindseil\
gbindsei at uwo.ca\
July 18 2011\
Summary: This is a small tutorial that explains how to run multiple GATE
simulations simultaneously on one computer with more than one logical
CPU. This method runs a set of Gate simulations and if the number of
simulations to be run are greater than the number of logical CPUs, the
script will wait until a CPU is available before starting the next Gate
Requirements: This method requires GATE to be installed and the
env_gate.sh or env_gate.csh shell script to have been sourced. Perl and
several perl modules are required.\
[[Configuring Perl to Install Modules]]\
Make sure you have perl installed on your computer. After that, install
the cpanm module installer which is a tool that automatically configures
and installs perl modules. Install cpanm by typing the following on the
terminal (use 'sudo' if your local account doesn't have write privileges
to system directories):\
sudo cpan App::cpanminus\
After that, any modules can be installed by typing the following:\
sudo cpanm Module::Name\
The instructions for doing this and installing CPAN modules can be found
[[Installing Required Perl Modules]]\
The script requires a couple modules to be installed. Install them by
typing the following into a terminal window:\
sudo cpanm Forks::Super (required: for managing the queue of GATE jobs)\
sudo cpanm File::Path (optional: to make creating directories easier)\
[[Running GATE script.]]\
Make a Gate macro and put the gate_batch.pl perl script into the same
directory. Modify gate_batch.pl to set the number of logical CPUs your
computer has (double the number of physical cores if your computer has
hyper-threading). You may also wish to modify the default path for
storage of the output root data files.\
To run the code, in a terminal window with the env_gate shell script
already sourced, execute the following command:\
perl gate_batch.pl\
The words "End of perl batch script." will be printed when all the
macros have completed.\
- Originally, my script included a step to automatically determine the
number of CPUs but it did not treat hyper-threaded CPUs properly.\
- Originally, my script called a print statement when any particular
macro had finished running, but this was not working as indented.}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gate_batch.pl
Type: application/octet-stream
Size: 1913 bytes
Desc: not available


Message: 2
Date: Mon, 18 Jul 2011 16:58:17 -0400
From: "Konik, Arda" <Arda.Konik at umassmed.edu>
To: "gate-users at lists.opengatecollaboration.org"
	<gate-users at lists.opengatecollaboration.org>
Subject: [Gate-users] Reading root histogram values
Message-ID: <103DE9ED-E33B-451B-AFB0-FEA037543DEE at umassmed.edu>
Content-Type: text/plain; charset="windows-1252"

Hi All,
How can I read the root histogram values ? 
Currently, I just enable the " Event Statusbar " as in the attached
screenshot and bring the cursor  on the horizontal line to read its y -
value at the bottom. 
In this example, the cursor (invisible on this picture) is positioned
somewhere on the highlighted tab and the y-value correctly shows y = 56.
However, this is not practical when there are multiple quantities I need
to check as in the case of ComptVolname (i.e., compton scatter values of
different SD in the system), especially
when horizontal lines are very close to y = 0. 

How can I read these values  without using this graphical method ? I
tried to use some root commands but couldn't get what I needed?
I ll appreciate if you could give a command line example to get the
scatter values of , say 2 materials ( Vol1 and Vol2) in ComptVolname.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: root_histogram.png
Type: image/png
Size: 43908 bytes
Desc: root_histogram.png
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001.txt


Gate-users mailing list
Gate-users at lists.opengatecollaboration.org

End of Gate-users Digest, Vol 62, Issue 19

More information about the Gate-users mailing list