Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
scdaq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scouting-demonstrator
scdaq
Commits
36231301
Commit
36231301
authored
2 years ago
by
Dinyar Rabady
Committed by
Dinyar Rabady
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Micro optimisations
parent
74aaa764
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/processor.cc
+5
-6
5 additions, 6 deletions
src/processor.cc
with
5 additions
and
6 deletions
src/processor.cc
+
5
−
6
View file @
36231301
...
@@ -126,7 +126,7 @@ inline std::pair<uint32_t, bool> StreamProcessor::ProcessOrbitHeader(char *rd_pt
...
@@ -126,7 +126,7 @@ inline std::pair<uint32_t, bool> StreamProcessor::ProcessOrbitHeader(char *rd_pt
// Goes through orbit worth of data and fills the output memory with the calo
// Goes through orbit worth of data and fills the output memory with the calo
// data corresponding to the non-empty bunchcrossings, as marked in bx_vect
// data corresponding to the non-empty bunchcrossings, as marked in bx_vect
StreamProcessor
::
fillOrbitMetadata
StreamProcessor
::
FillOrbitCalo
(
StreamProcessor
::
fillOrbitMetadata
StreamProcessor
::
FillOrbitCalo
(
std
::
vector
<
unsigned
int
>
&
bx_vect
,
char
*
rd_ptr
,
char
*
wr_ptr
)
{
const
std
::
vector
<
unsigned
int
>
&
bx_vect
,
char
*
rd_ptr
,
char
*
wr_ptr
)
{
std
::
pair
<
uint32_t
,
bool
>
orbit_header
=
std
::
pair
<
uint32_t
,
bool
>
{
std
::
pair
<
uint32_t
,
bool
>
orbit_header
=
std
::
pair
<
uint32_t
,
bool
>
{
ProcessOrbitHeader
(
rd_ptr
)};
//.second is the warning test enable bit
ProcessOrbitHeader
(
rd_ptr
)};
//.second is the warning test enable bit
rd_ptr
+=
32
;
// +32 to account for orbit header
rd_ptr
+=
32
;
// +32 to account for orbit header
...
@@ -142,7 +142,7 @@ StreamProcessor::fillOrbitMetadata StreamProcessor::FillOrbitCalo(
...
@@ -142,7 +142,7 @@ StreamProcessor::fillOrbitMetadata StreamProcessor::FillOrbitCalo(
uint32_t
bx
=
uint32_t
{
bx_vect
[
relbx
]};
uint32_t
bx
=
uint32_t
{
bx_vect
[
relbx
]};
uint32_t
orbit_
=
uint32_t
{
orbit_header
.
first
};
uint32_t
orbit_
=
uint32_t
{
orbit_header
.
first
};
if
(
bx
>
3554
)
{
if
(
bx
>
3554
)
{
orbit_
--
;
--
orbit_
;
}
// fix for the fact that bx 3555 - 3564 are from the previous orbit
}
// fix for the fact that bx 3555 - 3564 are from the previous orbit
uint32_t
header
=
uint32_t
{
orbit_header
.
second
};
// header can be added to later
uint32_t
header
=
uint32_t
{
orbit_header
.
second
};
// header can be added to later
memcpy
(
wr_ptr
,
(
char
*
)
&
header
,
4
);
memcpy
(
wr_ptr
,
(
char
*
)
&
header
,
4
);
...
@@ -233,7 +233,7 @@ uint32_t StreamProcessor::FillBril(char *rd_ptr, char *wr_ptr, char *end_ptr) {
...
@@ -233,7 +233,7 @@ uint32_t StreamProcessor::FillBril(char *rd_ptr, char *wr_ptr, char *end_ptr) {
// Goes through orbit worth of data and fills the output memory with the muons
// Goes through orbit worth of data and fills the output memory with the muons
// corresponding to the non-empty bunchcrossings, as marked in bx_vect
// corresponding to the non-empty bunchcrossings, as marked in bx_vect
StreamProcessor
::
fillOrbitMetadata
StreamProcessor
::
FillOrbitMuon
(
StreamProcessor
::
fillOrbitMetadata
StreamProcessor
::
FillOrbitMuon
(
std
::
vector
<
unsigned
int
>
&
bx_vect
,
char
*
rd_ptr
,
char
*
wr_ptr
)
{
const
std
::
vector
<
unsigned
int
>
&
bx_vect
,
char
*
rd_ptr
,
char
*
wr_ptr
)
{
std
::
pair
<
uint32_t
,
bool
>
orbit_header
=
std
::
pair
<
uint32_t
,
bool
>
{
std
::
pair
<
uint32_t
,
bool
>
orbit_header
=
std
::
pair
<
uint32_t
,
bool
>
{
ProcessOrbitHeader
(
rd_ptr
)};
//.second is the warning test enable bit
ProcessOrbitHeader
(
rd_ptr
)};
//.second is the warning test enable bit
rd_ptr
+=
32
;
// +32 to account for orbit header
rd_ptr
+=
32
;
// +32 to account for orbit header
...
@@ -252,7 +252,7 @@ StreamProcessor::fillOrbitMetadata StreamProcessor::FillOrbitMuon(
...
@@ -252,7 +252,7 @@ StreamProcessor::fillOrbitMetadata StreamProcessor::FillOrbitMuon(
bool
BblocksOn
[
8
];
bool
BblocksOn
[
8
];
uint32_t
bx
=
uint32_t
{
bx_vect
[
relbx
]};
uint32_t
bx
=
uint32_t
{
bx_vect
[
relbx
]};
if
(
bx
>
3554
)
{
if
(
bx
>
3554
)
{
orbit
--
;
--
orbit
;
}
// fix for the fact that bx 3555 - 3564 are from the previous orbit
}
// fix for the fact that bx 3555 - 3564 are from the previous orbit
for
(
unsigned
int
i
=
0
;
i
<
8
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
8
;
i
++
)
{
uint32_t
bxA
=
(
bl
->
bx
[
i
]
>>
shifts
::
bx
)
&
masks
::
bx
;
uint32_t
bxA
=
(
bl
->
bx
[
i
]
>>
shifts
::
bx
)
&
masks
::
bx
;
...
@@ -375,10 +375,9 @@ void StreamProcessor::process(Slice &input, Slice &out) {
...
@@ -375,10 +375,9 @@ void StreamProcessor::process(Slice &input, Slice &out) {
return
;
return
;
}
}
while
(
endofpacket
==
false
)
{
while
(
endofpacket
==
false
)
{
std
::
vector
<
unsigned
int
>
bx_vect
;
uint32_t
orbitCount
=
0
;
uint32_t
orbitCount
=
0
;
bool
trailerError
=
false
;
bool
trailerError
=
false
;
bx_vect
=
CountBX
(
input
,
rd_ptr
,
trailerError
);
std
::
vector
<
unsigned
int
>
bx_vect
=
CountBX
(
input
,
rd_ptr
,
trailerError
);
if
(
trailerError
==
true
)
{
if
(
trailerError
==
true
)
{
stats
.
orbit_trailer_error_count
++
;
stats
.
orbit_trailer_error_count
++
;
LOG
(
WARNING
)
<<
"Orbit trailer error: orbit trailer not found before end of data "
LOG
(
WARNING
)
<<
"Orbit trailer error: orbit trailer not found before end of data "
...
...
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