test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
MuPFIsoHelper Class Reference

#include <MuPFIsoHelper.h>

Public Types

typedef edm::ValueMap< double > CandDoubleMap
 

Public Member Functions

void beginEvent (const edm::Event &iEvent)
 
int embedPFIsolation (reco::Muon &, reco::MuonRef &)
 
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 > &)
 
 MuPFIsoHelper (const std::map< std::string, edm::ParameterSet > &, edm::ConsumesCollector &&)
 
 ~MuPFIsoHelper ()
 

Private Attributes

std::vector< edm::Handle
< CandDoubleMap > > 
chargedHadron_
 
std::vector< edm::EDGetTokenT
< CandDoubleMap > > 
chargedHadronToken_
 
std::vector< edm::Handle
< CandDoubleMap > > 
chargedParticle_
 
std::vector< edm::EDGetTokenT
< CandDoubleMap > > 
chargedParticleToken_
 
std::map< std::string,
edm::ParameterSet
labelMap_
 
std::vector< edm::Handle
< CandDoubleMap > > 
neutralHadron_
 
std::vector< edm::Handle
< CandDoubleMap > > 
neutralHadronHighThreshold_
 
std::vector< edm::EDGetTokenT
< CandDoubleMap > > 
neutralHadronHighThresholdToken_
 
std::vector< edm::EDGetTokenT
< CandDoubleMap > > 
neutralHadronToken_
 
std::vector< edm::Handle
< CandDoubleMap > > 
photon_
 
std::vector< edm::Handle
< CandDoubleMap > > 
photonHighThreshold_
 
std::vector< edm::EDGetTokenT
< CandDoubleMap > > 
photonHighThresholdToken_
 
std::vector< edm::EDGetTokenT
< CandDoubleMap > > 
photonToken_
 
std::vector< edm::Handle
< CandDoubleMap > > 
pu_
 
std::vector< edm::EDGetTokenT
< CandDoubleMap > > 
puToken_
 

Detailed Description

Definition at line 29 of file MuPFIsoHelper.h.

Member Typedef Documentation

Definition at line 31 of file MuPFIsoHelper.h.

Constructor & Destructor Documentation

MuPFIsoHelper::MuPFIsoHelper ( const std::map< std::string, edm::ParameterSet > &  labelMap,
edm::ConsumesCollector &&  iC 
)

Definition at line 4 of file MuPFIsoHelper.cc.

References chargedHadron_, chargedHadronToken_, chargedParticle_, chargedParticleToken_, i, labelMap_, neutralHadron_, neutralHadronHighThreshold_, neutralHadronHighThresholdToken_, neutralHadronToken_, photon_, photonHighThreshold_, photonHighThresholdToken_, photonToken_, pu_, and puToken_.

4  :
5  labelMap_(labelMap)
6 {
8  for(std::map<std::string,edm::ParameterSet>::const_iterator i = labelMap_.begin();i!=labelMap_.end();++i) {
9  chargedParticle_.push_back(nullHandle);
10  chargedHadron_.push_back(nullHandle);
11  neutralHadron_.push_back(nullHandle);
12  neutralHadronHighThreshold_.push_back(nullHandle);
13  photon_.push_back(nullHandle);
14  photonHighThreshold_.push_back(nullHandle);
15  pu_.push_back(nullHandle);
16 
17  chargedParticleToken_.push_back(iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("chargedParticle")));
18  chargedHadronToken_.push_back(iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("chargedHadron")));
19  neutralHadronToken_.push_back(iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("neutralHadron")));
20  neutralHadronHighThresholdToken_.push_back(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(iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("photonHighThreshold")));
23  puToken_.push_back(iC.consumes<CandDoubleMap>(i->second.getParameter<edm::InputTag>("pu")));
24  }
25 
26 
27 
28 
29 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int i
Definition: DBlmapReader.cc:9
std::vector< edm::EDGetTokenT< CandDoubleMap > > neutralHadronHighThresholdToken_
Definition: MuPFIsoHelper.h:66
std::vector< edm::EDGetTokenT< CandDoubleMap > > chargedHadronToken_
Definition: MuPFIsoHelper.h:64
std::vector< edm::Handle< CandDoubleMap > > chargedHadron_
Definition: MuPFIsoHelper.h:56
std::vector< edm::EDGetTokenT< CandDoubleMap > > photonHighThresholdToken_
Definition: MuPFIsoHelper.h:68
std::vector< edm::Handle< CandDoubleMap > > pu_
Definition: MuPFIsoHelper.h:61
std::vector< edm::EDGetTokenT< CandDoubleMap > > neutralHadronToken_
Definition: MuPFIsoHelper.h:65
std::vector< edm::Handle< CandDoubleMap > > neutralHadronHighThreshold_
Definition: MuPFIsoHelper.h:58
std::vector< edm::EDGetTokenT< CandDoubleMap > > chargedParticleToken_
Definition: MuPFIsoHelper.h:63
std::vector< edm::Handle< CandDoubleMap > > chargedParticle_
Definition: MuPFIsoHelper.h:55
std::vector< edm::Handle< CandDoubleMap > > photon_
Definition: MuPFIsoHelper.h:59
std::vector< edm::Handle< CandDoubleMap > > neutralHadron_
Definition: MuPFIsoHelper.h:57
std::vector< edm::EDGetTokenT< CandDoubleMap > > puToken_
Definition: MuPFIsoHelper.h:69
edm::ValueMap< double > CandDoubleMap
Definition: MuPFIsoHelper.h:31
std::vector< edm::Handle< CandDoubleMap > > photonHighThreshold_
Definition: MuPFIsoHelper.h:60
std::map< std::string, edm::ParameterSet > labelMap_
Definition: MuPFIsoHelper.h:53
std::vector< edm::EDGetTokenT< CandDoubleMap > > photonToken_
Definition: MuPFIsoHelper.h:67
MuPFIsoHelper::~MuPFIsoHelper ( )

