115 #include "TRestRawSignalIdTaggingProcess.h"
136 SetSectionName(this->ClassName());
137 SetLibraryVersion(LIBRARY_VERSION);
139 fSignalEvent =
nullptr;
154 RESTDebug <<
"fPointThreshold: " << fPointThreshold << RESTendl;
155 RESTDebug <<
"fSignalThreshold: " << fSignalThreshold << RESTendl;
156 RESTDebug <<
"fPointsOverThreshold: " << fPointsOverThreshold << RESTendl;
157 RESTDebug <<
"fBaseLineRange.X(): " << fBaseLineRange.X() << RESTendl;
158 RESTDebug <<
"fBaseLineRange.Y(): " << fBaseLineRange.Y() << RESTendl;
160 if (fPointThreshold != -1 && fSignalThreshold != -1 && fPointsOverThreshold != -1 &&
161 fBaseLineRange.X() != -1 && fBaseLineRange.Y() != -1) {
162 fGoodSignalsOnly =
true;
166 TiXmlElement* tagDefinition = GetElement(
"tag");
167 while (tagDefinition) {
168 fTagNames.push_back(GetFieldValue(
"name", tagDefinition));
169 fIdRanges.push_back(Get2DVectorParameterWithUnits(
"ids", tagDefinition));
171 tagDefinition = GetNextElement(tagDefinition);
181 std::vector<int> tagCode;
183 for (
int j = 0; j < fSignalEvent->GetNumberOfSignals(); j++) {
186 if (fGoodSignalsOnly ==
true) {
189 fPointsOverThreshold);
192 if (fGoodSignalsOnly ==
false ||
194 for (
unsigned int n = 0; n < fIdRanges.size(); n++) {
195 if (singleSignal->
GetID() >= fIdRanges[n].X() && singleSignal->
GetID() <= fIdRanges[n].Y()) {
197 if (std::find(tagCode.begin(), tagCode.end(), n + 1) == tagCode.end()) {
198 tagCode.push_back(n + 1);
204 std::sort(tagCode.begin(), tagCode.end());
207 for (
auto d : tagCode) {
208 result = result * 10 + d;
210 SetObservableValue(
"tagId", result);
213 if (ApplyCut())
return nullptr;
virtual void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
A base class for any REST event.
An event container for time rawdata signals with fixed length.
An analysis process helping to assign tags to user defined ranges of signal ids.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
~TRestRawSignalIdTaggingProcess()
Default destructor.
void InitFromConfigFile() override
Process initialization.
void InitProcess() override
Process initialization.
void Initialize() override
Function to initialize input/output event members and define the section name.
TRestRawSignalIdTaggingProcess()
Default constructor.
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 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 ...
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.