CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SimpleCutsIsolator.h
Go to the documentation of this file.
1 #ifndef SimpleCutsIsolator_H
2 #define SimpleCutsIsolator_H
3 
6 
8 
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  virtual ResultType resultType() const {return ISOL_BOOL_TYPE;}
20 
21  virtual Result result(const DepositContainer& deposits, const edm::Event* = 0) const {
23  answer.valBool = false;
24  // fail miserably...
25  return answer;
26  }
27 
28  virtual Result result(const DepositContainer& deposits, const reco::Track& tk, const edm::Event* = 0) const {
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
answer
Definition: submit.py:44
SimpleCutsIsolator(const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:604
virtual Result result(const DepositContainer &deposits, const reco::Track &tk, const edm::Event *=0) const
Compute and return the isolation variable, with vetoes and the muon.
muonisolation::Cuts theCuts
std::vector< DepositAndVetos > DepositContainer
virtual Result result(const DepositContainer &deposits, const edm::Event *=0) const
Compute and return the isolation variable.
virtual ResultType resultType() const