CMS 3D CMS Logo

MuPFIsoHelper.cc
Go to the documentation of this file.
2 
3 MuPFIsoHelper::MuPFIsoHelper(const std::map<std::string, edm::ParameterSet>& labelMap, edm::ConsumesCollector&& iC)
4  : labelMap_(labelMap) {
6  for (std::map<std::string, edm::ParameterSet>::const_iterator i = labelMap_.begin(); i != labelMap_.end(); ++i) {
7  chargedParticle_.push_back(nullHandle);
8  chargedHadron_.push_back(nullHandle);
9  neutralHadron_.push_back(nullHandle);
10  neutralHadronHighThreshold_.push_back(nullHandle);
11  photon_.push_back(nullHandle);
12  photonHighThreshold_.push_back(nullHandle);
13  pu_.push_back(nullHandle);
14 
15  chargedParticleToken_.push_back(
16  iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("chargedParticle")));
17  chargedHadronToken_.push_back(iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("chargedHadron")));
18  neutralHadronToken_.push_back(iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("neutralHadron")));
20  iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("neutralHadronHighThreshold")));
21  photonToken_.push_back(iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("photon")));
22  photonHighThresholdToken_.push_back(
23  iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("photonHighThreshold")));
24  puToken_.push_back(iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("pu")));
25  }
26 }
27 
29 
39  if (chargedParticle.isValid())
40  iso.sumChargedParticlePt = (*chargedParticle)[muonRef];
41 
42  if (chargedHadron.isValid())
43  iso.sumChargedHadronPt = (*chargedHadron)[muonRef];
44 
45  if (neutralHadron.isValid())
46  iso.sumNeutralHadronEt = (*neutralHadron)[muonRef];
47 
48  if (neutralHadronHighThreshold.isValid())
50 
51  if (photon.isValid())
52  iso.sumPhotonEt = (*photon)[muonRef];
53 
54  if (photonHighThreshold.isValid())
56 
57  if (pu.isValid())
58  iso.sumPUPt = (*pu)[muonRef];
59 
60  return iso;
61 }
62 
64  unsigned int count = 0;
65  for (std::map<std::string, edm::ParameterSet>::const_iterator i = labelMap_.begin(); i != labelMap_.end(); ++i) {
71  photon_[count],
73  pu_[count]);
74 
75  muon.setPFIsolation(i->first, iso);
76  count++;
77  }
78 
79  return 0;
80 }
81 
83  unsigned int count = 0;
84  for (std::map<std::string, edm::ParameterSet>::const_iterator i = labelMap_.begin(); i != labelMap_.end(); ++i) {
89  iEvent.getByToken(photonToken_[count], photon_[count]);
91  iEvent.getByToken(puToken_[count], pu_[count]);
92  count++;
93  }
94 }
reco::MuonPFIsolation::sumPhotonEtHighThreshold
float sumPhotonEtHighThreshold
sum pt of PF photons with a higher threshold
Definition: MuonPFIsolation.h:11
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
MuPFIsoHelper::puToken_
std::vector< edm::EDGetTokenT< CandDoubleMap > > puToken_
Definition: MuPFIsoHelper.h:62
mps_fire.i
i
Definition: mps_fire.py:428
reco::MuonPFIsolation::sumNeutralHadronEt
float sumNeutralHadronEt
sum pt of neutral hadrons
Definition: MuonPFIsolation.h:8
muon
Definition: MuonCocktails.h:17
MuPFIsoHelper.h
reco::MuonPFIsolation::sumNeutralHadronEtHighThreshold
float sumNeutralHadronEtHighThreshold
sum pt of neutral hadrons with a higher threshold
Definition: MuonPFIsolation.h:10
muons2muons_cfi.neutralHadronHighThreshold
neutralHadronHighThreshold
Definition: muons2muons_cfi.py:29
MuPFIsoHelper::neutralHadronToken_
std::vector< edm::EDGetTokenT< CandDoubleMap > > neutralHadronToken_
Definition: MuPFIsoHelper.h:58
MuPFIsoHelper::neutralHadronHighThreshold_
std::vector< edm::Handle< CandDoubleMap > > neutralHadronHighThreshold_
Definition: MuPFIsoHelper.h:51
MuPFIsoHelper::neutralHadronHighThresholdToken_
std::vector< edm::EDGetTokenT< CandDoubleMap > > neutralHadronHighThresholdToken_
Definition: MuPFIsoHelper.h:59
edm::Handle
Definition: AssociativeIterator.h:50
HPSPFTauProducerPuppi_cfi.chargedHadron
chargedHadron
Definition: HPSPFTauProducerPuppi_cfi.py:7
MuPFIsoHelper::chargedParticleToken_
std::vector< edm::EDGetTokenT< CandDoubleMap > > chargedParticleToken_
Definition: MuPFIsoHelper.h:56
reco::Muon
Definition: Muon.h:27
edm::Ref< MuonCollection >
MuPFIsoHelper::photonHighThresholdToken_
std::vector< edm::EDGetTokenT< CandDoubleMap > > photonHighThresholdToken_
Definition: MuPFIsoHelper.h:61
MuPFIsoHelper::chargedParticle_
std::vector< edm::Handle< CandDoubleMap > > chargedParticle_
Definition: MuPFIsoHelper.h:48
MuPFIsoHelper::beginEvent
void beginEvent(const edm::Event &iEvent)
Definition: MuPFIsoHelper.cc:82
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
MuPFIsoHelper::chargedHadronToken_
std::vector< edm::EDGetTokenT< CandDoubleMap > > chargedHadronToken_
Definition: MuPFIsoHelper.h:57
MuPFIsoHelper::makeIsoDeposit
reco::MuonPFIsolation makeIsoDeposit(reco::MuonRef &, const edm::Handle< CandDoubleMap > &, const edm::Handle< CandDoubleMap > &, const edm::Handle< CandDoubleMap > &, const edm::Handle< CandDoubleMap > &, const edm::Handle< CandDoubleMap > &, const edm::Handle< CandDoubleMap > &, const edm::Handle< CandDoubleMap > &)
Definition: MuPFIsoHelper.cc:30
MuPFIsoHelper::~MuPFIsoHelper
~MuPFIsoHelper()
Definition: MuPFIsoHelper.cc:28
muons2muons_cfi.chargedParticle
chargedParticle
Definition: muons2muons_cfi.py:25
MuPFIsoHelper::photonHighThreshold_
std::vector< edm::Handle< CandDoubleMap > > photonHighThreshold_
Definition: MuPFIsoHelper.h:53
iEvent
int iEvent
Definition: GenABIO.cc:224
MuPFIsoHelper::embedPFIsolation
int embedPFIsolation(reco::Muon &, reco::MuonRef &)
Definition: MuPFIsoHelper.cc:63
MuPFIsoHelper::chargedHadron_
std::vector< edm::Handle< CandDoubleMap > > chargedHadron_
Definition: MuPFIsoHelper.h:49
reco::MuonPFIsolation::sumChargedParticlePt
float sumChargedParticlePt
sum-pt of charged Particles(inludes e/mu)
Definition: MuonPFIsolation.h:7
MuPFIsoHelper::pu_
std::vector< edm::Handle< CandDoubleMap > > pu_
Definition: MuPFIsoHelper.h:54
reco::MuonPFIsolation
Definition: MuonPFIsolation.h:5
MuPFIsoHelper::photonToken_
std::vector< edm::EDGetTokenT< CandDoubleMap > > photonToken_
Definition: MuPFIsoHelper.h:60
reco::MuonPFIsolation::sumPUPt
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
Definition: MuonPFIsolation.h:12
edm::ValueMap
Definition: ValueMap.h:107
MuPFIsoHelper::photon_
std::vector< edm::Handle< CandDoubleMap > > photon_
Definition: MuPFIsoHelper.h:52
reco::MuonPFIsolation::sumPhotonEt
float sumPhotonEt
sum pt of PF photons
Definition: MuonPFIsolation.h:9
muons2muons_cfi.pu
pu
Definition: muons2muons_cfi.py:31
muons2muons_cfi.neutralHadron
neutralHadron
Definition: muons2muons_cfi.py:27
muons2muons_cfi.photonHighThreshold
photonHighThreshold
Definition: muons2muons_cfi.py:30
edm::Event
Definition: Event.h:73
MuPFIsoHelper::neutralHadron_
std::vector< edm::Handle< CandDoubleMap > > neutralHadron_
Definition: MuPFIsoHelper.h:50
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
MuPFIsoHelper::MuPFIsoHelper
MuPFIsoHelper(const std::map< std::string, edm::ParameterSet > &, edm::ConsumesCollector &&)
Definition: MuPFIsoHelper.cc:3
reco::MuonPFIsolation::sumChargedHadronPt
float sumChargedHadronPt
sum-pt of charged Hadron
Definition: MuonPFIsolation.h:6
MuPFIsoHelper::labelMap_
std::map< std::string, edm::ParameterSet > labelMap_
Definition: MuPFIsoHelper.h:46