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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 40 of file MuonTimingProducer.cc.

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

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

◆ ~MuonTimingProducer()

MuonTimingProducer::~MuonTimingProducer ( )
override

Definition at line 52 of file MuonTimingProducer.cc.

References theTimingFiller_.

52  {
53  if (theTimingFiller_)
54  delete theTimingFiller_;
55 }
MuonTimingFiller * theTimingFiller_

Member Function Documentation

◆ produce()

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

Definition at line 62 of file MuonTimingProducer.cc.

References trigObjTnPSource_cfi::filler, MuonTimingFiller::fillTiming(), mps_fire::i, iEvent, eostools::move(), PDWG_BPHSkim_cff::muons, muonToken_, custom_jme_cff::nMuons, and theTimingFiller_.

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

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().