CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cms::MuonMET Class Reference

#include <MuonMET.h>

Inheritance diagram for cms::MuonMET:
edm::stream::EDProducer<>

Public Member Functions

 MuonMET (const edm::ParameterSet &)
 
 MuonMET ()
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~MuonMET () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Private Attributes

MuonMETAlgo alg_
 
edm::EDGetTokenT< edm::View< reco::CaloMET > > inputCaloMETToken_
 
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
 
edm::EDGetTokenT< edm::View< reco::Muon > > inputMuonToken_
 
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
 
edm::InputTag metTypeInputTag_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 27 of file MuonMET.h.

Constructor & Destructor Documentation

cms::MuonMET::MuonMET ( const edm::ParameterSet iConfig)
explicit

Definition at line 18 of file MuonMET.cc.

References edm::ParameterSet::getParameter(), inputCaloMETToken_, inputMETToken_, inputMuonToken_, inputValueMapMuonMetCorrToken_, edm::InputTag::label(), metTypeInputTag_, TCMET_cfi::muonDepValueMap, caloMetM_cfi::muonsInputTag, and caloMetM_cfi::uncorMETInputTag.

19  : alg_()
20  , metTypeInputTag_(iConfig.getParameter<edm::InputTag>("metTypeInputTag"))
21  {
22 
23  edm::InputTag muonsInputTag = iConfig.getParameter<edm::InputTag>("muonsInputTag");
24  inputMuonToken_ = consumes<edm::View<reco::Muon> >(muonsInputTag);
25 
26  edm::InputTag muonDepValueMap = iConfig.getParameter<edm::InputTag>("muonMETDepositValueMapInputTag");
27  inputValueMapMuonMetCorrToken_ = consumes<edm::ValueMap<reco::MuonMETCorrectionData> >(muonDepValueMap);
28 
29  edm::InputTag uncorMETInputTag = iConfig.getParameter<edm::InputTag>("uncorMETInputTag");
30  if( metTypeInputTag_.label() == "CaloMET" )
31  {
32  inputCaloMETToken_ = consumes<edm::View<reco::CaloMET> >(uncorMETInputTag);
33  produces<reco::CaloMETCollection>();
34  }
35  else
36  {
37  inputMETToken_ = consumes<edm::View<reco::MET> >(uncorMETInputTag);
38  produces<reco::METCollection>();
39  }
40  }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
Definition: MuonMET.h:42
edm::EDGetTokenT< edm::View< reco::Muon > > inputMuonToken_
Definition: MuonMET.h:39
MuonMETAlgo alg_
Definition: MuonMET.h:36
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:37
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
Definition: MuonMET.h:40
muonDepValueMap
Definition: TCMET_cfi.py:14
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< edm::View< reco::CaloMET > > inputCaloMETToken_
Definition: MuonMET.h:41
cms::MuonMET::MuonMET ( )
explicit

Definition at line 42 of file MuonMET.cc.

42 : alg_() {}
MuonMETAlgo alg_
Definition: MuonMET.h:36
cms::MuonMET::~MuonMET ( )
inlineoverride

Definition at line 32 of file MuonMET.h.

References produce().

32 { }

Member Function Documentation

void cms::MuonMET::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 44 of file MuonMET.cc.

References alg_, DEFINE_FWK_MODULE, edm::Event::getByToken(), inputCaloMETToken_, inputMETToken_, calomuons_cfi::inputMuons, inputMuonToken_, inputValueMapMuonMetCorrToken_, edm::InputTag::label(), metTypeInputTag_, eostools::move(), convertSQLitetoXML_cfg::output, edm::Handle< T >::product(), edm::Event::put(), and MuonMETAlgo::run().

Referenced by ~MuonMET().

45  {
47  iEvent.getByToken(inputMuonToken_, inputMuons);
48 
50 
51  iEvent.getByToken(inputValueMapMuonMetCorrToken_, vm_muCorrData_h);
52 
53  if( metTypeInputTag_.label() == "CaloMET")
54  {
56  iEvent.getByToken(inputCaloMETToken_, inputUncorMet);
57  auto output = std::make_unique<reco::CaloMETCollection>();
58  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()), *(inputUncorMet.product()), &*output);
59  iEvent.put(std::move(output));
60  }
61  else
62  {
63  edm::Handle<edm::View<reco::MET> > inputUncorMet;
64  iEvent.getByToken(inputMETToken_, inputUncorMet);
65  auto output = std::make_unique<reco::METCollection>();
66  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()),*(inputUncorMet.product()), &*output);
67  iEvent.put(std::move(output));
68  }
69  }
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
Definition: MuonMET.h:42
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< edm::View< reco::Muon > > inputMuonToken_
Definition: MuonMET.h:39
MuonMETAlgo alg_
Definition: MuonMET.h:36
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:37
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
Definition: MuonMET.h:40
T const * product() const
Definition: Handle.h:74
std::string const & label() const
Definition: InputTag.h:36
virtual void run(const edm::View< reco::Muon > &inputMuons, const edm::ValueMap< reco::MuonMETCorrectionData > &vm_muCorrData, const edm::View< reco::MET > &uncorMET, reco::METCollection *corMET)
edm::EDGetTokenT< edm::View< reco::CaloMET > > inputCaloMETToken_
Definition: MuonMET.h:41
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

MuonMETAlgo cms::MuonMET::alg_
private

Definition at line 36 of file MuonMET.h.

Referenced by produce().

edm::EDGetTokenT<edm::View<reco::CaloMET> > cms::MuonMET::inputCaloMETToken_
private

Definition at line 41 of file MuonMET.h.

Referenced by MuonMET(), and produce().

edm::EDGetTokenT<edm::View<reco::MET> > cms::MuonMET::inputMETToken_
private

Definition at line 42 of file MuonMET.h.

Referenced by MuonMET(), and produce().

edm::EDGetTokenT<edm::View<reco::Muon> > cms::MuonMET::inputMuonToken_
private

Definition at line 39 of file MuonMET.h.

Referenced by MuonMET(), and produce().

edm::EDGetTokenT<edm::ValueMap<reco::MuonMETCorrectionData> > cms::MuonMET::inputValueMapMuonMetCorrToken_
private

Definition at line 40 of file MuonMET.h.

Referenced by MuonMET(), and produce().

edm::InputTag cms::MuonMET::metTypeInputTag_
private

Definition at line 37 of file MuonMET.h.

Referenced by MuonMET(), and produce().