[Gate-users] "Find" function in ROOT
Zhengzhi Liu
zliu36 at stanford.edu
Fri Feb 1 18:56:50 CET 2019
Dear GATE community members,
Thank you for reading my post first. I have a question regarding ROOT.
Please give any help.
Is there a function/way in ROOT to find the index of an event with its
eventID? To be more specific, let's say we want all the information of the
event with eventID = 100, is there a way to find the index i, then
Hits->GetEntry(i) can be used to read out all the information of this hit
from Hits file.
Currently, I loop through the whole Hits file once for each event that I
need, which is very slow when Hits->GetEntries() is large.
for (Int_t i=0; i< Hits->GetEntries(); j++) {
Hits->GetEntry(i);
if((eventID == 100)
{ //*** }
}
Thank you very much for reading and your help.
Best regards,
Zhengzhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20190201/d0f4f650/attachment.html>
More information about the Gate-users
mailing list