Commit b97053e0 authored by Vratislav Chudoba's avatar Vratislav Chudoba

Classes internal structure modified. Graph added to class AEvent.

parent f8d63419
...@@ -333,6 +333,9 @@ int main(int argc, const char * argv[]) ...@@ -333,6 +333,9 @@ int main(int argc, const char * argv[])
sumdt2 += dt*dt; sumdt2 += dt*dt;
} }
} //end of the boards loop } //end of the boards loop
// event->SetGraphs();
rtree->Fill(); rtree->Fill();
} // end of the events loop } // end of the events loop
......
#include "TF1.h"
void IntegralFULL(){ void IntegralFULL(){
Int_t j,i,nentry,NumM; Int_t j,i,nentry,NumM;
......
/*
* AEvent.cpp
*
* Created on: Dec 28, 2016
* Author: daria
*/
#include "AEvent.h"
AEvent::AEvent() : fNPoints(1024) {
// TODO Auto-generated constructor stub
Init();
Reset();
}
AEvent::~AEvent() {
// TODO Auto-generated destructor stub
delete gSignal;
}
void AEvent::SetRawDataFile(const char* inprawfile, const char* treename) {
TString iFileName = inprawfile;
TFile *fraw = new TFile(iFileName.Data());
if ( !fraw->IsOpen() ) {
Error("SetRawDataFile", "File %s was not opened and won't be processed", iFileName.Data());
}
TTree *traw = (TTree*)fraw->Get(treename);
if (!traw) {
Error("SetRawDataFile", "Tree %s was not found in file %s", treename, iFileName.Data());
}
}
void AEvent::ProcessEvent() {
if (fInputEvent == NULL) {
Warning("AEvent::ProcessEvent", "Input event wasn't set. Function won't be processed.");
return;
}
const Double_t *amp = fInputEvent->GetAmp();
const Double_t *time = fInputEvent->GetTime();
for(Int_t j = 0; j < NCELLS; j++) {
fAmpPos[j] = amp[j]*(-1.);
fTime[j] = time[j];
}
Double_t maxAmp = 0.;
Double_t maxAmpT = 0.;
maxAmp = fAmpPos[0];
for(Int_t j=0; j<NCELLS; j++) {
if(fAmpPos[j] > maxAmp) {
maxAmp = fAmpPos[j];
maxAmpT = fTime[j];
}
}
fAmpMax = maxAmp;
fTimeAmpMax = maxAmpT;
return;
}
void AEvent::Reset() {
for (Int_t i = 0; i < NCELLS; i++) {
fAmpPos[i] = 0;
fTime[i] = 0;
}
fAmpMax = 0.;
fTimeAmpMax = 0.;
}
void AEvent::SetInputEvent(RawEvent** event) {
if (event == 0) {
Warning("AEvent::SetInputEvent", "Input event was set as 0.");
}
fInputEvent = *event;
}
void AEvent::Init() {
gSignal = new TGraph();
fInputEvent = 0;
}
void AEvent::SetGraphs() {
gSignal->Set(fNPoints);
for (Int_t i=0; i<fNPoints; i++) {
gSignal->SetPoint(i, fTime[i], fAmpPos[i]);
}
return;
}
/*
* AEvent.h
*
* Created on: Dec 28, 2016
* Author: daria
*/
#ifndef DATACLASSES_AEVENT_H_
#define DATACLASSES_AEVENT_H_
#include <iostream>
#include <fstream>
#include <iomanip>
#include <sstream>
#include "TError.h"
#include "TString.h"
#include "TTree.h"
#include "TFile.h"
//#include "TMath.h"
#include "RawEvent.h"
#define NCELLS 1024
using std::cout;
using std::endl;
class AEvent {
private:
const Int_t fNPoints; //!
Double_t fAmpPos[NCELLS]; //array for raw amplitudes
Double_t fTime[NCELLS]; //array for raw times
Double_t fAmpMax;
Double_t fTimeAmpMax;
TGraph *gSignal;
RawEvent *fInputEvent; //!
public:
AEvent();
virtual ~AEvent();ClassDef(AEvent,1)
;
void SetRawDataFile(const char* inprawfile, const char* treename);
void ProcessEvent();
// void Integral()
void SetInputEvent(RawEvent** event);
void Reset();
//Resets arrays to zeros
void SetGraphs();
TGraph* GetGraph() {
return gSignal;
}
private:
void Init();
};
#endif /* DATACLASSES_AEVENT_H_ */
/*
* RawEvent.cpp
*
* Created on: Dec 27, 2016
* Author: vratik
*/
#include "RawEvent.h"
RawEvent::RawEvent() : fNPoints(1024) {
// TODO Auto-generated constructor stub
Init();
}
RawEvent::RawEvent(const Int_t npoints) : fNPoints(npoints) {
// TODO Auto-generated constructor stub
Init();
}
RawEvent::~RawEvent() {
// TODO Auto-generated destructor stub
}
void RawEvent::Init() {
fAmp.Set(fNPoints);
fTime.Set(fNPoints);
}
void RawEvent::Reset() {
for (Int_t i = 0; i < fNPoints; i++) {
fAmp[i] = 0;
fTime[i] = 0;
}
// TODO how to deal with graphs?
}
void RawEvent::PrintTime(Int_t i) {
cout << fTime[i] << endl;
}
void RawEvent::PrintAmp(Int_t i) {
cout << fAmp[i] << endl;
}
void RawEvent::SetAmp(Double_t a, Int_t i) {
if (i >= fNPoints) {
cout << "Error: array with raw amplitudes is overloaded!" << endl;
return;
}
fAmp[i] = a;
return;
}
void RawEvent::SetTime(Double_t t, Int_t i) {
if (i >=fNPoints) {
cout << "Error: array with raw times is overloaded!" << endl;
return;
}
fTime[i] = t;
return;
}
//void RawEvent::SetGraphs() {
//
// gAmp->Set(fNPoints);
//
// for (Int_t i=0; i<fNPoints; i++) {
// gAmp->SetPoint(i, fTime[i], fAmp[i]);
// }
//
// return;
//}
/*
* RawEvent.h
*
* Created on: Dec 27, 2016
* Author: vratik
*/
#ifndef DATACLASSES_RAWEVENT_H_
#define DATACLASSES_RAWEVENT_H_
#include <iostream>
//#include "Rtypes.h"
#include "TError.h"
#include "TGraph.h"
#include "TArrayD.h"
//#define NCELLS 1024
using std::cout;
using std::endl;
class RawEvent {
private:
// Double_t fAmp[NCELLS]; //array for raw amplitudes
// Double_t fTime[NCELLS]; //array for raw times
TArrayD fAmp; //array for raw amplitudes
TArrayD fTime; //array for raw times
const Int_t fNPoints; //!
// TGraph *gAmp;
//public:
// TArrayD fAmpA;
public:
RawEvent();
RawEvent(const Int_t npoints);
virtual ~RawEvent();
ClassDef(RawEvent,1);
void Reset();
//Resets arrays to zeros
const Double_t* GetAmp() const { return fAmp.GetArray(); }
const Double_t* GetTime() const { return fTime.GetArray(); }
void SetAmp(Double_t a, Int_t i);
//Takes amplitude (raw data, voltage from binary file)
//and places it in the array Amp[NCELLS]
void SetTime(Double_t t, Int_t i);
//Takes time (raw data, times from binary file)
//and places it in the array Time[NCELLS]
void PrintAmp(Int_t i);
//Prints i amplitudes (to make sense i shold be NCELLS)
void PrintTime(Int_t i);
// void InvertAmp(Double_t a, Int_t i);
//Inverts the amplitudes i.e. makes from negative singals
//posititve signals and vise versa.
// void SetGraphs();
// TGraph* GetGraph() {
// return gAmp;
// }
private:
void Init();
};
#endif /* DATACLASSES_RAWEVENT_H_ */
...@@ -31,90 +31,4 @@ void analyse() ...@@ -31,90 +31,4 @@ void analyse()
fw->Close(); fw->Close();
return; return;
// tr->SetBranchAddress("amp_ch1", ampl1);
// tr->SetBranchAddress("time_ch1", time1);
// tr->SetBranchAddress("ncell", ncells);
tw->Branch("maxAmplitude1", &maxAmplitude1, "maxAmplitude1/D");
tw->Branch("timemaxAmplitude1", &timemaxAmplitude1, "timemaxAmplitude1/D");
tw->Branch("ampl1_pos", ampl1_pos, "ampl1_pos[1023]/D"); //branch for positive signals
tw->Branch("time1_pos", time1_pos, "time1_pos[1023]/D");
const Long64_t nEntries = tr->GetEntries();
cout <<"Number of entries: "<<nEntries<<endl;
//----for pictures
/* TCanvas *c1 = new TCanvas();
c1->Divide(3,4);
for(Int_t i=12; i<24; i++) {
c1->cd(i-11);
tr->GetEntry(i);
TGraph *gr1 = new TGraph(1023, time1, ampl1);
gr1->SetTitle("Signal shape for one event");
gr1->GetXaxis();
gr1->Draw("Al*");
}
tr->GetEntry(499);
TGraph *gr1 = new TGraph(1023, time1, ampl1);
gr1->SetTitle("Signal shape for one event");
gr1->Draw("Al*");*/
//-----
Double_t maxAmpl1 = 0.;
Double_t timemaxAmpl1 = 0.;
for(Int_t i=0; i<tr->GetEntries(); i++) {
tr->GetEntry(i);
//changing polarity of the signal
for(Int_t j=0; j<1023; j++) {
ampl1_pos[j] = ampl1[j]*(-1.);
time1_pos[j] = time1[j];
}
//find maximum by hand
maxAmpl1 = ampl1_pos[0];
for(Int_t j=0; j<1023; j++) {
if(ampl1_pos[j] > maxAmpl1) {
maxAmpl1 = ampl1_pos[j];
timemaxAmpl1 = time1_pos[j];
}
//cout<<"Time "<<i<<" "<<j<<" "<<time1[j]<<endl;
//cout<<"Amplitude "<<i<<" "<<j<<" "<<ampl1[j]<<endl;
//cout<<endl;
}
maxAmplitude1 = maxAmpl1;
timemaxAmplitude1 = timemaxAmpl1;
cout<<"Max amplitude "<<maxAmpl1<<" for entry "<<i<<endl;
cout<<"Time for max amplitude "<<timemaxAmpl1<<" for entry "<<i<<endl;
//fitting 90 percent of rising edge
for(Int_t k=0; k<1023; k++) {
if(ampl1[k] > 0.1*maxAmpl1 && ampl1[k] < 0.9*maxAmpl1) { //we have negative signals, amplitude between 10 and 90 proc from maximum
/*cout<<"rjgnfre"<<endl;
TGraph *gr2 = new TGraph(1023, time1, ampl1);
gr2->SetTitle("stupido");
gr2->Fit("pol1");
gr2->Draw("Al*");*/
}
}
//getting integral
TGraph *gr3 = new TGraph(1023, time1, ampl1_pos);
gr3->Integral(120,180);
cout<<"INtegral "<<gr3->Integral(120,180)<<endl;
tw->Fill();
}
tw->GetEntry(498);
TGraph *gr2 = new TGraph(1023, time1_pos, ampl1_pos);
gr2->SetTitle("Signal shape for one gsgsg event");
gr2->Draw("Al*");
fw->cd();
tw->Write();
fw->Close();
} }
#define event_cxx
#include "event.h"
#include <TH2.h>
#include <TStyle.h>
#include <TCanvas.h>
#include <iostream>
void event::Loop()
{
// In a ROOT session, you can do:
// Root > .L event.C
// Root > event t
// Root > t.GetEntry(12); // Fill t data members with entry number 12
// Root > t.Show(); // Show values of entry 12
// Root > t.Show(16); // Read and show values of entry 16
// Root > t.Loop(); // Loop on all entries
//
// This is the loop skeleton where:
// jentry is the global entry number in the chain
// ientry is the entry number in the current Tree
// Note that the argument to GetEntry must be:
// jentry for TChain::GetEntry
// ientry for TTree::GetEntry and TBranch::GetEntry
//
// To read only selected branches, Insert statements like:
// METHOD1:
// fChain->SetBranchStatus("*",0); // disable all branches
// fChain->SetBranchStatus("branchname",1); // activate branchname
// METHOD2: replace line
// fChain->GetEntry(jentry); //read all branches
//by b_branchname->GetEntry(ientry); //read only this branch
if (fChain == 0) return;
Long64_t nentries = fChain->GetEntriesFast();
Long64_t nbytes = 0, nb = 0;
for (Long64_t jentry=0; jentry<nentries;jentry++) {
Long64_t ientry = LoadTree(jentry);
if (ientry < 0) break;
nb = fChain->GetEntry(jentry); nbytes += nb;
// if (Cut(ientry) < 0) continue;
//----Daria added
TGraph *gr3 = new TGraph(1023, time1_pos, ampl1_pos);
gr3->Integral(120,180);
cout<<"INtegral "<<gr3->Integral(120,180)<<endl;
gr3->Draw();
}
}
#define event_cxx
#include "event.h"
#include <TH2.h>
#include <TStyle.h>
#include <TCanvas.h>
void event::Loop()
{
// In a ROOT session, you can do:
// Root > .L event.C
// Root > event t
// Root > t.GetEntry(12); // Fill t data members with entry number 12
// Root > t.Show(); // Show values of entry 12
// Root > t.Show(16); // Read and show values of entry 16
// Root > t.Loop(); // Loop on all entries
//
// This is the loop skeleton where:
// jentry is the global entry number in the chain
// ientry is the entry number in the current Tree
// Note that the argument to GetEntry must be:
// jentry for TChain::GetEntry
// ientry for TTree::GetEntry and TBranch::GetEntry
//
// To read only selected branches, Insert statements like:
// METHOD1:
// fChain->SetBranchStatus("*",0); // disable all branches
// fChain->SetBranchStatus("branchname",1); // activate branchname
// METHOD2: replace line
// fChain->GetEntry(jentry); //read all branches
//by b_branchname->GetEntry(ientry); //read only this branch
if (fChain == 0) return;
Long64_t nentries = fChain->GetEntriesFast();
Long64_t nbytes = 0, nb = 0;
for (Long64_t jentry=0; jentry<nentries;jentry++) {
Long64_t ientry = LoadTree(jentry);
if (ientry < 0) break;
nb = fChain->GetEntry(jentry); nbytes += nb;
// if (Cut(ientry) < 0) continue;
//----Daria added
TGraph *gr3 = new TGraph(1023, time1_pos, ampl1_pos);
gr3->Integral(120,180);
cout<<"INtegral "<<gr3->Integral(120,180)<<endl;
gr3->Draw();
}
}
//////////////////////////////////////////////////////////
// This class has been automatically generated on
// Mon Dec 26 16:40:43 2016 by ROOT version 5.34/36
// from TTree drs4analysis/title of drs4 analysis tree
// found on file: ../data/dataDSR4/analysis_07_1.root
//////////////////////////////////////////////////////////
#ifndef event_h
#define event_h
#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>
#include <TGraph.h>
// Header file for the classes stored in the TTree if any.
// Fixed size dimensions of array or collections stored in the TTree if any.
class event {
public :
TTree *fChain; //!pointer to the analyzed TTree or TChain
Int_t fCurrent; //!current Tree number in a TChain
// Declaration of leaf types
Double_t maxAmplitude1;
Double_t timemaxAmplitude1;
Double_t ampl1_pos[1023];
Double_t time1_pos[1023];
// List of branches
TBranch *b_maxAmplitude1; //!
TBranch *b_timemaxAmplitude1; //!
TBranch *b_ampl1_pos; //!
TBranch *b_time1_pos; //!
event(TTree *tree=0);
virtual ~event();
virtual Int_t Cut(Long64_t entry);
virtual Int_t GetEntry(Long64_t entry);
virtual Long64_t LoadTree(Long64_t entry);
virtual void Init(TTree *tree);
virtual void Loop();
virtual Bool_t Notify();
virtual void Show(Long64_t entry = -1);
};
#endif
#ifdef event_cxx
event::event(TTree *tree) : fChain(0)
{
// if parameter tree is not specified (or zero), connect the file
// used to generate this class and read the Tree.
if (tree == 0) {
TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("../data/dataDSR4/analysis_07_1.root");
if (!f || !f->IsOpen()) {
f = new TFile("../data/dataDSR4/analysis_07_1.root");
}
f->GetObject("drs4analysis",tree);
}
Init(tree);
}
event::~event()
{
if (!fChain) return;
delete fChain->GetCurrentFile();
}
Int_t event::GetEntry(Long64_t entry)
{
// Read contents of entry.
if (!fChain) return 0;
return fChain->GetEntry(entry);
}
Long64_t event::LoadTree(Long64_t entry)
{
// Set the environment to read one entry
if (!fChain) return -5;
Long64_t centry = fChain->LoadTree(entry);
if (centry < 0) return centry;
if (fChain->GetTreeNumber() != fCurrent) {
fCurrent = fChain->GetTreeNumber();
Notify();
}
return centry;
}
void event::Init(TTree *tree)
{
// The Init() function is called when the selector needs to initialize
// a new tree or chain. Typically here the branch addresses and branch
// pointers of the tree will be set.
// It is normally not necessary to make changes to the generated
// code, but the routine can be extended by the user if needed.
// Init() will be called many times when running on PROOF
// (once per file to be processed).
// Set branch addresses and branch pointers
if (!tree) return;
fChain = tree;
fCurrent = -1;
fChain->SetMakeClass(1);
fChain->SetBranchAddress("maxAmplitude1", &maxAmplitude1, &b_maxAmplitude1);
fChain->SetBranchAddress("timemaxAmplitude1", &timemaxAmplitude1, &b_timemaxAmplitude1);
fChain->SetBranchAddress("ampl1_pos", ampl1_pos, &b_ampl1_pos);
fChain->SetBranchAddress("time1_pos", time1_pos, &b_time1_pos);
Notify();
}
Bool_t event::Notify()
{
// The Notify() function is called when a new file is opened. This
// can be either for a new TTree in a TChain or when when a new TTree
// is started when using PROOF. It is normally not necessary to make changes
// to the generated code, but the routine can be extended by the
// user if needed. The return value is currently not used.
return kTRUE;
}
void event::Show(Long64_t entry)
{
// Print contents of entry.
// If entry is not specified, print current entry
if (!fChain) return;
fChain->Show(entry);
}
Int_t event::Cut(Long64_t entry)
{
// This function may be called from Loop.
// returns 1 if entry is accepted.
// returns -1 otherwise.
return 1;
}
#endif // #ifdef event_cxx
//////////////////////////////////////////////////////////
// This class has been automatically generated on
// Mon Dec 26 16:40:43 2016 by ROOT version 5.34/36
// from TTree drs4analysis/title of drs4 analysis tree
// found on file: ../data/dataDSR4/analysis_07_1.root
//////////////////////////////////////////////////////////
#ifndef event_h
#define event_h
#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>
// Header file for the classes stored in the TTree if any.
// Fixed size dimensions of array or collections stored in the TTree if any.
class event {
public :
TTree *fChain; //!pointer to the analyzed TTree or TChain
Int_t fCurrent; //!current Tree number in a TChain
// Declaration of leaf types
Double_t maxAmplitude1;
Double_t timemaxAmplitude1;
Double_t ampl1_pos[1023];
Double_t time1_pos[1023];
// List of branches
TBranch *b_maxAmplitude1; //!
TBranch *b_timemaxAmplitude1; //!
TBranch *b_ampl1_pos; //!
TBranch *b_time1_pos; //!
event(TTree *tree=0);
virtual ~event();
virtual Int_t Cut(Long64_t entry);
virtual Int_t GetEntry(Long64_t entry);
virtual Long64_t LoadTree(Long64_t entry);
virtual void Init(TTree *tree);
virtual void Loop();
virtual Bool_t Notify();
virtual void Show(Long64_t entry = -1);
};
#endif
#ifdef event_cxx
event::event(TTree *tree) : fChain(0)
{
// if parameter tree is not specified (or zero), connect the file
// used to generate this class and read the Tree.
if (tree == 0) {
TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("../data/dataDSR4/analysis_07_1.root");
if (!f || !f->IsOpen()) {
f = new TFile("../data/dataDSR4/analysis_07_1.root");
}
f->GetObject("drs4analysis",tree);
}
Init(tree);
}
event::~event()
{
if (!fChain) return;
delete fChain->GetCurrentFile();
}
Int_t event::GetEntry(Long64_t entry)
{
// Read contents of entry.
if (!fChain) return 0;
return fChain->GetEntry(entry);
}
Long64_t event::LoadTree(Long64_t entry)
{
// Set the environment to read one entry
if (!fChain) return -5;
Long64_t centry = fChain->LoadTree(entry);
if (centry < 0) return centry;
if (fChain->GetTreeNumber() != fCurrent) {
fCurrent = fChain->GetTreeNumber();
Notify();
}
return centry;
}
void event::Init(TTree *tree)
{
// The Init() function is called when the selector needs to initialize
// a new tree or chain. Typically here the branch addresses and branch
// pointers of the tree will be set.
// It is normally not necessary to make changes to the generated
// code, but the routine can be extended by the user if needed.
// Init() will be called many times when running on PROOF
// (once per file to be processed).
// Set branch addresses and branch pointers
if (!tree) return;
fChain = tree;
fCurrent = -1;
fChain->SetMakeClass(1);
fChain->SetBranchAddress("maxAmplitude1", &maxAmplitude1, &b_maxAmplitude1);
fChain->SetBranchAddress("timemaxAmplitude1", &timemaxAmplitude1, &b_timemaxAmplitude1);
fChain->SetBranchAddress("ampl1_pos", ampl1_pos, &b_ampl1_pos);
fChain->SetBranchAddress("time1_pos", time1_pos, &b_time1_pos);
Notify();
}
Bool_t event::Notify()
{
// The Notify() function is called when a new file is opened. This
// can be either for a new TTree in a TChain or when when a new TTree
// is started when using PROOF. It is normally not necessary to make changes
// to the generated code, but the routine can be extended by the
// user if needed. The return value is currently not used.
return kTRUE;
}
void event::Show(Long64_t entry)
{
// Print contents of entry.
// If entry is not specified, print current entry
if (!fChain) return;
fChain->Show(entry);
}
Int_t event::Cut(Long64_t entry)
{
// This function may be called from Loop.
// returns 1 if entry is accepted.
// returns -1 otherwise.
return 1;
}
#endif // #ifdef event_cxx
# DO NOT DELETE
./event_C.so: event.h /usr/include/root/TROOT.h
./event_C.so: /usr/include/root/TDirectory.h /usr/include/root/TNamed.h
./event_C.so: /usr/include/root/TObject.h /usr/include/root/Rtypes.h
./event_C.so: /usr/include/root/RConfig.h /usr/include/root/RVersion.h
./event_C.so: /usr/include/root/DllImport.h /usr/include/root/Rtypeinfo.h
./event_C.so: /usr/include/root/snprintf.h /usr/include/root/strlcpy.h
./event_C.so: /usr/include/root/TGenericClassInfo.h
./event_C.so: /usr/include/root/TSchemaHelper.h /usr/include/root/TStorage.h
./event_C.so: /usr/include/root/TVersionCheck.h /usr/include/root/Riosfwd.h
./event_C.so: /usr/include/root/TBuffer.h /usr/include/root/TString.h
./event_C.so: /usr/include/root/TMathBase.h /usr/include/root/TList.h
./event_C.so: /usr/include/root/TSeqCollection.h
./event_C.so: /usr/include/root/TCollection.h /usr/include/root/TIterator.h
./event_C.so: /usr/include/root/TDatime.h /usr/include/root/TUUID.h
./event_C.so: /usr/include/root/TChain.h /usr/include/root/TTree.h
./event_C.so: /usr/include/root/TBranch.h /usr/include/root/TObjArray.h
./event_C.so: /usr/include/root/TAttFill.h /usr/include/root/TDataType.h
./event_C.so: /usr/include/root/TDictionary.h /usr/include/root/Property.h
./event_C.so: /usr/include/root/ESTLType.h /usr/include/root/TAttLine.h
./event_C.so: /usr/include/root/TAttMarker.h /usr/include/root/TArrayD.h
./event_C.so: /usr/include/root/TArray.h /usr/include/root/TArrayI.h
./event_C.so: /usr/include/root/TClass.h /usr/include/root/TObjString.h
./event_C.so: /usr/include/root/ThreadLocalStorage.h
./event_C.so: /usr/include/root/RConfigure.h
./event_C.so: /usr/include/root/TVirtualTreePlayer.h
./event_C.so: /usr/include/root/TFile.h /usr/include/root/TDirectoryFile.h
./event_C.so: /usr/include/root/TMap.h /usr/include/root/THashTable.h
./event_C.so: /usr/include/root/TUrl.h /usr/include/root/TGraph.h
./event_C.so: /usr/include/root/TVectorFfwd.h /usr/include/root/TVectorDfwd.h
./event_C.so: /usr/include/root/TFitResultPtr.h /usr/include/root/TH2.h
./event_C.so: /usr/include/root/TH1.h /usr/include/root/TAxis.h
./event_C.so: /usr/include/root/TAttAxis.h /usr/include/root/TArrayC.h
./event_C.so: /usr/include/root/TArrayS.h /usr/include/root/TArrayF.h
./event_C.so: /usr/include/root/Foption.h /usr/include/root/TMatrixFBasefwd.h
./event_C.so: /usr/include/root/TMatrixDBasefwd.h /usr/include/root/TStyle.h
./event_C.so: /usr/include/root/TAttText.h /usr/include/root/TCanvas.h
./event_C.so: /usr/include/root/TPad.h /usr/include/root/TVirtualPad.h
./event_C.so: /usr/include/root/TAttPad.h /usr/include/root/TVirtualX.h
./event_C.so: /usr/include/root/GuiTypes.h /usr/include/root/Buttons.h
./event_C.so: /usr/include/root/TQObject.h /usr/include/root/TAttBBox2D.h
./event_C.so: /usr/include/root/TPoint.h /usr/include/root/TAttCanvas.h
./event_C.so: /usr/include/root/TCanvasImp.h
./event_C.so: /usr/include/root/cintdictversion.h /usr/include/root/RVersion.h
event_C__ROOTBUILDVERSION= 5.34/36
{
TFile fr("../data/dataDSR4/analysis_07_1.root");
TTree *tr = (TTree*)fr.Get("drs4analysis");
tr->MakeClass("event");
}
{
TFile fr("../data/dataDSR4/analysis_07_1.root");
TTree *tr = (TTree*)fr.Get("drs4analysis");
tr->MakeClass("event");
// gSystem->Load("/home/dariak/NeuRad_tests/macros/event_C.so");
// event ev;
// ev.
}
//void test() void test()
{ {
gSystem->Load("../libData.so"); gSystem->Load("../libData.so");
RawData o; TFile fr("../data/rawDataDSR4/NeuRad_test_07_1.root");
TTree *tr = (TTree*)fr.Get("rtree");
Double_t *m = o.GetAmp(); RawEvent *revent = new RawEvent();
tr->SetBranchAddress("rawEvent",&revent);
for(Int_t i = 0; i < 1024; i++) { TGraph *gr[10];
m[i] = 1;
for (Int_t i = 0; i < 10; i++) {
gr[i] = 0;
tr->GetEntry(i+28);
gr[i] = new TGraph(*revent->GetGraph());
}
auto c1 = new TCanvas("c1","test",10,10,1000,600);
c1->Divide(3,2);
for (Int_t i = 0; i < 6; i++) {
c1->cd(i+1);
gr[i]->Draw();
} }
o.Print(); // c1->cd(2);
// tr->Draw("gAmp.Draw()","","goff",1,124);
} }
void testShowGraphs()
{
gSystem->Load("../libData.so");
TFile fr("../data/rawDataDSR4/NeuRad_test_07_1.root");
TTree *tr = (TTree*)fr.Get("rtree");
RawEvent *revent = new RawEvent();
tr->SetBranchAddress("rawEvent",&revent);
TGraph *gr[10];
for (Int_t i = 0; i < 10; i++) {
gr[i] = 0;
tr->GetEntry(i+28);
gr[i] = new TGraph(*revent->GetGraph());
}
auto c1 = new TCanvas("c1","test",10,10,1000,600);
c1->Divide(3,2);
for (Int_t i = 0; i < 6; i++) {
c1->cd(i+1);
gr[i]->Draw();
}
// c1->cd(2);
// tr->Draw("gAmp.Draw()","","goff",1,124);
}
#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(501);
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