Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
LHCb
LHCb
Commits
4fa0d1f6
Commit
4fa0d1f6
authored
11 months ago
by
Rosen Matev
Browse files
Options
Downloads
Patches
Plain Diff
Fix ODIN::CalibrationTypes for Run 3 and usage
parent
51058b14
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!4553
Fix UT Decoder
,
!4539
Synchronize master branch with 2024-patches
,
!4525
Draft: Synchronize master branch with 2024-patches
,
!4514
Fix ODIN::CalibrationTypes and clean up
Pipeline
#7235561
passed
11 months ago
Stage: test
Stage: .post
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Event/DAQEvent/include/Event/ODIN.h
+19
-6
19 additions, 6 deletions
Event/DAQEvent/include/Event/ODIN.h
Event/DAQEvent/src/ODIN.cpp
+15
-17
15 additions, 17 deletions
Event/DAQEvent/src/ODIN.cpp
with
34 additions
and
23 deletions
Event/DAQEvent/include/Event/ODIN.h
+
19
−
6
View file @
4fa0d1f6
...
...
@@ -139,10 +139,10 @@ namespace LHCb {
/// Calibration types
enum
class
CalibrationTypes
:
std
::
uint8_t
{
//
A
=
0
,
B
=
1
,
C
=
2
,
D
=
3
A
=
0
x1
,
B
=
0x2
,
C
=
0x4
,
D
=
0x8
};
/// BX Types
...
...
@@ -345,11 +345,24 @@ namespace LHCb {
[[
nodiscard
]]
constexpr
ACCEL_TARGET_SPEC
auto
calibrationType
()
const
{
return
details
::
get_bits
<
CalibrationTypeSize
,
CalibrationTypeOffset
>
(
data
);
}
[[
nodiscard
]]
constexpr
bool
calibrationTypeBit
(
CalibrationTypes
mask
)
const
{
assert
(
__builtin_popcount
(
static_cast
<
std
::
uint8_t
>
(
mask
)
)
==
1
);
// FIXME: C++20 use std::popcount
// instead
return
calibrationType
()
&
static_cast
<
std
::
uint8_t
>
(
mask
);
}
constexpr
void
setCalibrationType
(
std
::
uint8_t
value
)
{
details
::
set_bits
<
CalibrationTypeSize
,
CalibrationTypeOffset
>
(
data
,
value
);
}
constexpr
void
setCalibrationType
(
CalibrationTypes
value
)
{
setCalibrationType
(
static_cast
<
std
::
uint8_t
>
(
value
)
);
constexpr
void
setCalibrationTypeBit
(
CalibrationTypes
mask
,
bool
value
)
{
assert
(
__builtin_popcount
(
static_cast
<
std
::
uint8_t
>
(
mask
)
)
==
1
);
// FIXME: C++20 use std::popcount
// instead
std
::
uint8_t
newCalibrationType
=
calibrationType
();
if
(
value
)
{
newCalibrationType
|=
static_cast
<
std
::
uint8_t
>
(
mask
);
}
else
{
newCalibrationType
&=
~
static_cast
<
std
::
uint8_t
>
(
mask
);
}
setCalibrationType
(
newCalibrationType
);
}
[[
nodiscard
]]
constexpr
ACCEL_TARGET_SPEC
auto
orbitNumber
()
const
{
...
...
This diff is collapsed.
Click to expand it.
Event/DAQEvent/src/ODIN.cpp
+
15
−
17
View file @
4fa0d1f6
...
...
@@ -39,7 +39,8 @@ namespace LHCb::ODINImplementation::v7_standalone {
odin
.
setBunchId
(
get_bits
<
12
,
8
*
32
+
0
>
(
buffer
)
);
odin
.
setTimeAlignmentEventIndex
(
get_bits
<
3
,
8
*
32
+
12
>
(
buffer
)
);
odin
.
setTriggerType
(
get_bits
<
3
,
8
*
32
+
16
>
(
buffer
)
);
odin
.
setCalibrationType
(
get_bits
<
2
,
8
*
32
+
19
>
(
buffer
)
);
// calibration type changed from value (x) to bitmask (1 << x)
odin
.
setCalibrationType
(
1
<<
get_bits
<
2
,
8
*
32
+
19
>
(
buffer
)
);
odin
.
setBunchCrossingType
(
static_cast
<
ODIN
::
BXTypes
>
(
get_bits
<
2
,
8
*
32
+
22
>
(
buffer
)
)
);
return
odin
;
...
...
@@ -65,25 +66,22 @@ namespace LHCb::ODINImplementation::v7_standalone {
set_bits
<
3
,
8
*
32
+
12
>
(
buffer
,
timeAlignmentEventIndex
()
);
assert
(
triggerType
()
<=
7
);
// change of width between v6 and v7
set_bits
<
3
,
8
*
32
+
16
>
(
buffer
,
triggerType
()
);
assert
(
calibrationType
()
<=
3
);
// change of width between v6 and v7
set_bits
<
2
,
8
*
32
+
19
>
(
buffer
,
calibrationType
()
);
// change of width between v6 and v7
std
::
uint8_t
calibrationTypeV6
=
0
;
if
(
calibrationTypeBit
(
CalibrationTypes
::
A
)
)
{
calibrationTypeV6
=
0
;
}
else
if
(
calibrationTypeBit
(
CalibrationTypes
::
B
)
)
{
calibrationTypeV6
=
1
;
}
else
if
(
calibrationTypeBit
(
CalibrationTypes
::
C
)
)
{
calibrationTypeV6
=
2
;
}
else
if
(
calibrationTypeBit
(
CalibrationTypes
::
D
)
)
{
calibrationTypeV6
=
3
;
}
set_bits
<
2
,
8
*
32
+
19
>
(
buffer
,
calibrationTypeV6
);
set_bits
<
2
,
8
*
32
+
22
>
(
buffer
,
static_cast
<
std
::
uint16_t
>
(
bunchCrossingType
()
)
);
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
s
,
ODIN
::
CalibrationTypes
e
)
{
switch
(
e
)
{
case
LHCb
::
ODIN
::
CalibrationTypes
::
A
:
return
s
<<
"A"
;
case
LHCb
::
ODIN
::
CalibrationTypes
::
B
:
return
s
<<
"B"
;
case
LHCb
::
ODIN
::
CalibrationTypes
::
C
:
return
s
<<
"C"
;
case
LHCb
::
ODIN
::
CalibrationTypes
::
D
:
return
s
<<
"D"
;
default:
return
s
<<
"ERROR unknown value "
<<
static_cast
<
int
>
(
e
)
<<
" for enum LHCb::ODIN::CalibrationTypes"
;
}
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
s
,
ODIN
::
CalibrationTypes
e
)
{
return
s
<<
static_cast
<
int
>
(
e
);
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
s
,
ODIN
::
BXTypes
e
)
{
switch
(
e
)
{
...
...
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