CMS 3D CMS Logo

MuIsoByTrackPt.cc
Go to the documentation of this file.
2 
6 
9 
12 
13 #include <vector>
14 #include <iostream>
15 
16 using std::vector;
17 using std::string;
18 using reco::IsoDeposit;
19 using namespace muonisolation;
20 
21 
23 {
24  edm::ParameterSet extractorPSet = conf.getParameter<edm::ParameterSet>("ExtractorPSet");
25  string extractorName = extractorPSet.getParameter<string>("ComponentName");
26  theExtractor = std::unique_ptr<reco::isodeposit::IsoDepositExtractor>(IsoDepositExtractorFactoryFromHelper::get()->create(extractorName, extractorPSet, iC));
27 
28  theCut = conf.getUntrackedParameter<double>("Threshold", 0.);
29  float coneSize = conf.getUntrackedParameter<double>("ConeSize", 0.);
30  vector<double> weights(1,1.);
31  theIsolator = std::make_unique<IsolatorByDeposit>(coneSize, weights);
32 }
33 
35 
37 {
38  theIsolator->setConeSize(dr);
39 }
40 
42 {
43  IsoDeposit dep = extractor()->deposit(ev,es,muon);
45  deposits.push_back(&dep);
46  if (isolator()->resultType() == MuIsoBaseIsolator::ISOL_FLOAT_TYPE){
47  return isolator()->result(deposits).valFloat;
48  }
49 
50  return -999.;
51 }
52 
54 {
55  return (isolation(ev,es,muon) > theCut);
56 }
T getParameter(std::string const &) const
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
bool isIsolated(const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
T get(const Candidate &c)
Definition: component.h:55