|
ATLAS Offline Software
|
Go to the documentation of this file.
19 declareInterface<IMuonCombinedInDetExtensionTool>(
this);
20 declareInterface<MuonInsideOutRecoTool>(
this);
37 return StatusCode::SUCCESS;
42 const EventContext& ctx)
const {
43 ATH_MSG_WARNING(
"This version is deprecated, please use extendWithPRDs for MuGirl");
45 extendWithPRDs(inDetCandidates, tagMap, prdData, combTracks, meTracks, segments, ctx);
59 ATH_MSG_DEBUG(
" skip silicon associated track for extension ");
68 if (!muonSystemExtension) {
76 std::vector<Muon::MuonLayerRecoData> allLayers;
78 const std::vector<Muon::MuonSystemExtension::Intersection>& layerIntersections = muonSystemExtension->
layerIntersections();
79 ATH_MSG_DEBUG(
" ID track: pt " << indetTrackParticle.
pt() <<
" eta " << indetTrackParticle.
eta() <<
" phi "
80 << indetTrackParticle.
phi() <<
" layers " << layerIntersections.size());
84 std::vector<std::shared_ptr<const Muon::MuonSegment>> segments;
88 if (!
getLayerData(layer_intersect.layerSurface, layerPrepRawData, prdData)) {
92 m_segmentFinder->find(ctx, layer_intersect, layerPrepRawData, segments);
93 if (segments.empty())
continue;
97 for (
const std::shared_ptr<const Muon::MuonSegment>& seg : segments)
m_recoValidationTool->add(layer_intersect, *seg, 0);
101 std::vector<std::shared_ptr<const Muon::MuonSegment>> selectedSegments;
103 if (selectedSegments.empty())
continue;
111 allLayers.emplace_back(layer_intersect, std::move(selectedSegments));
115 msg(
MSG::DEBUG) <<
" Layers with segments " << allLayers.size();
116 for (
auto&
layer : allLayers) {
123 std::pair<std::unique_ptr<const Muon::MuonCandidate>, std::unique_ptr<Trk::Track>> bestCandidate =
125 if (!bestCandidate.first) {
return; }
128 addTag(ctx, indetCandidate, tagMap, *bestCandidate.first, bestCandidate.second, combTracks, meTracks, segColl);
133 const std::vector<Muon::MuonLayerRecoData>& allLayers)
const {
135 std::vector<Muon::MuonCandidate> resolvedCandidates;
140 typedef std::pair<std::unique_ptr<Trk::Track>, std::unique_ptr<const Muon::MuonCandidate>> candidatePair;
141 std::vector<candidatePair> trackCandidateLookup;
145 if (!
track || !
track->isValid() || !
track->fitQuality()->numberDoF())
continue;
148 trackCandidateLookup.emplace_back(std::move(
track), std::make_unique<Muon::MuonCandidate>(std::move(candidate)));
154 if (tracks.
empty())
return {
nullptr,
nullptr};
157 if (tracks.
size() == 1) {
158 selectedTrack = tracks.
front();
162 if (!resolvedTracks || resolvedTracks->
empty()) {
163 ATH_MSG_WARNING(
"Ambiguity resolver returned no tracks. Arbitrarily using the first track of initial collection.");
164 selectedTrack = tracks.
front();
167 if (
it != tracks.
end()) {
170 ATH_MSG_ERROR(
"Ambiguity resolver returned an unknown track. Arbitrarily using the first track of initial collection.");
171 selectedTrack = tracks.
front();
177 std::find_if(trackCandidateLookup.begin(), trackCandidateLookup.end(),
178 [selectedTrack](candidatePair& ele) { return ele.first.get() == selectedTrack; });
180 if (look_itr == trackCandidateLookup.end() || !look_itr->second) {
182 return {
nullptr,
nullptr};
187 return std::make_pair(std::move(look_itr->second), std::move(look_itr->first));
199 if (!vertices.isValid()) {
202 for (
const auto*
const vx : *vertices) {
203 for (
const auto& tpLink : vx->trackParticleLinks()) {
204 if (*tpLink == &idTrackParticle) {
208 if (matchedVertex)
break;
214 origin =
Amg::Vector3D{matchedVertex->
x(), matchedVertex->
y(), matchedVertex->
z()};
218 idTrackParticle.
d0() *
std::cos(idTrackParticle.
phi()) + idTrackParticle.
vy(),
219 idTrackParticle.
z0() + idTrackParticle.
vz()};
220 ATH_MSG_DEBUG(
" NO matched vertex take track perigee " << origin);
228 if (
it->trackParameters()) {
229 ATH_MSG_VERBOSE(
"check tsos " << tsos <<
" r " <<
it->trackParameters()->position().perp() <<
" z "
230 <<
it->trackParameters()->position().z() <<
" p "
231 <<
it->trackParameters()->momentum().mag());
236 std::vector<const Muon::MuonSegment*> segLinks;
238 std::unique_ptr<Muon::MuonSegment>
copy = std::make_unique<Muon::MuonSegment>(*
layer.segment);
239 segLinks.push_back(
copy.get());
245 using chamIdx = Muon::MuonStationIndex::ChIndex;
246 chamIdx ch_a = m_idHelperSvc->chamberIndex(m_edmHelperSvc->chamberId(*seg_a));
247 chamIdx ch_b = m_idHelperSvc->chamberIndex(m_edmHelperSvc->chamberId(*seg_b));
248 Muon::MuonStationIndex::StIndex st_a = Muon::MuonStationIndex::toStationIndex(ch_a);
249 Muon::MuonStationIndex::StIndex st_b = Muon::MuonStationIndex::toStationIndex(ch_b);
250 if (st_a != st_b) return st_a < st_b;
252 if (ch_a == chamIdx::CSL || ch_a == chamIdx::CSS || ch_b == chamIdx::CSS || ch_b == chamIdx::CSL)
253 return (ch_a == chamIdx::CSL) + 2 * (ch_a == chamIdx::CSS) > (ch_b == chamIdx::CSL) + 2 * (ch_b == chamIdx::CSS);
258 std::stringstream sstr;
264 ATH_MSG_DEBUG(
"Selected segments " << segLinks.size() <<
" " << sstr.str());
268 std::unique_ptr<Trk::Track> standaloneRefit{
m_trackFitter->standaloneRefit(ctx, *selectedTrack, origin)};
270 combTracks->
push_back(std::move(selectedTrack));
275 if (standaloneRefit) {
276 meTracks->
push_back(std::move(standaloneRefit));
278 tag->setUpdatedExtrapolatedTrack(melink);
289 std::vector<Muon::MuonStationIndex::TechnologyIndex> technologiesInStation =
292 std::string techString;
304 isok |= getLayerDataTech<Muon::MdtPrepData>(
it, surf, prdData.
mdtPrds, layerPrepRawData.
mdts);
307 isok |= getLayerDataTech<Muon::RpcPrepData>(
it, surf, prdData.
rpcPrds, layerPrepRawData.
rpcs);
310 isok |= getLayerDataTech<Muon::TgcPrepData>(
it, surf, prdData.
tgcPrds, layerPrepRawData.
tgcs);
313 isok |= getLayerDataTech<Muon::CscPrepData>(
it, surf, prdData.
cscPrds, layerPrepRawData.
cscs);
316 isok |= getLayerDataTech<Muon::sTgcPrepData>(
it, surf, prdData.
stgcPrds, layerPrepRawData.
stgcs);
319 isok |= getLayerDataTech<Muon::MMPrepData>(
it, surf, prdData.
mmPrds, layerPrepRawData.
mms);
330 if (!layerPrepRawData.
mms.empty())
msg(
MSG::DEBUG) <<
" MMs " << layerPrepRawData.
mms.size();
340 if (!
input ||
input->size() == 0)
return false;
348 if (
hashes.empty())
return false;
351 for (Muon::MuonLayerHashProviderTool::HashVec::const_iterator
it =
hashes.begin();
it !=
hashes.end(); ++
it) {
353 const auto* colIt =
input->indexFindPtr(*
it);
354 if (!colIt) {
continue; }
JetConstituentVector::iterator iterator
static const std::string & chName(ChIndex index)
convert ChIndex into a string
virtual double pt() const override final
The transverse momentum ( ) of the particle.
float x() const
Returns the x position.
static StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
const Muon::MuonSystemExtension * getExtension() const
std::string find(const std::string &s)
return a remapped string
float vx() const
The x origin for the parameters.
MuonStationIndex::LayerIndex layerIndex
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float vz() const
The z origin for the parameters.
static unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer
float z0() const
Returns the parameter.
bool msgLvl(const MSG::Level lvl) const
std::vector< const TgcPrepDataCollection * > tgcs
Struct to hold all PrepRawData collections in a given layer.
#define ATH_MSG_VERBOSE(x)
MuonStationIndex::DetectorRegionIndex regionIndex
float d0() const
Returns the parameter.
std::vector< const sTgcPrepDataCollection * > stgcs
void addEntry(const InDetCandidate *idcand, TagBase *tag)
static const std::string & regionName(DetectorRegionIndex index)
convert DetectorRegionIndex into a string
const Muon::CscPrepDataContainer * cscPrds
(Non-const) Iterator class for DataVector/DataList.
std::vector< const MdtPrepDataCollection * > mdts
::StatusCode StatusCode
StatusCode definition for legacy code.
Tracking class to hold the extrapolation from a particle from the calo entry to the end of muon syste...
const T * front() const
Access the first element in the collection as an rvalue.
static std::vector< MuonStationIndex::TechnologyIndex > technologiesInStation(MuonStationIndex::StIndex stIndex)
get techonolgies in
static const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
float z() const
Returns the z position.
Template to hold collections of MuonPrepRawData objects.
float vy() const
The y origin for the parameters.
represents the track state (measurement, material, fit parameters and quality) at a surface.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Eigen::Matrix< double, 3, 1 > Vector3D
std::vector< const CscPrepDataCollection * > cscs
TagBase implementation for a combined fit.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const xAOD::TrackParticle & indetTrackParticle() const
access TrackParticle
Class describing a Vertex.
bool isSiliconAssociated() const
Returns true if this candidate was formed from a special far forward InDet track.
#define ATH_MSG_WARNING(x)
The MuonTagToSegMap is an auxillary construct that links the MuonSegments associated with a combined ...
std::vector< const RpcPrepDataCollection * > rpcs
float y() const
Returns the y position.
const std::vector< Intersection > & layerIntersections() const
access to the intersections with the layers.
std::vector< const MMPrepDataCollection * > mms
StIndex
enum to classify the different station layers in the muon spectrometer
const Muon::RpcPrepDataContainer * rpcPrds
Class describing a TrackParticle.
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
const Muon::TgcPrepDataContainer * tgcPrds
const Muon::MMPrepDataContainer * mmPrds
TechnologyIndex
enum to classify the different layers in the muon spectrometer
size_type size() const noexcept
Returns the number of elements in the collection.
const Muon::sTgcPrepDataContainer * stgcPrds
std::vector< MuonLayerIntersection > layerIntersections
MuonLayerIntersections.
bool empty() const noexcept
Returns true if the collection is empty.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
const Muon::MdtPrepDataContainer * mdtPrds
static const std::string & technologyName(TechnologyIndex index)
convert LayerIndex into a string