CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ElectronPFIsolationWithConeVeto Class Reference
Inheritance diagram for ElectronPFIsolationWithConeVeto:
citk::IsolationConeDefinitionBase

Public Member Functions

 ElectronPFIsolationWithConeVeto (const edm::ParameterSet &c)
 
 ElectronPFIsolationWithConeVeto (const ElectronPFIsolationWithConeVeto &)=delete
 
bool isInIsolationCone (const reco::CandidatePtr &physob, const reco::CandidatePtr &other) const overridefinal
 
ElectronPFIsolationWithConeVetooperator= (const ElectronPFIsolationWithConeVeto &)=delete
 
void setConsumes (edm::ConsumesCollector)
 
virtual ~ElectronPFIsolationWithConeVeto ()
 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::string _isolateAgainst
 
const std::vector< unsigned > _miniAODVertexCodes
 
const float _vetoConeSize2EB
 
const float _vetoConeSize2EE
 
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 36 of file ElectronPFIsolationWithConeVeto.cc.

Constructor & Destructor Documentation

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

Definition at line 38 of file ElectronPFIsolationWithConeVeto.cc.

References citk::IsolationConeDefinitionBase::_additionalCode, _vetoConeSize2EB, _vetoConeSize2EE, mathSSE::sqrt(), and AlCaHLTBitMon_QueryRunRegistry::string.

38  :
40  _vetoConeSize2EB(std::pow(c.getParameter<double>("VetoConeSizeBarrel"),2.0)),
41  _vetoConeSize2EE(std::pow(c.getParameter<double>("VetoConeSizeEndcaps"),2.0)),
42  _miniAODVertexCodes(c.getParameter<std::vector<unsigned> >("miniAODVertexCodes")),
43  _isolateAgainst(c.getParameter<std::string>("isolateAgainst")) {
44  char buf[50];
45  sprintf(buf,"BarVeto%.2f-EndVeto%.2f",
49  auto decimal = _additionalCode.find('.');
50  while( decimal != std::string::npos ) {
51  _additionalCode.erase(decimal,1);
52  decimal = _additionalCode.find('.');
53  }
54  }
T getParameter(std::string const &) const
T sqrt(T t)
Definition: SSEVec.h:18
const std::vector< unsigned > _miniAODVertexCodes
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
ElectronPFIsolationWithConeVeto::ElectronPFIsolationWithConeVeto ( const ElectronPFIsolationWithConeVeto )
delete
virtual ElectronPFIsolationWithConeVeto::~ElectronPFIsolationWithConeVeto ( )
inlinevirtual

Destructor.

Definition at line 64 of file ElectronPFIsolationWithConeVeto.cc.

64 {};

Member Function Documentation

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

Implements citk::IsolationConeDefinitionBase.

Definition at line 78 of file ElectronPFIsolationWithConeVeto.cc.

References citk::IsolationConeDefinitionBase::_coneSize2, _miniAODVertexCodes, _vetoConeSize2EB, _vetoConeSize2EE, reco::deltaR2(), EcalBarrel, Exception, edm::Ptr< T >::get(), edm::Ptr< T >::isNonnull(), mps_fire::result, and fileCollector::seed.

79  {
80  reco::GsfElectronPtr eleref(physob);
81  pat::PackedCandidatePtr aspacked(iso_obj);
82  reco::PFCandidatePtr aspf(iso_obj);
83  const reco::CaloClusterPtr& seed = eleref->superCluster()->seed();
84  bool isEB = ( seed->seed().subdetId() == EcalBarrel );
85  const float deltar2 = reco::deltaR2(*physob,*iso_obj);
86  const float vetoConeSize2 = ( isEB ? _vetoConeSize2EB : _vetoConeSize2EE );
87  bool result = true;
88  if( aspacked.isNonnull() && aspacked.get() ) {
89  if( aspacked->charge() != 0 ) {
90  bool is_vertex_allowed = false;
91  for( const unsigned vtxtype : _miniAODVertexCodes ) {
92  if( vtxtype == aspacked->fromPV() ) {
93  is_vertex_allowed = true;
94  break;
95  }
96  }
97  result *= ( is_vertex_allowed );
98  }
99  result *= deltar2 > vetoConeSize2 && deltar2 < _coneSize2 ;
100  } else if ( aspf.isNonnull() && aspf.get() ) {
101  result *= deltar2 > vetoConeSize2 && deltar2 < _coneSize2;
102  } else {
103  throw cms::Exception("InvalidIsolationInput")
104  << "The supplied candidate to be used as isolation "
105  << "was neither a reco::PFCandidate nor a pat::PackedCandidate!";
106  }
107  return result;
108 }
tuple result
Definition: mps_fire.py:95
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
const std::vector< unsigned > _miniAODVertexCodes
ElectronPFIsolationWithConeVeto& ElectronPFIsolationWithConeVeto::operator= ( const ElectronPFIsolationWithConeVeto )
delete
void ElectronPFIsolationWithConeVeto::setConsumes ( edm::ConsumesCollector  )
inlinevirtual

Implements citk::IsolationConeDefinitionBase.

Definition at line 58 of file ElectronPFIsolationWithConeVeto.cc.

58 {}

Member Data Documentation

const std::string ElectronPFIsolationWithConeVeto::_isolateAgainst
private

Definition at line 69 of file ElectronPFIsolationWithConeVeto.cc.

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

Definition at line 68 of file ElectronPFIsolationWithConeVeto.cc.

Referenced by isInIsolationCone().

const float ElectronPFIsolationWithConeVeto::_vetoConeSize2EB
private
const float ElectronPFIsolationWithConeVeto::_vetoConeSize2EE
private
edm::EDGetTokenT<reco::VertexCollection> ElectronPFIsolationWithConeVeto::_vtxToken
private

Definition at line 70 of file ElectronPFIsolationWithConeVeto.cc.