13#include "GaudiKernel/ThreadLocalContext.h"
33 <<
" Trk::Tracks with key (electrons) "
38 <<
" Trk::Tracks with key (photons) "
48 return StatusCode::FAILURE;
56 ATH_MSG_DEBUG(
"==> done with initialize " << name() <<
"...");
57 return StatusCode::SUCCESS;
70 return StatusCode::SUCCESS;
78 std::vector<bool> keptTracks;
81 if (keptTracks.size() < trackPC->size()) {
82 keptTracks.resize(trackPC->size(),
false);
92 for (
const auto *el : *electrons) {
96 size_t nel = el->nTrackParticles();
100 for (
size_t i = 0; i < nel; i++) {
102 if (!tp || !tp->trackLink().isValid()) {
105 size_t index = tp->trackLink().index();
106 keptTracks[
index] =
true;
117 for (
const auto *ph : *photons) {
121 size_t nvx = ph->nVertices();
125 for (
size_t i = 0; i < nvx; i++) {
129 for (
size_t j = 0; j < ntp; j++) {
131 if (!tp || !tp->trackLink().isValid()) {
134 size_t index = tp->trackLink().index();
135 keptTracks[
index] =
true;
143 ATH_MSG_DEBUG(
"keep " << kept <<
" out of " << keptTracks.size());
145 trackPC.
keep(keptTracks);
146 return StatusCode::SUCCESS;
154 std::vector<bool> keptTracks;
158 if (keptTracks.size() < trackPC->size()) {
159 keptTracks.resize(trackPC->size(),
false);
167 for (
const auto *mu : *muons) {
173 acc(
"combinedTrackParticleLink");
174 if (!acc.isAvailable(*mu)) {
182 if (!tp || !tp->trackLink().isValid()) {
185 size_t index = tp->trackLink().index();
186 keptTracks[
index] =
true;
190 ATH_MSG_DEBUG(
"keep " << kept <<
" out of " << keptTracks.size());
192 trackPC.
keep(keptTracks);
193 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Handle for requesting thinning for a data object.
ElementLink implementation for ROOT usage.
bool isValid() const
Test to see if the link can be dereferenced.
SG::Accessor< T, ALLOC > Accessor
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.
Gaudi::Property< bool > m_doMuons
SG::ReadHandleKey< xAOD::PhotonContainer > m_photonsKey
Gaudi::Property< double > m_minptMuons
Gaudi::Property< bool > m_bestonlyPhotons
SG::ThinningHandleKey< TrackCollection > m_GSFTracksKey
StatusCode doEGamma(const EventContext &ctx) const
Inline method.
Gaudi::Property< bool > m_bestonlyElectrons
virtual StatusCode initialize() override final
Athena algorithm's initalize hook.
StringProperty m_streamName
StatusCode doMuons(const EventContext &ctx) const
Gaudi::Property< double > m_minptPhotons
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
Should the thinning run?
virtual StatusCode execute(const EventContext &ctx) const override final
Athena algorithm's execute hook.
Gaudi::Property< double > m_minptElectrons
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsKey
Gaudi::Property< bool > m_doElectrons
Gaudi::Property< bool > m_doPhotons
SG::ThinningHandleKey< TrackCollection > m_CombinedMuonsTracksKey
Containers to thin.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.