REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Public Member Functions | Private Member Functions | Private Attributes
TRestRawSignalRecoverSaturationProcess Class Reference

Detailed Description

This class recovers the saturated signals in a TRestRawSignalEvent using a fit to the AGET pulse.

This class processes signals that have saturated the ADC, recovering lost information using a fit. If the fit is successful, the saturated points are replaced by the corresponding fit values. The process reconstructs the lost signal data due to ADC saturation, allowing further event analysis as if no saturation had occurred. For example, the following image compares the original to the recovered event and the ThresholdIntegral spectrum in TRestRawSignalAnalysisProcess before (red) and after (blue) applying TRestRawSignalRecoverSaturationProcess:

Recovered Event
Spectrum Comparison

Fitting Function

The fitting function is fixed (hardcoded) to the AGET response function (without the sine term) multiplied by a logistic function:

[0] + [1] * TMath::Exp(-3. * (x-[3])/[2]) *
(x-[3])/[2] * (x-[3])/[2] * (x-[3])/[2] /
(1 + TMath::Exp(-10000 * (x-[3])))
[0] = "Baseline"
[1] = "Amplitude * e^{3}"
[2] = "HalfWidth"
[3] = "PulseStart"
Signal Fit

Parameters

Basic parameters of the process meant to configure the identification of saturated signals to process:

Advanced parameters to configure the fitting process:

Observables

The process adds the following observables to the event:

Added Amplitude and Integral

Examples

Example of usage with a minimal RML configuration:

<addProcess type="TRestRawSignalRecoverSaturationProcess" name="recSat" value="ON" observable="all">
<parameter name="minSaturationValue" value="3500" />
<parameter name="baseLineRange" value="(20,150)" />
<parameter name="fitRange" value="(150,300)" />
</addProcess>

Example of a more complex RML configuration:

<addProcess type="TRestRawSignalRecoverSaturationProcess" name="recSat" value="ON" obervable="all">
<parameter name="minSaturatedBins" value="3" />
<parameter name="processAllSignals" value="true" />
<parameter name="nBinsIfNotSaturated" value="16" />
<parameter name="fitRange" value="(150,300)" />
<parameter name="baseLineRange" value="(20,150)" />
<parameter name="initPointsOverThreshold" value="(3.5, 2.5, 7)" />
</addProcess>

Example of a testing RML configuration:

<addProcess type="TRestRawSignalRecoverSaturationProcess" name="recSat" value="ON"
verboseLevel="extreme" observable="all">
<parameter name="minSaturatedBins" value="3" />
<parameter name="processAllSignals" value="true" />
<parameter name="nBinsIfNotSaturated" value="16" />
<parameter name="fitRange" value="(150,300)" />
<parameter name="baseLineRange" value="(20,150)" />
<parameter name="initPointsOverThreshold" value="(3.5, 2.5, 7)" />
</addProcess>

REST-for-Physics - Software for Rare Event Searches Toolkit

History of developments:

2025-Jan: First implementation of TRestRawSignalRecoverSaturationProcess by Álvaro Ezquerro

Author
Álvaro Ezquerro

Definition at line 30 of file TRestRawSignalRecoverSaturationProcess.h.

#include <TRestRawSignalRecoverSaturationProcess.h>

Inheritance diagram for TRestRawSignalRecoverSaturationProcess:
TRestEventProcess TRestMetadata

Public Member Functions

 ClassDefOverride (TRestRawSignalRecoverSaturationProcess, 1)
 
void EndProcess () override
 Function to include required actions after all events have been processed. More...
 
RESTValue GetInputEvent () const override
 Get pointer to input event. Must be implemented in the derived class. More...
 
RESTValue GetOutputEvent () const override
 Get pointer to output event. Must be implemented in the derived class. More...
 
const char * GetProcessName () const override
 
void InitProcess () override
 Process initialization. Observable names can be re-interpreted here. Any action in the process required before starting event process might be added here. More...
 
void PrintMetadata () override
 It prints out the process parameters stored in the metadata structure. More...
 
