Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving to generic methods inside TRestRawSignal #100

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions inc/TRestRawSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ class TRestRawSignal {
private:
void CalculateThresholdIntegral();

void CalculateBaseLineSigmaSD(Int_t startBin, Int_t endBin);

void CalculateBaseLineSigmaIQR(Int_t startBin, Int_t endBin);

std::vector<Float_t> GetSignalSmoothed_ExcludeOutliers(Int_t averagingPoints);

protected:
Expand All @@ -60,7 +56,7 @@ class TRestRawSignal {
TGraph* fGraph; //!

/// A std::vector containing the index of points that are identified over threshold.
std::vector<Int_t> fPointsOverThreshold; //!
std::vector<std::pair<Int_t, Float_t> > fPointsOverThreshold; //!

/// It stores the integral value obtained from the points identified over threshold.
Double_t fThresholdIntegral = -1; //!
Expand All @@ -84,13 +80,13 @@ class TRestRawSignal {
inline Int_t GetSignalID() const { return fSignalID; }

/// Returns the value of signal ID
inline Int_t GetID() const { return fSignalID; }
inline Int_t GetID() const { return GetSignalID(); }

/// Returns the actual number of points, or size of the signal
inline Int_t GetNumberOfPoints() const { return fSignalData.size(); }

/// Returns a std::vector containing the indexes of data points over threshold
inline std::vector<Int_t> GetPointsOverThreshold() const { return fPointsOverThreshold; }
inline auto GetPointsOverThreshold() const { return fPointsOverThreshold; }

/// Returns the maximum value found in the data points. It includes baseline correction
inline Double_t GetMaxValue() { return GetMaxPeakValue(); }
Expand All @@ -115,9 +111,13 @@ class TRestRawSignal {
/// Returns the range defined by user
inline TVector2 GetRange() const { return fRange; }

inline std::vector<Short_t> GetSignalData() const { return fSignalData; }

/// Returns false if the baseline and its baseline fluctuation was not initialized.
inline Bool_t isBaseLineInitialized() const { return !(fBaseLineSigma == 0 && fBaseLine == 0); }

std::vector<Float_t> GetData() const;

Double_t GetData(Int_t n) const;

Double_t GetRawData(Int_t n) const;
Expand Down Expand Up @@ -188,16 +188,10 @@ class TRestRawSignal {

void GetDifferentialSignal(TRestRawSignal* diffSignal, Int_t smearPoints);

void GetSignalSmoothed(TRestRawSignal* smoothedSignal, Int_t averagingPoints);

std::vector<Float_t> GetSignalSmoothed(Int_t averagingPoints, std::string option = "");

void GetWhiteNoiseSignal(TRestRawSignal* noiseSignal, Double_t noiseLevel = 1.);

void CalculateBaseLineMean(Int_t startBin, Int_t endBin);

void CalculateBaseLineMedian(Int_t startBin, Int_t endBin);

void CalculateBaseLine(Int_t startBin, Int_t endBin, const std::string& option = "");

void GetBaseLineCorrected(TRestRawSignal* smoothedSignal, Int_t averagingPoints);
Expand Down
Loading