Re: How to get an Histogram ?

From: suvayu ali <fatkasuvayu_at_gmail.com>
Date: Thu, 8 Sep 2011 00:10:30 +0200


Hi Jordi,

On Wed, Sep 7, 2011 at 6:02 PM, Jordi Nadal <jnadal_at_ifae.es> wrote:
> root [1] gROOT->FindObject("Wjets_HFC_4ex")
> (const class TObject*)0x0

                       ^^^^^

As you can see here, there is no object "named" Wjets_HFC_4ex so it returns a null pointer (as indicated above). You have to first create the histogram before you can retrieve it with FindObject().

> root [2] .ls
> TFile**         PSE/JO_muon_PSE_RbFree/sumRootFile.root
>  TFile*         PSE/JO_muon_PSE_RbFree/sumRootFile.root
>  KEY: TTree    HangingTree;1   no lemons at that tree
> root [3]   TH1F *Wjets_HFC = (TH1F*) gROOT->FindObject("Wjets_HFC_4ex")
> root [4] Wjets_HFC->GetMean
> GetMean
> GetMeanError
> root [4] Wjets_HFC->GetMean()
> Error: illegal pointer to class object Wjets_HFC 0x0 550  (tmpfile):1:
> *** Interpreter error recovered ***

So if you try the above _after_ you have plotted the histogram as in your first post, the above should give you the expected results.

HTH

-- 
Suvayu

Open source is the future. It sets us free.
Received on Thu Sep 08 2011 - 00:11:00 CEST

This archive was generated by hypermail 2.2.0 : Thu Sep 08 2011 - 11:50:01 CEST