30 #include <unordered_map>
45 template <
class T,
class U>
48 for (
auto itr = thefootprint.begin(); itr != thefootprint.end(); ++itr )
50 if( itr->key() == theCandidate.key() )
return true;
58 template <
class T,
class U>
59 bool isInFootprintAlternative(
const T& thefootprint,
const U& theCandidate)
61 for (
auto itr = thefootprint.begin(); itr != thefootprint.end(); ++itr )
63 if( itr->key() == theCandidate->sourceCandidatePtr(0).key() )
return true;
116 "PhotonPFIsolationWithMapBasedVeto");
130 bool inFootprint =
false;
135 if ( aspacked.
get() )
137 inFootprint =
isInFootprint(aspat_photonptr ->associatedPackedPFCandidates(),aspacked);
140 if( aspacked->charge() != 0 )
142 bool is_vertex_allowed =
false;
146 is_vertex_allowed =
true;
151 result &= (is_vertex_allowed);
154 result &= deltar2 <
_coneSize2 && (!inFootprint);
162 result &= deltar2 <
_coneSize2 && (!inFootprint);
169 <<
"The supplied candidate to be used as isolation "
170 <<
"was neither a reco::Photon nor a pat::Photon!";
IsolationConeDefinitionBase(const edm::ParameterSet &c)
virtual ~PhotonPFIsolationWithMapBasedVeto()
Destructor.
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
T const * get() const
Returns C++ pointer to the item.
const std::vector< unsigned > _miniAODVertexCodes
bool isInIsolationCone(const reco::CandidatePtr &photon, const reco::CandidatePtr &pfCandidate) const overridefinal
edm::Handle< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationMap
const std::string _isolateAgainst
edm::Ptr< pat::PackedCandidate > PackedCandidatePtr
void setConsumes(edm::ConsumesCollector iC) override
const std::string _vertexCollection
bool isInFootprint(const T &thefootprint, const U &theCandidate)
edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationToken_
PhotonPFIsolationWithMapBasedVeto & operator=(const PhotonPFIsolationWithMapBasedVeto &)=delete
bool isNonnull() const
Checks for non-null.
edm::Ptr< reco::Photon > recoPhotonPtr
const unsigned _vertexIndex
const edm::InputTag _particleBasedIsolation
PhotonPFIsolationWithMapBasedVeto(const edm::ParameterSet &c)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
edm::Ptr< pat::Photon > patPhotonPtr
virtual void getEventInfo(const edm::Event &iEvent) override
#define DEFINE_EDM_PLUGIN(factory, type, name)