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

Public Member Functions

 MuonTimingProducer (const edm::ParameterSet &)
 
 ~MuonTimingProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 69 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_.

69  {
70 
71  std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMap(new reco::MuonTimeExtraMap());
72  reco::MuonTimeExtraMap::Filler filler(*muonTimeMap);
73  std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMapDT(new reco::MuonTimeExtraMap());
74  reco::MuonTimeExtraMap::Filler fillerDT(*muonTimeMapDT);
75  std::auto_ptr<reco::MuonTimeExtraMap> muonTimeMapCSC(new reco::MuonTimeExtraMap());
76  reco::MuonTimeExtraMap::Filler fillerCSC(*muonTimeMapCSC);
77 
79  iEvent.getByToken(muonToken_, muons);
80 
81  unsigned int nMuons = muons->size();
82 
83  std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
84  std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
85  std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
86 
87  for ( unsigned int i=0; i<nMuons; ++i ) {
88 
89  reco::MuonTimeExtra dtTime;
90  reco::MuonTimeExtra cscTime;
91  reco::MuonTime rpcTime;
92  reco::MuonTimeExtra combinedTime;
93 
94  reco::MuonRef muonr(muons,i);
95 
96  theTimingFiller_->fillTiming(*muonr, dtTime, cscTime, rpcTime, combinedTime, iEvent, iSetup);
97 
98  dtTimeColl[i] = dtTime;
99  cscTimeColl[i] = cscTime;
100  combinedTimeColl[i] = combinedTime;
101 
102  }
103 
104  filler.insert(muons, combinedTimeColl.begin(), combinedTimeColl.end());
105  filler.fill();
106  fillerDT.insert(muons, dtTimeColl.begin(), dtTimeColl.end());
107  fillerDT.fill();
108  fillerCSC.insert(muons, cscTimeColl.begin(), cscTimeColl.end());
109  fillerCSC.fill();
110 
111  iEvent.put(muonTimeMap,"combined");
112  iEvent.put(muonTimeMapDT,"dt");
113  iEvent.put(muonTimeMapCSC,"csc");
114 
115 }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
void fillTiming(const reco::Muon &muon, reco::MuonTimeExtra &dtTime, reco::MuonTimeExtra &cscTime, reco::MuonTime &rpcTime, reco::MuonTimeExtra &combinedTime, edm::Event &iEvent, const edm::EventSetup &iSetup)
MuonTimingFiller * theTimingFiller_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< reco::MuonCollection > muonToken_
tuple muons
Definition: patZpeak.py:38

Member Data Documentation

edm::InputTag MuonTimingProducer::m_muonCollection
private

Definition at line 52 of file MuonTimingProducer.h.

Referenced by MuonTimingProducer().

edm::EDGetTokenT<reco::MuonCollection> MuonTimingProducer::muonToken_
private

Definition at line 53 of file MuonTimingProducer.h.

Referenced by MuonTimingProducer(), and produce().

MuonTimingFiller* MuonTimingProducer::theTimingFiller_
private

Definition at line 55 of file MuonTimingProducer.h.

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