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