Definition at line 33 of file MuPFIsoHelper.cc.

33  {
34 
35 }

Member Function Documentation

void MuPFIsoHelper::beginEvent ( const edm::Event iEvent)

Definition at line 96 of file MuPFIsoHelper.cc.

References chargedHadron_, chargedHadronToken_, chargedParticle_, chargedParticleToken_, KineDebug3::count(), edm::Event::getByToken(), i, labelMap_, neutralHadron_, neutralHadronHighThreshold_, neutralHadronHighThresholdToken_, neutralHadronToken_, photon_, photonHighThreshold_, photonHighThresholdToken_, photonToken_, pu_, and puToken_.

Referenced by MuPFIsoEmbedder::produce(), and MuonProducer::produce().

96  {
97 
98  unsigned int count=0;
99  for(std::map<std::string,edm::ParameterSet>::const_iterator i = labelMap_.begin();i!=labelMap_.end();++i) {
100  iEvent.getByToken(chargedParticleToken_[count],chargedParticle_[count]);
101  iEvent.getByToken(chargedHadronToken_[count],chargedHadron_[count]);
102  iEvent.getByToken(neutralHadronToken_[count],neutralHadron_[count]);
104  iEvent.getByToken(photonToken_[count],photon_[count]);
106  iEvent.getByToken(puToken_[count],pu_[count]);
107  count++;
108  }
109 
110 }
int i
Definition: DBlmapReader.cc:9
std::vector< edm::EDGetTokenT< CandDoubleMap > > neutralHadronHighThresholdToken_
Definition: MuPFIsoHelper.h:66
std::vector< edm::EDGetTokenT< CandDoubleMap > > chargedHadronToken_
Definition: MuPFIsoHelper.h:64
std::vector< edm::Handle< CandDoubleMap > > chargedHadron_
Definition: MuPFIsoHelper.h:56
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::vector< edm::EDGetTokenT< CandDoubleMap > > photonHighThresholdToken_
Definition: MuPFIsoHelper.h:68
std::vector< edm::Handle< CandDoubleMap > > pu_
Definition: MuPFIsoHelper.h:61
std::vector< edm::EDGetTokenT< CandDoubleMap > > neutralHadronToken_
Definition: MuPFIsoHelper.h:65
std::vector< edm::Handle< CandDoubleMap > > neutralHadronHighThreshold_
Definition: MuPFIsoHelper.h:58
std::vector< edm::EDGetTokenT< CandDoubleMap > > chargedParticleToken_
Definition: MuPFIsoHelper.h:63
std::vector< edm::Handle< CandDoubleMap > > chargedParticle_
Definition: MuPFIsoHelper.h:55
std::vector< edm::Handle< CandDoubleMap > > photon_
Definition: MuPFIsoHelper.h:59
std::vector< edm::Handle< CandDoubleMap > > neutralHadron_
Definition: MuPFIsoHelper.h:57
std::vector< edm::EDGetTokenT< CandDoubleMap > > puToken_
Definition: MuPFIsoHelper.h:69
std::vector< edm::Handle< CandDoubleMap > > photonHighThreshold_
Definition: MuPFIsoHelper.h:60
std::map< std::string, edm::ParameterSet > labelMap_
Definition: MuPFIsoHelper.h:53
std::vector< edm::EDGetTokenT< CandDoubleMap > > photonToken_
Definition: MuPFIsoHelper.h:67
int MuPFIsoHelper::embedPFIsolation ( reco::Muon muon,
reco::MuonRef muonRef 
)

