31 #include <unordered_map> 45 template <
class T,
class U>
46 bool isInFootprint(
const T& thefootprint,
const U& theCandidate) {
47 for (
auto itr = thefootprint.begin(); itr != thefootprint.end(); ++itr) {
48 if (itr->key() == theCandidate.key())
56 template <
class T,
class U>
57 bool isInFootprintAlternative(
const T& thefootprint,
const U& theCandidate) {
58 for (
auto itr = thefootprint.begin(); itr != thefootprint.end(); ++itr) {
59 if (itr->key() == theCandidate->sourceCandidatePtr(0).key())
72 "miniAODVertexCodes")),
106 "ElectronPFIsolationWithMapBasedVeto");
118 bool inFootprint =
false;
120 const float deltar2 =
124 if (aspacked.
get()) {
128 if (aspacked->charge() != 0) {
129 bool is_vertex_allowed =
false;
131 if (vtxtype == aspacked->fromPV()) {
132 is_vertex_allowed =
true;
137 result &= (is_vertex_allowed);
144 else if (aspf.
get()) {
152 throw cms::Exception(
"InvalidIsolationInput") <<
"The supplied candidate to be used as isolation " 153 <<
"was neither a reco::Photon nor a pat::Photon!";
IsolationConeDefinitionBase(const edm::ParameterSet &c)
bool isInIsolationCone(const reco::CandidatePtr &photon, const reco::CandidatePtr &other) const final
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
const std::vector< unsigned > _miniAODVertexCodes
const std::string _isolateAgainst
edm::Handle< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationMap
const edm::InputTag _particleBasedIsolation
edm::Ptr< reco::GsfElectron > GsfElectronPtr
edm::RefVector< pat::PackedCandidateCollection > associatedPackedPFCandidates() const
References to PFCandidates linked to this object (e.g. for isolation vetos or masking before jet recl...
edm::Ptr< pat::Electron > patElectronPtr
edm::Ptr< pat::PackedCandidate > PackedCandidatePtr
~ElectronPFIsolationWithMapBasedVeto() override
Destructor.
ElectronPFIsolationWithMapBasedVeto(const edm::ParameterSet &c)
void setConsumes(edm::ConsumesCollector iC) override
ElectronPFIsolationWithMapBasedVeto & operator=(const ElectronPFIsolationWithMapBasedVeto &)=delete
edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationToken_
T const * get() const
Returns C++ pointer to the item.
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void getEventInfo(const edm::Event &iEvent) override
const std::string _vertexCollection
#define DEFINE_EDM_PLUGIN(factory, type, name)