49#define PEAK_WINDOW 1024
160 Error(
"Background",
"function not yet implemented: h=%s, iter=%d, option=%sn"
213 Int_t dimension =
hin->GetDimension();
214 if (dimension != 2) {
215 Error(
"Search",
"Must be a 2-d histogram");
237 for (i = 0; i <
sizex; i++) {
251 for (i = 0; i <
npeaks; i++) {
257 for (i = 0; i <
sizex; i++) {
269 hin->GetListOfFunctions()->Remove(
pm);
273 hin->GetListOfFunctions()->Add(
pm);
274 pm->SetMarkerStyle(23);
276 pm->SetMarkerSize(1.3);
379 return "Wrong parameters";
381 return "Width of Clipping Window Must Be Positive";
384 return (
"Too Large Clipping Window");
386 for (i = 0; i <
ssizex; i++)
539 for (i = 0; i <
ssizex; i++)
589 return "Averaging Window must be positive";
591 for(i = 0; i <
ssizex; i++)
607 for (i = 0; i <
ssizex; i++)
733 if (
a +
nip <= 0)
a = 1;
741 if (
a +
nim <= 0)
a = 1;
757 for(i = 0;i <
ssizex; i++){
762 for (i = 0; i <
ssizex; i++)
841 Int_t i,
j,
lhx,
lhy,
i1,
i2,
j1,
j2,
k1,
k2,
lindex,
i1min,
i1max,
845 return "Wrong parameters";
847 return "Number of iterations must be positive";
849 return "Number of repetitions must be positive";
851 for (i = 0; i <
ssizex; i++)
855 for (i = 0; i <
ssizex; i++) {
872 if (
lhx == -1 ||
lhy == -1) {
873 for (i = 0; i <
ssizex; i++)
876 return (
"Zero response data");
940 for (i = 0; i <
ssizex; i++) {
990 for (i = 0; i <
ssizex; i++) {
995 for (i = 0; i <
ssizex; i++)
1105 Int_t lhx,
lhy,
i1,
i2,
j1,
j2,
k1,
k2,
i1min,
i1max,
i2min,
i2max,
j1min,
j1max,
j2min,
j2max,
positx,
posity;
1107 Error(
"SearchHighRes",
"Invalid sigma, must be greater than or equal to 1");
1112 Error(
"SearchHighRes",
"Invalid threshold, must be positive and less than 100");
1118 Error(
"SearchHighRes",
"Too large sigma");
1124 Error(
"SearchHighRes",
"Averaging window must be positive");
1130 Error(
"SearchHighRes",
"Too large clipping window");
1139 for (k=0;k<16 * (
ssizey + i);k++)
wsk[k] = 0;
1154 else if(i >=
ssizex + shift){
1190 b = (
p1 +
p2) / 2.0;
1193 b = (
p1 +
p3) / 2.0;
1196 b = (
p2 +
p4) / 2.0;
1199 b = (
p3 +
p4) / 2.0;
1231 else if(i >=
ssizex + shift){
1308 if(i -
l + 1 <
xmin)
1346 if(i -
l + 1 <
ymin)
1385 if(i -
l + 1 <
xmin)
1573 if(
lda > 0.000001 &&
ldc > 0.000001){
1635 for(k = i - 1,
a = 0,
b = 0; k <= i + 1; k++){
1646 for(k =
j - 1,
a = 0,
b = 0; k <=
j + 1; k++){
1695 for(i = 0; i <
ssizex; i++){
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
TH1 is the base class of all histogram classes in ROOT.
The TNamed class is the base class for all named ROOT classes.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
A PolyMarker is defined by an array on N points in a 2-D space.
Advanced 2-dimensional spectra processing.
Double_t fResolution
NOT USED resolution of the neighboring peaks
TH1 * fHistogram
resulting histogram
static Int_t fgIterations
Maximum number of decon iterations (default=3)
static void SetDeconIterations(Int_t n=3)
static function: Set max number of decon iterations in deconvolution operation see TSpectrum2::Search...
static TH1 * StaticBackground(const TH1 *hist, Int_t niter=20, Option_t *option="")
static function (called by TH1), interface to TSpectrum2::Background
const char * SmoothMarkov(Double_t **source, Int_t ssizex, Int_t ssizey, Int_t averWindow)
This function calculates smoothed spectrum from source spectrum based on Markov chain method.
void SetResolution(Double_t resolution=1)
NOT USED resolution: determines resolution of the neighboring peaks default value is 1 correspond to ...
static Int_t fgAverageWindow
Average window of searched peaks.
Int_t fMaxPeaks
Maximum number of peaks to be found.
@ kBackSuccessiveFiltering
Int_t SearchHighRes(Double_t **source, Double_t **dest, Int_t ssizex, Int_t ssizey, Double_t sigma, Double_t threshold, Bool_t backgroundRemove, Int_t deconIterations, Bool_t markov, Int_t averWindow)
This function searches for peaks in source spectrum It is based on deconvolution method.
void Print(Option_t *option="") const override
Print the array of positions.
Int_t fNPeaks
number of peaks found
virtual TH1 * Background(const TH1 *hist, Int_t niter=20, Option_t *option="")
This function calculates the background spectrum in the input histogram h.
static void SetAverageWindow(Int_t w=3)
static function: Set average window of searched peaks see TSpectrum2::SearchHighRes
~TSpectrum2() override
Destructor.
virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05)
This function searches for peaks in source spectrum in hin The number of found peaks and their positi...
Double_t * fPositionY
[fNPeaks] Y position of peaks
static Int_t StaticSearch(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05)
static function (called by TH1), interface to TSpectrum2::Search
Double_t * fPosition
[fNPeaks] array of current peak positions
const char * Deconvolution(Double_t **source, Double_t **resp, Int_t ssizex, Int_t ssizey, Int_t numberIterations, Int_t numberRepetitions, Double_t boost)
This function calculates deconvolution from source spectrum according to response spectrum The result...
Double_t * fPositionX
[fNPeaks] X position of peaks
void ToLower()
Change string to lower-case.
TString & ReplaceAll(const TString &s1, const TString &s2)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.