Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Davide Di Croce
athena
Commits
61e47d16
Commit
61e47d16
authored
1 year ago
by
Carlo Varni
Committed by
Tadej Novak
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Use ReadDecorHandle when reading ACTS SPs from file
Use ReadDecorHandle when reading ACTS SPs from file
parent
0a940a43
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tracking/Acts/ActsCollectionAlgs/src/SpacePointReader.cxx
+17
-10
17 additions, 10 deletions
Tracking/Acts/ActsCollectionAlgs/src/SpacePointReader.cxx
Tracking/Acts/ActsCollectionAlgs/src/SpacePointReader.h
+4
-0
4 additions, 0 deletions
Tracking/Acts/ActsCollectionAlgs/src/SpacePointReader.h
with
21 additions
and
10 deletions
Tracking/Acts/ActsCollectionAlgs/src/SpacePointReader.cxx
+
17
−
10
View file @
61e47d16
...
...
@@ -5,6 +5,7 @@
#include
"SpacePointReader.h"
#include
"xAODMeasurementBase/UncalibratedMeasurementContainer.h"
#include
"AthLinks/ElementLink.h"
#include
"StoreGate/ReadDecorHandle.h"
#include
"StoreGate/WriteDecorHandle.h"
namespace
ActsTrk
{
...
...
@@ -18,13 +19,16 @@ namespace ActsTrk {
{
ATH_MSG_DEBUG
(
"Initializing "
<<
name
()
<<
" ... "
);
m_linkDecoration
=
m_spacePointKey
.
key
()
+
"."
+
m_linkDecoration
.
key
();
m_clusterDecoration
=
m_spacePointKey
.
key
()
+
"."
+
m_clusterDecoration
.
key
();
ATH_MSG_DEBUG
(
"Properties:"
);
ATH_MSG_DEBUG
(
m_spacePointKey
);
ATH_MSG_DEBUG
(
m_linkDecoration
);
ATH_MSG_DEBUG
(
m_clusterDecoration
);
ATH_CHECK
(
m_spacePointKey
.
initialize
());
ATH_CHECK
(
m_linkDecoration
.
initialize
());
ATH_CHECK
(
m_clusterDecoration
.
initialize
());
return
StatusCode
::
SUCCESS
;
...
...
@@ -40,21 +44,23 @@ namespace ActsTrk {
const
xAOD
::
SpacePointContainer
*
spacePoints
=
spHandle
.
cptr
();
ATH_MSG_DEBUG
(
"Retrieved "
<<
spacePoints
->
size
()
<<
" elements from space point container"
);
ATH_MSG_DEBUG
(
"Reading decoration to space point collection: element links to clusters"
);
ATH_MSG_DEBUG
(
"Decoration name: "
<<
m_linkDecoration
.
key
());
using
link_type
=
std
::
vector
<
ElementLink
<
xAOD
::
UncalibratedMeasurementContainer
>
>
;
SG
::
ReadDecorHandle
<
xAOD
::
SpacePointContainer
,
link_type
>
elementLinksToClusters
(
m_linkDecoration
,
ctx
);
ATH_CHECK
(
elementLinksToClusters
.
isAvailable
());
ATH_MSG_DEBUG
(
"Adding decoration to space point collection: bare pointers to clusters"
);
ATH_MSG_DEBUG
(
"Decoration name: "
<<
m_clusterDecoration
.
key
());
using
decoration_type
=
std
::
vector
<
const
xAOD
::
UncalibratedMeasurement
*>
;
SG
::
WriteDecorHandle
<
xAOD
::
SpacePointContainer
,
decoration_type
>
barePointersToClusters
(
m_clusterDecoration
,
ctx
);
ATH_MSG_DEBUG
(
"Retrieving Element Links to Clusters from the Space Points and attaching the bare pointers to the object"
);
static
const
SG
::
AuxElement
::
Accessor
<
std
::
vector
<
ElementLink
<
xAOD
::
UncalibratedMeasurementContainer
>>
>
accesor
(
"measurementLink"
);
for
(
const
xAOD
::
SpacePoint
*
sp
:
*
spacePoints
)
{
if
(
not
accesor
.
isAvailable
(
*
sp
))
{
ATH_MSG_ERROR
(
"Space point does not possess element link to cluster. Decoration `measurementLink` is not available and this should not happen!"
);
return
StatusCode
::
FAILURE
;
}
const
std
::
vector
<
ElementLink
<
xAOD
::
UncalibratedMeasurementContainer
>
>&
els
=
accesor
(
*
sp
);
const
link_type
&
els
=
elementLinksToClusters
(
*
sp
);
std
::
vector
<
const
xAOD
::
UncalibratedMeasurement
*
>
meas
;
meas
.
reserve
(
els
.
size
());
for
(
const
ElementLink
<
xAOD
::
UncalibratedMeasurementContainer
>&
el
:
els
)
{
...
...
@@ -63,7 +69,8 @@ namespace ActsTrk {
barePointersToClusters
(
*
sp
)
=
meas
;
}
ATH_MSG_DEBUG
(
"Decorations have been attached to space point collection"
);
return
StatusCode
::
SUCCESS
;
}
...
...
This diff is collapsed.
Click to expand it.
Tracking/Acts/ActsCollectionAlgs/src/SpacePointReader.h
+
4
−
0
View file @
61e47d16
...
...
@@ -8,6 +8,7 @@
#include
"AthenaBaseComps/AthReentrantAlgorithm.h"
#include
"GaudiKernel/EventContext.h"
#include
"StoreGate/ReadHandleKey.h"
#include
"StoreGate/ReadDecorHandleKey.h"
#include
"StoreGate/WriteDecorHandleKey.h"
// EDM
...
...
@@ -29,6 +30,9 @@ class SpacePointReader
{
this
,
"SpacePointKey"
,
""
,
"Key for input space point container"
};
SG
::
ReadDecorHandleKey
<
xAOD
::
SpacePointContainer
>
m_linkDecoration
{
this
,
"LinkDecorationKey"
,
"measurementLink"
,
"Decoration key for the element link to clusters"
};
SG
::
WriteDecorHandleKey
<
xAOD
::
SpacePointContainer
>
m_clusterDecoration
{
this
,
"ClusterDecorationKey"
,
"measurements"
,
"Decoration key for the cluster bare pointer"
};
...
...
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