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
muonisolation::MuIsoBaseIsolator::Result::Result
Result(ResultType typ)
Definition: MuIsoBaseIsolator.h:30
muonisolation::MuIsoBaseIsolator::ISOL_BOOL_TYPE
Definition: MuIsoBaseIsolator.h:25
muonisolation::MuIsoBaseIsolator::ISOL_FLOAT_TYPE
Definition: MuIsoBaseIsolator.h:25
funct::false
false
Definition: Factorize.h:29
muonisolation::MuIsoBaseIsolator::Result::valBool
bool valBool
Definition: MuIsoBaseIsolator.h:37
muonisolation::MuIsoBaseIsolator::Result::typeF_
ResultType typeF_
Definition: MuIsoBaseIsolator.h:41
muonisolation::MuIsoBaseIsolator::DepositAndVetos::DepositAndVetos
DepositAndVetos(const reco::IsoDeposit *depA, const Vetos *vetosA=nullptr)
Definition: MuIsoBaseIsolator.h:19
muon
Definition: MuonCocktails.h:17
muonisolation::MuIsoBaseIsolator::DepositAndVetos
Definition: MuIsoBaseIsolator.h:17
muonisolation::MuIsoBaseIsolator::DepositAndVetos::dep
const reco::IsoDeposit * dep
Definition: MuIsoBaseIsolator.h:20
muonisolation::MuIsoBaseIsolator::Result
Definition: MuIsoBaseIsolator.h:27
muonisolation::MuIsoBaseIsolator::result
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.
Definition: MuIsoBaseIsolator.h:49
muonisolation::MuIsoBaseIsolator::Result::valInt
int valInt
Definition: MuIsoBaseIsolator.h:35
reco::IsoDeposit::Veto
Definition: IsoDeposit.h:59
muonisolation::MuIsoBaseIsolator::Veto
reco::IsoDeposit::Veto Veto
Definition: MuIsoBaseIsolator.h:14
muonisolation::MuIsoBaseIsolator::ISOL_INT_TYPE
Definition: MuIsoBaseIsolator.h:25
Track.h
muonisolation::MuIsoBaseIsolator::result
virtual Result result(const DepositContainer &deposits, const edm::Event *=nullptr) const =0
Compute and return the isolation variable.
muonisolation::MuIsoBaseIsolator
Definition: MuIsoBaseIsolator.h:12
muonisolation::MuIsoBaseIsolator::Result::val
T val() const
muonisolation::MuIsoBaseIsolator::resultType
virtual ResultType resultType() const =0
reco::Track
Definition: Track.h:27
muonisolation::MuIsoBaseIsolator::Vetos
reco::IsoDeposit::Vetos Vetos
Definition: MuIsoBaseIsolator.h:15
muonisolation::MuIsoBaseIsolator::~MuIsoBaseIsolator
virtual ~MuIsoBaseIsolator()
Definition: MuIsoBaseIsolator.h:44
IsoDeposit.h
muonisolation::MuIsoBaseIsolator::ResultType
ResultType
Definition: MuIsoBaseIsolator.h:25
Event.h
muonisolation::MuIsoBaseIsolator::result
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.
Definition: MuIsoBaseIsolator.h:55
muonisolation::MuIsoBaseIsolator::Result::typeF
ResultType typeF() const
Definition: MuIsoBaseIsolator.h:38
reco::Candidate
Definition: Candidate.h:27
muonisolation
Definition: CandViewExtractor.h:16
muonisolation::MuIsoBaseIsolator::ISOL_INVALID_TYPE
Definition: MuIsoBaseIsolator.h:25
T
long double T
Definition: Basic3DVectorLD.h:48
reco::IsoDeposit
Definition: IsoDeposit.h:49
muonisolation::MuIsoBaseIsolator::Result::valFloat
float valFloat
Definition: MuIsoBaseIsolator.h:36
muonisolation::MuIsoBaseIsolator::DepositContainer
std::vector< DepositAndVetos > DepositContainer
Definition: MuIsoBaseIsolator.h:23
Candidate.h
edm::Event
Definition: Event.h:73
reco::IsoDeposit::Vetos
std::vector< Veto > Vetos
Definition: IsoDeposit.h:65
CandIsolatorFromDeposits_cfi.deposits
deposits
Definition: CandIsolatorFromDeposits_cfi.py:4
muonisolation::MuIsoBaseIsolator::DepositAndVetos::DepositAndVetos
DepositAndVetos()
Definition: MuIsoBaseIsolator.h:18
muonisolation::MuIsoBaseIsolator::DepositAndVetos::vetos
const Vetos * vetos
Definition: MuIsoBaseIsolator.h:21
muonisolation::MuIsoBaseIsolator::Result::Result
Result()
Definition: MuIsoBaseIsolator.h:29