peaks2¶

Example to illustrate the 2-d peak finder (class TSpectrum2).

This script generates a random number of 2-d gaussian peaks The position of the peaks is found via TSpectrum2 To execute this example, do:

root > .x peaks2.C  (generate up to 50 peaks by default)
root > .x peaks2.C(10) (generate up to 10 peaks)
root > .x peaks2.C+(200) (generate up to 200 peaks via ACLIC)


The script will iterate generating a new histogram having between 5 and the maximun number of peaks specified. Double Click on the bottom right corner of the pad to go to a new spectrum To Quit, select the "quit" item in the canvas "File" menu

Author: Rene Brun
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, August 09, 2022 at 09:43 AM.

In [1]:
%%cpp -d
#include "TSpectrum2.h"
#include "TCanvas.h"
#include "TRandom.h"
#include "TH2.h"
#include "TF2.h"
#include "TMath.h"
#include "TROOT.h"

TSpectrum2 *s;
TH2F *h2 = 0;
Int_t npeaks = 30;


Definition of a helper function:

In [2]:
%%cpp -d
Double_t fpeaks2(Double_t *x, Double_t *par) {
Double_t result = 0.1;
for (Int_t p=0;p<npeaks;p++) {
Double_t norm   = par[5*p+0];
Double_t mean1  = par[5*p+1];
Double_t sigma1 = par[5*p+2];
Double_t mean2  = par[5*p+3];
Double_t sigma2 = par[5*p+4];
result += norm*TMath::Gaus(x[0],mean1,sigma1)*TMath::Gaus(x[1],mean2,sigma2);
}
return result;
}


Definition of a helper function:

In [3]:
%%cpp -d
void findPeak2() {
printf("Generating histogram with %d peaks\n",npeaks);
Int_t nbinsx = 200;
Int_t nbinsy = 200;
Double_t xmin   = 0;
Double_t xmax   = (Double_t)nbinsx;
Double_t ymin   = 0;
Double_t ymax   = (Double_t)nbinsy;
Double_t dx = (xmax-xmin)/nbinsx;
Double_t dy = (ymax-ymin)/nbinsy;
delete h2;
h2 = new TH2F("h2","test",nbinsx,xmin,xmax,nbinsy,ymin,ymax);
h2->SetStats(0);
//generate n peaks at random
Double_t par[3000];
Int_t p;
for (p=0;p<npeaks;p++) {
par[5*p+0] = gRandom->Uniform(0.2,1);
par[5*p+1] = gRandom->Uniform(xmin,xmax);
par[5*p+2] = gRandom->Uniform(dx,5*dx);
par[5*p+3] = gRandom->Uniform(ymin,ymax);
par[5*p+4] = gRandom->Uniform(dy,5*dy);
}
TF2 *f2 = new TF2("f2",fpeaks2,xmin,xmax,ymin,ymax,5*npeaks);
f2->SetNpx(100);
f2->SetNpy(100);
f2->SetParameters(par);
TCanvas *c1 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("c1");
if (!c1) c1 = new TCanvas("c1","c1",10,10,1000,700);
h2->FillRandom("f2",500000);

//now the real stuff: Finding the peaks
Int_t nfound = s->Search(h2,2,"col");

//searching good and ghost peaks (approximation)
Int_t pf,ngood = 0;
Double_t *xpeaks = s->GetPositionX();
Double_t *ypeaks = s->GetPositionY();
for (p=0;p<npeaks;p++) {
for (pf=0;pf<nfound;pf++) {
Double_t diffx = TMath::Abs(xpeaks[pf] - par[5*p+1]);
Double_t diffy = TMath::Abs(ypeaks[pf] - par[5*p+3]);
if (diffx < 2*dx && diffy < 2*dy) ngood++;
}
}
if (ngood > nfound) ngood = nfound;
//Search ghost peaks (approximation)
Int_t nghost = 0;
for (pf=0;pf<nfound;pf++) {
Int_t nf=0;
for (p=0;p<npeaks;p++) {
Double_t diffx = TMath::Abs(xpeaks[pf] - par[5*p+1]);
Double_t diffy = TMath::Abs(ypeaks[pf] - par[5*p+3]);
if (diffx < 2*dx && diffy < 2*dy) nf++;
}
if (nf == 0) nghost++;
}
c1->Update();

s->Print();
printf("Gener=%d, Found=%d, Good=%d, Ghost=%d\n",npeaks,nfound,ngood,nghost);
if (!gROOT->IsBatch()) {
printf("\nDouble click in the bottom right corner of the pad to continue\n");
c1->WaitPrimitive();
}
}


