122 #include "TRestRawToDetectorSignalProcess.h"
143 SetSectionName(this->ClassName());
144 SetLibraryVersion(LIBRARY_VERSION);
146 fInputSignalEvent =
nullptr;
156 Int_t rejectedSignal = 0;
158 if (fZeroSuppression) {
159 fInputSignalEvent->SetBaseLineRange(fBaseLineRange);
160 fInputSignalEvent->SetRange(fIntegralRange);
163 for (
int n = 0; n < fInputSignalEvent->GetNumberOfSignals(); n++) {
166 signal.SetID(rawSignal->
GetID());
168 if (fZeroSuppression) {
169 ZeroSuppresion(rawSignal, signal);
172 if (rawSignal->
GetData(p) > fThreshold) {
173 signal.NewPoint(fTriggerStarts + fSampling * p, fGain * rawSignal->
GetData(p));
178 if (signal.GetNumberOfPoints() > 0) {
179 fOutputSignalEvent->AddSignal(signal);
185 SetObservableValue(
"NSignalsRejected", rejectedSignal);
187 if (fOutputSignalEvent->GetNumberOfSignals() <= 0) {
191 return fOutputSignalEvent;
196 fNPointsOverThreshold, 512);
199 for (
unsigned int n = 0; n < pOver.size(); n++) {
201 signal.NewPoint(fTriggerStarts + fSampling * j, fGain * rawSignal->
GetData(j));
A base class for any REST event.
An event container for time rawdata signals with fixed length.
It defines a Short_t array with a physical parameter that evolves in time using a fixed time bin.
Int_t GetID() const
Returns the value of signal ID.
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 thr...
std::vector< Int_t > GetPointsOverThreshold() const
Returns a std::vector containing the indexes of data points over threshold.
Double_t GetData(Int_t n) const
It returns the data value of point n including baseline correction.
Int_t GetNumberOfPoints() const
Returns the actual number of points, or size of the signal.
A process to convert a TRestRawSignalEvent into a TRestDetectorSignalEvent.
TRestRawToDetectorSignalProcess()
Default constructor.
void Initialize() override
Function to initialize input/output event members and define the section name.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
~TRestRawToDetectorSignalProcess()
Default destructor.