Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
19 return StatusCode::SUCCESS;
27 if( ! inputMuons.isValid() ) {
29 return StatusCode::FAILURE;
35 return StatusCode::FAILURE;
38 auto outputMuons = std::make_unique<xAOD::MuonContainer>();
39 auto outputMuonsAux = std::make_unique<xAOD::MuonAuxContainer>();
41 outputMuons->setStore (outputMuonsAux.get());
46 double track_charge=0.0;
48 std::vector<const xAOD::Muon*> matchedMuons;
55 if (nPixHits > 0)
continue;
58 TVector3 track_vector;
59 track_vector.SetPtEtaPhi(
t->pt(),
t->eta(),
t->phi());
62 track_charge=
t->charge();
66 float min_mu_charge=0.0;
69 for (muItr = inputMuons->begin(); muItr != inputMuons->end(); ++muItr){
71 if (
m.muonType() != xAOD::Muon::MuonStandAlone)
continue;
72 if (
std::find(matchedMuons.begin(), matchedMuons.end(), *muItr) != matchedMuons.end())
continue;
76 mu_vector.SetPtEtaPhi(
m.pt(),
m.eta(),
m.phi());
78 float mu_dR=mu_vector.DeltaR(track_vector);
83 min_mu_charge=mu_charge;
88 matchedMuons.push_back(*muMatchItr);
91 outputMuons->push_back(zeroPixelHitMuon);
92 zeroPixelHitMuon->
setP4(muon_match.
pt(),track_eta,track_phi);
93 zeroPixelHitMuon->
setCharge(min_mu_charge);
95 zeroPixelHitMuon->
setMuonType((xAOD::Muon::MuonType)10);
104 CHECK( outputMuonsHandle.record (std::move(outputMuons), std::move (outputMuonsAux)) );
108 return StatusCode::SUCCESS;
RecoverZeroPixelHitMuons(const std::string &name, ISvcLocator *pSvcLocator)
Const iterator class for DataVector/DataList.
std::string find(const std::string &s)
return a remapped string
void setTrackParticleLink(TrackParticleType type, const ElementLink< TrackParticleContainer > &link)
Set method for TrackParticle links.
void setP4(double pt, double eta, double phi)
Set method for IParticle values.
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::WriteHandleKey< xAOD::MuonContainer > m_outputMuonContainerKey
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKey< xAOD::MuonContainer > m_inputMuonContainerKey
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode execute(const EventContext &context) const override
virtual double pt() const
The transverse momentum ( ) of the particle.
void setCharge(float charge)
Set the charge (must be the same as primaryTrackParticle() )
#define CHECK(...)
Evaluate an expression and check for errors.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inputTrackContainerKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Muon_v1 Muon
Reference the current persistent version:
virtual StatusCode initialize() override
Class describing a TrackParticle.
void setMuonType(MuonType type)
Gaudi::Property< float > m_matchingDeltaR