#include <MuonRefProducer.h>
Public Member Functions | |
MuonRefProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
virtual | ~MuonRefProducer () |
Private Attributes | |
reco::Muon::ArbitrationType | arbitrationType_ |
double | maxAbsDx_ |
double | maxAbsDy_ |
double | maxAbsPullX_ |
double | maxAbsPullY_ |
double | maxChamberDist_ |
double | maxChamberDistPull_ |
int | minNumberOfMatches_ |
edm::InputTag | theReferenceCollection_ |
muon::AlgorithmType | type_ |
Definition at line 27 of file MuonRefProducer.h.
MuonRefProducer::MuonRefProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 31 of file MuonRefProducer.cc.
References arbitrationType_, edm::ParameterSet::getParameter(), maxAbsDx_, maxAbsDy_, maxAbsPullX_, maxAbsPullY_, maxChamberDist_, maxChamberDistPull_, minNumberOfMatches_, reco::Muon::NoArbitration, reco::Muon::SegmentAndTrackArbitration, reco::Muon::SegmentArbitration, AlCaHLTBitMon_QueryRunRegistry::string, theReferenceCollection_, muon::TMLastStation, and type_.
{ theReferenceCollection_ = iConfig.getParameter<edm::InputTag>("ReferenceCollection"); type_ = muon::TMLastStation; // default type std::string type = iConfig.getParameter<std::string>("algorithmType"); if ( type.compare("TMLastStation") != 0 ) edm::LogWarning("MuonIdentification") << "Unknown algorithm type is requested: " << type << "\nUsing the default one."; minNumberOfMatches_ = iConfig.getParameter<int>("minNumberOfMatchedStations"); maxAbsDx_ = iConfig.getParameter<double>("maxAbsDx"); maxAbsPullX_ = iConfig.getParameter<double>("maxAbsPullX"); maxAbsDy_ = iConfig.getParameter<double>("maxAbsDy"); maxAbsPullY_ = iConfig.getParameter<double>("maxAbsPullY"); maxChamberDist_ = iConfig.getParameter<double>("maxChamberDistance"); maxChamberDistPull_ = iConfig.getParameter<double>("maxChamberDistancePull"); std::string arbitrationType = iConfig.getParameter<std::string>("arbitrationType"); if (arbitrationType.compare("NoArbitration")==0) arbitrationType_ = reco::Muon::NoArbitration; else if (arbitrationType.compare("SegmentArbitration")==0) arbitrationType_ = reco::Muon::SegmentArbitration; else if (arbitrationType.compare("SegmentAndTrackArbitration")==0) arbitrationType_ = reco::Muon::SegmentAndTrackArbitration; else { edm::LogWarning("MuonIdentification") << "Unknown arbitration type is requested: " << arbitrationType << "\nUsing the default one"; arbitrationType_ = reco::Muon::SegmentAndTrackArbitration; } produces<edm::RefVector<std::vector<reco::Muon> > >(); }
MuonRefProducer::~MuonRefProducer | ( | ) | [virtual] |
Definition at line 62 of file MuonRefProducer.cc.
{}
void MuonRefProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 64 of file MuonRefProducer.cc.
References arbitrationType_, edm::Event::getByLabel(), i, muon::isGoodMuon(), maxAbsDx_, maxAbsDy_, maxAbsPullX_, maxAbsPullY_, maxChamberDist_, maxChamberDistPull_, minNumberOfMatches_, patZpeak::muons, edm::Event::put(), theReferenceCollection_, and type_.
{ std::auto_ptr<edm::RefVector<std::vector<reco::Muon> > > outputCollection(new edm::RefVector<std::vector<reco::Muon> >); edm::Handle<reco::MuonCollection> muons; iEvent.getByLabel(theReferenceCollection_, muons); // loop over input collection for ( unsigned int i=0; i<muons->size(); ++i ) if ( muon::isGoodMuon( (*muons)[i], type_, minNumberOfMatches_, maxAbsDx_, maxAbsPullX_, maxAbsDy_, maxAbsPullY_, maxChamberDist_, maxChamberDistPull_, arbitrationType_) ) outputCollection->push_back( edm::RefVector<std::vector<reco::Muon> >::value_type(muons,i) ); iEvent.put(outputCollection); }
Definition at line 44 of file MuonRefProducer.h.
Referenced by MuonRefProducer(), and produce().
double MuonRefProducer::maxAbsDx_ [private] |
Definition at line 38 of file MuonRefProducer.h.
Referenced by MuonRefProducer(), and produce().
double MuonRefProducer::maxAbsDy_ [private] |
Definition at line 40 of file MuonRefProducer.h.
Referenced by MuonRefProducer(), and produce().
double MuonRefProducer::maxAbsPullX_ [private] |
Definition at line 39 of file MuonRefProducer.h.
Referenced by MuonRefProducer(), and produce().
double MuonRefProducer::maxAbsPullY_ [private] |
Definition at line 41 of file MuonRefProducer.h.
Referenced by MuonRefProducer(), and produce().
double MuonRefProducer::maxChamberDist_ [private] |
Definition at line 42 of file MuonRefProducer.h.
Referenced by MuonRefProducer(), and produce().
double MuonRefProducer::maxChamberDistPull_ [private] |
Definition at line 43 of file MuonRefProducer.h.
Referenced by MuonRefProducer(), and produce().
int MuonRefProducer::minNumberOfMatches_ [private] |
Definition at line 37 of file MuonRefProducer.h.
Referenced by MuonRefProducer(), and produce().
Definition at line 34 of file MuonRefProducer.h.
Referenced by MuonRefProducer(), and produce().
muon::AlgorithmType MuonRefProducer::type_ [private] |
Definition at line 36 of file MuonRefProducer.h.
Referenced by MuonRefProducer(), and produce().