CMS 3D CMS Logo

MuonShowerInformationProducer.cc
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
3 
9 
16 
18 
20 public:
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  }
33  if (showerFiller_)
34  delete showerFiller_;
35  }
36 
37 private:
38  void produce(edm::Event&, const edm::EventSetup&) override;
42 
44 };
45 
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 }
MuonShowerInformationFiller.h
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
MuonShowerInformationProducer::MuonShowerInformationProducer
MuonShowerInformationProducer(const edm::ParameterSet &iConfig)
Definition: MuonShowerInformationProducer.cc:21
MuonShowerInformationProducer::showerFiller_
MuonShowerInformationFiller * showerFiller_
Definition: MuonShowerInformationProducer.cc:43
Muon.h
muon
Definition: MuonCocktails.h:17
edm::EDGetTokenT< reco::MuonCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
EDProducer.h
MuonShowerInformationProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: MuonShowerInformationProducer.cc:46
edm::Handle< reco::MuonCollection >
MuonShowerInformationFiller
Definition: MuonShowerInformationFiller.h:63
MakerMacros.h
Track.h
MuonShowerInformationProducer::muonToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Definition: MuonShowerInformationProducer.cc:41
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MuonShowerInformationProducer
Definition: MuonShowerInformationProducer.cc:19
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11773
MuonFwd.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
MuonShowerInformationProducer::~MuonShowerInformationProducer
~MuonShowerInformationProducer() override
Definition: MuonShowerInformationProducer.cc:32
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
MuonShowerInformationProducer::inputTrackCollection_
edm::InputTag inputTrackCollection_
Definition: MuonShowerInformationProducer.cc:40
ValueMap.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
Frameworkfwd.h
MuonShowerInformationProducer::inputMuonCollection_
edm::InputTag inputMuonCollection_
Definition: MuonShowerInformationProducer.cc:39
EventSetup.h
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
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45