CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 25 of file MuonMET.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file MuonMET.cc.

References edm::ParameterSet::getParameter(), inputCaloMETToken_, inputMETToken_, inputMuonToken_, inputValueMapMuonMetCorrToken_, edm::InputTag::label(), and metTypeInputTag_.

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  }
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
Definition: MuonMET.h:39
edm::EDGetTokenT< edm::View< reco::Muon > > inputMuonToken_
Definition: MuonMET.h:36
MuonMETAlgo alg_
Definition: MuonMET.h:33
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:34
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
Definition: MuonMET.h:37
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< edm::View< reco::CaloMET > > inputCaloMETToken_
Definition: MuonMET.h:38
cms::MuonMET::MuonMET ( )
explicit

Definition at line 35 of file MuonMET.cc.

35 : alg_() {}
MuonMETAlgo alg_
Definition: MuonMET.h:33
cms::MuonMET::~MuonMET ( )
inlineoverride

Definition at line 29 of file MuonMET.h.

29 {}

Member Function Documentation

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

Definition at line 37 of file MuonMET.cc.

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

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  }
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
Definition: MuonMET.h:39
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< edm::View< reco::Muon > > inputMuonToken_
Definition: MuonMET.h:36
MuonMETAlgo alg_
Definition: MuonMET.h:33
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:34
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
Definition: MuonMET.h:37
def move
Definition: eostools.py:511
T const * product() const
Definition: Handle.h:70
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:38

Member Data Documentation

MuonMETAlgo cms::MuonMET::alg_
private

Definition at line 33 of file MuonMET.h.

Referenced by produce().

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

Definition at line 38 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 39 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 36 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 37 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 34 of file MuonMET.h.

Referenced by MuonMET(), and produce().