StRoot
1
|
Public Member Functions | |
PeakAna () | |
Default constructor that always creates a new TGraph. | |
PeakAna (int size, double *xvals, double *yvals) | |
Constructor using array of x and y values with known size. | |
PeakAna (TGraph *Sig) | |
Constructor with a known TGraph. | |
PeakAna (TH1 *hist) | |
Constructor with a histogram, histogram gets converted to graph object. | |
PeakAna (const PeakAna &OldAna, TGraph *graph=0) | |
Copy constructor can be called with a new graph. | |
PeakAna & | operator= (const PeakAna &rhs) |
Assignment operator doesn't clone graph. | |
virtual | ~PeakAna () |
Destructor. | |
virtual void | Copy (TObject &obj) const |
Internal method use Clone instead. | |
virtual TObject * | Clone (const char *newname) const |
Clones internal graph as opposed to just copying the pointer. | |
virtual void | AddPeakStats (TPaveText *pave, const char *opt="") |
Add peak information to a "statistics" box. More... | |
void | ConvertPeaksToGraph () |
same as ConvertPeaksToGraph() but creates a new graph that replaces old one | |
PeakAna | ConvertPeaksToAna () |
same as ConvertPeaksToAna() but returns new PeakAna with same settings without modifying current one | |
virtual void | GetPossiblePeaks () |
Finds all possible Peaks in signal with some criteria. More... | |
virtual Int_t | SearchForPeak (const std::vector< PeakWindow > &PossiblePeaks) |
searches a vector of PeakWindow's for a specific peak based on input search criteria More... | |
Int_t | SearchForPeak (const std::vector< PeakWindow > &PossiblePeaks, const PeakWindow &search) |
same as SearchForPeak() but and set search criteria using PeakWindow | |
Int_t | SearchForPeak (const std::vector< PeakWindow > &PossiblePeaks, Double_t peak, Double_t width) |
same as SearchForPeak() and set search window by peak location and width | |
virtual Int_t | AnalyzeForPeak () |
Main analysis method for finding peaks. More... | |
virtual Int_t | AnalyzeForPeak (Double_t peak, Double_t width) |
virtual Int_t | AnalyzeForNoisyPeak () |
virtual void | MergeByProbability (std::vector< PeakWindow > &newpeaks) const |
Merges peaks in mPeaks using peak probability parameters. More... | |
virtual void | MergeByChirality (std::vector< PeakWindow > &newpeaks) const |
virtual short | MergeLeftOrRight (UInt_t index) const |
Double_t | Baseline () const |
Double_t | BaselineSigma () const |
Double_t | BaselineSigmaScale () const |
Double_t | MinX () const |
Double_t | MinY () const |
Double_t | MaxX () const |
Double_t | MaxY () const |
Double_t | SearchPeak () const |
Double_t | SearchWidth () const |
Double_t | TunnelScale () const |
Double_t | TunnelSigma () const |
Double_t | TunnelThreshold () const |
virtual void | Draw (Option_t *opt="") |
Draw method for PeakAna. More... | |
virtual void | Paint (Option_t *opt="") |
PeakAnaPainter * | GetPainter (Option_t *opt="") |
void | ForceInternal () |
PeakAna * | GausFilter (Int_t sizeavgs=0, bool copy=true) |
Apply a Gaussian filter to the data. More... | |
bool | GoodWindow () |
Check if found peak is inside mXRangeMin, mYRangeMin, mXRangeMax, mYRangeMax and has logical values. | |
virtual TGraph * | GetData () const |
UInt_t | GetDebug () const |
const PeakWindow & | GetPeak (UInt_t peakidx) const |
PeakWindow & | GetPeak (UInt_t peakidx) |
UInt_t | GetFilter () const |
Int_t | GetFilterScale () const |
Int_t | FoundPeakIndex () const |
virtual void | GetXYMax (Double_t xmin, Double_t xmax) |
Finds and sets mMaxX and mMaxY. | |
Double_t | MaxXval () |
Double_t | MaxYval () |
PeakAna * | MeanFilter (Int_t sizeavgs=0, bool copy=true) |
Apply a Mean filter to the data. More... | |
int | NPeaks () const |
bool | ValidPeakIdx () const |
Double_t | PeakStart () |
Found Signal starting x-value. | |
Double_t | PeakEnd () |
Found Signal ending x-value. | |
Double_t | PeakX () |
x-value of found signal peak | |
Double_t | PeakY () |
y-value of found signal peak | |
void | PeakXY (Double_t &xval, Double_t &yval) |
get peak x, and y value directly by reference | |
bool | PeakTunnel (const PeakWindow &window) const |
test whether a given peak satisifies peak tunnel parameters More... | |
Double_t | PeakProb (const PeakWindow &window, Double_t scale, Double_t sigma) const |
compute a given PeakWindow probability using internal graph More... | |
virtual void | Print (Option_t *opt="") const |
Print peak information. | |
void | ResetPeak () |
Resets values associated with peak finding. | |
void | SetDebug (UInt_t level) |
virtual void | SetData (TGraph *graph) |
sets new data for PeakAna More... | |
virtual void | SetData (TH1 *hist, UInt_t numavgs=1) |
sets new data for PeakAna using histogram object More... | |
void | SetBaseline (Double_t base, Double_t sigma) |
void | SetBaselineSigmaScale (Double_t scale) |
void | SetContinuity (Double_t val) |
void | SetFilter (UInt_t filter, Int_t scale, Double_t sigma=0) |
Set the filter to use when peak finding. More... | |
void | SetRange (Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax) |
Sets the absolute range of the data. More... | |
void | SetSearchWindow (Double_t peak, Double_t width) |
Sets peak search parameters. More... | |
void | SetTunnelScale (Double_t value) |
void | SetTunnelSigma (Double_t value) |
void | SetTunnelPars (Double_t scale, Double_t sigma) |
void | SetTunnelThreshold (Double_t value) |
Double_t | ChiralityPeakScale () const |
Double_t | ChiralityScale () const |
Double_t | ChiralityProbScale () const |
Double_t | ChiralityThreshold () const |
void | SetChiralityPeakScale (Double_t v) |
void | SetChiralityScale (Double_t v) |
void | SetChiralityProbScale (Double_t v) |
void | SetChiralityThreshold (Double_t v) |
void | SetPeak (const Int_t peakpoint, const Double_t peakx) |
Overwrite peak location in #mFoundpeak. WARNING doesn't set start and end values nor overwrite mComputedIndex. | |
void | SetWindow (const Int_t start, const Int_t end) |
Overwrite peak start and end values in mFoundPeak. WARNING doesn't set peak values nor overwrite mComputedIndex. | |
void | SetWindow (PeakWindow window) |
Overwrite mFoundPeak with a different PeakWindow. WARNING doesn't overwrite mComputedIndex. | |
Color_t | GetLineColor () const |
Style_t | GetLineStyle () const |
Width_t | GetLineWidth () const |
Color_t | GetFillColor () const |
Style_t | GetFillStyle () const |
Color_t | GetMarkerColor () const |
Size_t | GetMarkerSize () const |
Style_t | GetMarkerStyle () const |
void | SetLineColor (Color_t color) |
void | SetLineColorAlpha (Color_t color, Float_t alpha) |
void | SetLineStyle (Style_t style) |
void | SetLineWidth (Width_t width) |
void | SetFillColor (Color_t color) |
void | SetFillColorAlpha (Color_t color, Float_t alpha) |
void | SetFillStyle (Style_t style) |
void | SetMarkerColor (Color_t color=1) |
void | SetMarkerColorAlpha (Color_t color, Float_t alpha) |
void | SetMarkerSize (Size_t size=1) |
void | SetMarkerStyle (Style_t style=1) |
Color_t | GetBaseLineColor () const |
Style_t | GetBaseLineStyle () const |
Width_t | GetBaseLineWidth () const |
Color_t | GetHitLineColor () const |
Style_t | GetHitLineStyle () const |
Width_t | GetHitLineWidth () const |
void | SetBaseLineColor (Color_t color) |
void | SetBaseLineColorAlpha (Color_t color, Float_t alpha) |
void | SetBaseLineStyle (Style_t style) |
void | SetBaseLineWidth (Width_t width) |
void | SetHitLineColor (Color_t color) |
void | SetHitLineColorAlpha (Color_t color, Float_t alpha) |
void | SetHitLineStyle (Style_t style) |
void | SetHitLineWidth (Width_t width) |
Color_t | GetPeakLineColorS (UInt_t peakidx) const |
Color_t | GetPeakLineColorE (UInt_t peakidx) const |
Style_t | GetPeakStyleS (UInt_t peakidx) const |
Style_t | GetPeakStyleE (UInt_t peakidx) const |
Width_t | GetPeakWidthS (UInt_t peakidx) const |
Width_t | GetPeakWidthE (UInt_t peakidx) const |
Color_t | GetFoundPeakLineColorS () const |
Color_t | GetFoundPeakLineColorE () const |
Style_t | GetFoundPeakStyleS () const |
Style_t | GetFoundPeakStyleE () const |
Width_t | GetFoundPeakWidthS () const |
Width_t | GetFoundPeakWidthE () const |
void | SetFoundPeakLineColorS (Color_t s_color) |
void | SetFoundPeakLineColorE (Color_t e_color) |
void | SetFoundPeakLineColor (Color_t s_color, Color_t e_color) |
void | SetFoundPeakStyleS (Style_t s_style) |
void | SetFoundPeakStyleE (Style_t e_style) |
void | SetFoundPeakStyle (Style_t s_style, Style_t e_style) |
void | SetFoundPeakWidthS (Width_t s_width) |
void | SetFoundPeakWidthE (Width_t e_width) |
void | SetFoundPeakWidth (Width_t s_width, Width_t e_width) |
void | SetPeakLineColorS (UInt_t peakidx, Color_t s_color) |
void | SetPeakLineColorE (UInt_t peakidx, Color_t e_color) |
void | SetPeakLineColor (UInt_t peakidx, Color_t s_color, Color_t e_color) |
void | SetPeakLineColorAlphaS (UInt_t peakidx, Color_t s_color, Float_t s_alpha) |
void | SetPeakLineColorAlphaE (UInt_t peakidx, Color_t e_color, Float_t e_alpha) |
void | SetPeakLineColorAlpha (UInt_t peakidx, Color_t s_color, Float_t s_alpha, Color_t e_color, Float_t e_alpha) |
void | SetPeakLineStyleS (UInt_t peakidx, Style_t s_style) |
void | SetPeakLineStyleE (UInt_t peakidx, Style_t e_style) |
void | SetPeakLineStyle (UInt_t peakidx, Style_t s_style, Style_t e_style) |
void | SetPeakLineWidthS (UInt_t peakidx, Width_t s_width) |
void | SetPeakLineWidthE (UInt_t peakidx, Width_t e_width) |
void | SetPeakLineWidth (UInt_t peakidx, Width_t s_width, Width_t e_width) |
void | SetAllPeakLineColor (Color_t s_color, Color_t e_color) |
void | SetAllPeakLineStyle (Style_t s_style, Color_t e_style) |
void | SetAllPeakLineWidth (Width_t s_width, Width_t e_width) |
Static Public Member Functions | |
static TGraph * | ConvertHistToGraph (TH1 *graph, UInt_t numavgs=1) |
Converts a histogram to a graph. More... | |
static TGraph * | ConvertPeaksToGraph (const std::vector< PeakWindow > &Peaks) |
Convert each peak position into a TGraph. More... | |
static PeakAna | ConvertPeaksToAna (const PeakAna &Ana) |
same as ConvertPeaksToGraph() but returns a new PeakAna with same settings without modifying old one | |
Protected Member Functions | |
void | Init () |
Initialize internal varaibles. | |
virtual bool | MergeLeft (Double_t leftchir, Double_t thischir, Double_t rightchir) const |
virtual std::vector< std::pair < int, int > > | MergeIndices (std::vector< short > &vec) const |
Static Protected Member Functions | |
static double * | GaussianMatrix2D (int rx, double sx=0, int ry=0, double sy=0, bool kNorm=true) |
Generates up to a 2D matrix of Gaussian weights. More... | |
Protected Attributes | |
Int_t | mComputedIndex |
Index in mPeaks where a peak was found. More... | |
std::vector< PeakWindow > | mPeaks |
vector that stores all the found peaks in the data | |
PeakWindow | mFoundPeak |
Copy of found peak in mPeaks. More... | |
PeakWindow | mSearch |
Variable that defines peak search parameters. More... | |
Double_t | mBaseline |
Minimum threshold to search for a peak. More... | |
Double_t | mBaselineSigma |
Error on PeakAna::mBaseline. More... | |
Double_t | mBaselineSigmaScale |
scale on PeakAna::mBaselineSigma to determine final threshold More... | |
Double_t | mMaxX |
x-value where global maximum occurs | |
Double_t | mMaxY |
y-value of global maximum | |
Double_t | mDeltaX |
graph known delta-x More... | |
TGraph * | mG_Data |
TGraph that stores the x,y data. More... | |
Double_t | mXRangeMin |
Absolute possible x-value minimum of data. | |
Double_t | mXRangeMax |
Absolute possible x-value maximum of data. | |
Double_t | mYRangeMin |
Absolute possible y-value minimum of data. | |
Double_t | mYRangeMax |
Absolute possible y-value maximum of data. | |
Double_t | mTunnelScale |
Scale on exponential for determining tunneling probability (default is 1) see #PeakWindow::PeakTunelProb() | |
Double_t | mTunnelSigma |
Sigma for Gaussian for determining tunneling probability (default is 1) see #PeakWindow::PeakTunelProb() | |
Double_t | mTunnelThreshold |
Cutoff probability for peak tunneling method. If threshold less than 0 (default) then skip peak tunnel method, see PeakTunnel() | |
Double_t | mChiralityPeakScale |
Double_t | mChiralityScale |
Double_t | mChiralityProbScale |
Double_t | mChiralityThreshold |
UInt_t | mFilter |
Filter to use in AnalyzeForPeak() More... | |
Double_t * | mFilterWeights |
Array of weights to use in filtering, size is 2*mFilterScale+1. | |
Int_t | mFilterScale |
How many points to group together when applying filter. | |
PeakAnaPainter * | mPainter |
Painter for this class. | |
TString | mOption |
Drawing option. | |
|
virtual |
Add peak information to a "statistics" box.
"statistics" box can be a TPaveText or a TPaveStats since the latter inherits from the former.
pave | TPaveText to write peak information |
opt | options for what information to add to stats box "" (No option) means just show found peak "a" means show all found peaks "d" means show all detail information for the peak |
Definition at line 1010 of file PeakAna.cxx.
References AnalyzeForPeak(), GetData(), GetPeak(), mComputedIndex, mPeaks, NPeaks(), TunnelScale(), and TunnelSigma().
Referenced by PeakAnaPainter::PaintStats().
|
virtual |
Main analysis method for finding peaks.
First filters the data if the mFilter is set, then calls GetPossiblePeaks(), then calls SearchForPeak().
Reimplemented in StFcsPulseAna.
Definition at line 153 of file PeakAna.cxx.
References GausFilter(), GetPossiblePeaks(), mComputedIndex, MeanFilter(), mFilter, mFilterScale, mFoundPeak, mPeaks, mXRangeMax, ResetPeak(), SearchForPeak(), and PeakWindow::SetWindow().
Referenced by AddPeakStats(), StFcsPulseAna::AnalyzeForPeak(), GoodWindow(), PeakAnaPainter::PaintFoundMarker(), PeakAnaPainter::PaintFoundPeakRange(), PeakAnaPainter::PaintPeakMarkers(), PeakAnaPainter::PaintPeakRanges(), PeakEnd(), PeakStart(), PeakX(), PeakXY(), and PeakY().
|
inline |
Definition at line 178 of file PeakAna.h.
References mBaseline.
Referenced by GausFilter(), StFcsPulseAna::GausFit(), GetPossiblePeaks(), StFcsPulseAna::MBFit(), MeanFilter(), PeakAnaPainter::PaintBaselines(), PeakAnaPainter::PaintPeakRanges(), StFcsWaveformFitMaker::PedFitPulseFit(), StFcsPulseAna::PulseFit(), StFcsWaveformFitMaker::PulseFitAll(), StFcsPulseAna::SetFitPars(), StFcsPulseAna::SignalMBPars(), and StFcsPulseAna::Sum().
|
inline |
Definition at line 179 of file PeakAna.h.
References mBaselineSigma.
Referenced by GetPossiblePeaks(), PeakAnaPainter::PaintBaselines(), PeakAnaPainter::PaintPeakRanges(), StFcsWaveformFitMaker::PedFitPulseFit(), and StFcsWaveformFitMaker::PulseFitAll().
|
inline |
Definition at line 180 of file PeakAna.h.
References mBaselineSigmaScale.
Referenced by GetPossiblePeaks(), PeakAnaPainter::PaintBaselines(), PeakAnaPainter::PaintPeakRanges(), and StFcsWaveformFitMaker::PulseFitAll().
|
static |
Converts a histogram to a graph.
Treats each bin in the histogram as a point in a TGraph and the bin content as the y-value. Also, can be used to do a running average over "numavgs" bins
graph | histogram to be converted to a graph |
numavgs | number of bins to average over when creating the graph (running average), 1 means no running average |
Definition at line 382 of file PeakAna.cxx.
|
static |
Convert each peak position into a TGraph.
The purpose of this function is to help with really noisy data where the "peaks" are really just noise. Essentially the idea is that each "peak" should actually be a point on a kind of "running average" in this way you capture the overall shape of the data without noise.
Peaks | vector of PeakWindows to convert to a TGraph |
Definition at line 401 of file PeakAna.cxx.
|
virtual |
Draw method for PeakAna.
Options are semicolon seperated list with graph options first then the peak qa drawing options and finally the stats box drawing option.
peak qa drawing options(case insensitive):
Example1: "APL;FB;S" means draw graph using option "APL", draw only found peak qa and baselines, and create a stats box showing only basic information about the found peak. Example2: ";A;AD" means don't draw graph but draw all peaks and put detailed information of all peaks in a stats box Example3: "PL;A" means draw graph with option "PL" and draw all peaks but don't draw a stats box
Definition at line 984 of file PeakAna.cxx.
Referenced by StFcsWaveformFitMaker::drawFitter().
|
inline |
Definition at line 233 of file PeakAna.h.
References mComputedIndex.
Referenced by StFcsPulseAna::Clone(), Clone(), StFcsWaveformFitMaker::drawDualFit(), StFcsWaveformFitMaker::gausFit(), PeakAnaPainter::PaintFoundMarker(), PeakAnaPainter::PaintFoundPeakRange(), PeakAnaPainter::PaintPeakMarkers(), PeakAnaPainter::PaintPeakRanges(), StFcsWaveformFitMaker::PulseFit1(), StFcsWaveformFitMaker::PulseFit2(), StFcsWaveformFitMaker::PulseFitAll(), and StFcsPulseAna::SetFitPars().
PeakAna * PeakAna::GausFilter | ( | Int_t | sizeavgs = 0 , |
bool | copy = true |
||
) |
Apply a Gaussian filter to the data.
Applies a Gaussian filter by sampling "sizeavgs" and Gaussian weights stored in mFilterWeights.
sizeavgs | number of points to sample during filtering |
copy | if copy is true returns a new PeakAna with Gaussian filtered data, if false modifies "this" object |
Definition at line 518 of file PeakAna.cxx.
References Baseline(), GetData(), GetDebug(), mDeltaX, mFilterWeights, PeakAna(), ResetPeak(), and SetData().
Referenced by AnalyzeForPeak().
|
staticprotected |
Generates up to a 2D matrix of Gaussian weights.
Generates Gaussian weights to use in Gaussian filtering in a flattened 2D matrix.
rx | number of columns to generate weights |
sx | sigma of Gaussian to use in column weights |
ry | number of rows to generate weights |
sy | sigma of Gaussian to use in row weights |
kNorm | if true use a normalized Gaussian i.e. sum of all weights=1 |
Definition at line 1248 of file PeakAna.cxx.
Referenced by SetFilter().
|
inlinevirtual |
Reimplemented in StFcsPulseAna.
Definition at line 226 of file PeakAna.h.
References mG_Data.
Referenced by AddPeakStats(), Clone(), GausFilter(), MeanFilter(), operator=(), PeakAnaPainter::PaintFoundPeak(), PeakAnaPainter::PaintRawData(), PeakAna(), and PeakAnaPainter::ValidGraph().
|
inline |
Definition at line 227 of file PeakAna.h.
Referenced by StFcsPulseAna::AnalyzeForPedestal(), StFcsPulseAna::FindBaseline(), GausFilter(), StFcsPulseAna::GausFit(), GetPossiblePeaks(), StFcsPulseAna::MBFit(), MeanFilter(), PeakAnaPainter::PaintPeakRanges(), PeakTunnel(), StFcsPulseAna::PulseFit(), SearchForPeak(), and StFcsPulseAna::Sum().
|
inline |
|
inline |
|
inline |
Definition at line 228 of file PeakAna.h.
References mPeaks.
Referenced by AddPeakStats(), ConvertPeaksToAna(), StFcsWaveformFitMaker::drawDualFit(), StFcsWaveformFitMaker::gausFit(), StFcsWaveformFitMaker::NPeaksPrePost(), PeakAnaPainter::PaintFoundMarker(), PeakAnaPainter::PaintFoundPeakRange(), PeakAnaPainter::PaintPeakMarkers(), PeakAnaPainter::PaintPeakRanges(), StFcsWaveformFitMaker::PulseFit1(), StFcsWaveformFitMaker::PulseFit2(), StFcsWaveformFitMaker::PulseFitAll(), and StFcsPulseAna::SetFitPars().
|
inline |
|
virtual |
Finds all possible Peaks in signal with some criteria.
Uses a second derivative test to find all peaks in the data. Found peaks must be above the baseline, and the slope must change by mBaseline+mBaselineSigma*mBaselineSigmaScale. These values can be set with the appropriate function calls. Also, checks each peak's probability and merges peaks below some threshold if set.
Called by AnalyzeForPeak();
Definition at line 640 of file PeakAna.cxx.
References Baseline(), BaselineSigma(), BaselineSigmaScale(), PeakWindow::Combine(), GetDebug(), mDeltaX, PeakWindow::mEndX, PeakWindow::mEndY, mG_Data, PeakWindow::mP_Peak, mPeaks, PeakWindow::mPeakX, PeakWindow::mPeakY, PeakWindow::mStartX, PeakWindow::mStartY, mTunnelScale, mTunnelSigma, mXRangeMax, mXRangeMin, mYRangeMax, mYRangeMin, PeakTunnel(), PeakWindow::PeakTunnelProb(), PeakWindow::Print(), PeakWindow::Reset(), and PeakWindow::SetPeak().
Referenced by AnalyzeForPeak().
|
inline |
Definition at line 183 of file PeakAna.h.
References mXRangeMax.
Referenced by StFcsPulseAna::GausFit(), PeakAnaPainter::PaintBaselines(), and PeakAnaPainter::PaintFoundPeak().
|
inline |
Definition at line 235 of file PeakAna.h.
References GetXYMax(), mMaxX, mXRangeMax, and mXRangeMin.
|
inline |
Definition at line 184 of file PeakAna.h.
References mYRangeMax.
Referenced by StFcsPulseAna::GausFit(), PeakAnaPainter::PaintFoundPeakRange(), and PeakAnaPainter::PaintPeakRanges().
|
inline |
Definition at line 236 of file PeakAna.h.
References GetXYMax(), mMaxY, mXRangeMax, mXRangeMin, and mYRangeMin.
PeakAna * PeakAna::MeanFilter | ( | Int_t | sizeavgs = 0 , |
bool | copy = true |
||
) |
Apply a Mean filter to the data.
Applies a Mean filter by sampling "sizeavgs"
sizeavgs | number of points to sample during filtering |
copy | if copy is true returns a new PeakAna with Mean filtered data, if false modifies "this" object |
Definition at line 435 of file PeakAna.cxx.
References Baseline(), GetData(), GetDebug(), mDeltaX, mFilterWeights, PeakAna(), ResetPeak(), and SetData().
Referenced by AnalyzeForPeak().
|
virtual |
Merges peaks in mPeaks using peak probability parameters.
It is intended to be used after calling AnalyzeForPeak() since it doesn't do this by itself.
newpeaks | vector to store merged peaks |
Reimplemented in StFcsPulseAna.
Definition at line 792 of file PeakAna.cxx.
References mG_Data, mPeaks, mTunnelScale, mTunnelSigma, and PeakTunnel().
|
inline |
Definition at line 181 of file PeakAna.h.
References mXRangeMin.
Referenced by PeakAnaPainter::PaintBaselines().
|
inline |
Definition at line 182 of file PeakAna.h.
References mYRangeMin.
Referenced by PeakAnaPainter::PaintFoundPeakRange(), and PeakAnaPainter::PaintPeakRanges().
|
inline |
Definition at line 246 of file PeakAna.h.
References mPeaks.
Referenced by AddPeakStats(), ConvertPeaksToAna(), StFcsWaveformFitMaker::drawDualFit(), StFcsWaveformFitMaker::gausFit(), StFcsWaveformFitMaker::NPeaksPrePost(), PeakAnaPainter::PaintFoundMarker(), PeakAnaPainter::PaintFoundPeakRange(), PeakAnaPainter::PaintPeakMarkers(), PeakAnaPainter::PaintPeakRanges(), StFcsWaveformFitMaker::PulseFit1(), StFcsWaveformFitMaker::PulseFit2(), StFcsWaveformFitMaker::PulseFitAll(), and StFcsPulseAna::SetFitPars().
Double_t PeakAna::PeakProb | ( | const PeakWindow & | window, |
Double_t | scale, | ||
Double_t | sigma | ||
) | const |
compute a given PeakWindow probability using internal graph
Evaluates a given PeakWindow's prbability using internal graph and external parameters for the probability function
window | PeakWindow to compute probability |
scale | x-value scale for probability, see mTunnelScale |
sigma | y-value scale for probability, see mTunnelSigma |
Definition at line 635 of file PeakAna.cxx.
References mG_Data, and PeakWindow::PeakTunnelProb().
bool PeakAna::PeakTunnel | ( | const PeakWindow & | window | ) | const |
test whether a given peak satisifies peak tunnel parameters
Evaluates a PeakWindow's probability with function parameters stored in this class, and the internal graph object.
window | PeakWindow to be evaluated |
Definition at line 619 of file PeakAna.cxx.
References GetDebug(), mG_Data, mTunnelScale, mTunnelSigma, mTunnelThreshold, and PeakWindow::PeakTunnelProb().
Referenced by GetPossiblePeaks(), StFcsPulseAna::MergeByProbability(), and MergeByProbability().
|
virtual |
searches a vector of PeakWindow's for a specific peak based on input search criteria
Search criteria is stored in mSearch where the #mStartX is the peak location to search for and #mEndX is the tolerance (width) around which the peak should be found.
Called by AnalyzeForPeak() on mPeaks
PossiblePeaks | vector of peaks to search |
Definition at line 741 of file PeakAna.cxx.
References GetDebug(), PeakWindow::mEndX, mSearch, and PeakWindow::mStartX.
Referenced by StFcsPulseAna::AnalyzeForPeak(), AnalyzeForPeak(), and SearchForPeak().
|
inline |
Definition at line 185 of file PeakAna.h.
References mSearch, and PeakWindow::mStartX.
Referenced by Copy().
|
inline |
Definition at line 186 of file PeakAna.h.
References PeakWindow::mEndX, and mSearch.
Referenced by Copy().
void PeakAna::SetBaseline | ( | Double_t | base, |
Double_t | sigma | ||
) |
base | sets mBaseline |
sigma | sets mBaselineSigma |
Definition at line 330 of file PeakAna.cxx.
References mBaseline, and mBaselineSigma.
Referenced by StFcsWaveformFitMaker::InitFitter(), StFcsWaveformFitMaker::PulseFit1(), StFcsWaveformFitMaker::PulseFit2(), StFcsWaveformFitMaker::PulseFitAll(), and StFcsPulseAna::SetZS().
void PeakAna::SetBaselineSigmaScale | ( | Double_t | scale | ) |
scale | sets mBaselineSigmaScale |
Definition at line 337 of file PeakAna.cxx.
References mBaselineSigmaScale.
Referenced by StFcsWaveformFitMaker::InitFitter().
|
inline |
val | sets mDeltaX |
Definition at line 293 of file PeakAna.h.
References mDeltaX.
Referenced by StFcsWaveformFitMaker::InitFitter().
|
virtual |
sets new data for PeakAna
This will change mG_Data to the graph object passed in and calls ResetPeak(). Since graph is passed as external parameter this means this object should not delete it in the future so #mInternalSignal is set to false. If you want to change this behavior so this class deletes mG_Data call #ForceInternal()
graph | sets mG_Data |
Definition at line 302 of file PeakAna.cxx.
References mG_Data, and ResetPeak().
Referenced by ConvertPeaksToGraph(), GausFilter(), StFcsWaveformFitMaker::gausFit(), MeanFilter(), StFcsWaveformFitMaker::PedFitPulseFit(), StFcsWaveformFitMaker::PulseFit1(), StFcsWaveformFitMaker::PulseFit2(), StFcsWaveformFitMaker::PulseFitAll(), and StFcsPulseAna::ResetFinder().
|
virtual |
sets new data for PeakAna using histogram object
Works like SetData() but first calls ConvertHistToGraph() to convert a histogram to a graph. Since it creates a new graph #mInternalSignal is set to true so that the new graph gets deleted properly. The second argument can be used to do a running average over 'numavgs' number of bins.
hist | histogram to use as graph data |
numavgs | controls how many bins you want to average over when creating graph (1 means no average) |
Definition at line 311 of file PeakAna.cxx.
References ConvertHistToGraph(), mG_Data, and ResetPeak().
|
inline |
level | sets debug level #mDEBUG |
Definition at line 275 of file PeakAna.h.
Referenced by StFcsWaveformFitMaker::PedFitPulseFit(), StFcsWaveformFitMaker::PulseFit1(), StFcsWaveformFitMaker::PulseFit2(), and StFcsWaveformFitMaker::PulseFitAll().
void PeakAna::SetFilter | ( | UInt_t | filter, |
Int_t | scale, | ||
Double_t | sigma = 0 |
||
) |
Set the filter to use when peak finding.
There are two filters that can be used: a Mean filter which just averages over small samples of the data at a time, and a Gaussian filter which does a weighted average over the data samples, where the weights resemble a Gaussian function see GaussianMatrix2D(). The data sample averaging size is determined by mFilterScale. Note that a filter does not alter the size of the data.
filter | sets mFilter (0=none, 1=Mean, 2=Gaussian) |
scale | sets mFilterScale (number of points to group together when filtering) |
sigma | sigma of Gaussian to use to compute mFilterWeights (0 means sigma=mFilterScale/2) |
Definition at line 320 of file PeakAna.cxx.
References GaussianMatrix2D(), mFilter, mFilterScale, and mFilterWeights.
void PeakAna::SetRange | ( | Double_t | xmin, |
Double_t | ymin, | ||
Double_t | xmax, | ||
Double_t | ymax | ||
) |
Sets the absolute range of the data.
This sets the varaibles that tell the finder the range of x,y values possible for the data. This kind of range is needed for the algorithm to work properly since it only checks for peaks inside that range.
xmin | sets mXRangeMin |
ymin | sets mYRangeMin |
xmax | sets mXRangeMax |
ymax | sets mYRangeMax |
Definition at line 342 of file PeakAna.cxx.
References mXRangeMax, mXRangeMin, mYRangeMax, and mYRangeMin.
Referenced by StFcsWaveformFitMaker::InitFitter().
void PeakAna::SetSearchWindow | ( | Double_t | peak, |
Double_t | width | ||
) |
Sets peak search parameters.
This function is needed if you want to pick/check out a particular peak in the vector of #PeakWindows. It allows you to set the x-value of where you expect or want a peak and how far from that ideal position (width) you would like to check for a peak.
peak | x-location where you expect or want a peak |
width | how far in x you expect or want a peak from the ideal position of "peak" |
Definition at line 349 of file PeakAna.cxx.
References mSearch, ResetPeak(), and PeakWindow::SetWindow().
Referenced by StFcsWaveformFitMaker::InitFitter(), and SearchForPeak().
void PeakAna::SetTunnelPars | ( | Double_t | scale, |
Double_t | sigma | ||
) |
scale | sets mTunnelScale |
sigma | sets mTunnelSigma |
Definition at line 371 of file PeakAna.cxx.
References SetTunnelScale(), and SetTunnelSigma().
void PeakAna::SetTunnelScale | ( | Double_t | value | ) |
value | sets mTunnelScale |
Definition at line 363 of file PeakAna.cxx.
References mTunnelScale.
Referenced by SetTunnelPars(), and StFcsWaveformFitMaker::SetupDavidFitterMay2022().
void PeakAna::SetTunnelSigma | ( | Double_t | value | ) |
value | sets mTunnelSigma |
Definition at line 367 of file PeakAna.cxx.
References mTunnelSigma.
Referenced by SetTunnelPars(), and StFcsWaveformFitMaker::SetupDavidFitterMay2022().
void PeakAna::SetTunnelThreshold | ( | Double_t | value | ) |
value | sets mTunnelThreshold |
Definition at line 376 of file PeakAna.cxx.
References mTunnelThreshold.
Referenced by StFcsWaveformFitMaker::SetupDavidFitterMay2022().
|
inline |
Definition at line 187 of file PeakAna.h.
References mTunnelScale.
Referenced by AddPeakStats().
|
inline |
Definition at line 188 of file PeakAna.h.
References mTunnelSigma.
Referenced by AddPeakStats().
|
inline |
bool PeakAna::ValidPeakIdx | ( | ) | const |
Definition at line 204 of file PeakAna.cxx.
References mComputedIndex, and mPeaks.
Referenced by StFcsWaveformFitMaker::gausFit().
|
protected |
Minimum threshold to search for a peak.
Threshold for peak start and end values meaning y-value must exceed this variable to even check if it contains a peak. y-values below this variable will be ignored. This defines the noise level
Definition at line 456 of file PeakAna.h.
Referenced by StFcsPulseAna::AnalyzeForPedestal(), Baseline(), Copy(), StFcsPulseAna::FindBaseline(), Init(), StFcsPulseAna::Print(), Print(), StFcsPulseAna::ResetBaseline(), and SetBaseline().
|
protected |
This is used to characterize how much noise there is. It will be used with PeakAna::mBaseline to determine the threshold y-value for the data. It effectively sets the resolution of the finder. This is the standard deviation (sigma) around the baseline for ADCs (Also used as a threshold for the hit) error in baseline (fabs in case sigma is negative), //The sigma will determine the threshold value above baseline('value') i.e. the resolution of the finder
Definition at line 463 of file PeakAna.h.
Referenced by StFcsPulseAna::AnalyzeForPedestal(), BaselineSigma(), Copy(), StFcsPulseAna::FindBaseline(), Init(), StFcsPulseAna::Print(), Print(), StFcsPulseAna::ResetBaseline(), and SetBaseline().
|
protected |
scale on PeakAna::mBaselineSigma to determine final threshold
This is a multiplicative factor on PeakAna::mBaselineSigma that is used to determine the final thresholds on the y-value and slope to start the second derivative test in GetPossiblePeaks(). This "hit" threshold is PeakAna::mBaseline + PeakAna::mBaselineSigma * PeakAna::mBaselineSigmaScale. The default is 4. This threshold also applies to the first positive slope to prevent finding data with small changes as potential peaks.
Definition at line 469 of file PeakAna.h.
Referenced by BaselineSigmaScale(), Copy(), Init(), and SetBaselineSigmaScale().
|
protected |
Index in mPeaks where a peak was found.
This variables is negative if AnalyzeForPeak() was not called.
It is equal to size of mPeaks if AnalyzeForPeak() was called but no peak was found.
All other times it equals the index in mPeaks where the peak was found. The found peak is also stored in mFoundPeak.
This makes it easy to tell whether AnalyzeForPeak() was called and whether or not a peak was found.
Definition at line 436 of file PeakAna.h.
Referenced by AddPeakStats(), StFcsPulseAna::AnalyzeForPeak(), AnalyzeForPeak(), StFcsPulseAna::Clone(), Clone(), FoundPeakIndex(), GoodWindow(), Init(), PeakEnd(), PeakStart(), PeakX(), PeakXY(), PeakY(), ResetPeak(), and ValidPeakIdx().
|
protected |
graph known delta-x
Set this value if you know how far apart each x point in the data/graph needs to be. This way the finder can handle discontinuities (i.e. each adjacent point is not a fixed x-distance) in the actual data. Default is -1, which means don't check continuity.
Definition at line 478 of file PeakAna.h.
Referenced by Copy(), GausFilter(), GetPossiblePeaks(), Init(), MeanFilter(), and SetContinuity().
|
protected |
Filter to use in AnalyzeForPeak()
see SetFilter(). Note that filters do not change the size of the data
Definition at line 509 of file PeakAna.h.
Referenced by AnalyzeForPeak(), Copy(), GetFilter(), Init(), and SetFilter().
|
protected |
Copy of found peak in mPeaks.
This gets set after SearchForPeak() is called and finds a peak with given search parameters. It is separate for ease of access and so it can be overwritten for testing and debugging purposes
Definition at line 444 of file PeakAna.h.
Referenced by StFcsPulseAna::AnalyzeForPeak(), AnalyzeForPeak(), StFcsPulseAna::Clone(), Clone(), GoodWindow(), Init(), StFcsPulseAna::MBFit(), PeakEnd(), PeakStart(), PeakX(), PeakXY(), PeakY(), StFcsPulseAna::Print(), Print(), ResetPeak(), SetPeak(), SetWindow(), and StFcsPulseAna::SignalMBPars().
|
protected |
TGraph that stores the x,y data.
This graph object will not be deleted by this class unless #PeakAna::mInternalSiganl=true A TGraph is used because it is easier to process but may want to change to dynamic arrays for speed??
Definition at line 485 of file PeakAna.h.
Referenced by StFcsPulseAna::GausFit(), StFcsPulseAna::GetData(), GetData(), GetPossiblePeaks(), GetXYMax(), Init(), StFcsPulseAna::MBFit(), StFcsPulseAna::MergeByProbability(), MergeByProbability(), operator=(), PeakAna(), PeakProb(), PeakTunnel(), PeakX(), PeakXY(), PeakY(), Print(), StFcsPulseAna::PulseFit(), SetData(), StFcsPulseAna::Sum(), and ~PeakAna().
|
protected |
Variable that defines peak search parameters.
The values are stored in a PeakWindow object but only PeakWindow::mStartX is used for the peak location and PeakWindow::mEndX is used for the width. The width represents the +- window from PeakWindow::mStartX to look for a peak. This is used by SearchForPeak(). Default is peak at 0 with a width of 1.
Definition at line 450 of file PeakAna.h.
Referenced by Init(), StFcsPulseAna::Print(), Print(), SearchForPeak(), SearchPeak(), SearchWidth(), and SetSearchWindow().