CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
lst_math::Helix Class Reference

#include <lst_math.h>

Public Member Functions

const std::vector< float > center ()
 
const float charge ()
 
float compare_radius (const std::vector< float > point)
 
float compare_xy (const std::vector< float > point)
 
std::tuple< float, float, float, float > get_helix_point (float t)
 
 Helix (std::vector< float > c, float r, float p, float l, float q)
 
 Helix (float pt, float eta, float phi, float vx, float vy, float vz, float charge)
 
float infer_t (const std::vector< float > point)
 
const float lam ()
 
const float phi ()
 
const float radius ()
 

Public Attributes

std::vector< float > center_
 
float charge_
 
float lam_
 
float phi_
 
float radius_
 

Detailed Description

Definition at line 36 of file lst_math.h.

Constructor & Destructor Documentation

◆ Helix() [1/2]

lst_math::Helix::Helix ( std::vector< float >  c,
float  r,
float  p,
float  l,
float  q 
)
inline

◆ Helix() [2/2]

lst_math::Helix::Helix ( float  pt,
float  eta,
float  phi,
float  vx,
float  vy,
float  vz,
float  charge 
)
inline

Definition at line 52 of file lst_math.h.

References funct::abs(), center_, charge(), charge_, funct::cos(), PVValHelper::eta, JetChargeProducer_cfi::exp, lam_, M_PI, phi(), phi_, DiDispStaMuonMonitor_cfi::pt, radius_, funct::sin(), btvMC_cff::vx, btvMC_cff::vy, and btvMC_cff::vz.

52  {
53  // Radius based on pt
54  radius_ = pt / (2.99792458e-3 * 3.8);
55  phi_ = phi;
56  charge_ = charge;
57 
58  // reference point vector which for sim track is the vertex point
59  float ref_vec_x = vx;
60  float ref_vec_y = vy;
61  float ref_vec_z = vz;
62 
63  // The reference to center vector
64  float inward_radial_vec_x = charge_ * radius_ * sin(phi_);
65  float inward_radial_vec_y = charge_ * radius_ * -cos(phi_);
66  float inward_radial_vec_z = 0;
67 
68  // Center point
69  float center_vec_x = ref_vec_x + inward_radial_vec_x;
70  float center_vec_y = ref_vec_y + inward_radial_vec_y;
71  float center_vec_z = ref_vec_z + inward_radial_vec_z;
72  center_.push_back(center_vec_x);
73  center_.push_back(center_vec_y);
74  center_.push_back(center_vec_z);
75 
76  // Lambda
77  lam_ = copysign(M_PI / 2. - 2. * atan(exp(-abs(eta))), eta);
78  }
const float charge()
Definition: lst_math.h:84
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float radius_
Definition: lst_math.h:39
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float charge_
Definition: lst_math.h:42
std::vector< float > center_
Definition: lst_math.h:38
#define M_PI
const float phi()
Definition: lst_math.h:82

Member Function Documentation

◆ center()

const std::vector<float> lst_math::Helix::center ( )
inline

Definition at line 80 of file lst_math.h.

References center_.

Referenced by get_helix_point(), and infer_t().

80 { return center_; }
std::vector< float > center_
Definition: lst_math.h:38

◆ charge()

const float lst_math::Helix::charge ( void  )
inline

Definition at line 84 of file lst_math.h.

References charge_.

Referenced by get_helix_point(), and Helix().

84 { return charge_; }
float charge_
Definition: lst_math.h:42

◆ compare_radius()

float lst_math::Helix::compare_radius ( const std::vector< float >  point)
inline

Definition at line 100 of file lst_math.h.

References get_helix_point(), infer_t(), point, mathSSE::sqrt(), submitPVValidationJobs::t, and x.

Referenced by drfracSimHitConsistentWithHelix().

100  {
101  float t = infer_t(point);
102  auto [x, y, z, r] = get_helix_point(t);
103  float point_r = sqrt(point[0] * point[0] + point[1] * point[1]);
104  return (point_r - r);
105  }
std::tuple< float, float, float, float > get_helix_point(float t)
Definition: lst_math.h:86
T sqrt(T t)
Definition: SSEVec.h:23
float infer_t(const std::vector< float > point)
Definition: lst_math.h:94
*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

