WireCell / wire-cell-gen

Wire Cell packages that can generate things like wires, cells, depositions, diffusions, slices, frames, ...
0 stars 1 forks source link

Configurable method to determine frame time range in discontinuous mode. #19

Closed brettviren closed 6 years ago

brettviren commented 6 years ago

The sim runs in two modes as described here:

https://wirecell.github.io/news/posts/simulation-updates/

Continuous mode is effectively free running and frames are just to break up that infinite stream of data.

In discontinuous mode the time of the energy depositions determines the frame time. This currently causes waveforms to typically begin near the start of the frame. For a triggered detector the time range of a frame would be defined w.r.t. some trigger, typically causing the frame to be centered on the associated activity in the waveforms.

Some new mechanism is needed to align frames in some way to emulate trigger conditions. For beam triggers this can be done by having a simple configurable time offset applied to the earliest energy deposition.

For self triggering such as in DUNE, discontinuous mode is really not correct and continuous mode is required.

The two modes are currently implemented in Ductor and MultiDuctor so both must gain this configurable time offset.

brettviren commented 6 years ago

LArG4 makes depositions with times near 0.0. Besides an offset we need an IDrifter which applies some time offset.

brettviren commented 6 years ago

Meeting with MB provides guidance that the absolute time of simulation waveforms are not meaningful and need not be simulated. This reduces the difficulty for this bug. Only a fixed relative time offset is needed. Because of this simplicity I'll just add it as configurable optional part of the nominal Drifter and not make a new IDrifter.

brettviren commented 6 years ago

Fixed.

Plots for "after" and "before" adding 1.6ms offset for MB.

wct-sim-ideal-sig wct-sim-ideal-sig-pre-toffset

Reproduce and plot with:

$ rm -f wct-sim-ideal-sig.npz
$ wire-cell -c cfg/pgrapher/experiment/uboone/wct-sim-ideal-sig.jsonnet
$ wirecell-gen plot-sim wct-sim-ideal-sig.npz -n 0 -c 6,17 foo.pdf
brettviren commented 6 years ago

Time offset needs to be absolute, not based on initial depo because beam+cosmics puts the first cosmic at negative time.

brettviren commented 6 years ago

Edit: see next comment.

Turns out previous requirements were bogus. LArSoft depo generators are responsible for setting their absolute time given any assumptions about triggering. It's still true that their times are all near 0.0.

A new requirement is that the resulting frame must start at an fixed time (for all events). ~For MB this is -4050 us measured in the same clock as the depo times are~ (edit: this number is for "electronics" time which I think WCT does not need to care about, see next comment). This is described in MB DocDB 12290.

brettviren commented 6 years ago

The above comment reflected my misunderstanding. Confirmed by Herb, here is what MB LS expectations

So, new game plan:

brettviren commented 6 years ago

This is basically done now except doc/val. The new component is named Reframer.

Note, #25 is related.

brettviren commented 6 years ago

An additional timing related fix was found and made as part of this. The ductor's gate must be enlarged by a time estimated by the nominal travel time between response plane and collection plane so that early activity can influence at least the first tick. For MB this is an extra 171 ticks. These ticks are then truncated by the new Reframer component.