CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

MuPFIsoHelper Class Reference

#include <MuPFIsoHelper.h>

List of all members.

Public Types

typedef edm::ValueMap< double > CandDoubleMap

Public Member Functions

void beginEvent (const edm::Event &iEvent)
int embedPFIsolation (reco::Muon &, reco::MuonRef &)
 MuPFIsoHelper (const edm::ParameterSet &iConfig)
 ~MuPFIsoHelper ()

Private Attributes

edm::Handle< CandDoubleMapchargedHadron03_
edm::Handle< CandDoubleMapchargedHadron04_
edm::Handle< CandDoubleMapchargedParticle03_
edm::Handle< CandDoubleMapchargedParticle04_
edm::ParameterSet isoCfg03_
edm::ParameterSet isoCfg04_
edm::Handle< CandDoubleMapneutralHadron03_
edm::Handle< CandDoubleMapneutralHadron04_
edm::Handle< CandDoubleMapneutralHadronHighThreshold03_
edm::Handle< CandDoubleMapneutralHadronHighThreshold04_
edm::Handle< CandDoubleMapphoton03_
edm::Handle< CandDoubleMapphoton04_
edm::Handle< CandDoubleMapphotonHighThreshold03_
edm::Handle< CandDoubleMapphotonHighThreshold04_
edm::Handle< CandDoubleMappu03_
edm::Handle< CandDoubleMappu04_

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 edm::ParameterSet iConfig)

Definition at line 4 of file MuPFIsoHelper.cc.

                                                          :
  isoCfg03_(iConfig.getParameter<edm::ParameterSet>("isolationR03")),
  isoCfg04_(iConfig.getParameter<edm::ParameterSet>("isolationR04"))
{
  

}
MuPFIsoHelper::~MuPFIsoHelper ( )

Definition at line 14 of file MuPFIsoHelper.cc.

                              {

}

Member Function Documentation

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

Definition at line 103 of file MuPFIsoHelper.cc.

References chargedHadron03_, chargedHadron04_, chargedParticle03_, chargedParticle04_, edm::Event::getByLabel(), edm::ParameterSet::getParameter(), isoCfg03_, isoCfg04_, neutralHadron03_, neutralHadron04_, neutralHadronHighThreshold03_, neutralHadronHighThreshold04_, photon03_, photon04_, photonHighThreshold03_, photonHighThreshold04_, pu03_, and pu04_.

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

int MuPFIsoHelper::embedPFIsolation ( reco::Muon muon,
reco::MuonRef muonRef 
)

Definition at line 20 of file MuPFIsoHelper.cc.

References chargedHadron03_, chargedHadron04_, chargedParticle03_, chargedParticle04_, HiCaloIsolation_cff::isoR3, HiCaloIsolation_cff::isoR4, edm::HandleBase::isValid(), neutralHadron03_, neutralHadron04_, neutralHadronHighThreshold03_, neutralHadronHighThreshold04_, photon03_, photon04_, photonHighThreshold03_, photonHighThreshold04_, pu03_, pu04_, reco::Muon::setPFIsolation(), reco::MuonPFIsolation::sumChargedHadronPt, reco::MuonPFIsolation::sumChargedParticlePt, reco::MuonPFIsolation::sumNeutralHadronEt, reco::MuonPFIsolation::sumNeutralHadronEtHighThreshold, reco::MuonPFIsolation::sumPhotonEt, reco::MuonPFIsolation::sumPhotonEtHighThreshold, and reco::MuonPFIsolation::sumPUPt.

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

                                                                        {
  reco::MuonPFIsolation isoR3;
  if(chargedParticle03_.isValid()) {
       isoR3.sumChargedParticlePt = (*chargedParticle03_)[muonRef];
  }
  else {    return -1;}

  if(chargedHadron03_.isValid()) {
       isoR3.sumChargedHadronPt = (*chargedHadron03_)[muonRef];
  }
  else {    return -1;}

  if(neutralHadron03_.isValid()) {
       isoR3.sumNeutralHadronEt = (*neutralHadron03_)[muonRef];
  }
  else {    return -1;}

  if(photon03_.isValid()) {
       isoR3.sumPhotonEt = (*photon03_)[muonRef];
  }
  else {    return -1;}

  if(neutralHadronHighThreshold03_.isValid()) {
       isoR3.sumNeutralHadronEtHighThreshold = (*neutralHadronHighThreshold03_)[muonRef];
  }
  else {    return -1;}

  if(photonHighThreshold03_.isValid()) {
       isoR3.sumPhotonEtHighThreshold = (*photonHighThreshold03_)[muonRef];
  }
  else {    return -1;}

  if(pu03_.isValid()) {
       isoR3.sumPUPt = (*pu03_)[muonRef];
  }
  else {    return -1;}



  reco::MuonPFIsolation isoR4;
  if(chargedParticle04_.isValid()) {
       isoR4.sumChargedParticlePt = (*chargedParticle04_)[muonRef];
  }
  else {    return -1;}

  if(chargedHadron04_.isValid()) {
       isoR4.sumChargedHadronPt = (*chargedHadron04_)[muonRef];
  }
  else {    return -1;}

  if(neutralHadron04_.isValid()) {
       isoR4.sumNeutralHadronEt = (*neutralHadron04_)[muonRef];
  }
  else {    return -1;}

  if(photon04_.isValid()) {
       isoR4.sumPhotonEt = (*photon04_)[muonRef];
  }
  else {    return -1;}

  if(neutralHadronHighThreshold04_.isValid()) {
       isoR4.sumNeutralHadronEtHighThreshold = (*neutralHadronHighThreshold04_)[muonRef];
  }
  else {    return -1;}

  if(photonHighThreshold04_.isValid()) {
       isoR4.sumPhotonEtHighThreshold = (*photonHighThreshold04_)[muonRef];
  }
  else {    return -1;}

  if(pu04_.isValid()) {
       isoR4.sumPUPt = (*pu04_)[muonRef];
  }
  else {    return -1;}


  muon.setPFIsolation(isoR3,isoR4);
                                        
  return 0;
}

Member Data Documentation

Definition at line 45 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 53 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 44 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 52 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 40 of file MuPFIsoHelper.h.

Referenced by beginEvent().

Definition at line 41 of file MuPFIsoHelper.h.

Referenced by beginEvent().

Definition at line 46 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 54 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 48 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 56 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 47 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 55 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 49 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 57 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 50 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().

Definition at line 58 of file MuPFIsoHelper.h.

Referenced by beginEvent(), and embedPFIsolation().