Skip to content

Creating an optical data interface to OpDetDisplay

twongjirad edited this page Oct 28, 2015 · 7 revisions

The OpDetDisplay window can be used to plot information related to the MicroBooNE optical information. The goal is to provide an interface that will allow different types of data formats to display on the various canvases. For a description of the various canvases see the OpDetDisplay wiki page. Here we focus on how one gets information onto those canvases.

For examples of how this is suppose to be done see:

  • pylardata/rawdigitsopdata.py: This is a tree with a list of waveforms
  • larlite_interface/larliteopdata.py: This is an interface to optical information packed in a larlite file

OpDataPlottable abstract base class

Data

All data should inherit from the class OpDataPlottable found in pylardata/opdataplottable. This class is an abstract base class, which means that an implementation must have certain functions and also register itself. For more info on an ABC go here.

The point for this somewhat restrict definition is to ensure that the OpDetDisplay can interface to the dataproducts it needs.

What the user is required to provide:

  • event information:

    • self.event
    • self.run
    • self.subrun
  • beam waveform data:

    • each waveform to be stored in an instance of the OpWfmPlot class (found in pylard.pylardata.opwfmplot)

    • these instances are to be stored in a OpWfmPlotVector object, which is a container for OpWfmPlot. The beam waveforms are to be stored in the container instance self.beamwindows

    • the user can use the method provided by the OpDataPlottable base class to make a beam window OpWfmPlot instance by using

      makeBeamWindow( self, wfm, time, slot, ch, default_color=(255,255,255,255), highlighted_color=(0,255,255,255), timepertick=None )

    • of course, the user can also fill the designated container directly

  • cosmic waveforms:

    • like the beam waveforms, cosmic disc. waveforms are to be stored in an instance of the OpWfmPlot class

    • the OpWfmPlotVector container object is provided by the base class and is called self.cosmicwindows

    • the user can use the method provided by the OpDataPlottable base class to make a cosmic window OpWfmPlot instance by using

      makeCosmicWindow( self, wfm, time, slot, ch, default_color=(255,255,255,255), highlighted_color=(0,255,255,255), timepertick=None )

      or can fill self.cosmicwindows directly.

The user can also provide optional data:

  • a graph to plot on the waveform plot:
    • use the method

      self.makeUserWaveformPlot( self, wfm, time, slot, ch, default_color=(255,255,255,255), highlighted_color=(0,255,255,255), timepertick=None )

      provided by the OpDataPlottable base class, or fill the container self.userwindows directly

Note that the waveform data for the beam windows, cosmic discriminator windows and any user waveform graph now is represented by the same of object. This means that the OpDetDisplay only needs to know how to handle one kind of waveform data object.

Methods

The OpDetDisplay will call opdata.gotoEvent( event, run, subrun ) when it wants a specific event. When the user wants the next event, OpDetDisplay will call opdata.getNextEntryID() and expect that opdata.run, opdata.subrun, opdata.event will be filled.

Note that OpDetDisplay will call getNextEntryID() to load the first event.

Example

RawDigitsOpData (in pylard.pylardata) is an example of an implementation of this interface data product.

Clone this wiki locally