Arguments are defined.

In [4]:
Int_t maxpeaks=50;

In [5]:
s = new TSpectrum2(2*maxpeaks);
for (int i=0; i<10; ++i) {
npeaks = (Int_t)gRandom->Uniform(5,maxpeaks);
findPeak2();
}

Generating histogram with 49 peaks

Number of positions = 70
x[0] = 150.5, y[0] = 81.5
x[1] = 99.5, y[1] = 92.5
x[2] = 60.5, y[2] = 60.5
x[3] = 17.5, y[3] = 95.5
x[4] = 21.5, y[4] = 21.5
x[5] = 190.5, y[5] = 153.5
x[6] = 148.5, y[6] = 149.5
x[7] = 99.5, y[7] = 36.5
x[8] = 29.5, y[8] = 62.5
x[9] = 134.5, y[9] = 190.5
x[10] = 5.5, y[10] = 165.5
x[11] = 135.5, y[11] = 95.5
x[12] = 41.5, y[12] = 16.5
x[13] = 51.5, y[13] = 115.5
x[14] = 146.5, y[14] = 52.5
x[15] = 27.5, y[15] = 137.5
x[16] = 148.5, y[16] = 32.5
x[17] = 9.5, y[17] = 113.5
x[18] = 78.5, y[18] = 42.5
x[19] = 125.5, y[19] = 74.5
x[20] = 47.5, y[20] = 136.5
x[21] = 111.5, y[21] = 128.5
x[22] = 139.5, y[22] = 23.5
x[23] = 64.5, y[23] = 103.5
x[24] = 8.5, y[24] = 101.5
x[25] = 67.5, y[25] = 173.5
x[26] = 16.5, y[26] = 178.5
x[27] = 188.5, y[27] = 66.5
x[28] = 136.5, y[28] = 4.5
x[29] = 75.5, y[29] = 22.5
x[30] = 143.5, y[30] = 139.5
x[31] = 190.5, y[31] = 123.5
x[32] = 2.5, y[32] = 146.5
x[33] = 75.5, y[33] = 35.5
x[34] = 56.5, y[34] = 187.5
x[35] = 56.5, y[35] = 46.5
x[36] = 132.5, y[36] = 121.5
x[37] = 35.5, y[37] = 133.5
x[38] = 75.5, y[38] = 121.5
x[39] = 13.5, y[39] = 145.5
x[40] = 24.5, y[40] = 164.5
x[41] = 38.5, y[41] = 117.5
x[42] = 50.5, y[42] = 74.5
x[43] = 89.5, y[43] = 173.5
x[44] = 173.5, y[44] = 185.5
x[45] = 173.5, y[45] = 144.5
x[46] = 185.5, y[46] = 103.5
x[47] = 195.5, y[47] = 163.5
x[48] = 145.5, y[48] = 125.5
x[49] = 151.5, y[49] = 197.5
x[50] = 127.5, y[50] = 107.5
x[51] = 115.5, y[51] = 97.5
x[52] = 141.5, y[52] = 112.5
x[53] = 85.5, y[53] = 140.5
x[54] = 164.5, y[54] = 150.5
x[55] = 155.5, y[55] = 165.5
x[56] = 169.5, y[56] = 178.5
x[57] = 182.5, y[57] = 169.5
x[58] = 184.5, y[58] = 193.5
x[59] = 161.5, y[59] = 171.5
x[60] = 162.5, y[60] = 133.5
x[61] = 168.5, y[61] = 86.5
x[62] = 176.5, y[62] = 192.5
x[63] = 146.5, y[63] = 192.5
x[64] = 152.5, y[64] = 124.5
x[65] = 153.5, y[65] = 162.5
x[66] = 161.5, y[66] = 145.5
x[67] = 167.5, y[67] = 183.5
x[68] = 172.5, y[68] = 153.5
x[69] = 174.5, y[69] = 157.5
Gener=49, Found=70, Good=45, Ghost=27
Generating histogram with 27 peaks

