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 > &)
 
 ~MuPFIsoHelper ()
 

Private Attributes

std::vector< edm::Handle
< CandDoubleMap > > 
chargedHadron_
 
std::vector< edm::Handle
< CandDoubleMap > > 
chargedParticle_
 
std::map< std::string,
edm::ParameterSet
labelMap_
 
std::vector< edm::Handle
< CandDoubleMap > > 
neutralHadron_
 
std::vector< edm::Handle
< CandDoubleMap > > 
neutralHadronHighThreshold_
 
std::vector< edm::Handle
< CandDoubleMap > > 
photon_
 
std::vector< edm::Handle
< CandDoubleMap > > 
photonHighThreshold_
 
std::vector< edm::Handle
< CandDoubleMap > > 
pu_
 

Detailed Description

Definition at line 27 of file MuPFIsoHelper.h.

Member Typedef Documentation

Definition at line 29 of file MuPFIsoHelper.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file MuPFIsoHelper.cc.

References chargedHadron_, chargedParticle_, i, labelMap_, neutralHadron_, neutralHadronHighThreshold_, photon_, photonHighThreshold_, and pu_.

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 
18 
19 
20 
21 }
int i
Definition: DBlmapReader.cc:9
std::vector< edm::Handle< CandDoubleMap > > chargedHadron_
Definition: MuPFIsoHelper.h:54
std::vector< edm::Handle< CandDoubleMap > > pu_
Definition: MuPFIsoHelper.h:59
std::vector< edm::Handle< CandDoubleMap > > neutralHadronHighThreshold_
Definition: MuPFIsoHelper.h:56
std::vector< edm::Handle< CandDoubleMap > > chargedParticle_
Definition: MuPFIsoHelper.h:53
std::vector< edm::Handle< CandDoubleMap > > photon_
Definition: MuPFIsoHelper.h:57
std::vector< edm::Handle< CandDoubleMap > > neutralHadron_
Definition: MuPFIsoHelper.h:55
std::vector< edm::Handle< CandDoubleMap > > photonHighThreshold_
Definition: MuPFIsoHelper.h:58
std::map< std::string, edm::ParameterSet > labelMap_
Definition: MuPFIsoHelper.h:51
MuPFIsoHelper::~MuPFIsoHelper ( )

Definition at line 25 of file MuPFIsoHelper.cc.

25  {
26 
27 }

Member Function Documentation

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

Definition at line 88 of file MuPFIsoHelper.cc.

References chargedHadron_, chargedParticle_, prof2calltree::count, edm::Event::getByLabel(), i, labelMap_, neutralHadron_, neutralHadronHighThreshold_, photon_, photonHighThreshold_, and pu_.

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

88  {
89 
90  unsigned int count=0;
91  for(std::map<std::string,edm::ParameterSet>::const_iterator i = labelMap_.begin();i!=labelMap_.end();++i) {
92  iEvent.getByLabel(i->second.getParameter<edm::InputTag>("chargedParticle"),chargedParticle_[count]);
93  iEvent.getByLabel(i->second.getParameter<edm::InputTag>("chargedHadron"),chargedHadron_[count]);
94  iEvent.getByLabel(i->second.getParameter<edm::InputTag>("neutralHadron"),neutralHadron_[count]);
95  iEvent.getByLabel(i->second.getParameter<edm::InputTag>("neutralHadronHighThreshold"),neutralHadronHighThreshold_[count]);
96  iEvent.getByLabel(i->second.getParameter<edm::InputTag>("photon"),photon_[count]);
97  iEvent.getByLabel(i->second.getParameter<edm::InputTag>("photonHighThreshold"),photonHighThreshold_[count]);
98  iEvent.getByLabel(i->second.getParameter<edm::InputTag>("pu"),pu_[count]);
99  count++;
100  }
101 
102 }
int i
Definition: DBlmapReader.cc:9
std::vector< edm::Handle< CandDoubleMap > > chargedHadron_
Definition: MuPFIsoHelper.h:54
std::vector< edm::Handle< CandDoubleMap > > pu_
Definition: MuPFIsoHelper.h:59
std::vector< edm::Handle< CandDoubleMap > > neutralHadronHighThreshold_
Definition: MuPFIsoHelper.h:56
std::vector< edm::Handle< CandDoubleMap > > chargedParticle_
Definition: MuPFIsoHelper.h:53
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
std::vector< edm::Handle< CandDoubleMap > > photon_
Definition: MuPFIsoHelper.h:57
std::vector< edm::Handle< CandDoubleMap > > neutralHadron_
Definition: MuPFIsoHelper.h:55
std::vector< edm::Handle< CandDoubleMap > > photonHighThreshold_
Definition: MuPFIsoHelper.h:58
std::map< std::string, edm::ParameterSet > labelMap_
Definition: MuPFIsoHelper.h:51
int MuPFIsoHelper::embedPFIsolation ( reco::Muon muon,
reco::MuonRef muonRef 
)

