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

From: Chris Parkinson <c.parkinson09_at_imperial.ac.uk>
Date: Tue, 18 Jan 2011 18:26:44 +0100


Hi Philippe

Yes, the problem remains with the function defined in this way.

Thanks

Chris

On 18 January 2011 15:06, Philippe Canal <pcanal_at_fnal.gov> wrote:

> 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 - 18:26:49 CET

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