[ROOT] Multiple cuts on a ntuple

From: Kevin Reil (reil@physics.utah.edu)
Date: Thu Mar 14 2002 - 01:31:18 MET


Hi,

I have an ntuple "x1:x2:x3:x4:x5:...:xn" and a list of cuts I wish to
perform. I do not know in advance what n is but it is always larger than 
some minimum. If I create a very long string with all the cuts it does not
work. Is there a quick and easy way to do something like

TNtuple *nt;
TNtuple *ntcut1;
TNtuple *ntcut2;
...
Open the file with nt
....
ntcut1=nt->Clone("ntcut1","x1>5");
ntcut2=ntcut1->Clone("ntcut2","x2<3");

or

nt->Draw(">>ntcut1","x1>5");
ntcut1->Draw(">>ntcut2","x2<3");

Or best yet
ntcut1=nt->PerformCut("x1>5");
ntcut2=ntcut1->PerformCut("x1>5");

What I wish to avoid is having to code what is in the ntuple nt, create
ntcut1 based on knowledge of nt.
I am aware that I could SetAddress, GetEvent, decide, ntcut1->fill,
etc. Of course, I need to form ntcut1-> to be fillable, create a structure
to hold the proper x1:xn etc. I would prefer above methods.


|---------------------------------|------------------------------------|
| Campus Address                  | Office Location                    |
| 115 S, 1400 E, Room 201         | 262 INSCC                          |
| Salt Lake City, UT 84112-0830   | Just North of Park Building        |
|---------------------------------|------------------------------------|
| www.physics.utah.edu/~reil      | Office (801) 581-4306              |
| reil@physics.utah.edu           | Home   (801) 969-6399              |
| kevin@reil.net                  | Fax    (801) 581-6256 (via Frank)  |
|----------------------------------------------------------------------|
|                    And my father dwelt in a tent.                    |
|----------------------------------------------------------------------|



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:45 MET