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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 ( const edm::ParameterSet iConfig)
inline

Definition at line 21 of file MuonShowerInformationProducer.cc.

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

21  :
22  inputMuonCollection_(iConfig.getParameter<edm::InputTag>("muonCollection")),
23  inputTrackCollection_(iConfig.getParameter<edm::InputTag>("trackCollection"))
24  {
25  edm::ConsumesCollector iC = consumesCollector();
26  showerFiller_ = new MuonShowerInformationFiller(iConfig.getParameter<edm::ParameterSet>("ShowerInformationFillerParameters"),iC);
27 
28  muonToken_ = consumes<reco::MuonCollection>(inputMuonCollection_);
29 
30  produces<edm::ValueMap<reco::MuonShower> >().setBranchAlias("muonShowerInformation");
31  }
T getParameter(std::string const &) const
MuonShowerInformationFiller * showerFiller_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
MuonShowerInformationProducer::~MuonShowerInformationProducer ( )
inlineoverride

Definition at line 32 of file MuonShowerInformationProducer.cc.

References produce(), and showerFiller_.

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

Member Function Documentation

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

Definition at line 49 of file MuonShowerInformationProducer.cc.

References DEFINE_FWK_MODULE, MuonShowerInformationFiller::fillShowerInformation(), edm::Event::getByToken(), eostools::move(), metsig::muon, extraflags_cff::muons, muonToken_, edm::Event::put(), and showerFiller_.

Referenced by ~MuonShowerInformationProducer().

50 {
52  iEvent.getByToken(muonToken_, muons);
53 
54  // reserve some space for output
55  std::vector<reco::MuonShower> showerInfoValues;
56  showerInfoValues.reserve(muons->size());
57 
58  for(reco::MuonCollection::const_iterator muon = muons->begin();
59  muon != muons->end(); ++muon)
60  {
61  // if (!muon->isGlobalMuon() && !muon->isStandAloneMuon()) continue;
62  showerInfoValues.push_back(showerFiller_->fillShowerInformation(*muon,iEvent,iSetup));
63  }
64 
65  // create and fill value map
66  auto outC = std::make_unique<edm::ValueMap<reco::MuonShower>>();
68  fillerC.insert(muons, showerInfoValues.begin(), showerInfoValues.end());
69  fillerC.fill();
70 
71  // put value map into event
72  iEvent.put(std::move(outC));
73 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
reco::MuonShower fillShowerInformation(const reco::Muon &muon, const edm::Event &, const edm::EventSetup &)
fill muon shower variables
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
MuonShowerInformationFiller * showerFiller_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

edm::InputTag MuonShowerInformationProducer::inputMuonCollection_
private

Definition at line 39 of file MuonShowerInformationProducer.cc.

Referenced by MuonShowerInformationProducer().

edm::InputTag MuonShowerInformationProducer::inputTrackCollection_
private

Definition at line 40 of file MuonShowerInformationProducer.cc.

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

Definition at line 41 of file MuonShowerInformationProducer.cc.

Referenced by MuonShowerInformationProducer(), and produce().

MuonShowerInformationFiller* MuonShowerInformationProducer::showerFiller_
private