diff --git a/convertDRS4/read_root.C b/convertDRS4/read_root.C index 04d5f38146c7a5f04aacd617340ecc2cd4c091b1..38b12991d2acadb071ac5726c94ee8f303c84078 100644 --- a/convertDRS4/read_root.C +++ b/convertDRS4/read_root.C @@ -31,7 +31,7 @@ void read_root() tw->Branch("time1_pos", time1_pos, "time1_pos[1023]/D"); const Long64_t nEntries = tr->GetEntries(); - cout <<"Number of entries: "<Integral(120,180); - cout<<"INtegral "<Integral(120,180)<Integral(120,180)<< std::endl; tw->Fill(); diff --git a/convertTektronix/exp2.root b/convertTektronix/exp2.root index 41595f3b1dd929e45c2e2b2553c81764af4612c4..89c1b247325b02523a365e7641a7ca488e23610e 100644 Binary files a/convertTektronix/exp2.root and b/convertTektronix/exp2.root differ diff --git a/convertTektronix/read.c b/convertTektronix/read.c index 670d9ef12c476586aaca340b8ed9c21045dd4e06..e30cdcc18a7cea1c2ec373086c59eb827dcec129 100644 --- a/convertTektronix/read.c +++ b/convertTektronix/read.c @@ -1,3 +1,11 @@ +#include +#include + +#include "TFile.h" +#include "TTree.h" + +#include "../dataClasses/RawEvent.h" + void read() { //Double_t N[5]; // массив для чисел () //ifstream myfile; @@ -9,41 +17,52 @@ void read() { TFile *f1 = new TFile("exp2.root","RECREATE"); TTree *tree = new TTree("tree","signal"); tree->Branch("A",A,"A[1000]/D"); - tree->Branch("T",T,"T[1000]/D"); - //std::vector *A = new std::vector(); - //tree->Branch("mybranch","vector",A); + tree->Branch("T",T,"T[1000]/D"); + + RawEvent *event = new RawEvent; + rtree->Bronch("rawEvent", "RawEvent", &event); + + + //std::vector *A = new std::vector(); + //tree->Branch("mybranch","vector",A); ifstream myfile1; - myfile1.open("ch12016.12.07-02.11.54.dat"); + myfile1.open("../data/rawDataTektronix/ch12016.12.07-02.11.54.dat"); + + if (!myfile1.is_open()) { + Error("read.c", "Some error when opening file"); + return; + } + for(i = 0; i<100000; i++){ n=i/1000; // if ((i==1002)||(i==900)||(i==2002)||(i==8002)) {cout<> A[i-1000*n]; T[i-1000*n]=5e-013+ (i-1000*n)*1e-010; if(i-1000*n ==999) { - tree->Fill(); + tree->Fill(); for(j=0;j<1000;j++){ T[j]=0;A[j]=0; } - } + } } myfile1.close(); - + ifstream myfile2; myfile2.open("ch12016.12.07-08.48.05.dat"); for(i = 0; i<100000; i++){ n=i/1000; // if ((i==1002)||(i==900)||(i==2002)||(i==8002)) {cout<> A[i-1000*n]; T[i-1000*n]=5e-013+ (i-1000*n)*1e-010; - + if(i-1000*n ==999){ tree->Fill(); for(j=0;j<1000;j++){ T[j]=0;A[j]=0; } - } + } } myfile2.close(); @@ -53,14 +72,14 @@ void read() { n=i/1000;// if ((i==1002)||(i==900)||(i==2002)||(i==8002)) {cout<> A[i-1000*n]; T[i-1000*n]=5e-013+ (i-1000*n)*1e-010; - + if(i-1000*n ==999) { tree->Fill(); for(j=0;j<1000;j++){ T[j]=0;A[j]=0; } - } + } } myfile3.close(); diff --git a/data/dataDSR4/analysis_07_1.root b/data/dataDSR4/analysis_07_1.root index e12c8b7d7c07adb2f88192db7be47f95c1c6a52b..cfec7acb0d50925486bb9ec988fab2c6a8f28a2b 100644 Binary files a/data/dataDSR4/analysis_07_1.root and b/data/dataDSR4/analysis_07_1.root differ diff --git a/data/rawDataDSR4/NeuRad_test_07_1.root b/data/rawDataDSR4/NeuRad_test_07_1.root index 745aa21a08f6e214e988c28ab6902fce71a284bf..6232fe283cef29e9703e75ac25479fcf96ae6263 100644 Binary files a/data/rawDataDSR4/NeuRad_test_07_1.root and b/data/rawDataDSR4/NeuRad_test_07_1.root differ diff --git a/macros/analyse.C b/macros/analyse.C index b31a4591297686cea87c3ab9868e5e12fc8cd392..53d4d61f99be60fc1dc8a62600097c8442830b6a 100644 --- a/macros/analyse.C +++ b/macros/analyse.C @@ -5,7 +5,7 @@ void analyse() TFile *f = new TFile("../data/rawDataDSR4/NeuRad_test_07_1.root"); TTree *tr = (TTree*)f->Get("rtree"); - RawData *revent = new RawData(); + RawEvent *revent = new RawEvent(); tr->SetBranchAddress("rawEvent", &revent); // tr->SetMakeClass(1); @@ -13,14 +13,15 @@ void analyse() TFile *fw = new TFile("../data/dataDSR4/analysis_07_1.root", "RECREATE"); TTree *tw = new TTree("drs4analysis", "title of drs4 analysis tree"); - AnalyzeData *wevent = new AnalyzeData(); - tw->Bronch("AEvent", "AnalyzeData", &wevent); + AEvent *wevent = new AEvent(); + wevent->SetInputEvent(&revent); + tw->Bronch("AEvent", "AEvent", &wevent); Long64_t nentries = tr->GetEntries(); for(Long64_t i = 0; i < nentries; i++) { tr->GetEntry(i); - wevent->ProcessEvent(revent); + wevent->ProcessEvent(); tw->Fill(); }