Skip to content
Open
Show file tree
Hide file tree
Changes from 14 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
22 changes: 9 additions & 13 deletions inc/TRestRawSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ class TRestRawSignal : public TObject {
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 @@ -56,7 +52,7 @@ class TRestRawSignal : public TObject {
TGraph* fGraph; //!

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to have fPointsOverThreshold in correspondence with TRestRawSignal's data structure. x should be time bin(int) and y should be amplitude(unsigned short). Therefore the returned type should be std::vector<std::pair<Int_t, UShort_t> >

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I didn't notice this, I also think it would make more sense <Int_t, UShort_t>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the code fPointsOverThreshold corresponds to the points with the baseline substracted, so for me it doesn't make sense to return std::vector<std::pair<Int_t, Short_t> > since we will be loosing precision.


/// It stores the integral value obtained from the points identified over threshold.
Double_t fThresholdIntegral = -1; //!
Expand All @@ -80,13 +76,15 @@ class TRestRawSignal : public TObject {
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 std::vector<std::pair<Float_t, Float_t> > 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 @@ -111,12 +109,16 @@ class TRestRawSignal : public TObject {
/// 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() {
if (fBaseLineSigma == 0 && fBaseLine == 0) return false;
return true;
}

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

Double_t GetData(Int_t n) const;

Double_t GetRawData(Int_t n) const;
Expand Down Expand Up @@ -187,16 +189,10 @@ class TRestRawSignal : public TObject {

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