CMS 3D CMS Logo

IsolatorByDepositCount.cc
Go to the documentation of this file.
2 
3 using std::vector;
4 using reco::IsoDeposit;
5 using namespace muonisolation;
6 
7 IsolatorByDepositCount::IsolatorByDepositCount(float conesize, const vector<double>& dThresh)
8  : theConeSizeFunction(nullptr), theConeSize(conesize), theDepThresholds(dThresh)
9 { }
10 
12  const vector<double>& dThresh)
13  : theConeSizeFunction(conesize), theConeSize(0.), theDepThresholds(dThresh)
14 { }
15 
17  if (deposits.empty()) return Result(resultType());
18  if (deposits.size()>1){ return Result(ISOL_INVALID_TYPE);
19  }
20 
21  // To determine the threshold, the direction of the cone of the first
22  // set of deposits is used.
23  // For algorithms where different cone axis definitions are used
24  // for different types deposits (eg. HCAL and ECAL deposits for
25  // calorimeter isolation), the first one is used to determine the threshold
26  // value!
27  float eta = deposits.front().dep->eta();
28  float pt = deposits.front().dep->candEnergy();
29  float dr= coneSize(eta,pt);
30  DepositAndVetos depVet = deposits.front();
31  std::pair<double, int> sumAndCount = depVet.dep->depositAndCountWithin(dr, *depVet.vetos, theDepThresholds.front());
32 
33 
34  Result res(resultType());
35  res.valInt = sumAndCount.second;
36  return res;
37 }
#define nullptr
IsolatorByDepositCount(float conesize, const std::vector< double > &thresh)
construct with non-default thresholds per deposit
Definition: Electron.h:6
MuIsoBaseIsolator::DepositContainer DepositContainer
virtual float coneSize(float eta, float pT) const
Get the cone size.
Result result(const DepositContainer &deposits, const edm::Event *=0) const override
Compute the deposit within the cone and return the isolation result.
reco::IsoDeposit IsoDeposit
Definition: Isolation.h:7
std::pair< double, int > depositAndCountWithin(double coneSize, const Vetos &vetos=Vetos(), double threshold=-1e+36, bool skipDepositVeto=false) const
Get deposit.
Definition: IsoDeposit.cc:44