Definition at line 73 of file MuPFIsoHelper.cc.

References chargedHadron_, chargedParticle_, KineDebug3::count(), i, labelMap_, makeIsoDeposit(), neutralHadron_, neutralHadronHighThreshold_, photon_, photonHighThreshold_, pu_, and reco::Muon::setPFIsolation().

Referenced by MuPFIsoEmbedder::produce(), and MuonProducer::produce().

73  {
74 
75  unsigned int count=0;
76  for(std::map<std::string,edm::ParameterSet>::const_iterator i = labelMap_.begin();i!=labelMap_.end();++i) {
78  chargedParticle_[count],
79  chargedHadron_[count],
80  neutralHadron_[count],
82  photon_[count],
83  photonHighThreshold_[count],
84  pu_[count]);
85 
86  muon.setPFIsolation(i->first,iso);
87  count++;
88  }
89 
90 
91  return 0;
92 }
int i
Definition: DBlmapReader.cc:9
std::vector< edm::Handle< CandDoubleMap > > chargedHadron_
Definition: MuPFIsoHelper.h:56
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 > &)
std::vector< edm::Handle< CandDoubleMap > > pu_
Definition: MuPFIsoHelper.h:61
std::vector< edm::Handle< CandDoubleMap > > neutralHadronHighThreshold_
Definition: MuPFIsoHelper.h:58
void setPFIsolation(const std::string &label, const reco::MuonPFIsolation &deposit)
std::vector< edm::Handle< CandDoubleMap > > chargedParticle_
Definition: MuPFIsoHelper.h:55
std::vector< edm::Handle< CandDoubleMap > > photon_
Definition: MuPFIsoHelper.h:59
std::vector< edm::Handle< CandDoubleMap > > neutralHadron_
Definition: MuPFIsoHelper.h:57
std::vector< edm::Handle< CandDoubleMap > > photonHighThreshold_
Definition: MuPFIsoHelper.h:60
std::map< std::string, edm::ParameterSet > labelMap_
Definition: MuPFIsoHelper.h:53
reco::MuonPFIsolation MuPFIsoHelper::makeIsoDeposit ( reco::MuonRef muonRef,
const edm::Handle< CandDoubleMap > &  chargedParticle,
const edm::Handle< CandDoubleMap > &  chargedHadron,
const edm::Handle< CandDoubleMap > &  neutralHadron,
const edm::Handle< CandDoubleMap > &  neutralHadronHighThreshold,
const edm::Handle< CandDoubleMap > &  photon,
const edm::Handle< CandDoubleMap > &  photonHighThreshold,
const edm::Handle< CandDoubleMap > &  pu 
)

Definition at line 38 of file MuPFIsoHelper.cc.

References edm::HandleBase::isValid(), reco::MuonPFIsolation::sumChargedHadronPt, reco::MuonPFIsolation::sumChargedParticlePt, reco::MuonPFIsolation::sumNeutralHadronEt, reco::MuonPFIsolation::sumNeutralHadronEtHighThreshold, reco::MuonPFIsolation::sumPhotonEt, reco::MuonPFIsolation::sumPhotonEtHighThreshold, and reco::MuonPFIsolation::sumPUPt.

Referenced by embedPFIsolation().

45  {
46 
48  if(chargedParticle.isValid())
49  iso.sumChargedParticlePt = (*chargedParticle)[muonRef];
50 
51  if(chargedHadron.isValid())
52  iso.sumChargedHadronPt = (*chargedHadron)[muonRef];
53 
54  if(neutralHadron.isValid())
55  iso.sumNeutralHadronEt = (*neutralHadron)[muonRef];
56 
57  if(neutralHadronHighThreshold.isValid())
58  iso.sumNeutralHadronEtHighThreshold = (*neutralHadronHighThreshold)[muonRef];
59 
60  if(photon.isValid())
61  iso.sumPhotonEt = (*photon)[muonRef];
62 
63  if(photonHighThreshold.isValid())
64  iso.sumPhotonEtHighThreshold = (*photonHighThreshold)[muonRef];
65 
66  if(pu.isValid())
67  iso.sumPUPt = (*pu)[muonRef];
68 
69  return iso;
70 }
float sumNeutralHadronEtHighThreshold
sum pt of neutral hadrons with a higher threshold
float sumPhotonEt
sum pt of PF photons
float sumNeutralHadronEt
sum pt of neutral hadrons
float sumChargedParticlePt
sum-pt of charged Particles(inludes e/mu)
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
bool isValid() const
Definition: HandleBase.h:75
float sumPhotonEtHighThreshold
sum pt of PF photons with a higher threshold
float sumChargedHadronPt
sum-pt of charged Hadron

Member Data Documentation

std::vector<edm::Handle<CandDoubleMap> > MuPFIsoHelper::chargedHadron_
private

Definition at line 56 of file MuPFIsoHelper.h.

Referenced by beginEvent(), embedPFIsolation(), and MuPFIsoHelper().

std::vector<edm::EDGetTokenT<CandDoubleMap> > MuPFIsoHelper::chargedHadronToken_
private

Definition at line 64 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and MuPFIsoHelper().

std::vector<edm::Handle<CandDoubleMap> > MuPFIsoHelper::chargedParticle_
private

Definition at line 55 of file MuPFIsoHelper.h.

Referenced by beginEvent(), embedPFIsolation(), and MuPFIsoHelper().

std::vector<edm::EDGetTokenT<CandDoubleMap> > MuPFIsoHelper::chargedParticleToken_
private

Definition at line 63 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and MuPFIsoHelper().

std::map<std::string,edm::ParameterSet> MuPFIsoHelper::labelMap_
private

Definition at line 53 of file MuPFIsoHelper.h.

Referenced by beginEvent(), embedPFIsolation(), and MuPFIsoHelper().

std::vector<edm::Handle<CandDoubleMap> > MuPFIsoHelper::neutralHadron_
private

Definition at line 57 of file MuPFIsoHelper.h.

Referenced by beginEvent(), embedPFIsolation(), and MuPFIsoHelper().

std::vector<edm::Handle<CandDoubleMap> > MuPFIsoHelper::neutralHadronHighThreshold_
private

Definition at line 58 of file MuPFIsoHelper.h.

Referenced by beginEvent(), embedPFIsolation(), and MuPFIsoHelper().

std::vector<edm::EDGetTokenT<CandDoubleMap> > MuPFIsoHelper::neutralHadronHighThresholdToken_
private

Definition at line 66 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and MuPFIsoHelper().

std::vector<edm::EDGetTokenT<CandDoubleMap> > MuPFIsoHelper::neutralHadronToken_
private

Definition at line 65 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and MuPFIsoHelper().

std::vector<edm::Handle<CandDoubleMap> > MuPFIsoHelper::photon_
private

Definition at line 59 of file MuPFIsoHelper.h.

Referenced by beginEvent(), embedPFIsolation(), and MuPFIsoHelper().

std::vector<edm::Handle<CandDoubleMap> > MuPFIsoHelper::photonHighThreshold_
private

Definition at line 60 of file MuPFIsoHelper.h.

Referenced by beginEvent(), embedPFIsolation(), and MuPFIsoHelper().

std::vector<edm::EDGetTokenT<CandDoubleMap> > MuPFIsoHelper::photonHighThresholdToken_
private

Definition at line 68 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and MuPFIsoHelper().

std::vector<edm::EDGetTokenT<CandDoubleMap> > MuPFIsoHelper::photonToken_
private

Definition at line 67 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and MuPFIsoHelper().

std::vector<edm::Handle<CandDoubleMap> > MuPFIsoHelper::pu_
private

Definition at line 61 of file MuPFIsoHelper.h.

Referenced by beginEvent(), embedPFIsolation(), and MuPFIsoHelper().

std::vector<edm::EDGetTokenT<CandDoubleMap> > MuPFIsoHelper::puToken_
private

Definition at line 69 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and MuPFIsoHelper().