Re: Memory troubles when adding weights to a tree->Draw()

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 18 Jan 2011 08:06:35 -0600


Hi Chris,

Do you see the same problem with using:

map<Int_t,Double_t> theMap;
double getMap(Int_t );

//main body of program here

double getMap(Int_t evNum){
  return theMap[evNum];
}

Philippe.

On 1/18/11 7:42 AM, Chris Parkinson wrote:
> Hi rooters
>
> I'm having memory issues when trying to add weight information to a histogram. I book the histogram:
>
> TH1F* ht = new TH1F("ht","title;x;y",100,
> xlow,xhigh);
>
> and fill it with information from a tree:
>
> tree->Draw("X>>ht","(getMap(NUM))*(" + cuts + ")");
>
> where X and NUM are branches in the tree, 'cuts' is a TString containing some cuts to be applied, getMap is a function that I have
> defined to get values from 'theMap':
>
> map<Int_t,Double_t> theMap;
> double getMap(Int_t &);
>
> //main body of program here
>
> double getMap(Int_t & evNum){
> return theMap[evNum];
> }
>
> I am filling the histogram repeatedly in a loop (24k iterations). With the weight information, after approximately 600
> iterations, the memory usage begins increasing steadily until the program freezes. When I fill the histogram in the same way
> without the weight information, tree->Draw("X>>ht","cuts"); , I don't (appear to) have any problem.
>
> I've tried using ROOT versions 5.26.00 and 5.28.00.
>
> Thanks in advance
>
> Chris
Received on Tue Jan 18 2011 - 15:06:53 CET

This archive was generated by hypermail 2.2.0 : Tue Jan 18 2011 - 23:50:01 CET