Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rec
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package 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
Noah Behling
Rec
Commits
3fdc7e95
Commit
3fdc7e95
authored
2 years ago
by
Gerhard Raven
Browse files
Options
Downloads
Patches
Plain Diff
treat SmartRef as-if it was a pointer
parent
16402734
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Phys/SelKernel/include/SelKernel/Utilities.h
+5
-2
5 additions, 2 deletions
Phys/SelKernel/include/SelKernel/Utilities.h
with
5 additions
and
2 deletions
Phys/SelKernel/include/SelKernel/Utilities.h
+
5
−
2
View file @
3fdc7e95
...
...
@@ -22,6 +22,7 @@
#include
"SelKernel/ParticleTraits.h"
#include
"GaudiKernel/GenericMatrixTypes.h"
#include
"GaudiKernel/SmartRef.h"
#include
"GaudiKernel/detected.h"
#include
<cassert>
...
...
@@ -87,7 +88,10 @@ namespace Sel::Utils {
template
<
typename
T
>
auto
&&
deref_if_ptr
(
T
&&
x
)
{
if
constexpr
(
std
::
is_pointer_v
<
std
::
remove_reference_t
<
T
>>
)
{
if
constexpr
(
LHCb
::
Event
::
details
::
is_SmartRef_v
<
std
::
remove_cv_t
<
std
::
remove_reference_t
<
T
>>>
)
{
assert
(
x
);
return
*
x
;
}
else
if
constexpr
(
std
::
is_pointer_v
<
std
::
remove_reference_t
<
T
>>
)
{
assert
(
x
);
// turn on DEBUG flags if you want to check this
return
*
x
;
}
else
{
...
...
@@ -134,7 +138,6 @@ namespace Sel::Utils {
auto
flightDistanceChi2
(
Vertex1
const
&
v1
,
Vertex2
const
&
v2
)
{
using
LHCb
::
Event
::
endVertexPos
;
using
LHCb
::
Event
::
posCovMatrix
;
;
auto
cov
=
posCovMatrix
(
v1
)
+
posCovMatrix
(
v2
);
cov
=
cov
.
invChol
();
// what if it fails?
return
similarity
(
endVertexPos
(
v1
)
-
endVertexPos
(
v2
),
cov
);
...
...
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