CMS 3D CMS Logo

MuIsoBaseIsolator.h
Go to the documentation of this file.
1 #ifndef MuonIsolation_MuIsoBaseIsolator_H
2 #define MuonIsolation_MuIsoBaseIsolator_H
3 
4 #include <vector>
6 
10 
11 namespace muonisolation {
13  public:
16 
17  struct DepositAndVetos {
18  DepositAndVetos() : dep(nullptr), vetos(nullptr) {}
19  DepositAndVetos(const reco::IsoDeposit* depA, const Vetos* vetosA = nullptr) : dep(depA), vetos(vetosA) {}
21  const Vetos* vetos;
22  };
23  typedef std::vector<DepositAndVetos> DepositContainer;
24 
26 
27  class Result {
28  public:
30  Result(ResultType typ) : valInt(-999), valFloat(-999.), valBool(false), typeF_(typ) {}
31 
32  template <typename T>
33  T val() const;
34 
35  int valInt;
36  float valFloat;
37  bool valBool;
38  ResultType typeF() const { return typeF_; }
39 
40  protected:
42  };
43 
44  virtual ~MuIsoBaseIsolator() {}
45 
47  virtual Result result(const DepositContainer& deposits, const edm::Event* = nullptr) const = 0;
50  const reco::Candidate& muon,
51  const edm::Event* = nullptr) const {
52  return result(deposits);
53  }
56  const reco::Track& muon,
57  const edm::Event* = nullptr) const {
58  return result(deposits);
59  }
60 
61  virtual ResultType resultType() const = 0;
62  };
63 
64  template <>
65  inline int MuIsoBaseIsolator::Result::val<int>() const {
66  return valInt;
67  }
68  template <>
69  inline float MuIsoBaseIsolator::Result::val<float>() const {
70  return valFloat;
71  }
72  template <>
73  inline bool MuIsoBaseIsolator::Result::val<bool>() const {
74  return valBool;
75  }
76 
77 } // namespace muonisolation
78 #endif
virtual Result result(const DepositContainer &deposits, const reco::Candidate &muon, const edm::Event *=nullptr) const
Compute and return the isolation variable, with vetoes and the muon.
virtual Result result(const DepositContainer &deposits, const edm::Event *=nullptr) const =0
Compute and return the isolation variable.
reco::IsoDeposit::Vetos Vetos
DepositAndVetos(const reco::IsoDeposit *depA, const Vetos *vetosA=nullptr)
virtual ResultType resultType() const =0
std::vector< DepositAndVetos > DepositContainer
std::vector< Veto > Vetos
Definition: IsoDeposit.h:65
virtual Result result(const DepositContainer &deposits, const reco::Track &muon, const edm::Event *=nullptr) const
Compute and return the isolation variable, with vetoes and the muon.
long double T