CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  : theExtractor(0), theIsolator(0)
24 {
25  edm::ParameterSet extractorPSet = conf.getParameter<edm::ParameterSet>("ExtractorPSet");
26  string extractorName = extractorPSet.getParameter<string>("ComponentName");
27  theExtractor = IsoDepositExtractorFactory::get()->create(extractorName, extractorPSet);
28 
29  theCut = conf.getUntrackedParameter<double>("Threshold", 0.);
30  float coneSize = conf.getUntrackedParameter<double>("ConeSize", 0.);
31  vector<double> weights(1,1.);
32  theIsolator = new IsolatorByDeposit(coneSize, weights);
33 }
34 
36 {
37  delete theExtractor;
38  delete theIsolator;
39 }
40 
42 {
44 }
45 
47 {
48  IsoDeposit dep = extractor()->deposit(ev,es,muon);
50  deposits.push_back(&dep);
51  if (isolator()->resultType() == MuIsoBaseIsolator::ISOL_FLOAT_TYPE){
52  return isolator()->result(deposits).valFloat;
53  }
54 
55  return -999.;
56 }
57 
59 {
60  return (isolation(ev,es,muon) > theCut);
61 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual muonisolation::IsolatorByDeposit * isolator()
virtual reco::isodeposit::IsoDepositExtractor * extractor()
MuIsoByTrackPt(const edm::ParameterSet &conf)
void setConeSize(float dr)
virtual Result result(const DepositContainer &deposits, const edm::Event *=0) const
Compute the deposit within the cone and return the isolation result.
void setConeSize(float conesize)
Compute the count of deposit within the cone and return the isolation result.
virtual ~MuIsoByTrackPt()
tuple conf
Definition: dbtoconf.py:185
std::vector< DepositAndVetos > DepositContainer
reco::IsoDeposit IsoDeposit
Definition: Isolation.h:7
reco::isodeposit::IsoDepositExtractor * theExtractor
virtual float isolation(const edm::Event &, const edm::EventSetup &, const reco::Track &muon)
The isolation result for one muon.
virtual bool isIsolated(const edm::Event &, const edm::EventSetup &, const reco::Track &muon)
muonisolation::IsolatorByDeposit * theIsolator
virtual reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const =0
T get(const Candidate &c)
Definition: component.h:56