Automatic zoom to an area of interest, advice?

I am writing a simple event display application to display tracks from a drift chamber. At this stage I am using it to develop tracking code, so it is very informal and non-user friendly. Further, the hit information is wholly outside the GEANT3 framework where it was generated. The volume filled by the track is of course much smaller than the world volume and I would like to have a way to zoom in on a particular track (set of hits). I’ve started by constructing the minimum sized box that contains all of the hits. If that box were to fill the the canvas, with the relevant hits displayed, and the associated track, that would do the trick.

I don’t know how to use this virtual-region-of-interest box to influence the field of view. Neither am I sure that this has anything to do with a sensible approach. Help appreciated. :slight_smile:

Use TView::SetRange. See example in $ROOTSYS/tutorials/graphics/tornado.C


Thanks for the reply. I’ll give it a try.

That worked!

I’ve attached the simple example that I wrote. A geometry is created, some polymarkers are placed and the view defined. If the parameters of the view are changed then the “zoom” changes as well, just as desired.

One thing that is confusing me: it is important that the “draw” of the geometry be done before setting the view. In fact, the geometry draw seems to wipe out all objects defined before it is done (i. e., the axes, polymarkers, view). I was wondering why that is the case.
poly.C (1.59 KB)