22 : collectionCloner(producesCollector(), iConfig,
true),
23 collectionClonerTokens(iConfig.getParameter<
edm::
InputTag>(
"track"), consumesCollector()),
26 flag_copyMVA(iConfig.getParameter<
bool>(
"copyMVA")) {
27 produces<MVACollection>(
"MVAValues");
37 desc.
add<
bool>(
"copyMVA",
false);
39 descriptions.
add(
"HLTMuonTrackSelector", desc);
52 auto nMuon = handle_muon->size();
58 assert((*handle_originalMVAVals).size() == nTrack);
62 std::vector<unsigned int> selectedIter;
63 auto selectedMVAVals = std::make_unique<MVACollection>();
72 for (
auto i_mu = 0
U; i_mu < nMuon; ++i_mu) {
75 TrackRef muonTrackRef = (
muon.innerTrack().isNonnull()) ?
muon.innerTrack() :
muon.muonBestTrack();
77 double muonPt = muonTrackRef->pt();
78 double muonEta = muonTrackRef->eta();
79 double muonPhi = muonTrackRef->phi();
81 double smallestDPt = 1e30;
82 unsigned int smallestDPtIter = 9999
U;
85 for (
auto i_trk = 0
U; i_trk < nTrack; ++i_trk) {
95 if (dPt < smallestDPt) {
97 smallestDPtIter = i_trk;
103 if (smallestDPtIter != 9999
U) {
104 selectedIter.push_back(smallestDPtIter);
106 selectedMVAVals->push_back((*handle_originalMVAVals)[smallestDPtIter]);