6#include <edm4eic/ReconstructedParticleCollection.h>
7#include <edm4eic/TrackParametersCollection.h>
8#include <edm4eic/unit_system.h>
9#include <edm4hep/Vector3f.h>
19 edm4hep::Vector3f mOrigin;
32 Helix(
const double c,
const double dip,
const double phase,
const edm4hep::Vector3f& o,
36 Helix(
const edm4hep::Vector3f& p,
const edm4hep::Vector3f& o,
const double B,
const int q);
39 Helix(
const edm4eic::ReconstructedParticle& p,
const double b_field);
50 const edm4hep::Vector3f&
origin()
const;
54 void setParameters(
const edm4hep::Vector3f& p,
const edm4hep::Vector3f& o,
const double B,
58 void setParameters(
const edm4eic::TrackParameters& trk,
const double b_field);
61 double x(
double s)
const;
62 double y(
double s)
const;
63 double z(
double s)
const;
65 edm4hep::Vector3f
at(
double s)
const;
68 double cx(
double s)
const;
69 double cy(
double s)
const;
70 double cz(
double s = 0)
const;
72 edm4hep::Vector3f
cat(
double s)
const;
78 std::pair<double, double>
pathLength(
double r)
const;
81 std::pair<double, double>
pathLength(
double r,
double x,
double y);
84 double pathLength(
const edm4hep::Vector3f& p,
bool scanPeriods =
true)
const;
87 double pathLength(
const edm4hep::Vector3f& r,
const edm4hep::Vector3f& n)
const;
93 std::pair<double, double>
pathLengths(
const Helix&,
double minStepSize = 10 * edm4eic::unit::um,
94 double minRange = 10 * edm4eic::unit::cm)
const;
97 double distance(
const edm4hep::Vector3f& p,
bool scanPeriods =
true)
const;
100 bool valid(
double world = 1.e+5)
const {
return !
bad(world); }
101 int bad(
double world = 1.e+5)
const;
116 edm4hep::Vector3f
momentum(
double)
const;
117 edm4hep::Vector3f
momentumAt(
double,
double)
const;
146 return mOrigin.x - s * mCosDipAngle * mSinPhase;
148 return mOrigin.x + (cos(mPhase + s * mH * mCurvature * mCosDipAngle) - mCosPhase) / mCurvature;
153 return mOrigin.y + s * mCosDipAngle * mCosPhase;
155 return mOrigin.y + (sin(mPhase + s * mH * mCurvature * mCosDipAngle) - mSinPhase) / mCurvature;
158inline double Helix::z(
double s)
const {
return mOrigin.z + s * mSinDipAngle; }
162 return -mCosDipAngle * mSinPhase;
164 return -sin(mPhase + s * mH * mCurvature * mCosDipAngle) * mH * mCosDipAngle;
169 return mCosDipAngle * mCosPhase;
171 return cos(mPhase + s * mH * mCurvature * mCosDipAngle) * mH * mCosDipAngle;
174inline double Helix::cz(
double )
const {
return mSinDipAngle; }
178inline edm4hep::Vector3f
Helix::at(
double s)
const {
return edm4hep::Vector3f(
x(s),
y(s),
z(s)); }
181 return edm4hep::Vector3f(
cx(s),
cy(s),
cz(s));
190 if (!std::isfinite(mDipAngle))
192 if (!std::isfinite(mCurvature))
198 if (std::abs(mDipAngle) > 1.58)
200 double qwe = std::abs(std::abs(mDipAngle) - M_PI / 2);
201 if (qwe < 1. / WorldSize)
204 if (std::abs(mCurvature) > WorldSize)
209 if (std::abs(mH) != 1)
double cx(double s) const
pointing vector of helix at point s
Definition Helix.h:160
double cy(double s) const
Definition Helix.h:167
void setDipAngle(double)
Definition Helix.cc:128
double distance(const edm4hep::Vector3f &p, bool scanPeriods=true) const
minimal distance between point and helix
Definition Helix.cc:162
void setPhase(double)
performs also various checks
Definition Helix.cc:120
double dipAngle() const
Definition Helix.h:138
void Print() const
Definition Helix.cc:525
edm4hep::Vector3f cat(double s) const
Definition Helix.h:180
void setParameters(double c, double dip, double phase, const edm4hep::Vector3f &o, int h)
starting point
Definition Helix.cc:76
std::pair< double, double > pathLengths(const Helix &, double minStepSize=10 *edm4eic::unit::um, double minRange=10 *edm4eic::unit::cm) const
path lengths at dca between two helices
Definition Helix.cc:412
static const double NoSolution
Definition Helix.h:106
int charge(double) const
Definition Helix.cc:554
bool valid(double world=1.e+5) const
checks for valid parametrization
Definition Helix.h:100
edm4hep::Vector3f momentum(double) const
Definition Helix.cc:534
edm4hep::Vector3f momentumAt(double, double) const
Definition Helix.cc:547
double curvature() const
Definition Helix.h:140
edm4hep::Vector3f at(double s) const
Definition Helix.h:178
double period() const
returns period length of helix
Definition Helix.cc:249
double x(double s) const
coordinates of helix at point s
Definition Helix.h:144
double xcenter() const
aziumth in xy-plane measured from ring center
Definition Helix.cc:134
const edm4hep::Vector3f & origin() const
-sign(q*B);
Definition Helix.h:176
int bad(double world=1.e+5) const
Definition Helix.h:187
double fudgePathLength(const edm4hep::Vector3f &) const
value of S where distance in x-y plane is minimal
Definition Helix.cc:148
double y(double s) const
Definition Helix.h:151
std::pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
Definition Helix.cc:256
double ycenter() const
x-center of circle in xy-plane
Definition Helix.cc:141
double phase() const
1/R in xy-plane
Definition Helix.h:142
void moveOrigin(double s)
move the origin along the helix to s which becomes then s=0
Definition Helix.cc:515
void setCurvature(double)
Definition Helix.cc:106
double z(double s) const
Definition Helix.h:158
int h() const
y-center of circle in xy-plane
Definition Helix.h:136
double cz(double s=0) const
Definition Helix.h:174
double curvatureSignedDistance(double x, double y)
Definition Helix.cc:579
double geometricSignedDistance(double x, double y)
Definition Helix.cc:556
-client
Definition CalorimeterClusterRecoCoG.cc:37