Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:04

0001 #ifndef MuonIsolation_IsolatorByDepositCount_H
0002 #define MuonIsolation_IsolatorByDepositCount_H
0003 
0004 /** \class IsolatorByDepositCount
0005  *  Define the isolation variable simply as the deposit within the cone.
0006  *  This is the simplest definition possible, for isolation algorithms
0007  *  where the cut is directly on, e.g., the deposited energy.
0008  *
0009  *  \author M. Konecki, N. Amapane
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     //! construct with non-default thresholds per deposit
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     //! Compute the deposit within the cone and return the isolation result
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     //! Get the cone size
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 }  // namespace muonisolation
0054 
0055 #endif