CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
MuPFIsoEmbedder Class Reference

#include <RecoMuon/MuPFIsoEmbedder/src/MuPFIsoEmbedder.cc>

Inheritance diagram for MuPFIsoEmbedder:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MuPFIsoEmbedder (const edm::ParameterSet &)
 
 ~MuPFIsoEmbedder () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

MuPFIsoHelperhelper_
 
edm::InputTag muons_
 
edm::EDGetTokenT< reco::MuonCollectionmuonToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 39 of file MuPFIsoEmbedder.cc.

Constructor & Destructor Documentation

◆ MuPFIsoEmbedder()

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

Definition at line 56 of file MuPFIsoEmbedder.cc.

57  : muons_(iConfig.getParameter<edm::InputTag>("src")) {
58  //decide what to read
59  //Define a map between the isolation and the PSet for the PFHelper
60  std::map<std::string, edm::ParameterSet> psetMap;
61 
62  //First declare what isolation you are going to read
63  std::vector<std::string> isolationLabels;
64  isolationLabels.push_back("pfIsolationR03");
65  isolationLabels.push_back("pfIsoMeanDRProfileR03");
66  isolationLabels.push_back("pfIsoSumDRProfileR03");
67  isolationLabels.push_back("pfIsolationR04");
68  isolationLabels.push_back("pfIsoMeanDRProfileR04");
69  isolationLabels.push_back("pfIsoSumDRProfileR04");
70 
71  //Fill the label,pet map and initialize MuPFIsoHelper
72  for (std::vector<std::string>::const_iterator label = isolationLabels.begin(); label != isolationLabels.end();
73  ++label)
74  psetMap[*label] = iConfig.getParameter<edm::ParameterSet>(*label);
75  helper_ = new MuPFIsoHelper(psetMap, consumesCollector());
76  muonToken_ = consumes<reco::MuonCollection>(muons_);
77  produces<reco::MuonCollection>();
78 }

References edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::getParameter(), helper_, label, muons_, and muonToken_.

◆ ~MuPFIsoEmbedder()

MuPFIsoEmbedder::~MuPFIsoEmbedder ( )
override

Definition at line 80 of file MuPFIsoEmbedder.cc.

80  {
81  // do anything here that needs to be done at desctruction time
82  // (e.g. close files, deallocate resources etc.)
83 }

Member Function Documentation

◆ fillDescriptions()

void MuPFIsoEmbedder::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 112 of file MuPFIsoEmbedder.cc.

112  {
113  //The following says we do not know what parameters are allowed so do no validation
114  // Please change this to state exactly what you do use, even if it is no parameters
116  desc.setUnknown();
117  descriptions.addDefault(desc);
118 }

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

◆ produce()

void MuPFIsoEmbedder::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 90 of file MuPFIsoEmbedder.cc.

90  {
91  using namespace edm;
92  using namespace reco;
93 
95 
97  iEvent.getByToken(muonToken_, muons);
98 
99  auto out = std::make_unique<MuonCollection>();
100 
101  for (unsigned int i = 0; i < muons->size(); ++i) {
102  MuonRef muonRef(muons, i);
103  Muon muon = muons->at(i);
104  helper_->embedPFIsolation(muon, muonRef);
105  out->push_back(muon);
106  }
107 
108  iEvent.put(std::move(out));
109 }

References MuPFIsoHelper::beginEvent(), MuPFIsoHelper::embedPFIsolation(), helper_, mps_fire::i, iEvent, eostools::move(), PDWG_BPHSkim_cff::muons, muonToken_, and MillePedeFileConverter_cfg::out.

Member Data Documentation

◆ helper_

MuPFIsoHelper* MuPFIsoEmbedder::helper_
private

Definition at line 52 of file MuPFIsoEmbedder.cc.

Referenced by MuPFIsoEmbedder(), and produce().

◆ muons_

edm::InputTag MuPFIsoEmbedder::muons_
private

Definition at line 50 of file MuPFIsoEmbedder.cc.

Referenced by MuPFIsoEmbedder().

◆ muonToken_

edm::EDGetTokenT<reco::MuonCollection> MuPFIsoEmbedder::muonToken_
private

Definition at line 51 of file MuPFIsoEmbedder.cc.

Referenced by MuPFIsoEmbedder(), and produce().

PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
MuPFIsoHelper
Definition: MuPFIsoHelper.h:25
mps_fire.i
i
Definition: mps_fire.py:428
muon
Definition: MuonCocktails.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
MuPFIsoEmbedder::helper_
MuPFIsoHelper * helper_
Definition: MuPFIsoEmbedder.cc:52
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:46
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle< reco::MuonCollection >
Muon
Definition: Muon.py:1
edm::Ref< MuonCollection >
MuPFIsoHelper::beginEvent
void beginEvent(const edm::Event &iEvent)
Definition: MuPFIsoHelper.cc:82
edm::ParameterSet
Definition: ParameterSet.h:47
iEvent
int iEvent
Definition: GenABIO.cc:224
MuPFIsoHelper::embedPFIsolation
int embedPFIsolation(reco::Muon &, reco::MuonRef &)
Definition: MuPFIsoHelper.cc:63
MuPFIsoEmbedder::muonToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Definition: MuPFIsoEmbedder.cc:51
MuPFIsoEmbedder::muons_
edm::InputTag muons_
Definition: MuPFIsoEmbedder.cc:50
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11