RecoMuon
MuonIsolation
src
MuIsoByTrackPt.cc
Go to the documentation of this file.
1
#include "
RecoMuon/MuonIsolation/interface/MuIsoByTrackPt.h
"
2
3
#include "
PhysicsTools/IsolationAlgos/interface/IsoDepositExtractor.h
"
4
#include "
PhysicsTools/IsolationAlgos/interface/IsoDepositExtractorFactory.h
"
5
#include "
RecoMuon/MuonIsolation/interface/IsolatorByDeposit.h
"
6
7
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
8
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
9
10
#include "
DataFormats/TrackReco/interface/Track.h
"
11
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
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
21
MuIsoByTrackPt::MuIsoByTrackPt
(
const
edm::ParameterSet
& conf,
edm::ConsumesCollector
&& iC) {
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
32
MuIsoByTrackPt::~MuIsoByTrackPt
() =
default
;
33
34
void
MuIsoByTrackPt::setConeSize
(
float
dr
) { theIsolator->setConeSize(
dr
); }
35
36
float
MuIsoByTrackPt::isolation
(
const
edm::Event
&
ev
,
const
edm::EventSetup
& es,
const
reco::Track
&
muon
) {
37
IsoDeposit
dep = extractor()->deposit(
ev
, es,
muon
);
38
MuIsoBaseIsolator::DepositContainer
deposits
;
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
47
bool
MuIsoByTrackPt::isIsolated
(
const
edm::Event
&
ev
,
const
edm::EventSetup
& es,
const
reco::Track
&
muon
) {
48
return
(
isolation
(
ev
, es,
muon
) > theCut);
49
}
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_FULL_cff.weights
weights
Definition:
HLT_FULL_cff.py:99166
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:47
HLT_FULL_cff.coneSize
coneSize
Definition:
HLT_FULL_cff.py:50853
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
trackerHitRTTI::vector
Definition:
trackerHitRTTI.h:21
edm::EventSetup
Definition:
EventSetup.h:58
get
#define get
muonisolation
Definition:
CandViewExtractor.h:16
IsolatorByDeposit.h
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
flavorHistoryFilter_cfi.dr
dr
Definition:
flavorHistoryFilter_cfi.py:37
IsoDepositExtractorFactory.h
reco::IsoDeposit
Definition:
IsoDeposit.h:49
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
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:45
isolation
double isolation
Definition:
AssociatedVariableMaxCutCandRefSelector.cc:25
Generated for CMSSW Reference Manual by
1.8.16