CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonLinksProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: MuonIdentification
4 // Class: MuonLinksProducer
5 //
6 //
7 // Original Author: Dmytro Kovalskyi
8 // $Id: MuonLinksProducer.cc,v 1.1.2.1 2008/08/07 00:59:31 dmytro Exp $
9 //
10 //
11 
12 
13 // system include files
14 #include <memory>
15 
16 // user include files
19 
22 
24 
31 
32 #include <algorithm>
33 
35 {
36  produces<reco::MuonTrackLinksCollection>();
37  m_inputCollection = iConfig.getParameter<edm::InputTag>("inputCollection");
38 }
39 
41 {
42 }
43 
45 {
46  std::auto_ptr<reco::MuonTrackLinksCollection> output(new reco::MuonTrackLinksCollection());
48  iEvent.getByLabel(m_inputCollection, muons);
49 
50  for ( reco::MuonCollection::const_iterator muon = muons->begin();
51  muon != muons->end(); ++muon )
52  {
53  if ( ! muon->isGlobalMuon() ) continue;
54  output->push_back( reco::MuonTrackLinks( muon->track(), muon->standAloneMuon(), muon->combinedMuon() ) );
55  }
56  iEvent.put( output );
57 }
T getParameter(std::string const &) const
virtual void produce(edm::Event &, const edm::EventSetup &)
std::vector< MuonTrackLinks > MuonTrackLinksCollection
collection of MuonTrackLinks
Definition: MuonFwd.h:22
virtual ~MuonLinksProducer()
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
tuple muons
Definition: patZpeak.py:38
edm::InputTag m_inputCollection
MuonLinksProducer(const edm::ParameterSet &)