|
REST-for-Physics
v2.3
Rare Event Searches ToolKit for Physics
|
An event container for time rawdata signals with fixed length.
TRestRawSignalEvent stores the digitized raw waveforms recorded for one REST event.
A TRestRawSignalEvent is a collection of TRestRawSignal objects. Each TRestRawSignal represents one readout channel, identified by its signal ID, and contains a fixed-length array of ADC samples. The event object groups all channels that belong to the same acquisition event and provides event-level operations such as drawing, signal lookup, baseline initialization, and global observables obtained by combining the individual signals.
This is usually the first event type encountered when opening data produced from a raw DAQ file. Conversion processes read the external binary format and fill a TRestRawSignalEvent with one waveform per active channel. Later analysis processes, such as TRestRawSignalAnalysisProcess, use this event to calculate baseline values, threshold integrals, amplitudes, rise times, and other waveform observables.
A minimal inspection of a raw-signal event from a restRoot session or ROOT macro typically looks like:
Signals can be accessed either by their position in the internal collection with GetSignal(), or by their detector/readout identifier with GetSignalById(). The latter is usually safer in analysis code, because the ordering of signals in the event should not be assumed to define the channel mapping.
Baseline and range definitions can be applied at event level. Calling SetBaseLineRange() forwards the selected sample interval to all contained TRestRawSignal objects and calculates their baseline parameters. Calling SetRange() constrains subsequent signal observable calculations to the given sample interval.
The following figure shows the output of DrawEvent(), where each trace corresponds to one TRestRawSignal contained in the event.
In a typical processing chain this event type sits before detector-level signal and hit reconstruction. TRestRawSignalEvent keeps the data in ADC-bin form, while TRestDetectorSignalEvent stores signals as time-charge points using physical coordinates. Use TRestRawSignalEvent when the analysis still depends on raw samples, baseline windows, thresholds, or ADC-level pulse shape information.
RESTsoft - Software for Rare Event Searches with TPCs
History of developments:
2017-Feb: First concept (inspired by TRestDetectorSignalEvent) Javier Galan
Definition at line 40 of file TRestRawSignalEvent.h.
#include <TRestRawSignalEvent.h>
Public Member Functions | |
| void | AddChargeToSignal (Int_t sgnlID, Int_t bin, Short_t value) |
| void | AddSignal (TRestRawSignal &s) |
| TPad * | DrawEvent (const TString &option="") |
| This method draws current raw signal event in a TPad. More... | |
| TPad * | DrawSignal (Int_t signalID, const TString &option="") |
| This method draws selected signalID by ID, with baseline range and points over threshold highlighted. More... | |
| void | DrawSignals (TPad *pad, const std::vector< Int_t > &signals) |
| This method draws selected signal IDs, given by the vector passed as reference. More... | |
| auto | GetAuxiliar () |
| Double_t | GetAverageWidth (Double_t minPeakAmplitude=0) |
| Double_t | GetBaseLineAverage () |
| Double_t | GetBaseLineSigmaAverage () |
| Double_t | GetIntegral () |
| Double_t | GetLowAverageWidth (Int_t nSignals=5, Double_t minPeakAmplitude=0) |
| Int_t | GetLowestWidth (Double_t minPeakAmplitude=0) |
| TRestRawSignal * | GetMaxSignal () |
| Double_t | GetMaxTime () |
| Double_t | GetMaxValue () |
| Double_t | GetMinTime () |
| Double_t | GetMinValue () |
| Int_t | GetNumberOfSignals () const |
| TRestRawReadoutMetadata * | GetReadoutMetadata () const |
| Double_t | GetRiseSlope () |
| Double_t | GetRiseTime () |
| TRestRawSignal * | GetSignal (Int_t n) |
| TRestRawSignal * | GetSignalById (Int_t sid) |
| TRestRawSignalEvent | GetSignalEventForType (const std::string &type) const |
| TRestRawSignalEvent | GetSignalEventForTypes (const std::set< std::string > &types, const TRestRawReadoutMetadata *readoutMetadata=nullptr) const |
| std::vector< int > | GetSignalIds () |
| Int_t | GetSignalIndex (Int_t signalID) |
| std::vector< TRestRawSignal > | GetSignals () const |
| Double_t | GetSlopeIntegral () |
| Double_t | GetThresholdIntegral () |
| Double_t | GetTripleMaxIntegral () |
| void | Initialize () |
| Bool_t | isBaseLineInitialized () |
| void | PrintEvent () |
| void | PrintSignalIds () |
| void | RemoveSignalWithId (Int_t sId) |
| void | SetAuxiliar (Double_t aux) |
| void | SetBaseLineRange (Int_t from, Int_t to, std::string option="") |
| void | SetBaseLineRange (TVector2 blRange, std::string option="") |
| void | SetRange (Int_t from, Int_t to) |
| void | SetRange (TVector2 range) |
| void | SetTailPoints (Int_t p) |
| Bool_t | signalIDExists (Int_t sID) |
Public Member Functions inherited from TRestEvent | |
| virtual void | CloneTo (TRestEvent *target) |
| Clone the content of this TRestEvent object to another. More... | |
| virtual TPad * | DrawEvent (const TString &option="") |
| Draw the event. More... | |
| Int_t | GetID () const |
| Int_t | GetRunOrigin () const |
| TString | GetSubEventTag () const |
| Int_t | GetSubID () const |
| Int_t | GetSubRunOrigin () const |
| Double_t | GetTime () const |
| TTimeStamp | GetTimeStamp () const |
| virtual void | Initialize ()=0 |
| virtual void | InitializeReferences (TRestRun *run) |
| Initialize dynamical references when loading the event from a root file. More... | |
| virtual void | InitializeWithMetadata (TRestRun *run) |
| Bool_t | isOk () const |
| virtual void | PrintEvent () const |
| void | SetEventInfo (TRestEvent *eve) |
| void | SetID (Int_t id) |
| void | SetOK (Bool_t state) |
| void | SetRunOrigin (Int_t run_origin) |
| void | SetState (Bool_t state) |
| void | SetSubEventTag (const TString &tag) |
| void | SetSubID (Int_t id) |
| void | SetSubRunOrigin (Int_t sub_run_origin) |
| void | SetTime (Double_t seconds, Double_t nanoseconds) |
| void | SetTime (Double_t time) |
| void | SetTimeStamp (const TTimeStamp &time) |
| TRestEvent () | |
| virtual | ~TRestEvent () |
Protected Attributes | |
| Double_t | fAuxiliar = 0 |
| TVector2 | fBaseLineRange = TVector2(-1, -1) |
| Double_t | fMaxTime |
| Double_t | fMaxValue |
| Double_t | fMinTime |
| Double_t | fMinValue |
| TVector2 | fRange = TVector2(-1, -1) |
| std::vector< TRestRawSignal > | fSignal |
| TGraph * | gr |
Protected Attributes inherited from TRestEvent | |
| Int_t | fEventID |
| Event identification number. More... | |
| TTimeStamp | fEventTime |
| Absolute event time. More... | |
| Bool_t | fOk |
| Flag to be used by processes to define an event status. fOk=true is the default. More... | |
| TPad * | fPad |
| TRestRun * | fRun = nullptr |
| Int_t | fRunOrigin |
| Run ID number of the event. More... | |
| Int_t | fSubEventID |
| Sub-Event identification number. More... | |
| TString | fSubEventTag |
| A short length label to identify the sub-Event. More... | |
| Int_t | fSubRunOrigin |
| Sub-run ID number of the event. More... | |
Private Member Functions | |
| void | SetMaxAndMin () |
Additional Inherited Members | |
Protected Member Functions inherited from TRestEvent | |
| void | RestartPad (Int_t nElements) |
| TRestRawSignalEvent::TRestRawSignalEvent | ( | ) |
Definition at line 128 of file TRestRawSignalEvent.cxx.
|
virtual |
Definition at line 133 of file TRestRawSignalEvent.cxx.
| void TRestRawSignalEvent::AddChargeToSignal | ( | Int_t | signalID, |
| Int_t | bin, | ||
| Short_t | value | ||
| ) |
Perhaps we should not subtract baselines on a TRestRawSignal. Just consider it in the observables calculation if a baseline range is provided in the argument (as it is done in InitializeThresholdIntegral). This method should be probably removed.
Definition at line 343 of file TRestRawSignalEvent.cxx.
| void TRestRawSignalEvent::AddSignal | ( | TRestRawSignal & | s | ) |
Definition at line 149 of file TRestRawSignalEvent.cxx.
|
virtual |
This method draws current raw signal event in a TPad.
This method receives an optional argument as string that allows to control which signals will be plotted. Different options can be passed to the string by separated the options using colons, as "option1:option2:option3".
The following options are allowed:
- symbol (as in previous option) is also allowed. I.e. ids[10-20].If no option is given, all signals will be plotted.
Example 1:
Example 2:
Example 3:
Reimplemented from TRestEvent.
Definition at line 467 of file TRestRawSignalEvent.cxx.
| TPad * TRestRawSignalEvent::DrawSignal | ( | Int_t | signalID, |
| const TString & | option = "" |
||
| ) |
This method draws selected signalID by ID, with baseline range and points over threshold highlighted.
In order to compute points over threshold the following parameters should be provided:
goodSignals[pointTh,signalTh,nOver]: These parameters are the ones needed to call the method TRestRawSignal::InitializePointsOverThreshold.
baseLineRange[start,end]: It defines the bin range (start,end) where the baseline will be calculated.
Example 1:
Definition at line 746 of file TRestRawSignalEvent.cxx.
| void TRestRawSignalEvent::DrawSignals | ( | TPad * | pad, |
| const std::vector< Int_t > & | signals | ||
| ) |
This method draws selected signal IDs, given by the vector passed as reference.
Definition at line 674 of file TRestRawSignalEvent.cxx.
|
inline |
Definition at line 78 of file TRestRawSignalEvent.h.
| Double_t TRestRawSignalEvent::GetAverageWidth | ( | Double_t | minPeakAmplitude = 0 | ) |
Definition at line 286 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetBaseLineAverage | ( | ) |
Definition at line 262 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetBaseLineSigmaAverage | ( | ) |
Definition at line 322 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetIntegral | ( | ) |
Definition at line 180 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetLowAverageWidth | ( | Int_t | nSignals = 5, |
| Double_t | minPeakAmplitude = 0 |
||
| ) |
Definition at line 302 of file TRestRawSignalEvent.cxx.
| Int_t TRestRawSignalEvent::GetLowestWidth | ( | Double_t | minPeakAmplitude = 0 | ) |
Definition at line 273 of file TRestRawSignalEvent.cxx.
| TRestRawSignal * TRestRawSignalEvent::GetMaxSignal | ( | ) |
Definition at line 196 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetMaxTime | ( | ) |
Definition at line 403 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetMaxValue | ( | ) |
Definition at line 391 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetMinTime | ( | ) |
Definition at line 401 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetMinValue | ( | ) |
Definition at line 396 of file TRestRawSignalEvent.cxx.
|
inline |
Definition at line 101 of file TRestRawSignalEvent.h.
| TRestRawReadoutMetadata * TRestRawSignalEvent::GetReadoutMetadata | ( | ) | const |
Definition at line 859 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetRiseSlope | ( | ) |
Definition at line 221 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetRiseTime | ( | ) |
Definition at line 237 of file TRestRawSignalEvent.cxx.
|
inline |
Definition at line 102 of file TRestRawSignalEvent.h.
|
inline |
Definition at line 125 of file TRestRawSignalEvent.h.
| TRestRawSignalEvent TRestRawSignalEvent::GetSignalEventForType | ( | const std::string & | type | ) | const |
Definition at line 867 of file TRestRawSignalEvent.cxx.
| TRestRawSignalEvent TRestRawSignalEvent::GetSignalEventForTypes | ( | const std::set< std::string > & | types, |
| const TRestRawReadoutMetadata * | readoutMetadata = nullptr |
||
| ) | const |
Definition at line 871 of file TRestRawSignalEvent.cxx.
|
inline |
Definition at line 112 of file TRestRawSignalEvent.h.
| Int_t TRestRawSignalEvent::GetSignalIndex | ( | Int_t | signalID | ) |
Definition at line 174 of file TRestRawSignalEvent.cxx.
|
inline |
Definition at line 63 of file TRestRawSignalEvent.h.
| Double_t TRestRawSignalEvent::GetSlopeIntegral | ( | ) |
Definition at line 213 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetThresholdIntegral | ( | ) |
The result if this method depends on InitializePointsOverThreshold. Arguments are given there.
Definition at line 190 of file TRestRawSignalEvent.cxx.
| Double_t TRestRawSignalEvent::GetTripleMaxIntegral | ( | ) |
Definition at line 253 of file TRestRawSignalEvent.cxx.
|
virtual |
Run to initialize event data. To be re-implemented in derived class, you may want to call the base class at the end of the re-implemented, by calling TRestEvent::Initialize();
Implements TRestEvent.
Definition at line 137 of file TRestRawSignalEvent.cxx.
|
inline |
Definition at line 118 of file TRestRawSignalEvent.h.
| void TRestRawSignalEvent::PrintEvent | ( | ) |
Definition at line 356 of file TRestRawSignalEvent.cxx.
|
inline |
Definition at line 104 of file TRestRawSignalEvent.h.
| void TRestRawSignalEvent::RemoveSignalWithId | ( | Int_t | sId | ) |
Definition at line 162 of file TRestRawSignalEvent.cxx.
| void TRestRawSignalEvent::SetAuxiliar | ( | Double_t | aux | ) |
Definition at line 413 of file TRestRawSignalEvent.cxx.
|
inline |
It sets the range to be used for the baseline calculation and calls TRestRawSignal::CalculateBaseLine()
Definition at line 88 of file TRestRawSignalEvent.h.
|
inline |
It sets the range to be used for the baseline calculation and calls TRestRawSignal::CalculateBaseLine()
Definition at line 82 of file TRestRawSignalEvent.h.
|
private |
Definition at line 371 of file TRestRawSignalEvent.cxx.
|
inline |
Definition at line 95 of file TRestRawSignalEvent.h.
|
inline |
Definition at line 93 of file TRestRawSignalEvent.h.
|
inline |
Definition at line 72 of file TRestRawSignalEvent.h.
|
inline |
Definition at line 58 of file TRestRawSignalEvent.h.
|
protected |
Definition at line 47 of file TRestRawSignalEvent.h.
|
protected |
Definition at line 49 of file TRestRawSignalEvent.h.
|
protected |
Definition at line 44 of file TRestRawSignalEvent.h.
|
protected |
Definition at line 46 of file TRestRawSignalEvent.h.
|
protected |
Definition at line 43 of file TRestRawSignalEvent.h.
|
protected |
Definition at line 45 of file TRestRawSignalEvent.h.
|
protected |
Definition at line 50 of file TRestRawSignalEvent.h.
|
protected |
Definition at line 52 of file TRestRawSignalEvent.h.
|
protected |
Definition at line 42 of file TRestRawSignalEvent.h.