File indexing completed on 2024-04-06 11:58:24
0001 {
0002 gROOT->Reset();
0003 #include "Riostream.h"
0004
0005 ifstream in1;
0006 ifstream in2;
0007
0008 in1.open("pedSummary2008_07_29.dat");
0009 in2.open("pedSummary2008_09_02.dat");
0010
0011 Int_t index1, index2;
0012 Float_t peds1, rms1, peds2, rms2;
0013 int i=0;
0014 int j=0;
0015 Int_t nlines1 = 0;
0016 Int_t nlines2 = 0;
0017
0018 TFile *f = new TFile("peds1.root","RECREATE");
0019
0020
0021 TNtuple *ntuple1 = new TNtuple("Peds2","data from new ascii file","index1:peds1:rms1");
0022
0023 while (1) {
0024 i++;
0025 in2 >> index1 >> peds1 >> rms1 ;
0026 if (!in2.good()) break;
0027 Peds2->Fill(index1,peds1,rms1);
0028 nlines1++;
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 }
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 std::cout<<" found nr of lines: "<<nlines1<<" "<<nlines2<<std::endl;
0050 in1.close();
0051 in2.close();
0052 f->Write();
0053 }