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
8525a0b7
Commit
8525a0b7
authored
Dec 28, 2016
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Script was really added.
parent
96538c9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
119 additions
and
0 deletions
+119
-0
analyse.C
macros/analyse.C
+119
-0
No files found.
macros/analyse.C
0 → 100644
View file @
8525a0b7
void
analyse
()
{
gSystem
->
Load
(
"../libData.so"
);
TFile
*
f
=
new
TFile
(
"../data/rawDataDSR4/NeuRad_test_07_1.root"
);
TTree
*
tr
=
(
TTree
*
)
f
->
Get
(
"rtree"
);
RawData
*
revent
=
new
RawData
();
tr
->
SetBranchAddress
(
"rawEvent"
,
&
revent
);
// tr->SetMakeClass(1);
TFile
*
fw
=
new
TFile
(
"../data/dataDSR4/analysis_07_1.root"
,
"RECREATE"
);
TTree
*
tw
=
new
TTree
(
"drs4analysis"
,
"title of drs4 analysis tree"
);
AnalyzeData
*
wevent
=
new
AnalyzeData
();
tw
->
Bronch
(
"AEvent"
,
"AnalyzeData"
,
&
wevent
);
Long64_t
nentries
=
tr
->
GetEntries
();
for
(
Long64_t
i
=
0
;
i
<
nentries
;
i
++
)
{
tr
->
GetEntry
(
i
);
wevent
->
ProcessEvent
(
revent
);
tw
->
Fill
();
}
tw
->
Write
();
fw
->
Close
();
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
();
}
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