20 return StatusCode::SUCCESS;
30 return StatusCode::FAILURE;
36 return StatusCode::FAILURE;
39 auto outputMuons = std::make_unique<xAOD::MuonContainer>();
40 auto outputMuonsAux = std::make_unique<xAOD::MuonAuxContainer>();
42 outputMuons->setStore (outputMuonsAux.get());
44 std::vector<const xAOD::Muon*> matchedMuons;
49 if (nPixHits > 0)
continue;
56 if (m->muonType() != xAOD::Muon::MuonType::MuonStandAlone)
continue;
57 if (std::find(matchedMuons.begin(), matchedMuons.end(), m) != matchedMuons.end())
continue;
69 matchedMuons.push_back(muMatch);
71 xAOD::Muon *zeroPixelHitMuon = outputMuons->push_back(std::make_unique<xAOD::Muon>(muon_match));
72 zeroPixelHitMuon->
setP4(muon_match.
pt(), t->eta(), t->phi());
74 zeroPixelHitMuon->
setMuonType(xAOD::Muon::MuonType::ZeroPixelHit);
76 zeroPixelHitMuon->
setTrackParticleLink(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle, link);
83 CHECK( outputMuonsHandle.
record (std::move(outputMuons), std::move (outputMuonsAux)) );
87 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
An algorithm that can be simultaneously executed in multiple threads.
ElementLink implementation for ROOT usage.
RecoverZeroPixelHitMuons(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inputTrackContainerKey
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &context) const override
Gaudi::Property< float > m_matchingDeltaR
SG::WriteHandleKey< xAOD::MuonContainer > m_outputMuonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_inputMuonContainerKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
void setTrackParticleLink(TrackParticleType type, const ElementLink< TrackParticleContainer > &link)
Set method for TrackParticle links.
virtual double pt() const override
The transverse momentum ( ) of the particle.
void setMuonType(MuonType type)
void setP4(double pt, double eta, double phi)
Set method for IParticle values.
void setCharge(float charge)
Set the charge (must be the same as primaryTrackParticle() ).
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version:
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].