Number of positions = 41
x[0] = 155.5, y[0] = 29.5
x[1] = 143.5, y[1] = 153.5
x[2] = 55.5, y[2] = 77.5
x[3] = 47.5, y[3] = 158.5
x[4] = 101.5, y[4] = 186.5
x[5] = 86.5, y[5] = 7.5
x[6] = 16.5, y[6] = 97.5
x[7] = 115.5, y[7] = 14.5
x[8] = 76.5, y[8] = 34.5
x[9] = 64.5, y[9] = 114.5
x[10] = 9.5, y[10] = 44.5
x[11] = 7.5, y[11] = 147.5
x[12] = 2.5, y[12] = 187.5
x[13] = 177.5, y[13] = 52.5
x[14] = 17.5, y[14] = 29.5
x[15] = 19.5, y[15] = 150.5
x[16] = 188.5, y[16] = 23.5
x[17] = 56.5, y[17] = 59.5
x[18] = 88.5, y[18] = 41.5
x[19] = 46.5, y[19] = 94.5
x[20] = 48.5, y[20] = 10.5
x[21] = 94.5, y[21] = 55.5
x[22] = 71.5, y[22] = 58.5
x[23] = 192.5, y[23] = 40.5
x[24] = 168.5, y[24] = 14.5
x[25] = 167.5, y[25] = 168.5
x[26] = 147.5, y[26] = 167.5
x[27] = 163.5, y[27] = 161.5
x[28] = 173.5, y[28] = 191.5
x[29] = 164.5, y[29] = 142.5
x[30] = 190.5, y[30] = 147.5
x[31] = 163.5, y[31] = 186.5
x[32] = 174.5, y[32] = 171.5
x[33] = 195.5, y[33] = 190.5
x[34] = 156.5, y[34] = 156.5
x[35] = 156.5, y[35] = 180.5
x[36] = 174.5, y[36] = 176.5
x[37] = 183.5, y[37] = 177.5
x[38] = 184.5, y[38] = 135.5
x[39] = 184.5, y[39] = 183.5
x[40] = 188.5, y[40] = 181.5
Gener=27, Found=41, Good=24, Ghost=17
Generating histogram with 18 peaks

Number of positions = 100
x[0] = 67.5, y[0] = 168.5
x[1] = 100.5, y[1] = 181.5
x[2] = 135.5, y[2] = 114.5
x[3] = 156.5, y[3] = 37.5
x[4] = 14.5, y[4] = 9.5
x[5] = 98.5, y[5] = 99.5
x[6] = 76.5, y[6] = 96.5
x[7] = 58.5, y[7] = 46.5
x[8] = 113.5, y[8] = 7.5
x[9] = 149.5, y[9] = 75.5
x[10] = 151.5, y[10] = 57.5
x[11] = 18.5, y[11] = 19.5
x[12] = 47.5, y[12] = 124.5
x[13] = 99.5, y[13] = 155.5
x[14] = 91.5, y[14] = 72.5
x[15] = 163.5, y[15] = 154.5
x[16] = 164.5, y[16] = 195.5
x[17] = 141.5, y[17] = 167.5
x[18] = 111.5, y[18] = 140.5
x[19] = 127.5, y[19] = 97.5
x[20] = 141.5, y[20] = 185.5
x[21] = 100.5, y[21] = 76.5
x[22] = 152.5, y[22] = 179.5
x[23] = 152.5, y[23] = 197.5
x[24] = 151.5, y[24] = 192.5
x[25] = 152.5, y[25] = 122.5
x[26] = 163.5, y[26] = 145.5
x[27] = 88.5, y[27] = 198.5
x[28] = 81.5, y[28] = 111.5
x[29] = 160.5, y[29] = 132.5
x[30] = 118.5, y[30] = 128.5
x[31] = 105.5, y[31] = 136.5
x[32] = 156.5, y[32] = 185.5
x[33] = 139.5, y[33] = 152.5
x[34] = 164.5, y[34] = 110.5
x[35] = 151.5, y[35] = 170.5
x[36] = 138.5, y[36] = 174.5
x[37] = 120.5, y[37] = 78.5
x[38] = 140.5, y[38] = 139.5
x[39] = 142.5, y[39] = 97.5
x[40] = 129.5, y[40] = 125.5
x[41] = 148.5, y[41] = 155.5
x[42] = 121.5, y[42] = 110.5
x[43] = 130.5, y[43] = 74.5
x[44] = 125.5, y[44] = 164.5
x[45] = 71.5, y[45] = 181.5
x[46] = 126.5, y[46] = 138.5
x[47] = 95.5, y[47] = 134.5
x[48] = 159.5, y[48] = 94.5
x[49] = 133.5, y[49] = 185.5
x[50] = 139.5, y[50] = 128.5
x[51] = 115.5, y[51] = 102.5
x[52] = 56.5, y[52] = 163.5
x[53] = 121.5, y[53] = 166.5
x[54] = 130.5, y[54] = 82.5
x[55] = 134.5, y[55] = 100.5
x[56] = 86.5, y[56] = 118.5
x[57] = 147.5, y[57] = 195.5
x[58] = 165.5, y[58] = 60.5
x[59] = 123.5, y[59] = 174.5
x[60] = 105.5, y[60] = 116.5
x[61] = 166.5, y[61] = 83.5
x[62] = 145.5, y[62] = 101.5
x[63] = 145.5, y[63] = 90.5
x[64] = 165.5, y[64] = 102.5
x[65] = 125.5, y[65] = 63.5
x[66] = 114.5, y[66] = 162.5
x[67] = 80.5, y[67] = 173.5
x[68] = 104.5, y[68] = 165.5
x[69] = 123.5, y[69] = 186.5
x[70] = 139.5, y[70] = 158.5
x[71] = 163.5, y[71] = 177.5
x[72] = 120.5, y[72] = 157.5
x[73] = 85.5, y[73] = 179.5
x[74] = 154.5, y[74] = 104.5
x[75] = 154.5, y[75] = 144.5
x[76] = 164.5, y[76] = 187.5
x[77] = 77.5, y[77] = 188.5
x[78] = 78.5, y[78] = 141.5
x[79] = 79.5, y[79] = 58.5
x[80] = 86.5, y[80] = 64.5
x[81] = 95.5, y[81] = 127.5
x[82] = 96.5, y[82] = 80.5
x[83] = 97.5, y[83] = 141.5
x[84] = 105.5, y[84] = 196.5
x[85] = 111.5, y[85] = 81.5
x[86] = 111.5, y[86] = 148.5
x[87] = 115.5, y[87] = 91.5
x[88] = 119.5, y[88] = 182.5
x[89] = 120.5, y[89] = 133.5
x[90] = 129.5, y[90] = 192.5
x[91] = 130.5, y[91] = 157.5
x[92] = 135.5, y[92] = 143.5
x[93] = 135.5, y[93] = 192.5
x[94] = 136.5, y[94] = 89.5
x[95] = 145.5, y[95] = 145.5
x[96] = 147.5, y[96] = 117.5
x[97] = 148.5, y[97] = 136.5
x[98] = 153.5, y[98] = 87.5
x[99] = 158.5, y[99] = 114.5
Gener=18, Found=100, Good=12, Ghost=88
Generating histogram with 24 peaks

