Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:24

0001 {
0002 gROOT->Reset();
0003 #include "Riostream.h"
0004 
0005 ifstream in;
0006 
0007 in.open("diff_Gains_FileName");
0008 
0009 Int_t index;
0010 Float_t diffGains;
0011 int i=0;
0012 Int_t nlines = 0;
0013 TFile *f = new TFile("RootFile","RECREATE");
0014 
0015 TNtuple *ntuple = new TNtuple("DiffGains","data from new ascii file","index:diffGains");
0016 
0017 while (1) {
0018   i++;
0019   in >> index >> diffGains ;
0020   if (!in.good()) break;
0021 
0022   DiffGains->Fill(index,diffGains);
0023   nlines++;
0024 }
0025 
0026 std::cout<<" found nr of lines: "<<nlines<<std::endl;
0027 
0028 in.close();
0029 f->Write();
0030 }
0031 
0032 
0033