|
|
Go to the documentation of this file.
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!";
edm::Ptr< pat::PackedCandidate > PackedCandidatePtr
bool isInIsolationCone(const reco::CandidatePtr &photon, const reco::CandidatePtr &other) const final
const std::vector< unsigned > _miniAODVertexCodes
const std::string _isolateAgainst
edm::RefVector< pat::PackedCandidateCollection > associatedPackedPFCandidates() const
References to PFCandidates linked to this object (e.g. for isolation vetos or masking before jet recl...
T const * get() const
Returns C++ pointer to the item.
edm::Handle< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationMap
const edm::InputTag _particleBasedIsolation
~ElectronPFIsolationWithMapBasedVeto() override
Destructor.
ElectronPFIsolationWithMapBasedVeto(const edm::ParameterSet &c)
#define DEFINE_EDM_PLUGIN(factory, type, name)
ElectronPFIsolationWithMapBasedVeto & operator=(const ElectronPFIsolationWithMapBasedVeto &)=delete
edm::Ptr< reco::GsfElectron > GsfElectronPtr
void setConsumes(edm::ConsumesCollector iC) override
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationToken_
std::vector< std::pair< float, float > >::iterator itr
const std::string _vertexCollection
void getEventInfo(const edm::Event &iEvent) override
edm::Ptr< pat::Electron > patElectronPtr
IsolationConeDefinitionBase(const edm::ParameterSet &c)