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::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 MuonShowerInformationProducer (const edm::ParameterSet &iConfig)
 
virtual ~MuonShowerInformationProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

Private Attributes

edm::InputTag inputMuonCollection_
 
edm::InputTag inputTrackCollection_
 
MuonShowerInformationFiller showerFiller_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.

21  :
22  inputMuonCollection_(iConfig.getParameter<edm::InputTag>("muonCollection")),
23  inputTrackCollection_(iConfig.getParameter<edm::InputTag>("trackCollection")),
24  showerFiller_(iConfig.getParameter<edm::ParameterSet>("ShowerInformationFillerParameters"))
25  {
26  produces<edm::ValueMap<reco::MuonShower> >().setBranchAlias("muonShowerInformation");
27  }
T getParameter(std::string const &) const
MuonShowerInformationFiller showerFiller_
virtual MuonShowerInformationProducer::~MuonShowerInformationProducer ( )
inlinevirtual

Definition at line 28 of file MuonShowerInformationProducer.cc.

28 {}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 38 of file MuonShowerInformationProducer.cc.

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

39 {
41  iEvent.getByLabel(inputMuonCollection_, muons);
42 
43  // reserve some space for output
44  std::vector<reco::MuonShower> showerInfoValues;
45  showerInfoValues.reserve(muons->size());
46 
47  for(reco::MuonCollection::const_iterator muon = muons->begin();
48  muon != muons->end(); ++muon)
49  {
50  // if (!muon->isGlobalMuon() && !muon->isStandAloneMuon()) continue;
51  showerInfoValues.push_back(showerFiller_.fillShowerInformation(*muon,iEvent,iSetup));
52  }
53 
54  // create and fill value map
55  std::auto_ptr<edm::ValueMap<reco::MuonShower> > outC(new edm::ValueMap<reco::MuonShower>());
57  fillerC.insert(muons, showerInfoValues.begin(), showerInfoValues.end());
58  fillerC.fill();
59 
60  // put value map into event
61  iEvent.put(outC);
62 }
reco::MuonShower fillShowerInformation(const reco::Muon &muon, const edm::Event &, const edm::EventSetup &)
fill muon shower variables
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
MuonShowerInformationFiller showerFiller_
tuple muons
Definition: patZpeak.py:38

Member Data Documentation

edm::InputTag MuonShowerInformationProducer::inputMuonCollection_
private

Definition at line 32 of file MuonShowerInformationProducer.cc.

Referenced by produce().

edm::InputTag MuonShowerInformationProducer::inputTrackCollection_
private

Definition at line 33 of file MuonShowerInformationProducer.cc.

MuonShowerInformationFiller MuonShowerInformationProducer::showerFiller_
private

Definition at line 34 of file MuonShowerInformationProducer.cc.

Referenced by produce().