CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/RecoMuon/MuonIsolation/src/IsolatorByDepositCount.cc

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(DepositContainer deposits) const{
00017   if (deposits.empty()) return Result(resultType());
00018   if (deposits.size()>1){    return Result(ISOL_INVALID_TYPE);
00019   }
00020 
00021   // To determine the threshold, the direction of the cone of the first
00022   // set of deposits is used.
00023   // For algorithms where different cone axis definitions are used
00024   // for different types deposits (eg. HCAL and ECAL deposits for
00025   // calorimeter isolation), the first one is used to determine the threshold
00026   // value!
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 }