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
MuonTimingProducer Class Reference

#include <RecoMuon/MuonIdentification/interface/MuonTimingProducer.h>

Inheritance diagram for MuonTimingProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 MuonTimingProducer (const edm::ParameterSet &)
 
 ~MuonTimingProducer ()
 
- 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 beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag m_muonCollection
 
MuonTimingFillertheTimingFiller_
 

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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 44 of file MuonTimingProducer.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file MuonTimingProducer.cc.

References edm::ParameterSet::getParameter(), m_muonCollection, and theTimingFiller_.

45 {
46  produces<reco::MuonTimeExtraMap>("combined");
47  produces<reco::MuonTimeExtraMap>("dt");
48  produces<reco::MuonTimeExtraMap>("csc");
49 
50  m_muonCollection = iConfig.getParameter<edm::InputTag>("MuonCollection");
51 
52  // Load parameters for the TimingFiller
53  edm::ParameterSet fillerParameters = iConfig.getParameter<edm::ParameterSet>("TimingFillerParameters");
54  theTimingFiller_ = new MuonTimingFiller(fillerParameters);
55 }
T getParameter(std::string const &) const
MuonTimingFiller * theTimingFiller_
edm::InputTag m_muonCollection
MuonTimingProducer::~MuonTimingProducer ( )

Definition at line 58 of file MuonTimingProducer.cc.

References theTimingFiller_.

59 {
61 }
MuonTimingFiller * theTimingFiller_

Member Function Documentation

void MuonTimingProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 70 of file MuonTimingProducer.cc.

71 {
72 }
void MuonTimingProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 76 of file MuonTimingProducer.cc.

76  {
77 }
void MuonTimingProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

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

81  {
82 
83  std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMap(new reco::MuonTimeExtraMap());
84  reco::MuonTimeExtraMap::Filler filler(*muonTimeMap);
85  std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMapDT(new reco::MuonTimeExtraMap());
86  reco::MuonTimeExtraMap::Filler fillerDT(*muonTimeMapDT);
87  std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMapCSC(new reco::MuonTimeExtraMap());
88  reco::MuonTimeExtraMap::Filler fillerCSC(*muonTimeMapCSC);
89 
91  iEvent.getByLabel(m_muonCollection, muons);
92 
93  unsigned int nMuons = muons->size();
94 
95  std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
96  std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
97  std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
98 
99  for ( unsigned int i=0; i<nMuons; ++i ) {
100 
101  reco::MuonTimeExtra dtTime;
102  reco::MuonTimeExtra cscTime;
103  reco::MuonTimeExtra combinedTime;
104 
105  reco::MuonRef muonr(muons,i);
106 
107  theTimingFiller_->fillTiming(*muonr, dtTime, cscTime, combinedTime, iEvent, iSetup);
108 
109  dtTimeColl[i] = dtTime;
110  cscTimeColl[i] = cscTime;
111  combinedTimeColl[i] = combinedTime;
112 
113  }
114 
115  filler.insert(muons, combinedTimeColl.begin(), combinedTimeColl.end());
116  filler.fill();
117  fillerDT.insert(muons, dtTimeColl.begin(), dtTimeColl.end());
118  fillerDT.fill();
119  fillerCSC.insert(muons, cscTimeColl.begin(), cscTimeColl.end());
120  fillerCSC.fill();
121 
122  iEvent.put(muonTimeMap,"combined");
123  iEvent.put(muonTimeMapDT,"dt");
124  iEvent.put(muonTimeMapCSC,"csc");
125 
126 }
int i
Definition: DBlmapReader.cc:9
MuonTimingFiller * theTimingFiller_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
edm::InputTag m_muonCollection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple muons
Definition: patZpeak.py:38
void fillTiming(const reco::Muon &muon, reco::MuonTimeExtra &dtTime, reco::MuonTimeExtra &cscTime, reco::MuonTimeExtra &combinedTime, edm::Event &iEvent, const edm::EventSetup &iSetup)

Member Data Documentation

edm::InputTag MuonTimingProducer::m_muonCollection
private

Definition at line 55 of file MuonTimingProducer.h.

Referenced by MuonTimingProducer(), and produce().

MuonTimingFiller* MuonTimingProducer::theTimingFiller_
private

Definition at line 57 of file MuonTimingProducer.h.

Referenced by MuonTimingProducer(), produce(), and ~MuonTimingProducer().