Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
atlas
athena
Commits
c70ac557
Commit
c70ac557
authored
Jul 07, 2020
by
Mark Hodgkinson
Browse files
Add creation of FE and set its track links + charge.
parent
9542b245
Changes
1
Hide whitespace changes
Inline
Side-by-side
Reconstruction/eflowRec/src/PFChargedFlowElementCreatorAlgorithm.cxx
View file @
c70ac557
//eflowRec includes
#include
"eflowRec/PFChargedFlowElementCreatorAlgorithm.h"
#include
"eflowRec/eflowRecTrack.h"
//EDM includes
#include
"xAODBase/IParticleContainer.h"
#include
"xAODPFlow/FlowElementAuxContainer.h"
PFChargedFlowElementCreatorAlgorithm
::
PFChargedFlowElementCreatorAlgorithm
(
const
std
::
string
&
name
,
ISvcLocator
*
pSvcLocator
)
:
...
...
@@ -37,4 +41,33 @@ StatusCode PFChargedFlowElementCreatorAlgorithm::finalize(){ return StatusCode::
void
PFChargedFlowElementCreatorAlgorithm
::
createChargedFlowElements
(
const
eflowCaloObject
&
energyFlowCaloObject
,
bool
addClusters
,
SG
::
WriteHandle
<
xAOD
::
FlowElementContainer
>&
chargedFlowElementContainerWriteHandle
)
const
{
/* Loop over all tracks in the eflowCaloObject */
int
nTracks
=
energyFlowCaloObject
.
nTracks
();
for
(
int
iTrack
=
0
;
iTrack
<
nTracks
;
++
iTrack
)
{
eflowRecTrack
*
efRecTrack
=
energyFlowCaloObject
.
efRecTrack
(
iTrack
);
/* Skip tracks that haven't been subtracted */
if
(
false
==
m_eOverPMode
){
if
(
!
efRecTrack
->
isSubtracted
()){
continue
;
}
}
/* Create new xAOD::FlowElement */
xAOD
::
FlowElement
*
thisFE
=
new
xAOD
::
FlowElement
();
chargedFlowElementContainerWriteHandle
->
push_back
(
thisFE
);
/* Get the track elementLink and add it to the xAOD:FE.
Note we first have to convert it to an IParticle ElementLink. */
ElementLink
<
xAOD
::
TrackParticleContainer
>
theTrackLink
=
efRecTrack
->
getTrackElemLink
();
ElementLink
<
xAOD
::
IParticleContainer
>
theIParticleTrackLink
;
theIParticleTrackLink
.
resetWithKeyAndIndex
(
theTrackLink
.
persKey
(),
theTrackLink
.
persIndex
()
);
std
::
vector
<
ElementLink
<
xAOD
::
IParticleContainer
>
>
vecIParticleTrackLinkContainer
;
vecIParticleTrackLinkContainer
.
push_back
(
theIParticleTrackLink
);
thisFE
->
setChargedObjectLinks
(
vecIParticleTrackLinkContainer
);
//Now set the charge
thisFE
->
setCharge
(
efRecTrack
->
getTrack
()
->
charge
());
}
//loop over eflowRecTracks
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment