CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrajectoryStateTransform.cc
Go to the documentation of this file.
9 
10 
11 namespace trajectoryStateTransform {
12 
13  using namespace SurfaceSideDefinition;
14 
17  unsigned int detid)
18  {
19  int surfaceSide = static_cast<int>(ts.surfaceSide());
20 
21  if (ts.hasError()) {
23 
24  int dim = 5;
25  float localErrors[15];
26 
27  int k = 0;
28  for (int i=0; i<dim; i++) {
29  for (int j=0; j<=i; j++) {
30  localErrors[k++] = m(i,j);
31  }
32  }
34  localErrors, detid,
35  surfaceSide);
36  }
38  detid,
39  surfaceSide);
40  }
41 
44  const Surface* surface,
45  const MagneticField* field)
46  {
48  bool errInv=true;
49  if (ts.hasError()) {
50  errInv = false;
51  int dim = 5;
52  int k = 0;
53  for (int i=0; i<dim; i++) {
54  for (int j=0; j<=i; j++) {
55  m(i,j) = ts.error(k++); // NOTE: here we do a cast float => double.
56  }
57  }
58  }
59 
60 
62  errInv ? LocalTrajectoryError(InvalidError()) : LocalTrajectoryError(m),
63  *surface, field,
64  static_cast<SurfaceSide>(ts.surfaceSide()));
65 
66 }
67 
69  const MagneticField* field)
70  {
72  GlobalPoint gpos( pos);
73  Basic3DVector<float> mom( tk.momentum());
74  GlobalVector gmom( mom);
75  GlobalTrajectoryParameters par( gpos, gmom, tk.charge(), field);
77  return FreeTrajectoryState( par, err);
78  }
79 
81  const MagneticField* field)
82  {
84  GlobalPoint gpos( pos);
86  GlobalVector gmom( mom);
87  GlobalTrajectoryParameters par( gpos, gmom, tk.charge(), field);
88  CurvilinearTrajectoryError err( tk.extra()->innerStateCovariance());
89  return FreeTrajectoryState( par, err);
90  }
91 
92 
94  const MagneticField* field)
95  {
97  GlobalPoint gpos( pos);
99  GlobalVector gmom( mom);
100  GlobalTrajectoryParameters par( gpos, gmom, tk.charge(), field);
101  CurvilinearTrajectoryError err( tk.extra()->outerStateCovariance());
102  return FreeTrajectoryState( par, err);
103  }
104 
105 
107  const TrackingGeometry& geom,
108  const MagneticField* field)
109  {
110  const Surface& surface = geom.idToDet( DetId( tk.extra()->innerDetId()))->surface();
111  return TrajectoryStateOnSurface( innerFreeState( tk, field), surface);
112  }
113 
115  const TrackingGeometry& geom,
116  const MagneticField* field)
117  {
118  const Surface& surface = geom.idToDet( DetId( tk.extra()->outerDetId()))->surface();
119  return TrajectoryStateOnSurface( outerFreeState( tk, field), surface);
120  }
121 
122 }
int i
Definition: DBlmapReader.cc:9
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:150
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:97
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field)
const LocalTrajectoryParameters & localParameters() const
FreeTrajectoryState innerFreeState(const reco::Track &tk, const MagneticField *field)
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:47
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:182
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:42
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
int j
Definition: DBlmapReader.cc:9
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
int k[5][pyjets_maxn]
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:156
Definition: DetId.h:20
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:49
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
virtual const GeomDet * idToDet(DetId) const =0
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field)
TrajectoryStateOnSurface outerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field)
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:45
int charge() const
track electric charge
Definition: TrackBase.h:113
FreeTrajectoryState outerFreeState(const reco::Track &tk, const MagneticField *field)
const LocalTrajectoryParameters & parameters() const