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 in;
0006 
0007 in.open("diff_Peds_FileName");
0008 
0009 Int_t index;
0010 Float_t diffPeds;
0011 int i=0;
0012 Int_t nlines = 0;
0013 TFile *f = new TFile("RootFile","RECREATE");
0014 
0015 TNtuple *ntuple = new TNtuple("DiffPeds","data from new ascii file","index:diffPeds");
0016 
0017 while (1) {
0018   i++;
0019   in >> index >> diffPeds ;
0020   if (!in.good()) break;
0021 
0022   DiffPeds->Fill(index,diffPeds);
0023   nlines++;
0024 }
0025 
0026 std::cout<<" found nr of lines: "<<nlines<<std::endl;
0027 
0028 in.close();
0029 f->Write();
0030 }
0031 
0032