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