CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

CorrectedMETProducerT< T > Class Template Reference

#include <CorrectedMETProducerT.h>

Inheritance diagram for CorrectedMETProducerT< T >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 CorrectedMETProducerT (const edm::ParameterSet &cfg)
 ~CorrectedMETProducerT ()

Private Types

typedef std::vector< TMETCollection

Private Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es)

Private Attributes

METCorrectionAlgorithmalgorithm_
std::string moduleLabel_
edm::InputTag src_

Detailed Description

template<typename T>
class CorrectedMETProducerT< T >

Produce MET collections with Type 1 / Type 1 + 2 corrections applied

NOTE: This file defines the generic template. Concrete instances for CaloMET and PFMET are defined in JetMETCorrections/Type1MET/plugins/CorrectedCaloMETProducer.cc JetMETCorrections/Type1MET/plugins/CorrectedPFMETProducer.cc

Authors:
Michael Schmitt, Richard Cavanaugh, The University of Florida Florent Lacroix, University of Illinois at Chicago Christian Veelken, LLR
Version:
Revision:
1.4
Id:
CorrectedMETProducerT.h,v 1.4 2011/09/16 08:05:48 veelken Exp

Definition at line 65 of file CorrectedMETProducerT.h.


Member Typedef Documentation

template<typename T >
typedef std::vector<T> CorrectedMETProducerT< T >::METCollection [private]

Definition at line 67 of file CorrectedMETProducerT.h.


Constructor & Destructor Documentation

template<typename T >
CorrectedMETProducerT< T >::CorrectedMETProducerT ( const edm::ParameterSet cfg) [inline, explicit]
template<typename T >
CorrectedMETProducerT< T >::~CorrectedMETProducerT ( ) [inline]

Definition at line 81 of file CorrectedMETProducerT.h.

References CorrectedMETProducerT< T >::algorithm_.

  {
    delete algorithm_;
  }

Member Function Documentation

template<typename T >
void CorrectedMETProducerT< T >::produce ( edm::Event evt,
const edm::EventSetup es 
) [inline, private, virtual]

Implements edm::EDProducer.

Definition at line 88 of file CorrectedMETProducerT.h.

References CorrectedMETProducerT< T >::algorithm_, METCorrectionAlgorithm::compMETCorrection(), edm::Event::getByLabel(), edm::Event::put(), and CorrectedMETProducerT< T >::src_.

  {
    std::auto_ptr<METCollection> correctedMEtCollection(new METCollection);

    edm::Handle<METCollection> rawMEtCollection;
    evt.getByLabel(src_, rawMEtCollection);

    for ( typename METCollection::const_iterator rawMEt = rawMEtCollection->begin();
          rawMEt != rawMEtCollection->end(); ++rawMEt ) {
      CorrMETData correction = algorithm_->compMETCorrection(evt, es);
      
      static CorrectedMETProducer_namespace::CorrectedMETFactoryT<T> correctedMET_factory;
      T correctedMEt = correctedMET_factory(*rawMEt, correction);

      correctedMEtCollection->push_back(correctedMEt);
    }
          
//--- add collection of MET objects with Type 1 / Type 1 + 2 corrections applied to the event
    evt.put(correctedMEtCollection);
  }

Member Data Documentation

template<typename T >
METCorrectionAlgorithm* CorrectedMETProducerT< T >::algorithm_ [private]
template<typename T >
std::string CorrectedMETProducerT< T >::moduleLabel_ [private]

Definition at line 109 of file CorrectedMETProducerT.h.

template<typename T >
edm::InputTag CorrectedMETProducerT< T >::src_ [private]