#include <MuonProducer.h>
Public Member Functions | |
MuonProducer (const edm::ParameterSet &) | |
Constructor. | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
reconstruct muons | |
virtual | ~MuonProducer () |
Destructor. | |
Private Member Functions | |
void | printTrackRecHits (const reco::Track &track, edm::ESHandle< GlobalTrackingGeometry > trackingGeometry) const |
void | setAlias (std::string alias) |
Private Attributes | |
std::string | theAlias |
edm::InputTag | theLinksCollectionLabel |
No description available.
No description available.
Definition at line 22 of file MuonProducer.h.
MuonProducer::MuonProducer | ( | const edm::ParameterSet & | pSet | ) |
Constructor.
Definition at line 29 of file MuonProducer.cc.
References edm::ParameterSet::getParameter(), setAlias(), theAlias, and theLinksCollectionLabel.
{ theLinksCollectionLabel = pSet.getParameter<edm::InputTag>("InputObjects"); setAlias(pSet.getParameter<std::string>("@module_label")); produces<reco::MuonCollection>().setBranchAlias(theAlias + "s"); }
MuonProducer::~MuonProducer | ( | ) | [virtual] |
void MuonProducer::printTrackRecHits | ( | const reco::Track & | track, |
edm::ESHandle< GlobalTrackingGeometry > | trackingGeometry | ||
) | const [private] |
Definition at line 42 of file MuonProducer.cc.
References reco::Track::found(), i, LogTrace, reco::Track::lost(), metname, GloballyPositioned< T >::position(), csvReporter::r, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), GeomDet::surface(), GeomDet::toGlobal(), and z.
Referenced by produce().
{ const std::string metname = "Muon|RecoMuon|MuonIdentification|MuonProducer"; LogTrace(metname) << "Valid RecHits: "<<track.found() << " invalid RecHits: " << track.lost(); int i = 0; for(trackingRecHit_iterator recHit = track.recHitsBegin(); recHit != track.recHitsEnd(); ++recHit) if((*recHit)->isValid()){ const GeomDet* geomDet = trackingGeometry->idToDet((*recHit)->geographicalId()); double r = geomDet->surface().position().perp(); double z = geomDet->toGlobal((*recHit)->localPosition()).z(); LogTrace(metname) << i++ <<" r: "<< r <<" z: "<<z <<" "<<geomDet->toGlobal((*recHit)->localPosition()) <<std::endl; } }
void MuonProducer::produce | ( | edm::Event & | event, |
const edm::EventSetup & | eventSetup | ||
) | [virtual] |
reconstruct muons
Implements edm::EDProducer.
Definition at line 63 of file MuonProducer.cc.
References relval_parameters_module::energy, edm::EventSetup::get(), LogTrace, metname, metsig::muon, p4, printTrackRecHits(), reco::LeafCandidate::setCharge(), reco::Muon::setCombined(), reco::LeafCandidate::setP4(), reco::Muon::setStandAlone(), reco::Muon::setTrack(), reco::LeafCandidate::setVertex(), mathSSE::sqrt(), and theLinksCollectionLabel.
{ const std::string metname = "Muon|RecoMuon|MuonIdentification|MuonProducer"; // the muon collection, it will be loaded in the event std::auto_ptr<reco::MuonCollection> muonCollection(new reco::MuonCollection()); edm::Handle<reco::MuonTrackLinksCollection> linksCollection; event.getByLabel(theLinksCollectionLabel,linksCollection); if(linksCollection->empty()) { event.put(muonCollection); return; } // Global Tracking Geometry edm::ESHandle<GlobalTrackingGeometry> trackingGeometry; eventSetup.get<GlobalTrackingGeometryRecord>().get(trackingGeometry); for(reco::MuonTrackLinksCollection::const_iterator links = linksCollection->begin(); links != linksCollection->end(); ++links){ // some temporary print-out LogTrace(metname) << "trackerTrack"; printTrackRecHits(*(links->trackerTrack()),trackingGeometry); LogTrace(metname) << "standAloneTrack"; printTrackRecHits(*(links->standAloneTrack()),trackingGeometry); LogTrace(metname) << "globalTrack"; printTrackRecHits(*(links->globalTrack()),trackingGeometry); // Fill the muon reco::Muon muon; muon.setStandAlone(links->standAloneTrack()); muon.setTrack(links->trackerTrack()); muon.setCombined(links->globalTrack()); // FIXME: can this break in case combined info cannot be added to some tracks? muon.setCharge(links->globalTrack()->charge()); //FIXME: E = sqrt(p^2 + m^2), where m == 0.105658369(9)GeV double energy = sqrt(links->globalTrack()->p() * links->globalTrack()->p() + 0.011163691); math::XYZTLorentzVector p4(links->globalTrack()->px(), links->globalTrack()->py(), links->globalTrack()->pz(), energy); muon.setP4(p4); muon.setVertex(links->globalTrack()->vertex()); muonCollection->push_back(muon); } event.put(muonCollection); }
void MuonProducer::setAlias | ( | std::string | alias | ) | [inline, private] |
Definition at line 40 of file MuonProducer.h.
References theAlias.
Referenced by MuonProducer().
{ alias.erase( alias.size() - 1, alias.size() ); theAlias=alias; }
std::string MuonProducer::theAlias [private] |
Definition at line 38 of file MuonProducer.h.
Referenced by MuonProducer(), and setAlias().
Definition at line 52 of file MuonProducer.h.
Referenced by MuonProducer(), and produce().