16 citk::IsolationConeDefinitionBase(c),
17 _vetoThreshold(c.getParameter<double>(
"VetoThreshold")),
18 _vetoConeSize2(
std::
pow(c.getParameter<double>(
"VetoConeSize"),2.0)),
19 _miniAODVertexCodes(c.getParameter<
std::vector<unsigned> >(
"miniAODVertexCodes"))
22 snprintf(buf,49,
"ThresholdVeto%03.0f-ConeVeto%03.0f", 100*_vetoThreshold, 100*
std::sqrt(_vetoConeSize2));
37 const double _vetoThreshold, _vetoConeSize2;
44 "MuonPFIsolationWithConeVeto");
54 if( aspacked->
charge() != 0 ) {
55 bool is_vertex_allowed =
false;
56 for(
const unsigned vtxtype : _miniAODVertexCodes ) {
57 if( vtxtype == aspacked->
fromPV() ) {
58 is_vertex_allowed =
true;
62 result *= ( is_vertex_allowed );
64 result *= aspacked->
pt() > _vetoThreshold && deltar2 > _vetoConeSize2 && deltar2 < _coneSize2 ;
66 result *= aspf->pt() > _vetoThreshold && deltar2 > _vetoConeSize2 && deltar2 < _coneSize2 ;
69 <<
"The supplied candidate to be used as isolation " 70 <<
"was neither a reco::PFCandidate nor a pat::PackedCandidate!";
void setConsumes(edm::ConsumesCollector) override
virtual ~MuonPFIsolationWithConeVeto()
Destructor.
T const * get() const
Returns C++ pointer to the item.
virtual double pt() const
transverse momentum
edm::Ptr< pat::PackedCandidate > PackedCandidatePtr
const PVAssoc fromPV(size_t ipv=0) const
MuonPFIsolationWithConeVeto(const edm::ParameterSet &c)
virtual int charge() const
electric charge
bool isNonnull() const
Checks for non-null.
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
bool isInIsolationCone(const reco::CandidatePtr &physob, const reco::CandidatePtr &other) const override final
#define DEFINE_EDM_PLUGIN(factory, type, name)
Power< A, B >::type pow(const A &a, const B &b)
const std::vector< unsigned > _miniAODVertexCodes
edm::EDGetTokenT< reco::VertexCollection > _vtxToken