![]() |
![]() |
Public Member Functions | |
L1ExtraCalibrator (const edm::ParameterSet &) | |
~L1ExtraCalibrator () | |
Private Member Functions | |
void | calibrateP4 (reco::LeafCandidate &, const std::vector< double > &, const std::vector< double > &) |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
edm::InputTag | mEgamma |
std::vector< double > | mEgammabincorr |
std::vector< double > | mEgammacoeffb |
std::vector< double > | mEgammacoeffe |
edm::InputTag | mIsoegamma |
edm::InputTag | mIsotaus |
edm::InputTag | mJets |
std::vector< double > | mTaubincorr |
std::vector< double > | mTaucoeffb |
std::vector< double > | mTaucoeffe |
edm::InputTag | mTaus |
Definition at line 33 of file L1ExtraCalibrator.cc.
L1ExtraCalibrator::L1ExtraCalibrator | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 67 of file L1ExtraCalibrator.cc.
:mEgamma( iConfig.getParameter < edm::InputTag > ( "eGamma" ) ), mIsoegamma( iConfig.getParameter < edm::InputTag > ( "isoEGamma" ) ), mTaus( iConfig.getParameter < edm::InputTag > ( "taus" ) ), mIsotaus( iConfig.getParameter < edm::InputTag > ( "isoTaus" ) ), mJets( iConfig.getParameter < edm::InputTag > ( "jets" ) ), mEgammacoeffb( iConfig.getParameter < std::vector < double > > ( "eGammaCoefficientsB" ) ), mTaucoeffb( iConfig.getParameter < std::vector < double > > ( "tauCoefficientsB" ) ), mEgammacoeffe( iConfig.getParameter < std::vector < double > > ( "eGammaCoefficientsE" ) ), mTaucoeffe( iConfig.getParameter < std::vector < double > > ( "tauCoefficientsE" ) ), mEgammabincorr( iConfig.getParameter < std::vector < double > > ( "eGammaBinCorr" ) ), mTaubincorr( iConfig.getParameter < std::vector < double > > ( "tauBinCorr" ) ) { // Register Product produces < l1extra::L1EmParticleCollection > ( "EGamma" ); produces < l1extra::L1EmParticleCollection > ( "IsoEGamma" ); produces < l1extra::L1JetParticleCollection > ( "Taus" ); produces < l1extra::L1JetParticleCollection > ( "IsoTaus" ); produces < l1extra::L1JetParticleCollection > ( "Jets" ); }
L1ExtraCalibrator::~L1ExtraCalibrator | ( | ) |
Definition at line 88 of file L1ExtraCalibrator.cc.
{ }
void L1ExtraCalibrator::calibrateP4 | ( | reco::LeafCandidate & | p, |
const std::vector< double > & | coeffs, | ||
const std::vector< double > & | binCorrs | ||
) | [private] |
Definition at line 205 of file L1ExtraCalibrator.cc.
References reco::LeafCandidate::eta(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), and reco::LeafCandidate::setP4().
Referenced by produce().
{ // Function is never called if lAbsEta >=2.6 double lAbsEta ( fabs( p.eta( ) ) ); double bfactor = binCorrs.at( int( lAbsEta * 5.0 ) ); if( lAbsEta >= 1.6) lAbsEta -= 1.6; double factor( coeffs.at( 0 ) + ( coeffs.at( 1 ) * lAbsEta ) + ( coeffs.at( 2 ) * lAbsEta * lAbsEta ) ); p.setP4( math::PtEtaPhiMLorentzVector( factor * bfactor * p.pt( ), p.eta( ), p.phi( ), 0.0 ) ); }
void L1ExtraCalibrator::endJob | ( | void | ) | [private, virtual] |
void L1ExtraCalibrator::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 93 of file L1ExtraCalibrator.cc.
References calibrateP4(), reco::LeafCandidate::eta(), edm::Event::getByLabel(), analyzePatCleaning_cfg::jets, mEgamma, mEgammabincorr, mEgammacoeffb, mEgammacoeffe, mIsoegamma, mIsotaus, mJets, mTaubincorr, mTaucoeffb, mTaucoeffe, mTaus, AlCaHLTBitMon_ParallelJobs::p, edm::Event::put(), and metsig::tau.
{ edm::Handle < l1extra::L1EmParticleCollection > eg; if ( iEvent.getByLabel( mEgamma, eg ) ) { std::auto_ptr < l1extra::L1EmParticleCollection > l1EGamma( new l1extra::L1EmParticleCollection ); for ( l1extra::L1EmParticleCollection::const_iterator lIt = eg->begin( ) ; lIt != eg->end() ; ++lIt ) { l1extra::L1EmParticle p( *lIt ); double lAbsEta = fabs( p.eta( ) ); // Pass E or B coefficients depending on p.eta(). if ( lAbsEta < 1.6 ) { calibrateP4 ( p, mEgammacoeffb, mEgammabincorr ); } else if ( lAbsEta < 2.6 ) { calibrateP4 ( p, mEgammacoeffe, mEgammabincorr ); } l1EGamma->push_back( p ); } iEvent.put( l1EGamma, "EGamma" ); } edm::Handle < l1extra::L1EmParticleCollection > ieg; if ( iEvent.getByLabel( mIsoegamma, ieg ) ) { std::auto_ptr < l1extra::L1EmParticleCollection > l1IsoEGamma( new l1extra::L1EmParticleCollection ); for ( l1extra::L1EmParticleCollection::const_iterator lIt = ieg->begin( ) ; lIt != ieg->end() ; ++lIt ) { l1extra::L1EmParticle p( *lIt ); double lAbsEta = fabs( p.eta( ) ); if ( lAbsEta < 1.6 ) { calibrateP4 ( p, mEgammacoeffb, mEgammabincorr ); } else if ( lAbsEta < 2.6 ) { calibrateP4 ( p, mEgammacoeffe, mEgammabincorr ); } l1IsoEGamma->push_back( p ); } iEvent.put( l1IsoEGamma, "IsoEGamma" ); } edm::Handle < l1extra::L1JetParticleCollection > tau; if ( iEvent.getByLabel( mTaus, tau ) ) { std::auto_ptr < l1extra::L1JetParticleCollection > l1Tau( new l1extra::L1JetParticleCollection ); for ( l1extra::L1JetParticleCollection::const_iterator lIt = tau->begin( ) ; lIt != tau->end() ; ++lIt ) { l1extra::L1JetParticle p( *lIt ); double lAbsEta = fabs( p.eta( ) ); if ( lAbsEta < 1.6 ) { calibrateP4 ( p, mTaucoeffb, mTaubincorr ); } else if ( lAbsEta < 2.6 ) { calibrateP4 ( p, mTaucoeffe, mTaubincorr ); } l1Tau->push_back( p ); } iEvent.put( l1Tau, "Taus" ); } edm::Handle < l1extra::L1JetParticleCollection > itau; if ( iEvent.getByLabel( mIsotaus, itau ) ) { std::auto_ptr < l1extra::L1JetParticleCollection > l1IsoTau( new l1extra::L1JetParticleCollection ); for ( l1extra::L1JetParticleCollection::const_iterator lIt = itau->begin( ) ; lIt != itau->end() ; ++lIt ) { l1extra::L1JetParticle p( *lIt ); double lAbsEta = fabs( p.eta( ) ); if ( lAbsEta < 1.6 ) { calibrateP4 ( p, mTaucoeffb, mTaubincorr ); } else if ( lAbsEta < 2.6 ) { calibrateP4 ( p, mTaucoeffe, mTaubincorr ); } l1IsoTau->push_back( p ); } iEvent.put( l1IsoTau, "IsoTaus" ); } edm::Handle < l1extra::L1JetParticleCollection > jets; if ( iEvent.getByLabel( mJets, jets ) ) { std::auto_ptr < l1extra::L1JetParticleCollection > l1Jet( new l1extra::L1JetParticleCollection ); for ( l1extra::L1JetParticleCollection::const_iterator lIt = jets->begin( ) ; lIt != jets->end() ; ++lIt ) { l1Jet->push_back( *lIt ); } iEvent.put( l1Jet, "Jets" ); } }
edm::InputTag L1ExtraCalibrator::mEgamma [private] |
Definition at line 44 of file L1ExtraCalibrator.cc.
Referenced by produce().
std::vector< double > L1ExtraCalibrator::mEgammabincorr [private] |
Definition at line 54 of file L1ExtraCalibrator.cc.
Referenced by produce().
std::vector< double > L1ExtraCalibrator::mEgammacoeffb [private] |
Definition at line 50 of file L1ExtraCalibrator.cc.
Referenced by produce().
std::vector< double > L1ExtraCalibrator::mEgammacoeffe [private] |
Definition at line 52 of file L1ExtraCalibrator.cc.
Referenced by produce().
edm::InputTag L1ExtraCalibrator::mIsoegamma [private] |
Definition at line 45 of file L1ExtraCalibrator.cc.
Referenced by produce().
edm::InputTag L1ExtraCalibrator::mIsotaus [private] |
Definition at line 47 of file L1ExtraCalibrator.cc.
Referenced by produce().
edm::InputTag L1ExtraCalibrator::mJets [private] |
Definition at line 48 of file L1ExtraCalibrator.cc.
Referenced by produce().
std::vector< double > L1ExtraCalibrator::mTaubincorr [private] |
Definition at line 55 of file L1ExtraCalibrator.cc.
Referenced by produce().
std::vector< double > L1ExtraCalibrator::mTaucoeffb [private] |
Definition at line 51 of file L1ExtraCalibrator.cc.
Referenced by produce().
std::vector< double > L1ExtraCalibrator::mTaucoeffe [private] |
Definition at line 53 of file L1ExtraCalibrator.cc.
Referenced by produce().
edm::InputTag L1ExtraCalibrator::mTaus [private] |
Definition at line 46 of file L1ExtraCalibrator.cc.
Referenced by produce().