53#define PEAK_WINDOW 1024
120 Error(
"Background",
"function not yet implemented: h=%s, iter=%d, option=%sn"
169 Error(
"Search",
"Must be a 3-d histogram");
179 for (i = 0; i <
sizex; i++) {
185 for (k = 0; k <
sizez; k++)
190 npeaks =
SearchHighRes((
const Double_t***)
source,
dest,
sizex,
sizey,
sizez,
sigma, 100*
threshold,
kTRUE, 3,
kFALSE, 3);
195 for (i = 0; i <
npeaks; i++) {
203 for (i = 0; i <
sizex; i++) {
206 delete []
dest[i][
j];
395 Double_t a,
b,
c,
d,
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
s1,
s2,
s3,
s4,
s5,
s6,
s7,
s8,
s9,
s10,
s11,
s12,
r1,
r2,
r3,
r4,
r5,
r6;
397 return "Wrong parameters";
399 return "Width of Clipping Window Must Be Positive";
401 return (
"Too Large Clipping Window");
761 for(i = 0;i <
ssizex; i++){
865 Double_t nom,
nip,
nim,
sp,
sm,
spx,
smx,
spy,
smy,
spz,
smz,
plocha=0;
867 return "Averaging Window must be positive";
869 for(i = 0;i <
ssizex; i++){
882 for(k = 0;k <
ssizez; k++){
891 for(i = 0;i <
ssizex; i++){
986 for(i = zmin;i < zmax; i++){
1007 if(i -
l + 1 < zmin)
1049 if(i -
l + 1 <
xmin)
1109 for(
j = zmin;
j < zmax;
j++){
1130 if(i -
l + 1 <
xmin)
1167 if(
j -
l + 1 < zmin)
1190 for(
j = zmin;
j < zmax;
j++){
1211 if(i -
l + 1 <
ymin)
1248 if(
j -
l + 1 < zmin)
1272 for(k = zmin;k < zmax; k++){
1293 if(i -
l + 1 <
xmin)
1392 for(k = zmin;k <= zmax; k++){
1397 for(i = 0;i <
ssizex; i++){
1399 for(k = 0;k <
ssizez; k++){
1404 for(i = 0;i <
ssizex; i++){
1605 Int_t i,
j, k,
lhx,
lhy,
lhz,
i1,
i2,
i3,
j1,
j2,
j3,
k1,
k2,
k3,
lindex,
i1min,
i1max,
i2min,
i2max,
i3min,
i3max,
j1min,
j1max,
j2min,
j2max,
j3min,
j3max,
positx = 0,
posity = 0,
positz = 0,
repet;
1608 return "Wrong parameters";
1610 return "Number of iterations must be positive";
1612 return "Number of repetitions must be positive";
1621 for (i = 0; i <
ssizex; i++) {
1623 for (k = 0; k <
ssizez; k++) {
1642 if (
lhx == -1 ||
lhy == -1 ||
lhz == -1) {
1643 for(i = 0;i <
ssizex; i++){
1649 return (
"Zero response data");
1730 for (i = 0; i <
ssizex; i++) {
1732 for (k = 0; k <
ssizez; k++) {
1793 for (i = 0; i <
ssizex; i++) {
1795 for (k = 0; k <
ssizez; k++)
1799 for(i = 0;i <
ssizex; i++){
1960 Double_t nom,
nip,
nim,
sp,
sm,
spx,
spy,
smx,
smy,
spz,
smz;
1961 Double_t p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
s1,
s2,
s3,
s4,
s5,
s6,
s7,
s8,
s9,
s10,
s11,
s12,
r1,
r2,
r3,
r4,
r5,
r6;
1964 Int_t lhx,
lhy,
lhz,
i1,
i2,
i3,
j1,
j2,
j3,
k1,
k2,
k3,
i1min,
i1max,
i2min,
i2max,
i3min,
i3max,
j1min,
j1max,
j2min,
j2max,
j3min,
j3max,
positx,
posity,
positz;
1966 Error(
"SearchHighRes",
"Invalid sigma, must be greater than or equal to 1");
1971 Error(
"SearchHighRes",
"Invalid threshold, must be positive and less than 100");
1977 Error(
"SearchHighRes",
"Too large sigma");
1983 Error(
"SearchHighRes",
"Averaging window must be positive");
1990 Error(
"SearchHighRes",
"Too large clipping window");
2000 for(k = 0;k <
ssizey + i; k++)
2011 else if(k >=
ssizez + shift)
2022 else if(k >=
ssizez + shift)
2033 else if(k >=
ssizez + shift)
2041 else if(i >=
ssizex + shift){
2046 else if(k >=
ssizez + shift)
2057 else if(k >=
ssizez + shift)
2068 else if(k >=
ssizez + shift)
2081 else if(k >=
ssizez + shift)
2092 else if(k >=
ssizez + shift)
2103 else if(k >=
ssizez + shift)
2145 b = (
p1 +
p3) / 2.0;
2149 b = (
p1 +
p2) / 2.0;
2153 b = (
p2 +
p4) / 2.0;
2157 b = (
p3 +
p4) / 2.0;
2161 b = (
p5 +
p7) / 2.0;
2165 b = (
p5 +
p6) / 2.0;
2169 b = (
p6 +
p8) / 2.0;
2173 b = (
p7 +
p8) / 2.0;
2177 b = (
p2 +
p6) / 2.0;
2181 b = (
p4 +
p8) / 2.0;
2185 b = (
p1 +
p5) / 2.0;
2189 b = (
p3 +
p7) / 2.0;
2259 else if(k >=
ssizez + shift)
2270 else if(k >=
ssizez + shift)
2281 else if(k >=
ssizez + shift)
2289 else if(i >=
ssizex + shift){
2294 else if(k >=
ssizez + shift)
2305 else if(k >=
ssizez + shift)
2316 else if(k >=
ssizez + shift)
2329 else if(k >=
ssizez + shift)
2340 else if(k >=
ssizez + shift)
2351 else if(k >=
ssizez + shift)
2390 for(i = 0;i <
ssizex + k; i++){
2421 if(i -
l + 1 <
xmin)
2463 if(i -
l + 1 <
ymin)
2484 for(i = zmin;i < zmax;i++){
2505 if(i -
l + 1 < zmin)
2548 if(i -
l + 1 <
xmin)
2608 for(
j = zmin;
j < zmax;
j++){
2629 if(i -
l + 1 <
xmin)
2666 if(
j -
l + 1 < zmin)
2689 for(
j = zmin;
j < zmax;
j++){
2710 if(i -
l + 1 <
ymin)
2747 if(
j -
l + 1 < zmin)
2771 for(k = zmin;k < zmax; k++){
2792 if(i -
l + 1 <
xmin)
2892 for(k = zmin;k <= zmax; k++){
3112 for(k = i - 1,
a = 0,
b = 0;k <= i + 1; k++){
3117 for(k =
j - 1,
a = 0,
b = 0;k <=
j + 1; k++){
3122 for(k =
l - 1,
a = 0,
b = 0;k <=
l + 1; k++){
3135 for(i = 0;i <
ssizex; i++){
3137 for(k = 0;k <
ssizez; k++){
3144 for(i = 0;i <
ssizex + k; i++){
3179 Int_t i,
j,k,
l,
li,
lj,
lk,
lmin,
lmax,
xmin,
xmax,
ymin,
ymax,zmin,zmax;
3181 Double_t nom,
nip,
nim,
sp,
sm,
spx,
spy,
smx,
smy,
spz,
smz;
3182 Double_t norma,val,
val1,
val2,
val3,
val4,
val5,
val6,
val7,
val8,
val9,
val10,
val11,
val12,
val13,
val14,
val15,
val16,
val17,
val18,
val19,
val20,
val21,
val22,
val23,
val24,
val25,
val26;
3185 Double_t p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
s1,
s2,
s3,
s4,
s5,
s6,
s7,
s8,
s9,
s10,
s11,
s12,
r1,
r2,
r3,
r4,
r5,
r6;
3191 Error(
"SearchFast",
"Invalid sigma, must be greater than or equal to 1");
3196 Error(
"SearchFast",
"Invalid threshold, must be positive and less than 100");
3202 Error(
"SearchFast",
"Too large sigma");
3208 Error(
"SearchFast",
"Averaging window must be positive");
3214 Error(
"SearchFast",
"Too large clipping window");
3223 for(k = 0;k <
ssizey + i; k++)
3235 else if(k >=
ssizez + shift)
3246 else if(k >=
ssizez + shift)
3257 else if(k >=
ssizez + shift)
3265 else if(i >=
ssizex + shift){
3270 else if(k >=
ssizez + shift)
3281 else if(k >=
ssizez + shift)
3292 else if(k >=
ssizez + shift)
3305 else if(k >=
ssizez + shift)
3316 else if(k >=
ssizez + shift)
3327 else if(k >=
ssizez + shift)
3368 b = (
p1 +
p3) / 2.0;
3372 b = (
p1 +
p2) / 2.0;
3376 b = (
p2 +
p4) / 2.0;
3380 b = (
p3 +
p4) / 2.0;
3384 b = (
p5 +
p7) / 2.0;
3388 b = (
p5 +
p6) / 2.0;
3392 b = (
p6 +
p8) / 2.0;
3396 b = (
p7 +
p8) / 2.0;
3400 b = (
p2 +
p6) / 2.0;
3404 b = (
p4 +
p8) / 2.0;
3408 b = (
p1 +
p5) / 2.0;
3412 b = (
p3 +
p7) / 2.0;
3482 else if(k >=
ssizez + shift)
3493 else if(k >=
ssizez + shift)
3504 else if(k >=
ssizez + shift)
3512 else if(i >=
ssizex + shift){
3517 else if(k >=
ssizez + shift)
3528 else if(k >=
ssizez + shift)
3539 else if(k >=
ssizez + shift)
3552 else if(k >=
ssizez + shift)
3563 else if(k >=
ssizez + shift)
3574 else if(k >=
ssizez + shift)
3617 for(i = 0;i <
ssizex + k; i++){
3649 if(i -
l + 1 <
xmin)
3691 if(i -
l + 1 <
ymin)
3712 for(i = zmin;i < zmax;i++){
3733 if(i -
l + 1 < zmin)
3776 if(i -
l + 1 <
xmin)
3836 for(
j = zmin;
j < zmax;
j++){
3857 if(i -
l + 1 <
xmin)
3894 if(
j -
l + 1 < zmin)
3917 for(
j = zmin;
j < zmax;
j++){
3938 if(i -
l + 1 <
ymin)
3975 if(
j -
l + 1 < zmin)
3999 for(k = zmin;k < zmax; k++){
4020 if(i -
l + 1 <
xmin)
4120 for(k = zmin;k <= zmax; k++){
4136 for(k = 0;k <
ssizez; k++){
4138 for(i = 0;i <
ssizex; i++){
4150 for(i = -
j;i <=
j; i++){
4182 for(k = zmin;k <= zmax; k++){
4201 for(z = zmin + 1;z < zmax; z++){
4288 for(k =
x - 1,
a = 0,
b = 0;k <=
x + 1; k++){
4293 for(k =
y - 1,
a = 0,
b = 0;k <=
y + 1; k++){
4298 for(k = z - 1,
a = 0,
b = 0;k <= z + 1; k++){
4317 for(i = 0;i <
ssizex; i++){
4319 for(k = 0;k <
ssizez; k++){
4323 dest[i][
j][k] = val;
4329 for(i = 0;i <
ssizex + k; 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.
Advanced 3-dimensional spectra processing functions.
Double_t fResolution
NOT USED resolution of the neighboring peaks
Int_t fMaxPeaks
Maximum number of peaks to be found.
Int_t SearchFast(const Double_t ***source, Double_t ***dest, Int_t ssizex, Int_t ssizey, Int_t ssizez, Double_t sigma, Double_t threshold, Bool_t markov, Int_t averWindow)
THREE-DIMENSIONAL CLASSICAL PEAK SEARCH FUNCTION This function searches for peaks in source spectrum ...
virtual const char * Background(const TH1 *hist, Int_t niter, Option_t *option="goff")
This function calculates background spectrum from source in h.
TH1 * fHistogram
resulting histogram
const char * Deconvolution(Double_t ***source, const Double_t ***resp, Int_t ssizex, Int_t ssizey, Int_t ssizez, Int_t numberIterations, Int_t numberRepetitions, Double_t boost)
This function calculates deconvolution from source spectrum according to response spectrum The result...
Double_t * fPositionY
[fNPeaks] Y positions of peaks
Double_t * fPosition
[fNPeaks] array of current peak positions
virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05)
This function searches for peaks in source spectrum in hin The number of found peaks and their positi...
Int_t SearchHighRes(const Double_t ***source, Double_t ***dest, Int_t ssizex, Int_t ssizey, Int_t ssizez, 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.
const char * SmoothMarkov(Double_t ***source, Int_t ssizex, Int_t ssizey, Int_t ssizez, Int_t averWindow)
This function calculates smoothed spectrum from source spectrum based on Markov chain method.
@ kBackSuccessiveFiltering
Double_t * fPositionZ
[fNPeaks] Z positions of peaks
Double_t * fPositionX
[fNPeaks] X positions of peaks
Int_t fNPeaks
number of peaks found
void Print(Option_t *option="") const override
Print the array of positions.
void SetResolution(Double_t resolution=1)
NOT USED resolution: determines resolution of the neighbouring peaks default value is 1 correspond to...
~TSpectrum3() override
Destructor.
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.