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
48f13821
Commit
48f13821
authored
3 years ago
by
Felix Weiglhofer
Browse files
Options
Downloads
Patches
Plain Diff
StsDigi: Add more error handling against timestamp overflows.
parent
cb194272
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!538
StsDigi: Add more error handling against timestamp overflows.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/data/sts/CbmStsAddress.cxx
+4
-0
4 additions, 0 deletions
core/data/sts/CbmStsAddress.cxx
core/data/sts/CbmStsDigi.cxx
+1
-1
1 addition, 1 deletion
core/data/sts/CbmStsDigi.cxx
core/data/sts/CbmStsDigi.h
+2
-1
2 additions, 1 deletion
core/data/sts/CbmStsDigi.h
with
7 additions
and
2 deletions
core/data/sts/CbmStsAddress.cxx
+
4
−
0
View file @
48f13821
...
...
@@ -203,6 +203,10 @@ int32_t CbmStsAddress::PackDigiAddress(int32_t address)
|
kMask
[
1
][
kStsModule
]
<<
kShift
[
1
][
kStsModule
];
int32_t
ret
=
(
address
&
kDMask
)
>>
kShift
[
1
][
kStsUnit
];
// Check that no bits were set, that are stripped by this function.
assert
(
address
==
UnpackDigiAddress
(
ret
));
return
ret
;
}
// -------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
core/data/sts/CbmStsDigi.cxx
+
1
−
1
View file @
48f13821
...
...
@@ -37,7 +37,7 @@ void CbmStsDigi::PackAddressAndTime(int32_t newAddress, uint32_t newTime)
uint32_t
lowerAddr
=
packedAddr
&
((
1
<<
kNumLowerAddrBits
)
-
1
);
fAddress
=
lowerAddr
;
fTime
=
(
highestBitAddr
<<
kNumTimestampBits
)
|
newTime
;
fTime
=
(
highestBitAddr
<<
kNumTimestampBits
)
|
(
kTimestampMask
&
newTime
)
;
}
int32_t
CbmStsDigi
::
UnpackAddress
()
const
...
...
This diff is collapsed.
Click to expand it.
core/data/sts/CbmStsDigi.h
+
2
−
1
View file @
48f13821
...
...
@@ -47,8 +47,9 @@ public:
** @param time Measurement time [ns]
** @param charge Charge [ADC units]
**/
CbmStsDigi
(
int32_t
address
,
int32_t
channel
,
uint32_t
time
,
uint16_t
charge
)
CbmStsDigi
(
int32_t
address
,
int32_t
channel
,
double
time
,
uint16_t
charge
)
{
assert
(
time
>=
0
&&
time
<=
kMaxTimestamp
);
PackAddressAndTime
(
address
,
time
);
PackChannelAndCharge
(
channel
,
charge
);
}
...
...
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