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 Member Functions | Private Attributes
MuonShowerInformationProducer Class Reference
Inheritance diagram for MuonShowerInformationProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MuonShowerInformationProducer (const edm::ParameterSet &iConfig)
 
virtual ~MuonShowerInformationProducer ()
 
- 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)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

edm::InputTag inputMuonCollection_
 
edm::InputTag inputTrackCollection_
 
edm::EDGetTokenT
< reco::MuonCollection
muonToken_
 
MuonShowerInformationFillershowerFiller_
 

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
 
- 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 19 of file MuonShowerInformationProducer.cc.

Constructor & Destructor Documentation

MuonShowerInformationProducer::MuonShowerInformationProducer ( const edm::ParameterSet iConfig)
inline

Definition at line 21 of file MuonShowerInformationProducer.cc.

References edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::getParameter(), inputMuonCollection_, muonToken_, and showerFiller_.

21  :
22  inputMuonCollection_(iConfig.getParameter<edm::InputTag>("muonCollection")),
23  inputTrackCollection_(iConfig.getParameter<edm::InputTag>("trackCollection"))
24  {
26  showerFiller_ = new MuonShowerInformationFiller(iConfig.getParameter<edm::ParameterSet>("ShowerInformationFillerParameters"),iC);
27 
28  muonToken_ = consumes<reco::MuonCollection>(inputMuonCollection_);
29 
30  produces<edm::ValueMap<reco::MuonShower> >().setBranchAlias("muonShowerInformation");
31  }
T getParameter(std::string const &) const
MuonShowerInformationFiller * showerFiller_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< reco::MuonCollection > muonToken_
virtual MuonShowerInformationProducer::~MuonShowerInformationProducer ( )
inlinevirtual

Definition at line 32 of file MuonShowerInformationProducer.cc.

References showerFiller_.

32  {
33  if( showerFiller_)
34  delete showerFiller_;
35  }
MuonShowerInformationFiller * showerFiller_

Member Function Documentation

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

Implements edm::stream::EDProducerBase.

Definition at line 49 of file MuonShowerInformationProducer.cc.

References edm::helper::Filler< Map >::fill(), MuonShowerInformationFiller::fillShowerInformation(), edm::Event::getByToken(), edm::helper::Filler< Map >::insert(), metsig::muon, patZpeak::muons, muonToken_, edm::Event::put(), and showerFiller_.

50 {
52  iEvent.getByToken(muonToken_, muons);
53 
54  // reserve some space for output
55  std::vector<reco::MuonShower> showerInfoValues;
56  showerInfoValues.reserve(muons->size());
57 
58  for(reco::MuonCollection::const_iterator muon = muons->begin();
59  muon != muons->end(); ++muon)
60  {
61  // if (!muon->isGlobalMuon() && !muon->isStandAloneMuon()) continue;
62  showerInfoValues.push_back(showerFiller_->fillShowerInformation(*muon,iEvent,iSetup));
63  }
64 
65  // create and fill value map
66  std::auto_ptr<edm::ValueMap<reco::MuonShower> > outC(new edm::ValueMap<reco::MuonShower>());
68  fillerC.insert(muons, showerInfoValues.begin(), showerInfoValues.end());
69  fillerC.fill();
70 
71  // put value map into event
72  iEvent.put(outC);
73 }
reco::MuonShower fillShowerInformation(const reco::Muon &muon, const edm::Event &, const edm::EventSetup &)
fill muon shower variables
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
MuonShowerInformationFiller * showerFiller_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
edm::EDGetTokenT< reco::MuonCollection > muonToken_
tuple muons
Definition: patZpeak.py:38

Member Data Documentation

edm::InputTag MuonShowerInformationProducer::inputMuonCollection_
private

Definition at line 39 of file MuonShowerInformationProducer.cc.

Referenced by MuonShowerInformationProducer().

edm::InputTag MuonShowerInformationProducer::inputTrackCollection_
private

Definition at line 40 of file MuonShowerInformationProducer.cc.

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

Definition at line 41 of file MuonShowerInformationProducer.cc.

Referenced by MuonShowerInformationProducer(), and produce().

MuonShowerInformationFiller* MuonShowerInformationProducer::showerFiller_
private