REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Public Member Functions | Data Fields | Protected Attributes | Private Member Functions
TRestRawSignal Class Reference

Detailed Description

It defines a Short_t array with a physical parameter that evolves in time using a fixed time bin.

TRestRawSignal is ... a longer description comes here

DOCUMENTATION TO BE WRITTEN (main description, figures, ...)


Warning
⚠ REST is under continuous development. This documentation is offered to you by the REST community. Your HELP is needed to keep this code up to date. Your feedback will be worth to support this software, please report any problems/suggestions you may find will using it at The REST Framework forum. You are welcome to contribute fixing typos, updating information or adding/proposing new contributions. See also our Contribution Guide.

RESTsoft - Software for Rare Event Searches with TPCs

History of developments:

2017-February: First concept and implementation of TRestRawSignal class.

Author
Javier Galan

2022-January: Added robust baseline calculation methods

Author
Konrad Altenmüller

Definition at line 36 of file TRestRawSignal.h.

#include <TRestRawSignal.h>

Public Member Functions

void AddOffset (Short_t offset)
 This method adds an offset to the signal data. More...
 
void AddPoint (Double_t)
 Adds a new point to the end of the signal data array. More...
 
void AddPoint (Short_t)
 Adds a new point to the end of the signal data array. More...
 
void CalculateBaseLine (Int_t startBin, Int_t endBin, const std::string &option="")
 This method calculates the average and fluctuation of the baseline in the specified range and writes the values to fBaseLine and fBaseLineSigma respectively. Without further option, this method calculates the average as arithmetic mean, and the fluctuation as standard deviation. More...
 
void CalculateBaseLineMean (Int_t startBin, Int_t endBin)
 This method is called by CalculateBaseLine and is used to determine the value of the baseline as average (arithmetic mean) of the data points found in the range defined between startBin and endBin. More...
 
void CalculateBaseLineMedian (Int_t startBin, Int_t endBin)
 This method is called by CalculateBaseLine with the "ROBUST"-option and is used to determine the value of the baseline as the median of the data points found in the range defined between startBin and endBin. More...
 
void CalculateBaseLineMedianExcludeOutliers (Int_t startBin, Int_t endBin)
 This method is called by CalculateBaseLine with the "OUTLIERS"-option and is used to determine the value of the baseline as the median of the data points found in the range defined between startBin and endBin after excluding the outliers. The median is calculated using only the values in the 25-75% removing big and small outliers. More...
 
Double_t GetAverageInRange (Int_t startBin, Int_t endBin)
 It returns the average of the points found in the range (startBin, endBin) More...
 
Double_t GetBaseLine () const
 
void GetBaseLineCorrected (TRestRawSignal *smoothedSignal, Int_t averagingPoints)
 It applies the moving average filter (GetSignalSmoothed) to the signal, which is then subtracted from the raw data, resulting in a corrected baseline. The returned signal is placed at the signal pointer given by the argument. More...
 
Double_t GetBaseLineSigma () const
 
Double_t GetData (Int_t n) const
 It returns the data value of point n including baseline correction. More...
 
void GetDifferentialSignal (TRestRawSignal *diffSignal, Int_t smearPoints)
 It calculates the differential signal of the existing signal and it will place at the signal pointer given by argument. More...
 
TGraph * GetGraph (Int_t color=1)
 It builds a TGraph object that can be used for drawing. More...
 
Int_t GetHeadPoints () const
 Returns the number of head points used on points over threshold definition. More...
 
Int_t GetID () const
 Returns the value of signal ID. More...
 
Double_t GetIntegral ()
 It returns the integral of points found in the region defined by fRange. If fRange was not defined the integral is calculated in the full range. More...
 
Double_t GetIntegralInRange (Int_t startBin, Int_t endBin)
 It returns the integral of points found in the specific range given by (startBin,endBin). More...
 
Int_t GetMaxPeakBin ()
 It returns the bin at which the maximum peak amplitude happens. More...
 
Double_t GetMaxPeakValue ()
 It returns the amplitude of the signal maximum, baseline will be corrected if CalculateBaseLine was called first. More...
 
Int_t GetMaxPeakWidth ()
 It returns the temporal width of the peak with maximum amplitude inside the signal. More...
 
Double_t GetMaxValue ()
 Returns the maximum value found in the data points. It includes baseline correction. More...
 
