17#include "GaudiKernel/ConcurrencyFlags.h"
25 declareInterface<IMuonCombinedTool>(
this);
31 debugger_tool->
fillBranches(muonCandidates, inDetCandidates);
43 return StatusCode::SUCCESS;
48 const EventContext& ctx)
const {
50 if (inDetCandidates.
empty())
return;
51 if (muonCandidates.
empty())
return;
53 ATH_MSG_ERROR(
"Number of tag maps does not match number of tag tools");
62 muonCandidate->extrapolatedTrack() ? *muonCandidate->extrapolatedTrack() : muonCandidate->muonSpectrometerTrack();
65 std::vector<const InDetCandidate*> associatedIdCandidates;
66 associate(*muonCandidate, inDetCandidates, associatedIdCandidates);
67 if (associatedIdCandidates.empty())
continue;
68 ATH_MSG_DEBUG(
"Associated ID candidates " << associatedIdCandidates.size());
73 tool->combine(*muonCandidate, associatedIdCandidates, *(tagMaps.at(
count)), combinedTracks, METracks, ctx);
80 std::vector<const InDetCandidate*>& associatedIdCandidates)
const {
81 associatedIdCandidates.clear();
84 associatedIdCandidates.push_back(indetCand);
92 if (!ms_trk && !msoe_trk) {
110 if (id_trk && !id_extension)
m_alignUncertTool->get_track_state_measures(id_trk, id_exit, dummy, dummy, dummy);
111 if (ms_trk)
m_alignUncertTool->get_track_state_measures(ms_trk, dummy, dummy, dummy, ms_entrance);
112 if (msoe_trk)
m_alignUncertTool->get_track_state_measures(msoe_trk, dummy, dummy, dummy, msoe_entrance);
114 if (!msoe_entrance) msoe_entrance = ms_entrance;
115 if (!ms_entrance) ms_entrance = msoe_entrance;
119 if ((!id_exit && !id_extension) || !ms_entrance) {
122 if (!id_trk)
ATH_MSG_WARNING(
"Trk::Track not found for InDetTrack candidate!");
129 const double deltaEta = std::abs(muon_p3.eta() - idtr_p3.eta());
132 const double muonPt = muon_p3.perp();
133 const double indetPt = idtr_p3.perp();
134 const double ptBal = muonPt > 0. ? std::abs(muonPt - indetPt) / muonPt : 1.;
139 const Amg::Vector3D ms_en_pos = ms_entrance->trackParameters()->position();
140 const Amg::Vector3D msoe_en_pos = msoe_entrance->trackParameters()->position();
143 const double deltaEta = std::abs(id_ex_pos.eta() - ms_en_pos.eta());
146 const double deltaEtaMSOE = std::abs(id_ex_pos.eta() - msoe_en_pos.eta());
157 const double muonPt = muonPars->
momentum().perp();
159 const double ptBal = muonPt > 0. ? std::abs(muonPt - indetPt) / muonPt : 1.;
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
DataVector< MuonCombined::InDetCandidate > InDetCandidateCollection
This typedef represents a collection of InDetCandidate objects.
DataVector< MuonCombined::MuonCandidate > MuonCandidateCollection
This typedef represents a collection of MuonCandidate objects.
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
#define ATLAS_THREAD_SAFE
bool empty() const noexcept
Returns true if the collection is empty.
const Trk::CaloExtension * getCaloExtension() const
const xAOD::TrackParticle & indetTrackParticle() const
access TrackParticle
const Trk::Track & muonSpectrometerTrack() const
access spectrometer track, always there
const Trk::Track * extrapolatedTrack() const
access extrapolated track, can be zero if back extrapolation failed
Tracking class to hold the extrapolation through calorimeter Layers Both the caloEntryLayerIntersecti...
const TrackParameters * muonEntryLayerIntersection() const
access to intersection with the muon entry layer return nullptr if the intersection failed
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
represents the track state (measurement, material, fit parameters and quality) at a surface.
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Eigen::Matrix< double, 3, 1 > Vector3D
The MuonTagToSegMap is an auxillary construct that links the MuonSegments associated with a combined ...
ParametersBase< TrackParametersDim, Charged > TrackParameters
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[