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
13088ecc
Commit
13088ecc
authored
Jan 13, 2017
by
Muzalevsky I.A
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
programm for raw data to processed modified
parent
6833af68
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
20 deletions
+32
-20
analyse.cpp
convertRawToAnalyzed/analyse.cpp
+23
-12
integralFormSignal.cpp
macros/integralFormSignal.cpp
+5
-8
makefile
makefile
+4
-0
No files found.
convertRawToAnalyzed/analyse.cpp
View file @
13088ecc
...
@@ -12,20 +12,31 @@
...
@@ -12,20 +12,31 @@
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
// gSystem->Load("../libData.so");
if
(
(
argc
<
3
)
||
(
argc
>
4
)
)
{
if
(
argc
!=
4
)
{
// Tell the user how to run the program
// Tell the user how to run the program
std
::
cerr
<<
"Usage: "
<<
argv
[
0
]
<<
" [list with input files] [outputfile] [number of points in one event (1000
of 1024
)]"
<<
std
::
endl
;
std
::
cerr
<<
"Usage: "
<<
argv
[
0
]
<<
" [list with input files] [outputfile] [number of points in one event (1000)]"
<<
std
::
endl
;
/* "Usage messages" are a conventional way of telling the user
/* "Usage messages" are a conventional way of telling the user
* how to run a program if they enter the command incorrectly.
* how to run a program if they enter the command incorrectly.
*/
*/
return
1
;
return
1
;
}
}
// Print the user's name:
TString
infiles
=
argv
[
1
];
TString
infiles
=
argv
[
1
];
TString
ofile
=
argv
[
2
];
TString
ofile
=
argv
[
2
];
TString
Asize
=
argv
[
3
];
TString
Asize
=
argv
[
3
];
Int_t
kEventSize
;
if
(
argc
==
3
)
{
kEventSize
=
1024
;
Info
(
"convertRawToAnalyzed"
,
"Event size was set to %d"
,
kEventSize
);
}
if
(
argc
==
4
)
{
kEventSize
=
Asize
.
Atoi
();
if
(
kEventSize
!=
1000
)
{
std
::
cerr
<<
argv
[
0
]
<<
" the size of Events should be 1000 in this case "
<<
std
::
endl
;
return
1
;
}
}
TFile
*
f
=
new
TFile
(
infiles
.
Data
());
TFile
*
f
=
new
TFile
(
infiles
.
Data
());
TTree
*
tr
=
(
TTree
*
)
f
->
Get
(
"rtree"
);
TTree
*
tr
=
(
TTree
*
)
f
->
Get
(
"rtree"
);
...
@@ -35,28 +46,27 @@ int main(int argc, char* argv[])
...
@@ -35,28 +46,27 @@ int main(int argc, char* argv[])
const
Int_t
cfTD
=
5
;
const
Int_t
cfTD
=
5
;
TString
bName
;
TString
bName
;
RawEvent
*
revent
[
noBranches
];
// pointer to the array (of RawEvent class) in which raw data for each channel will be put
RawEvent
*
revent
[
noBranches
];
for
(
Int_t
j
=
0
;
j
<
noBranches
;
j
++
)
{
for
(
Int_t
j
=
0
;
j
<
noBranches
;
j
++
)
{
revent
[
j
]
=
new
RawEvent
(
);
//each raw event element is of class Raw
Event()
revent
[
j
]
=
new
RawEvent
(
kEventSize
);
//each Aevent element is of class A
Event()
bName
.
Form
(
"ch%d."
,
j
);
bName
.
Form
(
"ch%d."
,
j
);
tr
->
SetBranchAddress
(
bName
.
Data
(),
&
revent
[
j
]);
//read the tree tr with raw data and fill array revent with raw data
tr
->
SetBranchAddress
(
bName
.
Data
(),
&
revent
[
j
]);
}
}
// tr->SetMakeClass(1);
TFile
*
fw
=
new
TFile
(
ofile
.
Data
(),
"RECREATE"
);
//create .root file with somehow analyzed data
TFile
*
fw
=
new
TFile
(
ofile
.
Data
(),
"RECREATE"
);
//create .root file with somehow analyzed data
TTree
*
tw
=
new
TTree
(
"atree"
,
"title of drs4 analysis tree"
);
//create analysis tree atree in it
TTree
*
tw
=
new
TTree
(
"atree"
,
"title of drs4 analysis tree"
);
//create analysis tree atree in it
AEvent
*
wevent
[
noBranches
];
// pointer to the array (of AEvent class) in which analyzed data for each channel will be put
AEvent
*
wevent
[
noBranches
];
// pointer to the array (of AEvent class) in which analyzed data for each channel will be put
for
(
Int_t
j
=
0
;
j
<
noBranches
;
j
++
)
{
for
(
Int_t
j
=
0
;
j
<
noBranches
;
j
++
)
{
wevent
[
j
]
=
new
AEvent
(
atoi
(
Asize
)
);
wevent
[
j
]
=
new
AEvent
(
kEventSize
);
bName
.
Form
(
"Ach%d."
,
j
);
bName
.
Form
(
"Ach%d."
,
j
);
wevent
[
j
]
->
SetInputEvent
(
&
revent
[
j
]);
//takes raw event from RawEvent
wevent
[
j
]
->
SetInputEvent
(
&
revent
[
j
]);
//takes raw event from RawEvent
wevent
[
j
]
->
SetCFratio
(
cfRatio
);
wevent
[
j
]
->
SetCFratio
(
cfRatio
);
wevent
[
j
]
->
SetCFtimeDelay
(
cfTD
);
wevent
[
j
]
->
SetCFtimeDelay
(
cfTD
);
tw
->
Bronch
(
bName
.
Data
(),
"AEvent"
,
&
wevent
[
j
]);
// create branches in atree to hold analyzed data
tw
->
Bronch
(
bName
.
Data
(),
"AEvent"
,
&
wevent
[
j
]);
// create branches in atree to hold analyzed data
}
}
//----event loop in tr input tree
//----event loop in tr input tree
Long64_t
nentries
=
tr
->
GetEntries
();
Long64_t
nentries
=
tr
->
GetEntries
();
...
@@ -75,6 +85,7 @@ int main(int argc, char* argv[])
...
@@ -75,6 +85,7 @@ int main(int argc, char* argv[])
}
}
//----end of event loop
//----end of event loop
printf
(
"%d events are processed
\n
"
,
nentries
);
tw
->
Write
();
tw
->
Write
();
fw
->
Close
();
fw
->
Close
();
...
...
macros/integralFormSignal.cpp
View file @
13088ecc
void
integralFormSignal
()
//
void integralFormSignal()
{
{
gSystem
->
Load
(
"../libData.so"
);
gSystem
->
Load
(
"../libData.so"
);
TFile
*
f
=
new
TFile
(
"../data/dataTektronix/exp
2
.root"
);
TFile
*
f
=
new
TFile
(
"../data/dataTektronix/exp
7
.root"
);
TTree
*
tr
=
(
TTree
*
)
f
->
Get
(
"atree"
);
TTree
*
tr
=
(
TTree
*
)
f
->
Get
(
"atree"
);
const
Int_t
noBranches
=
4
;
const
Int_t
noBranches
=
4
;
Double_t
ZeroTime
[
4
];
Double_t
ZeroTime
[
4
];
Int_t
iZero
[
4
],
PosZero
[
4
],
deltaT
[
4
];
Int_t
iZero
[
4
],
PosZero
[
4
],
deltaT
[
4
];
TString
bName
;
TString
bName
;
AEvent
*
aevent
[
noBranches
];
// pointer to the array (of RawEvent class) in which raw data for each channel will be put
AEvent
*
aevent
[
noBranches
];
// pointer to the array (of RawEvent class) in which raw data for each channel will be put
for
(
Int_t
j
=
0
;
j
<
noBranches
;
j
++
)
{
for
(
Int_t
j
=
0
;
j
<
noBranches
;
j
++
)
{
aevent
[
j
]
=
new
AEvent
();
//each raw event element is of class RawEvent()
aevent
[
j
]
=
new
AEvent
(
1000
);
//each raw event element is of class RawEvent()
bName
.
Form
(
"Ach%d."
,
j
);
bName
.
Form
(
"Ach%d."
,
j
);
tr
->
SetBranchAddress
(
bName
.
Data
(),
&
aevent
[
j
]);
//read the tree tr with raw data and fill array revent with raw data
tr
->
SetBranchAddress
(
bName
.
Data
(),
&
aevent
[
j
]);
//read the tree tr with raw data and fill array revent with raw data
//cout << tr->SetBranchAddress(bName.Data(), &aevent[j]) << endl; //read the tree tr with raw data and fill array revent with raw data
}
}
TH1F
*
hist0
=
new
TH1F
(
"hist1"
,
"h1 title"
,
2000
,
-
100
,
100
);
TH1F
*
hist0
=
new
TH1F
(
"hist1"
,
"h1 title"
,
2000
,
-
100
,
100
);
...
@@ -38,15 +38,12 @@ void integralFormSignal()
...
@@ -38,15 +38,12 @@ void integralFormSignal()
deltaT
[
k
]
=
iZero
[
k
]
-
PosZero
[
k
];
deltaT
[
k
]
=
iZero
[
k
]
-
PosZero
[
k
];
}
}
//for(k=0;k<4;k++) {
for
(
Int_t
i
=
0
;
i
<
1000
;
i
++
){
for
(
Int_t
i
=
0
;
i
<
1000
;
i
++
){
if
(
((
i
+
deltaT
[
0
])
>-
1
)
&&
((
i
+
deltaT
[
0
])
<
1000
))
hist0
->
AddBinContent
(
i
+
500
,
aevent
[
0
]
->
GetOnefAmpPos
(
i
+
deltaT
[
0
]));
if
(
((
i
+
deltaT
[
0
])
>-
1
)
&&
((
i
+
deltaT
[
0
])
<
1000
))
hist0
->
AddBinContent
(
i
+
500
,
aevent
[
0
]
->
GetOnefAmpPos
(
i
+
deltaT
[
0
]));
if
(
((
i
+
deltaT
[
1
])
>-
1
)
&&
((
i
+
deltaT
[
1
])
<
1000
))
hist1
->
AddBinContent
(
i
+
500
,
aevent
[
1
]
->
GetOnefAmpPos
(
i
+
deltaT
[
1
]));
if
(
((
i
+
deltaT
[
1
])
>-
1
)
&&
((
i
+
deltaT
[
1
])
<
1000
))
hist1
->
AddBinContent
(
i
+
500
,
aevent
[
1
]
->
GetOnefAmpPos
(
i
+
deltaT
[
1
]));
hist2
->
AddBinContent
(
i
+
500
,
aevent
[
0
]
->
GetOnefAmpPos
(
i
));
hist2
->
AddBinContent
(
i
+
500
,
aevent
[
0
]
->
GetOnefAmpPos
(
i
));
hist3
->
AddBinContent
(
i
+
500
,
aevent
[
1
]
->
GetOnefAmpPos
(
i
));
hist3
->
AddBinContent
(
i
+
500
,
aevent
[
1
]
->
GetOnefAmpPos
(
i
));
}
}
//}
}
}
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"test"
,
10
,
10
,
1000
,
600
);
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"test"
,
10
,
10
,
1000
,
600
);
...
...
makefile
View file @
13088ecc
...
@@ -47,6 +47,10 @@ clean:
...
@@ -47,6 +47,10 @@ clean:
-
@echo
' '
-
@echo
' '
-
$(RM)
$(CONVERTDRS4)
/read_binary_DRS4
-
$(RM)
$(CONVERTDRS4)
/read_binary_DRS4
-
@echo
' '
-
@echo
' '
-
$(RM)
$(CONVERTTEKTRONIX)
/convertTektronix
-
@echo
' '
-
$(RM)
$(CONVERTRAWTOANALYZED)
/convertRawToAnalyzed
-
@echo
' '
# Those *Cint* files below need special treating:
# Those *Cint* files below need special treating:
$(DATA)/DataCint.cpp
:
$(DATA)/DataCint.cpp
:
...
...
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