<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear GATE community members, <div><br></div><div>Thank you for reading my post first. I have a question regarding ROOT. Please give any help. </div><div><br></div><div>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. </div><div><br></div><div>Currently, I loop through the whole Hits file once for each event that I need, which is very slow when Hits->GetEntries() is large. </div><div><div>  </div><div><font size="1">for (Int_t i=0; i< Hits->GetEntries(); j++) {<br></font></div><div><font size="1">                                        Hits->GetEntry(i);</font></div><div><font size="1">                                        if((eventID == 100)</font></div></div><div><font size="1">                                        {  //***  }</font></div><div><font size="1">  }</font></div><div><br></div><div>Thank you very much for reading and your help.</div><div>Best regards,</div><div>Zhengzhi </div></div></div></div></div>