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
7aa6b255
Commit
7aa6b255
authored
Mar 06, 2017
by
Kostyleva D.A
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collecting all the recent changes
parent
422bae7d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
238 additions
and
20 deletions
+238
-20
AEvent.h
dataClasses/AEvent.h
+1
-1
histPresent.C
macros/histPresent.C
+181
-0
testShowCFD.cxx
macros/testShowCFD.cxx
+28
-5
testShowGraphs.cxx
macros/testShowGraphs.cxx
+28
-14
No files found.
dataClasses/AEvent.h
View file @
7aa6b255
...
...
@@ -49,7 +49,7 @@ private:
TArrayD
fAmpCFD
;
//array for CFD amplitudes (attenuated, inversed and delayed)
Double_t
fTimeCFD
;
//zero-crossing time
Double_t
fChargeCFD
;
//
!
Double_t
fChargeCFD
;
//
Double_t
fChargeLED
;
//charge of the signal in Coulomb
Double_t
fChargeTF
;
//
...
...
macros/histPresent.C
0 → 100644
View file @
7aa6b255
#include "TH2F.h"
#include "TH3F.h"
#include "TStyle.h"
void
histPresent
(
const
char
*
filename
=
"analysis_07_8.root"
,
// const char *filename = "analysis_07_8_smooth.root",
// const char *filename = "analysis_08_2.root",
// const char *filename = "analysis_08_2_smooth.root",
const
char
*
foldername
=
"nustar_present"
,
// const char *ext = ".eps",
const
char
*
ext
=
".pdf"
,
const
Bool_t
can1
=
0
,
const
Bool_t
can2
=
0
,
const
Bool_t
can3
=
1
,
const
Bool_t
can4
=
0
)
//const Bool_t can5 = 0/*, const Bool_t can6 = 0*/)
{
using
std
::
cout
;
using
std
::
endl
;
gSystem
->
Load
(
"../libData.so"
);
TFile
*
f
=
new
TFile
(
Form
(
"../data/dataDSR4/%s"
,
filename
));
TTree
*
t
=
(
TTree
*
)
f
->
Get
(
"atree"
);
if
(
can1
){
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"canvas 1"
);
c1
->
Divide
(
2
,
2
);
c1
->
cd
(
1
);
//TH1F *h1 = new TH1F("h1", "CFD", 50, -15, 15);
TH1F
*
h1
=
new
TH1F
(
"h1"
,
"CFD"
,
50
,
0
,
20
);
t
->
Draw
(
"Ach0.fTimeCFD - Ach1.fTimeCFD >> h1"
,
"Ach0.fTimeCFD>100. && Ach0.fTimeCFD<160 && Ach1.fTimeCFD>100. && Ach1.fTimeCFD<160"
,
""
);
//x
h1
->
GetXaxis
()
->
SetTitle
(
"Time difference [ns]"
);
h1
->
GetXaxis
()
->
CenterTitle
();
//h1->Fit("gaus", "","",-3,2);
h1
->
Fit
(
"gaus"
,
""
,
""
,
8
,
13
);
gStyle
->
SetOptFit
();
c1
->
Update
();
c1
->
cd
(
2
);
//TH1F *h2 = new TH1F("h2", "LED",50, -10, 10);
TH1F
*
h2
=
new
TH1F
(
"h2"
,
"LED"
,
50
,
0
,
20
);
t
->
Draw
(
"Ach0.fTimeLED - Ach1.fTimeLED >> h2"
,
"Ach0.fTimeLED>100. && Ach0.fTimeLED < 150 && Ach1.fTimeLED>100 && Ach1.fTimeLED < 150"
,
"col"
);
//x
h2
->
GetXaxis
()
->
SetTitle
(
"Time difference [ns]"
);
h2
->
GetXaxis
()
->
CenterTitle
();
//h2->Fit("gaus", "","",-3,1);
h2
->
Fit
(
"gaus"
,
""
,
""
,
7
,
12
);
gStyle
->
SetOptFit
();
c1
->
Update
();
/* c1->cd(3);
//TH1F *h3 = new TH1F("h3", "Front edge fit crossing zero level", 100, -20, 20);
TH1F *h3 = new TH1F("h3", "Front edge fit crossing zero level", 100,0, 20);
t->Draw("Ach0.fTimeFront - Ach1.fTimeFront >> h3","Ach0.fTimeFront>100. && Ach0.fTimeFront < 150 && Ach1.fTimeFront>100 && Ach1.fTimeFront < 150","col");
//x
h3->GetXaxis()->SetTitle("Time difference [ns]");
h3->GetXaxis()->CenterTitle();
//h3->Fit("gaus", "","",-3,2);
h3->Fit("gaus", "","",9,12);
gStyle->SetOptFit();*/
c1
->
cd
(
3
);
//TH1F *h3 = new TH1F("h3", "Front edge fit crossing zero level", 100, -20, 20);
TH1F
*
h3
=
new
TH1F
(
"h3"
,
"Middle point of front level"
,
100
,
1
,
20
);
t
->
Draw
(
"Ach0.fTimeMid - Ach1.fTimeMid >> h3"
,
""
,
"col"
);
//x
h3
->
GetXaxis
()
->
SetTitle
(
"Time difference [ns]"
);
h3
->
GetXaxis
()
->
CenterTitle
();
//h3->Fit("gaus", "","",-3,2);
h3
->
Fit
(
"gaus"
,
""
,
""
,
9
,
12
);
gStyle
->
SetOptFit
();
c1
->
Update
();
c1
->
cd
(
4
);
//TH1F *h4 = new TH1F("h4", "the middle point of front edge", 50, -10, 10);
TH1F
*
h4
=
new
TH1F
(
"h4"
,
"the 10 percent point of front edge"
,
80
,
1
,
20
);
t
->
Draw
(
"Ach0.fTime10 - Ach1.fTime10 >> h4"
,
""
,
""
);
h4
->
GetXaxis
()
->
SetTitle
(
"Time difference [ns]"
);
h4
->
GetXaxis
()
->
CenterTitle
();
//h4->Fit("gaus","","",-3,1);
h4
->
Fit
(
"gaus"
,
""
,
""
,
9
,
13
);
gStyle
->
SetOptFit
();
c1
->
Print
(
Form
(
"../macros/picsDRS4/%s/Smoothed_deltas%s"
,
foldername
,
ext
));
}
if
(
can2
){
TCanvas
*
c2
=
new
TCanvas
(
"c2"
,
"canvas 2"
);
c2
->
Divide
(
2
,
2
);
c2
->
cd
(
1
);
//TH1F *h1 = new TH1F("h1", "CFD", 50, -15, 15);
TH1F
*
h5
=
new
TH1F
(
"h5"
,
"ToT"
,
50
,
0
,
12
);
t
->
Draw
(
"Ach0.fToT >> h5"
,
"Ach0.fToT > 0"
,
""
);
//x
h5
->
GetXaxis
()
->
SetTitle
(
"Time over threshold [ns]"
);
h5
->
GetXaxis
()
->
CenterTitle
();
//h1->Fit("gaus", "","",-3,2);
//h1->Fit("gaus", "","",8,13);
//gStyle->SetOptFit();
c2
->
Update
();
c2
->
cd
(
2
);
//TH1F *h2 = new TH1F("h2", "LED",50, -10, 10);
TH1F
*
h6
=
new
TH1F
(
"h6"
,
"ToT"
,
50
,
0
,
12
);
t
->
Draw
(
"Ach1.fToT >> h6"
,
"Ach1.fToT > 0"
,
"col"
);
//x
h6
->
GetXaxis
()
->
SetTitle
(
"Time over threshold [ns]"
);
h6
->
GetXaxis
()
->
CenterTitle
();
//h2->Fit("gaus", "","",-3,1);
//h2->Fit("gaus", "","",7,12);
//gStyle->SetOptFit();
c2
->
Update
();
c2
->
cd
(
3
);
//TH1F *h3 = new TH1F("h3", "Front edge fit crossing zero level", 100, -20, 20);
TH1F
*
h7
=
new
TH1F
(
"h7"
,
"Middle point of front level"
,
80
,
1
,
20
);
t
->
Draw
(
"Ach0.fTimeMid - Ach1.fTimeMid >> h7"
,
"Ach0.fToT > 2. && Ach0.fToT < 6. && Ach1.fToT > 2. && Ach1.fToT < 6. "
,
"col"
);
//x
h7
->
GetXaxis
()
->
SetTitle
(
"Time difference [ns]"
);
h7
->
GetXaxis
()
->
CenterTitle
();
//h3->Fit("gaus", "","",-3,2);
h7
->
Fit
(
"gaus"
,
""
,
""
,
9
,
12
);
gStyle
->
SetOptFit
();
c2
->
Update
();
c2
->
cd
(
4
);
//TH1F *h4 = new TH1F("h4", "the middle point of front edge", 50, -10, 10);
TH1F
*
h8
=
new
TH1F
(
"h8"
,
"the 10 percent point of front edge"
,
80
,
1
,
20
);
t
->
Draw
(
"Ach0.fTime10 - Ach1.fTime10 >> h8"
,
" Ach0.fToT > 2. && Ach0.fToT < 6. && Ach1.fToT > 2. && Ach1.fToT < 6."
,
""
);
h8
->
GetXaxis
()
->
SetTitle
(
"Time difference [ns]"
);
h8
->
GetXaxis
()
->
CenterTitle
();
//h4->Fit("gaus","","",-3,1);
h8
->
Fit
(
"gaus"
,
""
,
""
,
9
,
13
);
gStyle
->
SetOptFit
();
c2
->
Print
(
Form
(
"../macros/picsDRS4/%s/Smoothed_deltas_tot_corr%s"
,
foldername
,
ext
));
}
if
(
can3
){
TCanvas
*
c3
=
new
TCanvas
(
"c3"
,
"canvas 3"
);
c3
->
Divide
(
2
,
2
);
c3
->
cd
(
1
);
TH1F
*
h9
=
new
TH1F
(
"h9"
,
"Charge CFD"
,
200
,
0
,
0.5e-9
);
t
->
Draw
(
"Ach0.fChargeCFD >> h9"
,
""
,
""
);
c3
->
Update
();
c3
->
cd
(
2
);
TH1F
*
h10
=
new
TH1F
(
"h10"
,
"Charge LED"
,
200
,
0
,
0.5e-9
);
t
->
Draw
(
"Ach0.fChargeLED >> h10"
,
""
,
""
);
c3
->
Update
();
c3
->
cd
(
3
);
TH1F
*
h11
=
new
TH1F
(
"h11"
,
"Sum of charges CFD for 4 channels"
,
200
,
0
,
10e-9
);
t
->
Draw
(
"Ach0.fChargeCFD + Ach1.fChargeCFD + Ach2.fChargeCFD + Ach3.fChargeCFD >> h11"
,
""
,
""
);
c3
->
Update
();
c3
->
cd
(
4
);
TH1F
*
h12
=
new
TH1F
(
"h12"
,
"Sum of charges LED for 4 channels"
,
200
,
0
,
10e-9
);
t
->
Draw
(
"Ach0.fChargeLED + Ach1.fChargeLED + Ach2.fChargeLED + Ach3.fChargeLED >> h12"
,
""
,
""
);
c3
->
Update
();
}
}
macros/testShowCFD.cxx
View file @
7aa6b255
...
...
@@ -3,10 +3,13 @@ void testShowCFD()
gSystem
->
Load
(
"../libData.so"
);
const
Long64_t
kFirstEvent
=
128
;
const
Long64_t
kFirstEvent
=
133
;
const
char
*
foldername
=
"nustar_present"
;
const
char
*
ext
=
".pdf"
;
// TFile fr("../data/dataDSR4/analysis_08_2_CFD02_06.root");
TFile
fr
(
"../data/dataDSR4/analysis_08_2.root"
);
// TFile fr("../data/dataDSR4/analysis_08_2.root");
TFile
fr
(
"../data/dataDSR4/analysis_08_2_smooth.root"
);
TTree
*
tr
=
(
TTree
*
)
fr
.
Get
(
"atree"
);
AEvent
*
revent
=
new
AEvent
();
...
...
@@ -23,12 +26,32 @@ void testShowCFD()
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"CFD implementation"
,
10
,
10
,
1000
,
600
);
c1
->
Divide
(
3
,
4
);
for
(
Int_t
i
=
0
;
i
<
12
;
i
++
)
{
// four event picture
/* c1->Divide(2,2);
for (Int_t i = 0; i < 4; i++) {
c1->cd(i+1);
gr
[
i
]
->
Draw
(
""
);
gr[i]->GetXaxis()->SetRangeUser(130, 175);
gr[i]->GetXaxis()->SetTitle("Time [ns]");
gr[i]->GetXaxis()->CenterTitle();
gr[i]->GetYaxis()->SetTitle("Signal CFD [V]");
gr[i]->GetYaxis()->CenterTitle();
gr[i]->Draw("AL*");
}
c1->Print(Form("../macros/picsDRS4/%s/Signal_shapes_CFD%s", foldername, ext));*/
//one event picture
gr
[
2
]
->
GetXaxis
()
->
SetRangeUser
(
130
,
160
);
gr
[
2
]
->
GetXaxis
()
->
SetTitle
(
"Time [ns]"
);
gr
[
2
]
->
GetXaxis
()
->
CenterTitle
();
gr
[
2
]
->
GetYaxis
()
->
SetTitle
(
"Signal [V]"
);
gr
[
2
]
->
GetYaxis
()
->
CenterTitle
();
gr
[
2
]
->
Draw
(
"AL*"
);
//f1->SetRange(t10[2], t90[2]);
//gr[2]->Fit(f1, "RQ");
c1
->
Print
(
Form
(
"../macros/picsDRS4/%s/CFD_one_signal_shape%s"
,
foldername
,
ext
));
// c1->cd(2);
// tr->Draw("gAmp.Draw()","","goff",1,124);
...
...
macros/testShowGraphs.cxx
View file @
7aa6b255
...
...
@@ -13,21 +13,22 @@ void testShowGraphs()
gStyle
->
SetCanvasDefH
(
900
);
gStyle
->
SetCanvasDefW
(
1500
);
const
char
*
foldername
=
"7_8"
;
const
char
*
ext
=
".gif"
;
// const char *foldername = "7_8";
const
char
*
foldername
=
"nustar_present"
;
const
char
*
ext
=
".pdf"
;
gSystem
->
Load
(
"../libData.so"
);
const
Long64_t
kFirstEvent
=
1
28
;
const
Long64_t
kFirstEvent
=
1
40
;
// TFile fr("../data/dataDSR4/Neurad_7_08_NEW.root");
//
TFile fr("../data/dataDSR4/analysis_07_8.root");
TFile
fr
(
"../data/dataDSR4/analysis_07_8.root"
);
// TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root");
// TFile fr("../data/dataTektronix/exp18.root");
TFile
fr
(
"../data/dataDSR4/analysis_07_8
.root"
);
//TFile fr("../data/dataDSR4/analysis_07_8_smooth
.root");
// TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root");
// TFile fr("../data/dataTektronix/exp18.root");
...
...
@@ -60,15 +61,13 @@ void testShowGraphs()
}
//for over events
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"test"
,
10
,
10
,
1000
,
600
);
c1
->
Divide
(
2
,
2
);
TF1
*
f1
=
new
TF1
(
"f1name"
,
"[0]+x*[1]"
);
// TF1 *f1 = new TF1("pol1", );
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"Signal shape"
,
10
,
10
,
1000
,
600
);
//c1->Divide(3,4);
// four event picture
c1
->
Divide
(
2
,
2
);
for
(
Int_t
k
=
0
;
k
<
4
;
k
++
)
{
c1
->
cd
(
k
+
1
);
gr
[
k
]
->
GetXaxis
()
->
SetRangeUser
(
130
,
175
);
...
...
@@ -81,7 +80,22 @@ void testShowGraphs()
//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);
c1
->
Print
(
Form
(
"../macros/picsDRS4/%s/Signal_shapes_bad%s"
,
foldername
,
ext
));
// one event picture
/* gr[4]->GetXaxis()->SetRangeUser(130, 160);
gr[4]->GetXaxis()->SetTitle("Time [ns]");
gr[4]->GetXaxis()->CenterTitle();
gr[4]->GetYaxis()->SetTitle("Signal [V]");
gr[4]->GetYaxis()->CenterTitle();
gr[4]->Draw("AL*");
f1->SetRange(t10[4], t90[4]);
gr[4]->Fit(f1, "RQ");
c1->Print(Form("../macros/picsDRS4/%s/One_signal_shape%s", foldername, ext));
//c1->Print(Form("../macros/picsDRS4/%s/Signal_shapes_with_fit%s", foldername, ext));
*/
}
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