legend-exp / dspeed

Fast Digital Signal Processing for particle detector signals in Python
https://dspeed.readthedocs.io
GNU General Public License v3.0
2 stars 13 forks source link

Tutorial confusion regarding trapTmax #48

Open Jita22 opened 7 months ago

Jita22 commented 7 months ago

Was digging around for the definition of trapTmax. The tutorial seems to have a nice illustration with the processor

        "trapTmax": {
            "function": "argmax",
            "module": "numpy",
            "args": ["wf_trap", 1, "trapTmax"],
            "kwargs": {"signature": "(n),()->()", "types": ["fi->i"]},
            "unit": "ns",
        }

that indicates that it should a time (note that it has units of ns). The attached image in the documentation also seems to show a vertical blue line that presumably corresponding to a time.

HOWEVER, digging through the config files in legend-dataflow-config (which now have short descriptions of the parameters), it is clear that trapTmax is the max of a fixed length long trap filter and should correspond to an uncalibrated energy. Here is the relevant section from a config file

    "trapTmax": {
      "description": "max of fixed length long trap filter",
      "function": "amax",
      "module": "numpy",
      "args": [
        "wf_trap[round(2*db.ttrap.rise+db.ttrap.flat, wf_pz.period):-round((2*db.ttrap.rise+db.ttrap.flat), wf_pz.period)]",
        1,
        "trapTmax"
      ],
      "kwargs": { "signature": "(n),()->()", "types": ["fi->f"] },
      "defaults": { "db.ttrap.rise": "10*us", "db.ttrap.flat": "3.008*us" },
      "unit": "ADC"
    }

Could we make the tutorial definition consistent with the processor being used for production?

Screen Shot 2024-01-23 at 3 34 12 PM