[BLAST_ANAWARE] ntuple>>histarrays (w/multiple runs) = slow

From: Peter Karpius (karpiusp@einstein.unh.edu)
Date: Mon Dec 02 2002 - 10:55:39 EST


Hi all-

        I am trying to fill an array of histograms from the eep ntuple
using the following method:
********************************************************************
 for (int lpaddle = 0;lpaddle<16;lpaddle++){
    for (int rpaddle=0;rpaddle<16;rpaddle++){
   
    TString hist(u+"ptl["+lpaddle+"]["+rpaddle+"]");
    TString l_paddlecut(u+"atl > 7500 && ntl=="+lpaddle+" &&
ntr=="+rpaddle);
    TString r_paddlecut(u+"atr > 7500 && ntl=="+lpaddle+" &&
ntr=="+rpaddle);
    histpos[lpaddle][rpaddle] = new TH1F(hist,hist,100,-500,500);

    if (rpaddle < 8){
      //chain[ds]->Draw(u+"ptl>>"+hist,l_paddlecut,"goff");
            eep->Draw(u+"ptl>>"+hist,l_paddlecut,"goff");
      cout << "\ncut = " << l_paddlecut;
    }
    else {//chain[ds]->Draw(u+"ptl>>"+hist,r_paddlecut,"goff");
       eep->Draw(u+"ptl>>"+hist,r_paddlecut,"goff");
    cout << "\ncut = " << r_paddlecut;}
  
   Nent[lpaddle] = histpos[lpaddle][rpaddle]->GetEntries();
   if (Nent[lpaddle] > NentMAX[lpaddle]) { NentMAX[lpaddle] = Nent[lpaddle];
   position[0][lpaddle] = histpos[lpaddle][rpaddle];
   p4->cd(lpaddle+1);
   position[0][lpaddle]->Draw();
   }
    
    }
  }
******************************************************************

It seems to work fine for one run number as the command line argument.
But if I have two run numbers it takes almost TEN times as long to do
things (not twice as long as I would expect). I am calling init.C in the
opening statements. Any ideas how I can speed things up here?

                                                Thanks-

                                                Pete

 ----------------------------------------------
Pete Karpius
Graduate Research Assistant
Nuclear Physics Group
University of New Hampshire
phone: (603)862-1220
FAX: (603)862-2998
email: karpiusp@einstein.unh.edu
http://pubpages.unh.edu/~pkarpius/homepage.htm
----------------------------------------------



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:29 EST