31 declareInterface<IMuonSegmentTrackBuilder>(
this);
32 declareInterface<MooTrackBuilder>(
this);
33 declareInterface<IMuonTrackRefiner>(
this);
34 declareInterface<IMuonTrackBuilder>(
this);
57 return StatusCode::SUCCESS;
65 return StatusCode::SUCCESS;
95 <<
m_printer->print(track.track()) << std::endl
96 <<
m_printer->print(track.track().measurementsOnTrack()->stdcont()));
99 if (!finalTrack) {
ATH_MSG_WARNING(
" final track lost, this should not happen "); }
101 <<
m_printer->print(*finalTrack) << std::endl
102 <<
m_printer->print(finalTrack->measurementsOnTrack()->stdcont()));
108 bool recreateCompetingROTs =
true;
109 std::unique_ptr<Trk::Track> recalibratedTrack =
recalibrateHitsOnTrack(ctx, *finalTrack, recalibrateMDTHits, recreateCompetingROTs);
110 if (!recalibratedTrack) {
113 finalTrack.swap(recalibratedTrack);
115 std::unique_ptr<Trk::Track> refittedTrack =
refit(ctx, *finalTrack);
116 if (!refittedTrack) {
118 <<
m_printer->print(*finalTrack) << std::endl
119 <<
m_printer->printStations(*finalTrack));
121 finalTrack.swap(refittedTrack);
125 if (!finalTrackWithHoles) {
126 ATH_MSG_WARNING(
" failed to add holes to final track, this should not happen ");
128 finalTrack.swap(finalTrackWithHoles);
131 if (entryRecordTrack) {
132 finalTrack.swap(entryRecordTrack);
140 std::unique_ptr<Trk::Track> track =
combine(ctx, seg1, seg2, externalPhiHits);
142 if (!track)
return nullptr;
152 const PrepVec& externalPhiHits)
const {
156 if (!segInfo1) {
return nullptr; }
158 if (!segInfo2) {
return nullptr; }
161 return combine(ctx, *segInfo1, *segInfo2, externalPhiHits);
165 const PrepVec& externalPhiHits)
const {
167 std::unique_ptr<Trk::Track> track =
combine(ctx, firstCandidate, secondCandidate, externalPhiHits);
169 if (!track)
return nullptr;
188 std::set<MuonStationIndex::StIndex> stations = firstCandidate.
stations();
189 stations.insert(secondCandidate.
stations().begin(), secondCandidate.
stations().end());
190 unsigned int nstations = stations.size();
203 bool slFit = !fieldCache.
toroidOn() || nstations == 1 ||
204 (nstations == 2 && (stations.count(StIndex::EM) &&
205 (stations.count(StIndex::BO) || stations.count(StIndex::EO))));
207 msg(MSG::DEBUG) << MSG::DEBUG <<
" combining entries: nstations " << nstations <<
" types:";
208 for (std::set<StIndex>::const_iterator it = stations.begin(); it != stations.end(); ++it) {
209 msg(MSG::DEBUG) << MSG::DEBUG <<
" " <<
stName(*it);
212 msg(MSG::DEBUG) <<
" doing SL fit ";
214 msg(MSG::DEBUG) <<
" doing curved fit ";
227 if (trkCan1 && segCan2) {
230 }
else if (trkCan2 && segCan1) {
236 if (candidate && segment) {
239 if (std::find(excl.begin(),excl.end(), segment) != excl.end()){
248 std::set<const MuPatSegment*> segments;
249 if ((segCan1 && segCan2)) {
250 segments.insert(segCan1);
251 segments.insert(segCan2);
253 if (candidate && segment) {
254 segments.insert(segment);
255 segments.insert(candidate->
segments().begin(), candidate->
segments().end());
263 std::set<const MuPatSegment*> foundSegments;
264 for (
const MuPatSegment* segOnTrack : assoc_track->segments()) {
265 if (segments.count(segOnTrack)) foundSegments.insert(segOnTrack);
268 if (foundSegments.size() == segments.size()) {
269 ATH_MSG_DEBUG(
"Combination already part of an existing track");
274 if (candidate && !candidate->
excludedSegments().empty() && foundSegments.size() == segments.size() - 1) {
276 std::vector<const MuPatSegment*> unassociatedSegments(segments.size(),
nullptr);
277 std::vector<const MuPatSegment*>::iterator it = std::set_difference(
278 segments.begin(), segments.end(), foundSegments.begin(), foundSegments.end(), unassociatedSegments.begin());
280 unassociatedSegments.erase(std::find(unassociatedSegments.begin(), unassociatedSegments.end(),
zero),
281 unassociatedSegments.end());
284 if (it != unassociatedSegments.begin()) {
286 if (unassociatedSegments.size() != 1) {
287 ATH_MSG_DEBUG(
"Inconsistent result from set difference: size result "
288 << unassociatedSegments.size() <<
" candidate " << segments.size() <<
" found "
289 << foundSegments.size());
294 if (!segments.count(unassociatedSegments.front())) {
295 ATH_MSG_DEBUG(
"Segment point not part of the original set, aborting!");
300 std::vector<MuPatSegment*>::const_iterator pos = std::find(
303 ATH_MSG_DEBUG(
"Segment found in exclusion list, not performing fit");
313 if (slFit)
return std::unique_ptr<Trk::Track>(
m_slFitter->fit(ctx, firstCandidate, secondCandidate, externalPhiHits));
315 return m_fitter->fit(ctx, firstCandidate, secondCandidate, externalPhiHits);
319 const PrepVec& externalPhiHits)
const {
322 std::unique_ptr<Trk::Track> inTrack = std::make_unique<Trk::Track>(track);
324 if (!candidate)
return nullptr;
326 if (!segInfo) {
return nullptr; }
329 return combine(ctx, *candidate, *segInfo, externalPhiHits);
333 const PrepVec& externalPhiHits)
const {
336 std::unique_ptr<Trk::Track> inTrack = std::make_unique<Trk::Track>(track);
338 if (!candidate)
return {};
340 if (!segInfo)
return {};
350 double posSeg = isEndcap ? pos.z() : pos.perp();
353 double closest = 1e8;
355 bool closestIsMeasured =
false;
367 for (; tsit != tsit_end; ++tsit) {
370 if (!meas) {
continue; }
373 if (!pars) {
continue; }
376 bool isMeasured = pars->covariance();
379 if (closestIsMeasured && !isMeasured)
continue;
382 double posPars = isEndcap ? pars->position().z() : pars->position().perp();
383 double diffPos = std::abs(posPars - posSeg);
386 if ((isMeasured && !closestIsMeasured) || diffPos < closest) {
388 closestParameters = pars;
389 closestIsMeasured = isMeasured;
392 if (closest < 100.) {
break; }
397 if (closestParameters)
return closestParameters->
uniqueClone();
417 const std::set<Identifier>& chIds,
418 const PrepVec& patternPhiHits)
const {
420 std::unique_ptr<Trk::Track> inTrack = std::make_unique<Trk::Track>(track);
422 if (!can) {
return {}; }
428 const PrepVec& externalPhiHits)
const {
436 std::vector<std::unique_ptr<Trk::Track> > newTracks;
441 if (chIds.empty())
return newTracks;
446 std::unique_ptr<Trk::Track> newtrack(
m_fitter->fit(ctx, candidate, segInfo, externalPhiHits));
447 if (newtrack) newTracks.push_back(std::move(newtrack));
469 std::unique_ptr<Trk::TrackParameters> exPars(
483 std::vector<const MuonSegment*>& referenceSegments)
const {
484 if (referenceSegments.empty())
return;
486 ATH_MSG_DEBUG(
" Removing duplicates from segment vector of size " << segments->size() <<
" reference size "
487 << referenceSegments.size());
492 std::vector<std::pair<MuonSegmentKey, Trk::SegmentCollection::iterator> > segKeys;
493 segKeys.reserve(segments->size());
498 for (; sit != sit_end; ++sit) {
505 std::vector<MuonSegmentKey> referenceSegKeys;
506 referenceSegKeys.reserve(referenceSegments.size());
509 std::vector<const MuonSegment*>::iterator vit = referenceSegments.begin();
510 std::vector<const MuonSegment*>::iterator vit_end = referenceSegments.end();
511 for (; vit != vit_end; ++vit) { referenceSegKeys.emplace_back(**vit); }
514 std::vector<std::pair<MuonSegmentKey, Trk::SegmentCollection::iterator> >
::iterator skit = segKeys.begin();
515 std::vector<std::pair<MuonSegmentKey, Trk::SegmentCollection::iterator> >
::iterator skit_end = segKeys.end();
516 for (; skit != skit_end; ++skit) {
517 bool isDuplicate =
false;
519 std::vector<MuonSegmentKey>::iterator rskit = referenceSegKeys.begin();
520 std::vector<MuonSegmentKey>::iterator rskit_end = referenceSegKeys.end();
522 for (; rskit != rskit_end; ++rskit) {
535 if (isDuplicate) segments->erase(skit->second);
541 const std::set<Identifier>& chIds,
542 const PrepVec& externalPhiHits)
const {
543 std::vector<std::unique_ptr<Trk::Track> > newTracks;
545 if (chIds.empty())
return newTracks;
548 ATH_MSG_WARNING(
"combineWithSegmentFinding called with CSC hits!! retuning zero pointer");
560 if (segments->empty()) {
565 unsigned int nseg = segments->size();
567 std::vector<const MuonSegment*> referenceSegments;
568 for (std::vector<MuPatSegment*>::const_iterator esit = candidate.
excludedSegments().begin();
570 if ((*esit)->segment) referenceSegments.push_back((*esit)->segment);
575 if (
msgLvl(MSG::DEBUG) && segments->size() != nseg) {
576 msg(MSG::DEBUG) << MSG::DEBUG
577 <<
" Rejected segments based on exclusion list, number of removed segments: " << nseg - segments->size()
578 <<
" total " << segments->size() <<
endmsg;
581 if (!segments->empty()) {
588 msg(MSG::DEBUG) << MSG::DEBUG <<
" adding segment " <<
m_printer->print(*mseg);
589 if (
msgLvl(MSG::VERBOSE)) {
602 std::unique_ptr<Trk::Track> segTrack =
m_fitter->fit(ctx, candidate, *segInfo, externalPhiHits);
604 if (!segTrack)
continue;
607 newTracks.push_back(std::move(segTrack));
611 if (!newTracks.empty())
ATH_MSG_DEBUG(
" found new tracks for segment " << newTracks.size());
617 bool doCompetingClusters)
const {
625 msg(MSG::DEBUG) << MSG::DEBUG <<
" recalibrating hits on track " << std::endl <<
m_printer->print(track);
627 if (
msgLvl(MSG::VERBOSE)) {
628 if (track.measurementsOnTrack())
629 msg(MSG::DEBUG) << std::endl <<
m_printer->print(track.measurementsOnTrack()->stdcont()) <<
endmsg;
636 std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> newStates;
637 newStates.reserve(states->size() + 5);
642 for (; state_itr != end_itr; ++state_itr) {
649 newStates.emplace_back(tsit->
clone());
656 newStates.emplace_back(tsit->
clone());
664 newStates.emplace_back(tsit->
clone());
674 ATH_MSG_WARNING(
" Measurement with MDT identifier that is not a MdtDriftCircleOnTrack ");
683 *tsit, std::move(newMdt), pars->uniqueClone(),
686 newStates.push_back(std::move(tsos));
689 newStates.emplace_back(tsit->
clone());
693 newStates.emplace_back(tsit->
clone());
696 if (doCompetingClusters) {
699 newStates.emplace_back(tsit->
clone());
703 newStates.emplace_back(tsit->
clone());
709 ATH_MSG_DEBUG(
" original track had " << states->size() <<
" TSOS, adding " << newStates.size() - states->size() <<
" new TSOS ");
712 auto trackStateOnSurfaces = std::make_unique<Trk::TrackStates>();
713 trackStateOnSurfaces->reserve(newStates.size());
714 for (std::unique_ptr<const Trk::TrackStateOnSurface>& new_state : newStates) {
716 trackStateOnSurfaces->push_back(std::move(new_state));
718 return std::make_unique<Trk::Track>(track.info(), std::move(trackStateOnSurfaces),
719 track.fitQuality() ? track.fitQuality()->uniqueClone() :
nullptr);
725 std::vector<std::unique_ptr<const Trk::TrackStateOnSurface> >& states)
const {
727 if (tsit == tsit_end) {
728 ATH_MSG_WARNING(
" iterator pointing to end of vector, this should no happen ");
735 if (!meas || !pars) {
736 ATH_MSG_WARNING(
" iterator pointing to a TSOS without a measurement or TrackParameters ");
737 if (tsit + 1 == tsit_end) --tsit;
745 std::list<const Trk::PrepRawData*> etaPrds;
746 std::list<const Trk::PrepRawData*> phiPrds;
748 std::vector<std::unique_ptr<const Trk::TrackStateOnSurface> > newStates;
750 std::vector<std::pair<bool, const Trk::TrackStateOnSurface*> > outlierStates;
751 bool hasPhi {
false}, hasEta{
false};
753 for (; tsit != tsit_end; ++tsit) {
755 if (!in_tsos)
continue;
760 newStates.emplace_back(in_tsos->
clone());
766 if (!
id.is_valid()) {
767 newStates.emplace_back(in_tsos->
clone());
775 if (!hasPhi && measuresPhi) hasPhi =
true;
776 if (!hasEta && !measuresPhi) hasEta =
true;
780 outlierStates.emplace_back(measuresPhi, in_tsos);
788 std::list<const Trk::PrepRawData*>& prdList = measuresPhi ? phiPrds : etaPrds;
792 if (!currentDetEl) currentDetEl = detEl;
793 if (detEl != currentDetEl) {
803 if (comp->containedROTs().empty()) {
807 detEl = comp->containedROTs().front()->detectorElement();
808 if (!currentDetEl) currentDetEl = detEl;
809 if (detEl != currentDetEl) {
813 std::ranges::transform(comp->containedROTs(), std::back_inserter(prdList),
814 [](
const auto& rot){ return rot->prepRawData();});
823 if (!etaPrds.empty()) {
824 std::unique_ptr<CompetingMuonClustersOnTrack> etaCompRot =
m_compRotCreator->createBroadCluster(etaPrds, 0.);
826 ATH_MSG_WARNING(
" Failed to create CompetingMuonClustersOnTrack for eta hits! ");
828 std::unique_ptr<Trk::TrackParameters> etaPars;;
830 if (etaCompRot->associatedSurface() == pars->associatedSurface()) {
831 etaPars = pars->uniqueClone();
836 etaCompRot->associatedSurface(),
840 ATH_MSG_WARNING(
" Failed to calculate TrackParameters for eta hits! ");
842 std::unique_ptr<Trk::TrackStateOnSurface> tsos =
844 newStates.push_back(std::move(tsos));
849 if (!phiPrds.empty()) {
850 std::unique_ptr<CompetingMuonClustersOnTrack> phiCompRot =
m_compRotCreator->createBroadCluster(phiPrds, 0.);
852 ATH_MSG_WARNING(
" Failed to create CompetingMuonClustersOnTrack for phi hits! ");
854 std::unique_ptr<Trk::TrackParameters> phiPars;
856 if (phiCompRot->associatedSurface() == pars->associatedSurface()) {
857 phiPars = pars->uniqueClone();
861 m_propagator->propagate(ctx, *pars, phiCompRot->associatedSurface(),
865 ATH_MSG_WARNING(
" Failed to calculate TrackParameters for phi hits! ");
867 std::unique_ptr<Trk::TrackStateOnSurface> tsos =
869 newStates.push_back(std::move(tsos));
875 for (
const auto& outlier : outlierStates) {
876 if (hasPhi && outlier.first)
877 newStates.emplace_back(outlier.second->clone());
878 else if (hasEta && !outlier.first)
879 newStates.emplace_back(outlier.second->clone());
880 else if (
msgLvl(MSG::DEBUG))
881 msg(MSG::DEBUG) <<
" Dropping outlier " <<
endmsg;
888 states.insert(states.end(), std::make_move_iterator(newStates.begin()),
889 std::make_move_iterator(newStates.end()));
913 return m_fitter->splitTrack(ctx, track);
917 const std::vector<MuPatSegment*>& segVec)
const {
918 std::vector<std::unique_ptr<MuPatTrack> > candidates;
920 if (segVec.empty())
return candidates;
922 std::set<MuPatSegment*> usedSegments;
923 std::map<MuPatSegment*, MuPatSegment*> slSegments;
926 bool tightQualityCuts =
false;
932 std::vector<std::pair<MuPatSegment*, std::unique_ptr<Trk::Track> > > extensions;
933 extensions.reserve(segVec.size());
937 if (usedSegments.count(seg))
continue;
946 ATH_MSG_VERBOSE(
" track/segment combination rejected based on angular matching " << std::endl
967 if (!sortTracks(*track, trkCan->
track())) {
968 ATH_MSG_VERBOSE(
" rejecting track as new segment results in worse fit");
974 std::set<MuonStationIndex::StIndex> stationLayersOnTrack;
977 if (!
id.is_valid() ||
m_idHelperSvc->isTrigger(
id)) {
continue; }
978 stationLayersOnTrack.insert(
m_idHelperSvc->stationIndex(
id));
981 bool hasAllLayers =
true;
983 if (!stationLayersOnTrack.count(stIdx)) {
985 hasAllLayers =
false;
990 ATH_MSG_VERBOSE(
" rejecting track as one of the chamber layers of the candidate was removed ");
995 if (!track) {
continue; }
997 usedSegments.insert(seg);
1001 if (!seg->hasSLOverlap()) {
1002 std::unique_ptr<MuPatTrack> newCandidate;
1006 if (seg->chIndex == seg_1->chIndex)
continue;
1008 if (!newCandidate) {
1009 std::unique_ptr<Trk::Track> trkTrkCan = std::make_unique<Trk::Track>(*track);
1012 newCandidate = std::make_unique<MuPatTrack>(*trkCan);
1014 }
else if (segCan) {
1017 if (!newCandidate)
break;
1020 ATH_MSG_VERBOSE(
"track/segment combination rejected based on angular matching "
1027 std::unique_ptr<Trk::Track> slOverlapTrack =
combine(ctx, *track, *seg_1->segment,
emptyPhiHits);
1028 if (!slOverlapTrack)
continue;
1032 if (!sortTracks(*slOverlapTrack, *track)) {
1033 ATH_MSG_VERBOSE(__FILE__<<
":"<<__LINE__<<
" rejecting track as new segment results in worse fit");
1037 <<
m_printer->printStations(*slOverlapTrack));
1039 track.swap(slOverlapTrack);
1040 usedSegments.insert(seg_1);
1041 slSegments[seg] = seg_1;
1049 extensions.emplace_back(seg, std::move(track));
1054 if (!extensions.empty()) {
1055 candidates.reserve(extensions.size());
1063 for (std::pair<
MuPatSegment*, std::unique_ptr<Trk::Track> >& ext_itr : extensions) {
1064 std::unique_ptr<MuPatTrack> newCandidate;
1067 newCandidate = std::make_unique<MuPatTrack>(*trkCan);
1068 m_candidateHandler->extendWithSegment(*newCandidate, *ext_itr.first, ext_itr.second);
1069 }
else if (segCan) {
1070 newCandidate =
m_candidateHandler->createCandidate(*segCan, *ext_itr.first, ext_itr.second);
1078 std::unique_ptr<Trk::Track> nullTrack;
1079 newCandidate->addSegment(slOverlap, nullTrack);
1081 candidates.push_back(std::move(newCandidate));
1083 ATH_MSG_DEBUG(
" creating new candidate " << candidates.back().get() << std::endl
1084 <<
m_printer->print(candidates.back()->track()) << std::endl
1085 <<
m_printer->printStations(candidates.back()->track()));
1094 if (!parsVec1 || parsVec1->
empty()) {
1100 ATH_MSG_WARNING(
" isSplitTrack::Track without NULL pointer in parameter vector! ");
1105 if (!parsVec2 || parsVec2->
empty()) {
1111 ATH_MSG_WARNING(
" isSplitTrack::Track without NULL pointer in parameter vector! ");
1120 double sinTheta1 = sin(pars1->
momentum().theta());
1121 double sinTheta2 = sin(pars2->
momentum().theta());
1122 double deltaSinTheta = sinTheta1 - sinTheta2;
1123 if (std::abs(deltaSinTheta) > 1.) {
1124 ATH_MSG_DEBUG(
" too large opening angle in theta " << deltaSinTheta);
1127 double sinPhi1 = sin(pars1->
momentum().phi());
1128 double sinPhi2 = sin(pars2->
momentum().phi());
1129 double deltaSinPhi = sinPhi1 - sinPhi2;
1130 if (std::abs(deltaSinPhi) > 1.) {
1131 ATH_MSG_DEBUG(
" too large opening angle in phi " << deltaSinPhi);
1143 if (isSL1 && !isSL2) {
1144 referenceTrack = &track2;
1145 otherTrack = &track1;
1146 }
else if (!isSL1 && isSL2) {
1147 referenceTrack = &track1;
1148 otherTrack = &track2;
1151 bool pickFirst = sortTracks(track1, track2);
1153 referenceTrack = &track1;
1154 otherTrack = &track2;
1156 referenceTrack = &track2;
1157 otherTrack = &track1;
1182 unsigned int nmatching(0);
1183 unsigned int noff(0);
1186 double prevDist = 1e10;
1190 while (refTSOS != refTSOS_end && otherTSOS != otherTSOS_end) {
1203 double dist = distAlongPars(*parsRef, *parsOther);
1212 if (prevPars && std::abs(prevDist) < std::abs(dist)) {
1213 closestPars = prevPars;
1215 closestPars = parsRef;
1223 if (!
id.is_valid()) {
1235 double residual = 1e10;
1238 std::optional<Trk::ResidualPull> resPull =
1240 if (resPull && resPull->pull().size() == 1) {
1241 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
" residual " <<
m_printer->print(*resPull);
1242 residual = resPull->residual().front();
1243 pull = resPull->pull().front();
1248 bool inBounds =
false;
1253 if (
msgLvl(MSG::VERBOSE))
1264 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
" range " << halfTubeLen;
1270 if (mmClusterOnTrack) {
1276 if (
msgLvl(MSG::VERBOSE)) {
1278 msg(MSG::VERBOSE) <<
" inBounds ";
1280 msg(MSG::VERBOSE) <<
" outBounds ";
1286 if (inBounds && (std::abs(residual) < 20. || std::abs(pull) < 10.)) {
1295 ATH_MSG_DEBUG(
"failed to extrapolate parameters to surface");
1307 return nmatching > noff;
1312 std::vector<std::pair<bool, std::unique_ptr<Trk::Track> > > goodTracks;
1313 goodTracks.reserve(tracks.
size());
1314 bool foundSplitTracks =
false;
1316 ATH_MSG_DEBUG(
" trying to merge split tracks, collection size " << tracks.
size());
1321 std::unique_ptr<Trk::Track> mergedTrack;
1324 for (std::pair<
bool, std::unique_ptr<Trk::Track>>& good_trk : goodTracks) {
1326 bool isSplit =
isSplitTrack(ctx, *good_trk.second, *in_track);
1329 std::unique_ptr<Trk::Track> track1 = std::make_unique<Trk::Track>(*good_trk.second);
1330 std::unique_ptr<Trk::Track> track2 = std::make_unique<Trk::Track>(*in_track);
1339 <<
m_printer->print(*good_trk.second) << std::endl
1340 <<
m_printer->printStations(*good_trk.second) << std::endl
1341 <<
m_printer->print(*in_track) << std::endl
1342 <<
m_printer->printStations(*in_track) << std::endl
1343 <<
" merged track " << std::endl
1344 <<
m_printer->print(*mergedTrack) << std::endl
1345 <<
m_printer->printStations(*mergedTrack));
1346 foundSplitTracks =
true;
1348 good_trk.first =
true;
1349 good_trk.second.swap(mergedTrack);
1353 <<
m_printer->print(*good_trk.second) << std::endl
1354 <<
m_printer->printStations(*good_trk.second) << std::endl
1355 <<
m_printer->print(*in_track) << std::endl
1356 <<
m_printer->printStations(*in_track));
1363 std::unique_ptr<Trk::Track> newTrack = std::make_unique<Trk::Track>(*in_track);
1364 goodTracks.emplace_back(
false, std::move(newTrack));
1369 if (!foundSplitTracks)
return nullptr;
1372 newTracks->
reserve(goodTracks.size());
1373 for (std::pair<
bool, std::unique_ptr<Trk::Track>>& good_trk: goodTracks) {
1375 newTracks->
push_back(std::move(good_trk.second));
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
bool msgLvl(const MSG::Level lvl) const
static Timeout & instance()
Get reference to Timeout singleton.
void getInitializedCache(MagField::AtlasFieldCache &cache) const
get B field cache for evaluation as a function of 2-d or 3-d position.
DataModel_detail::const_iterator< DataVector > const_iterator
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataModel_detail::iterator< DataVector > iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const T * front() const
Access the first element in the collection as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h).
bool insideActiveBounds(const Identifier &id, const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const
boundary check Wrapper Trk::PlaneSurface::insideBounds() taking into account the passivated width
double getActiveTubeLength(const int tubeLayer, const int tube) const
Class for competing MuonClusters, it extends the Trk::CompetingRIOsOnTrack base class.
std::vector< const Trk::PrepRawData * > PrepVec
Class to represent calibrated clusters formed from TGC strips.
virtual const MuonGM::MMReadoutElement * detectorElement() const
Returns the detector element, assoicated with the PRD of this class.
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
virtual const MuonGM::MdtReadoutElement * detectorElement() const override final
Returns the detector element, assoicated with the PRD of this class.
virtual const MdtPrepData * prepRawData() const override final
Returns the PrepRawData used to create this corrected measurement.
virtual std::unique_ptr< Trk::TrackParameters > getClosestParameters(const Trk::Track &track, const Trk::Surface &surf) const override
find closest TrackParameters to the surface.
ToolHandle< MuPatCandidateTool > m_candidateHandler
candidate handler
ToolHandle< IMuonCompetingClustersOnTrackCreator > m_compRotCreator
void removeDuplicateWithReference(std::unique_ptr< Trk::SegmentCollection > &segments, std::vector< const MuonSegment * > &referenceSegments) const
ToolHandle< Trk::IPropagator > m_propagator
bool isSplitTrack(const EventContext &ctx, const Trk::Track &track1, const Trk::Track &track2) const
identify whether two track are split
Trk::MagneticFieldProperties m_magFieldProperties
magnetic field properties
virtual std::vector< std::unique_ptr< MuPatTrack > > find(const EventContext &ctx, MuPatCandidateBase &candidate, const std::vector< MuPatSegment * > &segments) const override
interface for tools to find track in the muon system starting from a vector of segments
ToolHandle< IMuonSeededSegmentFinder > m_seededSegmentFinder
Gaudi::Property< bool > m_recalibrateMDTHits
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtRotCreator
PublicToolHandle< MuonEDMPrinterTool > m_printer
tool to print out EDM objects;
Gaudi::Property< bool > m_useTrackingHistory
use history of the track finding up to now to avoid creating duplicates
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
std::atomic_uint m_ncalls
virtual std::unique_ptr< Trk::TrackParameters > findClosestParameters(const Trk::Track &track, const Amg::Vector3D &pos) const override
find closest TrackParameters to the position.
ToolHandle< MooTrackFitter > m_fitter
virtual void refine(const EventContext &ctx, MuPatTrack &track) const override
interface for tools which refine the hit content of a given track
Gaudi::Property< bool > m_useExclusionList
use exclusion list (bit faster at the price of missing chambers)
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
MooTrackBuilder(const std::string &, const std::string &, const IInterface *)
default AlgTool constructor
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
std::atomic_uint m_nTimedOut
ToolHandle< IMuonHoleRecoveryTool > m_muonChamberHoleRecoverTool
ToolHandle< MooCandidateMatchingTool > m_candidateMatchingTool
ToolHandle< MooTrackFitter > m_slFitter
std::vector< std::unique_ptr< Trk::Track > > combineWithSegmentFinding(const EventContext &ctx, const Trk::Track &track, const MuonSegment &seg, const PrepVec &patternPhiHits) const
find tracks by redoing the segment finding in the chamber of the segment
std::unique_ptr< MuonSegment > combineToSegment(const EventContext &ctx, const MuPatCandidateBase &firstEntry, const MuPatCandidateBase &secondEntry, const PrepVec &patternPhiHits) const
Methos is used externally by MuonTrackSteering.cxx:233. Should be revised to put it into an interface...
ToolHandle< IMuonErrorOptimisationTool > m_errorOptimisationTool
virtual StatusCode initialize() override
initialize method, method taken from bass-class AlgTool
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
TrackCollection * mergeSplitTracks(const EventContext &ctx, const TrackCollection &tracks) const
look for split tracks in collection and merge them
std::pair< std::unique_ptr< Trk::Track >, std::unique_ptr< Trk::Track > > splitTrack(const EventContext &ctx, const Trk::Track &track) const
split given track if it crosses the calorimeter volume, code assumes that the track was already extra...
ToolHandle< IMuonTrackToSegmentTool > m_trackToSegmentTool
virtual std::unique_ptr< Trk::Track > recalibrateHitsOnTrack(const EventContext &ctx, const Trk::Track &track, bool doMdts, bool doCompetingClusters) const override
recalibrate hits on track
ToolHandle< IMuonTrackExtrapolationTool > m_trackExtrapolationTool
virtual std::unique_ptr< Trk::Track > refit(const EventContext &ctx, Trk::Track &track) const override
refit track
Gaudi::Property< bool > m_doTimeOutChecks
on/off time out check
Trk::TrackStates::const_iterator insertClustersWithCompetingRotCreation(const EventContext &ctx, Trk::TrackStates::const_iterator tsit, Trk::TrackStates::const_iterator tsit_end, std::vector< std::unique_ptr< const Trk::TrackStateOnSurface > > &states) const
ToolHandle< Trk::IResidualPullCalculator > m_pullCalculator
virtual StatusCode finalize() override
finialize method, method taken from bass-class AlgTool
std::unique_ptr< Trk::Track > combine(const EventContext &ctx, const MuPatCandidateBase &firstEntry, const MuPatCandidateBase &secondEntry, const PrepVec &patternPhiHits) const
combine two MCTBCandidateEntries
track candidate entry object.
const std::set< MuonStationIndex::StIndex > & stations() const
returns set with contained stationIndices
bool shareChambers(const MuPatCandidateBase &entry) const
checks whether the two entries contain the same chamber
segment candidate object.
const Trk::TrackParameters & entryPars() const
returns first track parameters
const MuonSegment * segment
void addExcludedSegment(MuPatSegment *segment)
add segment that does not match the track
Trk::Track & track() const
access to track
const std::vector< MuPatSegment * > & excludedSegments() const
access to segments
const std::vector< MuPatSegment * > & segments() const
access to segments
Base class for Muon cluster RIO_OnTracks.
virtual const MuonGM::MuonClusterReadoutElement * detectorElement() const override=0
Returns the detector element, associated with the PRD of this class.
virtual const MuonCluster * prepRawData() const override=0
Returns the Trk::PrepRawData - is a MuonCluster in this scope.
static std::unique_ptr< Trk::TrackParameters > closestParameters(const Trk::Track &track, const Amg::Vector3D &pos, bool onlyUseMeasured=false)
Class to cache the identifiers on a segment in sets that can later be used to perform an overlap remo...
This is the common class for 3D segments used in the muon spectrometer.
virtual const Amg::Vector3D & globalPosition() const override final
global position
virtual const Trk::PlaneSurface & associatedSurface() const override final
returns the surface for the local to global transformation
static std::unique_ptr< Trk::TrackStateOnSurface > createMeasTSOS(std::unique_ptr< Trk::MeasurementBase > meas, std::unique_ptr< Trk::TrackParameters > pars, Trk::TrackStateOnSurface::TrackStateOnSurfaceType type)
create a TSOS with a measurement, takes ownership of the pointers
static std::unique_ptr< Trk::TrackStateOnSurface > createMeasTSOSWithUpdate(const Trk::TrackStateOnSurface &tsos, std::unique_ptr< Trk::MeasurementBase > meas, std::unique_ptr< Trk::TrackParameters > pars, Trk::TrackStateOnSurface::TrackStateOnSurfaceType type)
create a TSOS with a measurement, takes ownership of the pointers
This class is the pure abstract base class for all fittable tracking measurements.
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
std::unique_ptr< ParametersBase< DIM, T > > uniqueClone() const
clone method for polymorphic deep copy returning unique_ptr; it is not overriden, but uses the existi...
@ Unbiased
RP with track state that has measurement not included.
Base class for all TrackSegment implementations, extends the common MeasurementBase.
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
Abstract Base Class for tracking surfaces.
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const =0
virtual methods to be overwritten by the inherited surfaces
represents the track state (measurement, material, fit parameters and quality) at a surface.
virtual TrackStateOnSurface * clone() const
Pseudo-constructor: needed to avoid excessive RTTI.
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
const DataVector< const MeasurementBase > * measurementsOnTrack() const
return a pointer to a vector of MeasurementBase (NOT including any that come from outliers).
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
This is the base class for all tracking detector elements with read-out relevant information.
holding In fact this class is here in order to allow STL container for all features This class is sho...
void zero(TH2 *h)
zero the contents of a 2d histogram
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
StIndex
enum to classify the different station layers in the muon spectrometer
const std::string & stName(StIndex index)
convert StIndex into a string
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
static const MooTrackBuilder::PrepVec emptyPhiHits
DataVector< const Trk::TrackStateOnSurface > TrackStates
ParametersBase< TrackParametersDim, Charged > TrackParameters
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.
OverlapResult
enum for the overlap result