Commit f8d63419 authored by Vratislav Chudoba's avatar Vratislav Chudoba

Functionality in event classes was modified. Branch with event class was added...

Functionality in event classes was modified. Branch with event class was added to convertTektronix application.
parent 7f1eef39
......@@ -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: "<<nEntries<<endl;
std::cout <<"Number of entries: "<<nEntries<<std::endl;
//----for pictures
/* TCanvas *c1 = new TCanvas();
......@@ -76,8 +76,8 @@ void read_root()
}
maxAmplitude1 = maxAmpl1;
timemaxAmplitude1 = timemaxAmpl1;
cout<<"Max amplitude "<<maxAmpl1<<" for entry "<<i<<endl;
cout<<"Time for max amplitude "<<timemaxAmpl1<<" for entry "<<i<<endl;
std::cout<<"Max amplitude "<<maxAmpl1<<" for entry "<<i<< std::endl;
std::cout<<"Time for max amplitude "<<timemaxAmpl1<<" for entry "<<i<< std::endl;
//fitting 90 percent of rising edge
for(Int_t k=0; k<1023; k++) {
......@@ -93,7 +93,7 @@ void read_root()
//getting integral
TGraph *gr3 = new TGraph(1023, time1, ampl1_pos);
gr3->Integral(120,180);
cout<<"INtegral "<<gr3->Integral(120,180)<<endl;
std::cout << "INtegral "<<gr3->Integral(120,180)<< std::endl;
tw->Fill();
......
#include <iostream>
#include <fstream>
#include "TFile.h"
#include "TTree.h"
#include "../dataClasses/RawEvent.h"
void read() {
//Double_t N[5]; // массив для чисел ()
//ifstream myfile;
......@@ -10,11 +18,22 @@ void read() {
TTree *tree = new TTree("tree","signal");
tree->Branch("A",A,"A[1000]/D");
tree->Branch("T",T,"T[1000]/D");
RawEvent *event = new RawEvent;
rtree->Bronch("rawEvent", "RawEvent", &event);
//std::vector<Double_t> *A = new std::vector<Double_t>();
//tree->Branch("mybranch","vector<Double_t>",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<<i<<" "<<n<<endl;}
myfile1 >> A[i-1000*n];
......
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment