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
ff68d4c9
Commit
ff68d4c9
authored
Dec 28, 2016
by
Kostyleva D.A
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Functions converting DRS4 data are added to class RawData
parent
bf84b293
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
21 deletions
+45
-21
read_binary.cpp
convertDRS4/read_binary.cpp
+10
-3
NeuRad_test_07_1.root
data/rawDataDSR4/NeuRad_test_07_1.root
+0
-0
RawData.cpp
dataClasses/RawData.cpp
+22
-3
RawData.h
dataClasses/RawData.h
+13
-15
No files found.
convertDRS4/read_binary.cpp
View file @
ff68d4c9
...
...
@@ -114,7 +114,7 @@ int main(int argc, const char * argv[])
//rtree->Branch("t1", &t1, "t1/D"); //br for time of threshold crossing signal in 1 ch
// rtree->Branch("t2", &t2, "t2/D"); //br for time of threshold crossing signal in 2 ch
int
ncell
;
const
int
ncellMax
=
10
30
;
const
int
ncellMax
=
10
24
;
double
amp_ch1
[
ncellMax
],
time_ch1
[
ncellMax
];
//variable size array
//------for other channels
// double amp_ch2[ncellMax], time_ch2[ncellMax];
...
...
@@ -200,6 +200,7 @@ int main(int argc, const char * argv[])
// loop over all events in the data file
for
(
n
=
0
;
;
n
++
)
{
event
->
Reset
();
// read event header
i
=
(
int
)
fread
(
&
eh
,
sizeof
(
eh
),
1
,
f
);
if
(
i
<
1
)
...
...
@@ -253,6 +254,9 @@ int main(int argc, const char * argv[])
if
(
chn_index
==
0
)
{
amp_ch1
[
i
]
=
waveform
[
b
][
chn_index
][
i
];
event
->
SetAmp
(
waveform
[
b
][
chn_index
][
i
],
i
);
/*printf("old ampl %f ",amp_ch1[i]);
event->PrintAmp(i);
printf("\n");*/
}
// if(chn_index == 1) {amp_ch2[i] = waveform[b][chn_index][i];}
...
...
@@ -291,9 +295,13 @@ 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];
}
//event->Print();
// find peak in channel 1 above threshold
for
(
i
=
0
;
i
<
1022
;
i
++
)
{
...
...
@@ -324,7 +332,6 @@ int main(int argc, const char * argv[])
sumdt2
+=
dt
*
dt
;
}
}
//end of the boards loop
rtree
->
Fill
();
}
// end of the events loop
...
...
data/rawDataDSR4/NeuRad_test_07_1.root
View file @
ff68d4c9
No preview for this file type
dataClasses/RawData.cpp
View file @
ff68d4c9
...
...
@@ -25,12 +25,31 @@ void RawData::Reset() {
Time
[
i
]
=
0
;
}
}
void
RawData
::
PrintTime
(
Int_t
i
)
{
cout
<<
Time
[
i
]
<<
endl
;
}
void
RawData
::
Print
()
{
for
(
Int_t
i
=
0
;
i
<
NCELLS
;
i
++
)
{
void
RawData
::
PrintAmp
(
Int_t
i
)
{
cout
<<
Amp
[
i
]
<<
endl
;
// Time[i] = 0;
}
void
RawData
::
SetAmp
(
Double_t
a
,
Int_t
i
)
{
if
(
i
>=
NCELLS
)
{
cout
<<
"Error: array with raw amplitudes is overloaded!"
<<
endl
;
return
;
}
Amp
[
i
]
=
a
;
return
;
}
void
RawData
::
SetTime
(
Double_t
t
,
Int_t
i
)
{
if
(
i
>=
NCELLS
)
{
cout
<<
"Error: array with raw times is overloaded!"
<<
endl
;
return
;
}
Time
[
i
]
=
t
;
return
;
}
dataClasses/RawData.h
View file @
ff68d4c9
...
...
@@ -7,21 +7,18 @@
#ifndef DATACLASSES_RAWDATA_H_
#define DATACLASSES_RAWDATA_H_
#include <iostream>
#include "TGraph.h"
#define NCELLS 1024
using
std
::
cout
;
using
std
::
endl
;
#define NCELLS 1024
class
RawData
{
private
:
Double_t
Amp
[
NCELLS
];
Double_t
Time
[
NCELLS
];
Double_t
Amp
[
NCELLS
];
//array for raw amplitudes
Double_t
Time
[
NCELLS
];
//array for raw times
public
:
RawData
();
...
...
@@ -29,6 +26,7 @@ public:
ClassDef
(
RawData
,
1
);
void
Reset
();
//Resets arrays to zeros
const
Double_t
*
GetAmp
()
const
{
return
Amp
;
...
...
@@ -38,16 +36,16 @@ public:
return
Time
;
}
void
SetAmp
(
Double_t
a
,
Int_t
i
)
{
if
(
i
>=
NCELLS
)
{
cout
<<
"chren'"
<<
endl
;
return
;
}
Amp
[
i
]
=
a
;
return
;
}
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
Print
();
void
PrintAmp
(
Int_t
i
);
void
PrintTime
(
Int_t
i
);
};
#endif
/* DATACLASSES_RAWDATA_H_ */
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