Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NeuRad_tests
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vratislav Chudoba
NeuRad_tests
Commits
d4f67dde
Commit
d4f67dde
authored
Apr 17, 2017
by
Muzalevsky I.A
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macro for drawing 1elec signals added
parent
8122863f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
126 additions
and
0 deletions
+126
-0
DrawElNoizeSignal.cxx
macros/DrawElNoizeSignal.cxx
+126
-0
No files found.
macros/DrawElNoizeSignal.cxx
0 → 100644
View file @
d4f67dde
#include <TTree.h>
#include <TGraph.h>
#include <TFile.h>
#include <TSystem.h>
#include <TCanvas.h>
#include "TStyle.h"
void
testShowGraphs
()
{
using
std
::
cout
;
using
std
::
endl
;
gStyle
->
SetCanvasDefH
(
900
);
gStyle
->
SetCanvasDefW
(
1500
);
const
char
*
foldername
=
"7_8"
;
const
char
*
ext
=
".gif"
;
gSystem
->
Load
(
"../libData.so"
);
const
Long64_t
kFirstEvent
=
0
;
// TFile fr("../data/dataDSR4/analysis_08_2.root");
//TFile fr("../data/dataTektronix/GSItests/1000V_trigg40mv/30_60_10_50_GSI.root");
//TFile fr("../data/dataTektronix/GSItests/1000V_trigg20mv/analyze.root");
// /data/dataTektronix/GSItests/1000V_trigg5mv
TFile
fr
(
"../data/dataTektronix/GSItests/1000V_trigg5mv/analize1.root"
);
TTree
*
tr
=
(
TTree
*
)
fr
.
Get
(
"atree"
);
AEvent
*
revent
=
new
AEvent
(
1000
);
AEvent
*
revent1
=
new
AEvent
(
1000
);
tr
->
SetBranchAddress
(
"Ach0."
,
&
revent
);
tr
->
SetBranchAddress
(
"Ach1."
,
&
revent1
);
TGraph
*
gr
[
16
];
TGraph
*
gr1
[
16
];
Double_t
t10
[
16
];
Double_t
t90
[
16
];
Double_t
charge0
,
charge1
;
Int_t
counter
=
0
;
Long64_t
nEntries
=
tr
->
GetEntries
();
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"test"
,
10
,
10
,
1000
,
600
);
c1
->
Divide
(
4
,
4
);
//loop over events
for
(
Int_t
j
=
0
+
kFirstEvent
;
j
<
nEntries
;
j
++
)
{
tr
->
GetEntry
(
j
);
charge0
=
revent
->
GetfChargeCFD
();
charge1
=
revent1
->
GetfChargeCFD
();
if
(
((
charge0
-
charge1
)
<
0.1
)
&&
((
charge0
-
charge1
)
>
-
0.1
)
)
continue
;
// отбор по событиям по заряду
gr
[
counter
]
=
new
TGraph
(
*
revent
->
GetGraphSignal
());
gr1
[
counter
]
=
new
TGraph
(
*
revent1
->
GetGraphSignal
());
if
(
counter
==
7
)
break
;
counter
++
;
}
// cout<<counter<<endl;
// return;
for
(
Int_t
k
=
0
;
k
<
8
;
k
++
)
{
gr
[
k
]
->
GetXaxis
()
->
SetTitle
(
"Time [ns]"
);
gr
[
k
]
->
GetXaxis
()
->
CenterTitle
();
gr
[
k
]
->
GetYaxis
()
->
SetTitle
(
"Signal [V]"
);
gr
[
k
]
->
GetYaxis
()
->
CenterTitle
();
gr1
[
k
]
->
GetXaxis
()
->
SetTitle
(
"Time1 [ns]"
);
gr1
[
k
]
->
GetXaxis
()
->
CenterTitle
();
gr1
[
k
]
->
GetYaxis
()
->
SetTitle
(
"Signal1 [V]"
);
gr1
[
k
]
->
GetYaxis
()
->
CenterTitle
();
c1
->
cd
(
k
+
1
);
gr
[
k
]
->
Draw
(
"AL*"
);
c1
->
cd
(
k
+
9
);
gr1
[
k
]
->
Draw
(
"AL*"
);
}
//return;
}
//loop over events
/*for (Long64_t i = 0; i < 8; i++) {
gr[i] = 0;
// t10[i] = 0;
// t90[i] = 0;
tr->GetEntry(i+kFirstEvent);
gr[i] = new TGraph(*revent->GetGraphSignal());
// t10[i] = revent->GetT_10();
// t90[i] = revent->GetT_90();
// cout << t10[i] << "\t" << t90[i] << endl;
// cout << revent->GetEdgeSlope() << endl;
}//for over events
for (Long64_t i = 8; i < 16; i++) {
gr[i] = 0;
tr->GetEntry(i+kFirstEvent-8);
gr[i] = new TGraph(*revent1->GetGraphSignal());
}//for over events
// TF1 *f1 = new TF1("f1name", "[0]+x*[1]");
// TF1 *f1 = new TF1("pol1", );
//k=0;
for (Int_t k = 0; k < 16; k++)
{
c1->cd(k+1);
//gr[k]->GetXaxis()->SetRangeUser(130, 175);
gr[k]->GetXaxis()->SetTitle("Time [ns]");
gr[k]->GetXaxis()->CenterTitle();
gr[k]->GetYaxis()->SetTitle("Signal [V]");
gr[k]->GetYaxis()->CenterTitle();
gr[k]->Draw("AL*");
//cout << t10[k] << "\t" << t90[k] << endl;
//f1->SetRange(t10[k], t90[k]);
//gr[k]->Fit(f1, "RQ");
}
//c1->Print(Form("../macros/picsDRS4/file%s/signals%s", foldername, ext));
// c1->cd(2);
// tr->Draw("gAmp.Draw()","","goff",1,124);*/
//}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment