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 //____________________________________________________________________________||
caloMetM_cfi.muonsInputTag
muonsInputTag
Definition: caloMetM_cfi.py:8
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:72
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
TCMET_cfi.muonDepValueMap
muonDepValueMap
Definition: TCMET_cfi.py:14
edm::Handle
Definition: AssociativeIterator.h:50
caloMetM_cfi.uncorMETInputTag
uncorMETInputTag
Definition: caloMetM_cfi.py:7
cms::MuonMET::alg_
MuonMETAlgo alg_
Definition: MuonMET.h:33
CaloMETCollection.h
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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
edm::ParameterSet
Definition: ParameterSet.h:47
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:58
cms::MuonMET::MuonMET
MuonMET()
Definition: MuonMET.cc:35
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
edm::Event
Definition: Event.h:73
calomuons_cfi.inputMuons
inputMuons
Definition: calomuons_cfi.py:11
edm::InputTag
Definition: InputTag.h:15
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21