Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fadc_decoder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zhiwen Zhao
fadc_decoder
Commits
59de4df6
Commit
59de4df6
authored
Apr 14, 2020
by
Chao Peng
Browse files
Options
Downloads
Patches
Plain Diff
adjust the branch data filling, now it does not need to know the data mode
parent
8fd890b7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/esb_analyze.cpp
+8
-28
8 additions, 28 deletions
src/esb_analyze.cpp
with
8 additions
and
28 deletions
src/esb_analyze.cpp
+
8
−
28
View file @
59de4df6
...
@@ -241,7 +241,6 @@ void waveform_analysis(const std::vector<uint32_t> &raw, BranchData &res)
...
@@ -241,7 +241,6 @@ void waveform_analysis(const std::vector<uint32_t> &raw, BranchData &res)
res
.
nraw
=
len
;
res
.
nraw
=
len
;
// sanity check
// sanity check
if
(
len
==
0
)
{
if
(
len
==
0
)
{
res
.
npul
=
0
;
return
;
return
;
}
}
...
@@ -294,10 +293,8 @@ void waveform_analysis(const std::vector<uint32_t> &raw, BranchData &res)
...
@@ -294,10 +293,8 @@ void waveform_analysis(const std::vector<uint32_t> &raw, BranchData &res)
// fill decoded FADC250 data into the container (branch data)
// fill decoded FADC250 data into the container (branch data)
void
fill_branch
(
const
Fadc250Data
&
slot_data
,
const
Module
&
mod
,
std
::
unordered_map
<
std
::
string
,
BranchData
>
&
brdata
,
int
mode
)
void
fill_branch
(
const
Fadc250Data
&
slot_data
,
const
Module
&
mod
,
std
::
unordered_map
<
std
::
string
,
BranchData
>
&
brdata
)
{
{
// mode 3 only has integrals and timings
if
(
mode
==
3
)
{
for
(
auto
&
event
:
slot_data
.
events
)
{
for
(
auto
&
event
:
slot_data
.
events
)
{
for
(
auto
&
ch
:
mod
.
channels
)
{
for
(
auto
&
ch
:
mod
.
channels
)
{
auto
&
channel
=
event
.
channels
[
ch
.
id
];
auto
&
channel
=
event
.
channels
[
ch
.
id
];
...
@@ -307,22 +304,6 @@ void fill_branch(const Fadc250Data &slot_data, const Module &mod, std::unordered
...
@@ -307,22 +304,6 @@ void fill_branch(const Fadc250Data &slot_data, const Module &mod, std::unordered
bd
.
integral
[
i
]
=
channel
.
integral
[
i
];
bd
.
integral
[
i
]
=
channel
.
integral
[
i
];
bd
.
time
[
i
]
=
channel
.
time
[
i
];
bd
.
time
[
i
]
=
channel
.
time
[
i
];
}
}
}
}
return
;
}
// mode 1 needs raw wave form analysis
if
(
mode
!=
1
)
{
std
::
cout
<<
"Warning: unsupported data mode = "
<<
mode
<<
", no data are stored."
<<
std
::
endl
;
return
;
}
// fill raw data
for
(
auto
&
event
:
slot_data
.
events
)
{
for
(
auto
&
ch
:
mod
.
channels
)
{
auto
&
channel
=
event
.
channels
[
ch
.
id
];
auto
&
bd
=
brdata
[
ch
.
name
];
waveform_analysis
(
channel
.
raw
,
bd
);
waveform_analysis
(
channel
.
raw
,
bd
);
}
}
}
}
...
@@ -417,9 +398,8 @@ void write_raw_data(const std::string &dpath, const std::string &opath, int nev,
...
@@ -417,9 +398,8 @@ void write_raw_data(const std::string &dpath, const std::string &opath, int nev,
br
.
second
.
nraw
=
0
;
br
.
second
.
nraw
=
0
;
}
}
int
data_mode
=
-
1
;
// read data into event buffer
// read data into event buffer
int
data_mode
=
-
1
;
for
(
auto
&
mod
:
modules
)
{
for
(
auto
&
mod
:
modules
)
{
int
blvl
=
1
;
int
blvl
=
1
;
simpleGetRocBlockLevel
(
mod
.
crate
,
FADC_BANK
,
&
blvl
);
simpleGetRocBlockLevel
(
mod
.
crate
,
FADC_BANK
,
&
blvl
);
...
@@ -447,7 +427,7 @@ void write_raw_data(const std::string &dpath, const std::string &opath, int nev,
...
@@ -447,7 +427,7 @@ void write_raw_data(const std::string &dpath, const std::string &opath, int nev,
}
}
// fill branch data
// fill branch data
fill_branch
(
slot_data
,
mod
,
brdata
,
data_mode
);
fill_branch
(
slot_data
,
mod
,
brdata
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment