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
58a38423
Commit
58a38423
authored
Jan 12, 2017
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"convertTektronix" is application now.
parent
f8d14ce8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
8 deletions
+49
-8
exp2.root
convertTektronix/exp2.root
+0
-0
read1.cpp
convertTektronix/read1.cpp
+38
-7
makefile
makefile
+11
-1
No files found.
convertTektronix/exp2.root
deleted
100644 → 0
View file @
f8d14ce8
File deleted
convertTektronix/read1.cpp
View file @
58a38423
void
read1
()
{
gSystem
->
Load
(
"../libData.so"
);
#include <fstream>
#include "TString.h"
#include "TFile.h"
#include "TError.h"
#include "TTree.h"
#include "../dataClasses/RawEvent.h"
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
!=
3
)
{
// Tell the user how to run the program
std
::
cerr
<<
"Usage: "
<<
argv
[
0
]
<<
" [list with input files] [outputfile]"
<<
std
::
endl
;
/* "Usage messages" are a conventional way of telling the user
* how to run a program if they enter the command incorrectly.
*/
return
1
;
}
// Print the user's name:
TString
infiles
=
argv
[
1
];
TString
ofile
=
argv
[
2
];
// std::cout << argv[1] << "says hello, " << argv[2] << "!" << std::endl;
// std::cout << infiles << "says hello, " << ofile << "!" << std::endl;
// return 0;
Double_t
A1
[
1000
],
A2
[
1000
],
A3
[
1000
],
A4
[
1000
];
Double_t
T
[
1000
];
...
...
@@ -7,7 +33,7 @@ void read1() {
TString
line1
,
line2
,
line3
,
line4
,
fileName
;
Double_t
amp1
,
amp2
,
amp3
,
amp4
,
time
;
TFile
*
f1
=
new
TFile
(
"exp2.root"
,
"RECREATE"
);
TFile
*
f1
=
new
TFile
(
ofile
.
Data
()
,
"RECREATE"
);
TTree
*
tree
=
new
TTree
(
"rtree"
,
"signal"
);
tree
->
Branch
(
"A1"
,
A1
,
"A1[1000]/D"
);
tree
->
Branch
(
"A2"
,
A2
,
"A2[1000]/D"
);
...
...
@@ -37,7 +63,7 @@ void read1() {
ifstream
myfile3
;
ifstream
myfile4
;
myfile
.
open
(
"../data/rawDataTektronix/infiles.dat"
);
// открываю файл с названиями файлов с данными для подсчёта общего количества файлов
myfile
.
open
(
infiles
.
Data
()
);
// открываю файл с названиями файлов с данными для подсчёта общего количества файлов
if
(
myfile
.
is_open
())
{
/// для создания динамического массива с путями к файлам с данными
while
(
1
){
fileName
.
ReadLine
(
myfile
);
...
...
@@ -46,12 +72,15 @@ void read1() {
}
myfile
.
close
();
}
else
{
Error
(
"read.cpp"
,
"Some error when opening file"
,
"infiles.dat"
);
return
;}
else
{
Error
(
"read.cpp"
,
"Some error when opening file %s"
,
infiles
.
Data
());
return
1
;
}
TString
*
NameLines
=
new
TString
[
Nlines
];
// создание массива в котором хранятся строки из файла "infiles.dat"
// TString NameLines[Nlines];
myfile
.
open
(
"../data/rawDataTektronix/infiles.dat"
);
myfile
.
open
(
infiles
.
Data
()
);
for
(
i
=
0
;;
i
++
){
fileName
.
ReadLine
(
myfile
);
NameLines
[
i
]
=
fileName
;
...
...
@@ -127,9 +156,11 @@ void read1() {
}
else
{
Error
(
"read.cpp"
,
"Some error when opening data file number of %d"
,
i
);
return
;
return
1
;
}
}
//for i
tree
->
Write
();
f1
->
Close
();
return
0
;
}
makefile
View file @
58a38423
...
...
@@ -24,11 +24,13 @@ PWD = $(shell pwd)
DATA
=
$(PWD)
/dataClasses
CONVERTDRS4
=
$(PWD)
/convertDRS4
CONVERTTEKTRONIX
=
$(PWD)
/convertTektronix
-include
$(DATA)/Data.mk
all
:
libData.so
\
read_binary_DRS4
read_binary_DRS4
\
convertTektronix
#ROOT html documentation, it will be done as a program which will be alsa compiled by this makefile, program will be as a last condition after all of the libraries
...
...
@@ -67,6 +69,14 @@ read_binary_DRS4: $(CONVERTDRS4)/read_binary.cpp libData.so
@echo 'Finished building target
:
$@'
@
echo
' '
convertTektronix
:
$(CONVERTTEKTRONIX)/read1.cpp libData.so
@
echo
'Building target: $@'
@
echo
'Invoking: GCC C++ Linker'
# $(CC) -L $(ROOTLIBS) -shared -o"libData.so" $(DATAOBJS) $(DATALIBS)
$(CC)
-o
$(CONVERTTEKTRONIX)/convertTektronix
$(CONVERTTEKTRONIX)/read1.cpp
-lm
`root-config
--cflags
--libs`
-L
$(PWD)
-lData
-Wl,-rpath,$(PWD)
@echo 'Finished building target
:
$@'
@
echo
' '
.PHONY
:
all clean
# Each subdirectory must supply rules for building sources it contributes
...
...
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