Number of positions = 100
x[0] = 20.5, y[0] = 17.5
x[1] = 102.5, y[1] = 22.5
x[2] = 81.5, y[2] = 168.5
x[3] = 51.5, y[3] = 115.5
x[4] = 88.5, y[4] = 47.5
x[5] = 89.5, y[5] = 157.5
x[6] = 38.5, y[6] = 51.5
x[7] = 60.5, y[7] = 4.5
x[8] = 21.5, y[8] = 39.5
x[9] = 104.5, y[9] = 96.5
x[10] = 15.5, y[10] = 79.5
x[11] = 18.5, y[11] = 115.5
x[12] = 7.5, y[12] = 83.5
x[13] = 31.5, y[13] = 68.5
x[14] = 85.5, y[14] = 119.5
x[15] = 70.5, y[15] = 89.5
x[16] = 111.5, y[16] = 58.5
x[17] = 110.5, y[17] = 162.5
x[18] = 126.5, y[18] = 72.5
x[19] = 60.5, y[19] = 140.5
x[20] = 119.5, y[20] = 101.5
x[21] = 107.5, y[21] = 77.5
x[22] = 123.5, y[22] = 197.5
x[23] = 94.5, y[23] = 128.5
x[24] = 90.5, y[24] = 190.5
x[25] = 105.5, y[25] = 118.5
x[26] = 64.5, y[26] = 118.5
x[27] = 114.5, y[27] = 116.5
x[28] = 92.5, y[28] = 196.5
x[29] = 123.5, y[29] = 164.5
x[30] = 113.5, y[30] = 171.5
x[31] = 55.5, y[31] = 131.5
x[32] = 81.5, y[32] = 87.5
x[33] = 116.5, y[33] = 145.5
x[34] = 128.5, y[34] = 134.5
x[35] = 109.5, y[35] = 152.5
x[36] = 63.5, y[36] = 65.5
x[37] = 69.5, y[37] = 120.5
x[38] = 54.5, y[38] = 83.5
x[39] = 100.5, y[39] = 73.5
x[40] = 103.5, y[40] = 156.5
x[41] = 73.5, y[41] = 127.5
x[42] = 48.5, y[42] = 77.5
x[43] = 132.5, y[43] = 190.5
x[44] = 61.5, y[44] = 85.5
x[45] = 105.5, y[45] = 35.5
x[46] = 103.5, y[46] = 129.5
x[47] = 135.5, y[47] = 86.5
x[48] = 94.5, y[48] = 147.5
x[49] = 76.5, y[49] = 152.5
x[50] = 114.5, y[50] = 122.5
x[51] = 53.5, y[51] = 55.5
x[52] = 100.5, y[52] = 137.5
x[53] = 114.5, y[53] = 188.5
x[54] = 67.5, y[54] = 144.5
x[55] = 125.5, y[55] = 180.5
x[56] = 74.5, y[56] = 106.5
x[57] = 130.5, y[57] = 165.5
x[58] = 102.5, y[58] = 49.5
x[59] = 115.5, y[59] = 139.5
x[60] = 133.5, y[60] = 176.5
x[61] = 106.5, y[61] = 184.5
x[62] = 96.5, y[62] = 195.5
x[63] = 100.5, y[63] = 175.5
x[64] = 133.5, y[64] = 112.5
x[65] = 108.5, y[65] = 134.5
x[66] = 89.5, y[66] = 99.5
x[67] = 101.5, y[67] = 146.5
x[68] = 45.5, y[68] = 70.5
x[69] = 67.5, y[69] = 66.5
x[70] = 124.5, y[70] = 147.5
x[71] = 128.5, y[71] = 100.5
x[72] = 121.5, y[72] = 97.5
x[73] = 126.5, y[73] = 109.5
x[74] = 123.5, y[74] = 54.5
x[75] = 119.5, y[75] = 91.5
x[76] = 132.5, y[76] = 106.5
x[77] = 56.5, y[77] = 59.5
x[78] = 68.5, y[78] = 95.5
x[79] = 74.5, y[79] = 98.5
x[80] = 77.5, y[80] = 77.5
x[81] = 84.5, y[81] = 183.5
x[82] = 86.5, y[82] = 111.5
x[83] = 86.5, y[83] = 134.5
x[84] = 92.5, y[84] = 91.5
x[85] = 92.5, y[85] = 139.5
x[86] = 93.5, y[86] = 63.5
x[87] = 93.5, y[87] = 117.5
x[88] = 96.5, y[88] = 171.5
x[89] = 104.5, y[89] = 162.5
x[90] = 106.5, y[90] = 55.5
x[91] = 109.5, y[91] = 110.5
x[92] = 113.5, y[92] = 155.5
x[93] = 119.5, y[93] = 172.5
x[94] = 119.5, y[94] = 175.5
x[95] = 123.5, y[95] = 128.5
x[96] = 125.5, y[96] = 113.5
x[97] = 129.5, y[97] = 118.5
x[98] = 130.5, y[98] = 147.5
x[99] = 130.5, y[99] = 183.5
Gener=24, Found=100, Good=13, Ghost=87
Generating histogram with 33 peaks