TRestEventProcessEvent (TRestEvent *eventInput) override
 The main processing event function. More...
 
 TRestRawSignalRecoverSaturationProcess ()
 Default constructor. More...
 
 ~TRestRawSignalRecoverSaturationProcess ()
 Default destructor. More...
 
- Public Member Functions inherited from TRestEventProcess
virtual Bool_t AddInputFile (const std::string &file)
 
bool ApplyCut ()
 
virtual void BeginOfEventProcess (TRestEvent *inputEvent=nullptr)
 Begin of event process, preparation work. Called right before ProcessEvent() More...
 
 ClassDefOverride (TRestEventProcess, 3)
 
virtual void EndOfEventProcess (TRestEvent *inputEvent=nullptr)
 End of event process. Nothing to do. Called directly after ProcessEvent() More...
 
virtual void EndProcess ()
 To be executed at the end of the run (outside event loop) More...
 
TRestAnalysisTreeGetAnalysisTree () const
 Return the local analysis tree (dummy) More...
 
TCanvas * GetCanvas () const
 Get canvas. More...
 
TRestAnalysisTreeGetFullAnalysisTree ()
 
virtual RESTValue GetInputEvent () const =0
 Get pointer to input event. Must be implemented in the derived class. More...
 
std::vector< std::string > GetListOfAddedObservables ()
 
virtual RESTValue GetOutputEvent () const =0
 Get pointer to output event. Must be implemented in the derived class. More...
 
virtual const char * GetProcessName () const =0
 
TRestRunGetRunInfo () const
 Return the pointer of the hosting TRestRun object. More...
 
virtual Long64_t GetTotalBytes () const
 
virtual Long64_t GetTotalBytesRead () const
 Interface to external file reading, get the read bytes. To be implemented in external processes. More...
 
virtual void InitFromConfigFile () override
 To make settings from rml file. This method must be implemented in the derived class. More...
 
virtual void InitProcess ()
 To be executed at the beginning of the run (outside event loop) More...
 
Bool_t isExternal () const
 Return whether this process is external process. More...
 
Int_t LoadSectionMetadata () override
 This method does some preparation of xml section. More...
 
virtual void NotifyAnalysisTreeReset ()
 In case the analysis tree is reset(switched to new file), some process needs to have action. More...
 
virtual Bool_t OpenInputFiles (const std::vector< std::string > &files)
 
virtual TRestEventProcessEvent (TRestEvent *inputEvent)=0
 Process one event. More...
 
std::vector< std::string > ReadObservables ()
 
void RegisterAllObservables (Bool_t value=true)
 
virtual Bool_t ResetEntry ()
 
void SetAnalysisTree (TRestAnalysisTree *tree)
 Set analysis tree of this process, then add observables to it.
 
void SetCanvasSize (Int_t x, Int_t y)
 Set canvas size. More...
 
void SetFriendProcess (TRestEventProcess *p)
 Add friendly process to this process.
 
void SetObservableValidation (bool validate)
 
void SetParallelProcess (TRestEventProcess *p)
 Add parallel process to this process.
 
void SetRunInfo (TRestRun *r)
 Set TRestRun for this process. More...
 
Bool_t singleThreadOnly () const
 Return whether this process is single std::thread only. More...
 
 TRestEventProcess ()
 
 ~TRestEventProcess ()
 

Private Member Functions

void Initialize () override
 Function to initialize input/output event members and define the section name. More...
 

Private Attributes

TRestRawSignalEventfAnaEvent
 A pointer to the specific TRestRawSignalEvent input event. More...
 
TVector2 fBaseLineRange
 Range of bins to calculate the baseline and fix that parameter in the fit. More...
 
TCanvas * fC
 Canvas to draw the signals. More...
 
TVector2 fFitRange
 Range of bins to fit the signal. More...
 
TVector3 fInitPointsOverThreshold
 Wrapper of (pointThreshold, signalThreshold, pointsOverThreshold) params. More...
 
