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
66cd88ed
Commit
66cd88ed
authored
Dec 30, 2016
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convertTektronix fill branch with RawEvent class.
parent
11a99d97
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
14 deletions
+49
-14
exp2.root
convertTektronix/exp2.root
+0
-0
infiles.dat
convertTektronix/infiles.dat
+12
-0
read.cpp
convertTektronix/read.cpp
+34
-12
RawEvent.cpp
dataClasses/RawEvent.cpp
+3
-2
No files found.
convertTektronix/exp2.root
View file @
66cd88ed
No preview for this file type
convertTektronix/infiles.dat
0 → 100644
View file @
66cd88ed
ch1
../data/rawDataTektronix/ch12016.12.07-02.11.54.dat
../data/rawDataTektronix/ch12016.12.07-08.48.05.dat
../data/rawDataTektronix/ch12016.12.07-10.03.01.dat
ch2
...
...
...
ch3
...
...
...
\ No newline at end of file
convertTektronix/read.cpp
View file @
66cd88ed
#include <iostream>
#include <fstream>
#include "TFile.h"
#include "TTree.h"
#include "../dataClasses/RawEvent.h"
//
#include <iostream>
//
#include <fstream>
//
//
#include "TFile.h"
//
#include "TTree.h"
//
//
#include "../dataClasses/RawEvent.h"
void
read
()
{
//Double_t N[5]; // массив для чисел ()
//ifstream myfile;
const
Int_t
par1
=
5
;
const
Double_t
par2
=
5.34
;
// ....
// ....
gSystem
->
Load
(
"../libData.so"
);
Double_t
A
[
1000
];
Double_t
T
[
1000
];
Int_t
i
,
j
,
n
;
...
...
@@ -19,7 +27,7 @@ void read() {
tree
->
Branch
(
"A"
,
A
,
"A[1000]/D"
);
tree
->
Branch
(
"T"
,
T
,
"T[1000]/D"
);
RawEvent
*
event
=
new
RawEvent
;
RawEvent
*
event
=
new
RawEvent
()
;
tree
->
Bronch
(
"rawEvent"
,
"RawEvent"
,
&
event
);
...
...
@@ -34,17 +42,31 @@ void read() {
return
;
}
Double_t
amp
=
0
;
Double_t
time
=
0
;
//rewrite using while-loop
for
(
i
=
0
;
i
<
100000
;
i
++
){
n
=
i
/
1000
;
// if ((i==1002)||(i==900)||(i==2002)||(i==8002)) {cout<<i<<" "<<n<<endl;}
myfile1
>>
A
[
i
-
1000
*
n
];
T
[
i
-
1000
*
n
]
=
5e-013
+
(
i
-
1000
*
n
)
*
1e-010
;
myfile1
>>
amp
;
time
=
5e-013
+
(
i
-
1000
*
n
)
*
1e-010
;
A
[
i
-
1000
*
n
]
=
amp
;
T
[
i
-
1000
*
n
]
=
time
;
event
->
SetAmp
(
amp
,
i
-
1000
*
n
);
event
->
SetTime
(
time
,
i
-
1000
*
n
);
if
(
i
-
1000
*
n
==
999
)
{
tree
->
Fill
();
for
(
j
=
0
;
j
<
1000
;
j
++
){
T
[
j
]
=
0
;
A
[
j
]
=
0
;
T
[
j
]
=
0
;
A
[
j
]
=
0
;
}
event
->
Reset
();
}
}
myfile1
.
close
();
...
...
dataClasses/RawEvent.cpp
View file @
66cd88ed
...
...
@@ -45,8 +45,9 @@ void RawEvent::PrintAmp(Int_t i) {
}
void
RawEvent
::
SetAmp
(
Double_t
a
,
Int_t
i
)
{
// cout << fNPoints << endl;
if
(
i
>=
fNPoints
)
{
cout
<<
"Error: array with raw amplitudes is overloaded!"
<<
endl
;
Error
(
"RawEvent::SetAmp"
,
"Array with raw amplitudes is overloaded!"
)
;
return
;
}
fAmp
[
i
]
=
a
;
...
...
@@ -55,7 +56,7 @@ void RawEvent::SetAmp(Double_t a, Int_t i) {
void
RawEvent
::
SetTime
(
Double_t
t
,
Int_t
i
)
{
if
(
i
>=
fNPoints
)
{
cout
<<
"Error: array with raw times is overloaded!"
<<
endl
;
Error
(
"RawEvent::SetTime"
,
"Array with raw times is overloaded!"
)
;
return
;
}
fTime
[
i
]
=
t
;
...
...
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