CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MuonPFIsolationWithConeVeto Class Reference
Inheritance diagram for MuonPFIsolationWithConeVeto:
citk::IsolationConeDefinitionBase

Public Member Functions

bool isInIsolationCone (const reco::CandidatePtr &physob, const reco::CandidatePtr &other) const final
 
 MuonPFIsolationWithConeVeto (const edm::ParameterSet &c)
 
 MuonPFIsolationWithConeVeto (const MuonPFIsolationWithConeVeto &)=delete
 
MuonPFIsolationWithConeVetooperator= (const MuonPFIsolationWithConeVeto &)=delete
 
void setConsumes (edm::ConsumesCollector) override
 
 ~MuonPFIsolationWithConeVeto () override
 Destructor. More...
 
- Public Member Functions inherited from citk::IsolationConeDefinitionBase
const std::string & additionalCode () const
 
virtual void getEventInfo (const edm::Event &)
 
virtual void getEventSetupInfo (const edm::EventSetup &)
 
 IsolationConeDefinitionBase (const edm::ParameterSet &c)
 
 IsolationConeDefinitionBase (const IsolationConeDefinitionBase &)=delete
 
const std::string & name () const
 
IsolationConeDefinitionBaseoperator= (const IsolationConeDefinitionBase &)=delete
 
virtual ~IsolationConeDefinitionBase ()
 Destructor. More...
 

Private Attributes

const std::vector< unsigned > _miniAODVertexCodes
 
const double _vetoConeSize2
 
const double _vetoThreshold
 
edm::EDGetTokenT< reco::VertexCollection_vtxToken
 

Additional Inherited Members

- Protected Attributes inherited from citk::IsolationConeDefinitionBase
std::string _additionalCode
 
const float _coneSize2
 

Detailed Description

Definition at line 13 of file MuonPFIsolationWithConeVeto.cc.

Constructor & Destructor Documentation

MuonPFIsolationWithConeVeto::MuonPFIsolationWithConeVeto ( const edm::ParameterSet c)
inline

Definition at line 15 of file MuonPFIsolationWithConeVeto.cc.

References mathSSE::sqrt(), and AlCaHLTBitMon_QueryRunRegistry::string.

17  _vetoThreshold(c.getParameter<double>("VetoThreshold")),
18  _vetoConeSize2(std::pow(c.getParameter<double>("VetoConeSize"), 2.0)),
19  _miniAODVertexCodes(c.getParameter<std::vector<unsigned> >("miniAODVertexCodes")) {
20  char buf[50];
21  snprintf(buf, 49, "ThresholdVeto%03.0f-ConeVeto%03.0f", 100 * _vetoThreshold, 100 * std::sqrt(_vetoConeSize2));
23  }
T getParameter(std::string const &) const
T sqrt(T t)
Definition: SSEVec.h:19
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
const std::vector< unsigned > _miniAODVertexCodes
MuonPFIsolationWithConeVeto::MuonPFIsolationWithConeVeto ( const MuonPFIsolationWithConeVeto )
delete
MuonPFIsolationWithConeVeto::~MuonPFIsolationWithConeVeto ( )
inlineoverride

Destructor.

Definition at line 32 of file MuonPFIsolationWithConeVeto.cc.

32 {};

Member Function Documentation

bool MuonPFIsolationWithConeVeto::isInIsolationCone ( const reco::CandidatePtr physob,
const reco::CandidatePtr other 
) const
finalvirtual

Implements citk::IsolationConeDefinitionBase.

Definition at line 42 of file MuonPFIsolationWithConeVeto.cc.

References reco::deltaR2(), Exception, edm::Ptr< T >::get(), edm::Ptr< T >::isNonnull(), and mps_fire::result.

43  {
44  const pat::PackedCandidatePtr aspacked(iso_obj);
45  const reco::PFCandidatePtr aspf(iso_obj);
46  const double deltar2 = reco::deltaR2(*physob, *iso_obj);
47 
48  bool result = true;
49  if (aspacked.isNonnull() && aspacked.get()) {
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;
55  break;
56  }
57  }
58  result = result && (is_vertex_allowed);
59  }
60  result = result && (aspacked->pt() > _vetoThreshold && deltar2 > _vetoConeSize2 && deltar2 < _coneSize2);
61  } else if (aspf.isNonnull() && aspf.get()) {
62  result = result && (aspf->pt() > _vetoThreshold && deltar2 > _vetoConeSize2 && deltar2 < _coneSize2);
63  } else {
64  throw cms::Exception("InvalidIsolationInput") << "The supplied candidate to be used as isolation "
65  << "was neither a reco::PFCandidate nor a pat::PackedCandidate!";
66  }
67  return result;
68 }
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
const std::vector< unsigned > _miniAODVertexCodes
MuonPFIsolationWithConeVeto& MuonPFIsolationWithConeVeto::operator= ( const MuonPFIsolationWithConeVeto )
delete
void MuonPFIsolationWithConeVeto::setConsumes ( edm::ConsumesCollector  )
inlineoverridevirtual

Implements citk::IsolationConeDefinitionBase.

Definition at line 27 of file MuonPFIsolationWithConeVeto.cc.

References trackingPlots::other.

27 {}

Member Data Documentation

const std::vector<unsigned> MuonPFIsolationWithConeVeto::_miniAODVertexCodes
private

Definition at line 36 of file MuonPFIsolationWithConeVeto.cc.

const double MuonPFIsolationWithConeVeto::_vetoConeSize2
private

Definition at line 32 of file MuonPFIsolationWithConeVeto.cc.

const double MuonPFIsolationWithConeVeto::_vetoThreshold
private

Definition at line 32 of file MuonPFIsolationWithConeVeto.cc.

edm::EDGetTokenT<reco::VertexCollection> MuonPFIsolationWithConeVeto::_vtxToken
private

Definition at line 37 of file MuonPFIsolationWithConeVeto.cc.