Number of positions = 50
x[0] = 171.5, y[0] = 103.5
x[1] = 70.5, y[1] = 188.5
x[2] = 100.5, y[2] = 42.5
x[3] = 120.5, y[3] = 160.5
x[4] = 48.5, y[4] = 54.5
x[5] = 56.5, y[5] = 106.5
x[6] = 127.5, y[6] = 17.5
x[7] = 27.5, y[7] = 6.5
x[8] = 40.5, y[8] = 71.5
x[9] = 115.5, y[9] = 177.5
x[10] = 119.5, y[10] = 192.5
x[11] = 155.5, y[11] = 189.5
x[12] = 105.5, y[12] = 119.5
x[13] = 186.5, y[13] = 138.5
x[14] = 72.5, y[14] = 74.5
x[15] = 92.5, y[15] = 18.5
x[16] = 115.5, y[16] = 92.5
x[17] = 152.5, y[17] = 149.5
x[18] = 161.5, y[18] = 113.5
x[19] = 49.5, y[19] = 61.5
x[20] = 32.5, y[20] = 196.5
x[21] = 5.5, y[21] = 50.5
x[22] = 88.5, y[22] = 90.5
x[23] = 71.5, y[23] = 44.5
x[24] = 104.5, y[24] = 26.5
x[25] = 24.5, y[25] = 120.5
x[26] = 126.5, y[26] = 150.5
x[27] = 29.5, y[27] = 21.5
x[28] = 158.5, y[28] = 169.5
x[29] = 176.5, y[29] = 163.5
x[30] = 197.5, y[30] = 175.5
x[31] = 184.5, y[31] = 172.5
x[32] = 154.5, y[32] = 164.5
x[33] = 127.5, y[33] = 119.5
x[34] = 132.5, y[34] = 183.5
x[35] = 142.5, y[35] = 173.5
x[36] = 141.5, y[36] = 137.5
x[37] = 198.5, y[37] = 162.5
x[38] = 182.5, y[38] = 124.5
x[39] = 174.5, y[39] = 115.5
x[40] = 190.5, y[40] = 112.5
x[41] = 167.5, y[41] = 154.5
x[42] = 132.5, y[42] = 164.5
x[43] = 189.5, y[43] = 197.5
x[44] = 182.5, y[44] = 104.5
x[45] = 194.5, y[45] = 157.5
x[46] = 128.5, y[46] = 178.5
x[47] = 163.5, y[47] = 127.5
x[48] = 171.5, y[48] = 195.5
x[49] = 189.5, y[49] = 153.5
Gener=33, Found=50, Good=27, Ghost=23
Generating histogram with 29 peaks

