CMS 3D CMS Logo

GsfEleConversionVetoCut.cc
Go to the documentation of this file.
7 
9 public:
11 
12  result_type operator()(const reco::GsfElectronPtr&) const final;
13 
15  void getEventContent(const edm::EventBase&) final;
16 
17  double value(const reco::CandidatePtr& cand) const final;
18 
20 
21 private:
24 };
25 
27 
29  edm::InputTag conversiontag = c.getParameter<edm::InputTag>("conversionSrc");
30  contentTags_.emplace("conversions", conversiontag);
31 
32  edm::InputTag conversiontagMiniAOD = c.getParameter<edm::InputTag>("conversionSrcMiniAOD");
33  contentTags_.emplace("conversionsMiniAOD", conversiontagMiniAOD);
34 
35  edm::InputTag beamspottag = c.getParameter<edm::InputTag>("beamspotSrc");
36  contentTags_.emplace("beamspot", beamspottag);
37 }
38 
40  auto convs = cc.mayConsume<reco::ConversionCollection>(contentTags_["conversions"]);
41  auto convsMiniAOD = cc.mayConsume<reco::ConversionCollection>(contentTags_["conversionsMiniAOD"]);
42  auto thebs = cc.consumes<reco::BeamSpot>(contentTags_["beamspot"]);
43  contentTokens_.emplace("conversions", convs);
44  contentTokens_.emplace("conversionsMiniAOD", convsMiniAOD);
45  contentTokens_.emplace("beamspot", thebs);
46 }
47 
49  // First try AOD, then go to miniAOD. Use the same Handle since collection class is the same.
50  ev.getByLabel(contentTags_["conversions"], _convs);
51  if (!_convs.isValid())
52  ev.getByLabel(contentTags_["conversionsMiniAOD"], _convs);
53 
54  ev.getByLabel(contentTags_["beamspot"], _thebs);
55 }
56 
58  if (_thebs.isValid() && _convs.isValid()) {
60  } else {
61  edm::LogWarning("GsfEleConversionVetoCut") << "Couldn't find a necessary collection, returning true!";
62  }
63  return true;
64 }
65 
68  if (_thebs.isValid() && _convs.isValid()) {
70  } else {
71  edm::LogWarning("GsfEleConversionVetoCut") << "Couldn't find a necessary collection, returning true!";
72  return true;
73  }
74 }
MessageLogger.h
GsfEleConversionVetoCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const final
Definition: GsfEleConversionVetoCut.cc:57
ConversionFwd.h
watchdog.const
const
Definition: watchdog.py:83
edm::Handle< reco::ConversionCollection >
GsfEleConversionVetoCut::_thebs
edm::Handle< reco::BeamSpot > _thebs
Definition: GsfEleConversionVetoCut.cc:23
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
GsfEleConversionVetoCut::_convs
edm::Handle< reco::ConversionCollection > _convs
Definition: GsfEleConversionVetoCut.cc:22
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:48
candidate_functions::CandidateCut::result_type
bool result_type
Definition: CandidateCut.h:11
GsfEleConversionVetoCut::candidateType
CandidateType candidateType() const final
Definition: GsfEleConversionVetoCut.cc:19
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:181
reco::BeamSpot
Definition: BeamSpot.h:21
GsfEleConversionVetoCut::setConsumes
void setConsumes(edm::ConsumesCollector &) final
Definition: GsfEleConversionVetoCut.cc:39
CutApplicatorWithEventContentBase.h
GsfEleConversionVetoCut::value
double value(const reco::CandidatePtr &cand) const final
Definition: GsfEleConversionVetoCut.cc:66
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::ParameterSet
Definition: ParameterSet.h:47
CutApplicatorBase::CandidateType
CandidateType
Definition: CutApplicatorBase.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
cand
Definition: decayParser.h:32
GsfEleConversionVetoCut::GsfEleConversionVetoCut
GsfEleConversionVetoCut(const edm::ParameterSet &c)
Definition: GsfEleConversionVetoCut.cc:28
cc
edm::Ptr< reco::GsfElectron >
GsfEleConversionVetoCut
Definition: GsfEleConversionVetoCut.cc:8
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
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.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:45
CutApplicatorWithEventContentBase
Definition: CutApplicatorWithEventContentBase.h:19
ConversionTools.h
Conversion.h