#include <RecoMuon/MuonIdentification/interface/MuonTimingProducer.h>
Public Member Functions | |
MuonTimingProducer (const edm::ParameterSet &) | |
~MuonTimingProducer () | |
Private Member Functions | |
virtual void | beginJob () |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
edm::InputTag | m_muonCollection |
MuonTimingFiller * | theTimingFiller_ |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 44 of file MuonTimingProducer.h.
MuonTimingProducer::MuonTimingProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 44 of file MuonTimingProducer.cc.
References edm::ParameterSet::getParameter(), m_muonCollection, and theTimingFiller_.
{ produces<reco::MuonTimeExtraMap>("combined"); produces<reco::MuonTimeExtraMap>("dt"); produces<reco::MuonTimeExtraMap>("csc"); m_muonCollection = iConfig.getParameter<edm::InputTag>("MuonCollection"); // Load parameters for the TimingFiller edm::ParameterSet fillerParameters = iConfig.getParameter<edm::ParameterSet>("TimingFillerParameters"); theTimingFiller_ = new MuonTimingFiller(fillerParameters); }
MuonTimingProducer::~MuonTimingProducer | ( | ) |
Definition at line 58 of file MuonTimingProducer.cc.
References theTimingFiller_.
{ if (theTimingFiller_) delete theTimingFiller_; }
void MuonTimingProducer::beginJob | ( | void | ) | [private, virtual] |
void MuonTimingProducer::endJob | ( | void | ) | [private, virtual] |
void MuonTimingProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 81 of file MuonTimingProducer.cc.
References edm::helper::Filler< Map >::fill(), MuonTimingFiller::fillTiming(), edm::Event::getByLabel(), i, edm::helper::Filler< Map >::insert(), m_muonCollection, patZpeak::muons, edm::Event::put(), and theTimingFiller_.
{ std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMap(new reco::MuonTimeExtraMap()); reco::MuonTimeExtraMap::Filler filler(*muonTimeMap); std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMapDT(new reco::MuonTimeExtraMap()); reco::MuonTimeExtraMap::Filler fillerDT(*muonTimeMapDT); std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMapCSC(new reco::MuonTimeExtraMap()); reco::MuonTimeExtraMap::Filler fillerCSC(*muonTimeMapCSC); edm::Handle<reco::MuonCollection> muons; iEvent.getByLabel(m_muonCollection, muons); unsigned int nMuons = muons->size(); std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons); std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons); std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons); for ( unsigned int i=0; i<nMuons; ++i ) { reco::MuonTimeExtra dtTime; reco::MuonTimeExtra cscTime; reco::MuonTimeExtra combinedTime; reco::MuonRef muonr(muons,i); theTimingFiller_->fillTiming(*muonr, dtTime, cscTime, combinedTime, iEvent, iSetup); dtTimeColl[i] = dtTime; cscTimeColl[i] = cscTime; combinedTimeColl[i] = combinedTime; } filler.insert(muons, combinedTimeColl.begin(), combinedTimeColl.end()); filler.fill(); fillerDT.insert(muons, dtTimeColl.begin(), dtTimeColl.end()); fillerDT.fill(); fillerCSC.insert(muons, cscTimeColl.begin(), cscTimeColl.end()); fillerCSC.fill(); iEvent.put(muonTimeMap,"combined"); iEvent.put(muonTimeMapDT,"dt"); iEvent.put(muonTimeMapCSC,"csc"); }
Definition at line 55 of file MuonTimingProducer.h.
Referenced by MuonTimingProducer(), and produce().
Definition at line 57 of file MuonTimingProducer.h.
Referenced by MuonTimingProducer(), produce(), and ~MuonTimingProducer().