Int_t GetMinPeakBin ()
 It returns the bin at which the minimum peak amplitude happens. More...
 
Double_t GetMinPeakValue ()
 It returns the amplitude of the signal minimum, baseline will be corrected if CalculateBaseLine was called first. More...
 
Double_t GetMinValue ()
 Returns the lowest value found in the data points. It includes baseline correction. More...
 
Int_t GetNumberOfPoints () const
 Returns the actual number of points, or size of the signal. More...
 
std::vector< std::pair< UShort_t, double > > GetPeaks (double threshold, UShort_t distance=5) const
 
std::vector< std::pair< UShort_t, double > > GetPeaksVeto (double threshold, UShort_t distance=5) const
 
std::vector< Int_t > GetPointsOverThreshold () const
 Returns a std::vector containing the indexes of data points over threshold. More...
 
TVector2 GetRange () const
 Returns the range defined by user. More...
 
Double_t GetRawData (Int_t n) const
 It returns the original data value of point n without baseline correction. More...
 
Double_t GetRiseSlope ()
 It returns the rate of change or slope from the points that have been identified over threshlold on the first positive rise of the signal. InitializePointsOverThreshold should have been called first. More...
 
Int_t GetRiseTime ()
 It returns the time required from the signal to reach the maximum. InitializePointsOverThreshold should have been called first. More...
 
UInt_t GetSeed () const
 
Int_t GetSignalID () const
 Returns the value of signal ID. More...
 
std::vector< Float_t > GetSignalSmoothed (Int_t averagingPoints, std::string option="")
 It smoothes the existing signal and returns it in a vector of Float_t values. More...
 
void GetSignalSmoothed (TRestRawSignal *smoothedSignal, Int_t averagingPoints)
 It smoothes the existing signal and places it at the signal pointer given by argument. More...
 
Double_t GetSlopeIntegral ()
 It returns the integral of points identified over threshold found in the first positive rise of the signal. InitializePointsOverThreshold should have been called first. More...
 
Int_t GetTailPoints () const
 Returns the number of tail points used on points over threshold definition. More...
 
Double_t GetThresholdIntegral ()
 It returns the integral of points identified over threshold. InitializePointsOverThreshold should have been called first. More...
 
Double_t GetTripleMaxIntegral ()
 It returns the integral calculated using the maximum signal amplitude and its neightbour points. More...
 
void GetWhiteNoiseSignal (TRestRawSignal *noiseSignal, Double_t noiseLevel=1.)
 It calculates an arbitrary Gaussian noise placing it at the signal pointer given by argument. The number of points defined will be the same as the existing signal. More...
 
void IncreaseBinBy (Int_t bin, Double_t data)
 It adds the content of data to fSignalData[bin]. More...
 
void Initialize ()
 Initialization of TRestRawSignal members. More...
 
void InitializePointsOverThreshold (const TVector2 &thrPar, Int_t nPointsOver, Int_t nPointsFlat=512)
 It initializes the fPointsOverThreshold array with the indexes of data points that are found over threshold. The parameters provided to this method are used to identify those points. More...
 
Bool_t IsADCSaturation (int Nflat=3)
 It returns whether the signal has ADC saturation. More...
 
Bool_t isBaseLineInitialized () const
 Returns false if the baseline and its baseline fluctuation was not initialized. More...
 
Short_t operator[] (Int_t n)
 It overloads the operator [] so that we can retrieve a particular point n in the form rawSignal[n]. More...
 
void Print () const
 It prints the signal data on screen. More...
 
void Reset ()
 Initializes the existing signal data and sets it to zero while keeping the array size. More...
 
void Scale (Double_t value)
 This method scales the signal by a given value. More...
 
void SetHeadPoints (Int_t p)
 It sets the number of head points. More...
 
void SetID (Int_t sID)
 It sets the id number of the signal. More...
 
void SetRange (const TVector2 &range)
 It sets/constrains the range for any calculation. More...
 
void SetRange (Int_t from, Int_t to)
 It sets/constrains the range for any calculation. More...
 
void SetRangeToMax ()
 
void SetSeed (UInt_t seed)
 
void SetSignalID (Int_t sID)
 It sets the id number of the signal. More...
 
void SetTailPoints (Int_t p)
 It sets the number of tail points. More...
 
