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
bf84b293
Commit
bf84b293
authored
Dec 28, 2016
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Branch with class RawEvent added in read_binary_DRS application.
parent
7b3acf5f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
303 additions
and
280 deletions
+303
-280
read_binary.cpp
convertDRS4/read_binary.cpp
+286
-274
analysis_07_1.root
data/dataDSR4/analysis_07_1.root
+0
-0
RawData.cpp
dataClasses/RawData.cpp
+2
-2
RawData.h
dataClasses/RawData.h
+13
-2
makefile
makefile
+2
-2
No files found.
convertDRS4/read_binary.cpp
View file @
bf84b293
...
...
@@ -17,7 +17,7 @@
for time measurements.
$Id: read_binary.cpp 22290 2016-04-27 14:51:37Z ritt $
*/
*/
#include <stdio.h>
#include <fcntl.h>
...
...
@@ -31,6 +31,9 @@
#include "TTree.h"
#include "TH1F.h"
//our code
#include "../dataClasses/RawData.h"
typedef
struct
{
char
tag
[
3
];
char
version
;
...
...
@@ -104,7 +107,7 @@ int main(int argc, const char * argv[])
return
-
1
;
}
// ---------------for ROOT
// ---------------for ROOT
TFile
*
rfile
=
new
TFile
(
outroot
,
"RECREATE"
);
TTree
*
rtree
=
new
TTree
(
"rtree"
,
"tree for drs4 analysis"
);
...
...
@@ -113,18 +116,21 @@ int main(int argc, const char * argv[])
int
ncell
;
const
int
ncellMax
=
1030
;
double
amp_ch1
[
ncellMax
],
time_ch1
[
ncellMax
];
//variable size array
//------for other channels
// double amp_ch2[ncellMax], time_ch2[ncellMax];
//------for other channels
// double amp_ch2[ncellMax], time_ch2[ncellMax];
rtree
->
Branch
(
"ncell"
,
&
ncell
,
"ncell/I"
);
rtree
->
Branch
(
"amp_ch1"
,
amp_ch1
,
"amp_ch1[ncell]/D"
);
rtree
->
Branch
(
"time_ch1"
,
time_ch1
,
"time_ch1[ncell]/D"
);
//------for other channels
// rtree->Branch("amp_ch2", amp_ch2, "amp_ch2[ncell]/D");
// rtree->Branch("time_ch2", time_ch2, "time_ch2[ncell]/D");
RawData
*
event
=
new
RawData
();
rtree
->
Bronch
(
"rawEvent"
,
"RawData"
,
&
event
);
//------for other channels
// rtree->Branch("amp_ch2", amp_ch2, "amp_ch2[ncell]/D");
// rtree->Branch("time_ch2", time_ch2, "time_ch2[ncell]/D");
//----------------
//----------------
// open the binary waveform file
FILE
*
f
=
fopen
(
filename
,
"r"
);
...
...
@@ -244,7 +250,10 @@ int main(int argc, const char * argv[])
//for ROOT
ncell
=
i
;
if
(
chn_index
==
0
)
{
amp_ch1
[
i
]
=
waveform
[
b
][
chn_index
][
i
];}
if
(
chn_index
==
0
)
{
amp_ch1
[
i
]
=
waveform
[
b
][
chn_index
][
i
];
event
->
SetAmp
(
waveform
[
b
][
chn_index
][
i
],
i
);
}
// if(chn_index == 1) {amp_ch2[i] = waveform[b][chn_index][i];}
// calculate time for this cell
...
...
@@ -260,7 +269,7 @@ int main(int argc, const char * argv[])
// printf("t1 %1.6lf \n",time[b][0][(1024-tch.trigger_cell) % 1024]);
for
(
chn
=
1
;
chn
<
4
;
chn
++
)
{
t2
=
time
[
b
][
chn
][(
1024
-
tch
.
trigger_cell
)
%
1024
];
//adding channels 3 and 4
//adding channels 3 and 4
t3
=
time
[
b
][
chn
][(
1024
-
tch
.
trigger_cell
)
%
1024
];
t4
=
time
[
b
][
chn
][(
1024
-
tch
.
trigger_cell
)
%
1024
];
//my prinf
...
...
@@ -324,6 +333,9 @@ int main(int argc, const char * argv[])
rfile
->
Write
();
rfile
->
Close
();
delete
event
;
return
1
;
}
data/dataDSR4/analysis_07_1.root
View file @
bf84b293
No preview for this file type
dataClasses/RawData.cpp
View file @
bf84b293
...
...
@@ -20,7 +20,7 @@ RawData::~RawData() {
void
RawData
::
Reset
()
{
for
(
Int_t
i
=
0
;
i
<
1024
;
i
++
)
{
for
(
Int_t
i
=
0
;
i
<
NCELLS
;
i
++
)
{
Amp
[
i
]
=
0
;
Time
[
i
]
=
0
;
}
...
...
@@ -29,7 +29,7 @@ void RawData::Reset() {
}
void
RawData
::
Print
()
{
for
(
Int_t
i
=
0
;
i
<
1024
;
i
++
)
{
for
(
Int_t
i
=
0
;
i
<
NCELLS
;
i
++
)
{
cout
<<
Amp
[
i
]
<<
endl
;
// Time[i] = 0;
}
...
...
dataClasses/RawData.h
View file @
bf84b293
...
...
@@ -15,11 +15,13 @@
using
std
::
cout
;
using
std
::
endl
;
#define NCELLS 1024
class
RawData
{
private
:
Double_t
Amp
[
1024
];
Double_t
Time
[
1024
];
Double_t
Amp
[
NCELLS
];
Double_t
Time
[
NCELLS
];
public
:
RawData
();
...
...
@@ -36,6 +38,15 @@ public:
return
Time
;
}
void
SetAmp
(
Double_t
a
,
Int_t
i
)
{
if
(
i
>=
NCELLS
)
{
cout
<<
"chren'"
<<
endl
;
return
;
}
Amp
[
i
]
=
a
;
return
;
}
void
Print
();
};
...
...
makefile
View file @
bf84b293
...
...
@@ -59,11 +59,11 @@ libData.so: $(DATAOBJS)
@
echo
'Finished building target: $@'
@
echo
' '
read_binary_DRS4
:
$(CONVERTDRS4)/read_binary.cpp
read_binary_DRS4
:
libData.so
$(CONVERTDRS4)/read_binary.cpp
@
echo
'Building target: $@'
@
echo
'Invoking: GCC C++ Linker'
# $(CC) -L $(ROOTLIBS) -shared -o"libData.so" $(DATAOBJS) $(DATALIBS)
$(CC)
-o
$(CONVERTDRS4)/read_binary_DRS4
$(CONVERTDRS4)/read_binary.cpp
-lm
`root-config
--cflags
--libs`
$(CC)
-o
$(CONVERTDRS4)/read_binary_DRS4
$(CONVERTDRS4)/read_binary.cpp
-lm
`root-config
--cflags
--libs`
-L
$(PWD)
-lData
-Wl,-rpath,$(PWD)
@echo 'Finished building target
:
$@'
@
echo
' '
...
...
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