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 ()
 
 MuonMET (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~MuonMET () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () 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 25 of file MuonMET.h.

Constructor & Destructor Documentation

◆ MuonMET() [1/2]

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

Definition at line 17 of file MuonMET.cc.

18  : alg_(), metTypeInputTag_(iConfig.getParameter<edm::InputTag>("metTypeInputTag")) {
19  edm::InputTag muonsInputTag = iConfig.getParameter<edm::InputTag>("muonsInputTag");
20  inputMuonToken_ = consumes<edm::View<reco::Muon> >(muonsInputTag);
21 
22  edm::InputTag muonDepValueMap = iConfig.getParameter<edm::InputTag>("muonMETDepositValueMapInputTag");
23  inputValueMapMuonMetCorrToken_ = consumes<edm::ValueMap<reco::MuonMETCorrectionData> >(muonDepValueMap);
24 
25  edm::InputTag uncorMETInputTag = iConfig.getParameter<edm::InputTag>("uncorMETInputTag");
26  if (metTypeInputTag_.label() == "CaloMET") {
27  inputCaloMETToken_ = consumes<edm::View<reco::CaloMET> >(uncorMETInputTag);
28  produces<reco::CaloMETCollection>();
29  } else {
30  inputMETToken_ = consumes<edm::View<reco::MET> >(uncorMETInputTag);
31  produces<reco::METCollection>();
32  }
33  }

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

◆ MuonMET() [2/2]

cms::MuonMET::MuonMET ( )
explicit

Definition at line 35 of file MuonMET.cc.

35 : alg_() {}

◆ ~MuonMET()

cms::MuonMET::~MuonMET ( )
inlineoverride

Definition at line 29 of file MuonMET.h.

29 {}

Member Function Documentation

◆ produce()

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

Definition at line 37 of file MuonMET.cc.

37  {
39  iEvent.getByToken(inputMuonToken_, inputMuons);
40 
42 
43  iEvent.getByToken(inputValueMapMuonMetCorrToken_, vm_muCorrData_h);
44 
45  if (metTypeInputTag_.label() == "CaloMET") {
47  iEvent.getByToken(inputCaloMETToken_, inputUncorMet);
48  auto output = std::make_unique<reco::CaloMETCollection>();
49  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()), *(inputUncorMet.product()), &*output);
50  iEvent.put(std::move(output));
51  } else {
52  edm::Handle<edm::View<reco::MET> > inputUncorMet;
53  iEvent.getByToken(inputMETToken_, inputUncorMet);
54  auto output = std::make_unique<reco::METCollection>();
55  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()), *(inputUncorMet.product()), &*output);
56  iEvent.put(std::move(output));
57  }
58  }

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

Member Data Documentation

◆ alg_

MuonMETAlgo cms::MuonMET::alg_
private

Definition at line 33 of file MuonMET.h.

Referenced by produce().

◆ inputCaloMETToken_

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

Definition at line 38 of file MuonMET.h.

Referenced by MuonMET(), and produce().

◆ inputMETToken_

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

Definition at line 39 of file MuonMET.h.

Referenced by MuonMET(), and produce().

◆ inputMuonToken_

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

Definition at line 36 of file MuonMET.h.

Referenced by MuonMET(), and produce().

◆ inputValueMapMuonMetCorrToken_

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

Definition at line 37 of file MuonMET.h.

Referenced by MuonMET(), and produce().

◆ metTypeInputTag_

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

Definition at line 34 of file MuonMET.h.

Referenced by MuonMET(), and produce().

cms::MuonMET::inputValueMapMuonMetCorrToken_
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
Definition: MuonMET.h:37
edm::Handle::product
T const * product() const
Definition: Handle.h:70
cms::MuonMET::inputMETToken_
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
Definition: MuonMET.h:39
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
MetdistMuonCorrections_cff.uncorMETInputTag
uncorMETInputTag
Definition: MetdistMuonCorrections_cff.py:8
edm::Handle
Definition: AssociativeIterator.h:50
cms::MuonMET::alg_
MuonMETAlgo alg_
Definition: MuonMET.h:33
distTCMET_cfi.muonDepValueMap
muonDepValueMap
Definition: distTCMET_cfi.py:17
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
MetdistMuonCorrections_cff.muonsInputTag
muonsInputTag
Definition: MetdistMuonCorrections_cff.py:9
cms::MuonMET::inputCaloMETToken_
edm::EDGetTokenT< edm::View< reco::CaloMET > > inputCaloMETToken_
Definition: MuonMET.h:38
cms::MuonMET::inputMuonToken_
edm::EDGetTokenT< edm::View< reco::Muon > > inputMuonToken_
Definition: MuonMET.h:36
MuonMETAlgo::run
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)
iEvent
int iEvent
Definition: GenABIO.cc:224
cms::MuonMET::metTypeInputTag_
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:34
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
calomuons_cfi.inputMuons
inputMuons
Definition: calomuons_cfi.py:11
edm::InputTag
Definition: InputTag.h:15