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")) {
21 snprintf(buf, 49,
"ThresholdVeto%03.0f-ConeVeto%03.0f", 100 * _vetoThreshold, 100 *
std::sqrt(_vetoConeSize2));
35 const double _vetoThreshold, _vetoConeSize2;
50 if (aspacked->charge() != 0) {
51 bool is_vertex_allowed =
false;
52 for (
const unsigned vtxtype : _miniAODVertexCodes) {
53 if (vtxtype == aspacked->fromPV()) {
54 is_vertex_allowed =
true;
58 result = result && (is_vertex_allowed);
60 result = result && (aspacked->pt() > _vetoThreshold && deltar2 > _vetoConeSize2 && deltar2 < _coneSize2);
62 result = result && (aspf->pt() > _vetoThreshold && deltar2 > _vetoConeSize2 && deltar2 < _coneSize2);
64 throw cms::Exception(
"InvalidIsolationInput") <<
"The supplied candidate to be used as isolation " 65 <<
"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
MuonPFIsolationWithConeVeto(const edm::ParameterSet &c)
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