[gate-users] Draw method with a selection based on logical operation on strings

tim tran timtran at jlab.org
Fri Sep 2 21:59:14 CEST 2005

I have just entered the exciting field of detector simulation using
I am using ROOT for analysis of Gate.root data. 
First of all, I like to thank all those who have made it possible for
these wonderful software packages to be freely available for researchers
all over the world.
Now, I have a  question about displaying histogram using ROOT.
The Draw() method provides a very easy way to display a histogram and
has a very neat implementation of a selection option.
e.g.,  Singles->Draw("globalPosX","energy>0.1");  Display those Singles
with energy less than 0.1 Mev.
However, the easy selection method does not seem to extend to string
operation. For example, if I want to display the same globalPosX for
those Singles that had at least Compton interaction in the SPECThead, I
thought the following line might work, it it did not,
  Singles->Draw("globalPosX","!strcmp(comptVolName,"SPECTHead"));  To
display those Singles with a Compton interaction in the SPECThead.
However, the 'comptVolName' is not recognized by ROOT, while globalPosX
Can some one point out what was wrong with the above line?
Is there a correct and similarly easy way to display a variable with
logical operation on strings as a selection method?
I understand that an alternative way is to use the Get Entry() method in
a loop. 
If using GetEntry() is the only way possible to display a histogram when
selection is based on comparison of strings, please tell me, so I won't
keep looking for an easy way out.
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20050902/e9f4a5d0/attachment.htm>

More information about the Gate-users mailing list