CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfEleDxyCut.cc
Go to the documentation of this file.
6 
8 public:
10 
11  result_type operator()(const reco::GsfElectronPtr&) const override final;
12 
13  void setConsumes(edm::ConsumesCollector&) override final;
14  void getEventContent(const edm::EventBase&) override final;
15 
16  CandidateType candidateType() const override final {
17  return ELECTRON;
18  }
19 
20 private:
23 };
24 
27  "GsfEleDxyCut");
28 
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 }
37 
39  auto vtcs =
41  contentTokens_.emplace("vertices",vtcs);
42 }
43 
45  ev.getByLabel(contentTags_["vertices"],_vtxs);
46 }
47 
48 CutApplicatorBase::result_type
50 operator()(const reco::GsfElectronPtr& cand) const{
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 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
bool ev
void getEventContent(const edm::EventBase &) overridefinal
Definition: GsfEleDxyCut.cc:44
const double _dxyCutValueEB
Definition: GsfEleDxyCut.cc:21
std::unordered_map< std::string, edm::InputTag > contentTags_
CandidateType candidateType() const overridefinal
Definition: GsfEleDxyCut.cc:16
result_type operator()(const reco::GsfElectronPtr &) const overridefinal
Definition: GsfEleDxyCut.cc:50
edm::Handle< reco::VertexCollection > _vtxs
Definition: GsfEleDxyCut.cc:22
const double _dxyCutValueEE
Definition: GsfEleDxyCut.cc:21
void setConsumes(edm::ConsumesCollector &) overridefinal
Definition: GsfEleDxyCut.cc:38
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GsfEleDxyCut(const edm::ParameterSet &c)
Definition: GsfEleDxyCut.cc:29
const double _barrelCutOff
Definition: GsfEleDxyCut.cc:21
string const
Definition: compareJSON.py:14
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
static int position[264][3]
Definition: ReadPGInfo.cc:509
#define DEFINE_EDM_PLUGIN(factory, type, name)