49#define PEAK_WINDOW 1024
159 Error(
"Background",
"function not yet implemented: h=%s, iter=%d, option=%sn"
212 Int_t dimension =
hin->GetDimension();
213 if (dimension != 2) {
214 Error(
"Search",
"Must be a 2-d histogram");
236 for (i = 0; i <
sizex; i++) {
250 for (i = 0; i <
npeaks; i++) {
256 for (i = 0; i <
sizex; i++) {
268 hin->GetListOfFunctions()->Remove(
pm);
272 hin->GetListOfFunctions()->Add(
pm);
273 pm->SetMarkerStyle(23);
275 pm->SetMarkerSize(1.3);
378 return "Wrong parameters";
380 return "Width of Clipping Window Must Be Positive";
383 return (
"Too Large Clipping Window");
385 for (i = 0; i <
ssizex; i++)
538 for (i = 0; i <
ssizex; i++)
588 return "Averaging Window must be positive";
590 for(i = 0; i <
ssizex; i++)
606 for (i = 0; i <
ssizex; i++)
732 if (
a +
nip <= 0)
a = 1;
740 if (
a +
nim <= 0)
a = 1;
756 for(i = 0;i <
ssizex; i++){
761 for (i = 0; i <
ssizex; i++)
840 Int_t i,
j,
lhx,
lhy,
i1,
i2,
j1,
j2,
k1,
k2,
lindex,
i1min,
i1max,
844 return "Wrong parameters";
846 return "Number of iterations must be positive";
848 return "Number of repetitions must be positive";
850 for (i = 0; i <
ssizex; i++)
854 for (i = 0; i <
ssizex; i++) {
871 if (
lhx == -1 ||
lhy == -1) {
872 for (i = 0; i <
ssizex; i++)
875 return (
"Zero response data");
939 for (i = 0; i <
ssizex; i++) {
989 for (i = 0; i <
ssizex; i++) {
994 for (i = 0; i <
ssizex; i++)
1104 Int_t lhx,
lhy,
i1,
i2,
j1,
j2,
k1,
k2,
i1min,
i1max,
i2min,
i2max,
j1min,
j1max,
j2min,
j2max,
positx,
posity;
1106 Error(
"SearchHighRes",
"Invalid sigma, must be greater than or equal to 1");
1111 Error(
"SearchHighRes",
"Invalid threshold, must be positive and less than 100");
1117 Error(
"SearchHighRes",
"Too large sigma");
1123 Error(
"SearchHighRes",
"Averaging window must be positive");
1129 Error(
"SearchHighRes",
"Too large clipping window");
1138 for (k=0;k<16 * (
ssizey + i);k++)
wsk[k] = 0;
1153 else if(i >=
ssizex + shift){
1189 b = (
p1 +
p2) / 2.0;
1192 b = (
p1 +
p3) / 2.0;
1195 b = (
p2 +
p4) / 2.0;
1198 b = (
p3 +
p4) / 2.0;
1230 else if(i >=
ssizex + shift){
1307 if(i -
l + 1 <
xmin)
1345 if(i -
l + 1 <
ymin)
1384 if(i -
l + 1 <
xmin)
1572 if(
lda > 0.000001 &&
ldc > 0.000001){
1634 for(k = i - 1,
a = 0,
b = 0; k <= i + 1; k++){
1645 for(k =
j - 1,
a = 0,
b = 0; k <=
j + 1; k++){
1694 for(i = 0; i <
ssizex; i++){
int Int_t
Signed integer 4 bytes (int)
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char)
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.