CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  static inline Vector3 conv(const GlobalVector &vec)
26  {
27  Vector3 result;
28  result[0] = vec.x();
29  result[1] = vec.y();
30  result[2] = vec.z();
31  return result;
32  }
33 }
34 
36  Base(new TrackGhostTrackState(track))
37 {
38 }
39 
41  const CovarianceMatrix &cov) :
42  Base(new VertexGhostTrackState(pos, cov))
43 {
44 }
45 
47  const GlobalError &error) :
48  Base(new VertexGhostTrackState(pos, error.matrix_new()))
49 {
50 }
51 
54  state.error().matrix_new()))
55 {
56 }
57 
59 {
60  return dynamic_cast<const TrackGhostTrackState*>(&data()) != 0;
61 }
62 
64 {
65  return dynamic_cast<const VertexGhostTrackState*>(&data()) != 0;
66 }
67 
69 {
70  const TrackGhostTrackState *track =
71  dynamic_cast<const TrackGhostTrackState*>(basic);
72  if (!track)
73  throw cms::Exception("InvalidOperation")
74  << "track requested on non non-track GhostTrackState";
75  return track;
76 }
77 
79 {
80  return getTrack(&data())->track();
81 }
82 
84 {
85  return getTrack(&data())->tsos();
86 }
87 
89  const GlobalVector &dir) const
90 {
91  return (globalPosition() - point).dot(dir.unit());
92 }
93 
95  const GlobalVector &dir) const
96 {
97  return (globalPosition() - point).cross(dir.unit()).mag();
98 }
99 
101 {
102  return axisDistance(pred.origin(), pred.direction());
103 }
104 
106  const GlobalError &pvError) const
107 {
108  if (!isValid())
109  return -1.;
110 
111  return std::sqrt(
112  ROOT::Math::Similarity(
113  conv(pred.direction()),
114  (vertexStateOnGhostTrack(pred).second.matrix_new() +
115  pvError.matrix_new()))
116  / pred.rho2());
117 }
double lambdaError(const GhostTrackPrediction &pred, const GlobalError &pvError=GlobalError()) const
Vertex vertexStateOnGhostTrack(const GhostTrackPrediction &pred, bool withMeasurementError=true) const
const GlobalPoint origin() const
const TransientTrack & track() const
static HepMC::IO_HEPEVT conv
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T y() const
Definition: PV3DBase.h:63
const TransientTrack & track() const
double flightDistance(const GlobalPoint &point, const GlobalVector &dir) const
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
const TrajectoryStateOnSurface & tsos() const
const AlgebraicSymMatrix33 & matrix_new() const
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
const TrajectoryStateOnSurface & tsos() const
tuple result
Definition: query.py:137
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalVector
vector in glovbal coordinate system
Definition: Vector3D.h:28
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
double axisDistance(const GlobalPoint &point, const GlobalVector &dir) const
const T & data() const
Definition: ProxyBase.h:67
char state
Definition: procUtils.cc:75
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:18
dbl *** dir
Definition: mlp_gen.cc:35
GhostTrackState(const TransientTrack &track)
T x() const
Definition: PV3DBase.h:62
GlobalPoint globalPosition() const
*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
const GlobalVector direction() const