void SignalAddition (const TRestRawSignal &signal)
 This method adds the signal provided by argument to the existing signal. More...
 
 TRestRawSignal ()
 Default constructor. More...
 
 TRestRawSignal (Int_t nBins)
 Default constructor initializing fSignalData with a number of points equal to nBins. More...
 
void WriteSignalToTextFile (const TString &filename)
 This method dumps to a text file the data inside fSignalData. More...
 
 ~TRestRawSignal ()
 Default destructor. More...
 

Data Fields

Double_t fBaseLine = 0
 This baseline value will be subtracted from GetData for any raw signal observable calculation. More...
 
Double_t fBaseLineSigma = 0
 The baseline fluctuation calculated as the standard deviation of the baseline. More...
 
TGraph * fGraph
 A TGraph pointer used to store the TRestRawSignal drawing. More...
 
Int_t fHeadPoints
 It defines the number of points to include before point over threshold definition. NOT implemented. More...
 
std::vector< Int_t > fPointsOverThreshold
 A std::vector containing the index of points that are identified over threshold. More...
 
TVector2 fRange = TVector2(0, 0)
 Any signal calculation will be restricted to the following range definition. More...
 
Int_t fTailPoints
 It defines the number of points to include after point over threshold definition. NOT implemented. More...
 
Double_t fThresholdIntegral = -1
 It stores the integral value obtained from the points identified over threshold. More...
 

Protected Attributes

UInt_t fSeed = gRandom->GetSeed()
 Seed used for random number generation. More...
 
Bool_t fShowWarnings = true
 
std::vector< Short_t > fSignalData
 Vector with the data of the signal. More...
 
Int_t fSignalID
 An integer value used to attribute a unique identification number to the signal. More...
 

Private Member Functions

void CalculateBaseLineSigmaExcludeOutliers (Int_t startBin, Int_t endBin)
 This method is called by CalculateBaseLine with the "OUTLIERS"-option to determine the value of the baseline fluctuation as the standard deviation in the baseline range provided excluding outliers. Since outliers are strongly suppressed there is no need to use the IQR. More...
 
void CalculateBaseLineSigmaIQR (Int_t startBin, Int_t endBin)
 This method is called by CalculateBaseLine with the "ROBUST"-option to determine the value of the baseline fluctuation as its interquartile range (IQR) in the baseline range provided. The IQR is more robust towards outliers than the standard deviation. More...
 
void CalculateBaseLineSigmaSD (Int_t startBin, Int_t endBin)
 This method is called by CalculateBaseLine to determine the value of the baseline fluctuation as its standard deviation in the baseline range provided. More...
 
void CalculateThresholdIntegral ()
 This method will be called each time InitializePointsOverThreshold is called to re-define the value of fThresholdIntegral. This method is only used internally. More...
 
std::vector< Float_t > GetSignalSmoothed_ExcludeOutliers (Int_t averagingPoints)
 It smooths the existing signal and returns it in a vector of Float_t values. This method excludes points which are far off from the BaseLine IQR (e.g. signals). In case the baseline parameters were not calculated yet, this method calls CalculateBaseLine with the "ROBUST" option on the entire signal range minus 5 bins on the edges. More...
 

Constructor & Destructor Documentation

◆ TRestRawSignal() [1/2]

TRestRawSignal::TRestRawSignal ( )

Default constructor.

Definition at line 77 of file src/TRestRawSignal.cxx.

◆ TRestRawSignal() [2/2]

TRestRawSignal::TRestRawSignal ( Int_t  nBins)

Default constructor initializing fSignalData with a number of points equal to nBins.

Definition at line 87 of file src/TRestRawSignal.cxx.

◆ ~TRestRawSignal()

TRestRawSignal::~TRestRawSignal ( )

Default destructor.

Definition at line 98 of file src/TRestRawSignal.cxx.

Member Function Documentation

◆ AddOffset()

void TRestRawSignal::AddOffset ( Short_t  offset)

This method adds an offset to the signal data.

Definition at line 944 of file src/TRestRawSignal.cxx.

◆ AddPoint() [1/2]

void TRestRawSignal::AddPoint ( Double_t  value)

Adds a new point to the end of the signal data array.

Definition at line 135 of file src/TRestRawSignal.cxx.

