RE: Alt$(primary, alternate) for TTree::Draw() not defined in current scope?

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 8 Jul 2008 17:37:01 -0500


Hi,

You meant to type:

        inputTree->Draw("Alt$(b_u20->En, 0)");

I.e. Alt$ must be in the string that is passed to TTree::Draw.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of Matt Dunkman
Sent: Tuesday, July 08, 2008 5:33 PM
To: roottalk_at_cern.ch
Subject: [ROOT] Alt$(primary, alternate) for TTree::Draw() not defined in current scope?

Dear ROOTers,

I have been having an issue using the alternate function of TTree::Draw, specifically it complains:

Error: Function Alt$("b_u30->En",0) is not defined in current scope (tmpfile):1:

Here is a sample macro...

{

	TFile inputFile("June27_20km.root");
	TTree *inputTree = (TTree*)inputFile->Get("events");


//this draw works:
inputTree->Draw("b_u20->En");
//but when I try to use Alt$ as defined in TTree::Draw() it fails.
inputTree->Draw(Alt$("b_u20->En", 0));

}

Where b_u20 is a branch, and En a leaf on that branch.

Is there a simple #include statement needed (I am attempting to use it in a compiled program)? I am currently including the following



TApplication
TH1F
TH2F
TF1
TFile
TTree
TCanvas
TPad
TPaveStats

Thanks,
Matt Received on Wed Jul 09 2008 - 00:37:40 CEST

This archive was generated by hypermail 2.2.0 : Wed Jul 09 2008 - 11:50:02 CEST