10 #include "GaudiKernel/ConcurrencyFlags.h"
38 std::ostringstream sout;
39 sout <<
" sector " <<
intersection.layerSurface.sector <<
" "
70 return StatusCode::SUCCESS;
79 extend(inDetCandidates, tagMap, combTracks, meTracks, segments, ctx);
84 const EventContext& ctx)
const {
87 if (meTracks)
ATH_MSG_DEBUG(
"Not currently creating ME tracks for staus");
91 std::unique_ptr<MuonStauRecoTool::TruthInfo>
95 truthParticleLinkAcc(
"truthParticleLink");
99 return std::make_unique<TruthInfo>((*truthLink)->pdgId(), (*truthLink)->m(), (*truthLink)->p4().Beta());
108 ATH_MSG_DEBUG(
" skip silicon associated track for extension ");
121 std::unique_ptr<TruthInfo> truthInfo(
getTruth(indetTrackParticle));
125 ATH_MSG_DEBUG(
"Truth reconstruction enabled: skipping ID track with pdgId: " << (truthInfo ? truthInfo->
pdgId : 0));
134 msg(MSG::INFO) <<
" ID track: pt " << indetTrackParticle.
pt() <<
" eta " << indetTrackParticle.
eta() <<
" phi "
135 << indetTrackParticle.
phi();
136 if (truthInfo)
msg(MSG::INFO) << truthInfo->
toString();
137 if (!muonSystemExtension)
msg(MSG::INFO) <<
" failed muonSystemExtension";
142 if (!muonSystemExtension) {
return; }
197 ATH_MSG_DEBUG(
" candidate: betaseed beta" << candidate->betaSeed.beta <<
", error" << candidate->betaSeed.error
198 <<
" layerDataVec size" << candidate->layerDataVec.size() <<
" hits size"
199 << candidate->hits.size());
202 for (
const auto& layerData : candidate->layerDataVec) {
204 std::vector<std::shared_ptr<const Muon::MuonSegment>> segments;
207 for (
const auto& maximumData : layerData.maximumDataVec) {
213 if (segments.empty())
continue;
221 std::vector<std::shared_ptr<const Muon::MuonSegment>> selectedSegments;
225 for (
const auto& seg : selectedSegments)
m_recoValidationTool->add(layerData.intersection, *seg, 3);
229 candidate->allLayers.emplace_back(layerData.intersection, std::move(selectedSegments));
233 if (!candidate->allLayers.empty()) refinedCandidates.push_back(candidate);
241 msg(MSG::INFO) <<
" Summary::refineCandidates ";
243 msg(MSG::INFO) <<
" No candidated found ";
248 msg(MSG::INFO) << std::endl
249 <<
" candidate: beta fit result: beta " << candidate->betaFitResult.beta <<
" chi2/ndof "
250 << candidate->betaFitResult.chi2PerDOF() <<
" layers with segments" << candidate->allLayers.size();
251 for (
const auto&
layer : candidate->allLayers)
252 msg(MSG::INFO) << std::endl
265 if (!mdtCalibConstants.isValid()) {
267 throw std::runtime_error(
"Failed to retrieve calibration constants");
283 ATH_MSG_WARNING(
" track without states, cannot extractTimeMeasurementsFromTrack ");
290 typedef std::vector<const Muon::MuonClusterOnTrack*> RpcClVec;
291 using RpcClPerChMap = std::map<Identifier, std::tuple<const Trk::TrackParameters*, RpcClVec, RpcClVec>>;
292 RpcClPerChMap rpcPrdsPerChamber;
294 using MdtTubeData = std::pair<const Trk::TrackParameters*, const Muon::MdtDriftCircleOnTrack*>;
295 using MdtTubeDataVec = std::vector<MdtTubeData>;
296 using MdtChamberLayerData = std::map<int, MdtTubeDataVec>;
297 MdtChamberLayerData mdtDataPerChamberLayer;
302 for (; tsit != tsit_end; ++tsit) {
324 if (stName[2] ==
'R') { chIndexWithBIR += 1000; }
326 mdtDataPerChamberLayer[chIndexWithBIR].push_back(std::make_pair(
pars, mdt));
332 float ix =
pars->position().x();
333 float iy =
pars->position().y();
334 float iz =
pars->position().z();
346 auto data = mdtCalibConstants->getCalibData(
id, msgStream());
347 const auto& rtRelation =
data->rtRelation;
348 bool out_of_bound_flag =
false;
349 float drdt = rtRelation->rt()->driftVelocity(
driftTime);
350 float rres = rtRelation->rtRes()->resolution(
driftTime);
351 float tres = rres / drdt;
352 float TlocR = rtRelation->tr()->tFromR(std::abs(
locR), out_of_bound_flag);
353 float trackTimeRes = errR / drdt;
355 er = std::sqrt(
tres *
tres + trackTimeRes * trackTimeRes);
357 time =
driftTime - TlocR + tofShiftFromBeta;
362 std::unique_ptr<const Trk::TrackParameters> unbiasedPars(
365 float locRu = unbiasedPars->parameters()[
Trk::locR];
366 float TlocRu = rtRelation->tr()->tFromR(std::abs(locRu), out_of_bound_flag);
367 float errRu = unbiasedPars->covariance() ?
Amg::error(*unbiasedPars->covariance(),
Trk::locR) : 0.3;
368 float trackTimeResu = errRu / drdt;
370 time =
driftTime - TlocRu + tofShiftFromBeta;
371 er = std::sqrt(
tres *
tres + trackTimeResu * trackTimeResu);
373 ATH_MSG_VERBOSE(
" Got unbiased parameters: r " <<
locR <<
" ur " << locRu <<
" err " << errR <<
" uerr "
374 << errRu <<
" terr " << trackTimeRes <<
" terru "
380 <<
" TlocR " << TlocR <<
" diff " <<
driftTime - TlocR <<
" tofShift " << tofShiftFromBeta
381 <<
" time " << time <<
" err " << er <<
" intrinsic " <<
tres <<
" track " << trackTimeRes);
385 <<
beta <<
" diff " << std::abs(
beta - betaSeed));
389 candidate.
stauHits.push_back(
MuGirlNS::StauHit(tech, time + tof, ix, iy, iz,
id,
ie, er,
sh, isEta, propTime));
393 std::vector<const Muon::MuonClusterOnTrack*>
clusters;
403 auto pos = rpcPrdsPerChamber.find(chamberId);
404 if (
pos == rpcPrdsPerChamber.end()) {
406 rpcPrdsPerChamber[chamberId] = std::make_tuple(
pars,
clusters, RpcClVec());
408 rpcPrdsPerChamber[chamberId] = std::make_tuple(
pars, RpcClVec(),
clusters);
410 RpcClVec& clVec = measuresPhi ? std::get<1>(
pos->second) : std::get<2>(
pos->second);
420 float ix =
pars->position().x();
421 float iy =
pars->position().y();
422 float iz =
pars->position().z();
429 candidate.
stauHits.push_back(
MuGirlNS::StauHit(tech, time + tof, ix, iy, iz,
id,
ie, er,
sh, isEta, propTime));
437 std::vector<const Muon::MuonClusterOnTrack*> calibratedClusters;
438 for (
const auto* cluster :
clusters) {
440 if (
cl) calibratedClusters.push_back(
cl);
442 if (calibratedClusters.empty())
return;
445 for (
const auto*
cl : calibratedClusters)
delete cl;
446 if (!
result.valid)
return;
453 float ix =
pars.position().x();
454 float iy =
pars.position().y();
455 float iz =
pars.position().z();
466 <<
" diff " << std::abs(
beta - betaSeed));
471 candidate.stauHits.push_back(
MuGirlNS::StauHit(tech, time + tof, ix, iy, iz,
id,
ie, er,
sh, isEta, propTime));
475 RpcClPerChMap::const_iterator chit = rpcPrdsPerChamber.begin();
476 RpcClPerChMap::const_iterator chit_end = rpcPrdsPerChamber.end();
479 for (; chit != chit_end; ++chit) {
481 const RpcClVec& phiClusters = std::get<1>(chit->second);
482 const RpcClVec& etaClusters = std::get<2>(chit->second);
483 insertRpcs(*
pars, phiClusters, candidate,
hits);
484 insertRpcs(*
pars, etaClusters, candidate,
hits);
499 MdtChamberLayerData::const_iterator mit = mdtDataPerChamberLayer.begin();
500 MdtChamberLayerData::const_iterator mit_end = mdtDataPerChamberLayer.end();
501 for (; mit != mit_end; ++mit) {
503 <<
" hits " << mit->second.size());
504 if (mit->second.size() < 4)
continue;
510 ATH_MSG_WARNING(
"MdtReadoutElement should always have a PlaneSurface as reference surface");
527 std::vector<std::pair<std::shared_ptr<const Muon::MdtDriftCircleOnTrack>,
const Trk::TrackParameters*>> indexLookUp;
529 for (
const auto&
entry : mit->second) {
534 std::unique_ptr<const Muon::MdtDriftCircleOnTrack> calibratedMdt(
536 if (!calibratedMdt) {
543 <<
" r_track " <<
pars.parameters()[
Trk::locR] <<
" residual "
566 dcs.push_back(dcOnTrack);
567 indexLookUp.emplace_back(std::move(calibratedMdt), &
pars);
572 for (
unsigned int i = 0;
i < dcs.size(); ++
i) {
581 segment.hitsOnTrack(dcs.size());
582 unsigned int ndofFit =
segment.ndof();
583 if (ndofFit < 1)
continue;
584 double chi2NdofSegmentFit =
segment.chi2() / ndofFit;
585 bool hasDropHit =
false;
586 unsigned int dropDepth = 0;
588 ATH_MSG_DEBUG(
"DropHits failed, fit chi2/ndof " << chi2NdofSegmentFit);
597 if (
i >=
segment.dcs().size())
continue;
605 if (index < 0 || index >= (
int)indexLookUp.size()) {
606 ATH_MSG_WARNING(
" lookup of TrackParameters and MdtDriftCircleOnTrack failed " <<
index <<
" range: 0 - "
607 << indexLookUp.size() - 1);
615 std::shared_ptr<const Muon::MdtDriftCircleOnTrack> calibratedMdt(
617 if (!calibratedMdt.get()) {
624 float ix =
pars->position().x();
625 float iy =
pars->position().y();
626 float iz =
pars->position().z();
638 auto data = mdtCalibConstants->getCalibData(
id, msgStream());
639 const auto& rtRelation =
data->rtRelation;
640 bool out_of_bound_flag =
false;
641 float drdt = rtRelation->rt()->driftVelocity(
driftTime);
642 float rres = rtRelation->rtRes()->resolution(
driftTime);
643 float tres = rres / drdt;
644 float TlocR = rtRelation->tr()->tFromR(std::abs(
locR), out_of_bound_flag);
645 float trackTimeRes = errR / drdt;
646 float tofShiftFromBeta = 0.;
647 er = std::sqrt(
tres *
tres + trackTimeRes * trackTimeRes);
649 time =
driftTime - TlocR + tofShiftFromBeta;
658 << chi2NdofSegmentFit <<
" ndof " << std::setw(2) << ndofFit;
660 msg(
MSG::DEBUG) <<
" after outlier " << std::setw(5) << chi2NdofSegmentFit <<
" ndof " << std::setw(2) << ndofFit;
661 msg(
MSG::DEBUG) <<
" driftR " << std::setw(4) << dc.
r() <<
" rline " << std::setw(5) <<
rline <<
" residual "
662 << std::setw(5) <<
res <<
" pull " << std::setw(4) <<
pull <<
" time " << std::setw(3) << time
663 <<
" beta" << std::setw(2) <<
beta <<
" err " << std::setw(3) << er <<
" intrinsic " << std::setw(3)
664 <<
tres <<
" track " << std::setw(3) << trackTimeRes;
669 if (!isSelected)
continue;
672 candidate.stauHits.emplace_back(
MuGirlNS::MDTT_STAU_HIT, time + tof, ix, iy, iz,
id,
ie, er,
sh, isEta, propTime);
677 ATH_MSG_DEBUG(
" extractTimeMeasurementsFromTrack: extracted " << candidate.stauHits.size() <<
" time measurements "
678 <<
" status fit " << betaFitResult.
status <<
" beta "
679 << betaFitResult.
beta <<
" chi2/ndof " << betaFitResult.
chi2PerDOF());
681 candidate.finalBetaFitResult = betaFitResult;
692 std::vector<ElementLink<Trk::SegmentCollection>> segmentLinks;
697 segmentLinks.push_back(segLink);
708 std::unique_ptr<MuGirlNS::StauExtras> stauExtras = std::make_unique<MuGirlNS::StauExtras>();
712 tag->setStauExtras(std::move(stauExtras));
716 msg(MSG::INFO) <<
" Summary::addTag ";
717 msg(MSG::INFO) << std::endl
718 <<
" candidate: beta fit result: beta " << candidate.
betaFitResult.
beta <<
" chi2/ndof "
722 msg(MSG::INFO) << std::endl
723 <<
" track " <<
m_printer->print(**comblink) << std::endl
737 std::map<const Trk::Track*, std::shared_ptr<Candidate>> trackCandidateLookup;
742 trackCandidateLookup[
track] = candidate;
747 if (tracks.
empty())
return false;
748 if (tracks.
size() == 1)
return true;
752 if (!resolvedTracks || resolvedTracks->
empty()) {
759 auto pos = trackCandidateLookup.find(selectedTrack);
760 if (
pos == trackCandidateLookup.end()) {
766 std::shared_ptr<Candidate> candidate =
pos->second;
772 msg(MSG::INFO) <<
" Summary::resolveAmbiguities ";
773 msg(MSG::INFO) << std::endl
774 <<
" candidate: beta fit result: beta " << candidate->
betaFitResult.
beta <<
" chi2/ndof "
793 std::pair<std::unique_ptr<const Muon::MuonCandidate>, std::unique_ptr<Trk::Track>>
result =
801 candidate->muonCandidate = std::move(
result.first);
802 candidate->combinedTrack = std::move(
result.second);
806 combinedCandidates.push_back(candidate);
816 msg(MSG::INFO) <<
" Summary::combineCandidates ";
818 msg(MSG::INFO) <<
" No candidated found ";
823 msg(MSG::INFO) << std::endl
824 <<
" candidate: beta fit result: " << candidate->betaFitResult.beta <<
" chi2/ndof "
825 << candidate->betaFitResult.chi2PerDOF();
826 if (candidate->finalBetaFitResult.status != 0)
827 msg(MSG::INFO) <<
" MDTT beta fit result: " << candidate->finalBetaFitResult.beta <<
" chi2/ndof "
828 << candidate->finalBetaFitResult.chi2PerDOF();
829 msg(MSG::INFO) <<
" layers with segments" << candidate->allLayers.size() << std::endl
830 <<
" track " <<
m_printer->print(*candidate->combinedTrack) << std::endl
831 <<
m_printer->printStations(*candidate->combinedTrack);
843 LayerDataVec::const_iterator
it = associatedData.
layerData.begin();
844 LayerDataVec::const_iterator it_end = associatedData.
layerData.end();
845 for (;
it != it_end; ++
it) {
847 for (
const auto& maximumData :
it->maximumDataVec) {
849 if (!maximumData->betaSeeds.empty()) seedMaximumDataVec.push_back(maximumData);
852 ATH_MSG_DEBUG(
"Creating candidates from seeds " << seedMaximumDataVec.size());
854 if (seedMaximumDataVec.empty()) {
860 auto SortMaximumDataVec = [](
const std::shared_ptr<MaximumData>&
max1,
const std::shared_ptr<MaximumData>& max2) {
861 return max1->maximum->max < max2->maximum->max;
863 std::stable_sort(seedMaximumDataVec.begin(), seedMaximumDataVec.end(), SortMaximumDataVec);
867 std::set<const MaximumData*> usedMaximumData;
870 for (; sit != sit_end; ++sit) {
872 if (usedMaximumData.count(sit->get()))
continue;
873 usedMaximumData.insert(sit->get());
877 for (
const auto& betaSeed : (*sit)->betaSeeds) { newCandidates.push_back(std::make_shared<Candidate>(betaSeed)); }
882 for (
auto& newCandidate : newCandidates) {
884 newCandidate->betaFitResult =
fitter.fitWithOutlierLogic(newCandidate->hits);
886 << newCandidate->hits.size() <<
" status " << newCandidate->betaFitResult.status <<
" beta "
887 << newCandidate->betaFitResult.beta <<
" chi2/ndof " << newCandidate->betaFitResult.chi2PerDOF());
889 if (newCandidate->betaFitResult.status != 0) {
890 newCandidate->combinedTrack =
nullptr;
898 msg(MSG::INFO) <<
" Summary::createCandidates ";
900 msg(MSG::INFO) <<
" No candidated found ";
905 msg(MSG::INFO) << std::endl
906 <<
" candidate: beta seed " << candidate->betaSeed.beta <<
" beta fit result: beta "
907 << candidate->betaFitResult.beta <<
" chi2/ndof " << candidate->betaFitResult.chi2PerDOF() <<
" layers "
908 << candidate->layerDataVec.size();
909 for (
const auto& layerData : candidate->layerDataVec)
910 msg(MSG::INFO) << std::endl
912 << layerData.maximumDataVec.size();
921 MuonStauRecoTool::LayerDataVec::const_iterator
it,
922 MuonStauRecoTool::LayerDataVec::const_iterator it_end)
const {
931 unsigned int nextensions = 0;
944 if (nextensions == 0)
945 theCandidate = candidate.get();
947 std::shared_ptr<Candidate> newCandidate = std::make_unique<Candidate>(candidate->betaSeed);
950 newCandidates.push_back(newCandidate);
951 theCandidate = newCandidate.get();
959 theCandidate->
hits.insert(theCandidate->
hits.end(), newhits.begin(), newhits.end());
961 usedMaximumData.insert(maximumData.get());
963 ATH_MSG_DEBUG(
" adding maximumData: candidate hits " << theCandidate->
hits.size() <<
" LayerDataVec "
971 ATH_MSG_DEBUG(
" extendCandidates done, new candidates " << newCandidates.size());
992 if (layerData.maximumDataVec.empty())
continue;
994 associatedData.
layerData.push_back(layerData);
997 for (
auto& maximum : layerData.maximumDataVec) {
1002 std::vector<std::shared_ptr<const Muon::MuonSegment>> t0fittedSegments;
1004 if (t0fittedSegments.empty())
continue;
1016 msg(MSG::INFO) <<
" Summary::extractTimeMeasurements ";
1018 msg(MSG::INFO) <<
" No layers associated ";
1020 msg(MSG::INFO) <<
" Associated layers " << associatedData.
layerData.size();
1022 for (
const auto& layerData : associatedData.
layerData) {
1023 unsigned int nmaxWithBeta = 0;
1024 for (
const auto& maximumData : layerData.maximumDataVec) {
1025 if (!maximumData->betaSeeds.empty()) ++nmaxWithBeta;
1027 msg(MSG::INFO) << std::endl
1029 << layerData.maximumDataVec.size() <<
" maxima with beta seeds " << nmaxWithBeta;
1035 return !associatedData.
layerData.empty();
1040 unsigned int nstart =
hits.size();
1046 << std::abs(
beta - seed->beta));
1047 if (std::abs(
beta - seed->beta) >
cut)
return;
1057 float time = rpc.time;
1058 float error = rpc.error;
1067 if (!seg->hasFittedT0())
continue;
1068 float time = seg->time();
1069 float error = seg->errorTime();
1077 float smallestResidual = FLT_MAX;
1079 if (!seg->hasFittedT0())
continue;
1080 float distance = seg->globalPosition().mag();
1081 float time = seg->time();
1087 bestSegment = seg.get();
1097 return nstart !=
hits.size();
1110 float chi2ndof =
result.chi2PerDOF();
1112 ATH_MSG_DEBUG(
" fitting beta for maximum: time measurements " <<
hits.size() <<
" status " <<
result.status <<
" beta "
1113 <<
result.beta <<
" chi2/ndof " << chi2ndof);
1118 std::vector<std::shared_ptr<const Muon::MuonSegment>>& segments,
1119 const ToolHandle<Muon::IMuonPRDSelectionTool>& muonPRDSelectionTool,
1120 const ToolHandle<Muon::IMuonSegmentMaker>& segmentMaker)
const {
1122 const std::vector<std::shared_ptr<const Muon::MuonClusterOnTrack>>& phiClusterOnTracks = maximumData.
phiClusterOnTracks;
1126 std::vector<const Muon::MdtDriftCircleOnTrack*>& mdts) {
1128 if (mdt) mdts.push_back(mdt);
1133 std::vector<const Muon::MuonClusterOnTrack*>&
clusters) {
1135 if (cluster)
clusters.push_back(cluster);
1139 std::vector<const Muon::MdtDriftCircleOnTrack*> mdts;
1140 std::vector<const Muon::MuonClusterOnTrack*>
clusters;
1143 clusters.reserve(phiClusterOnTracks.size());
1145 for (
const auto& phiClusterOnTrack : phiClusterOnTracks) {
clusters.push_back(phiClusterOnTrack->clone()); }
1149 MuonHough::HitVec::const_iterator hit = maximum.
hits.begin();
1150 MuonHough::HitVec::const_iterator hit_end = maximum.
hits.end();
1151 for (; hit != hit_end; ++hit) {
1152 ATH_MSG_DEBUG(
"hit x,y_min,y_max,w = " << (*hit)->x <<
"," << (*hit)->ymin <<
"," << (*hit)->ymax <<
"," << (*hit)->w);
1155 for (
const auto& prd : (*hit)->tgc->etaCluster) handleCluster(*prd,
clusters);
1156 }
else if ((*hit)->prd) {
1174 if (mdts.size() > 2) {
1182 for (; sit != sit_end; ++sit) {
1186 segments.push_back(std::shared_ptr<const Muon::MuonSegment>(mseg));
1191 for (
const auto* hit : mdts)
delete hit;
1192 for (
const auto* hit :
clusters)
delete hit;
1199 std::map<Identifier, std::vector<const Muon::RpcPrepData*>> rpcPrdsPerChamber;
1206 rpcPrdsPerChamber[chamberId].push_back(rpcPrd);
1211 MuonHough::HitVec::const_iterator hit = maximum.
hits.begin();
1212 MuonHough::HitVec::const_iterator hit_end = maximum.
hits.end();
1213 for (; hit != hit_end; ++hit) {
1214 if ((*hit)->tgc || !(*hit)->prd || !
m_idHelperSvc->isRpc((*hit)->prd->identify()))
continue;
1215 addRpc((*hit)->prd);
1219 for (
const auto& rot : maximumData.
phiClusterOnTracks) { addRpc(rot->prepRawData()); }
1222 if (rpcPrdsPerChamber.empty())
return;
1224 std::map<Identifier, std::vector<const Muon::RpcPrepData*>>
::iterator chit = rpcPrdsPerChamber.begin();
1225 std::map<Identifier, std::vector<const Muon::RpcPrepData*>>
::iterator chit_end = rpcPrdsPerChamber.end();
1226 for (; chit != chit_end; ++chit) {
1229 if (!clustering.
cluster(chit->second)) {
1235 <<
" eta clusters " << clustering.
clustersEta.size() <<
" phi clusters " << clustering.
clustersPhi.size());
1242 const std::vector<Muon::RpcClusterObj>& clusterObjects,
1245 for (
const auto& cluster : clusterObjects) {
1246 if (cluster.hitList.empty() || !cluster.hitList.front()) {
1251 << cluster.hitList.size());
1254 std::vector<const Muon::MuonClusterOnTrack*>
clusters;
1255 for (
const auto* rpc : cluster.hitList) {
1272 if (rcl) rpcTimeMeasurement.
rpcClusters.push_back(std::shared_ptr<const Muon::RpcClusterOnTrack>(rcl));
1274 rpcTimeMeasurements.push_back(rpcTimeMeasurement);
1294 if (!houghDataPerSectorVec.isValid()) {
1300 if (
static_cast<int>(houghDataPerSectorVec->vec.size()) <= sector - 1) {
1302 <<
" larger than the available sectors in the Hough tool: " << houghDataPerSectorVec->vec.size());
1311 if (houghDataPerSector.
maxVec.size() <= sectorLayerHash) {
1312 ATH_MSG_WARNING(
" houghDataPerSector.maxVec.size() smaller than hash " << houghDataPerSector.
maxVec.size() <<
" hash "
1313 << sectorLayerHash);
1317 if (maxVec.empty())
return;
1323 float phi =
intersection.trackParameters->position().phi();
1329 float errx =
intersection.trackParameters->covariance() ?
1331 float x = barrelLike ?
z :
r;
1332 float y = barrelLike ?
r :
z;
1333 float theta = std::atan2(
y,
x);
1337 ATH_MSG_DEBUG(
" Got Phi Hough maxima " << phiMaxVec.size() <<
" phi " << phi);
1341 std::vector<std::shared_ptr<const Muon::MuonClusterOnTrack>>&
clusters) {
1343 if (cluster)
clusters.push_back(std::move(cluster));
1348 std::vector<std::shared_ptr<const Muon::MuonClusterOnTrack>> phiClusterOnTracks;
1349 Muon::MuonLayerHoughTool::PhiMaximumVec::const_iterator pit = phiMaxVec.begin();
1350 Muon::MuonLayerHoughTool::PhiMaximumVec::const_iterator pit_end = phiMaxVec.end();
1351 for (; pit != pit_end; ++pit) {
1353 for (
const std::shared_ptr<MuonHough::PhiHit>& hit : maximum.
hits) {
1369 <<
"," <<
y <<
") errorx " << errx <<
" "
1370 <<
" angle " << theta);
1373 for (
const auto& mit : maxVec) {
1375 if (std::find_if(maximum.
hits.begin(),maximum.
hits.end(),
1376 [](
const std::shared_ptr<MuonHough::Hit>& hit){
1377 return hit->prd && (hit->prd->type(Trk::PrepRawDataType::sTgcPrepData) ||
1378 hit->prd->type(Trk::PrepRawDataType::MMPrepData));
1379 }) != maximum.
hits.end())
continue;
1381 float residualTheta = maximum.
theta - theta;
1388 const float pullUncert = std::sqrt(errx * errx + maxwidth * maxwidth / 12.);
1389 float pull =
residual / (pullUncert > std::numeric_limits<float>::epsilon() ? pullUncert : 1.) ;
1392 <<
" pull " <<
pull <<
" angle " << maximum.
theta <<
" residual " << residualTheta);
1397 if (std::abs(
pull) > 5)
continue;
1415 return std::abs(
beta) > 0 ? dist * inverseSpeedOfLight /
beta : 1.e12;
1420 return time != 0. ? dist * inverseSpeedOfLight / time : 20.;
1425 ATH_MSG_WARNING(
"You are calling the non thread-safe MuonRecoValidationTool with multiple threads, will most likely crash");
1433 float chi2ndof = -1.;
1434 if (candidate->finalBetaFitResult.status != 0) {
1435 ntimes = candidate->stauHits.size();
1436 beta = candidate->finalBetaFitResult.beta;
1437 chi2ndof = candidate->finalBetaFitResult.chi2PerDOF();
1438 }
else if (candidate->betaFitResult.status != 0) {
1439 ntimes = candidate->hits.size();
1440 beta = candidate->betaFitResult.beta;
1441 chi2ndof = candidate->betaFitResult.chi2PerDOF();
1444 beta = candidate->betaSeed.beta;
1447 if (candidate->combinedTrack)
ATH_MSG_DEBUG(
"candidate has combined track");
1448 m_recoValidationTool->addMuonCandidate(indetTrackParticle, candidate->muonCandidate.get(), candidate->combinedTrack.get(),