26 #include <unordered_map> 39 citk::IsolationConeDefinitionBase(c),
40 _vetoConeSize2EB(
std::
pow(c.getParameter<double>(
"VetoConeSizeBarrel"),2.0)),
41 _vetoConeSize2EE(
std::
pow(c.getParameter<double>(
"VetoConeSizeEndcaps"),2.0)),
42 _miniAODVertexCodes(c.getParameter<
std::vector<unsigned> >(
"miniAODVertexCodes")),
43 _isolateAgainst(c.getParameter<
std::
string>(
"isolateAgainst")) {
45 sprintf(buf,
"BarVeto%.2f-EndVeto%.2f",
49 auto decimal = _additionalCode.find(
'.');
50 while( decimal != std::string::npos ) {
51 _additionalCode.erase(decimal,1);
52 decimal = _additionalCode.find(
'.');
67 const float _vetoConeSize2EB, _vetoConeSize2EE;
75 "ElectronPFIsolationWithConeVeto");
84 bool isEB = ( seed->seed().subdetId() ==
EcalBarrel );
86 const float vetoConeSize2 = ( isEB ? _vetoConeSize2EB : _vetoConeSize2EE );
89 if( aspacked->
charge() != 0 ) {
90 bool is_vertex_allowed =
false;
91 for(
const unsigned vtxtype : _miniAODVertexCodes ) {
92 if( vtxtype == aspacked->
fromPV() ) {
93 is_vertex_allowed =
true;
97 result = result && ( is_vertex_allowed );
99 result = result && ( deltar2 > vetoConeSize2 && deltar2 < _coneSize2 );
101 result = result && ( deltar2 > vetoConeSize2 && deltar2 < _coneSize2 );
104 <<
"The supplied candidate to be used as isolation " 105 <<
"was neither a reco::PFCandidate nor a pat::PackedCandidate!";
const std::string _isolateAgainst
T const * get() const
Returns C++ pointer to the item.
edm::EDGetTokenT< reco::VertexCollection > _vtxToken
edm::Ptr< reco::GsfElectron > GsfElectronPtr
edm::Ptr< pat::PackedCandidate > PackedCandidatePtr
int charge() const override
electric charge
const PVAssoc fromPV(size_t ipv=0) const
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
bool isInIsolationCone(const reco::CandidatePtr &physob, const reco::CandidatePtr &other) const override final
ElectronPFIsolationWithConeVeto(const edm::ParameterSet &c)
bool isNonnull() const
Checks for non-null.
void setConsumes(edm::ConsumesCollector) override
virtual ~ElectronPFIsolationWithConeVeto()
Destructor.
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
const std::vector< unsigned > _miniAODVertexCodes
#define DEFINE_EDM_PLUGIN(factory, type, name)
Power< A, B >::type pow(const A &a, const B &b)