◆ AddPoint() [2/2]

void TRestRawSignal::AddPoint ( Short_t  value)

Adds a new point to the end of the signal data array.

Definition at line 130 of file src/TRestRawSignal.cxx.

◆ CalculateBaseLine()

void TRestRawSignal::CalculateBaseLine ( Int_t  startBin,
Int_t  endBin,
const std::string &  option = "" 
)

This method calculates the average and fluctuation of the baseline in the specified range and writes the values to fBaseLine and fBaseLineSigma respectively. Without further option, this method calculates the average as arithmetic mean, and the fluctuation as standard deviation.

Parameters
optionBy setting this option to "ROBUST", the average is calculated as median, and the fluctuation as interquartile range (IQR), which are less affected by outliers (e.g. a signal pulse). By setting it to "OUTLIERS" the median and sigma will only take into account the 25-75% values of the interval.

Definition at line 842 of file src/TRestRawSignal.cxx.

◆ CalculateBaseLineMean()

void TRestRawSignal::CalculateBaseLineMean ( Int_t  startBin,
Int_t  endBin 
)

This method is called by CalculateBaseLine and is used to determine the value of the baseline as average (arithmetic mean) of the data points found in the range defined between startBin and endBin.

Definition at line 752 of file src/TRestRawSignal.cxx.

◆ CalculateBaseLineMedian()

void TRestRawSignal::CalculateBaseLineMedian ( Int_t  startBin,
Int_t  endBin 
)

This method is called by CalculateBaseLine with the "ROBUST"-option and is used to determine the value of the baseline as the median of the data points found in the range defined between startBin and endBin.

Definition at line 771 of file src/TRestRawSignal.cxx.

◆ CalculateBaseLineMedianExcludeOutliers()

void TRestRawSignal::CalculateBaseLineMedianExcludeOutliers ( Int_t  startBin,
Int_t  endBin 
)

This method is called by CalculateBaseLine with the "OUTLIERS"-option and is used to determine the value of the baseline as the median of the data points found in the range defined between startBin and endBin after excluding the outliers. The median is calculated using only the values in the 25-75% removing big and small outliers.

Definition at line 793 of file src/TRestRawSignal.cxx.

◆ CalculateBaseLineSigmaExcludeOutliers()

void TRestRawSignal::CalculateBaseLineSigmaExcludeOutliers ( Int_t  startBin,
Int_t  endBin 
)
private

This method is called by CalculateBaseLine with the "OUTLIERS"-option to determine the value of the baseline fluctuation as the standard deviation in the baseline range provided excluding outliers. Since outliers are strongly suppressed there is no need to use the IQR.

Definition at line 899 of file src/TRestRawSignal.cxx.

◆ CalculateBaseLineSigmaIQR()

void TRestRawSignal::CalculateBaseLineSigmaIQR ( Int_t  startBin,
Int_t  endBin 
)
private

This method is called by CalculateBaseLine with the "ROBUST"-option to determine the value of the baseline fluctuation as its interquartile range (IQR) in the baseline range provided. The IQR is more robust towards outliers than the standard deviation.

Definition at line 877 of file src/TRestRawSignal.cxx.

◆ CalculateBaseLineSigmaSD()

void TRestRawSignal::CalculateBaseLineSigmaSD ( Int_t  startBin,
Int_t  endBin 
)
private

This method is called by CalculateBaseLine to determine the value of the baseline fluctuation as its standard deviation in the baseline range provided.

Definition at line 860 of file src/TRestRawSignal.cxx.

◆ CalculateThresholdIntegral()

void TRestRawSignal::CalculateThresholdIntegral ( )
private

This method will be called each time InitializePointsOverThreshold is called to re-define the value of fThresholdIntegral. This method is only used internally.

Definition at line 288 of file src/TRestRawSignal.cxx.

◆ GetAverageInRange()

Double_t TRestRawSignal::GetAverageInRange ( Int_t  startBin,
Int_t  endBin 
)

It returns the average of the points found in the range (startBin, endBin)

Definition at line 466 of file src/TRestRawSignal.cxx.

◆ GetBaseLine()

Double_t TRestRawSignal::GetBaseLine ( ) const
inline

Returns the value of baseline that it is initialized after calling CalculateBaseLine.

Definition at line 111 of file TRestRawSignal.h.

