Go to the documentation of this file.00001 #include "RecoMuon/MuonIsolation/interface/IsolatorByDepositCount.h"
00002
00003 using std::vector;
00004 using reco::IsoDeposit;
00005 using namespace muonisolation;
00006
00007 IsolatorByDepositCount::IsolatorByDepositCount(float conesize, const vector<double>& dThresh)
00008 : theConeSizeFunction(0), theConeSize(conesize), theDepThresholds(dThresh)
00009 { }
00010
00011 IsolatorByDepositCount::IsolatorByDepositCount(const ConeSizeFunction * conesize,
00012 const vector<double>& dThresh)
00013 : theConeSizeFunction(conesize), theConeSize(0.), theDepThresholds(dThresh)
00014 { }
00015
00016 MuIsoBaseIsolator::Result IsolatorByDepositCount::result(const DepositContainer& deposits, const edm::Event*) const{
00017 if (deposits.empty()) return Result(resultType());
00018 if (deposits.size()>1){ return Result(ISOL_INVALID_TYPE);
00019 }
00020
00021
00022
00023
00024
00025
00026
00027 float eta = deposits.front().dep->eta();
00028 float pt = deposits.front().dep->candEnergy();
00029 float dr= coneSize(eta,pt);
00030 DepositAndVetos depVet = deposits.front();
00031 std::pair<double, int> sumAndCount = depVet.dep->depositAndCountWithin(dr, *depVet.vetos, theDepThresholds.front());
00032
00033
00034 Result res(resultType());
00035 res.valInt = sumAndCount.second;
00036 return res;
00037 }