Definition at line 65 of file MuPFIsoHelper.cc.

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

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

65  {
66 
67  unsigned int count=0;
68  for(std::map<std::string,edm::ParameterSet>::const_iterator i = labelMap_.begin();i!=labelMap_.end();++i) {
70  chargedParticle_[count],
71  chargedHadron_[count],
72  neutralHadron_[count],
74  photon_[count],
75  photonHighThreshold_[count],
76  pu_[count]);
77 
78  muon.setPFIsolation(i->first,iso);
79  count++;
80  }
81 
82 
83  return 0;
84 }
int i
Definition: DBlmapReader.cc:9
std::vector< edm::Handle< CandDoubleMap > > chargedHadron_
Definition: MuPFIsoHelper.h:54
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:59
std::vector< edm::Handle< CandDoubleMap > > neutralHadronHighThreshold_
Definition: MuPFIsoHelper.h:56
void setPFIsolation(const std::string &label, const reco::MuonPFIsolation &deposit)
Definition: Muon.cc:813
std::vector< edm::Handle< CandDoubleMap > > chargedParticle_
Definition: MuPFIsoHelper.h:53
std::vector< edm::Handle< CandDoubleMap > > photon_
Definition: MuPFIsoHelper.h:57
std::vector< edm::Handle< CandDoubleMap > > neutralHadron_
Definition: MuPFIsoHelper.h:55
std::vector< edm::Handle< CandDoubleMap > > photonHighThreshold_
Definition: MuPFIsoHelper.h:58
std::map< std::string, edm::ParameterSet > labelMap_
Definition: MuPFIsoHelper.h:51
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 30 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().

37  {
38 
40  if(chargedParticle.isValid())
41  iso.sumChargedParticlePt = (*chargedParticle)[muonRef];
42 
43  if(chargedHadron.isValid())
44  iso.sumChargedHadronPt = (*chargedHadron)[muonRef];
45 
46  if(neutralHadron.isValid())
47  iso.sumNeutralHadronEt = (*neutralHadron)[muonRef];
48 
49  if(neutralHadronHighThreshold.isValid())
50  iso.sumNeutralHadronEtHighThreshold = (*neutralHadronHighThreshold)[muonRef];
51 
52  if(photon.isValid())
53  iso.sumPhotonEt = (*photon)[muonRef];
54 
55  if(photonHighThreshold.isValid())
56  iso.sumPhotonEtHighThreshold = (*photonHighThreshold)[muonRef];
57 
58  if(pu.isValid())
59  iso.sumPUPt = (*pu)[muonRef];
60 
61  return iso;
62 }
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:76
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 54 of file MuPFIsoHelper.h.

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

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

Definition at line 53 of file MuPFIsoHelper.h.

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

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

Definition at line 51 of file MuPFIsoHelper.h.

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

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

Definition at line 55 of file MuPFIsoHelper.h.

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

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

Definition at line 56 of file MuPFIsoHelper.h.

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

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

Definition at line 57 of file MuPFIsoHelper.h.

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

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

Definition at line 58 of file MuPFIsoHelper.h.

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

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

Definition at line 59 of file MuPFIsoHelper.h.

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