◆ GetBaseLineCorrected()

void TRestRawSignal::GetBaseLineCorrected ( TRestRawSignal smoothedSignal,
Int_t  averagingPoints 
)

It applies the moving average filter (GetSignalSmoothed) to the signal, which is then subtracted from the raw data, resulting in a corrected baseline. The returned signal is placed at the signal pointer given by the argument.

Parameters
smoothedSignalThe pointer to the TRestRawSignal which will contain the corrected signal
averagingPointsIt defines the number of neighbour consecutive points used to average the signal

Definition at line 737 of file src/TRestRawSignal.cxx.

◆ GetBaseLineSigma()

Double_t TRestRawSignal::GetBaseLineSigma ( ) const
inline

Returns the value of baseline sigma that it is initialized after calling CalculateBaseLineSigmaSD or CalculateBaseLineSigmaIQR.

Definition at line 115 of file TRestRawSignal.h.

◆ GetData()

Double_t TRestRawSignal::GetData ( Int_t  n) const

It returns the data value of point n including baseline correction.

This method will substract the internal value of fBaseLine that is extracted from the existing data points after calling the method CalculateBaseLine. If CalculateBaseLine has not been called previously, this method will return the raw values inside fSignalData.

Definition at line 170 of file src/TRestRawSignal.cxx.

◆ GetDifferentialSignal()

void TRestRawSignal::GetDifferentialSignal ( TRestRawSignal diffSignal,
Int_t  smearPoints 
)

It calculates the differential signal of the existing signal and it will place at the signal pointer given by argument.

Parameters
smearPointsis a number bigger that 0 that serves to change the time distance of points used to obtain the differential at a given point.

Definition at line 588 of file src/TRestRawSignal.cxx.

◆ GetGraph()

TGraph * TRestRawSignal::GetGraph ( Int_t  color = 1)

It builds a TGraph object that can be used for drawing.

Definition at line 1002 of file src/TRestRawSignal.cxx.

◆ GetHeadPoints()

Int_t TRestRawSignal::GetHeadPoints ( ) const
inline

Returns the number of head points used on points over threshold definition.

Definition at line 104 of file TRestRawSignal.h.

◆ GetID()

Int_t TRestRawSignal::GetID ( ) const
inline

Returns the value of signal ID.

Definition at line 89 of file TRestRawSignal.h.

◆ GetIntegral()

Double_t TRestRawSignal::GetIntegral ( )

It returns the integral of points found in the region defined by fRange. If fRange was not defined the integral is calculated in the full range.

Definition at line 310 of file src/TRestRawSignal.cxx.

◆ GetIntegralInRange()

Double_t TRestRawSignal::GetIntegralInRange ( Int_t  startBin,
Int_t  endBin 
)

It returns the integral of points found in the specific range given by (startBin,endBin).

Definition at line 329 of file src/TRestRawSignal.cxx.

◆ GetMaxPeakBin()

Int_t TRestRawSignal::GetMaxPeakBin ( )

It returns the bin at which the maximum peak amplitude happens.

Definition at line 510 of file src/TRestRawSignal.cxx.

◆ GetMaxPeakValue()

Double_t TRestRawSignal::GetMaxPeakValue ( )

It returns the amplitude of the signal maximum, baseline will be corrected if CalculateBaseLine was called first.

Definition at line 505 of file src/TRestRawSignal.cxx.

◆ GetMaxPeakWidth()

Int_t TRestRawSignal::GetMaxPeakWidth ( )

It returns the temporal width of the peak with maximum amplitude inside the signal.

Definition at line 480 of file src/TRestRawSignal.cxx.

◆ GetMaxValue()

Double_t TRestRawSignal::GetMaxValue ( )
inline

Returns the maximum value found in the data points. It includes baseline correction.

Definition at line 98 of file TRestRawSignal.h.

◆ GetMinPeakBin()

Int_t TRestRawSignal::GetMinPeakBin ( )

It returns the bin at which the minimum peak amplitude happens.

Definition at line 538 of file src/TRestRawSignal.cxx.

◆ GetMinPeakValue()

Double_t TRestRawSignal::GetMinPeakValue ( )

It returns the amplitude of the signal minimum, baseline will be corrected if CalculateBaseLine was called first.

Definition at line 533 of file src/TRestRawSignal.cxx.

