CMS 3D CMS Logo

CurvilinearState.h
Go to the documentation of this file.
1 #ifndef CurvilinearState_H
2 #define CurvilinearState_H
3 
7 #include "VectorDoublet.h"
8 
22 public:
23  typedef double Scalar;
27 
29 
30  CurvilinearState(const Vector& v, Scalar z, Scalar pzsign) : par_(v), z_(z), pzSign_(pzsign) {}
31 
33  : par_(Vector2D(pos.x(), pos.y()), Vector3D(p.x() / p.z(), p.y() / p.z(), ch / p.mag())),
34  z_(pos.z()),
35  pzSign_(p.z() > 0. ? 1. : -1.) {}
36 
37  const Vector3D position() const { return Vector3D(par_.first().x(), par_.first().y(), z_); }
38 
39  const Vector3D momentum() const {
40  Scalar p = 1. / fabs(par_.second().z());
41  if (p > 1.e9)
42  p = 1.e9;
43  Scalar dxdz = par_.second().x();
44  Scalar dydz = par_.second().y();
45  Scalar dz = pzSign_ / sqrt(1. + dxdz * dxdz + dydz * dydz);
46  Scalar dx = dz * dxdz;
47  Scalar dy = dz * dydz;
48  return Vector3D(dx * p, dy * p, dz * p);
49  }
50 
51  const Vector& parameters() const { return par_; }
52 
53  Scalar charge() const { return par_.second().z() > 0 ? 1 : -1; }
54 
55  Scalar z() const { return z_; }
56 
57  double pzSign() const { return pzSign_; }
58 
59 private:
63 };
64 
66  return CurvilinearState(a.parameters() + b.parameters(), a.z() + b.z(), a.pzSign());
67 }
68 
70  return CurvilinearState(a.parameters() - b.parameters(), a.z() - b.z(), a.pzSign());
71 }
72 
74  return CurvilinearState(v.parameters() * s, v.z() * s, v.pzSign());
75 }
77  return CurvilinearState(v.parameters() * s, v.z() * s, v.pzSign());
78 }
79 
81  return CurvilinearState(v.parameters() / s, v.z() / s, v.pzSign());
82 }
83 
84 #endif
DDAxes::y
CurvilinearState::momentum
const Vector3D momentum() const
Definition: CurvilinearState.h:39
Visibility.h
CurvilinearState::z_
Scalar z_
Definition: CurvilinearState.h:61
operator+
CurvilinearState operator+(const CurvilinearState &a, const CurvilinearState &b)
Definition: CurvilinearState.h:65
operator/
CurvilinearState operator/(const CurvilinearState &v, const CurvilinearState::Scalar &s)
Definition: CurvilinearState.h:80
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
Basic3DVector.h
DDAxes::x
findQualityFiles.v
v
Definition: findQualityFiles.py:179
VectorDoublet.h
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CurvilinearState::CurvilinearState
CurvilinearState(const Vector3D &pos, const Vector3D &p, Scalar ch)
Definition: CurvilinearState.h:32
CurvilinearState::charge
Scalar charge() const
Definition: CurvilinearState.h:53
CurvilinearState::Scalar
double Scalar
Definition: CurvilinearState.h:23
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
BeamSpotPI::dxdz
Definition: BeamSpotPayloadInspectorHelper.h:37
b
double b
Definition: hdecay.h:118
CurvilinearState::Vector2D
Basic2DVector< Scalar > Vector2D
Definition: CurvilinearState.h:24
CurvilinearState::pzSign_
Scalar pzSign_
sign of local pz
Definition: CurvilinearState.h:62
Basic2DVector< Scalar >
a
double a
Definition: hdecay.h:119
CurvilinearState::parameters
const Vector & parameters() const
Definition: CurvilinearState.h:51
operator-
CurvilinearState operator-(const CurvilinearState &a, const CurvilinearState &b)
Definition: CurvilinearState.h:69
CurvilinearState::pzSign
double pzSign() const
Definition: CurvilinearState.h:57
dso_internal
#define dso_internal
Definition: Visibility.h:13
CurvilinearState::Vector
VectorDoublet< Vector2D, Vector3D > Vector
Definition: CurvilinearState.h:26
CurvilinearState::position
const Vector3D position() const
Definition: CurvilinearState.h:37
BeamSpotPI::dydz
Definition: BeamSpotPayloadInspectorHelper.h:38
PVValHelper::dy
Definition: PVValidationHelpers.h:50
CurvilinearState::z
Scalar z() const
Definition: CurvilinearState.h:55
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
CurvilinearState::par_
Vector par_
Definition: CurvilinearState.h:60
CurvilinearState
Definition: CurvilinearState.h:21
PVValHelper::dz
Definition: PVValidationHelpers.h:51
Basic2DVector.h
VectorDoublet< Vector2D, Vector3D >
CurvilinearState::CurvilinearState
CurvilinearState(const Vector &v, Scalar z, Scalar pzsign)
Definition: CurvilinearState.h:30
PVValHelper::dx
Definition: PVValidationHelpers.h:49
Basic3DVector< Scalar >
operator*
CurvilinearState operator*(const CurvilinearState &v, const CurvilinearState::Scalar &s)
Definition: CurvilinearState.h:73
CurvilinearState::CurvilinearState
CurvilinearState()
Definition: CurvilinearState.h:28
CurvilinearState::Vector3D
Basic3DVector< Scalar > Vector3D
Definition: CurvilinearState.h:25