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();
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]);
const TrackCollectionCloner::Tokens collectionClonerTokens
const edm::EDGetTokenT< std::vector< reco::Muon > > token_muon
~HLTMuonTrackSelector() override
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
void add(std::string const &label, ParameterSetDescription const &psetDescription)
reco::TrackCollection const & tracks(edm::Event &evt) const
TrackCollectionCloner collectionCloner
std::vector< float > MVACollection