Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Computing
cbmroot
Commits
ad0346b7
Commit
ad0346b7
authored
1 year ago
by
Felix Weiglhofer
Committed by
Volker Friese
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
UnpackSts: Add protection against invalid timestamps.
parent
602e4e23
No related branches found
No related tags found
1 merge request
!1226
UnpackSts: Add protection against invalid timestamps.
Pipeline
#23069
passed
1 year ago
Stage: build
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
algo/detectors/sts/UnpackSts.cxx
+9
-1
9 additions, 1 deletion
algo/detectors/sts/UnpackSts.cxx
core/data/sts/CbmStsDigi.h
+9
-10
9 additions, 10 deletions
core/data/sts/CbmStsDigi.h
with
18 additions
and
11 deletions
algo/detectors/sts/UnpackSts.cxx
+
9
−
1
View file @
ad0346b7
...
...
@@ -123,11 +123,19 @@ namespace cbm::algo
messageTime
-=
elinkPar
.
fTimeOffset
;
// --- Apply walk correction if applicable
if
(
message
.
GetHitAdc
()
<=
elinkPar
.
fWalk
.
size
())
{
messageTime
+=
elinkPar
.
fWalk
[
message
.
GetHitAdc
()
-
1
];
}
if
(
message
.
GetHitAdc
()
<=
elinkPar
.
fWalk
.
size
())
{
double
walk
=
elinkPar
.
fWalk
[
message
.
GetHitAdc
()
-
1
];
messageTime
+=
walk
;
}
// --- Charge
double
charge
=
elinkPar
.
fAdcOffset
+
(
message
.
GetHitAdc
()
-
1
)
*
elinkPar
.
fAdcGain
;
if
(
messageTime
>
CbmStsDigi
::
kMaxTimestamp
)
{
monitor
.
fNumErrTimestampOverflow
++
;
return
;
}
// --- Create output digi
digiVec
.
emplace_back
(
elinkPar
.
fAddress
,
channel
,
messageTime
,
charge
);
}
...
...
This diff is collapsed.
Click to expand it.
core/data/sts/CbmStsDigi.h
+
9
−
10
View file @
ad0346b7
...
...
@@ -39,11 +39,19 @@
**/
class
CbmStsDigi
{
public:
// constants
static
constexpr
int
kNumAdcBits
=
5
;
static
constexpr
uint32_t
kAdcMask
=
(
1u
<<
kNumAdcBits
)
-
1u
;
static
constexpr
int
kNumLowerAddrBits
=
16
;
static
constexpr
int
kNumTimestampBits
=
31
;
static
constexpr
uint32_t
kTimestampMask
=
(
1u
<<
kNumTimestampBits
)
-
1u
;
static
constexpr
uint32_t
kMaxTimestamp
=
kTimestampMask
;
static
constexpr
uint32_t
kTimeAddressBitMask
=
~
kTimestampMask
;
public:
/** Default constructor **/
CbmStsDigi
()
=
default
;
/** Standard constructor
** @param address Unique element address
** @param channel Channel number
...
...
@@ -159,15 +167,6 @@ public:
private
:
friend
class
boost
::
serialization
::
access
;
static
constexpr
int
kNumAdcBits
=
5
;
static
constexpr
uint32_t
kAdcMask
=
(
1u
<<
kNumAdcBits
)
-
1u
;
static
constexpr
int
kNumLowerAddrBits
=
16
;
static
constexpr
int
kNumTimestampBits
=
31
;
static
constexpr
uint32_t
kTimestampMask
=
(
1u
<<
kNumTimestampBits
)
-
1u
;
static
constexpr
uint32_t
kMaxTimestamp
=
kTimestampMask
;
static
constexpr
uint32_t
kTimeAddressBitMask
=
~
kTimestampMask
;
// CUDA requires types in shared memory to have trivial constructors / destructors
#if XPU_IS_HIP_CUDA
#define CPU_ONLY(x)
...
...
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