Simply combine them: root [12] TTree * hitdata = ...; root [13] TH1D mresidHist1 = TH1D( "mresidHist1", "bla", 100, -.05, 0.05); root [14] hitdata->Draw("_1.mresid>>mresidHist1","_1.senstype == 3"); Cheers, Philippe. -----Original Message----- From: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Isard_Dunietz Sent: Wednesday, June 27, 2001 10:42 AM To: roottalk@pcroot.cern.ch Subject: [ROOT] on plotting a variable of an TTree with a constraint in a specified range I have a TTree * with several variables inside it. Instead of using the MakeClass machinery I wonder whether there is a simple and straightforward way to plot out a variable subject to a constraint, this can be done as in: root [1] TTree * hitdata = ...; root [2] hitdata->Draw("_1.mresid","_1.senstype == 3"); However I would want to have the histogram have the limit xmin < x < xmax and so I used: root [10] TH1D mresidHist1 = TH1D( "mresidHist1", "bla", 100, -.05, 0.05); root [11] hitdata->Draw("_1.resid >> mresidHist1"); However, I wish to draw _1.resid under the constraint "_1.senstype == 3" and within the limit -.05< x < + 0.05, and I do not know how to combine both (a) the constraint, and (b) the histogram limit: in a simple fashion. I am using at present root v2_26_00g. Thank you, Isi
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:50 MET