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;
114 "PhotonPFIsolationWithMapBasedVeto");
128 bool inFootprint =
false;
133 if ( aspacked.
get() )
135 inFootprint =
isInFootprint(aspat_photonptr ->associatedPackedPFCandidates(),aspacked);
138 if( aspacked->charge() != 0 )
140 bool is_vertex_allowed =
false;
144 is_vertex_allowed =
true;
149 result &= (is_vertex_allowed);
152 result &= deltar2 <
_coneSize2 && (!inFootprint);
160 result &= deltar2 <
_coneSize2 && (!inFootprint);
167 <<
"The supplied candidate to be used as isolation "
168 <<
"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)
const std::string _vertexCollection
virtual void getEventInfo(const edm::Event &iEvent)
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
PhotonPFIsolationWithMapBasedVeto(const edm::ParameterSet &c)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
edm::Ptr< pat::Photon > patPhotonPtr
#define DEFINE_EDM_PLUGIN(factory, type, name)