CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MuIsoByTrackPt.cc
Go to the documentation of this file.
2 
6 
9 
12 
13 #include <vector>
14 #include <iostream>
15 
16 using reco::IsoDeposit;
17 using std::string;
18 using std::vector;
19 using namespace muonisolation;
20 
22  edm::ParameterSet extractorPSet = conf.getParameter<edm::ParameterSet>("ExtractorPSet");
23  string extractorName = extractorPSet.getParameter<string>("ComponentName");
24  theExtractor = IsoDepositExtractorFactoryFromHelper::get()->create(extractorName, extractorPSet, iC);
25 
26  theCut = conf.getUntrackedParameter<double>("Threshold", 0.);
27  float coneSize = conf.getUntrackedParameter<double>("ConeSize", 0.);
28  vector<double> weights(1, 1.);
29  theIsolator = std::make_unique<IsolatorByDeposit>(coneSize, weights);
30 }
31 
33 
34 void MuIsoByTrackPt::setConeSize(float dr) { theIsolator->setConeSize(dr); }
35 
37  IsoDeposit dep = extractor()->deposit(ev, es, muon);
39  deposits.push_back(&dep);
40  if (isolator()->resultType() == MuIsoBaseIsolator::ISOL_FLOAT_TYPE) {
41  return isolator()->result(deposits).valFloat;
42  }
43 
44  return -999.;
45 }
46 
48  return (isolation(ev, es, muon) > theCut);
49 }
T getUntrackedParameter(std::string const &, T const &) const
MuIsoByTrackPt(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
~MuIsoByTrackPt() override
bool ev
void setConeSize(float dr)
float isolation(const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
The isolation result for one muon.
std::vector< DepositAndVetos > DepositContainer
reco::IsoDeposit IsoDeposit
Definition: Isolation.h:7
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool isIsolated(const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
#define get