Re: Strange crash making draw in a macro

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Fri, 30 Mar 2012 16:37:03 -0500

 >Error in <TSelectorDraw::Begin>: An object of type 'TH1D' has the same name as the requested event list (hVar671)  >(class TH1D*)0x947be20

This would happen if the value of 'yyvar' is an empty string. This would mean that:

     tup->Draw(">>hVar671",cut);
is being executed ... this explicitly request the create an event list with the name hVar671 which interfers somehow with the histogram of the same name.

Cheers,
Philippe.

On 3/30/12 4:05 PM, Arthur E. Snyder wrote:
> ROOT 5.26/00a (tags/v5-26-00a_at_32053, Jan 19 2010, 12:43:52 on linux)
>
> CINT/ROOT C/C++ Interpreter version 5.17.00, Dec 21, 2008
>
>
> In executing the following simple minded macro:
>
> TH1D* hDo=0;
> TString hDoName="";
> TH1D* doDraw(TTree* tup) {
> sAndB(0);
> hDoName="hVar";
> hDoName+=getTagI();
>
>
> cout << "hDoName:" << hDoName << endl;
> hDo=new TH1D(hDoName,yyvar,nyy,yylo,yyup);
> cout << "hDo:" << hDo << endl;
>
> if(tup->GetTitle()=="front") hDo->SetLineColor(2);
> if(tup->GetTitle()=="back") hDo->SetLineColor(4);
>
> cout << "drawing ..." << endl;
>
> tup->Draw(yyvar+">>"+hDoName,cut);
> return hDo;
>
> }
>
>
> I get the following strange error:
>
> hDoName:hVar671
> hDo:0x947be20
> drawing ...
>
>
> Error in <TSelectorDraw::Begin>: An object of type 'TH1D' has the same name as the requested event list (hVar671)
> (class TH1D*)0x947be20
>
> What does that mean?
>
> -Arthur S.
>
> If I try to execute the Draw command by hand using the same TH1D name I get the same error. If w/o ">>" to specifiy histogram to
> use, it works.
>
> If I clone a copy of the histogram |hDo|, change it's name, and use that, so
>
> root [18] hDo2->GetName()
> (const char* 0x956dbd0)"hVar673_2"
> root [19] tFront->Draw(xxvar+">>hVar673_2",cut)
> (Long64_t)20934
>
> that works too!
>
> ?????
>
>
>
> A.E. Snyder, The Former Group C (TFC) \!c*p?/
> SLAC Mail Stop #95 ((. .))
> Box 4349 |
> Stanford, Ca, USA, 94309 '\|/`
> e-mail:snyder_at_slac.stanford.edu o
> phone:650-926-2701 _
> http://www.slac.stanford.edu/~snyder BaBar
> FAX:707-313-0250 Collaboration
> &
> Fermi/GLAST
>
>
>
Received on Fri Mar 30 2012 - 23:37:11 CEST

This archive was generated by hypermail 2.2.0 : Fri Mar 30 2012 - 23:50:01 CEST