42 return StatusCode::SUCCESS;
48 return StatusCode::SUCCESS;
59 return StatusCode::SUCCESS;
66 std::vector<bool> keptTrackParticles;
71 keptTrackParticles.resize( trackPC->size(),
false );
77 std::vector<bool> keptVertices;
82 keptVertices.resize( vertices->size(),
false );
97 auto el_itr = electrons->begin();
98 auto el_end = electrons->end();
99 for( ; el_itr != el_end; ++el_itr ) {
101 auto trackParticleLinks = (*el_itr)->trackParticleLinks();
102 for (
const auto& link : trackParticleLinks){
103 if( ! link.isValid() ){
106 ATH_MSG_DEBUG(
"Electrons : Keeping GSF Track Particle with index : "<< link.index() );
107 keptTrackParticles[link.index() ] =
true;
119 auto ph_itr = photons->begin();
120 auto ph_end = photons->end();
121 for( ; ph_itr != ph_end; ++ph_itr ) {
123 auto vertexLinks= (*ph_itr) ->vertexLinks();
124 for (
const auto& vxlink : vertexLinks){
125 if( ! vxlink.isValid() ){
128 ATH_MSG_DEBUG(
"Photons : Keeping GSF Vertex with index : "<< vxlink.index() );
129 keptVertices[vxlink.index()]=
true;
136 for (
const auto& link : trackParticleLinks){
137 if( ! link.isValid() ){
140 ATH_MSG_DEBUG(
"Photons : Keeping GSF Track Particle with index : "<< link.index() );
141 keptTrackParticles[link.index() ] =
true;
153 for (
const auto *el : *fwdelectrons) {
155 auto trackParticleLinks = el->trackParticleLinks();
156 for (
const auto& link : trackParticleLinks){
157 if (!link.isValid()) {
161 "Keeping GSF Track Particle with index : "
163 keptTrackParticles[link.index()] =
true;
170 trackPC.
keep (keptTrackParticles);
171 vertices.
keep (keptVertices);
175 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
Handle for requesting thinning for a data object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
Handle for requesting thinning for a data object.
SG::ThinningHandleKey< xAOD::VertexContainer > m_VertexKey
GSF vertex container to thin.
SG::ReadHandleKey< xAOD::ElectronContainer > m_InputForwardElectronContainerKey
forward electron collection input name
SG::ReadHandleKey< xAOD::ElectronContainer > m_InputElectronContainerKey
electron collection input name
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_TrackParticlesKey
GSF Track Particle container to thin.
Gaudi::Property< bool > m_doThinning
Bool to decide if we actually do the Thinning.
StatusCode initialize() override final
initialize method
StatusCode finalize() override final
finalize method
SG::ReadHandleKey< xAOD::PhotonContainer > m_InputPhotonContainerKey
photon collection input name
StringProperty m_streamName
Name of the stream being thinned.
StatusCode execute(const EventContext &ctx) const override final
execute method
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
Vertex_v1 Vertex
Define the latest version of the vertex class.