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
3628b433
Commit
3628b433
authored
Dec 23, 2016
by
Muzalevsky I.A
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added script for converting data from txt files
parent
e51e9398
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
read.c
convertTektronix/read.c
+69
-0
No files found.
convertTektronix/read.c
0 → 100644
View file @
3628b433
void
read
()
{
//Double_t N[5]; // массив для чисел ()
//ifstream myfile;
Double_t
A
[
1000
];
Double_t
T
[
1000
];
Int_t
i
,
j
,
n
;
TFile
*
f1
=
new
TFile
(
"exp2.root"
,
"RECREATE"
);
TTree
*
tree
=
new
TTree
(
"tree"
,
"signal"
);
tree
->
Branch
(
"A"
,
A
,
"A[1000]/D"
);
tree
->
Branch
(
"T"
,
T
,
"T[1000]/D"
);
//std::vector<Double_t> *A = new std::vector<Double_t>();
//tree->Branch("mybranch","vector<Double_t>",A);
ifstream
myfile1
;
myfile1
.
open
(
"ch12016.12.07-02.11.54.dat"
);
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
;
if
(
i
-
1000
*
n
==
999
)
{
tree
->
Fill
();
for
(
j
=
0
;
j
<
1000
;
j
++
){
T
[
j
]
=
0
;
A
[
j
]
=
0
;
}
}
}
myfile1
.
close
();
ifstream
myfile2
;
myfile2
.
open
(
"ch12016.12.07-08.48.05.dat"
);
for
(
i
=
0
;
i
<
100000
;
i
++
){
n
=
i
/
1000
;
// if ((i==1002)||(i==900)||(i==2002)||(i==8002)) {cout<<i<<" "<<n<<endl;}
myfile2
>>
A
[
i
-
1000
*
n
];
T
[
i
-
1000
*
n
]
=
5e-013
+
(
i
-
1000
*
n
)
*
1e-010
;
if
(
i
-
1000
*
n
==
999
){
tree
->
Fill
();
for
(
j
=
0
;
j
<
1000
;
j
++
){
T
[
j
]
=
0
;
A
[
j
]
=
0
;
}
}
}
myfile2
.
close
();
ifstream
myfile3
;
myfile3
.
open
(
"ch12016.12.07-10.03.01.dat"
);
for
(
i
=
0
;
i
<
29000
;
i
++
){
n
=
i
/
1000
;
// if ((i==1002)||(i==900)||(i==2002)||(i==8002)) {cout<<i<<" "<<n<<endl;}
myfile3
>>
A
[
i
-
1000
*
n
];
T
[
i
-
1000
*
n
]
=
5e-013
+
(
i
-
1000
*
n
)
*
1e-010
;
if
(
i
-
1000
*
n
==
999
)
{
tree
->
Fill
();
for
(
j
=
0
;
j
<
1000
;
j
++
){
T
[
j
]
=
0
;
A
[
j
]
=
0
;
}
}
}
myfile3
.
close
();
tree
->
Write
();
f1
->
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