CMS 3D CMS Logo

MuonMET.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: METProducers
4 // Class: MuonMET
5 //
6 
7 //____________________________________________________________________________||
9 
12 
13 //____________________________________________________________________________||
14 namespace cms {
15 
16  //____________________________________________________________________________||
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  }
34 
35  MuonMET::MuonMET() : alg_() {}
36 
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  }
59  //____________________________________________________________________________||
61 
62 } // namespace cms
63 
64 //____________________________________________________________________________||
cms::MuonMET::inputValueMapMuonMetCorrToken_
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
Definition: MuonMET.h:37
cms::MuonMET::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: MuonMET.cc: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:32
MetdistMuonCorrections_cff.uncorMETInputTag
uncorMETInputTag
Definition: MetdistMuonCorrections_cff.py:8
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Handle
Definition: AssociativeIterator.h:50
cms::MuonMET::alg_
MuonMETAlgo alg_
Definition: MuonMET.h:33
CaloMETCollection.h
distTCMET_cfi.muonDepValueMap
muonDepValueMap
Definition: distTCMET_cfi.py:17
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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
METCollection.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
cms::MuonMET
Definition: MuonMET.h:25
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
MuonMET.h
edm::EventSetup
Definition: EventSetup.h:57
cms::MuonMET::MuonMET
MuonMET()
Definition: MuonMET.cc:35
cms::MuonMET::metTypeInputTag_
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:34
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::Event
Definition: Event.h:73
calomuons_cfi.inputMuons
inputMuons
Definition: calomuons_cfi.py:12
edm::InputTag
Definition: InputTag.h:15
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21