#include "Riostream.h" #include "TFile.h" #include "TH1.h" #include "TNtuple.h" #include "TTree.h" #include "TBrowser.h" #include "TH2.h" #include "TRandom.h" #include "TClassTable.h" #include "TSystem.h" #include "TROOT.h" #include "iostream" #include "algorithm" void daya_1() { // int a[10] = {0, 7, 7, 6, 1, 1, 5, 5, 8, 9}; int i2=0, i3=0, n=0, i4=0; // cout << n << endl; // for (int i=0; iBranch("x1", &x1, "x1/D"); tree->Branch("x2", &x2, "x2/D"); while(1) { file >> x1 >> x2; if(file.eof()) break; tree -> Fill(); i=i+1; // cout << "x2 " <GetEntries(); // Loop over entries in the tree and store data into the array for (Long64_t j = 0; j < nEntries; j++) { tree->GetEntry(j); c[j] = x2; // Store x2 data into the array } n = unique(c,c+48777)-c; cout << n << endl; for (int i3=0; i3Branch("x2_new", &x2_new, "x2_new/D"); double x11; TBranch* branch_x1 = tree->Branch("x11", &x11, "x11/D"); for (int i5 = 0; i5 < n; i5++) { tree->GetEntry(i5); x2_new = d[i5]; branch_x2->Fill(); branch_x1->Fill(); // Fill "x1" with corresponding values } //cout << "i4=" << i4 << end;; output -> Write(); output -> Close(); file.close(); cout << "total count of events: " <