Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TRestDetectorSignalToRawSignalProcess to support calibration points and shaping #19

Merged
merged 9 commits into from
Sep 5, 2022

Conversation

lobis
Copy link
Member

@lobis lobis commented Aug 31, 2022

lobis Medium: 195

This PR updates TRestDetectorSignalToRawSignalProcess with the following:

  • A new trigger mode "fixed" has been implemented, where the user can manually set the exact time of the first bien (instead of using the time of the first deposit).
    For example, a configuration such as
<parameter name="sampling" value="1us"/>
<parameter name="nPoints" value="512"/>
<parameter name="triggerMode" value="fixed"/>
<parameter name="triggerFixedStartTime" value="55.0us"/>
<parameter name="triggerDelay" value="100"/>

would have a starting time of 55.0 us - 1.0 * 100 us as it is affected by the triggerDelay parameter.

  • A new parameter offset (fCalibrationOffset) has been introduced to allow for more calibration options besides the gain. This allows to set our zero elsewhere than on the middle of the range.
  • A new way of calibration has been introduced which can be used as an alternative to the gain/offset. Instead of fixing the gain and offset (optional), we can specify two points to establish a linear relation between energy and ADC. For example:
<parameter name="calibrationEnergy" value="(0,10)MeV"/>
<parameter name="calibrationRange" value="(0.1,0.9)"/>

would generate a gain and offset such that 0 energy corresponds to 0.1 or 10% of our range (-32768 + 0.1 * 65535 in ADC units) and 10 Mev to 90% of our range. I believe this way is more intuitive and allows an easier reproduction of experimental calibration.

  • Shaping has been implemented in TRestDetectorSignalToRawSignalProcess. Even though shaping is implemented already in rawlib (TRestRawSignalShapingProcess) it presents a few problems, mainly information loss when dealing with signals above the saturation limit.

The image below corresponds to the output of TRestDetectorSignalToRawSignalProcess after these changes. Note how some of the peaks are cut off due to saturation (as would happen on a physical experiment).

image

If we were to convert the detector signal into raw signal without the shaping, we would get something such as the image below.

image

If we were to perform shaping to this event, it would be impossible to get the first result, which is more physical, since the information of how much each signal is above the saturation limit is lost. We would get peaks with the maximum exactly equal to the saturation limit, which does not correspond to the physical event since signals with different energy would be exactly equal (such as the first peaks of green and yellow in the images).

@lobis lobis added enhancement New feature or request development labels Sep 1, 2022
@lobis lobis marked this pull request as ready for review September 1, 2022 07:35
@lobis lobis requested a review from nkx111 September 1, 2022 08:19
@DavidDiezIb
Copy link
Member

Great update @lobis, I only have one request: could you write these new options in the documentation? Few lines with the new keywords and an example would be great. Otherwise this will be hidden in the code for most of us and will be lost in time, like tears in rain ;)

lobis added a commit that referenced this pull request Sep 1, 2022
@lobis lobis merged commit 319cc97 into master Sep 5, 2022
@lobis lobis deleted the lobis-detector-to-raw-calibration branch September 5, 2022 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants