CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonRefProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: MuonIdentification
4 // Class: MuonRefProducer
5 //
6 //
7 // Original Author: Dmytro Kovalskyi
8 // $Id: MuonRefProducer.cc,v 1.5 2010/03/25 14:08:49 jribnik Exp $
9 //
10 //
11 
12 // user include files
15 
18 
20 
24 
30 
32 {
33  theReferenceCollection_ = iConfig.getParameter<edm::InputTag>("ReferenceCollection");
34  type_ = muon::TMLastStation; // default type
35  std::string type = iConfig.getParameter<std::string>("algorithmType");
36  if ( type.compare("TMLastStation") != 0 )
37  edm::LogWarning("MuonIdentification") << "Unknown algorithm type is requested: " << type << "\nUsing the default one.";
38 
39  minNumberOfMatches_ = iConfig.getParameter<int>("minNumberOfMatchedStations");
40  maxAbsDx_ = iConfig.getParameter<double>("maxAbsDx");
41  maxAbsPullX_ = iConfig.getParameter<double>("maxAbsPullX");
42  maxAbsDy_ = iConfig.getParameter<double>("maxAbsDy");
43  maxAbsPullY_ = iConfig.getParameter<double>("maxAbsPullY");
44  maxChamberDist_ = iConfig.getParameter<double>("maxChamberDistance");
45  maxChamberDistPull_ = iConfig.getParameter<double>("maxChamberDistancePull");
46 
47  std::string arbitrationType = iConfig.getParameter<std::string>("arbitrationType");
48  if (arbitrationType.compare("NoArbitration")==0)
50  else if (arbitrationType.compare("SegmentArbitration")==0)
52  else if (arbitrationType.compare("SegmentAndTrackArbitration")==0)
54  else {
55  edm::LogWarning("MuonIdentification") << "Unknown arbitration type is requested: " << arbitrationType << "\nUsing the default one";
57  }
58  produces<edm::RefVector<std::vector<reco::Muon> > >();
59 }
60 
61 
63 
65 {
66  std::auto_ptr<edm::RefVector<std::vector<reco::Muon> > > outputCollection(new edm::RefVector<std::vector<reco::Muon> >);
67 
69  iEvent.getByLabel(theReferenceCollection_, muons);
70 
71  // loop over input collection
72  for ( unsigned int i=0; i<muons->size(); ++i )
73  if ( muon::isGoodMuon( (*muons)[i], type_, minNumberOfMatches_,
75  outputCollection->push_back( edm::RefVector<std::vector<reco::Muon> >::value_type(muons,i) );
76  iEvent.put(outputCollection);
77 }
reco::Muon::ArbitrationType arbitrationType_
type
Definition: HCALResponse.h:22
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
virtual ~MuonRefProducer()
edm::InputTag theReferenceCollection_
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
muon::AlgorithmType type_
Container::value_type value_type
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
MuonRefProducer(const edm::ParameterSet &)
virtual void produce(edm::Event &, const edm::EventSetup &)
tuple muons
Definition: patZpeak.py:38
double maxChamberDistPull_