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

 deltaBetaFactor_ (cfg.getParameter< double >("deltaBetaFactor"))
 
 deltaBetaIsolationValueMapToken_ (iC.mayConsume< IsoMap >(cfg.getParameter< edm::InputTag >("deltaBetaIsolationValueMap")))
 
 doDeltaBetaCorrection_ (cfg.getParameter< bool >("doDeltaBetaCorrection"))
 
 IsolatedPFCandidateSelectorDefinition (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
 isolationCut_ (cfg.getParameter< double >("isolationCut"))
 
 isolationValueMapNeutralTokens_ (edm::vector_transform(cfg.getParameter< std::vector< edm::InputTag > >("isolationValueMapsNeutral"), [&](edm::InputTag const &tag){return iC.consumes< IsoMap >(tag);}))
 
 isRelative_ (cfg.getParameter< bool >("isRelative"))
 
void select (const HandleToCollection &hc, const edm::Event &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::EDGetTokenT< IsoMapdeltaBetaIsolationValueMapToken_
 
bool doDeltaBetaCorrection_
 
double isolationCut_
 
std::vector< edm::EDGetTokenT
< IsoMap > > 
isolationValueMapChargedTokens_
 
std::vector< edm::EDGetTokenT
< IsoMap > > 
isolationValueMapNeutralTokens_
 
bool isRelative_
 

Additional Inherited Members

- Protected Attributes inherited from pf2pat::PFCandidateSelectorDefinition
container selected_
 

Detailed Description

Definition at line 14 of file IsolatedPFCandidateSelectorDefinition.h.

Member Typedef Documentation

Definition at line 17 of file IsolatedPFCandidateSelectorDefinition.h.

Constructor & Destructor Documentation

pf2pat::IsolatedPFCandidateSelectorDefinition::IsolatedPFCandidateSelectorDefinition ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 19 of file IsolatedPFCandidateSelectorDefinition.h.

References GlobalPosition_Frontier_DevDB_cff::tag.

19  :
20  isolationValueMapChargedTokens_(edm::vector_transform(cfg.getParameter< std::vector<edm::InputTag> >("isolationValueMapsCharged"), [&](edm::InputTag const & tag){return iC.consumes<IsoMap>(tag);}) ),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
std::vector< edm::EDGetTokenT< IsoMap > > isolationValueMapChargedTokens_

Member Function Documentation

pf2pat::IsolatedPFCandidateSelectorDefinition::deltaBetaFactor_ ( cfg.getParameter< double >  "deltaBetaFactor")
pf2pat::IsolatedPFCandidateSelectorDefinition::deltaBetaIsolationValueMapToken_ ( iC.mayConsume< IsoMap cfg.getParameter< edm::InputTag >("deltaBetaIsolationValueMap"))
pf2pat::IsolatedPFCandidateSelectorDefinition::doDeltaBetaCorrection_ ( cfg.getParameter< bool >  "doDeltaBetaCorrection")
pf2pat::IsolatedPFCandidateSelectorDefinition::isolationCut_ ( cfg.getParameter< double >  "isolationCut")
inline

Definition at line 26 of file IsolatedPFCandidateSelectorDefinition.h.

26 {}
pf2pat::IsolatedPFCandidateSelectorDefinition::isolationValueMapNeutralTokens_ ( edm::  vector_transformcfg.getParameter< std::vector< edm::InputTag > >("isolationValueMapsNeutral"),[&](edm::InputTag const &tag){return iC.consumes< IsoMap >(tag);})
pf2pat::IsolatedPFCandidateSelectorDefinition::isRelative_ ( cfg.getParameter< bool >  "isRelative")
void pf2pat::IsolatedPFCandidateSelectorDefinition::select ( const HandleToCollection hc,
const edm::Event e,
const edm::EventSetup s 
)
inline

Definition at line 30 of file IsolatedPFCandidateSelectorDefinition.h.

References edm::Event::getByToken(), and combine::key.

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

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

Member Data Documentation

double pf2pat::IsolatedPFCandidateSelectorDefinition::deltaBetaFactor_
private

Definition at line 110 of file IsolatedPFCandidateSelectorDefinition.h.

edm::EDGetTokenT<IsoMap> pf2pat::IsolatedPFCandidateSelectorDefinition::deltaBetaIsolationValueMapToken_
private

Definition at line 109 of file IsolatedPFCandidateSelectorDefinition.h.

bool pf2pat::IsolatedPFCandidateSelectorDefinition::doDeltaBetaCorrection_
private

Definition at line 108 of file IsolatedPFCandidateSelectorDefinition.h.

double pf2pat::IsolatedPFCandidateSelectorDefinition::isolationCut_
private

Definition at line 112 of file IsolatedPFCandidateSelectorDefinition.h.

std::vector<edm::EDGetTokenT<IsoMap> > pf2pat::IsolatedPFCandidateSelectorDefinition::isolationValueMapChargedTokens_
private

Definition at line 106 of file IsolatedPFCandidateSelectorDefinition.h.

std::vector<edm::EDGetTokenT<IsoMap> > pf2pat::IsolatedPFCandidateSelectorDefinition::isolationValueMapNeutralTokens_
private

Definition at line 107 of file IsolatedPFCandidateSelectorDefinition.h.

bool pf2pat::IsolatedPFCandidateSelectorDefinition::isRelative_
private

Definition at line 111 of file IsolatedPFCandidateSelectorDefinition.h.