Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:20:37

0001 #ifndef MuonIsolation_IsolatorByNominalEfficiency_H
0002 #define MuonIsolation_IsolatorByNominalEfficiency_H
0003 
0004 /** \class IsolatorByNominalEfficiency
0005  *  Computes the isolation variable as "nominal efficiency",
0006  *  defined so that a cut at a value X will give X efficiency
0007  *  on the reference signal (W->munu). See CMS/Note 2002/040 for details.
0008  *
0009  *  \author M. Konecki, N. Amapane
0010  */
0011 
0012 #include "RecoMuon/MuonIsolation/interface/MuIsoBaseIsolator.h"
0013 #include "RecoMuon/MuonIsolation/interface/Cuts.h"
0014 #include <vector>
0015 #include <string>
0016 
0017 namespace muonisolation {
0018   class NominalEfficiencyThresholds;
0019 }
0020 
0021 namespace muonisolation {
0022   class IsolatorByNominalEfficiency : public MuIsoBaseIsolator {
0023   public:
0024     typedef MuIsoBaseIsolator::DepositContainer DepositContainer;
0025 
0026     //! Constructor
0027     IsolatorByNominalEfficiency(const std::string& thrFile,
0028                                 const std::vector<std::string>& ceff,
0029                                 const std::vector<double>& weights);
0030 
0031     IsolatorByNominalEfficiency(const std::string& thrFile,
0032                                 const std::vector<std::string>& ceff,
0033                                 const std::vector<double>& weights,
0034                                 const std::vector<double>& thresh);
0035 
0036     ~IsolatorByNominalEfficiency() override;
0037 
0038     //! Compute the deposit within the cone and return the isolation result
0039     Result result(const DepositContainer& deposits, const edm::Event* = nullptr) const override;
0040 
0041     Cuts cuts(float nominalEfficiency) const;
0042 
0043   private:
0044     class ConeSizes {
0045     private:
0046       enum IsoDim { DIM = 15 };
0047       static const float cone_dr[DIM];
0048 
0049     public:
0050       int dim() const { return DIM; }
0051       double size(int i) const;
0052       int index(float dr) const;
0053     };
0054 
0055     // Compute the weighted sum of deposits of different type within dRcone
0056     virtual double weightedSum(const DepositContainer& deposits, float dRcone) const;
0057 
0058     // Size of cone for a given nominal efficiency value.
0059     int bestConeForEfficiencyIndex(float eff_thr) const;
0060 
0061     typedef std::multimap<float, int> mapNomEff_Cone;
0062     mapNomEff_Cone cones(const std::vector<std::string>& names);
0063 
0064     std::string findPath(const std::string& fileName);
0065 
0066     ResultType resultType() const override { return ISOL_FLOAT_TYPE; }
0067 
0068   private:
0069     mapNomEff_Cone coneForEfficiency;
0070     NominalEfficiencyThresholds* thresholds;
0071     std::vector<double> theWeights;
0072     std::vector<double> theDepThresholds;
0073     ConeSizes theConesInfo;
0074   };
0075 }  // namespace muonisolation
0076 
0077 #endif