CMS 3D CMS Logo

Functions
MuonCosmicsId.cc File Reference
#include "RecoMuon/MuonIdentification/interface/MuonCosmicsId.h"
#include "DataFormats/TrackReco/interface/Track.h"

Go to the source code of this file.

Functions

bool directionAlongMomentum (const reco::Track &track)
 

Function Documentation

bool directionAlongMomentum ( const reco::Track track)

Definition at line 4 of file MuonCosmicsId.cc.

References reco::Track::innerPosition(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::vx(), and reco::TrackBase::vy().

Referenced by muonid::matchTracks().

4  {
5  // check is done in 2D
6  return (track.innerPosition().x()-track.vx())*track.px() +
7  (track.innerPosition().y()-track.vy())*track.py() > 0;
8 }
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:627
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:55
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:663
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:633
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657