CMS 3D CMS Logo

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 final
 
ElectronPFIsolationWithConeVetooperator= (const ElectronPFIsolationWithConeVeto &)=delete
 
void setConsumes (edm::ConsumesCollector) override
 
 ~ElectronPFIsolationWithConeVeto () 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::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 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
ElectronPFIsolationWithConeVeto::~ElectronPFIsolationWithConeVeto ( )
inlineoverride

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
finalvirtual

Implements citk::IsolationConeDefinitionBase.

Definition at line 78 of file ElectronPFIsolationWithConeVeto.cc.

References pat::PackedCandidate::charge(), reco::deltaR2(), EcalBarrel, Exception, pat::PackedCandidate::fromPV(), edm::Ptr< T >::get(), edm::Ptr< T >::isNonnull(), mps_fire::result, SurveyInfoScenario_cff::seed, and reco::GsfElectron::superCluster().

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 = result && ( is_vertex_allowed );
98  }
99  result = result && ( deltar2 > vetoConeSize2 && deltar2 < _coneSize2 );
100  } else if ( aspf.isNonnull() && aspf.get() ) {
101  result = 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 }
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
const std::vector< unsigned > _miniAODVertexCodes
ElectronPFIsolationWithConeVeto& ElectronPFIsolationWithConeVeto::operator= ( const ElectronPFIsolationWithConeVeto )
delete
void ElectronPFIsolationWithConeVeto::setConsumes ( edm::ConsumesCollector  )
inlineoverridevirtual

Implements citk::IsolationConeDefinitionBase.

Definition at line 58 of file ElectronPFIsolationWithConeVeto.cc.

References trackingPlots::other.

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.

const float ElectronPFIsolationWithConeVeto::_vetoConeSize2EB
private

Definition at line 64 of file ElectronPFIsolationWithConeVeto.cc.

const float ElectronPFIsolationWithConeVeto::_vetoConeSize2EE
private

Definition at line 64 of file ElectronPFIsolationWithConeVeto.cc.

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

Definition at line 70 of file ElectronPFIsolationWithConeVeto.cc.