Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:42:16

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