#include <SmearedJetProducerT.h>
Public Member Functions | |
GenJetMatcherT (const edm::ParameterSet &cfg) | |
const reco::GenJet * | operator() (const T &jet, edm::Event *evt=0) const |
~GenJetMatcherT () | |
Private Attributes | |
TFormula * | dRmaxGenJetMatch_ |
edm::InputTag | srcGenJets_ |
Definition at line 53 of file SmearedJetProducerT.h.
SmearedJetProducer_namespace::GenJetMatcherT< T >::GenJetMatcherT | ( | const edm::ParameterSet & | cfg | ) | [inline] |
Definition at line 57 of file SmearedJetProducerT.h.
References data, SmearedJetProducer_namespace::GenJetMatcherT< T >::dRmaxGenJetMatch_, and edm::ParameterSet::getParameter().
: srcGenJets_(cfg.getParameter<edm::InputTag>("srcGenJets")), dRmaxGenJetMatch_(0) { TString dRmaxGenJetMatch_formula = cfg.getParameter<std::string>("dRmaxGenJetMatch").data(); dRmaxGenJetMatch_formula.ReplaceAll("genJetPt", "x"); dRmaxGenJetMatch_ = new TFormula("dRmaxGenJetMatch", dRmaxGenJetMatch_formula.Data()); }
SmearedJetProducer_namespace::GenJetMatcherT< T >::~GenJetMatcherT | ( | ) | [inline] |
Definition at line 65 of file SmearedJetProducerT.h.
References SmearedJetProducer_namespace::GenJetMatcherT< T >::dRmaxGenJetMatch_.
{ delete dRmaxGenJetMatch_; }
const reco::GenJet* SmearedJetProducer_namespace::GenJetMatcherT< T >::operator() | ( | const T & | jet, |
edm::Event * | evt = 0 |
||
) | const [inline] |
Definition at line 70 of file SmearedJetProducerT.h.
References deltaR(), SmearedJetProducer_namespace::GenJetMatcherT< T >::dRmaxGenJetMatch_, and SmearedJetProducer_namespace::GenJetMatcherT< T >::srcGenJets_.
{ assert(evt); edm::Handle<reco::GenJetCollection> genJets; evt->getByLabel(srcGenJets_, genJets); const reco::GenJet* retVal = 0; double dRbestMatch = 1.e+6; for ( reco::GenJetCollection::const_iterator genJet = genJets->begin(); genJet != genJets->end(); ++genJet ) { double dRmax = dRmaxGenJetMatch_->Eval(genJet->pt()); //std::cout << "genJetPt = " << genJet->pt() << ": dRmax = " << dRmax << std::endl; double dR = deltaR(jet.p4(), genJet->p4()); if ( dR < dRbestMatch && dR < dRmax ) { retVal = &(*genJet); dRbestMatch = dR; } } return retVal; }
TFormula* SmearedJetProducer_namespace::GenJetMatcherT< T >::dRmaxGenJetMatch_ [private] |
Definition at line 99 of file SmearedJetProducerT.h.
Referenced by SmearedJetProducer_namespace::GenJetMatcherT< pat::Jet >::GenJetMatcherT(), SmearedJetProducer_namespace::GenJetMatcherT< T >::GenJetMatcherT(), SmearedJetProducer_namespace::GenJetMatcherT< T >::operator()(), SmearedJetProducer_namespace::GenJetMatcherT< T >::~GenJetMatcherT(), and SmearedJetProducer_namespace::GenJetMatcherT< pat::Jet >::~GenJetMatcherT().
edm::InputTag SmearedJetProducer_namespace::GenJetMatcherT< T >::srcGenJets_ [private] |
Definition at line 97 of file SmearedJetProducerT.h.
Referenced by SmearedJetProducer_namespace::GenJetMatcherT< T >::operator()().