◆ GetMinValue()

Double_t TRestRawSignal::GetMinValue ( )
inline

Returns the lowest value found in the data points. It includes baseline correction.

Definition at line 101 of file TRestRawSignal.h.

◆ GetNumberOfPoints()

Int_t TRestRawSignal::GetNumberOfPoints ( ) const
inline

Returns the actual number of points, or size of the signal.

Definition at line 92 of file TRestRawSignal.h.

◆ GetPeaks()

vector< pair< UShort_t, double > > TRestRawSignal::GetPeaks ( double  threshold,
UShort_t  distance = 5 
) const

Returns the (time, amplitude) of the peaks in the signal. Peaks are defined as the points that are above the threshold and are separated by a minimum distance in time bin units. The threshold must be set in absolute value (regardless of the baseline)

Definition at line 1029 of file src/TRestRawSignal.cxx.

◆ GetPeaksVeto()

vector< pair< UShort_t, double > > TRestRawSignal::GetPeaksVeto ( double  threshold,
UShort_t  distance = 5 
) const

Definition at line 1132 of file src/TRestRawSignal.cxx.

◆ GetPointsOverThreshold()

std::vector< Int_t > TRestRawSignal::GetPointsOverThreshold ( ) const
inline

Returns a std::vector containing the indexes of data points over threshold.

Definition at line 95 of file TRestRawSignal.h.

◆ GetRange()

TVector2 TRestRawSignal::GetRange ( ) const
inline

Returns the range defined by user.

Definition at line 118 of file TRestRawSignal.h.

◆ GetRawData()

Double_t TRestRawSignal::GetRawData ( Int_t  n) const

It returns the original data value of point n without baseline correction.

Definition at line 176 of file src/TRestRawSignal.cxx.

◆ GetRiseSlope()

Double_t TRestRawSignal::GetRiseSlope ( )

It returns the rate of change or slope from the points that have been identified over threshlold on the first positive rise of the signal. InitializePointsOverThreshold should have been called first.

Definition at line 390 of file src/TRestRawSignal.cxx.

◆ GetRiseTime()

Int_t TRestRawSignal::GetRiseTime ( )

It returns the time required from the signal to reach the maximum. InitializePointsOverThreshold should have been called first.

Definition at line 414 of file src/TRestRawSignal.cxx.

◆ GetSeed()

UInt_t TRestRawSignal::GetSeed ( ) const
inline

Definition at line 161 of file TRestRawSignal.h.

◆ GetSignalID()

Int_t TRestRawSignal::GetSignalID ( ) const
inline

Returns the value of signal ID.

Definition at line 86 of file TRestRawSignal.h.

◆ GetSignalSmoothed() [1/2]

std::vector< Float_t > TRestRawSignal::GetSignalSmoothed ( Int_t  averagingPoints,
std::string  option = "" 
)

It smoothes the existing signal and returns it in a vector of Float_t values.

Parameters
averagingPointsIt defines the number of neighbour consecutive points used to average the signal
optionIf the option is set to "EXCLUDE OUTLIERS", points that are too far away from the median baseline will be ignored to improve the smoothing result

Definition at line 661 of file src/TRestRawSignal.cxx.

◆ GetSignalSmoothed() [2/2]

void TRestRawSignal::GetSignalSmoothed ( TRestRawSignal smoothedSignal,
Int_t  averagingPoints 
)

It smoothes the existing signal and places it at the signal pointer given by argument.

Parameters
averagingPointsIt defines the number of neighbour consecutive points used to average the signal

Definition at line 633 of file src/TRestRawSignal.cxx.

◆ GetSignalSmoothed_ExcludeOutliers()

std::vector< Float_t > TRestRawSignal::GetSignalSmoothed_ExcludeOutliers ( Int_t  averagingPoints)
private

It smooths the existing signal and returns it in a vector of Float_t values. This method excludes points which are far off from the BaseLine IQR (e.g. signals). In case the baseline parameters were not calculated yet, this method calls CalculateBaseLine with the "ROBUST" option on the entire signal range minus 5 bins on the edges.

Parameters
averagingPointsIt defines the number of neightbour consecutive points used to average the signal

Definition at line 698 of file src/TRestRawSignal.cxx.

◆ GetSlopeIntegral()

