|
ATLAS Offline Software
|
Go to the documentation of this file.
18 declareInterface<IMuonCombinedInDetExtensionTool>(
this);
19 declareInterface<MuonInsideOutRecoTool>(
this);
36 return StatusCode::SUCCESS;
41 const EventContext& ctx)
const {
42 ATH_MSG_WARNING(
"This version is deprecated, please use extendWithPRDs for MuGirl");
44 extendWithPRDs(inDetCandidates, tagMap, prdData, combTracks, meTracks, segments, ctx);
58 ATH_MSG_DEBUG(
" skip silicon associated track for extension ");
67 if (!muonSystemExtension) {
75 std::vector<Muon::MuonLayerRecoData> allLayers;
77 const std::vector<Muon::MuonSystemExtension::Intersection>& layerIntersections = muonSystemExtension->
layerIntersections();
78 ATH_MSG_DEBUG(
" ID track: pt " << indetTrackParticle.
pt() <<
" eta " << indetTrackParticle.
eta() <<
" phi "
79 << indetTrackParticle.
phi() <<
" layers " << layerIntersections.size());
83 std::vector<std::shared_ptr<const Muon::MuonSegment>> segments;
87 if (!
getLayerData(layer_intersect.layerSurface, layerPrepRawData, prdData)) {
91 m_segmentFinder->find(ctx, layer_intersect, layerPrepRawData, segments);
92 if (segments.empty())
continue;
96 for (
const std::shared_ptr<const Muon::MuonSegment>& seg : segments)
m_recoValidationTool->add(layer_intersect, *seg, 0);
100 std::vector<std::shared_ptr<const Muon::MuonSegment>> selectedSegments;
102 if (selectedSegments.empty())
continue;
110 allLayers.emplace_back(layer_intersect, std::move(selectedSegments));
114 msg(
MSG::DEBUG) <<
" Layers with segments " << allLayers.size();
115 for (
auto&
layer : allLayers) {
122 std::pair<std::unique_ptr<const Muon::MuonCandidate>, std::unique_ptr<Trk::Track>> bestCandidate =
124 if (!bestCandidate.first) {
return; }
127 addTag(ctx, indetCandidate, tagMap, *bestCandidate.first, bestCandidate.second, combTracks, meTracks, segColl);
132 const std::vector<Muon::MuonLayerRecoData>& allLayers)
const {
134 std::vector<Muon::MuonCandidate> resolvedCandidates;
139 typedef std::pair<std::unique_ptr<Trk::Track>, std::unique_ptr<const Muon::MuonCandidate>> candidatePair;
140 std::vector<candidatePair> trackCandidateLookup;
144 if (!
track || !
track->isValid() || !
track->fitQuality()->numberDoF())
continue;
147 trackCandidateLookup.emplace_back(std::move(
track), std::make_unique<Muon::MuonCandidate>(std::move(candidate)));
153 if (tracks.
empty())
return {
nullptr,
nullptr};
156 if (tracks.
size() == 1) {
157 selectedTrack = tracks.
front();
161 if (!resolvedTracks || resolvedTracks->
empty()) {
162 ATH_MSG_WARNING(
"Ambiguity resolver returned no tracks. Arbitrarily using the first track of initial collection.");
163 selectedTrack = tracks.
front();
166 if (
it != tracks.
end()) {
169 ATH_MSG_ERROR(
"Ambiguity resolver returned an unknown track. Arbitrarily using the first track of initial collection.");
170 selectedTrack = tracks.
front();
176 std::find_if(trackCandidateLookup.begin(), trackCandidateLookup.end(),
177 [selectedTrack](candidatePair& ele) { return ele.first.get() == selectedTrack; });
179 if (look_itr == trackCandidateLookup.end() || !look_itr->second) {
181 return {
nullptr,
nullptr};
186 return std::make_pair(std::move(look_itr->second), std::move(look_itr->first));
198 if (!vertices.isValid()) {
201 for (
const auto*
const vx : *vertices) {
202 for (
const auto& tpLink : vx->trackParticleLinks()) {
203 if (*tpLink == &idTrackParticle) {
207 if (matchedVertex)
break;
213 origin =
Amg::Vector3D{matchedVertex->
x(), matchedVertex->
y(), matchedVertex->
z()};
217 idTrackParticle.
d0() *
std::cos(idTrackParticle.
phi()) + idTrackParticle.
vy(),
218 idTrackParticle.
z0() + idTrackParticle.
vz()};
219 ATH_MSG_DEBUG(
" NO matched vertex take track perigee " << origin);
227 if (
it->trackParameters()) {
228 ATH_MSG_VERBOSE(
"check tsos " << tsos <<
" r " <<
it->trackParameters()->position().perp() <<
" z "
229 <<
it->trackParameters()->position().z() <<
" p "
230 <<
it->trackParameters()->momentum().mag());
235 std::vector<const Muon::MuonSegment*> segLinks;
237 std::unique_ptr<Muon::MuonSegment>
copy = std::make_unique<Muon::MuonSegment>(*
layer.segment);
238 segLinks.push_back(
copy.get());
244 using chamIdx = Muon::MuonStationIndex::ChIndex;
245 chamIdx ch_a = m_idHelperSvc->chamberIndex(m_edmHelperSvc->chamberId(*seg_a));
246 chamIdx ch_b = m_idHelperSvc->chamberIndex(m_edmHelperSvc->chamberId(*seg_b));
247 Muon::MuonStationIndex::StIndex st_a = Muon::MuonStationIndex::toStationIndex(ch_a);
248 Muon::MuonStationIndex::StIndex st_b = Muon::MuonStationIndex::toStationIndex(ch_b);
249 if (st_a != st_b) return st_a < st_b;
251 if (ch_a == chamIdx::CSL || ch_a == chamIdx::CSS || ch_b == chamIdx::CSS || ch_b == chamIdx::CSL)
252 return (ch_a == chamIdx::CSL) + 2 * (ch_a == chamIdx::CSS) > (ch_b == chamIdx::CSL) + 2 * (ch_b == chamIdx::CSS);
257 std::stringstream sstr;
263 ATH_MSG_DEBUG(
"Selected segments " << segLinks.size() <<
" " << sstr.str());
267 std::unique_ptr<Trk::Track> standaloneRefit{
m_trackFitter->standaloneRefit(ctx, *selectedTrack, origin)};
269 combTracks->
push_back(std::move(selectedTrack));
274 if (standaloneRefit) {
275 meTracks->
push_back(std::move(standaloneRefit));
277 tag->setUpdatedExtrapolatedTrack(melink);
288 const std::set<Muon::MuonStationIndex::TechnologyIndex>& technologiesInStation =
m_idHelperSvc->technologiesInStation(stIndex);
290 std::string techString;
302 isok |= getLayerDataTech<Muon::MdtPrepData>(
it, surf, prdData.
mdtPrds, layerPrepRawData.
mdts);
305 isok |= getLayerDataTech<Muon::RpcPrepData>(
it, surf, prdData.
rpcPrds, layerPrepRawData.
rpcs);
308 isok |= getLayerDataTech<Muon::TgcPrepData>(
it, surf, prdData.
tgcPrds, layerPrepRawData.
tgcs);
311 isok |= getLayerDataTech<Muon::CscPrepData>(
it, surf, prdData.
cscPrds, layerPrepRawData.
cscs);
314 isok |= getLayerDataTech<Muon::sTgcPrepData>(
it, surf, prdData.
stgcPrds, layerPrepRawData.
stgcs);
317 isok |= getLayerDataTech<Muon::MMPrepData>(
it, surf, prdData.
mmPrds, layerPrepRawData.
mms);
328 if (!layerPrepRawData.
mms.empty())
msg(
MSG::DEBUG) <<
" MMs " << layerPrepRawData.
mms.size();
338 if (!
input ||
input->size() == 0)
return false;
346 if (
hashes.empty())
return false;
349 for (Muon::MuonLayerHashProviderTool::HashVec::const_iterator
it =
hashes.begin();
it !=
hashes.end(); ++
it) {
351 const auto* colIt =
input->indexFindPtr(*
it);
352 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 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