16 cut_(params.getParameter<std::
string>(
"cut")) {
18 leptons_.push_back(consumes<reco::CandidateView>(
tag));
20 produces<std::vector<pat::IsolatedTrack>>();
26 auto out = std::make_unique<std::vector<pat::IsolatedTrack>>();
28 std::vector<reco::CandidatePtr> leptonPfCands;
32 for (
const auto& lep : *leptons) {
33 for (
unsigned int i = 0,
n = lep.numberOfSourceCandidatePtrs();
i <
n; ++
i) {
34 auto ptr = lep.sourceCandidatePtr(
i);
36 leptonPfCands.push_back(ptr);
40 std::sort(leptonPfCands.begin(), leptonPfCands.end());
44 for (
const auto&
track : *tracks) {
47 if (
track.packedCandRef().isNonnull()) {
49 if (std::binary_search(leptonPfCands.begin(), leptonPfCands.end(), pfCand)) {
62 std::vector<edm::EDGetTokenT<reco::CandidateView>>
leptons_;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
IsolatedTrackCleaner(edm::ParameterSet const ¶ms)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
auto const & tracks
cannot be loose
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::EDGetTokenT< std::vector< pat::IsolatedTrack > > tracks_
StringCutObjectSelector< pat::IsolatedTrack > cut_
T getParameter(std::string const &) const
~IsolatedTrackCleaner() override
std::vector< edm::EDGetTokenT< reco::CandidateView > > leptons_