test
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
GsfEleDxyCut Class Reference
Inheritance diagram for GsfEleDxyCut:
CutApplicatorWithEventContentBase CutApplicatorBase candidate_functions::CandidateCut

Public Member Functions

CandidateType candidateType () const overridefinal
 
void getEventContent (const edm::EventBase &) overridefinal
 
 GsfEleDxyCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::GsfElectronPtr &) const overridefinal
 
void setConsumes (edm::ConsumesCollector &) overridefinal
 
- Public Member Functions inherited from CutApplicatorWithEventContentBase
 CutApplicatorWithEventContentBase (const edm::ParameterSet &c)
 
 CutApplicatorWithEventContentBase (const CutApplicatorWithEventContentBase &)=delete
 
CutApplicatorWithEventContentBaseoperator= (const CutApplicatorWithEventContentBase &)=delete
 
virtual ~CutApplicatorWithEventContentBase ()
 Destructor. More...
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) const
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
const std::string & name () const
 
virtual result_type operator() (const argument_type &) const final
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const reco::PhotonPtr &) const
 
virtual result_type operator() (const pat::PhotonPtr &) const
 
virtual result_type operator() (const reco::MuonPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) const
 
CutApplicatorBaseoperator= (const CutApplicatorBase &)=delete
 
virtual ~CutApplicatorBase ()
 Destructor. More...
 
- Public Member Functions inherited from candidate_functions::CandidateCut
virtual ~CandidateCut ()
 

Private Attributes

const double _barrelCutOff
 
const double _dxyCutValueEB
 
const double _dxyCutValueEE
 
edm::Handle
< reco::VertexCollection
_vtxs
 

Additional Inherited Members

- Public Types inherited from CutApplicatorBase
enum  CandidateType {
  NONE, ELECTRON, MUON, PHOTON,
  TAU, PATELECTRON, PATMUON, PATPHOTON,
  PATTAU
}
 
- Protected Attributes inherited from CutApplicatorWithEventContentBase
std::unordered_map
< std::string, edm::InputTag
contentTags_
 
std::unordered_map
< std::string, edm::EDGetToken
contentTokens_
 

Detailed Description

Definition at line 7 of file GsfEleDxyCut.cc.

Constructor & Destructor Documentation

GsfEleDxyCut::GsfEleDxyCut ( const edm::ParameterSet c)

Definition at line 29 of file GsfEleDxyCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, and edm::ParameterSet::getParameter().

29  :
31  _dxyCutValueEB(c.getParameter<double>("dxyCutValueEB")),
32  _dxyCutValueEE(c.getParameter<double>("dxyCutValueEE")),
33  _barrelCutOff(c.getParameter<double>("barrelCutOff")) {
34  edm::InputTag vertextag = c.getParameter<edm::InputTag>("vertexSrc");
35  contentTags_.emplace("vertices",vertextag);
36 }
T getParameter(std::string const &) const
CutApplicatorWithEventContentBase(const edm::ParameterSet &c)
const double _dxyCutValueEB
Definition: GsfEleDxyCut.cc:21
std::unordered_map< std::string, edm::InputTag > contentTags_
const double _dxyCutValueEE
Definition: GsfEleDxyCut.cc:21
const double _barrelCutOff
Definition: GsfEleDxyCut.cc:21

Member Function Documentation

CandidateType GsfEleDxyCut::candidateType ( ) const
inlinefinaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 16 of file GsfEleDxyCut.cc.

References CutApplicatorBase::ELECTRON.

16  {
17  return ELECTRON;
18  }
void GsfEleDxyCut::getEventContent ( const edm::EventBase ev)
finaloverridevirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 44 of file GsfEleDxyCut.cc.

References _vtxs, CutApplicatorWithEventContentBase::contentTags_, and edm::EventBase::getByLabel().

44  {
45  ev.getByLabel(contentTags_["vertices"],_vtxs);
46 }
std::unordered_map< std::string, edm::InputTag > contentTags_
edm::Handle< reco::VertexCollection > _vtxs
Definition: GsfEleDxyCut.cc:22
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:87
CutApplicatorBase::result_type GsfEleDxyCut::operator() ( const reco::GsfElectronPtr cand) const
finaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 50 of file GsfEleDxyCut.cc.

References _barrelCutOff, _dxyCutValueEB, _dxyCutValueEE, _vtxs, funct::abs(), and position.

50  {
51  const float dxyCutValue =
52  ( std::abs(cand->superCluster()->position().eta()) < _barrelCutOff ?
54 
55  const reco::VertexCollection& vtxs = *_vtxs;
56  const double dxy = ( vtxs.size() ?
57  cand->gsfTrack()->dxy(vtxs[0].position()) :
58  cand->gsfTrack()->dxy() );
59  return std::abs(dxy) < dxyCutValue;
60 }
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
const double _dxyCutValueEB
Definition: GsfEleDxyCut.cc:21
edm::Handle< reco::VertexCollection > _vtxs
Definition: GsfEleDxyCut.cc:22
const double _dxyCutValueEE
Definition: GsfEleDxyCut.cc:21
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const double _barrelCutOff
Definition: GsfEleDxyCut.cc:21
static int position[264][3]
Definition: ReadPGInfo.cc:509
void GsfEleDxyCut::setConsumes ( edm::ConsumesCollector cc)
finaloverridevirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 38 of file GsfEleDxyCut.cc.

References edm::ConsumesCollector::consumes(), CutApplicatorWithEventContentBase::contentTags_, and CutApplicatorWithEventContentBase::contentTokens_.

38  {
39  auto vtcs =
41  contentTokens_.emplace("vertices",vtcs);
42 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::unordered_map< std::string, edm::InputTag > contentTags_

Member Data Documentation

const double GsfEleDxyCut::_barrelCutOff
private

Definition at line 21 of file GsfEleDxyCut.cc.

Referenced by operator()().

const double GsfEleDxyCut::_dxyCutValueEB
private

Definition at line 21 of file GsfEleDxyCut.cc.

Referenced by operator()().

const double GsfEleDxyCut::_dxyCutValueEE
private

Definition at line 21 of file GsfEleDxyCut.cc.

Referenced by operator()().

edm::Handle<reco::VertexCollection> GsfEleDxyCut::_vtxs
private

Definition at line 22 of file GsfEleDxyCut.cc.

Referenced by getEventContent(), and operator()().