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 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 }
HLT_2018_cff.weights
weights
Definition: HLT_2018_cff.py:87167
MessageLogger.h
muonisolation::MuIsoBaseIsolator::ISOL_FLOAT_TYPE
Definition: MuIsoBaseIsolator.h:25
muon
Definition: MuonCocktails.h:17
pat::IsoDeposit
reco::IsoDeposit IsoDeposit
Definition: Isolation.h:7
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
MuIsoByTrackPt::isIsolated
bool isIsolated(const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
Definition: MuIsoByTrackPt.cc:47
MuIsoByTrackPt::~MuIsoByTrackPt
~MuIsoByTrackPt() override
Track.h
TrackFwd.h
HLT_2018_cff.coneSize
coneSize
Definition: HLT_2018_cff.py:49353
reco::Track
Definition: Track.h:27
MuIsoByTrackPt::MuIsoByTrackPt
MuIsoByTrackPt(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
Definition: MuIsoByTrackPt.cc:21
MuIsoByTrackPt::setConeSize
void setConeSize(float dr)
Definition: MuIsoByTrackPt.cc:34
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
IsoDepositExtractor.h
edm::ParameterSet
Definition: ParameterSet.h:36
MuIsoByTrackPt::isolation
float isolation(const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
The isolation result for one muon.
Definition: MuIsoByTrackPt.cc:36
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
muonisolation
Definition: CandViewExtractor.h:16
IsolatorByDeposit.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
IsoDepositExtractorFactory.h
reco::IsoDeposit
Definition: IsoDeposit.h:49
muonisolation::MuIsoBaseIsolator::DepositContainer
std::vector< DepositAndVetos > DepositContainer
Definition: MuIsoBaseIsolator.h:23
MuIsoByTrackPt.h
ParameterSet.h
edm::Event
Definition: Event.h:73
CandIsolatorFromDeposits_cfi.deposits
deposits
Definition: CandIsolatorFromDeposits_cfi.py:4
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
isolation
double isolation
Definition: AssociatedVariableMaxCutCandRefSelector.cc:25