WireCell / wire-cell-toolkit

Toolkit for Liquid Argon TPC Simulation and Reconstruction
https://wirecell.github.io/
Other
7 stars 22 forks source link

filter module to correct electronics response #291

Closed wenqiang-gu closed 7 months ago

wenqiang-gu commented 7 months ago

For validation purpose, I copied the "perchan" code from the OmnibusSigproc and re-implemented it as a "noise filter" module. With the following package on dunegpvm, one can check the corrected pulser waveforms in DUNE VD CRP5 coldgox data:

$ source /cvmfs/[dune.opensciencegrid.org/products/dune/setup_dune.sh](http://dune.opensciencegrid.org/products/dune/setup_dune.sh);
$ setup dunesw v09_88_00d00 -q e26:prof
$ source /exp/dune/data/users/wenqiang/opt/localProducts_larsoft_v09_88_00_e26_prof/setup
$ mrbslp

$ export LD_LIBRARY_PATH=/exp/dune/data/users/wenqiang/opt/wire-cell-toolkit/install/lib64:$LD_LIBRARY_PATH

$ cd /exp/dune/data/users/wenqiang/demo/crp5_run021040
$ lar -n1 -c crp4_data_nf.fcl np02_bde_coldbox_run021040_0000_dataflow0_datawriter_0_20230428T205142_decode.root

$ root -l -b -q 'convert_artroot.C("np02_bde_coldbox_run021040_0000_dataflow0_datawriter_0_20230428T205142_decode_crpcb_bottom_reco.root")'

One can check the waveforms (_hdaq is before correction, _hraw is after correction) in the output file: magnify-21040-1-nf.root

wenqiang-gu commented 7 months ago

Here are some essential updates for using this "ResponseShaper" in the noise filter stage:

* common/tools.jsonnet
type: "ParamsPerChannelResponse"
* nf.jsonnet
function(params, anode, tools, chndbobj, n, name='')

   local pc = tools.perchanresp_nameuses,
    local shaper = {
      type: 'perChannelShaper',
      name: name,
      data: {
      noisedb: wc.tn(chndbobj),
      anode: wc.tn(anode),
      elecresponse: wc.tn(tools.elec_resp),
     },
    },

uses=[chndbobj, anode, single, shaper, grouped, tools.elec_resp] + pc.uses

* params.jsonnet
     elec: super.elec {
      type: "ColdElecResponse",
       postgain: 1.0,
      gain : 14.0*wc.mV/wc.fC,
      shaping : 4.0*wc.us,  // extreme value for sanity check
     },

With a shaping time value of 4us, I can see that the "ResponseShaper" is working:

image