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 ()
 
ModuleDescription const & moduleDescription () const
 
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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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_
 
edm::InputTag muonDepValueMap_
 
edm::InputTag muonsInputTag_
 
edm::InputTag uncorMETInputTag_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::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 38 of file MuonMET.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file MuonMET.cc.

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

44  : alg_()
45  {
46  metTypeInputTag_ = iConfig.getParameter<edm::InputTag>("metTypeInputTag");
47  uncorMETInputTag_ = iConfig.getParameter<edm::InputTag>("uncorMETInputTag");
48  muonsInputTag_ = iConfig.getParameter<edm::InputTag>("muonsInputTag");
49  muonDepValueMap_ = iConfig.getParameter<edm::InputTag>("muonMETDepositValueMapInputTag");
50 
51 
52  inputMuonToken_ = consumes<edm::View<reco::Muon> >(muonsInputTag_);
53  inputValueMapMuonMetCorrToken_ = consumes<edm::ValueMap<reco::MuonMETCorrectionData> >(muonDepValueMap_);
54 
55  if( metTypeInputTag_.label() == "CaloMET" ) {
56  inputCaloMETToken_ = consumes<edm::View<reco::CaloMET> >(uncorMETInputTag_);
57  produces<reco::CaloMETCollection>();
58  } else
59  inputMETToken_ = consumes<edm::View<reco::MET> >(uncorMETInputTag_);
60  produces<reco::METCollection>();
61 
62  }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
Definition: MuonMET.h:57
edm::EDGetTokenT< edm::View< reco::Muon > > inputMuonToken_
Definition: MuonMET.h:54
MuonMETAlgo alg_
Definition: MuonMET.h:48
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:49
edm::InputTag muonDepValueMap_
Definition: MuonMET.h:52
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
Definition: MuonMET.h:55
std::string const & label() const
Definition: InputTag.h:42
edm::InputTag muonsInputTag_
Definition: MuonMET.h:51
edm::InputTag uncorMETInputTag_
Definition: MuonMET.h:50
edm::EDGetTokenT< edm::View< reco::CaloMET > > inputCaloMETToken_
Definition: MuonMET.h:56
MuonMET::MuonMET ( )
explicit

Definition at line 63 of file MuonMET.cc.

63 : alg_() {}
MuonMETAlgo alg_
Definition: MuonMET.h:48
MuonMET::~MuonMET ( )
virtual

Definition at line 65 of file MuonMET.cc.

65 {}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 68 of file MuonMET.cc.

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

69  {
70  using namespace edm;
71 
72  //get the muons
73  Handle<View<reco::Muon> > inputMuons;
74  iEvent.getByToken(inputMuonToken_, inputMuons );
75 
77 
78  iEvent.getByToken(inputValueMapMuonMetCorrToken_, vm_muCorrData_h);
79 
80  if( metTypeInputTag_.label() == "CaloMET")
81  {
82  Handle<View<reco::CaloMET> > inputUncorMet;
83  iEvent.getByToken(inputCaloMETToken_, inputUncorMet); //Get Inputs
84  std::auto_ptr<reco::CaloMETCollection> output( new reco::CaloMETCollection() ); //Create empty output
85 
86  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()),
87  *(inputUncorMet.product()), &*output);
88 
89  iEvent.put(output); //Put output into Event
90  }
91  else
92  {
93  Handle<View<reco::MET> > inputUncorMet; //Define Inputs
94  iEvent.getByToken(inputMETToken_, inputUncorMet); //Get Inputs
95  std::auto_ptr<reco::METCollection> output( new reco::METCollection() ); //Create empty output
96 
97 
98  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()),*(inputUncorMet.product()), &*output);
99  iEvent.put(output); //Put output into Event
100  }
101  }
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
Definition: MuonMET.h:57
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< edm::View< reco::Muon > > inputMuonToken_
Definition: MuonMET.h:54
MuonMETAlgo alg_
Definition: MuonMET.h:48
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:23
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:49
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
Definition: MuonMET.h:55
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
T const * product() const
Definition: Handle.h:81
std::string const & label() const
Definition: InputTag.h:42
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:56

Member Data Documentation

MuonMETAlgo cms::MuonMET::alg_
private

Definition at line 48 of file MuonMET.h.

Referenced by produce().

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

Definition at line 56 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 57 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 54 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 55 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 49 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 52 of file MuonMET.h.

Referenced by MuonMET().

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

Definition at line 51 of file MuonMET.h.

Referenced by MuonMET().

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

Definition at line 50 of file MuonMET.h.

Referenced by MuonMET().