27 vetoSrcToken_{consumes<edm::View<reco::Candidate>>(
iConfig.getParameter<
edm::InputTag>(
"veto"))},
28 useDeltaRforFootprint_(
iConfig.getParameter<
bool>(
"useDeltaRforFootprint")),
29 extendVetoBySingleSourcePtr_(
iConfig.getParameter<
bool>(
"extendVetoBySingleSourcePtr")) {
30 produces<edm::PtrVector<reco::Candidate>>();
38 auto result = std::make_unique<PtrVector<reco::Candidate>>();
39 std::set<reco::CandidatePtr> vetoedPtrs;
40 for (
auto const&
veto : *vetoes) {
41 auto const n =
veto.numberOfSourceCandidatePtrs();
42 for (
size_t j{};
j <
n; ++
j) {
43 vetoedPtrs.insert(
veto.sourceCandidatePtr(
j));
49 for (
size_t i{};
i <
cands->size(); ++
i) {
51 if (vetoedPtrs.find(
c) == vetoedPtrs.cend()) {
54 addcand = (vetoedPtrs.find(
c->sourceCandidatePtr(0)) == vetoedPtrs.cend());
56 for (
const auto& it : vetoedPtrs)
57 if (it.isNonnull() && it.isAvailable() &&
reco::deltaR2(*it, *
c) < 0.00000025) {
72 desc.
add<
bool>(
"useDeltaRforFootprint",
false);
73 desc.
add<
bool>(
"extendVetoBySingleSourcePtr",
true);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EventSetup & c
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bool extendVetoBySingleSourcePtr_
edm::EDGetTokenT< edm::View< reco::Candidate > > vetoSrcToken_
bool useDeltaRforFootprint_
CandPtrProjector(edm::ParameterSet const &iConfig)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< edm::View< reco::Candidate > > candSrcToken_
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
T getParameter(std::string const &) const
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const override