#include <IsolatedPFCandidateSelectorDefinition.h>
Public Types | |
typedef edm::ValueMap< double > | IsoMap |
Public Member Functions | |
IsolatedPFCandidateSelectorDefinition (const edm::ParameterSet &cfg) | |
void | select (const HandleToCollection &hc, const edm::EventBase &e, const edm::EventSetup &s) |
Private Attributes | |
double | deltaBetaFactor_ |
edm::InputTag | deltaBetaIsolationValueMap_ |
bool | doDeltaBetaCorrection_ |
double | isolationCut_ |
std::vector< edm::InputTag > | isolationValueMapChargedLabels_ |
std::vector< edm::InputTag > | isolationValueMapNeutralLabels_ |
bool | isRelative_ |
Definition at line 12 of file IsolatedPFCandidateSelectorDefinition.h.
typedef edm::ValueMap<double> pf2pat::IsolatedPFCandidateSelectorDefinition::IsoMap |
Definition at line 15 of file IsolatedPFCandidateSelectorDefinition.h.
pf2pat::IsolatedPFCandidateSelectorDefinition::IsolatedPFCandidateSelectorDefinition | ( | const edm::ParameterSet & | cfg | ) | [inline] |
Definition at line 17 of file IsolatedPFCandidateSelectorDefinition.h.
: isolationValueMapChargedLabels_(cfg.getParameter< std::vector<edm::InputTag> >("isolationValueMapsCharged") ), isolationValueMapNeutralLabels_(cfg.getParameter< std::vector<edm::InputTag> >("isolationValueMapsNeutral") ), doDeltaBetaCorrection_(cfg.getParameter<bool>("doDeltaBetaCorrection")), deltaBetaIsolationValueMap_(cfg.getParameter< edm::InputTag >("deltaBetaIsolationValueMap") ), deltaBetaFactor_(cfg.getParameter<double>("deltaBetaFactor")), isRelative_(cfg.getParameter<bool>("isRelative")), isolationCut_(cfg.getParameter<double>("isolationCut")) {}
void pf2pat::IsolatedPFCandidateSelectorDefinition::select | ( | const HandleToCollection & | hc, |
const edm::EventBase & | e, | ||
const edm::EventSetup & | s | ||
) | [inline] |
Definition at line 28 of file IsolatedPFCandidateSelectorDefinition.h.
References deltaBetaFactor_, deltaBetaIsolationValueMap_, doDeltaBetaCorrection_, edm::EventBase::getByLabel(), isolationCut_, isolationValueMapChargedLabels_, isolationValueMapNeutralLabels_, isRelative_, combine::key, and pf2pat::PFCandidateSelectorDefinition::selected_.
{ selected_.clear(); // read all charged isolation value maps std::vector< edm::Handle<IsoMap> > isoMapsCharged(isolationValueMapChargedLabels_.size()); for(unsigned iMap = 0; iMap<isolationValueMapChargedLabels_.size(); ++iMap) { e.getByLabel(isolationValueMapChargedLabels_[iMap], isoMapsCharged[iMap]); } // read all neutral isolation value maps std::vector< edm::Handle<IsoMap> > isoMapsNeutral(isolationValueMapNeutralLabels_.size()); for(unsigned iMap = 0; iMap<isolationValueMapNeutralLabels_.size(); ++iMap) { e.getByLabel(isolationValueMapNeutralLabels_[iMap], isoMapsNeutral[iMap]); } edm::Handle<IsoMap> dBetaH; if(doDeltaBetaCorrection_) { e.getByLabel(deltaBetaIsolationValueMap_, dBetaH); } unsigned key=0; for( collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++key) { reco::PFCandidateRef candidate(hc,key); bool passed = true; double isoSumCharged=0.0; double isoSumNeutral=0.0; for(unsigned iMap = 0; iMap<isoMapsCharged.size(); ++iMap) { const IsoMap & isoMap = *(isoMapsCharged[iMap]); double val = isoMap[candidate]; isoSumCharged+=val; } for(unsigned iMap = 0; iMap<isoMapsNeutral.size(); ++iMap) { const IsoMap & isoMap = *(isoMapsNeutral[iMap]); double val = isoMap[candidate]; isoSumNeutral+=val; } if ( doDeltaBetaCorrection_ ) { const IsoMap& isoMap = *dBetaH; double dBetaVal = isoMap[candidate]; double dBetaCorIsoSumNeutral = isoSumNeutral + deltaBetaFactor_*dBetaVal; isoSumNeutral = dBetaCorIsoSumNeutral>0 ? dBetaCorIsoSumNeutral : isoSumNeutral; } double isoSum=isoSumCharged+isoSumNeutral; if( isRelative_ ) { isoSum /= candidate->pt(); } if ( isoSum>isolationCut_ ) { passed = false; } if(passed) { // passed all cuts, selected selected_.push_back( reco::PFCandidate(*pfc) ); reco::PFCandidatePtr ptrToMother( hc, key ); selected_.back().setSourceCandidatePtr( ptrToMother ); } } }
double pf2pat::IsolatedPFCandidateSelectorDefinition::deltaBetaFactor_ [private] |
Definition at line 108 of file IsolatedPFCandidateSelectorDefinition.h.
Referenced by select().
Definition at line 107 of file IsolatedPFCandidateSelectorDefinition.h.
Referenced by select().
Definition at line 106 of file IsolatedPFCandidateSelectorDefinition.h.
Referenced by select().
double pf2pat::IsolatedPFCandidateSelectorDefinition::isolationCut_ [private] |
Definition at line 110 of file IsolatedPFCandidateSelectorDefinition.h.
Referenced by select().
std::vector<edm::InputTag> pf2pat::IsolatedPFCandidateSelectorDefinition::isolationValueMapChargedLabels_ [private] |
Definition at line 104 of file IsolatedPFCandidateSelectorDefinition.h.
Referenced by select().
std::vector<edm::InputTag> pf2pat::IsolatedPFCandidateSelectorDefinition::isolationValueMapNeutralLabels_ [private] |
Definition at line 105 of file IsolatedPFCandidateSelectorDefinition.h.
Referenced by select().
bool pf2pat::IsolatedPFCandidateSelectorDefinition::isRelative_ [private] |
Definition at line 109 of file IsolatedPFCandidateSelectorDefinition.h.
Referenced by select().