53 maxDR2ToClean_(
pow2(iConfig.getParameter<double>(
"maxDRToClean"))) {
54 produces<std::vector<edm::Ptr<reco::Candidate>>>();
66 const std::vector<std::pair<float, float>>& etaPhisToMatch,
68 const float candEta =
cand.eta();
69 const float candPhi =
cand.phi();
70 for (
const auto& etaPhi : etaPhisToMatch) {
71 if (
reco::deltaR2(candEta, candPhi, etaPhi.first, etaPhi.second) <= maxDR2) {
83 auto outColl = std::make_unique<std::vector<edm::Ptr<reco::Candidate>>>();
88 std::vector<std::pair<float, float>> coll1EtaPhis;
89 for (
size_t objNr = 0; objNr < coll1Handle->size(); objNr++) {
91 coll1EtaPhis.push_back({objPtr->
eta(), objPtr->
phi()});
94 for (
size_t objNr = 0; objNr < coll2Handle->size(); objNr++) {
109 desc.add<
double>(
"maxDRToClean", 0.05);
110 descriptions.
add(
"candMergerCleanOthersByDR",
desc);
const edm::EDGetTokenT< edm::View< reco::Candidate > > coll2Token_
const edm::EDGetTokenT< edm::View< reco::Candidate > > coll1Token_
constexpr int pow2(int x)
const float maxDR2ToClean_
CandMergerCleanOthersByDR(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
~CandMergerCleanOthersByDR() override
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity