CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfEleConversionVetoCut.cc
Go to the documentation of this file.
6 
7 
9 public:
11 
12  result_type operator()(const reco::GsfElectronPtr&) const override final;
13 
14  void setConsumes(edm::ConsumesCollector&) override final;
15  void getEventContent(const edm::EventBase&) override final;
16 
17  CandidateType candidateType() const override final {
18  return ELECTRON;
19  }
20 
21 private:
24 };
25 
28  "GsfEleConversionVetoCut");
29 
32  edm::InputTag conversiontag = c.getParameter<edm::InputTag>("conversionSrc");
33  contentTags_.emplace("conversions",conversiontag);
34  edm::InputTag beamspottag = c.getParameter<edm::InputTag>("beamspotSrc");
35  contentTags_.emplace("beamspot",beamspottag);
36 }
37 
39  auto convs =
41  auto thebs = cc.consumes<reco::BeamSpot>(contentTags_["beamspot"]);
42  contentTokens_.emplace("conversions",convs);
43  contentTokens_.emplace("beamspot",thebs);
44 }
45 
47  ev.getByLabel(contentTags_["conversions"],_convs);
48  ev.getByLabel(contentTags_["beamspot"],_thebs);
49 }
50 
51 CutApplicatorBase::result_type
53 operator()(const reco::GsfElectronPtr& cand) const{
54  if( _thebs.isValid() && _convs.isValid() ) {
56  _thebs->position());
57  } else {
58  edm::LogWarning("GsfEleConversionVetoCut")
59  << "Couldn't find a necessary collection, returning true!";
60  }
61  return true;
62 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::Handle< reco::BeamSpot > _thebs
CandidateType candidateType() const overridefinal
void setConsumes(edm::ConsumesCollector &) overridefinal
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
bool ev
std::unordered_map< std::string, edm::InputTag > contentTags_
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
edm::Handle< reco::ConversionCollection > _convs
GsfEleConversionVetoCut(const edm::ParameterSet &c)
bool isValid() const
Definition: HandleBase.h:76
static bool hasMatchedConversion(const reco::GsfElectron &ele, const edm::Handle< reco::ConversionCollection > &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
void getEventContent(const edm::EventBase &) overridefinal
result_type operator()(const reco::GsfElectronPtr &) const overridefinal
string const
Definition: compareJSON.py:14
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:87
#define DEFINE_EDM_PLUGIN(factory, type, name)