Drawing selected events from a TTree

From: Roger Mason <rmason_at_esd.mun.ca>
Date: Thu, 30 Oct 2008 11:44:49 -0230


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:16:39 CET

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