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 = result && ( is_vertex_allowed );
64 result = result &&( aspacked->
pt() > _vetoThreshold && deltar2 > _vetoConeSize2 && deltar2 < _coneSize2 );
66 result = 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
T const * get() const
Returns C++ pointer to the item.
bool isInIsolationCone(const reco::CandidatePtr &physob, const reco::CandidatePtr &other) const final
edm::Ptr< pat::PackedCandidate > PackedCandidatePtr
int charge() const override
electric charge
const PVAssoc fromPV(size_t ipv=0) const
MuonPFIsolationWithConeVeto(const edm::ParameterSet &c)
double pt() const override
transverse momentum
bool isNonnull() const
Checks for non-null.
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
~MuonPFIsolationWithConeVeto() override
Destructor.
#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