39 for (
Int_t p = 0; p < npeaks; p++) {
51 printf(
"Generating histogram with %d peaks\n", npeaks);
66 for (p = 0; p < npeaks; p++) {
67 par[5 * p + 0] =
gRandom->Uniform(0.2, 1);
69 par[5 * p + 2] =
gRandom->Uniform(dx, 5 * dx);
71 par[5 * p + 4] =
gRandom->Uniform(dy, 5 * dy);
79 c1 =
new TCanvas(
"c1",
"c1", 10, 10, 1000, 700);
89 for (p = 0; p < npeaks; p++) {
90 for (pf = 0; pf < nfound; pf++) {
93 if (diffx < 2 * dx && diffy < 2 * dy)
101 for (pf = 0; pf < nfound; pf++) {
103 for (p = 0; p < npeaks; p++) {
106 if (diffx < 2 * dx && diffy < 2 * dy)
115 printf(
"Gener=%d, Found=%d, Good=%d, Ghost=%d\n", npeaks, nfound, ngood, nghost);
116 if (!
gROOT->IsBatch()) {
117 printf(
"\nDouble click in the bottom right corner of the pad to continue\n");
121void peaks2(
Int_t maxpeaks = 50)
124 for (
int i = 0; i < 10; ++i) {
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
virtual void SetNpx(Int_t npx=100)
virtual void SetParameters(const Double_t *params)
virtual void SetNpy(Int_t npy=100)
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
2-D histogram with a float per channel (see TH1 documentation)
void FillRandom(TF1 *function, Int_t ntimes=5000, TRandom *rng=nullptr) override
Fill histogram following distribution in function function.
Advanced 2-dimensional spectra processing.
Double_t * GetPositionY() const
Double_t * GetPositionX() const
void Print(Option_t *option="") const override
Print the array of positions.
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 Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculates a gaussian function with mean and sigma.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.