32 #include <unordered_map>
46 template <
class T,
class U>
49 for (
auto itr = thefootprint.begin(); itr != thefootprint.end(); ++itr )
51 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;
112 "ElectronPFIsolationWithMapBasedVeto");
126 bool inFootprint =
false;
131 if ( aspacked.
get() )
133 inFootprint =
isInFootprint(aspat_electronptr ->associatedPackedPFCandidates(),aspacked);
136 if( aspacked->charge() != 0 )
138 bool is_vertex_allowed =
false;
141 if( vtxtype == aspacked->fromPV() ) {
142 is_vertex_allowed =
true;
147 result &= (is_vertex_allowed);
150 result &= deltar2 <
_coneSize2 && (!inFootprint);
154 else if ( aspf.
get())
158 result &= deltar2 <
_coneSize2 && (!inFootprint);
164 <<
"The supplied candidate to be used as isolation "
165 <<
"was neither a reco::Photon nor a pat::Photon!";
virtual void getEventInfo(const edm::Event &iEvent)
IsolationConeDefinitionBase(const edm::ParameterSet &c)
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::vector< unsigned > _miniAODVertexCodes
T const * get() const
Returns C++ pointer to the item.
const std::string _isolateAgainst
bool isInIsolationCone(const reco::CandidatePtr &photon, const reco::CandidatePtr &other) const overridefinal
edm::Handle< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationMap
edm::Ptr< reco::GsfElectron > GsfElectronPtr
edm::Ptr< pat::Electron > patElectronPtr
edm::Ptr< pat::PackedCandidate > PackedCandidatePtr
void setConsumes(edm::ConsumesCollector iC)
edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationToken_
ElectronPFIsolationWithMapBasedVeto(const edm::ParameterSet &c)
bool isInFootprint(const T &thefootprint, const U &theCandidate)
double deltaR2(const T1 &t1, const T2 &t2)
ElectronPFIsolationWithMapBasedVeto & operator=(const ElectronPFIsolationWithMapBasedVeto &)=delete
const std::string _vertexCollection
virtual ~ElectronPFIsolationWithMapBasedVeto()
Destructor.
#define DEFINE_EDM_PLUGIN(factory, type, name)