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  }
18 
19  ResultType resultType() const override {return ISOL_BOOL_TYPE;}
20 
21  Result result(const DepositContainer& deposits, const edm::Event* = nullptr) const override {
23  answer.valBool = false;
24  // fail miserably...
25  return answer;
26  }
27 
28  Result result(const DepositContainer& deposits, const reco::Track& tk, const edm::Event* = nullptr) const override {
30 
31  muonisolation::Cuts::CutSpec cuts_here = theCuts(tk.eta());
32 
33  double conesize = cuts_here.conesize;
34  double dephlt = 0;
35  unsigned int nDeps = deposits.size();
36  for(unsigned int iDep = 0; iDep < nDeps; ++iDep ){
37  dephlt += deposits[iDep].dep->depositWithin(conesize);
38  }
39  answer.valFloat = dephlt;
40  if (dephlt<cuts_here.threshold) {
41  answer.valBool = true;
42  } else {
43  answer.valBool = false;
44  }
45  return answer;
46  }
47 
48  private:
49 
50  // Isolation cuts
52 
53 
54 };
55 
56 #endif
SimpleCutsIsolator(const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:684
Result result(const DepositContainer &deposits, const reco::Track &tk, const edm::Event *=0) const override
Compute and return the isolation variable, with vetoes and the muon.
muonisolation::Cuts theCuts
Result result(const DepositContainer &deposits, const edm::Event *=0) const override
Compute and return the isolation variable.
std::vector< DepositAndVetos > DepositContainer
answer
Definition: submit.py:45
ResultType resultType() const override