50 double pow2(
double val){
return val*
val;}
58 produces<std::vector<edm::Ptr<reco::Candidate> > >();
70 bool hasDRMatch(
const reco::Candidate&
cand,
const std::vector<std::pair<float,float> >& etaPhisToMatch,
const float maxDR2)
72 const float candEta = cand.
eta();
73 const float candPhi = cand.
phi();
74 for(
const auto& etaPhi : etaPhisToMatch){
75 if(
reco::deltaR2(candEta,candPhi,etaPhi.first,etaPhi.second)<=maxDR2){
87 auto outColl = std::make_unique<std::vector<edm::Ptr<reco::Candidate> > >();
92 std::vector<std::pair<float,float> > coll1EtaPhis;
93 for(
size_t objNr=0;objNr<coll1Handle->size();objNr++){
95 coll1EtaPhis.push_back({objPtr->
eta(),objPtr->
phi()});
98 for(
size_t objNr=0;objNr<coll2Handle->size();objNr++){
115 desc.
add<
double>(
"maxDRToClean", 0.05);
116 descriptions.
add(
"candMergerCleanOthersByDR", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< edm::View< reco::Candidate > > coll2Token_
#define DEFINE_FWK_MODULE(type)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const edm::EDGetTokenT< edm::View< reco::Candidate > > coll1Token_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const float maxDR2ToClean_
CandMergerCleanOthersByDR(const edm::ParameterSet &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
virtual double eta() const =0
momentum pseudorapidity
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
~CandMergerCleanOthersByDR()
virtual double phi() const =0
momentum azimuthal angle