RE: [ROOT] Speed problem for analysis macro

From: Aranzazu Ruiz Martinez (Aranzazu.Ruiz.Martinez@cern.ch)
Date: Tue Jul 20 2004 - 19:22:46 MEST


  Hi Rene!

  I have released when I have made my macro shorter than the problem is not in reading the tree. I have ran the macro with the same number of branches and it goes very fast. I have seen that the speed problem comes from having couts inside if loops. I show you one of the loops I am using. This macro contains a lot of loops like this. For example:

    if(TRod.HMarker != HEADER_MARKER) {
      err++;
      count_err_header_trailer[0]++;
      if(answer == 0 && answer_opt[2] == 0) {
        cout<<"Event = "<<event+1<<" -> Error HMarker = "<<count_err_header_trailer[0]<<endl;
        cout<<"HMarker = 0x"<<hex<<TRod.HMarker<<dec<<endl;
        if(answer_opt[3] == 0) {
          getchar();
        }
      }
    }

  If I comment the couts the execution is fast, otherwise it is very slow. Do you know how can I solve it? 

  Thank you very much. Best regards

             Arantxa


-----Original Message-----
From:	brun@pcbrun.cern.ch on behalf of Rene Brun
Sent:	Tue 7/20/2004 3:00 PM
To:	Aranzazu Ruiz Martinez
Cc:	roottalk (ROOT Talk mailing list)
Subject:	Re: [ROOT] Speed problem for analysis macro

Could you send a very short script reading your Tree and also a small file
with your Tree. If the file is more than 100 Kbytes, tell us a public area
where we can access it.

Rene Brun

Aranzazu Ruiz Martinez wrote:
> 
>   Hi!
> 
>   I have made a macro to analyse data from a root tree. The tree contains about twenty branches using two different structures defined in a separate file and the problem is that the program is very slow and spends a lot of time to check a few entries.
> 
>   Do you know any way to increase the speed of this program? Maybe the problem is in the way I'm using the structure or in the way we read the branches.
> 
>   Thanks in advance. Best regards
> 
>                 Arantxa



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET