#include #include "TString.h" #include "TFile.h" #include "TError.h" #include "TTree.h" //#include "../dataClasses/RawEvent.h" void read2() { // find . -type f | wc -l для подсчёта файлов в папке // cout << gSystem->Load("../libData.so") << endl; gSystem->Load("../libData.so"); using std::cout; using std::endl; Int_t k,n,p,Nchannel,nHun,nDec,counter; TString line1,line2,filename1,filename2; Double_t amp1,amp2,time1,time2; const Int_t nfiles = 5000; const Int_t NEvents = 1000; //Double_t A1[1000],A2[1000]; //Double_t T1[1000],T2[1000]; p=0; TFile *f1 = new TFile("../data/rawDataTektronix/GSItests/1000v_5mv.root","RECREATE"); //TFile *f1 = new TFile("1000V_10mv.root","RECREATE"); TTree *rtree = new TTree("rtree","signal"); /* rtree->Branch("A1",A1,"A1[1000]/D"); rtree->Branch("A2",A2,"A2[1000]/D"); rtree->Branch("T1",T1,"T1[1000]/D"); rtree->Branch("T2",T2,"T2[1000]/D");*/ RawEvent *event1 = new RawEvent(1000); rtree->Bronch("ch0.", "RawEvent", &event1); RawEvent *event2 = new RawEvent(1000); rtree->Bronch("ch1.", "RawEvent", &event2); RawEvent *event3 = new RawEvent(1000); rtree->Bronch("ch2.", "RawEvent", &event3); RawEvent *event4 = new RawEvent(1000); rtree->Bronch("ch3.", "RawEvent", &event4); counter = 0; ifstream myfile1,myfile2; // i=0; for(Int_t i=0; iSetAmp(amp1, j); event2->SetAmp(amp2, j); event1->SetTime(time1, j); event2->SetTime(time2, j); } rtree->Fill(); counter++; //cout<Reset(); event2->Reset(); } myfile1.close(); myfile2.close(); } else{ Error("read2.cpp", "Some error when opening file %s", filename2.Data()); return; } } else{ Error("read2.cpp", "Some error when opening file %s", filename1.Data()); return; }//*/ } //for cout << p << " files processed" << endl; rtree->Write(); f1->Close(); }