|
|
Go to the documentation of this file.
29 #include <unordered_map>
44 template <
class T,
class U>
45 bool isInFootprint(
const T& thefootprint,
const U& theCandidate) {
46 for (
auto itr = thefootprint.begin(); itr != thefootprint.end(); ++itr) {
47 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")),
107 "PhotonPFIsolationWithMapBasedVeto");
119 bool inFootprint =
false;
121 const float deltar2 =
125 if (aspacked.
get()) {
126 inFootprint = isInFootprint(aspat_photonptr->associatedPackedPFCandidates(), aspacked);
129 if (aspacked->charge() != 0) {
130 bool is_vertex_allowed =
false;
133 is_vertex_allowed =
true;
138 result &= (is_vertex_allowed);
154 throw cms::Exception(
"InvalidIsolationInput") <<
"The supplied candidate to be used as isolation "
155 <<
"was neither a reco::Photon nor a pat::Photon!";
edm::Ptr< pat::PackedCandidate > PackedCandidatePtr
edm::Ptr< pat::Photon > patPhotonPtr
PhotonPFIsolationWithMapBasedVeto & operator=(const PhotonPFIsolationWithMapBasedVeto &)=delete
const edm::InputTag _particleBasedIsolation
T const * get() const
Returns C++ pointer to the item.
#define DEFINE_EDM_PLUGIN(factory, type, name)
edm::Ptr< reco::Photon > recoPhotonPtr
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
bool isInIsolationCone(const reco::CandidatePtr &photon, const reco::CandidatePtr &pfCandidate) const final
edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationToken_
const unsigned _vertexIndex
const std::vector< unsigned > _miniAODVertexCodes
PhotonPFIsolationWithMapBasedVeto(const edm::ParameterSet &c)
edm::Handle< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationMap
const std::string _isolateAgainst
bool isNonnull() const
Checks for non-null.
~PhotonPFIsolationWithMapBasedVeto() override
Destructor.
void getEventInfo(const edm::Event &iEvent) override
void setConsumes(edm::ConsumesCollector iC) override
const std::string _vertexCollection
IsolationConeDefinitionBase(const edm::ParameterSet &c)