CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/RecoMuon/MuonIsolation/interface/IsolatorByDeposit.h

Go to the documentation of this file.
00001 #ifndef MuonIsolation_IsolatorByDeposit_H
00002 #define MuonIsolation_IsolatorByDeposit_H
00003 
00014 #include "RecoMuon/MuonIsolation/interface/MuIsoBaseIsolator.h"
00015 #include <vector>
00016 
00017 
00018 namespace muonisolation {
00019 class IsolatorByDeposit : public MuIsoBaseIsolator {
00020 public:
00021   typedef MuIsoBaseIsolator::DepositContainer DepositContainer;
00022 
00023   struct ConeSizeFunction {
00024    virtual float  coneSize( float eta, float pt) const = 0;
00025   };
00026 
00028   IsolatorByDeposit(float conesize, const  std::vector<double> & weights);
00029   IsolatorByDeposit(const ConeSizeFunction * conesize, const std::vector<double> & weights);
00030 
00032   IsolatorByDeposit(float conesize, 
00033                     const std::vector<double> & weights, const std::vector<double>& thresh);
00034   IsolatorByDeposit(const ConeSizeFunction * conesize, 
00035                     const std::vector<double> & weights, const std::vector<double>& thresh);
00036 
00037   virtual ~IsolatorByDeposit() {}
00038 
00040   virtual void setWeights(const std::vector<double>& weights) {theWeights=weights;}
00041 
00043   virtual Result result(DepositContainer deposits) const;
00044 
00046 /*   virtual int resultInt(DepositContainer deposits) const; */
00047 
00048 
00049 
00050   void setConeSize(float conesize) { theConeSize = conesize; theConeSizeFunction = 0;} 
00051 
00052   void setConeSize(ConeSizeFunction * conesize) { theConeSizeFunction = conesize; }
00053 
00054 
00056   virtual float coneSize(float eta, float pT) const {
00057     return theConeSizeFunction ? theConeSizeFunction->coneSize(eta,pT) : theConeSize;
00058   }
00059 
00060   virtual ResultType resultType() const { return ISOL_FLOAT_TYPE;}
00061 
00062 
00063 private:
00064   // Compute the weighted sum of deposits of different type within dRcone
00065   double weightedSum(const DepositContainer& deposits, float dRcone) const;
00066 
00067 private:
00068   const ConeSizeFunction * theConeSizeFunction;
00069   float theConeSize;
00070   std::vector<double> theWeights;
00071   std::vector<double> theDepThresholds;
00072 };
00073 }
00074 
00075 #endif