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::stream::EDProducer<> edm::stream::EDProducerBase 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::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
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 27 of file MuonMET.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file MuonMET.cc.

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

19  : alg_()
20  , metTypeInputTag_(iConfig.getParameter<edm::InputTag>("metTypeInputTag"))
21  {
22 
23  edm::InputTag muonsInputTag = iConfig.getParameter<edm::InputTag>("muonsInputTag");
24  inputMuonToken_ = consumes<edm::View<reco::Muon> >(muonsInputTag);
25 
26  edm::InputTag muonDepValueMap = iConfig.getParameter<edm::InputTag>("muonMETDepositValueMapInputTag");
27  inputValueMapMuonMetCorrToken_ = consumes<edm::ValueMap<reco::MuonMETCorrectionData> >(muonDepValueMap);
28 
29  edm::InputTag uncorMETInputTag = iConfig.getParameter<edm::InputTag>("uncorMETInputTag");
30  if( metTypeInputTag_.label() == "CaloMET" )
31  {
32  inputCaloMETToken_ = consumes<edm::View<reco::CaloMET> >(uncorMETInputTag);
33  produces<reco::CaloMETCollection>();
34  }
35  else
36  {
37  inputMETToken_ = consumes<edm::View<reco::MET> >(uncorMETInputTag);
38  produces<reco::METCollection>();
39  }
40  }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
Definition: MuonMET.h:42
edm::EDGetTokenT< edm::View< reco::Muon > > inputMuonToken_
Definition: MuonMET.h:39
MuonMETAlgo alg_
Definition: MuonMET.h:36
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:37
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
Definition: MuonMET.h:40
std::string const & label() const
Definition: InputTag.h:42
edm::EDGetTokenT< edm::View< reco::CaloMET > > inputCaloMETToken_
Definition: MuonMET.h:41
cms::MuonMET::MuonMET ( )
explicit

Definition at line 42 of file MuonMET.cc.

42 : alg_() {}
MuonMETAlgo alg_
Definition: MuonMET.h:36
virtual cms::MuonMET::~MuonMET ( )
inlinevirtual

Definition at line 32 of file MuonMET.h.

32 { }

Member Function Documentation

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

Implements edm::stream::EDProducerBase.

Definition at line 44 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().

45  {
47  iEvent.getByToken(inputMuonToken_, inputMuons);
48 
50 
51  iEvent.getByToken(inputValueMapMuonMetCorrToken_, vm_muCorrData_h);
52 
53  if( metTypeInputTag_.label() == "CaloMET")
54  {
56  iEvent.getByToken(inputCaloMETToken_, inputUncorMet);
57  std::auto_ptr<reco::CaloMETCollection> output( new reco::CaloMETCollection() );
58  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()), *(inputUncorMet.product()), &*output);
59  iEvent.put(output);
60  }
61  else
62  {
63  edm::Handle<edm::View<reco::MET> > inputUncorMet;
64  iEvent.getByToken(inputMETToken_, inputUncorMet);
65  std::auto_ptr<reco::METCollection> output( new reco::METCollection() );
66  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()),*(inputUncorMet.product()), &*output);
67  iEvent.put(output);
68  }
69  }
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
Definition: MuonMET.h:42
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
edm::EDGetTokenT< edm::View< reco::Muon > > inputMuonToken_
Definition: MuonMET.h:39
MuonMETAlgo alg_
Definition: MuonMET.h:36
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:23
edm::InputTag metTypeInputTag_
Definition: MuonMET.h:37
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > inputValueMapMuonMetCorrToken_
Definition: MuonMET.h:40
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
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:41

Member Data Documentation

MuonMETAlgo cms::MuonMET::alg_
private

Definition at line 36 of file MuonMET.h.

Referenced by produce().

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

Definition at line 41 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 42 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 39 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 40 of file MuonMET.h.

Referenced by MuonMET(), and produce().

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

Definition at line 37 of file MuonMET.h.

Referenced by MuonMET(), and produce().