CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

MuonShowerInformationProducer Class Reference

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

List of all members.

Public Member Functions

 MuonShowerInformationProducer (const edm::ParameterSet &iConfig)
virtual ~MuonShowerInformationProducer ()

Private Member Functions

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

Private Attributes

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

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.

                                                                :
    inputMuonCollection_(iConfig.getParameter<edm::InputTag>("muonCollection")),
    inputTrackCollection_(iConfig.getParameter<edm::InputTag>("trackCollection")),
    showerFiller_(iConfig.getParameter<edm::ParameterSet>("ShowerInformationFillerParameters"))
  {
    produces<edm::ValueMap<reco::MuonShower> >().setBranchAlias("muonShowerInformation");
  }
virtual MuonShowerInformationProducer::~MuonShowerInformationProducer ( ) [inline, virtual]

Definition at line 28 of file MuonShowerInformationProducer.cc.

{}

Member Function Documentation

void MuonShowerInformationProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

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_.

{
  edm::Handle<reco::MuonCollection> muons;
  iEvent.getByLabel(inputMuonCollection_, muons);

  // reserve some space for output
  std::vector<reco::MuonShower> showerInfoValues;
  showerInfoValues.reserve(muons->size());
  
  for(reco::MuonCollection::const_iterator muon = muons->begin(); 
      muon != muons->end(); ++muon)
    {
     // if (!muon->isGlobalMuon() && !muon->isStandAloneMuon()) continue;
      showerInfoValues.push_back(showerFiller_.fillShowerInformation(*muon,iEvent,iSetup));
    }

  // create and fill value map
  std::auto_ptr<edm::ValueMap<reco::MuonShower> > outC(new edm::ValueMap<reco::MuonShower>());
  edm::ValueMap<reco::MuonShower>::Filler fillerC(*outC);
  fillerC.insert(muons, showerInfoValues.begin(), showerInfoValues.end());
  fillerC.fill();

  // put value map into event
  iEvent.put(outC);
}

Member Data Documentation

Definition at line 32 of file MuonShowerInformationProducer.cc.

Referenced by produce().

Definition at line 33 of file MuonShowerInformationProducer.cc.

Definition at line 34 of file MuonShowerInformationProducer.cc.

Referenced by produce().