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 override final
 
 MuonPFIsolationWithConeVeto (const edm::ParameterSet &c)
 
 MuonPFIsolationWithConeVeto (const MuonPFIsolationWithConeVeto &)=delete
 
MuonPFIsolationWithConeVetooperator= (const MuonPFIsolationWithConeVeto &)=delete
 
void setConsumes (edm::ConsumesCollector) override
 
virtual ~MuonPFIsolationWithConeVeto ()
 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.

15  :
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  {
21  char buf[50];
22  snprintf(buf,49,"ThresholdVeto%03.0f-ConeVeto%03.0f", 100*_vetoThreshold, 100*std::sqrt(_vetoConeSize2));
24  }
T getParameter(std::string const &) const
T sqrt(T t)
Definition: SSEVec.h:18
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
const std::vector< unsigned > _miniAODVertexCodes
MuonPFIsolationWithConeVeto::MuonPFIsolationWithConeVeto ( const MuonPFIsolationWithConeVeto )
delete
virtual MuonPFIsolationWithConeVeto::~MuonPFIsolationWithConeVeto ( )
inlinevirtual

Destructor.

Definition at line 34 of file MuonPFIsolationWithConeVeto.cc.

34 {};

Member Function Documentation

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

Implements citk::IsolationConeDefinitionBase.

Definition at line 46 of file MuonPFIsolationWithConeVeto.cc.

References pat::PackedCandidate::charge(), reco::deltaR2(), Exception, pat::PackedCandidate::fromPV(), edm::Ptr< T >::get(), edm::Ptr< T >::isNonnull(), pat::PackedCandidate::pt(), and mps_fire::result.

47  {
48  const pat::PackedCandidatePtr aspacked(iso_obj);
49  const reco::PFCandidatePtr aspf(iso_obj);
50  const double deltar2 = reco::deltaR2(*physob,*iso_obj);
51 
52  bool result = true;
53  if( aspacked.isNonnull() && aspacked.get() ) {
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;
59  break;
60  }
61  }
62  result *= ( is_vertex_allowed );
63  }
64  result *= aspacked->pt() > _vetoThreshold && deltar2 > _vetoConeSize2 && deltar2 < _coneSize2 ;
65  } else if ( aspf.isNonnull() && aspf.get() ) {
66  result *= aspf->pt() > _vetoThreshold && deltar2 > _vetoConeSize2 && deltar2 < _coneSize2 ;
67  } else {
68  throw cms::Exception("InvalidIsolationInput")
69  << "The supplied candidate to be used as isolation "
70  << "was neither a reco::PFCandidate nor a pat::PackedCandidate!";
71  }
72  return result;
73 }
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
const std::vector< unsigned > _miniAODVertexCodes
MuonPFIsolationWithConeVeto& MuonPFIsolationWithConeVeto::operator= ( const MuonPFIsolationWithConeVeto )
delete
void MuonPFIsolationWithConeVeto::setConsumes ( edm::ConsumesCollector  )
inlineoverridevirtual

Implements citk::IsolationConeDefinitionBase.

Definition at line 28 of file MuonPFIsolationWithConeVeto.cc.

References trackingPlots::other.

28 {}

Member Data Documentation

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

Definition at line 38 of file MuonPFIsolationWithConeVeto.cc.

const double MuonPFIsolationWithConeVeto::_vetoConeSize2
private

Definition at line 34 of file MuonPFIsolationWithConeVeto.cc.

const double MuonPFIsolationWithConeVeto::_vetoThreshold
private

Definition at line 34 of file MuonPFIsolationWithConeVeto.cc.

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

Definition at line 39 of file MuonPFIsolationWithConeVeto.cc.