next up previous contents
Next: Communication between Hard and Up: Using Cuts Previous: One-Dimensional Cuts

Two-dimensional Cuts

Analogous to one-dimensional cuts, two-dimensional cut mean the condition of a pair of values being in a certain range, where the range is defined by a closed polygon in the x/y space. The condition is then e.g. ''is the current point (x,y) inside the area defined by the polygon I just drew into the picture representing the whole (x/y) space ?''. This is no longer done easily by hand, as in the case of one-dimensional cuts.

Creating a two-dimensional cut is done with the call cutid = cut2d(NAME, initial);, with the parameters just as for one-dimensional cuts. Again, the handle (cutid returned is used to refer to the cut later.

Inside proc analyze(), the cuts are used with e.g.:

if (inside2d(cutid, x,y))
   printf("%f %f is inside the cut!\n", x, y);
else
   printf("%f %f is outside the cut!\n", x, y);

Normally, you would use histogramming functions instead of printing the values. This is done simply for illustration.

As their one-dimensional counterparts, cuts are read from file either via the cut pull-down menu or with the readcuts(FILENAME) call, which works for one- and two-dimensional cuts as well. In fact, cut parameters can be mixed in the same file (as it is done by PAW).

To define a two-dimensional cut graphically, you must first convince PAW that you've just plotted a two-dimensional representation of some ntuple variables (else it will still stick to the opinion that you are viewing a one-dimensional histogram, and will not permit to enter more than two points ...).

To do this trick, use the following sequence of paw kumac commands:

nt/create 9999 'JUNK' 2 ! 1000 x y
nt/pl 9999.x%y
h/del 9999
h/del 1000000
next

To make this more convenient, you should save this sequence in a kumac-file for easy retrieval. Call it cut2d.kumac or something like this, so that you can use it anytime you want to define 2-dimensional cuts with PAW.

If you want to switch between one- and two-dimensional cut definition in PAW, you should write another kumac file to convince PAW of the idea of the necessity to allow one-dimensional cuts only:

nt/create 9999 'JUNK' 2 ! 1000 x y
nt/pl 9999.x
h/del 9999
h/del 1000000
next

Save this in another kumac-file, e.g. cut1d.kumac, so switching between one- and two-dimensional definitions is easy.


next up previous contents
Next: Communication between Hard and Up: Using Cuts Previous: One-Dimensional Cuts
Heiko Rohdjess
2001-07-19