#include #include #include #include #include #include #define NOFCHANNELS 5 using namespace std; int spark() { TCanvas * c1 = new TCanvas("c", "c", 1200, 1200); ifstream ifs("trial_3.txt"); // construct the interface to the file string line; int npoints=0; while(!ifs.eof()){ //count number of lines getline(ifs,line); npoints++; } ifs.close(); TH1F* histo[NOFCHANNELS]; char name[50]; for(int i=0;iSetBinContent(bin,entries[0]); /*for(int i=0;iSetBinContent(bin,entries[i]); }*/ bin++; } /*TSpectrum* peaks = new TSpectrum(); double sigma = 2.; double treshold = 20; int position[1]; peaks -> Search(histo, sigma, "", treshold); peaks -> Print >> position; histo-> GetBinValue */ histo[0]->Draw("C"); /*histo[1]->Draw("Csame"); histo[2]->Draw("Csame"); histo[3]->Draw("Csame"); histo[4]->Draw("Csame"); */ c1->Draw(); }