Example to illustrate high resolution peak searching function (class TSpectrum2).
Found 5 candidate peaks
posx= 216, posy= 69, value=1502
posx= 191, posy= 188, value=1404
posx= 66, posy= 51, value=1555
posx= 109, posy= 100, value=1260
posx= 40, posy= 222, value=978
void Src2()
{
const Int_t nbinsx = 256;
const Int_t nbinsy = 256;
std::vector<Double_t *> source(nbinsx),
dest(nbinsx);
}
TString file = dir +
"/spectrum/TSpectrum2.root";
auto search = (
TH2F *)
f->Get(
"back3");
for (
Int_t j = 0; j < nbinsy; j++) {
source[
i][j] = search->GetBinContent(
i + 1, j + 1);
}
}
printf("Found %d candidate peaks\n", nfound);
search->Draw("COL");
printf(
"posx= %d, posy= %d, value=%d\n", (
Int_t)(PositionX[
i] + 0.5), (
Int_t)(PositionY[
i] + 0.5),
m.DrawMarker(PositionX[
i], PositionY[
i]);
}
}
}
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
R__EXTERN TStyle * gStyle
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
2-D histogram with a float per channel (see TH1 documentation)
Advanced 2-dimensional spectra processing.
Double_t * GetPositionY() const
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.
Double_t * GetPositionX() const
const char * Data() const
- Authors
- Miroslav Morhac, Olivier Couet
Definition in file Src2.C.