CMS 3D CMS Logo

SimpleCutsIsolator.h
Go to the documentation of this file.
1 #ifndef SimpleCutsIsolator_H
2 #define SimpleCutsIsolator_H
3 
6 
9 
11 public:
13  : theCuts(par.getParameter<std::vector<double> >("EtaBounds"),
14  par.getParameter<std::vector<double> >("ConeSizes"),
15  par.getParameter<std::vector<double> >("Thresholds")) {}
16 
17  ResultType resultType() const override { return ISOL_BOOL_TYPE; }
18 
19  Result result(const DepositContainer& deposits, const edm::Event* = nullptr) const override {
20  Result answer(ISOL_BOOL_TYPE);
21  answer.valBool = false;
22  // fail miserably...
23  return answer;
24  }
25 
26  Result result(const DepositContainer& deposits, const reco::Track& tk, const edm::Event* = nullptr) const override {
27  Result answer(ISOL_BOOL_TYPE);
28 
29  muonisolation::Cuts::CutSpec cuts_here = theCuts(tk.eta());
30 
31  double conesize = cuts_here.conesize;
32  double dephlt = 0;
33  unsigned int nDeps = deposits.size();
34  for (unsigned int iDep = 0; iDep < nDeps; ++iDep) {
35  dephlt += deposits[iDep].dep->depositWithin(conesize);
36  }
37  answer.valFloat = dephlt;
38  if (dephlt < cuts_here.threshold) {
39  answer.valBool = true;
40  } else {
41  answer.valBool = false;
42  }
43  return answer;
44  }
45 
46 private:
47  // Isolation cuts
49 };
50 
51 #endif
Result result(const DepositContainer &deposits, const edm::Event *=nullptr) const override
Compute and return the isolation variable.
SimpleCutsIsolator(const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
muonisolation::Cuts theCuts
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
std::vector< DepositAndVetos > DepositContainer
ResultType resultType() const override
Result result(const DepositContainer &deposits, const reco::Track &tk, const edm::Event *=nullptr) const override
Compute and return the isolation variable, with vetoes and the muon.