Hi Bill, When you use the syntax tree.Draw("y:x>hist",...) TTree::Draw searches in the current directory for an object named "hist" In your case, the cd doest not contain this object because you opened a new file between the creation of the TProfile and the tree.Draw command. Move the creation of TProfile after opening the TFile. Rene Brun On Fri, 8 Dec 2000, William Love wrote: > > ----- Original Message ----- > From: "Mail Delivery Subsystem" <MAILER-DAEMON@newmint.cern.ch> > To: <love@bnl.gov> > Sent: Friday, December 08, 2000 4:00 PM > Subject: Returned mail: User unknown > > > > The original message was received at Fri, 8 Dec 2000 22:00:04 +0100 (MET) > > from mail.bnl.gov [130.199.128.205] > > > > ----- The following addresses had permanent fatal errors ----- > > <roottalk@hpsalo.cern.ch> > > > > ----- Transcript of session follows ----- > > ... while talking to hpsalo.cern.ch.: > > >>> RCPT To:<roottalk@hpsalo.cern.ch> > > <<< 550 5.1.1 <roottalk@hpsalo.cern.ch>... User unknown > > 550 <roottalk@hpsalo.cern.ch>... User unknown > > > > ----- Original message follows ----- > > > > Return-Path: <love@bnl.gov> > > Received: from mail.bnl.gov (mail.bnl.gov [130.199.128.205]) > > by newmint.cern.ch (8.9.3/8.9.3) with ESMTP id WAA32349 > > for <roottalk@hpsalo.cern.ch>; Fri, 8 Dec 2000 22:00:04 +0100 (MET) > > Received: from garbo (garbo.star.bnl.gov [130.199.88.81]) > > by mail.bnl.gov (8.9.1/8.9.1) with SMTP id PAA11501 > > for <roottalk@hpsalo.cern.ch>; Fri, 8 Dec 2000 15:59:28 -0500 (EST) > > Message-ID: <000901c06159$3f637480$5158c782@star.bnl.gov> > > From: "William Love" <love@bnl.gov> > > To: "roottalk" <roottalk@hpsalo.cern.ch> > > Subject: Trying to fill a TProfile from a TTree > > Date: Fri, 8 Dec 2000 15:55:49 -0500 > > MIME-Version: 1.0 > > Content-Type: text/plain; > > charset="iso-8859-1" > > Content-Transfer-Encoding: 7bit > > X-Priority: 3 > > X-MSMail-Priority: Normal > > X-Mailer: Microsoft Outlook Express 5.50.4133.2400 > > X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 > > > > Rooting squad > > I don't seem to make contact in a macro between a defined TProfile and > > the TProfile output of a TTree->Draw. It works from the CINT command > > line but not from the following Macro. What am I doing wrong? > > Bill Love > > > > void Profile98ExB(const Char_t * filename="R1243037Ev98ExB.root") { > > char selection[200]; > > c1 = new TCanvas("c1","Profile",200,10,700,500); > > TProfile *h1 = new TProfile("h1","dx vs row ExB > > Corrected",45,0.5,45.5,-2.5,2.5,""); > > // open the root input file. > > TString file("/star/rcf/scratch/love/roots/"); > > file += filename; > > cout << "Read file "<< file << endl; > > TFile f(file->Data()); > > TTree *laser = (TTree*)f.Get("laser"); //Req'd by standard C++ > > // Int_t entr = laser->GetEntries(); > > // laser->SetEstimate(entr); > > sprintf(selection,"fHits.ftknfit>25"); > > > > > laser->Draw("fHits.fdx*sign(ftkinvp):fHits.frow%100>>h1",selection,"prof"); > > > > } > > > > > > > > >
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:38 MET