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
f6a3f0c4
Commit
f6a3f0c4
authored
Jan 09, 2017
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convertDRS4 extended to 4 channels.
parent
9c11fb9e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
18 deletions
+26
-18
read_binary.cpp
convertDRS4/read_binary.cpp
+24
-18
NeuRad_test_07_1.root
data/rawDataDSR4/NeuRad_test_07_1.root
+0
-0
RawEvent.cpp
dataClasses/RawEvent.cpp
+2
-0
No files found.
convertDRS4/read_binary.cpp
View file @
f6a3f0c4
...
...
@@ -123,8 +123,18 @@ int main(int argc, const char * argv[])
// rtree->Branch("amp_ch1", amp_ch1, "amp_ch1[ncell]/D");
// rtree->Branch("time_ch1", time_ch1, "time_ch1[ncell]/D");
RawEvent
*
event
=
new
RawEvent
();
rtree
->
Bronch
(
"rawEvent"
,
"RawEvent"
,
&
event
);
// RawEvent *event = new RawEvent();
// rtree->Bronch("rawEvent", "RawEvent", &event);
TString
bName
;
RawEvent
*
event
[
4
];
for
(
Int_t
i
=
0
;
i
<
4
;
i
++
)
{
event
[
i
]
=
new
RawEvent
();
bName
.
Form
(
"ch%d"
,
i
);
rtree
->
Bronch
(
bName
.
Data
(),
"RawEvent"
,
&
event
[
i
]);
}
//------for other channels
// rtree->Branch("amp_ch2", amp_ch2, "amp_ch2[ncell]/D");
...
...
@@ -200,7 +210,9 @@ int main(int argc, const char * argv[])
// loop over all events in the data file
for
(
n
=
0
;
;
n
++
)
{
event
->
Reset
();
//reset Events
for
(
Int_t
noChannel
=
0
;
noChannel
<
4
;
noChannel
++
)
{
event
[
noChannel
]
->
Reset
();
}
// read event header
i
=
(
int
)
fread
(
&
eh
,
sizeof
(
eh
),
1
,
f
);
if
(
i
<
1
)
...
...
@@ -251,14 +263,10 @@ int main(int argc, const char * argv[])
//for ROOT
//ncell = i;
if
(
chn_index
==
0
)
{
//amp_ch1[i] = waveform[b][chn_index][i];
event
->
SetAmp
(
waveform
[
b
][
chn_index
][
i
],
i
);
// event->InvertAmp(waveform[b][chn_index][i], i);
/*printf("old ampl %f ",amp_ch1[i]);
event->PrintAmp(i);
printf("\n");*/
}
// if(chn_index == 0) {
// event[0]->SetAmp(waveform[b][chn_index][i], i);
// }
event
[
chn_index
]
->
SetAmp
(
waveform
[
b
][
chn_index
][
i
],
i
);
// if(chn_index == 1) {amp_ch2[i] = waveform[b][chn_index][i];}
// calculate time for this cell
...
...
@@ -270,6 +278,7 @@ int main(int argc, const char * argv[])
// align cell #0 of all channels
t1
=
time
[
b
][
0
][(
1024
-
tch
.
trigger_cell
)
%
1024
];
// event[0]->SetTime(time[b][chn][i],i);
//my print;
// printf("t1 %1.6lf \n",time[b][0][(1024-tch.trigger_cell) % 1024]);
for
(
chn
=
1
;
chn
<
4
;
chn
++
)
{
...
...
@@ -285,6 +294,7 @@ int main(int argc, const char * argv[])
time
[
b
][
chn
][
i
]
+=
dt
;
//each element of time gets dt correction
//my print;
// printf("time %1.6lf for %d %d %d \n",time[b][chn][i], b, chn, i);
// event[chn]->SetTime(time[b][chn][i],i);
}
}
...
...
@@ -295,12 +305,7 @@ int main(int argc, const char * argv[])
//for ROOT
for
(
i
=
0
;
i
<
1024
;
i
++
)
{
//time_ch1[i] = time[b][0][i];
event
->
SetTime
(
time
[
b
][
0
][
i
],
i
);
/*printf("old time %f ",time_ch1[i]);
event->PrintTime(i);
printf("\n");*/
// time_ch2[i] = time[b][1][i];
for
(
Int_t
chNum
=
0
;
chNum
<
4
;
chNum
++
)
{
event
[
chNum
]
->
SetTime
(
time
[
b
][
chNum
][
i
],
i
);
}
}
//event->Print();
// find peak in channel 1 above threshold
...
...
@@ -345,7 +350,8 @@ int main(int argc, const char * argv[])
rfile
->
Write
();
rfile
->
Close
();
delete
event
;
// delete event;
// delete[] event;
return
1
;
}
...
...
data/rawDataDSR4/NeuRad_test_07_1.root
View file @
f6a3f0c4
No preview for this file type
dataClasses/RawEvent.cpp
View file @
f6a3f0c4
...
...
@@ -10,11 +10,13 @@
RawEvent
::
RawEvent
()
:
fNPoints
(
1024
)
{
// TODO Auto-generated constructor stub
Init
();
Reset
();
}
RawEvent
::
RawEvent
(
const
Int_t
npoints
)
:
fNPoints
(
npoints
)
{
// TODO Auto-generated constructor stub
Init
();
Reset
();
}
RawEvent
::~
RawEvent
()
{
...
...
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