CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MuonShowerInformationProducer Class Reference
Inheritance diagram for MuonShowerInformationProducer:
edm::stream::EDProducer<>

Public Member Functions

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

Private Member Functions

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

Private Attributes

edm::InputTag inputMuonCollection_
 
edm::InputTag inputTrackCollection_
 
edm::EDGetTokenT< reco::MuonCollectionmuonToken_
 
MuonShowerInformationFillershowerFiller_
 

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

Definition at line 19 of file MuonShowerInformationProducer.cc.

Constructor & Destructor Documentation

◆ MuonShowerInformationProducer()

MuonShowerInformationProducer::MuonShowerInformationProducer ( const edm::ParameterSet iConfig)
inline

Definition at line 21 of file MuonShowerInformationProducer.cc.

22  : inputMuonCollection_(iConfig.getParameter<edm::InputTag>("muonCollection")),
23  inputTrackCollection_(iConfig.getParameter<edm::InputTag>("trackCollection")) {
24  edm::ConsumesCollector iC = consumesCollector();
26  iConfig.getParameter<edm::ParameterSet>("ShowerInformationFillerParameters"), iC);
27 
28  muonToken_ = consumes<reco::MuonCollection>(inputMuonCollection_);
29 
30  produces<edm::ValueMap<reco::MuonShower>>().setBranchAlias("muonShowerInformation");
31  }

References edm::ParameterSet::getParameter(), inputMuonCollection_, muonToken_, and showerFiller_.

◆ ~MuonShowerInformationProducer()

MuonShowerInformationProducer::~MuonShowerInformationProducer ( )
inlineoverride

Definition at line 32 of file MuonShowerInformationProducer.cc.

32  {
33  if (showerFiller_)
34  delete showerFiller_;
35  }

References showerFiller_.

Member Function Documentation

◆ produce()

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

Definition at line 46 of file MuonShowerInformationProducer.cc.

46  {
48  iEvent.getByToken(muonToken_, muons);
49 
50  // reserve some space for output
51  std::vector<reco::MuonShower> showerInfoValues;
52  showerInfoValues.reserve(muons->size());
53 
54  for (reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
55  // if (!muon->isGlobalMuon() && !muon->isStandAloneMuon()) continue;
56  showerInfoValues.push_back(showerFiller_->fillShowerInformation(*muon, iEvent, iSetup));
57  }
58 
59  // create and fill value map
60  auto outC = std::make_unique<edm::ValueMap<reco::MuonShower>>();
62  fillerC.insert(muons, showerInfoValues.begin(), showerInfoValues.end());
63  fillerC.fill();
64 
65  // put value map into event
66  iEvent.put(std::move(outC));
67 }

References MuonShowerInformationFiller::fillShowerInformation(), iEvent, eostools::move(), HLT_FULL_cff::muon, PDWG_BPHSkim_cff::muons, muonToken_, and showerFiller_.

Member Data Documentation

◆ inputMuonCollection_

edm::InputTag MuonShowerInformationProducer::inputMuonCollection_
private

Definition at line 39 of file MuonShowerInformationProducer.cc.

Referenced by MuonShowerInformationProducer().

◆ inputTrackCollection_

edm::InputTag MuonShowerInformationProducer::inputTrackCollection_
private

Definition at line 40 of file MuonShowerInformationProducer.cc.

◆ muonToken_

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

Definition at line 41 of file MuonShowerInformationProducer.cc.

Referenced by MuonShowerInformationProducer(), and produce().

◆ showerFiller_

MuonShowerInformationFiller* MuonShowerInformationProducer::showerFiller_
private
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
MuonShowerInformationProducer::showerFiller_
MuonShowerInformationFiller * showerFiller_
Definition: MuonShowerInformationProducer.cc:43
muon
Definition: MuonCocktails.h:17
edm::Handle< reco::MuonCollection >
MuonShowerInformationFiller
Definition: MuonShowerInformationFiller.h:63
MuonShowerInformationProducer::muonToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Definition: MuonShowerInformationProducer.cc:41
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11773
edm::ParameterSet
Definition: ParameterSet.h:47
iEvent
int iEvent
Definition: GenABIO.cc:224
MuonShowerInformationProducer::inputTrackCollection_
edm::InputTag inputTrackCollection_
Definition: MuonShowerInformationProducer.cc:40
eostools.move
def move(src, dest)
Definition: eostools.py:511
MuonShowerInformationProducer::inputMuonCollection_
edm::InputTag inputMuonCollection_
Definition: MuonShowerInformationProducer.cc:39
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MuonShowerInformationFiller::fillShowerInformation
reco::MuonShower fillShowerInformation(const reco::Muon &muon, const edm::Event &, const edm::EventSetup &)
fill muon shower variables
Definition: MuonShowerInformationFiller.cc:109
edm::helper::Filler
Definition: ValueMap.h:22
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45