Re: Drawing selected events from a TTree

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Thu, 30 Oct 2008 09:23:42 -0500


Hi Roger,

You might have a file whose name is exactly 'energy' in the current file system directory.
TTree::Draw thinks you want to use it to express the quantity being drawn. Rename this file and your Draw command should work.

Cheers,
Philippe.

Roger Mason wrote:
> Hello,
>
> Reading through the user guide I found the information on drawing
> selected events from a TTree. This exercise works:
>
> ROOT 5.20/00 (trunk_at_24524, Sep 30 2008, 15:32:00 on linux)
>
> CINT/ROOT C/C++ Interpreter version 5.16.29, Jan 08, 2008
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
> root [0] TFile f("staff.root")
> root [1] TTree *MyTree = T
> root [2] MyTree->Draw("Cost")
> <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
> root [3] MyTree->Draw("Cost","Cost>8000")
>
> Unfortunately, when I try the same syntax on my own data:
>
> ROOT 5.20/00 (trunk_at_24524, Sep 30 2008, 15:32:00 on linux)
>
> CINT/ROOT C/C++ Interpreter version 5.16.29, Jan 08, 2008
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
> root [0] TFile f("Ca2Mn46d.topaz.20080506.160756.root")
> root [1] TTree *MyTree = t
> root [2] MyTree->Draw("energy")
> <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
> root [3] MyTree->Draw("energy","energy>-2143.58")
> Error in <TTreePlayer::DrawSelect>: Drawing using a C++ file currently
> requires that both the expression and the selection are files
> "energy" is not a file
> (Long64_t)0
>
> Can someone explain why this does not work and what I must do to make
> it work?
>
> Thanks,
> Roger
>
>
Received on Thu Oct 30 2008 - 15:24:48 CET

This archive was generated by hypermail 2.2.0 : Thu Oct 30 2008 - 17:50:02 CET