CMS 3D CMS Logo

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

Public Member Functions

 MuonTimingProducer (const edm::ParameterSet &)
 
 ~MuonTimingProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

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

Private Attributes

edm::InputTag m_muonCollection
 
edm::EDGetTokenT< reco::MuonCollectionmuonToken_
 
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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

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

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

Definition at line 41 of file MuonTimingProducer.h.

Constructor & Destructor Documentation

◆ MuonTimingProducer()

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

Definition at line 41 of file MuonTimingProducer.cc.

41  {
42  produces<reco::MuonTimeExtraMap>("combined");
43  produces<reco::MuonTimeExtraMap>("dt");
44  produces<reco::MuonTimeExtraMap>("csc");
45 
46  m_muonCollection = iConfig.getParameter<edm::InputTag>("MuonCollection");
47  muonToken_ = consumes<reco::MuonCollection>(m_muonCollection);
48  // Load parameters for the TimingFiller
49  edm::ParameterSet fillerParameters = iConfig.getParameter<edm::ParameterSet>("TimingFillerParameters");
50  theTimingFiller_ = new MuonTimingFiller(fillerParameters, consumesCollector());
51 }

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

◆ ~MuonTimingProducer()

MuonTimingProducer::~MuonTimingProducer ( )
override

Definition at line 53 of file MuonTimingProducer.cc.

53  {
54  if (theTimingFiller_)
55  delete theTimingFiller_;
56 }

References theTimingFiller_.

Member Function Documentation

◆ produce()

void MuonTimingProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 63 of file MuonTimingProducer.cc.

63  {
64  auto muonTimeMap = std::make_unique<reco::MuonTimeExtraMap>();
66  auto muonTimeMapDT = std::make_unique<reco::MuonTimeExtraMap>();
67  reco::MuonTimeExtraMap::Filler fillerDT(*muonTimeMapDT);
68  auto muonTimeMapCSC = std::make_unique<reco::MuonTimeExtraMap>();
69  reco::MuonTimeExtraMap::Filler fillerCSC(*muonTimeMapCSC);
70 
72  iEvent.getByToken(muonToken_, muons);
73 
74  unsigned int nMuons = muons->size();
75 
76  std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
77  std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
78  std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
79 
80  for (unsigned int i = 0; i < nMuons; ++i) {
81  reco::MuonTimeExtra dtTime;
82  reco::MuonTimeExtra cscTime;
83  reco::MuonTime rpcTime;
84  reco::MuonTimeExtra combinedTime;
85 
86  reco::MuonRef muonr(muons, i);
87 
88  theTimingFiller_->fillTiming(*muonr, dtTime, cscTime, rpcTime, combinedTime, iEvent, iSetup);
89 
90  dtTimeColl[i] = dtTime;
91  cscTimeColl[i] = cscTime;
92  combinedTimeColl[i] = combinedTime;
93  }
94 
95  filler.insert(muons, combinedTimeColl.begin(), combinedTimeColl.end());
96  filler.fill();
97  fillerDT.insert(muons, dtTimeColl.begin(), dtTimeColl.end());
98  fillerDT.fill();
99  fillerCSC.insert(muons, cscTimeColl.begin(), cscTimeColl.end());
100  fillerCSC.fill();
101 
102  iEvent.put(std::move(muonTimeMap), "combined");
103  iEvent.put(std::move(muonTimeMapDT), "dt");
104  iEvent.put(std::move(muonTimeMapCSC), "csc");
105 }

References edm::helper::Filler< Map >::fill(), trigObjTnPSource_cfi::filler, MuonTimingFiller::fillTiming(), mps_fire::i, iEvent, edm::helper::Filler< Map >::insert(), eostools::move(), PDWG_BPHSkim_cff::muons, muonToken_, jets_cff::nMuons, and theTimingFiller_.

Member Data Documentation

◆ m_muonCollection

edm::InputTag MuonTimingProducer::m_muonCollection
private

Definition at line 50 of file MuonTimingProducer.h.

Referenced by MuonTimingProducer().

◆ muonToken_

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

Definition at line 51 of file MuonTimingProducer.h.

Referenced by MuonTimingProducer(), and produce().

◆ theTimingFiller_

MuonTimingFiller* MuonTimingProducer::theTimingFiller_
private

Definition at line 53 of file MuonTimingProducer.h.

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

PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
mps_fire.i
i
Definition: mps_fire.py:355
MuonTimingProducer::theTimingFiller_
MuonTimingFiller * theTimingFiller_
Definition: MuonTimingProducer.h:53
MuonTimingProducer::muonToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Definition: MuonTimingProducer.h:51
MuonTimingFiller::fillTiming
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)
Definition: MuonTimingFiller.cc:76
edm::Handle< reco::MuonCollection >
edm::Ref< MuonCollection >
reco::MuonTime
Definition: MuonTime.h:5
reco::MuonTimeExtra
Definition: MuonTimeExtra.h:15
jets_cff.nMuons
nMuons
Definition: jets_cff.py:209
edm::ParameterSet
Definition: ParameterSet.h:36
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
MuonTimingFiller
Definition: MuonTimingFiller.h:42
edm::helper::Filler
Definition: ValueMap.h:22
edm::InputTag
Definition: InputTag.h:15
MuonTimingProducer::m_muonCollection
edm::InputTag m_muonCollection
Definition: MuonTimingProducer.h:50