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::vector<const MuonClusterOnTrack*>::const_iterator clit = comp->containedROTs().begin();
814 std::vector<const MuonClusterOnTrack*>::const_iterator clit_end = comp->containedROTs().end();
815 for (; clit != clit_end; ++clit) { prdList.push_back((*clit)->prepRawData()); }
825 if (!etaPrds.empty()) {
826 std::unique_ptr<CompetingMuonClustersOnTrack> etaCompRot =
m_compRotCreator->createBroadCluster(etaPrds, 0.);
828 ATH_MSG_WARNING(
" Failed to create CompetingMuonClustersOnTrack for eta hits! ");
830 std::unique_ptr<Trk::TrackParameters> etaPars;;
832 if (etaCompRot->associatedSurface() == pars->associatedSurface()) {
833 etaPars = pars->uniqueClone();
838 etaCompRot->associatedSurface(),
842 ATH_MSG_WARNING(
" Failed to calculate TrackParameters for eta hits! ");
844 std::unique_ptr<Trk::TrackStateOnSurface> tsos =
846 newStates.push_back(std::move(tsos));
851 if (!phiPrds.empty()) {
852 std::unique_ptr<CompetingMuonClustersOnTrack> phiCompRot =
m_compRotCreator->createBroadCluster(phiPrds, 0.);
854 ATH_MSG_WARNING(
" Failed to create CompetingMuonClustersOnTrack for phi hits! ");
856 std::unique_ptr<Trk::TrackParameters> phiPars;
858 if (phiCompRot->associatedSurface() == pars->associatedSurface()) {
859 phiPars = pars->uniqueClone();
863 m_propagator->propagate(ctx, *pars, phiCompRot->associatedSurface(),
867 ATH_MSG_WARNING(
" Failed to calculate TrackParameters for phi hits! ");
869 std::unique_ptr<Trk::TrackStateOnSurface> tsos =
871 newStates.push_back(std::move(tsos));
877 for (
const auto& outlier : outlierStates) {
878 if (hasPhi && outlier.first)
879 newStates.emplace_back(outlier.second->clone());
880 else if (hasEta && !outlier.first)
881 newStates.emplace_back(outlier.second->clone());
882 else if (
msgLvl(MSG::DEBUG))
883 msg(MSG::DEBUG) <<
" Dropping outlier " <<
endmsg;
890 states.insert(states.end(), std::make_move_iterator(newStates.begin()),
891 std::make_move_iterator(newStates.end()));
915 return m_fitter->splitTrack(ctx, track);
919 const std::vector<MuPatSegment*>& segVec)
const {
920 std::vector<std::unique_ptr<MuPatTrack> > candidates;
922 if (segVec.empty())
return candidates;
924 std::set<MuPatSegment*> usedSegments;
925 std::map<MuPatSegment*, MuPatSegment*> slSegments;
928 bool tightQualityCuts =
false;
934 std::vector<std::pair<MuPatSegment*, std::unique_ptr<Trk::Track> > > extensions;
935 extensions.reserve(segVec.size());
939 if (usedSegments.count(seg))
continue;
948 ATH_MSG_VERBOSE(
" track/segment combination rejected based on angular matching " << std::endl
969 if (!sortTracks(*track, trkCan->
track())) {
970 ATH_MSG_VERBOSE(
" rejecting track as new segment results in worse fit");
976 std::set<MuonStationIndex::StIndex> stationLayersOnTrack;
979 if (!
id.is_valid() ||
m_idHelperSvc->isTrigger(
id)) {
continue; }
980 stationLayersOnTrack.insert(
m_idHelperSvc->stationIndex(
id));
983 bool hasAllLayers =
true;
985 if (!stationLayersOnTrack.count(stIdx)) {
987 hasAllLayers =
false;
992 ATH_MSG_VERBOSE(
" rejecting track as one of the chamber layers of the candidate was removed ");
997 if (!track) {
continue; }
999 usedSegments.insert(seg);
1003 if (!seg->hasSLOverlap()) {
1004 std::unique_ptr<MuPatTrack> newCandidate;
1008 if (seg->chIndex == seg_1->chIndex)
continue;
1010 if (!newCandidate) {
1011 std::unique_ptr<Trk::Track> trkTrkCan = std::make_unique<Trk::Track>(*track);
1014 newCandidate = std::make_unique<MuPatTrack>(*trkCan);
1016 }
else if (segCan) {
1019 if (!newCandidate)
break;
1022 ATH_MSG_VERBOSE(
"track/segment combination rejected based on angular matching "
1029 std::unique_ptr<Trk::Track> slOverlapTrack =
combine(ctx, *track, *seg_1->segment,
emptyPhiHits);
1030 if (!slOverlapTrack)
continue;
1034 if (!sortTracks(*slOverlapTrack, *track)) {
1035 ATH_MSG_VERBOSE(__FILE__<<
":"<<__LINE__<<
" rejecting track as new segment results in worse fit");
1039 <<
m_printer->printStations(*slOverlapTrack));
1041 track.swap(slOverlapTrack);
1042 usedSegments.insert(seg_1);
1043 slSegments[seg] = seg_1;
1051 extensions.emplace_back(seg, std::move(track));
1056 if (!extensions.empty()) {
1057 candidates.reserve(extensions.size());
1065 for (std::pair<
MuPatSegment*, std::unique_ptr<Trk::Track> >& ext_itr : extensions) {
1066 std::unique_ptr<MuPatTrack> newCandidate;
1069 newCandidate = std::make_unique<MuPatTrack>(*trkCan);
1070 m_candidateHandler->extendWithSegment(*newCandidate, *ext_itr.first, ext_itr.second);
1071 }
else if (segCan) {
1072 newCandidate =
m_candidateHandler->createCandidate(*segCan, *ext_itr.first, ext_itr.second);
1080 std::unique_ptr<Trk::Track> nullTrack;
1081 newCandidate->addSegment(slOverlap, nullTrack);
1083 candidates.push_back(std::move(newCandidate));
1085 ATH_MSG_DEBUG(
" creating new candidate " << candidates.back().get() << std::endl
1086 <<
m_printer->print(candidates.back()->track()) << std::endl
1087 <<
m_printer->printStations(candidates.back()->track()));
1096 if (!parsVec1 || parsVec1->
empty()) {
1102 ATH_MSG_WARNING(
" isSplitTrack::Track without NULL pointer in parameter vector! ");
1107 if (!parsVec2 || parsVec2->
empty()) {
1113 ATH_MSG_WARNING(
" isSplitTrack::Track without NULL pointer in parameter vector! ");
1122 double sinTheta1 = sin(pars1->
momentum().theta());
1123 double sinTheta2 = sin(pars2->
momentum().theta());
1124 double deltaSinTheta = sinTheta1 - sinTheta2;
1125 if (std::abs(deltaSinTheta) > 1.) {
1126 ATH_MSG_DEBUG(
" too large opening angle in theta " << deltaSinTheta);
1129 double sinPhi1 = sin(pars1->
momentum().phi());
1130 double sinPhi2 = sin(pars2->
momentum().phi());
1131 double deltaSinPhi = sinPhi1 - sinPhi2;
1132 if (std::abs(deltaSinPhi) > 1.) {
1133 ATH_MSG_DEBUG(
" too large opening angle in phi " << deltaSinPhi);
1145 if (isSL1 && !isSL2) {
1146 referenceTrack = &track2;
1147 otherTrack = &track1;
1148 }
else if (!isSL1 && isSL2) {
1149 referenceTrack = &track1;
1150 otherTrack = &track2;
1153 bool pickFirst = sortTracks(track1, track2);
1155 referenceTrack = &track1;
1156 otherTrack = &track2;
1158 referenceTrack = &track2;
1159 otherTrack = &track1;
1184 unsigned int nmatching(0);
1185 unsigned int noff(0);
1188 double prevDist = 1e10;
1192 while (refTSOS != refTSOS_end && otherTSOS != otherTSOS_end) {
1205 double dist = distAlongPars(*parsRef, *parsOther);
1214 if (prevPars && std::abs(prevDist) < std::abs(dist)) {
1215 closestPars = prevPars;
1217 closestPars = parsRef;
1225 if (!
id.is_valid()) {
1237 double residual = 1e10;
1240 std::optional<Trk::ResidualPull> resPull =
1242 if (resPull && resPull->pull().size() == 1) {
1243 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
" residual " <<
m_printer->print(*resPull);
1244 residual = resPull->residual().front();
1245 pull = resPull->pull().front();
1250 bool inBounds =
false;
1255 if (
msgLvl(MSG::VERBOSE))
1266 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
" range " << halfTubeLen;
1272 if (mmClusterOnTrack) {
1278 if (
msgLvl(MSG::VERBOSE)) {
1280 msg(MSG::VERBOSE) <<
" inBounds ";
1282 msg(MSG::VERBOSE) <<
" outBounds ";
1288 if (inBounds && (std::abs(residual) < 20. || std::abs(pull) < 10.)) {
1297 ATH_MSG_DEBUG(
"failed to extrapolate parameters to surface");
1309 return nmatching > noff;
1314 std::vector<std::pair<bool, std::unique_ptr<Trk::Track> > > goodTracks;
1315 goodTracks.reserve(tracks.
size());
1316 bool foundSplitTracks =
false;
1318 ATH_MSG_DEBUG(
" trying to merge split tracks, collection size " << tracks.
size());
1323 std::unique_ptr<Trk::Track> mergedTrack;
1326 for (std::pair<
bool, std::unique_ptr<Trk::Track>>& good_trk : goodTracks) {
1328 bool isSplit =
isSplitTrack(ctx, *good_trk.second, *in_track);
1331 std::unique_ptr<Trk::Track> track1 = std::make_unique<Trk::Track>(*good_trk.second);
1332 std::unique_ptr<Trk::Track> track2 = std::make_unique<Trk::Track>(*in_track);
1341 <<
m_printer->print(*good_trk.second) << std::endl
1342 <<
m_printer->printStations(*good_trk.second) << std::endl
1343 <<
m_printer->print(*in_track) << std::endl
1344 <<
m_printer->printStations(*in_track) << std::endl
1345 <<
" merged track " << std::endl
1346 <<
m_printer->print(*mergedTrack) << std::endl
1347 <<
m_printer->printStations(*mergedTrack));
1348 foundSplitTracks =
true;
1350 good_trk.first =
true;
1351 good_trk.second.swap(mergedTrack);
1355 <<
m_printer->print(*good_trk.second) << std::endl
1356 <<
m_printer->printStations(*good_trk.second) << std::endl
1357 <<
m_printer->print(*in_track) << std::endl
1358 <<
m_printer->printStations(*in_track));
1365 std::unique_ptr<Trk::Track> newTrack = std::make_unique<Trk::Track>(*in_track);
1366 goodTracks.emplace_back(
false, std::move(newTrack));
1371 if (!foundSplitTracks)
return nullptr;
1374 newTracks->
reserve(goodTracks.size());
1375 for (std::pair<
bool, std::unique_ptr<Trk::Track>>& good_trk: goodTracks) {
1377 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