![]() |
![]() |
Go to the source code of this file.
Functions | |
template<typename Reference , typename Association > | |
std::pair< typename Association::data_type::first_type, double > | match (Reference key, Association association, bool bestMatchByMaxValue) |
Generic matching function. |
std::pair<typename Association::data_type::first_type, double> match | ( | Reference | key, |
Association | association, | ||
bool | bestMatchByMaxValue | ||
) |
Generic matching function.
Definition at line 6 of file Utils.h.
References i, pos, lumiQueryAPI::q, edm::second(), and relativeConstraints::value.
Referenced by optutl::CommandLineParser::_finishDefaultOptions(), DTTFFEDReader::analyse(), ZHistogrammer::analyze(), ValidationHcalIsoTrackAlCaReco::analyze(), SiPixelHitEfficiencySource::analyze(), SiPixelTrackResidualSource::analyze(), DQMHcalIsoTrackAlCaReco::analyze(), DebugZMCTruth::analyze(), SiPixelTrackingRecHitsValid::analyze(), RPCRecHitValid::analyze(), CalibAnalyzer< Ref, Rec, Alg >::analyze(), SiPixelRecHitSource::analyze(), ZMCHistogrammer::analyze(), RPCPointVsRecHit::analyze(), TkConvValidator::analyze(), VertexAssociatorByTracks::associateRecoToSim(), VertexAssociatorByTracks::associateSimToReco(), Comparison< Ref, RefQualifier, Rec, RecQualifier, Alg >::book(), JetPartonMatching::calculate(), checkHLTMatch(), MuonTrajectoryCleaner::clean(), Digi2Raw2Digi::compare(), L1Comparator::compareCollections(), DEcompare< T >::CompareCollections(), L1Comparator::CompareCollections(), GtPsbTextToDigi::endJob(), L1GctLut< NAddressBits, NDataBits >::equalityCheck(), TrackHistory::evaluate(), VertexHistory::evaluate(), PFCandidateManager::fill(), PFCandidateMonitor::fill(), PFJetMonitor::fill(), L1TDTTF::fillMEs(), reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >::filter(), pat::GenericOverlapFinder< Distance >::find(), StringMap::find(), muonid::findOppositeTrack(), pat::PATObject< ObjectType >::getKinResolution(), helper::getRange(), TrackDetectorAssociator::getTAMuonChamberMatches(), pat::PATObject< ObjectType >::hasKinResolution(), pat::TriggerObjectStandAlone::hasPathOrAlgorithm(), triggerExpression::HLTReader::init(), triggerExpression::L1TechReader::init(), triggerExpression::L1Reader::init(), HLTHighLevel::init(), IsoDepositVetoFactory::make(), PFBenchmarkAlgo::matchByDeltaEt(), PFBenchmarkAlgo::matchByDeltaR(), FWCaloTowerSliceSelector::matchCell(), JetPartonMatching::matchingPtOrderedMinDist(), ConversionProducer::matchingSC(), JetPartonMatching::matchingTotalMinDist(), JetPartonMatching::matchingUnambiguousOnly(), AlignmentGlobalTrackSelector::matchTracks(), JetPartonMatching::minSumDist_recursion(), FWDetailViewManager::openDetailViewFor(), Comparison< Ref, RefQualifier, Rec, RecQualifier, Alg >::operator()(), MatchJet::operator()(), StringMap::operator[](), MuonIdProducer::overlap(), pat::PATObject< ObjectType >::overlaps(), reco::modules::TrackerTrackHitFilter::parseStoN(), CandOneToManyDeltaRMatcher::produce(), MCTrackMatcher::produce(), reco::modules::CosmicTrackSelector::produce(), cms::SimpleTrackListMerger::produce(), TtSemiLepHypothesis::produce(), pat::PATJetProducer::produce(), reco::modules::TrackMultiSelector::produce(), reco::PhysObjectMatcher< C1, C2, S, D, Q >::produce(), reco::modules::AnalyticalTrackSelector::produce(), reco::modules::MatcherBase< C1, C2, M >::produce(), reco::modules::TrackFullCloneSelectorBase< Selector >::produce(), GenTrackMatcher::produce(), reco::modulesNew::Matcher< C1, C2, S, D >::produce(), pat::PATTriggerMatchEmbedder< PATObjectType >::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), TtJetPartonMatch< C >::produce(), TtSemiLepJetCombGeom::produce(), TtSemiLepKinFitProducer< LeptonCollection >::produce(), TtFullHadHypothesis::produce(), TtFullLepHypothesis::produce(), MCTruthCompositeMatcher< C1, C2 >::produce(), TtFullHadKinFitProducer::produce(), reco::modules::TrackerTrackHitFilter::Rule::Rule(), pf2pat::ElectronIDPFCandidateSelectorDefinition::select(), L1TDTTFClient::setGMTsummary(), pat::PATObject< ObjectType >::setKinResolution(), TtFullHadKinFitter::KinFit::setMatch(), pat::PATObject< ObjectType >::setOverlaps(), DEcompare< T >::SortCollections(), and reco::parser::ExpressionVar::trueDelete().
{ typename Association::data_type::first_type value; typename Association::const_iterator pos = association.find(key); if (pos == association.end()) return std::pair<typename Association::data_type::first_type, double> (value, 0); const std::vector<typename Association::data_type> & matches = pos->val; double q = bestMatchByMaxValue ? -1e30 : 1e30; for (std::size_t i = 0; i < matches.size(); ++i) if (bestMatchByMaxValue ? (matches[i].second > q) : (matches[i].second < q)) { value = matches[i].first; q = matches[i].second; } return std::pair<typename Association::data_type::first_type, double> (value, q); }