CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  showerFiller_(iConfig.getParameter<edm::ParameterSet>("ShowerInformationFillerParameters"))
25  {
26  produces<edm::ValueMap<reco::MuonShower> >().setBranchAlias("muonShowerInformation");
27  }
29 
30 private:
31  virtual void produce(edm::Event&, const edm::EventSetup&);
35 };
36 
37 void
39 {
41  iEvent.getByLabel(inputMuonCollection_, muons);
42 
43  // reserve some space for output
44  std::vector<reco::MuonShower> showerInfoValues;
45  showerInfoValues.reserve(muons->size());
46 
47  for(reco::MuonCollection::const_iterator muon = muons->begin();
48  muon != muons->end(); ++muon)
49  {
50  // if (!muon->isGlobalMuon() && !muon->isStandAloneMuon()) continue;
51  showerInfoValues.push_back(showerFiller_.fillShowerInformation(*muon,iEvent,iSetup));
52  }
53 
54  // create and fill value map
55  std::auto_ptr<edm::ValueMap<reco::MuonShower> > outC(new edm::ValueMap<reco::MuonShower>());
57  fillerC.insert(muons, showerInfoValues.begin(), showerInfoValues.end());
58  fillerC.fill();
59 
60  // put value map into event
61  iEvent.put(outC);
62 }
reco::MuonShower fillShowerInformation(const reco::Muon &muon, const edm::Event &, const edm::EventSetup &)
fill muon shower variables
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void produce(edm::Event &, const edm::EventSetup &)
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:53
MuonShowerInformationProducer(const edm::ParameterSet &iConfig)
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
MuonShowerInformationFiller showerFiller_
tuple muons
Definition: patZpeak.py:38