CMS 3D CMS Logo

GsfEleDzCut.cc
Go to the documentation of this file.
6 
8 public:
10 
11  result_type operator()(const reco::GsfElectronPtr&) const final;
12 
14  void getEventContent(const edm::EventBase&) final;
15 
16  double value(const reco::CandidatePtr& cand) const final;
17 
19 
20 private:
23 };
24 
26 
29  _dzCutValueEB(c.getParameter<double>("dzCutValueEB")),
30  _dzCutValueEE(c.getParameter<double>("dzCutValueEE")),
31  _barrelCutOff(c.getParameter<double>("barrelCutOff")) {
32  edm::InputTag vertextag = c.getParameter<edm::InputTag>("vertexSrc");
33  edm::InputTag vertextagMiniAOD = c.getParameter<edm::InputTag>("vertexSrcMiniAOD");
34  contentTags_.emplace("vertices", vertextag);
35  contentTags_.emplace("verticesMiniAOD", vertextagMiniAOD);
36 }
37 
39  auto vtcs = cc.mayConsume<reco::VertexCollection>(contentTags_["vertices"]);
40  auto vtcsMiniAOD = cc.mayConsume<reco::VertexCollection>(contentTags_["verticesMiniAOD"]);
41  contentTokens_.emplace("vertices", vtcs);
42  contentTokens_.emplace("verticesMiniAOD", vtcsMiniAOD);
43 }
44 
46  // First try AOD, then go to miniAOD. Use the same Handle since collection class is the same.
47  ev.getByLabel(contentTags_["vertices"], _vtxs);
48  if (!_vtxs.isValid())
49  ev.getByLabel(contentTags_["verticesMiniAOD"], _vtxs);
50 }
51 
53  const float dzCutValue =
54  (std::abs(cand->superCluster()->position().eta()) < _barrelCutOff ? _dzCutValueEB : _dzCutValueEE);
55 
56  const reco::VertexCollection& vtxs = *_vtxs;
57  const double dz = (!vtxs.empty() ? cand->gsfTrack()->dz(vtxs[0].position()) : cand->gsfTrack()->dz());
58  return std::abs(dz) < dzCutValue;
59 }
60 
63  const reco::VertexCollection& vtxs = *_vtxs;
64  const double dz = (!vtxs.empty() ? ele->gsfTrack()->dz(vtxs[0].position()) : ele->gsfTrack()->dz());
65  return std::abs(dz);
66 }
reco::GsfElectron::gsfTrack
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:164
GsfEleDzCut::getEventContent
void getEventContent(const edm::EventBase &) final
Definition: GsfEleDzCut.cc:45
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
GsfEleDzCut::setConsumes
void setConsumes(edm::ConsumesCollector &) final
Definition: GsfEleDzCut.cc:38
GsfEleDzCut::_barrelCutOff
const double _barrelCutOff
Definition: GsfEleDzCut.cc:21
watchdog.const
const
Definition: watchdog.py:83
edm::Handle< reco::VertexCollection >
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
candidate_functions::CandidateCut::result_type
bool result_type
Definition: CandidateCut.h:11
CutApplicatorWithEventContentBase.h
GsfElectron.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
edm::ParameterSet
Definition: ParameterSet.h:47
CutApplicatorBase::CandidateType
CandidateType
Definition: CutApplicatorBase.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
cand
Definition: decayParser.h:32
GsfEleDzCut
Definition: GsfEleDzCut.cc:7
GsfTrack.h
GsfEleDzCut::_dzCutValueEB
const double _dzCutValueEB
Definition: GsfEleDzCut.cc:21
cc
GsfEleDzCut::candidateType
CandidateType candidateType() const final
Definition: GsfEleDzCut.cc:18
edm::Ptr< reco::GsfElectron >
VertexFwd.h
GsfEleDzCut::GsfEleDzCut
GsfEleDzCut(const edm::ParameterSet &c)
Definition: GsfEleDzCut.cc:27
Vertex.h
GsfEleDzCut::_vtxs
edm::Handle< reco::VertexCollection > _vtxs
Definition: GsfEleDzCut.cc:22
PVValHelper::dz
Definition: PVValidationHelpers.h:51
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: CutApplicatorWithEventContentBase.h:40
edm::EventBase
Definition: EventBase.h:46
GsfEleDzCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const final
Definition: GsfEleDzCut.cc:52
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
CutApplicatorBase::ELECTRON
Definition: CutApplicatorBase.h:47
GsfEleDzCut::_dzCutValueEE
const double _dzCutValueEE
Definition: GsfEleDzCut.cc:21
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
CutApplicatorWithEventContentBase
Definition: CutApplicatorWithEventContentBase.h:19
GsfEleDzCut::value
double value(const reco::CandidatePtr &cand) const final
Definition: GsfEleDzCut.cc:61