◆ compare_xy()

float lst_math::Helix::compare_xy ( const std::vector< float >  point)
inline

Definition at line 107 of file lst_math.h.

References get_helix_point(), infer_t(), point, funct::pow(), mathSSE::sqrt(), submitPVValidationJobs::t, and x.

Referenced by distxySimHitConsistentWithHelix().

107  {
108  float t = infer_t(point);
109  auto [x, y, z, r] = get_helix_point(t);
110  float xy_dist = sqrt(pow(point[0] - x, 2) + pow(point[1] - y, 2));
111  return xy_dist;
112  }
std::tuple< float, float, float, float > get_helix_point(float t)
Definition: lst_math.h:86
T sqrt(T t)
Definition: SSEVec.h:23
float infer_t(const std::vector< float > point)
Definition: lst_math.h:94
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
*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

◆ get_helix_point()

std::tuple<float, float, float, float> lst_math::Helix::get_helix_point ( float  t)
inline

Definition at line 86 of file lst_math.h.

References center(), charge(), funct::cos(), lam(), phi(), radius(), funct::sin(), mathSSE::sqrt(), submitPVValidationJobs::t, funct::tan(), and x.

Referenced by compare_radius(), compare_xy(), and drfracSimHitConsistentWithHelix().

86  {
87  float x = center()[0] - charge() * radius() * sin(phi() - (charge()) * t);
88  float y = center()[1] + charge() * radius() * cos(phi() - (charge()) * t);
89  float z = center()[2] + radius() * tan(lam()) * t;
90  float r = sqrt(x * x + y * y);
91  return std::make_tuple(x, y, z, r);
92  }
const float charge()
Definition: lst_math.h:84
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const std::vector< float > center()
Definition: lst_math.h:80
T sqrt(T t)
Definition: SSEVec.h:23
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const float lam()
Definition: lst_math.h:83
const float radius()
Definition: lst_math.h:81
const float phi()
Definition: lst_math.h:82

◆ infer_t()

float lst_math::Helix::infer_t ( const std::vector< float >  point)
inline

Definition at line 94 of file lst_math.h.

References center(), lam(), point, radius(), submitPVValidationJobs::t, and funct::tan().

Referenced by compare_radius(), compare_xy(), distxySimHitConsistentWithHelix(), and drfracSimHitConsistentWithHelix().

94  {
95  // Solve for t based on z position
96  float t = (point[2] - center()[2]) / (radius() * tan(lam()));
97  return t;
98  }
const std::vector< float > center()
Definition: lst_math.h:80
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const float lam()
Definition: lst_math.h:83
const float radius()
Definition: lst_math.h:81
*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

◆ lam()

const float lst_math::Helix::lam ( )
inline

Definition at line 83 of file lst_math.h.

References lam_.

Referenced by get_helix_point(), and infer_t().

83 { return lam_; }

◆ phi()

const float lst_math::Helix::phi ( void  )
inline

◆ radius()

const float lst_math::Helix::radius ( void  )
inline

Definition at line 81 of file lst_math.h.

References radius_.

Referenced by get_helix_point(), and infer_t().

81 { return radius_; }
float radius_
Definition: lst_math.h:39

Member Data Documentation

◆ center_

std::vector<float> lst_math::Helix::center_

Definition at line 38 of file lst_math.h.

Referenced by center(), and Helix().

◆ charge_

float lst_math::Helix::charge_

Definition at line 42 of file lst_math.h.

Referenced by charge(), and Helix().

◆ lam_

float lst_math::Helix::lam_

Definition at line 41 of file lst_math.h.

Referenced by Helix(), and lam().

◆ phi_

float lst_math::Helix::phi_

Definition at line 40 of file lst_math.h.

Referenced by Helix(), and phi().

◆ radius_

float lst_math::Helix::radius_

Definition at line 39 of file lst_math.h.

Referenced by Helix(), and radius().