Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
atlas
athena
Commits
061232cd
Commit
061232cd
authored
Jul 30, 2020
by
Mark Hodgkinson
Browse files
Add code to set LC 4-vector of shallow copied FlowElements.
parent
47cd23a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Reconstruction/eflowRec/src/PFLCNeutralFlowElementCreatorAlgorithm.cxx
View file @
061232cd
#include "eflowRec/PFLCNeutralFlowElementCreatorAlgorithm.h"
#include "xAODCore/ShallowCopy.h"
#include "xAODCaloEvent/CaloClusterContainer.h"
PFLCNeutralFlowElementCreatorAlgorithm
::
PFLCNeutralFlowElementCreatorAlgorithm
(
const
std
::
string
&
name
,
ISvcLocator
*
pSvcLocator
)
:
AthReentrantAlgorithm
(
name
,
pSvcLocator
)
...
...
@@ -26,6 +27,17 @@ StatusCode PFLCNeutralFlowElementCreatorAlgorithm::execute(const EventContext& c
SG
::
WriteHandle
<
xAOD
::
FlowElementContainer
>
neutralFELCContainerWriteHandle
(
m_neutralFELCContainerWriteHandleKey
,
ctx
);
ATH_CHECK
(
neutralFELCContainerWriteHandle
.
record
(
std
::
move
(
neutralFELCContainer
),
std
::
move
(
neutralFELCContainerAux
)));
for
(
unsigned
int
counter
=
0
;
counter
<
(
*
neutralFEContainerReadHandle
).
size
();
counter
++
){
const
xAOD
::
FlowElement
*
thisFE
=
(
*
neutralFEContainerReadHandle
)[
counter
];
const
SG
::
AuxElement
::
Accessor
<
ElementLink
<
xAOD
::
CaloClusterContainer
>
>
accShowerSubtractedClusterLink
(
"FEShowerSubtractedClusterLink"
);
ElementLink
<
xAOD
::
CaloClusterContainer
>
clusElementLink
=
accShowerSubtractedClusterLink
(
*
thisFE
);
xAOD
::
FlowElement
*
theCopiedFE
=
(
*
neutralFELCContainerWriteHandle
)[
counter
];
theCopiedFE
->
setP4
((
*
clusElementLink
)
->
pt
(),
(
*
clusElementLink
)
->
rawEta
(),
(
*
clusElementLink
)
->
rawPhi
(),
(
*
clusElementLink
)
->
m
());
}
return
StatusCode
::
SUCCESS
;
}
...
...
Reconstruction/eflowRec/src/PFNeutralFlowElementCreatorAlgorithm.cxx
View file @
061232cd
...
...
@@ -40,7 +40,7 @@ StatusCode PFNeutralFlowElementCreatorAlgorithm::execute(const EventContext& ctx
// Record the output containers
SG
::
WriteHandle
<
xAOD
::
FlowElementContainer
>
neutralFEContainerWriteHandle
(
m_neutralFEContainerWriteHandleKey
,
ctx
);
std
::
sort
(
neutralFEContainer
->
begin
(),
neutralFEContainer
->
end
(),
[]
(
const
xAOD
::
FlowElement
*
fe1
,
const
xAOD
::
FlowElement
*
fe2
)
{
return
fe1
->
pt
()
>
fe2
->
pt
();});
std
::
sort
(
neutralFEContainer
->
begin
(),
neutralFEContainer
->
end
(),
[]
(
const
xAOD
::
FlowElement
*
fe1
,
const
xAOD
::
FlowElement
*
fe2
)
{
return
fe1
->
pt
()
>
fe2
->
pt
();});
ATH_CHECK
(
neutralFEContainerWriteHandle
.
record
(
std
::
move
(
neutralFEContainer
),
std
::
move
(
neutralFEContainerAux
))
);
return
StatusCode
::
SUCCESS
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment