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 
14  public:
17 
18  struct DepositAndVetos {
20  DepositAndVetos(const reco::IsoDeposit* depA, const Vetos* vetosA = nullptr):
21  dep(depA), vetos(vetosA) {}
23  const Vetos* vetos;
24  };
25  typedef std::vector<DepositAndVetos> DepositContainer;
26 
27  enum ResultType {
32  };
33 
34  class Result {
35  public:
36  Result() : valInt(-999), valFloat(-999), valBool(false), typeF_(ISOL_INVALID_TYPE) {}
37  Result(ResultType typ) : valInt(-999), valFloat(-999.), valBool(false), typeF_(typ) {}
38 
39  template <typename T> T val() const;
40 
41  int valInt;
42  float valFloat;
43  bool valBool;
44  ResultType typeF() const {return typeF_;}
45 
46  protected:
48  };
49 
50 
51  virtual ~MuIsoBaseIsolator(){}
52 
54  virtual Result result(const DepositContainer& deposits, const edm::Event* = nullptr) const = 0;
56  virtual Result result(const DepositContainer& deposits, const reco::Candidate& muon, const edm::Event* = nullptr) const {
57  return result(deposits);
58  }
60  virtual Result result(const DepositContainer& deposits, const reco::Track& muon, const edm::Event* = nullptr) const {
61  return result(deposits);
62  }
63 
64  virtual ResultType resultType() const = 0;
65 
66  };
67 
68  template<> inline int MuIsoBaseIsolator::Result::val<int>() const { return valInt;}
69  template<> inline float MuIsoBaseIsolator::Result::val<float>() const { return valFloat;}
70  template<> inline bool MuIsoBaseIsolator::Result::val<bool>() const { return valBool;}
71 
72 }
73 #endif
74 
#define nullptr
reco::IsoDeposit::Vetos Vetos
virtual Result result(const DepositContainer &deposits, const reco::Candidate &muon, const edm::Event *=0) const
Compute and return the isolation variable, with vetoes and the muon.
virtual Result result(const DepositContainer &deposits, const reco::Track &muon, const edm::Event *=0) const
Compute and return the isolation variable, with vetoes and the muon.
virtual ResultType resultType() const =0
std::vector< DepositAndVetos > DepositContainer
std::vector< Veto > Vetos
Definition: IsoDeposit.h:63
virtual Result result(const DepositContainer &deposits, const edm::Event *=0) const =0
Compute and return the isolation variable.
long double T
DepositAndVetos(const reco::IsoDeposit *depA, const Vetos *vetosA=0)