CMS 3D CMS Logo

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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(), metTypeInputTag_, TCMET_cfi::muonDepValueMap, caloMetM_cfi::muonsInputTag, and caloMetM_cfi::uncorMETInputTag.

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
muonDepValueMap
Definition: TCMET_cfi.py:14
std::string const & label() const
Definition: InputTag.h:36
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.

References produce().

32 { }

Member Function Documentation

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

Definition at line 44 of file MuonMET.cc.

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

Referenced by ~MuonMET().

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  auto output = std::make_unique<reco::CaloMETCollection>();
58  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()), *(inputUncorMet.product()), &*output);
59  iEvent.put(std::move(output));
60  }
61  else
62  {
63  edm::Handle<edm::View<reco::MET> > inputUncorMet;
64  iEvent.getByToken(inputMETToken_, inputUncorMet);
65  auto output = std::make_unique<reco::METCollection>();
66  alg_.run(*(inputMuons.product()), *(vm_muCorrData_h.product()),*(inputUncorMet.product()), &*output);
67  iEvent.put(std::move(output));
68  }
69  }
edm::EDGetTokenT< edm::View< reco::MET > > inputMETToken_
Definition: MuonMET.h:42
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
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
T const * product() const
Definition: Handle.h:81
std::string const & label() const
Definition: InputTag.h:36
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
def move(src, dest)
Definition: eostools.py:510

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().