RE: Error: illegal pointer to class object Spher3D_sig 0x0 396 plot1.C:7: *** Interpreter error recovered ***

From: Meera Lebbai, Mohamed R. <razzak_at_ou.edu>
Date: Fri, 26 Oct 2007 10:16:31 -0500


Hi Rene,

Thank you for the help.

Razzak



From: Rene Brun [Rene.Brun_at_cern.ch]
Sent: Friday, October 26, 2007 9:39 AM
To: Meera Lebbai, Mohamed R.
Cc: ROOT Talk
Subject: Re: [ROOT] Error: illegal pointer to class object Spher3D_sig 0x0 396 plot1.C:7: *** Interpreter error recovered ***

Instead of:

 TH1F *Spher3D_sig = setA->Get("h_Sphericity3D"); Spher3D_sig->Draw();

do:

 TH1F *Spher3D_sig = (TH1F*)setA->Get("h_Sphericity3D"); if(Spher3D_sig) Spher3D_sig->Draw();

Rene Brun

Meera Lebbai, Mohamed R. wrote:
> Hi all,
>
> I am getting illegal pointer error when I try Draw() a histogram ( but I never used to get this before).
>
> I have just included a simple file
>
>
> // test.C
>
>
> { gStyle->SetOptFit(111111);
>
> // signal
> TFile* setA = TFile::Open("hist_stop_sig.root");
>
> TH1F *Spher3D_sig = setA->Get("h_Sphericity3D");
> Spher3D_sig->Draw();
> }
>
> Any help will be appreciated.
>
> Razzak
>
>
Received on Fri Oct 26 2007 - 17:18:13 CEST

This archive was generated by hypermail 2.2.0 : Mon Oct 29 2007 - 11:50:01 CET