CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfEleFull5x5E2x5OverE5x5Cut.cc
Go to the documentation of this file.
6 
8 
10 public:
12 
13  result_type operator()(const reco::GsfElectronPtr&) const override final;
14 
15  void setConsumes(edm::ConsumesCollector&) override final;
16  void getEventContent(const edm::EventBase&) override final;
17 
18  CandidateType candidateType() const override final {
19  return ELECTRON;
20  }
21 
22 private:
25 
26 
30 
31  constexpr static char e5x5_[] = "e5x5";
32  constexpr static char e2x5_[] = "e2x5";
33  constexpr static char e1x5_[] = "e1x5";
34 };
35 
39 
42  "GsfEleFull5x5E2x5OverE5x5Cut");
43 
46  minE1x5OverE5x5Cut_(params,"minE1x5OverE5x5"),
47  minE2x5OverE5x5Cut_(params,"minE2x5OverE5x5"){
48  edm::InputTag e5x5Tag = params.getParameter<edm::InputTag>(e5x5_);
49  edm::InputTag e2x5Tag = params.getParameter<edm::InputTag>(e2x5_);
50  edm::InputTag e1x5Tag = params.getParameter<edm::InputTag>(e1x5_);
51  contentTags_.emplace(e5x5_,e5x5Tag);
52  contentTags_.emplace(e2x5_,e2x5Tag);
53  contentTags_.emplace(e1x5_,e1x5Tag);
54 }
55 
57  auto e5x5 = cc.consumes<double>(contentTags_[e5x5_]);
58  contentTokens_.emplace(e5x5_,e5x5);
59  auto e2x5 = cc.consumes<double>(contentTags_[e2x5_]);
60  contentTokens_.emplace(e2x5_,e2x5);
61  auto e1x5 = cc.consumes<double>(contentTags_[e1x5_]);
62  contentTokens_.emplace(e1x5_,e1x5);
63 }
64 
69 }
70 
71 CutApplicatorBase::result_type
73 operator()(const reco::GsfElectronPtr& cand) const{
74 
75  const double e5x5 = (*e5x5Handle_)[cand];
76  const double e1x5OverE5x5 = e5x5!=0 ? (*e1x5Handle_)[cand]/e5x5 : 0;
77  const double e2x5OverE5x5 = e5x5!=0 ? (*e2x5Handle_)[cand]/e5x5 : 0;
78 
79  return e1x5OverE5x5 > minE1x5OverE5x5Cut_(cand) || e2x5OverE5x5 > minE2x5OverE5x5Cut_(cand);
80 
81 }
edm::Handle< edm::ValueMap< float > > e1x5Handle_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
CandidateType candidateType() const overridefinal
edm::Handle< edm::ValueMap< float > > e5x5Handle_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
void setConsumes(edm::ConsumesCollector &) overridefinal
std::unordered_map< std::string, edm::InputTag > contentTags_
GsfEleFull5x5E2x5OverE5x5Cut(const edm::ParameterSet &c)
result_type operator()(const reco::GsfElectronPtr &) const overridefinal
void getEventContent(const edm::EventBase &) overridefinal
edm::Handle< edm::ValueMap< float > > e2x5Handle_
string const
Definition: compareJSON.py:14
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:87
#define DEFINE_EDM_PLUGIN(factory, type, name)
#define constexpr