CMS 3D CMS Logo

GsfEleFull5x5E2x5OverE5x5WithSatCut.cc
Go to the documentation of this file.
5 
7 public:
9 
10  result_type operator()(const reco::GsfElectronPtr&) const override final;
11 
12  void setConsumes(edm::ConsumesCollector&) override final;
13  void getEventContent(const edm::EventBase&) override final;
14 
15  double value(const reco::CandidatePtr& cand) const override final;
16 
17  CandidateType candidateType() const override final {
18  return ELECTRON;
19  }
20 
21 private:
26 
27 };
28 
31  "GsfEleFull5x5E2x5OverE5x5WithSatCut");
32 
35  minE1x5OverE5x5Cut_(params,"minE1x5OverE5x5"),
36  minE2x5OverE5x5Cut_(params,"minE2x5OverE5x5"),
37  maxNrSatCrysIn5x5Cut_(params,"maxNrSatCrysIn5x5"){
38  contentTags_.emplace("nrSatCrysValueMap",params.getParameter<edm::InputTag>("nrSatCrysValueMap"));
39 }
40 
42  contentTokens_.emplace("nrSatCrysValueMap",cc.consumes<edm::ValueMap<int> >(contentTags_["nrSatCrysValueMap"]));
43 }
44 
46  ev.getByLabel(contentTags_["nrSatCrysValueMap"],nrSatCrysValueMap_);
47 
48 }
49 
50 
51 CutApplicatorBase::result_type
54 
55  if((*nrSatCrysValueMap_)[cand]>maxNrSatCrysIn5x5Cut_(cand)) return true;
56 
57  const double e5x5 = cand->full5x5_e5x5();
58  const double e2x5OverE5x5 = e5x5!=0 ? cand->full5x5_e2x5Max()/e5x5 : 0;
59  const double e1x5OverE5x5 = e5x5!=0 ? cand->full5x5_e1x5()/e5x5 : 0;
60 
61  return e1x5OverE5x5 > minE1x5OverE5x5Cut_(cand) || e2x5OverE5x5 > minE2x5OverE5x5Cut_(cand);
62 
63 }
64 
66 value(const reco::CandidatePtr& cand) const {
67  reco::GsfElectronPtr ele(cand);
68  //btw we broke somebodies nice model of assuming every cut is 1D....
69  //what this is returning is fairly meaningless...
70  return ele->full5x5_e1x5() ? ele->full5x5_e2x5Max()/ele->full5x5_e1x5() : 0.;
71 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
float full5x5_e5x5() const
Definition: GsfElectron.h:459
float full5x5_e1x5() const
Definition: GsfElectron.h:457
void getEventContent(const edm::EventBase &) override final
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
bool ev
void setConsumes(edm::ConsumesCollector &) override final
std::unordered_map< std::string, edm::InputTag > contentTags_
CandidateType candidateType() const override final
double value(const reco::CandidatePtr &cand) const override final
float full5x5_e2x5Max() const
Definition: GsfElectron.h:458
result_type operator()(const reco::GsfElectronPtr &) const override final
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:94
edm::Handle< edm::ValueMap< int > > nrSatCrysValueMap_
#define DEFINE_EDM_PLUGIN(factory, type, name)