CMS 3D CMS Logo

IsolatorByDepositCount.cc
Go to the documentation of this file.
2 
3 using reco::IsoDeposit;
4 using std::vector;
5 using namespace muonisolation;
6 
7 IsolatorByDepositCount::IsolatorByDepositCount(float conesize, const vector<double>& dThresh)
8  : theConeSizeFunction(nullptr), theConeSize(conesize), theDepThresholds(dThresh) {}
9 
11  : theConeSizeFunction(conesize), theConeSize(0.), theDepThresholds(dThresh) {}
12 
14  if (deposits.empty())
15  return Result(resultType());
16  if (deposits.size() > 1) {
17  return Result(ISOL_INVALID_TYPE);
18  }
19 
20  // To determine the threshold, the direction of the cone of the first
21  // set of deposits is used.
22  // For algorithms where different cone axis definitions are used
23  // for different types deposits (eg. HCAL and ECAL deposits for
24  // calorimeter isolation), the first one is used to determine the threshold
25  // value!
26  float eta = deposits.front().dep->eta();
27  float pt = deposits.front().dep->candEnergy();
28  float dr = coneSize(eta, pt);
29  DepositAndVetos depVet = deposits.front();
30  std::pair<double, int> sumAndCount = depVet.dep->depositAndCountWithin(dr, *depVet.vetos, theDepThresholds.front());
31 
33  res.valInt = sumAndCount.second;
34  return res;
35 }
Result result(const DepositContainer &deposits, const edm::Event *=nullptr) const override
Compute the deposit within the cone and return the isolation result.
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.
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:37