Double_t TRestRawSignal::GetSlopeIntegral ( )

It returns the integral of points identified over threshold found in the first positive rise of the signal. InitializePointsOverThreshold should have been called first.

Definition at line 367 of file src/TRestRawSignal.cxx.

◆ GetTailPoints()

Int_t TRestRawSignal::GetTailPoints ( ) const
inline

Returns the number of tail points used on points over threshold definition.

Definition at line 107 of file TRestRawSignal.h.

◆ GetThresholdIntegral()

Double_t TRestRawSignal::GetThresholdIntegral ( )

It returns the integral of points identified over threshold. InitializePointsOverThreshold should have been called first.

Definition at line 349 of file src/TRestRawSignal.cxx.

◆ GetTripleMaxIntegral()

Double_t TRestRawSignal::GetTripleMaxIntegral ( )

It returns the integral calculated using the maximum signal amplitude and its neightbour points.

Definition at line 432 of file src/TRestRawSignal.cxx.

◆ GetWhiteNoiseSignal()

void TRestRawSignal::GetWhiteNoiseSignal ( TRestRawSignal noiseSignal,
Double_t  noiseLevel = 1. 
)

It calculates an arbitrary Gaussian noise placing it at the signal pointer given by argument. The number of points defined will be the same as the existing signal.

Parameters
noiseLevelIt defines the amplitude of the signal noise fluctuations as its standard deviation.

Definition at line 615 of file src/TRestRawSignal.cxx.

◆ IncreaseBinBy()

void TRestRawSignal::IncreaseBinBy ( Int_t  bin,
Double_t  data 
)

It adds the content of data to fSignalData[bin].

Definition at line 181 of file src/TRestRawSignal.cxx.

◆ Initialize()

void TRestRawSignal::Initialize ( )

Initialization of TRestRawSignal members.

Definition at line 103 of file src/TRestRawSignal.cxx.

◆ InitializePointsOverThreshold()

void TRestRawSignal::InitializePointsOverThreshold ( const TVector2 &  thrPar,
Int_t  nPointsOver,
Int_t  nPointsFlat = 512 
)

It initializes the fPointsOverThreshold array with the indexes of data points that are found over threshold. The parameters provided to this method are used to identify those points.

Parameters
thrParA TVector2 defining two parameters: pointThreshold and signalThreshold. Both numbers define the number of sigmas over the baseline fluctuation, stored in fBaseLineSigma. The first parameter, pointThreshold, serves to identify if a single point is over threshold by satisfying the condition that is above the baseline by the number of sigmas given in pointThreshold. Once a certain number of consecutive points have been identified, the parameter signalThreshold will serve to reject the signals (consecutive points over threshold) that their standard deviation is lower that signalThreshold times the baseline fluctuation.
nPointsOverOnly data points with at least nPointsOver consecutive points will be considered.
nPointsFlatIt will serve to terminate the points over threshold identification in signals where we find an overshoot, being the baseline not returning to zero (or its original value) at the signal tail.

Definition at line 223 of file src/TRestRawSignal.cxx.

◆ IsADCSaturation()

Bool_t TRestRawSignal::IsADCSaturation ( int  Nflat = 3)

It returns whether the signal has ADC saturation.

Definition at line 558 of file src/TRestRawSignal.cxx.

◆ isBaseLineInitialized()

Bool_t TRestRawSignal::isBaseLineInitialized ( ) const
inline

Returns false if the baseline and its baseline fluctuation was not initialized.

Definition at line 121 of file TRestRawSignal.h.

◆ operator[]()

Short_t TRestRawSignal::operator[] ( Int_t  n)

It overloads the operator [] so that we can retrieve a particular point n in the form rawSignal[n].

Definition at line 149 of file src/TRestRawSignal.cxx.

◆ Print()

void TRestRawSignal::Print ( ) const

It prints the signal data on screen.

Definition at line 988 of file src/TRestRawSignal.cxx.

◆ Reset()

void TRestRawSignal::Reset ( )

Initializes the existing signal data and sets it to zero while keeping the array size.

Definition at line 121 of file src/TRestRawSignal.cxx.

◆ Scale()

void TRestRawSignal::Scale ( Double_t  value)

This method scales the signal by a given value.

Definition at line 952 of file src/TRestRawSignal.cxx.

