Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Tim Martin
athena
Commits
f7633b1e
Commit
f7633b1e
authored
4 years ago
by
Tim Martin
Browse files
Options
Downloads
Patches
Plain Diff
Add deduplication checking to typelessFindLinks
parent
4d807e12
No related branches found
No related tags found
No related merge requests found
Pipeline
#2185136
passed
4 years ago
Stage: external
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Trigger/TrigSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx
+40
-10
40 additions, 10 deletions
...gSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx
with
40 additions
and
10 deletions
Trigger/TrigSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx
+
40
−
10
View file @
f7633b1e
...
...
@@ -351,24 +351,54 @@ namespace TrigCompositeUtils {
{
using
namespace
msgFindLink
;
if
(
visitedCache
!=
nullptr
)
{
// We only need to recursivly explore back from each node in the graph once.
// We only need to recursiv
e
ly explore back from each node in the graph once.
// We can keep a record of nodes which we have already explored, these we can safely skip over.
if
(
visitedCache
->
count
(
start
)
==
1
)
{
return
false
;
// Early exit
}
}
// As the append vectors are user-supplied, perform some input validation.
if
(
keyVec
.
size
()
!=
clidVec
.
size
()
or
clidVec
.
size
()
!=
indexVec
.
size
())
{
ANA_MSG_WARNING
(
"In typelessFindLinks, keyVec, clidVec, indexVec must all be the same size. Instead have:"
<<
keyVec
.
size
()
<<
", "
<<
clidVec
.
size
()
<<
", "
<<
indexVec
.
size
());
return
false
;
}
// Locate named links. Both collections of links and individual links are supported.
bool
found
=
false
;
std
::
vector
<
uint32_t
>
tmpKeyVec
;
std
::
vector
<
uint32_t
>
tmpClidVec
;
std
::
vector
<
uint16_t
>
tmpIndexVec
;
if
(
start
->
hasObjectCollectionLinks
(
linkName
))
{
found
=
start
->
typelessGetObjectCollectionLinks
(
linkName
,
k
eyVec
,
c
lidVec
,
i
ndexVec
);
found
=
start
->
typelessGetObjectCollectionLinks
(
linkName
,
tmpK
eyVec
,
tmpC
lidVec
,
tmpI
ndexVec
);
}
if
(
start
->
hasObjectLink
(
linkName
))
{
uint32_t
key
,
clid
;
uint16_t
index
;
found
|=
start
->
typelessGetObjectLink
(
linkName
,
key
,
clid
,
index
);
keyVec
.
push_back
(
key
);
clidVec
.
push_back
(
clid
);
indexVec
.
push_back
(
index
);
uint32_t
tmpKey
,
tmpClid
;
uint16_t
tmpIndex
;
found
|=
start
->
typelessGetObjectLink
(
linkName
,
tmpKey
,
tmpClid
,
tmpIndex
);
tmpKeyVec
.
push_back
(
tmpKey
);
tmpClidVec
.
push_back
(
tmpClid
);
tmpIndexVec
.
push_back
(
tmpIndex
);
}
// De-duplicate
for
(
size_t
tmpi
=
0
;
tmpi
<
tmpKeyVec
.
size
();
++
tmpi
)
{
bool
alreadyAdded
=
false
;
const
uint32_t
tmpKey
=
tmpKeyVec
.
at
(
tmpi
);
const
uint32_t
tmpClid
=
tmpClidVec
.
at
(
tmpi
);
const
uint16_t
tmpIndex
=
tmpIndexVec
.
at
(
tmpi
);
for
(
size_t
veci
=
0
;
veci
<
keyVec
.
size
();
++
veci
)
{
if
(
keyVec
.
at
(
veci
)
==
tmpKey
and
clidVec
.
at
(
veci
)
==
tmpClid
and
indexVec
.
at
(
veci
)
==
tmpIndex
)
{
alreadyAdded
=
true
;
break
;
}
}
if
(
!
alreadyAdded
)
{
keyVec
.
push_back
(
tmpKey
);
clidVec
.
push_back
(
tmpClid
);
indexVec
.
push_back
(
tmpIndex
);
}
}
// Early exit
if
(
found
&&
behaviour
==
TrigDefs
::
lastFeatureOfType
)
{
...
...
@@ -395,7 +425,7 @@ namespace TrigCompositeUtils {
// only want the most recent.
// Hence we can supply TrigDefs::lastFeatureOfType. /--> parent3(link)
// We can still have more then one link found if there is a branch in the navigation. E.g. start --> parent1 --> parent2(link)
// If both parent2 and parent3 posessed an admis
a
ble ElementLink, then the warning below will trigger, and only one of the
// If both parent2 and parent3 pos
s
essed an admis
si
ble ElementLink, then the warning below will trigger, and only one of the
// links will be returned (whichever of parent2 or parent3 happened to be the first seed of parent1).
std
::
vector
<
uint32_t
>
keyVec
;
std
::
vector
<
uint32_t
>
clidVec
;
...
...
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