CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfEleDzCut.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  "GsfEleDzCut");
28 
31  _dzCutValueEB(c.getParameter<double>("dzCutValueEB")),
32  _dzCutValueEE(c.getParameter<double>("dzCutValueEE")),
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 dzCutValue =
52  ( std::abs(cand->superCluster()->position().eta()) < _barrelCutOff ?
54 
55  const reco::VertexCollection& vtxs = *_vtxs;
56  const double dz = ( vtxs.size() ?
57  cand->gsfTrack()->dz(vtxs[0].position()) :
58  cand->gsfTrack()->dz() );
59  return std::abs(dz) < dzCutValue;
60 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
CandidateType candidateType() const overridefinal
Definition: GsfEleDzCut.cc:16
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
std::unordered_map< std::string, edm::InputTag > contentTags_
const double _barrelCutOff
Definition: GsfEleDzCut.cc:21
result_type operator()(const reco::GsfElectronPtr &) const overridefinal
Definition: GsfEleDzCut.cc:50
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void setConsumes(edm::ConsumesCollector &) overridefinal
Definition: GsfEleDzCut.cc:38
void getEventContent(const edm::EventBase &) overridefinal
Definition: GsfEleDzCut.cc:44
GsfEleDzCut(const edm::ParameterSet &c)
Definition: GsfEleDzCut.cc:29
const double _dzCutValueEB
Definition: GsfEleDzCut.cc:21
string const
Definition: compareJSON.py:14
const double _dzCutValueEE
Definition: GsfEleDzCut.cc:21
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:87
edm::Handle< reco::VertexCollection > _vtxs
Definition: GsfEleDzCut.cc:22
#define DEFINE_EDM_PLUGIN(factory, type, name)