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() [1/2]

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

Definition at line 15 of file MuonPFIsolationWithConeVeto.cc.

References citk::IsolationConeDefinitionBase::_additionalCode, _vetoConeSize2, _vetoThreshold, visDQMUpload::buf, 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 sqrt(T t)
Definition: SSEVec.h:19
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
const std::vector< unsigned > _miniAODVertexCodes

◆ MuonPFIsolationWithConeVeto() [2/2]

MuonPFIsolationWithConeVeto::MuonPFIsolationWithConeVeto ( const MuonPFIsolationWithConeVeto )
delete

◆ ~MuonPFIsolationWithConeVeto()

MuonPFIsolationWithConeVeto::~MuonPFIsolationWithConeVeto ( )
inlineoverride

Destructor.

Definition at line 32 of file MuonPFIsolationWithConeVeto.cc.

32 {};

Member Function Documentation

◆ isInIsolationCone()

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 citk::IsolationConeDefinitionBase::_coneSize2, _miniAODVertexCodes, _vetoThreshold, reco::deltaR2(), Exception, edm::Ptr< T >::get(), edm::Ptr< T >::isNonnull(), and mps_fire::result.

43  {
44  if (iso_obj->pt() <= _vetoThreshold)
45  return false;
46  const double deltar2 = reco::deltaR2(*physob, *iso_obj);
47  if (deltar2 <= _vetoConeSize2 || deltar2 >= _coneSize2)
48  return false;
49 
50  //the rest will check the vertex selection
51  const pat::PackedCandidatePtr aspacked(iso_obj);
52  const reco::PFCandidatePtr aspf(iso_obj);
53 
54  bool result = true;
55  if (aspacked.isNonnull() && aspacked.get()) {
56  if (aspacked->charge() != 0) {
57  bool is_vertex_allowed = false;
58  for (const unsigned vtxtype : _miniAODVertexCodes) {
59  if (vtxtype == aspacked->fromPV()) {
60  is_vertex_allowed = true;
61  break;
62  }
63  }
64  result = result && (is_vertex_allowed);
65  }
66  } else if (aspf.isNonnull() && aspf.get()) {
67  } else {
68  throw cms::Exception("InvalidIsolationInput") << "The supplied candidate to be used as isolation "
69  << "was neither a reco::PFCandidate nor a pat::PackedCandidate!";
70  }
71  return result;
72 }
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
const std::vector< unsigned > _miniAODVertexCodes

◆ operator=()

MuonPFIsolationWithConeVeto& MuonPFIsolationWithConeVeto::operator= ( const MuonPFIsolationWithConeVeto )
delete

◆ setConsumes()

void MuonPFIsolationWithConeVeto::setConsumes ( edm::ConsumesCollector  )
inlineoverridevirtual

Implements citk::IsolationConeDefinitionBase.

Definition at line 27 of file MuonPFIsolationWithConeVeto.cc.

27 {}

Member Data Documentation

◆ _miniAODVertexCodes

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

Definition at line 36 of file MuonPFIsolationWithConeVeto.cc.

Referenced by isInIsolationCone().

◆ _vetoConeSize2

const double MuonPFIsolationWithConeVeto::_vetoConeSize2
private

Definition at line 32 of file MuonPFIsolationWithConeVeto.cc.

Referenced by MuonPFIsolationWithConeVeto().

◆ _vetoThreshold

const double MuonPFIsolationWithConeVeto::_vetoThreshold
private

◆ _vtxToken

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

Definition at line 37 of file MuonPFIsolationWithConeVeto.cc.