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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MuonTimingProducer (const edm::ParameterSet &)
 
 ~MuonTimingProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
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 beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag m_muonCollection
 
edm::EDGetTokenT
< reco::MuonCollection
muonToken_
 
MuonTimingFillertheTimingFiller_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

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

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

Definition at line 43 of file MuonTimingProducer.h.

Constructor & Destructor Documentation

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

Definition at line 43 of file MuonTimingProducer.cc.

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

44 {
45  produces<reco::MuonTimeExtraMap>("combined");
46  produces<reco::MuonTimeExtraMap>("dt");
47  produces<reco::MuonTimeExtraMap>("csc");
48 
49  m_muonCollection = iConfig.getParameter<edm::InputTag>("MuonCollection");
50  muonToken_ = consumes<reco::MuonCollection>(m_muonCollection);
51  // Load parameters for the TimingFiller
52  edm::ParameterSet fillerParameters = iConfig.getParameter<edm::ParameterSet>("TimingFillerParameters");
53  theTimingFiller_ = new MuonTimingFiller(fillerParameters,consumesCollector());
54 }
T getParameter(std::string const &) const
MuonTimingFiller * theTimingFiller_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::InputTag m_muonCollection
edm::EDGetTokenT< reco::MuonCollection > muonToken_
MuonTimingProducer::~MuonTimingProducer ( )

Definition at line 57 of file MuonTimingProducer.cc.

References theTimingFiller_.

58 {
60 }
MuonTimingFiller * theTimingFiller_

Member Function Documentation

void MuonTimingProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 69 of file MuonTimingProducer.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 75 of file MuonTimingProducer.cc.

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

Implements edm::EDProducer.

Definition at line 80 of file MuonTimingProducer.cc.

References edm::helper::Filler< Map >::fill(), MuonTimingFiller::fillTiming(), edm::Event::getByToken(), i, edm::helper::Filler< Map >::insert(), patZpeak::muons, muonToken_, edm::Event::put(), and theTimingFiller_.

80  {
81 
82  std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMap(new reco::MuonTimeExtraMap());
83  reco::MuonTimeExtraMap::Filler filler(*muonTimeMap);
84  std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMapDT(new reco::MuonTimeExtraMap());
85  reco::MuonTimeExtraMap::Filler fillerDT(*muonTimeMapDT);
86  std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMapCSC(new reco::MuonTimeExtraMap());
87  reco::MuonTimeExtraMap::Filler fillerCSC(*muonTimeMapCSC);
88 
90  iEvent.getByToken(muonToken_, muons);
91 
92  unsigned int nMuons = muons->size();
93 
94  std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
95  std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
96  std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
97 
98  for ( unsigned int i=0; i<nMuons; ++i ) {
99 
100  reco::MuonTimeExtra dtTime;
101  reco::MuonTimeExtra cscTime;
102  reco::MuonTimeExtra combinedTime;
103 
104  reco::MuonRef muonr(muons,i);
105 
106  theTimingFiller_->fillTiming(*muonr, dtTime, cscTime, combinedTime, iEvent, iSetup);
107 
108  dtTimeColl[i] = dtTime;
109  cscTimeColl[i] = cscTime;
110  combinedTimeColl[i] = combinedTime;
111 
112  }
113 
114  filler.insert(muons, combinedTimeColl.begin(), combinedTimeColl.end());
115  filler.fill();
116  fillerDT.insert(muons, dtTimeColl.begin(), dtTimeColl.end());
117  fillerDT.fill();
118  fillerCSC.insert(muons, cscTimeColl.begin(), cscTimeColl.end());
119  fillerCSC.fill();
120 
121  iEvent.put(muonTimeMap,"combined");
122  iEvent.put(muonTimeMapDT,"dt");
123  iEvent.put(muonTimeMapCSC,"csc");
124 
125 }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
MuonTimingFiller * theTimingFiller_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
edm::EDGetTokenT< reco::MuonCollection > muonToken_
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 54 of file MuonTimingProducer.h.

Referenced by MuonTimingProducer().

edm::EDGetTokenT<reco::MuonCollection> MuonTimingProducer::muonToken_
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().