Commit 90bdde37 authored by Vratislav Chudoba's avatar Vratislav Chudoba

Data analysed for 4 channels.

parent f6a3f0c4
......@@ -130,7 +130,7 @@ int main(int argc, const char * argv[])
RawEvent *event[4];
for (Int_t i = 0; i<4; i++) {
event[i] = new RawEvent();
bName.Form("ch%d", i);
bName.Form("ch%d.", i);
rtree->Bronch(bName.Data(), "RawEvent", &event[i]);
}
......
......@@ -43,8 +43,8 @@ private:
public:
AEvent();
virtual ~AEvent();ClassDef(AEvent,1)
;
virtual ~AEvent();
ClassDef(AEvent,1);
void SetRawDataFile(const char* inprawfile, const char* treename);
void ProcessEvent();
......
......@@ -5,23 +5,37 @@ void analyse()
TFile *f = new TFile("../data/rawDataDSR4/NeuRad_test_07_1.root");
TTree *tr = (TTree*)f->Get("rtree");
RawEvent *revent = new RawEvent();
tr->SetBranchAddress("rawEvent", &revent);
const Int_t noBranches = 4;
TString bName;
RawEvent *revent[noBranches];
for (Int_t j = 0; j<noBranches; j++) {
revent[j] = new RawEvent();
bName.Form("ch%d", j);
tr->SetBranchAddress(bName.Data(), &revent[j]);
}
// tr->SetMakeClass(1);
TFile *fw = new TFile("../data/dataDSR4/analysis_07_1.root", "RECREATE");
TTree *tw = new TTree("drs4analysis", "title of drs4 analysis tree");
AEvent *wevent = new AEvent();
wevent->SetInputEvent(&revent);
tw->Bronch("AEvent", "AEvent", &wevent);
TTree *tw = new TTree("atree", "title of drs4 analysis tree");
AEvent *wevent[noBranches];
for (Int_t j = 0; j<noBranches; j++) {
wevent[j] = new AEvent();
bName.Form("Ach%d.", j);
wevent[j]->SetInputEvent(&revent[j]);
tw->Bronch(bName.Data(), "AEvent", &wevent[j]);
}
Long64_t nentries = tr->GetEntries();
for(Long64_t i = 0; i < nentries; i++) {
tr->GetEntry(i);
wevent->ProcessEvent();
for (Int_t j = 0; j<noBranches; j++) {
wevent[j]->Reset();
wevent[j]->ProcessEvent();
}
tw->Fill();
}
......
......@@ -3,11 +3,11 @@ void testShowGraphs()
gSystem->Load("../libData.so");
TFile fr("../data/rawDataDSR4/NeuRad_test_07_1.root");
TTree *tr = (TTree*)fr.Get("rtree");
TFile fr("../data/dataDSR4/analysis_07_1.root");
TTree *tr = (TTree*)fr.Get("atree");
RawEvent *revent = new RawEvent();
tr->SetBranchAddress("rawEvent",&revent);
AEvent *revent = new AEvent();
tr->SetBranchAddress("Ach1",&revent);
TGraph *gr[10];
......
#include <TSystem.h>
#include <iostream>
using namespace std;
void try_event_class()
{
gSystem->Load("/home/dariak/NeuRad_tests/macros/event_C.so");
event ev;
ev.GetEntry(499);
ev.Show();
ev.Loop();
}
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