CMS 3D CMS Logo

Public Member Functions | Private Attributes

cms::MuonMET Class Reference

#include <MuonMET.h>

Inheritance diagram for cms::MuonMET:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 MuonMET (const edm::ParameterSet &)
 MuonMET ()
virtual void produce (edm::Event &, const edm::EventSetup &)
virtual ~MuonMET ()

Private Attributes

MuonMETAlgo alg_
edm::InputTag metTypeInputTag_
edm::InputTag muonDepValueMap_
edm::InputTag muonsInputTag_
edm::InputTag uncorMETInputTag_

Detailed Description

Definition at line 33 of file MuonMET.h.


Constructor & Destructor Documentation

MuonMET::MuonMET ( const edm::ParameterSet iConfig) [explicit]

Definition at line 47 of file MuonMET.cc.

References edm::ParameterSet::getParameter(), edm::InputTag::label(), metTypeInputTag_, muonDepValueMap_, muonsInputTag_, and uncorMETInputTag_.

                                                   : alg_() 
  {
    metTypeInputTag_             = iConfig.getParameter<edm::InputTag>("metTypeInputTag");
    uncorMETInputTag_            = iConfig.getParameter<edm::InputTag>("uncorMETInputTag");
    muonsInputTag_               = iConfig.getParameter<edm::InputTag>("muonsInputTag");
    muonDepValueMap_             = iConfig.getParameter<edm::InputTag>("muonMETDepositValueMapInputTag");

    if( metTypeInputTag_.label() == "CaloMET" ) {
      produces<reco::CaloMETCollection>();
    } else 
      produces<reco::METCollection>();
    
  }
MuonMET::MuonMET ( ) [explicit]

Definition at line 60 of file MuonMET.cc.

: alg_() {}
MuonMET::~MuonMET ( ) [virtual]

Definition at line 62 of file MuonMET.cc.

{}

Member Function Documentation

void MuonMET::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 65 of file MuonMET.cc.

References alg_, edm::Event::getByLabel(), edm::InputTag::label(), metTypeInputTag_, muonDepValueMap_, muonsInputTag_, convertSQLitetoXML_cfg::output, edm::Handle< T >::product(), edm::Event::put(), MuonMETAlgo::run(), and uncorMETInputTag_.

  {
    using namespace edm;
    
    //get the muons
    Handle<View<reco::Muon> > inputMuons;
    iEvent.getByLabel( muonsInputTag_, inputMuons );

    Handle<ValueMap<reco::MuonMETCorrectionData> > vm_muCorrData_h;
    
    iEvent.getByLabel( muonDepValueMap_, vm_muCorrData_h);
    
    if( metTypeInputTag_.label() == "CaloMET")
      {
        Handle<View<reco::CaloMET> > inputUncorMet;
        iEvent.getByLabel( uncorMETInputTag_, inputUncorMet  );     //Get Inputs
        std::auto_ptr<reco::CaloMETCollection> output( new reco::CaloMETCollection() );  //Create empty output
        
        alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()),
                 *(inputUncorMet.product()), &*output);
        
        iEvent.put(output);                                        //Put output into Event
      }
    else
      {
        Handle<View<reco::MET> > inputUncorMet;                     //Define Inputs
        iEvent.getByLabel( uncorMETInputTag_,  inputUncorMet );     //Get Inputs
        std::auto_ptr<reco::METCollection> output( new reco::METCollection() );  //Create empty output
        

        alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()),*(inputUncorMet.product()), &*output);
        iEvent.put(output);                                        //Put output into Event
      }
  }

Member Data Documentation

Definition at line 43 of file MuonMET.h.

Referenced by produce().

Definition at line 44 of file MuonMET.h.

Referenced by MuonMET(), and produce().

Definition at line 47 of file MuonMET.h.

Referenced by MuonMET(), and produce().

Definition at line 46 of file MuonMET.h.

Referenced by MuonMET(), and produce().

Definition at line 45 of file MuonMET.h.

Referenced by MuonMET(), and produce().