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
pf2pat::IsolatedPFCandidateSelectorDefinition Class Reference

#include <IsolatedPFCandidateSelectorDefinition.h>

Inheritance diagram for pf2pat::IsolatedPFCandidateSelectorDefinition:
pf2pat::PFCandidateSelectorDefinition

Public Types

typedef edm::ValueMap< double > IsoMap
 
- Public Types inherited from pf2pat::PFCandidateSelectorDefinition
typedef reco::PFCandidateCollection collection
 
typedef
boost::transform_iterator
< Pointer,
container::const_iterator > 
const_iterator
 
typedef std::vector
< reco::PFCandidate
container
 
typedef edm::Handle< collectionHandleToCollection
 

Public Member Functions

 IsolatedPFCandidateSelectorDefinition (const edm::ParameterSet &cfg)
 
void select (const HandleToCollection &hc, const edm::EventBase &e, const edm::EventSetup &s)
 
- Public Member Functions inherited from pf2pat::PFCandidateSelectorDefinition
const_iterator begin () const
 
const_iterator end () const
 
 PFCandidateSelectorDefinition ()
 
const containerselected () const
 
size_t size () const
 

Private Attributes

double deltaBetaFactor_
 
edm::InputTag deltaBetaIsolationValueMap_
 
bool doDeltaBetaCorrection_
 
double isolationCut_
 
std::vector< edm::InputTagisolationValueMapChargedLabels_
 
std::vector< edm::InputTagisolationValueMapNeutralLabels_
 
bool isRelative_
 

Additional Inherited Members

- Protected Attributes inherited from pf2pat::PFCandidateSelectorDefinition
container selected_
 

Detailed Description

Definition at line 12 of file IsolatedPFCandidateSelectorDefinition.h.

Member Typedef Documentation

Definition at line 15 of file IsolatedPFCandidateSelectorDefinition.h.

Constructor & Destructor Documentation

pf2pat::IsolatedPFCandidateSelectorDefinition::IsolatedPFCandidateSelectorDefinition ( const edm::ParameterSet cfg)
inline

Definition at line 17 of file IsolatedPFCandidateSelectorDefinition.h.

17  :
18  isolationValueMapChargedLabels_(cfg.getParameter< std::vector<edm::InputTag> >("isolationValueMapsCharged") ),
19  isolationValueMapNeutralLabels_(cfg.getParameter< std::vector<edm::InputTag> >("isolationValueMapsNeutral") ),
20  doDeltaBetaCorrection_(cfg.getParameter<bool>("doDeltaBetaCorrection")),
21  deltaBetaIsolationValueMap_(cfg.getParameter< edm::InputTag >("deltaBetaIsolationValueMap") ),
22  deltaBetaFactor_(cfg.getParameter<double>("deltaBetaFactor")),
23  isRelative_(cfg.getParameter<bool>("isRelative")),
24  isolationCut_(cfg.getParameter<double>("isolationCut")) {}
T getParameter(std::string const &) const

Member Function Documentation

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_.

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().

30  {
31  selected_.clear();
32 
33 
34  // read all charged isolation value maps
35  std::vector< edm::Handle<IsoMap> >
36  isoMapsCharged(isolationValueMapChargedLabels_.size());
37  for(unsigned iMap = 0; iMap<isolationValueMapChargedLabels_.size(); ++iMap) {
38  e.getByLabel(isolationValueMapChargedLabels_[iMap], isoMapsCharged[iMap]);
39  }
40 
41 
42  // read all neutral isolation value maps
43  std::vector< edm::Handle<IsoMap> >
44  isoMapsNeutral(isolationValueMapNeutralLabels_.size());
45  for(unsigned iMap = 0; iMap<isolationValueMapNeutralLabels_.size(); ++iMap) {
46  e.getByLabel(isolationValueMapNeutralLabels_[iMap], isoMapsNeutral[iMap]);
47  }
48 
49  edm::Handle<IsoMap> dBetaH;
52  }
53 
54  unsigned key=0;
55  for( collection::const_iterator pfc = hc->begin();
56  pfc != hc->end(); ++pfc, ++key) {
57  reco::PFCandidateRef candidate(hc,key);
58 
59  bool passed = true;
60  double isoSumCharged=0.0;
61  double isoSumNeutral=0.0;
62 
63  for(unsigned iMap = 0; iMap<isoMapsCharged.size(); ++iMap) {
64  const IsoMap & isoMap = *(isoMapsCharged[iMap]);
65  double val = isoMap[candidate];
66  isoSumCharged+=val;
67  }
68 
69  for(unsigned iMap = 0; iMap<isoMapsNeutral.size(); ++iMap) {
70  const IsoMap & isoMap = *(isoMapsNeutral[iMap]);
71  double val = isoMap[candidate];
72  isoSumNeutral+=val;
73  }
74 
75 
76  if ( doDeltaBetaCorrection_ ) {
77  const IsoMap& isoMap = *dBetaH;
78  double dBetaVal = isoMap[candidate];
79  double dBetaCorIsoSumNeutral = isoSumNeutral + deltaBetaFactor_*dBetaVal;
80  isoSumNeutral = dBetaCorIsoSumNeutral>0 ? dBetaCorIsoSumNeutral : 0; //follow muon POG definition in 2012
81  }
82 
83  double isoSum=isoSumCharged+isoSumNeutral;
84 
85  if( isRelative_ ) {
86  isoSum /= candidate->pt();
87  }
88 
89  if ( isoSum>isolationCut_ ) {
90  passed = false;
91  }
92 
93  if(passed) {
94  // passed all cuts, selected
95  selected_.push_back( reco::PFCandidate(*pfc) );
96  reco::PFCandidatePtr ptrToMother( hc, key );
97  selected_.back().setSourceCandidatePtr( ptrToMother );
98  }
99  }
100  }
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:33
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:86
list key
Definition: combine.py:13

Member Data Documentation

double pf2pat::IsolatedPFCandidateSelectorDefinition::deltaBetaFactor_
private

Definition at line 108 of file IsolatedPFCandidateSelectorDefinition.h.

Referenced by select().

edm::InputTag pf2pat::IsolatedPFCandidateSelectorDefinition::deltaBetaIsolationValueMap_
private

Definition at line 107 of file IsolatedPFCandidateSelectorDefinition.h.

Referenced by select().

bool pf2pat::IsolatedPFCandidateSelectorDefinition::doDeltaBetaCorrection_
private

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().