28 declareInterface<IMuonErrorOptimisationTool>(
this);
39 return StatusCode::SUCCESS;
63 return StatusCode::SUCCESS;
76 std::unique_ptr<Trk::Track> result1;
77 std::unique_ptr<Trk::Track> result2;
81 settings.
broad =
false;
82 std::unique_ptr<Trk::Track> refittedTrack =
m_refitTool->refit(
track, ctx, &settings);
87 <<
m_printer->print(*refittedTrack) << std::endl
88 <<
m_printer->printStations(*refittedTrack));
91 result1.swap(refittedTrack);
94 <<
m_printer->print(*refittedTrack) << std::endl
95 <<
m_printer->printStations(*refittedTrack));
106 if (!refittedTrack) {
108 settings.
broad =
true;
114 <<
m_printer->print(*refittedTrack) << std::endl
115 <<
m_printer->printStations(*refittedTrack));
117 result2.swap(refittedTrack);
120 <<
m_printer->print(*refittedTrack) << std::endl
121 <<
m_printer->printStations(*refittedTrack));
136 if (!result1 && !result2)
return nullptr;
143 bool doSelection =
true;
146 if (!fq0 || (result1 && !fq1) || (result2 && !fq2)) {
159 if (muonSummary0) nhits0 = muonSummary0->
netaHits() + muonSummary0->
nphiHits();
164 if (muonSummary0) nhits0 = muonSummary0->
netaHits() + muonSummary0->
nphiHits();
170 if (muonSummary0) nhits0 = muonSummary0->
netaHits() + muonSummary0->
nphiHits();
184 if (muonSummary1) nhits1 = muonSummary1->
netaHits() + muonSummary1->
nphiHits();
189 if (muonSummary1) nhits1 = muonSummary1->
netaHits() + muonSummary1->
nphiHits();
203 if (muonSummary2) nhits2 = muonSummary2->
netaHits() + muonSummary2->
nphiHits();
208 if (muonSummary2) nhits2 = muonSummary2->
netaHits() + muonSummary2->
nphiHits();
211 if (nhits0 != -1 && nhits1 != -1 && nhits2 != -1) {
212 if (nhits0 == nhits1 && nhits0 == nhits2) doSelection =
true;
220 bool firstIsBest =
true;
221 if (!fq1 && fq2) firstIsBest =
false;
239 return refittedTrack;