Size_t fMinSaturatedBins
 Minimum number of saturated bins to consider a signal as saturated. More...
 
Short_t fMinSaturationValue
 Minimum value to consider a signal as saturated. More...
 
Size_t fNBinsIfNotSaturated
 Number of bins to consider if the signal is not saturated. More...
 
Bool_t fProcessAllSignals
 Process all signals in the event. More...
 

Additional Inherited Members

- Protected Types inherited from TRestEventProcess
enum  REST_Process_Output { No_Output , Observable , Internal_Var , Full_Output }
 
- Protected Member Functions inherited from TRestEventProcess
void BeginPrintProcess ()
 [name, cut range]
 
void CreateCanvas ()
 Create the canvas. More...
 
void EndPrintProcess ()
 
TRestEventProcessGetFriend (const std::string &nameOrType)
 
TRestEventProcessGetFriendLive (const std::string &nameOrType)
 
template<class T >
T * GetMetadata ()
 Get a metadata object from the host TRestRun. More...
 
TRestMetadataGetMetadata (const std::string &nameOrType)
 
size_t GetNumberOfParallelProcesses () const
 
template<class T >
GetObservableValue (const std::string &name)
 
TRestEventProcessGetParallel (int i)
 
template<class T >
std::vector< T > GetParallelDataMembers (T *member_of_process)
 Get a list of data members from parallel processes which is same to this process's certain data member. More...
 
template<class T >
void SetObservableValue (const std::string &name, const T &value)
 Set observable value for AnalysisTree. More...
 
- Protected Attributes inherited from TRestEventProcess
TRestAnalysisTreefAnalysisTree = nullptr
 
TCanvas * fCanvas = nullptr
 < Canvas for some viewer event More...
 
TVector2 fCanvasSize
 Canvas size. More...
 
std::vector< std::pair< std::string, TVector2 > > fCuts
 Stores cut definitions. Any listed observables should be in the range. More...
 
bool fDynamicObs = false
 It defines whether to use added observables only or all the observables appear in the code. More...
 
bool fIsExternal = false
 It defines if the process reads event data from an external source. More...
 
std::map< std::string, int > fObservablesDefined
 Stores the list of all the appeared process observables in the code. More...
 
std::map< std::string, int > fObservablesUpdated
 Stores the list of process observables updated when processing this event. More...
 
bool fReadOnly = false
 not used, keep for compatibility More...
 
TRestRunfRunInfo = nullptr
 < Pointer to TRestRun object where to find metadata. More...
 
bool fSingleThreadOnly = false
 
bool fValidateObservables = false
 It defines if observable names should be added to the validation list. More...
 

Constructor & Destructor Documentation

◆ TRestRawSignalRecoverSaturationProcess()

TRestRawSignalRecoverSaturationProcess::TRestRawSignalRecoverSaturationProcess ( )

Default constructor.

Definition at line 151 of file TRestRawSignalRecoverSaturationProcess.cxx.

◆ ~TRestRawSignalRecoverSaturationProcess()

TRestRawSignalRecoverSaturationProcess::~TRestRawSignalRecoverSaturationProcess ( )

Default destructor.

Definition at line 156 of file TRestRawSignalRecoverSaturationProcess.cxx.

Member Function Documentation

◆ EndProcess()

void TRestRawSignalRecoverSaturationProcess::EndProcess ( )
overridevirtual

Function to include required actions after all events have been processed.

Reimplemented from TRestEventProcess.

Definition at line 425 of file TRestRawSignalRecoverSaturationProcess.cxx.

◆ GetInputEvent()

RESTValue TRestRawSignalRecoverSaturationProcess::GetInputEvent ( ) const
inlineoverridevirtual

Get pointer to input event. Must be implemented in the derived class.

Implements TRestEventProcess.

Definition at line 62 of file TRestRawSignalRecoverSaturationProcess.h.

◆ GetOutputEvent()

RESTValue TRestRawSignalRecoverSaturationProcess::GetOutputEvent ( ) const
inlineoverridevirtual

Get pointer to output event. Must be implemented in the derived class.