Number of positions = 30
x[0] = 77.5, y[0] = 86.5
x[1] = 171.5, y[1] = 140.5
x[2] = 9.5, y[2] = 59.5
x[3] = 126.5, y[3] = 99.5
x[4] = 152.5, y[4] = 43.5
x[5] = 111.5, y[5] = 169.5
x[6] = 183.5, y[6] = 116.5
x[7] = 71.5, y[7] = 166.5
x[8] = 144.5, y[8] = 59.5
x[9] = 84.5, y[9] = 191.5
x[10] = 146.5, y[10] = 109.5
x[11] = 193.5, y[11] = 144.5
x[12] = 36.5, y[12] = 24.5
x[13] = 64.5, y[13] = 82.5
x[14] = 26.5, y[14] = 97.5
x[15] = 131.5, y[15] = 77.5
x[16] = 10.5, y[16] = 13.5
x[17] = 77.5, y[17] = 25.5
x[18] = 156.5, y[18] = 62.5
x[19] = 82.5, y[19] = 13.5
x[20] = 14.5, y[20] = 29.5
x[21] = 39.5, y[21] = 96.5
x[22] = 169.5, y[22] = 107.5
x[23] = 108.5, y[23] = 62.5
x[24] = 89.5, y[24] = 4.5
x[25] = 171.5, y[25] = 15.5
x[26] = 143.5, y[26] = 2.5
x[27] = 195.5, y[27] = 155.5
x[28] = 175.5, y[28] = 155.5
x[29] = 183.5, y[29] = 131.5
Gener=29, Found=30, Good=27, Ghost=3
Generating histogram with 23 peaks

Number of positions = 49
x[0] = 50.5, y[0] = 167.5
x[1] = 125.5, y[1] = 79.5
x[2] = 12.5, y[2] = 105.5
x[3] = 26.5, y[3] = 109.5
x[4] = 186.5, y[4] = 188.5
x[5] = 110.5, y[5] = 138.5
x[6] = 22.5, y[6] = 173.5
x[7] = 141.5, y[7] = 152.5
x[8] = 89.5, y[8] = 157.5
x[9] = 153.5, y[9] = 21.5
x[10] = 139.5, y[10] = 66.5
x[11] = 84.5, y[11] = 195.5
x[12] = 141.5, y[12] = 36.5
x[13] = 58.5, y[13] = 45.5
x[14] = 127.5, y[14] = 170.5
x[15] = 189.5, y[15] = 164.5
x[16] = 108.5, y[16] = 26.5
x[17] = 146.5, y[17] = 49.5
x[18] = 121.5, y[18] = 99.5
x[19] = 166.5, y[19] = 139.5
x[20] = 96.5, y[20] = 9.5
x[21] = 168.5, y[21] = 171.5
x[22] = 171.5, y[22] = 92.5
x[23] = 93.5, y[23] = 195.5
x[24] = 197.5, y[24] = 190.5
x[25] = 140.5, y[25] = 107.5
x[26] = 152.5, y[26] = 118.5
x[27] = 132.5, y[27] = 100.5
x[28] = 167.5, y[28] = 82.5
x[29] = 139.5, y[29] = 82.5
x[30] = 151.5, y[30] = 172.5
x[31] = 175.5, y[31] = 177.5
x[32] = 155.5, y[32] = 176.5
x[33] = 185.5, y[33] = 147.5
x[34] = 194.5, y[34] = 178.5
x[35] = 175.5, y[35] = 169.5
x[36] = 131.5, y[36] = 186.5
x[37] = 179.5, y[37] = 143.5
x[38] = 78.5, y[38] = 182.5
x[39] = 112.5, y[39] = 154.5
x[40] = 116.5, y[40] = 160.5
x[41] = 139.5, y[41] = 189.5
x[42] = 141.5, y[42] = 196.5
x[43] = 156.5, y[43] = 182.5
x[44] = 160.5, y[44] = 161.5
x[45] = 164.5, y[45] = 77.5
x[46] = 165.5, y[46] = 191.5
x[47] = 179.5, y[47] = 178.5
x[48] = 194.5, y[48] = 150.5
Gener=23, Found=49, Good=23, Ghost=27
Generating histogram with 47 peaks