◆ SetHeadPoints()

void TRestRawSignal::SetHeadPoints ( Int_t  p)
inline

It sets the number of head points.

Definition at line 136 of file TRestRawSignal.h.

◆ SetID()

void TRestRawSignal::SetID ( Int_t  sID)
inline

It sets the id number of the signal.

Definition at line 133 of file TRestRawSignal.h.

◆ SetRange() [1/2]

void TRestRawSignal::SetRange ( const TVector2 &  range)
inline

It sets/constrains the range for any calculation.

Definition at line 142 of file TRestRawSignal.h.

◆ SetRange() [2/2]

void TRestRawSignal::SetRange ( Int_t  from,
Int_t  to 
)
inline

It sets/constrains the range for any calculation.

Definition at line 147 of file TRestRawSignal.h.

◆ SetRangeToMax()

void TRestRawSignal::SetRangeToMax ( )
inline

Definition at line 144 of file TRestRawSignal.h.

◆ SetSeed()

void TRestRawSignal::SetSeed ( UInt_t  seed)
inline

Definition at line 219 of file TRestRawSignal.h.

◆ SetSignalID()

void TRestRawSignal::SetSignalID ( Int_t  sID)
inline

It sets the id number of the signal.

Definition at line 130 of file TRestRawSignal.h.

◆ SetTailPoints()

void TRestRawSignal::SetTailPoints ( Int_t  p)
inline

It sets the number of tail points.

Definition at line 139 of file TRestRawSignal.h.

◆ SignalAddition()

void TRestRawSignal::SignalAddition ( const TRestRawSignal signal)

This method adds the signal provided by argument to the existing signal.

Definition at line 963 of file src/TRestRawSignal.cxx.

◆ WriteSignalToTextFile()

void TRestRawSignal::WriteSignalToTextFile ( const TString &  filename)

This method dumps to a text file the data inside fSignalData.

Definition at line 978 of file src/TRestRawSignal.cxx.

Field Documentation

◆ fBaseLine

Double_t TRestRawSignal::fBaseLine = 0

This baseline value will be subtracted from GetData for any raw signal observable calculation.

Definition at line 77 of file TRestRawSignal.h.

◆ fBaseLineSigma

Double_t TRestRawSignal::fBaseLineSigma = 0

The baseline fluctuation calculated as the standard deviation of the baseline.

Definition at line 80 of file TRestRawSignal.h.

◆ fGraph

TGraph* TRestRawSignal::fGraph

A TGraph pointer used to store the TRestRawSignal drawing.

Definition at line 62 of file TRestRawSignal.h.

◆ fHeadPoints

Int_t TRestRawSignal::fHeadPoints

It defines the number of points to include before point over threshold definition. NOT implemented.

Definition at line 71 of file TRestRawSignal.h.

◆ fPointsOverThreshold

std::vector<Int_t> TRestRawSignal::fPointsOverThreshold

A std::vector containing the index of points that are identified over threshold.

Definition at line 65 of file TRestRawSignal.h.

◆ fRange

TVector2 TRestRawSignal::fRange = TVector2(0, 0)

Any signal calculation will be restricted to the following range definition.

Definition at line 83 of file TRestRawSignal.h.

◆ fSeed

UInt_t TRestRawSignal::fSeed = gRandom->GetSeed()
protected

Seed used for random number generation.

Definition at line 58 of file TRestRawSignal.h.

◆ fShowWarnings

Bool_t TRestRawSignal::fShowWarnings = true
protected

Definition at line 55 of file TRestRawSignal.h.

◆ fSignalData

std::vector<Short_t> TRestRawSignal::fSignalData
protected

Vector with the data of the signal.

Definition at line 53 of file TRestRawSignal.h.

◆ fSignalID

Int_t TRestRawSignal::fSignalID
protected

An integer value used to attribute a unique identification number to the signal.

Definition at line 50 of file TRestRawSignal.h.

◆ fTailPoints

Int_t TRestRawSignal::fTailPoints

It defines the number of points to include after point over threshold definition. NOT implemented.

Definition at line 74 of file TRestRawSignal.h.

◆ fThresholdIntegral

Double_t TRestRawSignal::fThresholdIntegral = -1

It stores the integral value obtained from the points identified over threshold.

Definition at line 68 of file TRestRawSignal.h.


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