23 : collectionCloner(producesCollector(), iConfig,
true),
24 collectionClonerTokens(iConfig.getParameter<
edm::
InputTag>(
"track"), consumesCollector()),
27 flag_copyMVA(iConfig.getParameter<
bool>(
"copyMVA")) {
28 produces<MVACollection>(
"MVAValues");
36 desc.add<
bool>(
"copyMVA",
false);
38 descriptions.
add(
"HLTMuonTrackSelector",
desc);
51 auto nMuon = handle_muon->size();
61 std::vector<unsigned int> selectedIter;
62 auto selectedMVAVals = std::make_unique<MVACollection>();
71 for (
auto i_mu = 0
U; i_mu < nMuon; ++i_mu) {
74 TrackRef muonTrackRef = (
muon.innerTrack().isNonnull()) ?
muon.innerTrack() :
muon.muonBestTrack();
76 double muonPt = muonTrackRef->pt();
77 double muonEta = muonTrackRef->eta();
78 double muonPhi = muonTrackRef->phi();
80 double smallestDPt = 1e30;
81 unsigned int smallestDPtIter = 9999
U;
84 for (
auto i_trk = 0
U; i_trk <
nTrack; ++i_trk) {
94 if (dPt < smallestDPt) {
96 smallestDPtIter = i_trk;
102 if (smallestDPtIter != 9999
U) {
103 selectedIter.push_back(smallestDPtIter);
105 selectedMVAVals->push_back((*handle_originalMVAVals)[smallestDPtIter]);
const TrackCollectionCloner::Tokens collectionClonerTokens
const edm::EDGetTokenT< std::vector< reco::Muon > > token_muon
static void fill(edm::ParameterSetDescription &desc)
static void fillDescriptions(edm::ConfigurationDescriptions &)
const edm::EDGetTokenT< MVACollection > token_originalMVAVals
#define DEFINE_FWK_MODULE(type)
HLTMuonTrackSelector(const edm::ParameterSet &)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void add(std::string const &label, ParameterSetDescription const &psetDescription)
reco::TrackCollection const & tracks(edm::Event &evt) const
TrackCollectionCloner collectionCloner
std::vector< float > MVACollection