CMS 3D CMS Logo

GhostTrackState.cc
Go to the documentation of this file.
1 #include <cmath>
2 
3 #include <Math/SMatrix.h>
4 #include <Math/MatrixFunctions.h>
5 
7 
10 
13 
17 
18 using namespace reco;
19 
20 namespace {
21  using namespace ROOT::Math;
22 
23  typedef SVector<double, 3> Vector3;
24 
25  inline Vector3 conv(const GlobalVector &vec) {
26  Vector3 result;
27  result[0] = vec.x();
28  result[1] = vec.y();
29  result[2] = vec.z();
30  return result;
31  }
32 } // namespace
33 
35 
37  : Base(new VertexGhostTrackState(pos, cov)) {}
38 
41 
44 
45 bool GhostTrackState::isTrack() const { return dynamic_cast<const TrackGhostTrackState *>(&data()) != nullptr; }
46 
47 bool GhostTrackState::isVertex() const { return dynamic_cast<const VertexGhostTrackState *>(&data()) != nullptr; }
48 
49 static const TrackGhostTrackState *getTrack(const BasicGhostTrackState *basic) {
50  const TrackGhostTrackState *track = dynamic_cast<const TrackGhostTrackState *>(basic);
51  if (!track)
52  throw cms::Exception("InvalidOperation") << "track requested on non non-track GhostTrackState";
53  return track;
54 }
55 
56 const TransientTrack &GhostTrackState::track() const { return getTrack(&data())->track(); }
57 
59 
61  return (globalPosition() - point).dot(dir.unit());
62 }
63 
65  return (globalPosition() - point).cross(dir.unit()).mag();
66 }
67 
69  return axisDistance(pred.origin(), pred.direction());
70 }
71 
72 double GhostTrackState::lambdaError(const GhostTrackPrediction &pred, const GlobalError &pvError) const {
73  if (!isValid())
74  return -1.;
75 
76  return std::sqrt(ROOT::Math::Similarity(conv(pred.direction()),
77  (vertexStateOnGhostTrack(pred).second.matrix() + pvError.matrix())) /
78  pred.rho2());
79 }
double flightDistance(const GlobalPoint &point, const GlobalVector &dir) const
GlobalPoint globalPosition() const
T z() const
Definition: PV3DBase.h:61
const TransientTrack & track() const
double axisDistance(const GlobalPoint &point, const GlobalVector &dir) const
double lambdaError(const GhostTrackPrediction &pred, const GlobalError &pvError=GlobalError()) const
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
const GlobalVector direction() const
Vertex vertexStateOnGhostTrack(const GhostTrackPrediction &pred, bool withMeasurementError=true) const
T sqrt(T t)
Definition: SSEVec.h:19
const TransientTrack & track() const
const AlgebraicSymMatrix33 matrix() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalVector
vector in glovbal coordinate system
Definition: Vector3D.h:28
const TrajectoryStateOnSurface & tsos() const
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
const T & data() const
Definition: ProxyBase11.h:51
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const GlobalPoint origin() const
const TrajectoryStateOnSurface & tsos() const
EPOS::IO_EPOS conv
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:18
fixed size matrix
static int position[264][3]
Definition: ReadPGInfo.cc:289
GhostTrackState(const TransientTrack &track)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5