File indexing completed on 2024-04-06 12:27:04
0001 #ifndef MuonIsolation_IsolatorByDepositCount_H
0002 #define MuonIsolation_IsolatorByDepositCount_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "RecoMuon/MuonIsolation/interface/MuIsoBaseIsolator.h"
0013 #include <vector>
0014
0015 namespace muonisolation {
0016 class IsolatorByDepositCount : public MuIsoBaseIsolator {
0017 public:
0018 typedef MuIsoBaseIsolator::DepositContainer DepositContainer;
0019
0020 struct ConeSizeFunction {
0021 virtual ~ConeSizeFunction() = default;
0022 virtual float coneSize(float eta, float pt) const = 0;
0023 };
0024
0025
0026 IsolatorByDepositCount(float conesize, const std::vector<double>& thresh);
0027 IsolatorByDepositCount(const ConeSizeFunction* conesize, const std::vector<double>& thresh);
0028
0029 ~IsolatorByDepositCount() override = default;
0030
0031
0032 Result result(const DepositContainer& deposits, const edm::Event* = nullptr) const override;
0033
0034 void setConeSize(float conesize) {
0035 theConeSize = conesize;
0036 theConeSizeFunction = nullptr;
0037 }
0038
0039 void setConeSize(ConeSizeFunction* conesize) { theConeSizeFunction = conesize; }
0040
0041
0042 virtual float coneSize(float eta, float pT) const {
0043 return theConeSizeFunction ? theConeSizeFunction->coneSize(eta, pT) : theConeSize;
0044 }
0045
0046 ResultType resultType() const override { return ISOL_INT_TYPE; }
0047
0048 private:
0049 const ConeSizeFunction* theConeSizeFunction;
0050 float theConeSize;
0051 std::vector<double> theDepThresholds;
0052 };
0053 }
0054
0055 #endif