Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:38

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 //TNtuple *ntuple1 = new TNtuple("Peds1","data from ascii file","index1:peds1:rms1:index2:peds2:rms2");
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   while (2) {
0031     j++;
0032     in2 >> index2 >> peds2 >> rms2 ;
0033     if (!in2.good()) break;
0034     Peds1->Fill(index1,peds1,rms1,index2,peds2,rms2);
0035     nlines2++;
0036   }
0037   */
0038 }
0039 
0040 /*
0041 while (1) {
0042   j++; 
0043   in2 >> index2 >> peds2 >> rms2 ;
0044   if (!in2.good()) break;
0045   Peds1->Fill(index1,peds1,rms1,index2,peds2,rms2);
0046   nlines2++;
0047 }
0048 */
0049 std::cout<<" found nr of lines: "<<nlines1<<"  "<<nlines2<<std::endl;
0050 in1.close();
0051 in2.close();
0052 f->Write();
0053 }