Implements TRestEventProcess.

Definition at line 63 of file TRestRawSignalRecoverSaturationProcess.h.

◆ GetProcessName()

const char * TRestRawSignalRecoverSaturationProcess::GetProcessName ( ) const
inlineoverridevirtual

Implements TRestEventProcess.

Definition at line 67 of file TRestRawSignalRecoverSaturationProcess.h.

◆ Initialize()

void TRestRawSignalRecoverSaturationProcess::Initialize ( )
overrideprivatevirtual

Function to initialize input/output event members and define the section name.

Reimplemented from TRestMetadata.

Definition at line 162 of file TRestRawSignalRecoverSaturationProcess.cxx.

◆ InitProcess()

void TRestRawSignalRecoverSaturationProcess::InitProcess ( )
overridevirtual

Process initialization. Observable names can be re-interpreted here. Any action in the process required before starting event process might be added here.

Reimplemented from TRestEventProcess.

Definition at line 183 of file TRestRawSignalRecoverSaturationProcess.cxx.

◆ PrintMetadata()

void TRestRawSignalRecoverSaturationProcess::PrintMetadata ( )
inlineoverridevirtual

It prints out the process parameters stored in the metadata structure.

Reimplemented from TRestMetadata.

Definition at line 74 of file TRestRawSignalRecoverSaturationProcess.h.

◆ ProcessEvent()

TRestEvent * TRestRawSignalRecoverSaturationProcess::ProcessEvent ( TRestEvent eventInput)
overridevirtual

The main processing event function.

Implements TRestEventProcess.

Definition at line 195 of file TRestRawSignalRecoverSaturationProcess.cxx.

Field Documentation

◆ fAnaEvent

TRestRawSignalEvent* TRestRawSignalRecoverSaturationProcess::fAnaEvent
private

A pointer to the specific TRestRawSignalEvent input event.

Definition at line 33 of file TRestRawSignalRecoverSaturationProcess.h.

◆ fBaseLineRange

TVector2 TRestRawSignalRecoverSaturationProcess::fBaseLineRange
private

Range of bins to calculate the baseline and fix that parameter in the fit.

Definition at line 50 of file TRestRawSignalRecoverSaturationProcess.h.

◆ fC

TCanvas* TRestRawSignalRecoverSaturationProcess::fC
private

Canvas to draw the signals.

Definition at line 59 of file TRestRawSignalRecoverSaturationProcess.h.

◆ fFitRange

TVector2 TRestRawSignalRecoverSaturationProcess::fFitRange
private

Range of bins to fit the signal.

Definition at line 53 of file TRestRawSignalRecoverSaturationProcess.h.

◆ fInitPointsOverThreshold

TVector3 TRestRawSignalRecoverSaturationProcess::fInitPointsOverThreshold
private

Wrapper of (pointThreshold, signalThreshold, pointsOverThreshold) params.

Definition at line 56 of file TRestRawSignalRecoverSaturationProcess.h.

◆ fMinSaturatedBins

Size_t TRestRawSignalRecoverSaturationProcess::fMinSaturatedBins
private

Minimum number of saturated bins to consider a signal as saturated.

Definition at line 38 of file TRestRawSignalRecoverSaturationProcess.h.

◆ fMinSaturationValue

Short_t TRestRawSignalRecoverSaturationProcess::fMinSaturationValue
private

Minimum value to consider a signal as saturated.

Definition at line 47 of file TRestRawSignalRecoverSaturationProcess.h.

◆ fNBinsIfNotSaturated

Size_t TRestRawSignalRecoverSaturationProcess::fNBinsIfNotSaturated
private

Number of bins to consider if the signal is not saturated.

Definition at line 44 of file TRestRawSignalRecoverSaturationProcess.h.

◆ fProcessAllSignals

Bool_t TRestRawSignalRecoverSaturationProcess::fProcessAllSignals
private

Process all signals in the event.

Definition at line 41 of file TRestRawSignalRecoverSaturationProcess.h.


The documentation for this class was generated from the following files: