23 #ifndef RestDAQ_TRestRawSignalEvent
24 #define RestDAQ_TRestRawSignalEvent
29 #include <TRestEvent.h>
30 #include <TRestRawReadoutMetadata.h>
37 #include "TRestRawSignal.h"
47 Double_t fAuxiliar = 0;
49 TVector2 fBaseLineRange = TVector2(-1, -1);
50 TVector2 fRange = TVector2(-1, -1);
52 std::vector<TRestRawSignal> fSignal;
58 Bool_t signalIDExists(Int_t sID) {
59 if (GetSignalIndex(sID) == -1)
return false;
63 std::vector<TRestRawSignal> GetSignals()
const {
return fSignal; }
68 void RemoveSignalWithId(Int_t sId);
72 void SetTailPoints(Int_t p) {
73 for (
int n = 0; n < GetNumberOfSignals(); n++) fSignal[n].SetTailPoints(p);
77 void SetAuxiliar(Double_t aux);
78 auto GetAuxiliar() {
return fAuxiliar; }
89 fBaseLineRange = TVector2(from, to);
90 for (
int n = 0; n < GetNumberOfSignals(); n++) fSignal[n].CalculateBaseLine(from, to, option);
93 void SetRange(TVector2 range) { SetRange(range.X(), range.Y()); }
95 void SetRange(Int_t from, Int_t to) {
96 fRange = TVector2(from, to);
97 for (
int n = 0; n < GetNumberOfSignals(); n++) fSignal[n].SetRange(fRange);
101 inline Int_t GetNumberOfSignals()
const {
return fSignal.size(); }
104 void PrintSignalIds() {
105 for (
int n = 0; n < GetNumberOfSignals(); n++) {
106 if (n > 0) std::cout <<
" , ";
109 std::cout << std::endl;
112 std::vector<int> GetSignalIds() {
113 std::vector<int> ids;
114 for (
int n = 0; n < GetNumberOfSignals(); n++) ids.push_back(GetSignal(n)->
GetSignalID());
118 Bool_t isBaseLineInitialized() {
120 for (
int n = 0; n < GetNumberOfSignals(); n++)
121 if (fSignal[n].isBaseLineInitialized())
return true;
126 Int_t index = GetSignalIndex(sid);
127 if (index < 0)
return nullptr;
129 return &fSignal[index];
138 Int_t GetLowestWidth(Double_t minPeakAmplitude = 0);
139 Double_t GetLowAverageWidth(Int_t nSignals = 5, Double_t minPeakAmplitude = 0);
140 Double_t GetAverageWidth(Double_t minPeakAmplitude = 0);
142 Int_t GetSignalIndex(Int_t signalID);
144 Double_t GetBaseLineAverage();
145 Double_t GetBaseLineSigmaAverage();
147 Double_t GetIntegral();
150 Double_t GetSlopeIntegral();
151 Double_t GetRiseSlope();
152 Double_t GetRiseTime();
153 Double_t GetTripleMaxIntegral();
155 Double_t GetMaxValue();
156 Double_t GetMinValue();
157 Double_t GetMinTime();
158 Double_t GetMaxTime();
164 TPad*
DrawEvent(
const TString& option =
"");
165 void DrawSignals(TPad* pad,
const std::vector<Int_t>& signals);
166 TPad*
DrawSignal(Int_t signalID,
const TString& option =
"");
A base class for any REST event.
An event container for time rawdata signals with fixed length.
void DrawSignals(TPad *pad, const std::vector< Int_t > &signals)
This method draws selected signal IDs, given by the vector passed as reference.
TPad * DrawEvent(const TString &option="")
This method draws current raw signal event in a TPad.
void SetBaseLineRange(Int_t from, Int_t to, std::string option="")
TPad * DrawSignal(Int_t signalID, const TString &option="")
This method draws selected signalID by ID, with baseline range and points over threshold highlighted.
void SetBaseLineRange(TVector2 blRange, std::string option="")
void AddChargeToSignal(Int_t sgnlID, Int_t bin, Short_t value)
Double_t GetThresholdIntegral()
It defines a Short_t array with a physical parameter that evolves in time using a fixed time bin.
Int_t GetSignalID() const
Returns the value of signal ID.