CMS 3D CMS Logo

GsfEleConversionVetoCut.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 
28  edm::InputTag conversiontag = c.getParameter<edm::InputTag>("conversionSrc");
29  contentTags_.emplace("conversions", conversiontag);
30 
31  edm::InputTag conversiontagMiniAOD = c.getParameter<edm::InputTag>("conversionSrcMiniAOD");
32  contentTags_.emplace("conversionsMiniAOD", conversiontagMiniAOD);
33 
34  edm::InputTag beamspottag = c.getParameter<edm::InputTag>("beamspotSrc");
35  contentTags_.emplace("beamspot", beamspottag);
36 }
37 
39  auto convs = cc.mayConsume<reco::ConversionCollection>(contentTags_["conversions"]);
40  auto convsMiniAOD = cc.mayConsume<reco::ConversionCollection>(contentTags_["conversionsMiniAOD"]);
41  auto thebs = cc.consumes<reco::BeamSpot>(contentTags_["beamspot"]);
42  contentTokens_.emplace("conversions", convs);
43  contentTokens_.emplace("conversionsMiniAOD", convsMiniAOD);
44  contentTokens_.emplace("beamspot", thebs);
45 }
46 
48  // First try AOD, then go to miniAOD. Use the same Handle since collection class is the same.
49  ev.getByLabel(contentTags_["conversions"], _convs);
50  if (!_convs.isValid())
51  ev.getByLabel(contentTags_["conversionsMiniAOD"], _convs);
52 
53  ev.getByLabel(contentTags_["beamspot"], _thebs);
54 }
55 
57  if (_thebs.isValid() && _convs.isValid()) {
59  } else {
60  edm::LogWarning("GsfEleConversionVetoCut") << "Couldn't find a necessary collection, returning true!";
61  }
62  return true;
63 }
64 
67  if (_thebs.isValid() && _convs.isValid()) {
69  } else {
70  edm::LogWarning("GsfEleConversionVetoCut") << "Couldn't find a necessary collection, returning true!";
71  return true;
72  }
73 }
ConversionTools.h
GsfEleConversionVetoCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const final
Definition: GsfEleConversionVetoCut.cc:56
ConversionFwd.h
watchdog.const
const
Definition: watchdog.py:83
edm::Handle< reco::ConversionCollection >
GsfEleConversionVetoCut::_thebs
edm::Handle< reco::BeamSpot > _thebs
Definition: GsfEleConversionVetoCut.cc:22
GsfEleConversionVetoCut::_convs
edm::Handle< reco::ConversionCollection > _convs
Definition: GsfEleConversionVetoCut.cc:21
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
GsfEleConversionVetoCut::getEventContent
void getEventContent(const edm::EventBase &) final
Definition: GsfEleConversionVetoCut.cc:47
candidate_functions::CandidateCut::result_type
bool result_type
Definition: CandidateCut.h:11
GsfEleConversionVetoCut::candidateType
CandidateType candidateType() const final
Definition: GsfEleConversionVetoCut.cc:18
ConversionTools::hasMatchedConversion
static bool hasMatchedConversion(const reco::GsfElectron &ele, const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
Definition: ConversionTools.cc:184
reco::BeamSpot
Definition: BeamSpot.h:21
GsfEleConversionVetoCut::setConsumes
void setConsumes(edm::ConsumesCollector &) final
Definition: GsfEleConversionVetoCut.cc:38
CutApplicatorWithEventContentBase.h
GsfEleConversionVetoCut::value
double value(const reco::CandidatePtr &cand) const final
Definition: GsfEleConversionVetoCut.cc:65
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
GsfElectron.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
edm::LogWarning
Definition: MessageLogger.h:141
edm::ParameterSet
Definition: ParameterSet.h:36
CutApplicatorBase::CandidateType
CandidateType
Definition: CutApplicatorBase.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
cand
Definition: decayParser.h:34
GsfEleConversionVetoCut::GsfEleConversionVetoCut
GsfEleConversionVetoCut(const edm::ParameterSet &c)
Definition: GsfEleConversionVetoCut.cc:27
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
cc
edm::Ptr< reco::GsfElectron >
GsfEleConversionVetoCut
Definition: GsfEleConversionVetoCut.cc:7
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: CutApplicatorWithEventContentBase.h:40
edm::EventBase
Definition: EventBase.h:46
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
CutApplicatorBase::ELECTRON
Definition: CutApplicatorBase.h:47
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
CutApplicatorWithEventContentBase
Definition: CutApplicatorWithEventContentBase.h:19
Conversion.h