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 
10 IsolatorByDepositCount::IsolatorByDepositCount(const ConeSizeFunction* conesize, const vector<double>& dThresh)
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 }
IsolatorByDepositCount.h
muonisolation::IsolatorByDepositCount::IsolatorByDepositCount
IsolatorByDepositCount(float conesize, const std::vector< double > &thresh)
construct with non-default thresholds per deposit
Definition: IsolatorByDepositCount.cc:7
muonisolation::MuIsoBaseIsolator::DepositAndVetos
Definition: MuIsoBaseIsolator.h:17
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
muonisolation::IsolatorByDepositCount::ConeSizeFunction
Definition: IsolatorByDepositCount.h:20
muonisolation::MuIsoBaseIsolator::DepositAndVetos::dep
const reco::IsoDeposit * dep
Definition: MuIsoBaseIsolator.h:20
muonisolation::MuIsoBaseIsolator::Result
Definition: MuIsoBaseIsolator.h:27
reco::IsoDeposit::depositAndCountWithin
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
pat::IsoDeposit
reco::IsoDeposit IsoDeposit
Definition: Isolation.h:7
muonisolation::IsolatorByDepositCount::coneSize
virtual float coneSize(float eta, float pT) const
Get the cone size.
Definition: IsolatorByDepositCount.h:42
PVValHelper::eta
Definition: PVValidationHelpers.h:69
muonisolation::IsolatorByDepositCount::resultType
ResultType resultType() const override
Definition: IsolatorByDepositCount.h:46
res
Definition: Electron.h:6
muonisolation
Definition: CandViewExtractor.h:16
muonisolation::IsolatorByDepositCount::DepositContainer
MuIsoBaseIsolator::DepositContainer DepositContainer
Definition: IsolatorByDepositCount.h:18
muonisolation::MuIsoBaseIsolator::ISOL_INVALID_TYPE
Definition: MuIsoBaseIsolator.h:25
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
muonisolation::IsolatorByDepositCount::theDepThresholds
std::vector< double > theDepThresholds
Definition: IsolatorByDepositCount.h:51
edm::Event
Definition: Event.h:73
CandIsolatorFromDeposits_cfi.deposits
deposits
Definition: CandIsolatorFromDeposits_cfi.py:4
muonisolation::MuIsoBaseIsolator::DepositAndVetos::vetos
const Vetos * vetos
Definition: MuIsoBaseIsolator.h:21
muonisolation::IsolatorByDepositCount::result
Result result(const DepositContainer &deposits, const edm::Event *=nullptr) const override
Compute the deposit within the cone and return the isolation result.
Definition: IsolatorByDepositCount.cc:13