CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
cms::MuonMET Class Reference

#include <MuonMET.h>

Inheritance diagram for cms::MuonMET:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MuonMET (const edm::ParameterSet &)
 
 MuonMET ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~MuonMET ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

MuonMETAlgo alg_
 
edm::InputTag metTypeInputTag_
 
edm::InputTag muonDepValueMap_
 
edm::InputTag muonsInputTag_
 
edm::InputTag uncorMETInputTag_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 33 of file MuonMET.h.

Constructor & Destructor Documentation

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

Definition at line 47 of file MuonMET.cc.

References edm::ParameterSet::getParameter(), edm::InputTag::label(), metTypeInputTag_, muonDepValueMap_, muonsInputTag_, and uncorMETInputTag_.

47  : alg_()
48  {
49  metTypeInputTag_ = iConfig.getParameter<edm::InputTag>("metTypeInputTag");
50  uncorMETInputTag_ = iConfig.getParameter<edm::InputTag>("uncorMETInputTag");
51  muonsInputTag_ = iConfig.getParameter<edm::InputTag>("muonsInputTag");
52  muonDepValueMap_ = iConfig.getParameter<edm::InputTag>("muonMETDepositValueMapInputTag");
53 
54  if( metTypeInputTag_.label() == "CaloMET" ) {
55  produces<reco::CaloMETCollection>();
56  } else
57  produces<reco::METCollection>();
58 
59  }
T getParameter(std::string const &) const
MuonMETAlgo alg_
Definition: MuonMET.h:43
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:44
edm::InputTag muonDepValueMap_
Definition: MuonMET.h:47
std::string const & label() const
Definition: InputTag.h:42
edm::InputTag muonsInputTag_
Definition: MuonMET.h:46
edm::InputTag uncorMETInputTag_
Definition: MuonMET.h:45
MuonMET::MuonMET ( )
explicit

Definition at line 60 of file MuonMET.cc.

60 : alg_() {}
MuonMETAlgo alg_
Definition: MuonMET.h:43
MuonMET::~MuonMET ( )
virtual

Definition at line 62 of file MuonMET.cc.

62 {}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 65 of file MuonMET.cc.

References alg_, edm::Event::getByLabel(), edm::InputTag::label(), metTypeInputTag_, muonDepValueMap_, muonsInputTag_, convertSQLitetoXML_cfg::output, edm::Handle< T >::product(), edm::Event::put(), MuonMETAlgo::run(), and uncorMETInputTag_.

66  {
67  using namespace edm;
68 
69  //get the muons
70  Handle<View<reco::Muon> > inputMuons;
71  iEvent.getByLabel( muonsInputTag_, inputMuons );
72 
74 
75  iEvent.getByLabel( muonDepValueMap_, vm_muCorrData_h);
76 
77  if( metTypeInputTag_.label() == "CaloMET")
78  {
79  Handle<View<reco::CaloMET> > inputUncorMet;
80  iEvent.getByLabel( uncorMETInputTag_, inputUncorMet ); //Get Inputs
81  std::auto_ptr<reco::CaloMETCollection> output( new reco::CaloMETCollection() ); //Create empty output
82 
83  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()),
84  *(inputUncorMet.product()), &*output);
85 
86  iEvent.put(output); //Put output into Event
87  }
88  else
89  {
90  Handle<View<reco::MET> > inputUncorMet; //Define Inputs
91  iEvent.getByLabel( uncorMETInputTag_, inputUncorMet ); //Get Inputs
92  std::auto_ptr<reco::METCollection> output( new reco::METCollection() ); //Create empty output
93 
94 
95  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()),*(inputUncorMet.product()), &*output);
96  iEvent.put(output); //Put output into Event
97  }
98  }
MuonMETAlgo alg_
Definition: MuonMET.h:43
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:23
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:44
edm::InputTag muonDepValueMap_
Definition: MuonMET.h:47
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
T const * product() const
Definition: Handle.h:74
std::string const & label() const
Definition: InputTag.h:42
edm::InputTag muonsInputTag_
Definition: MuonMET.h:46
edm::InputTag uncorMETInputTag_
Definition: MuonMET.h:45
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)

Member Data Documentation

MuonMETAlgo cms::MuonMET::alg_
private

Definition at line 43 of file MuonMET.h.

Referenced by produce().

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

Definition at line 44 of file MuonMET.h.

Referenced by MuonMET(), and produce().

edm::InputTag cms::MuonMET::muonDepValueMap_
private

Definition at line 47 of file MuonMET.h.

Referenced by MuonMET(), and produce().

edm::InputTag cms::MuonMET::muonsInputTag_
private

Definition at line 46 of file MuonMET.h.

Referenced by MuonMET(), and produce().

edm::InputTag cms::MuonMET::uncorMETInputTag_
private

Definition at line 45 of file MuonMET.h.

Referenced by MuonMET(), and produce().