Project

General

Profile

Bug #16169

Event display zoom not working

Added by Bruce Baller over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
High
Category:
Event Display
Target version:
-
Start date:
04/12/2017
Due date:
% Done:

100%

Estimated time:
16.00 h
Spent time:
Occurs In:
Experiment:
-
Co-Assignees:
Duration:

Description

The zoom feature in the wire - time display pads doesn't work in larsoft version v06_30_00 and v06_31_00 but it does work in v06_29_00.

Associated revisions

Revision a292e74b (diff)
Added by Gianluca Petrillo over 3 years ago

Re-enable zooming abilities for the event display.

This should work around issue #16169.
This is also related to JIRA ticket ROOT-8762.

History

#1 Updated by Tingjun Yang over 3 years ago

I confirm this problem also occurs in the Ortho3D view.

#2 Updated by Gianluca Petrillo over 3 years ago

  • Status changed from New to Accepted
  • Occurs In v0_01_01 added

I can reproduce the problem.
Clicking on the time/wire view and dragging a rectangle produce no effect.
Dragging a range on the time axis of the time/wire view also produce no effect. Probably the same is true for the wire axis, but it's harder there to be sure to be picking the right spot.

#3 Updated by Gianluca Petrillo over 3 years ago

  • Occurs In v06_31_00 added
  • Occurs In deleted (v0_01_01)

#4 Updated by Gianluca Petrillo over 3 years ago

  • Status changed from Accepted to Assigned
  • Assignee set to Gianluca Petrillo

No time estimate.
The first suspect is ROOT (6.06/08 to 6.08/06), but I could not find anything relevant in the release notes.

#5 Updated by Gianluca Petrillo over 3 years ago

  • Status changed from Assigned to Work in progress

#6 Updated by Gianluca Petrillo over 3 years ago

  • % Done changed from 0 to 50
  • Estimated time set to 16.00 h
  • Occurs In v06_32_00 added

The analysis of the issue follows. For the resolution, I need to study the example in ROOT (thanks to Philippe for pointing me to it), and possibly ask for suggestions.

Design and expected behaviour

The zooming action is managed by the event display code in LArSoft (evd::TWQProjectionView, evd::TWQMultiTPCProjection) at a fairly low level. The objects are taught to react to mouse events like "mouse over", "pressed mouse button", "mouse moved" etc.

In order to react to the zooming events, callbacks are registered by those evd objects into the ROOT pad (TPad) hosting the wire/time plot, as TExec objects.

When a mouse event occurs, ROOT records an "event" including information of the position on screen where it happened (x and y), and the type of event. ROOT then dispatches it to the canvas involving that event. In our case this is a TCanvas-derived object which contains some "primitives": 3 basic pads (TPad), plus additional 2 for each plane. For reference, they are:

  1. histogram of waveform on the single wire ("fWireQPad")
  2. text area with event information, rendered left of the previous ("fHeader")
  3. text area with Monte Carlo truth information, rendered just above the waveform ("fMCPad")
  4. for each wire plane #:
    1. a map of charge vs. wire and time, rendered on the left ("fWireProjP#")
    2. a color scale, rendered on the right of the previous ("fQPadPlane#")

The plane pads are rendered above the Monte Carlo (and waveform) pad, the bottom one being plane 0.
The canvas decides (TCanvas::HandleInput()) which of its primitives dispatch the event to.
In order to do so, it picks (TCanvas::Pick()) the primitive at the position (x,y) of the event.
Pick() parses all contained primitives (recursively; in our case, there are one per point in the plot, O(100k)).
It ends up pickingreturning the TPad owning a primitive that contains the event position. Then that pad is activated (via gPad) and TCanvas::RunAutoExec() forces the active pad to run all its registered TExec. Our pads "fWireProjP#" have the evd::TWQProjectionView::MouseDispatch() method registered as TExec, which will take over and manage the event.

The issue

With ROOT commit c41182a90c572751ce1a7950d0a04ee2031b84c6 TPad::Pick() will not pick a pad which is marked "not pickable" any more. Therefore the canvas will fail to pick any pad. The event will be handled by the canvas itself, which has no TExec registered to manage the zoom-like events.
That commit was included in ROT 6.08/00, matching the evidence of this issue appearing with LArSoft 6.30.00.


Edit: Removed irrelevant details.

#7 Updated by Philippe Canal over 3 years ago

As far as I can tell, kCannotPick is not the default. Do you know how one of the pad/canvas was set to kCannotPick?

#8 Updated by Gianluca Petrillo over 3 years ago

  • Status changed from Work in progress to Resolved
  • % Done changed from 50 to 100

Yes, the bit is explicitly set.
I have opened JIRA ticket ROOT-8762 to have a comment from ROOT whether this is going to be considered a bug to be fixed or it is accepted as new behaviour.
In the meanwhile, I have pushed the workaround, that, as Philippe hints, is just to disable the kCannotPick bits for the pads which have TExec associated with it. This includes:

  • wire/time pads in the 2D view, for both single and multi-TPC
  • the orthogonal projections of Ortho3D view

I have tested the former, and I have tentative evidence that also Ortho3D view should work.
The workaround has been pushed into develop branch of lareventdisplay as lareventdisplay:a292e74b3a238539a593989bb6476a68a86173b8 .

I have added Brian Rebel to the watcher list: he might know the design reason behind the choice of marking those pads as kCannotPick (which sounds right to me).

#9 Updated by Gianluca Petrillo over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF