CMS 3D CMS Logo

IsolatorByDeposit.h
Go to the documentation of this file.
1 #ifndef MuonIsolation_IsolatorByDeposit_H
2 #define MuonIsolation_IsolatorByDeposit_H
3 
13 #include <vector>
14 
15 namespace muonisolation {
17  public:
19 
21  virtual ~ConeSizeFunction() = default;
22  virtual float coneSize(float eta, float pt) const = 0;
23  };
24 
26  IsolatorByDeposit(float conesize, const std::vector<double>& weights);
27  IsolatorByDeposit(const ConeSizeFunction* conesize, const std::vector<double>& weights);
28 
30  IsolatorByDeposit(float conesize, const std::vector<double>& weights, const std::vector<double>& thresh);
31  IsolatorByDeposit(const ConeSizeFunction* conesize,
32  const std::vector<double>& weights,
33  const std::vector<double>& thresh);
34 
35  ~IsolatorByDeposit() override {}
36 
38  virtual void setWeights(const std::vector<double>& weights) { theWeights = weights; }
39 
41  Result result(const DepositContainer& deposits, const edm::Event* = nullptr) const override;
42 
44  /* virtual int resultInt(DepositContainer deposits) const; */
45 
46  void setConeSize(float conesize) {
47  theConeSize = conesize;
48  theConeSizeFunction = nullptr;
49  }
50 
51  void setConeSize(ConeSizeFunction* conesize) { theConeSizeFunction = conesize; }
52 
54  virtual float coneSize(float eta, float pT) const {
56  }
57 
58  ResultType resultType() const override { return ISOL_FLOAT_TYPE; }
59 
60  private:
61  // Compute the weighted sum of deposits of different type within dRcone
62  double weightedSum(const DepositContainer& deposits, float dRcone) const;
63 
64  private:
66  float theConeSize;
67  std::vector<double> theWeights;
68  std::vector<double> theDepThresholds;
69  };
70 } // namespace muonisolation
71 
72 #endif
Result result(const DepositContainer &deposits, const edm::Event *=0) const override
Compute the deposit within the cone and return the isolation result.
std::vector< double > theDepThresholds
double weightedSum(const DepositContainer &deposits, float dRcone) const
ResultType resultType() const override
virtual float coneSize(float eta, float pt) const =0
virtual float coneSize(float eta, float pT) const
Get the cone size.
IsolatorByDeposit(float conesize, const std::vector< double > &weights)
construct with no addtnl thresholds on deposits
MuIsoBaseIsolator::DepositContainer DepositContainer
virtual void setWeights(const std::vector< double > &weights)
Set the weights for summing deposits of different types.
void setConeSize(float conesize)
Compute the count of deposit within the cone and return the isolation result.
std::vector< double > theWeights
const ConeSizeFunction * theConeSizeFunction
std::vector< DepositAndVetos > DepositContainer
void setConeSize(ConeSizeFunction *conesize)