Number of positions = 77
x[0] = 25.5, y[0] = 97.5
x[1] = 144.5, y[1] = 144.5
x[2] = 25.5, y[2] = 147.5
x[3] = 166.5, y[3] = 122.5
x[4] = 105.5, y[4] = 112.5
x[5] = 30.5, y[5] = 77.5
x[6] = 60.5, y[6] = 182.5
x[7] = 110.5, y[7] = 104.5
x[8] = 131.5, y[8] = 154.5
x[9] = 177.5, y[9] = 186.5
x[10] = 193.5, y[10] = 169.5
x[11] = 51.5, y[11] = 134.5
x[12] = 23.5, y[12] = 113.5
x[13] = 73.5, y[13] = 183.5
x[14] = 147.5, y[14] = 177.5
x[15] = 112.5, y[15] = 158.5
x[16] = 196.5, y[16] = 145.5
x[17] = 71.5, y[17] = 13.5
x[18] = 77.5, y[18] = 73.5
x[19] = 153.5, y[19] = 80.5
x[20] = 40.5, y[20] = 93.5
x[21] = 166.5, y[21] = 21.5
x[22] = 196.5, y[22] = 46.5
x[23] = 109.5, y[23] = 186.5
x[24] = 128.5, y[24] = 64.5
x[25] = 3.5, y[25] = 64.5
x[26] = 96.5, y[26] = 95.5
x[27] = 74.5, y[27] = 139.5
x[28] = 149.5, y[28] = 24.5
x[29] = 166.5, y[29] = 51.5
x[30] = 119.5, y[30] = 140.5
x[31] = 194.5, y[31] = 27.5
x[32] = 152.5, y[32] = 166.5
x[33] = 96.5, y[33] = 110.5
x[34] = 26.5, y[34] = 16.5
x[35] = 14.5, y[35] = 160.5
x[36] = 163.5, y[36] = 156.5
x[37] = 47.5, y[37] = 103.5
x[38] = 188.5, y[38] = 99.5
x[39] = 128.5, y[39] = 76.5
x[40] = 179.5, y[40] = 25.5
x[41] = 107.5, y[41] = 80.5
x[42] = 92.5, y[42] = 144.5
x[43] = 92.5, y[43] = 164.5
x[44] = 132.5, y[44] = 168.5
x[45] = 191.5, y[45] = 196.5
x[46] = 134.5, y[46] = 117.5
x[47] = 164.5, y[47] = 171.5
x[48] = 114.5, y[48] = 171.5
x[49] = 174.5, y[49] = 158.5
x[50] = 187.5, y[50] = 188.5
x[51] = 127.5, y[51] = 109.5
x[52] = 124.5, y[52] = 180.5
x[53] = 178.5, y[53] = 148.5
x[54] = 51.5, y[54] = 114.5
x[55] = 119.5, y[55] = 176.5
x[56] = 182.5, y[56] = 126.5
x[57] = 132.5, y[57] = 194.5
x[58] = 182.5, y[58] = 152.5
x[59] = 96.5, y[59] = 171.5
x[60] = 167.5, y[60] = 173.5
x[61] = 179.5, y[61] = 164.5
x[62] = 60.5, y[62] = 122.5
x[63] = 80.5, y[63] = 154.5
x[64] = 99.5, y[64] = 153.5
x[65] = 118.5, y[65] = 187.5
x[66] = 120.5, y[66] = 104.5
x[67] = 125.5, y[67] = 191.5
x[68] = 142.5, y[68] = 195.5
x[69] = 145.5, y[69] = 128.5
x[70] = 148.5, y[70] = 157.5
x[71] = 153.5, y[71] = 193.5
x[72] = 155.5, y[72] = 144.5
x[73] = 171.5, y[73] = 138.5
x[74] = 182.5, y[74] = 196.5
x[75] = 191.5, y[75] = 130.5
x[76] = 195.5, y[76] = 182.5
Gener=47, Found=77, Good=42, Ghost=35
Generating histogram with 16 peaks

