-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of TRestRawSignalRecoverSaturationProcess (#147)
* implementation of process to recover saturated signals * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add parameters for better fitting * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add documentation to the class * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix doc images and improve documentation of the class * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix maxPeakBin and maxValue when processing a non saturated signal * update fit parameter names and improve debug output * add second estimation of width * improve first estimation of parameters * wrapp initPointsOverThreshold parameters into a TVector3 * remove useless debug messages * improve doc * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix doc examples * fix parameter doc --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e8b3ef8
commit 12d3311
Showing
6 changed files
with
527 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/************************************************************************* | ||
* This file is part of the REST software framework. * | ||
* * | ||
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) * | ||
* For more information see http://gifna.unizar.es/trex * | ||
* * | ||
* REST is free software: you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation, either version 3 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* REST is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have a copy of the GNU General Public License along with * | ||
* REST in $REST_PATH/LICENSE. * | ||
* If not, see http://www.gnu.org/licenses/. * | ||
* For the list of contributors see $REST_PATH/CREDITS. * | ||
*************************************************************************/ | ||
|
||
#ifndef RESTProc_TRestRawSignalRecoverSaturationProcess | ||
#define RESTProc_TRestRawSignalRecoverSaturationProcess | ||
|
||
#include "TRestEventProcess.h" | ||
#include "TRestRawSignalEvent.h" | ||
|
||
/// This class recovers the saturated signals in a TRestRawSignalEvent using a fit to the AGET pulse. | ||
class TRestRawSignalRecoverSaturationProcess : public TRestEventProcess { | ||
private: | ||
/// A pointer to the specific TRestRawSignalEvent input event | ||
TRestRawSignalEvent* fAnaEvent; //! | ||
|
||
void Initialize() override; | ||
|
||
/// Minimum number of saturated bins to consider a signal as saturated | ||
Size_t fMinSaturatedBins; //< | ||
|
||
/// Process all signals in the event | ||
Bool_t fProcessAllSignals; //< | ||
|
||
/// Number of bins to consider if the signal is not saturated | ||
Size_t fNBinsIfNotSaturated; //< | ||
|
||
/// Minimum value to consider a signal as saturated | ||
Short_t fMinSaturationValue; //< | ||
|
||
/// Range of bins to calculate the baseline and fix that parameter in the fit | ||
TVector2 fBaseLineRange; //< | ||
|
||
/// Range of bins to fit the signal | ||
TVector2 fFitRange; //< | ||
|
||
/// Wrapper of (pointThreshold, signalThreshold, pointsOverThreshold) params | ||
TVector3 fInitPointsOverThreshold; //< | ||
|
||
/// Canvas to draw the signals | ||
TCanvas* fC; //! | ||
|
||
public: | ||
RESTValue GetInputEvent() const override { return fAnaEvent; } | ||
RESTValue GetOutputEvent() const override { return fAnaEvent; } | ||
|
||
void InitProcess() override; | ||
|
||
const char* GetProcessName() const override { return "RawSignalRecoverSaturationProcess"; } | ||
|
||
TRestEvent* ProcessEvent(TRestEvent* eventInput) override; | ||
|
||
void EndProcess() override; | ||
|
||
/// It prints out the process parameters stored in the metadata structure | ||
void PrintMetadata() override { | ||
BeginPrintProcess(); | ||
|
||
// Write here how to print the added process members and parameters. | ||
std::string strProcessAllSignals = fProcessAllSignals ? "true" : "false"; | ||
RESTMetadata << "MinSaturatedBins: " << fMinSaturatedBins << RESTendl; | ||
RESTMetadata << "ProcessAllSignals: " << strProcessAllSignals << RESTendl; | ||
RESTMetadata << "NBinsIfNotSaturated: " << fNBinsIfNotSaturated << RESTendl; | ||
RESTMetadata << "MinSaturationValue: " << fMinSaturationValue << RESTendl; | ||
RESTMetadata << "BaseLineRange: (" << fBaseLineRange.X() << ", " << fBaseLineRange.Y() << ")" | ||
<< RESTendl; | ||
RESTMetadata << "FitRange: (" << fFitRange.X() << ", " << fFitRange.Y() << ")" << RESTendl; | ||
RESTMetadata << "InitPointsOverThreshold: (" << fInitPointsOverThreshold.X() << ", " | ||
<< fInitPointsOverThreshold.Y() << ", " << fInitPointsOverThreshold.Z() << ")" | ||
<< RESTendl; | ||
|
||
EndPrintProcess(); | ||
} | ||
|
||
TRestRawSignalRecoverSaturationProcess(); | ||
~TRestRawSignalRecoverSaturationProcess(); | ||
|
||
// ROOT class definition helper. Increase the number in it every time | ||
// you add/rename/remove the process parameters | ||
ClassDefOverride(TRestRawSignalRecoverSaturationProcess, 1); | ||
}; | ||
#endif |
Oops, something went wrong.