29 produces<reco::MuonCollection>().setBranchAlias(
theAlias +
"s");
42 const std::string metname =
"Muon|RecoMuon|MuonIdentification|GlobalMuonToMuonProducer";
44 LogTrace(metname) <<
"Valid RecHits: "<<track.
found() <<
" invalid RecHits: " << track.
lost();
48 if((*recHit)->isValid()){
49 const GeomDet* geomDet = trackingGeometry->
idToDet((*recHit)->geographicalId());
51 double z = geomDet->
toGlobal((*recHit)->localPosition()).
z();
52 LogTrace(metname) << i++ <<
" r: "<< r <<
" z: "<<z <<
" "<<geomDet->
toGlobal((*recHit)->localPosition())
62 const std::string metname =
"Muon|RecoMuon|MuonIdentification|GlobalMuonToMuonProducer";
71 if(linksCollection->empty()) {
81 for(reco::MuonTrackLinksCollection::const_iterator links = linksCollection->begin();
82 links != linksCollection->end(); ++links){
87 LogTrace(metname) <<
"standAloneTrack";
95 muon.
setTrack(links->trackerTrack());
99 muon.
setCharge(links->globalTrack()->charge());
102 double energy =
sqrt(links->globalTrack()->p() * links->globalTrack()->p() + 0.011163691);
104 links->globalTrack()->py(),
105 links->globalTrack()->pz(),
109 muon.
setVertex(links->globalTrack()->vertex());
T getParameter(std::string const &) const
virtual ~GlobalMuonToMuonProducer()
Destructor.
edm::EDGetTokenT< reco::MuonTrackLinksCollection > trackLinkToken_
GlobalMuonToMuonProducer(const edm::ParameterSet &)
Constructor.
unsigned short lost() const
Number of lost (=invalid) hits on track.
const std::string metname
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
const Plane & surface() const
The nominal surface of the GeomDet.
edm::InputTag theLinksCollectionLabel
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual const GeomDet * idToDet(DetId) const
virtual void setStandAlone(const TrackRef &t)
void setAlias(std::string alias)
virtual void setCombined(const TrackRef &t)
virtual void setCharge(Charge q) final
set electric charge
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
virtual void setVertex(const Point &vertex)
set vertex
void printTrackRecHits(const reco::Track &track, edm::ESHandle< GlobalTrackingGeometry > trackingGeometry) const
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
reconstruct muons
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
virtual void setTrack(const TrackRef &t)
unsigned short found() const
Number of valid hits on track.
const PositionType & position() const
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.