Number of positions = 49
x[0] = 170.5, y[0] = 145.5
x[1] = 179.5, y[1] = 180.5
x[2] = 71.5, y[2] = 48.5
x[3] = 62.5, y[3] = 131.5
x[4] = 125.5, y[4] = 127.5
x[5] = 147.5, y[5] = 23.5
x[6] = 72.5, y[6] = 31.5
x[7] = 35.5, y[7] = 11.5
x[8] = 6.5, y[8] = 117.5
x[9] = 101.5, y[9] = 17.5
x[10] = 81.5, y[10] = 25.5
x[11] = 171.5, y[11] = 189.5
x[12] = 71.5, y[12] = 8.5
x[13] = 51.5, y[13] = 136.5
x[14] = 121.5, y[14] = 142.5
x[15] = 83.5, y[15] = 139.5
x[16] = 177.5, y[16] = 130.5
x[17] = 184.5, y[17] = 168.5
x[18] = 84.5, y[18] = 52.5
x[19] = 155.5, y[19] = 116.5
x[20] = 170.5, y[20] = 122.5
x[21] = 196.5, y[21] = 186.5
x[22] = 164.5, y[22] = 167.5
x[23] = 126.5, y[23] = 187.5
x[24] = 153.5, y[24] = 141.5
x[25] = 151.5, y[25] = 161.5
x[26] = 192.5, y[26] = 149.5
x[27] = 146.5, y[27] = 112.5
x[28] = 145.5, y[28] = 135.5
x[29] = 155.5, y[29] = 147.5
x[30] = 197.5, y[30] = 164.5
x[31] = 151.5, y[31] = 166.5
x[32] = 179.5, y[32] = 164.5
x[33] = 151.5, y[33] = 179.5
x[34] = 192.5, y[34] = 174.5
x[35] = 161.5, y[35] = 178.5
x[36] = 130.5, y[36] = 170.5
x[37] = 130.5, y[37] = 180.5
x[38] = 133.5, y[38] = 145.5
x[39] = 140.5, y[39] = 151.5
x[40] = 141.5, y[40] = 184.5
x[41] = 144.5, y[41] = 155.5
x[42] = 159.5, y[42] = 147.5
x[43] = 159.5, y[43] = 191.5
x[44] = 171.5, y[44] = 156.5
x[45] = 182.5, y[45] = 191.5
x[46] = 183.5, y[46] = 148.5
x[47] = 190.5, y[47] = 181.5
x[48] = 191.5, y[48] = 156.5
Gener=16, Found=49, Good=14, Ghost=35
Generating histogram with 22 peaks

Number of positions = 22
x[0] = 118.5, y[0] = 155.5
x[1] = 192.5, y[1] = 133.5
x[2] = 82.5, y[2] = 190.5
x[3] = 46.5, y[3] = 13.5
x[4] = 137.5, y[4] = 105.5
x[5] = 161.5, y[5] = 121.5
x[6] = 79.5, y[6] = 154.5
x[7] = 92.5, y[7] = 27.5
x[8] = 16.5, y[8] = 105.5
x[9] = 26.5, y[9] = 123.5
x[10] = 86.5, y[10] = 15.5
x[11] = 60.5, y[11] = 58.5
x[12] = 127.5, y[12] = 181.5
x[13] = 46.5, y[13] = 108.5
x[14] = 147.5, y[14] = 29.5
x[15] = 3.5, y[15] = 26.5
x[16] = 150.5, y[16] = 172.5
x[17] = 74.5, y[17] = 133.5
x[18] = 105.5, y[18] = 125.5
x[19] = 50.5, y[19] = 198.5
x[20] = 181.5, y[20] = 64.5
x[21] = 194.5, y[21] = 144.5
Gener=22, Found=22, Good=21, Ghost=1


Draw all canvases

In [6]:
gROOT->GetListOfCanvases()->Draw()