1 #ifndef RecoTracker_MkFitCore_interface_Hit_h 2 #define RecoTracker_MkFitCore_interface_Hit_h 30 inline float getRad2(
float x,
float y) {
return x *
x + y * y; }
32 inline float getInvRad2(
float x,
float y) {
return 1.0f / (
x *
x + y * y); }
34 inline float getPhi(
float x,
float y) {
return std::atan2(y,
x); }
36 inline float getTheta(
float r,
float z) {
return std::atan2(r, z); }
42 inline float getEta(
float x,
float y,
float z) {
49 inline float getRadErr2(
float x,
float y,
float exx,
float eyy,
float exy) {
50 return (
x *
x * exx + y * y * eyy + 2.0
f *
x * y * exy) /
getRad2(
x, y);
53 inline float getInvRadErr2(
float x,
float y,
float exx,
float eyy,
float exy) {
54 return (
x *
x * exx + y * y * eyy + 2.0
f *
x * y * exy) /
cube(
getRad2(
x, y));
57 inline float getPhiErr2(
float x,
float y,
float exx,
float eyy,
float exy) {
59 return (y * y * exx +
x *
x * eyy - 2.0
f *
x * y * exy) / (rad2 * rad2);
63 float x,
float y,
float z,
float exx,
float eyy,
float ezz,
float exy,
float exz,
float eyz) {
66 const float hypot2 = rad2 + z * z;
67 const float dthetadx =
x * z / (rad * hypot2);
68 const float dthetady = y * z / (rad * hypot2);
69 const float dthetadz = -rad / hypot2;
70 return dthetadx * dthetadx * exx + dthetady * dthetady * eyy + dthetadz * dthetadz * ezz +
71 2.0f * dthetadx * dthetady * exy + 2.0f * dthetadx * dthetadz * exz + 2.0f * dthetady * dthetadz * eyz;
74 inline float getEtaErr2(
float x,
float y,
float z,
float exx,
float eyy,
float ezz,
float exy,
float exz,
float eyz) {
76 const float detadx = -
x / (rad2 *
std::sqrt(1 + rad2 / (z * z)));
77 const float detady = -y / (rad2 *
std::sqrt(1 + rad2 / (z * z)));
78 const float detadz = 1.0f / (z *
std::sqrt(1 + rad2 / (z * z)));
79 return detadx * detadx * exx + detady * detady * eyy + detadz * detadz * ezz + 2.0f * detadx * detady * exy +
80 2.0f * detadx * detadz * exz + 2.0f * detady * detadz * eyz;
83 inline float getPxPxErr2(
float ipt,
float phi,
float vipt,
float vphi) {
84 const float iipt2 = 1.0f / (ipt * ipt);
87 return iipt2 * (iipt2 * cosP * cosP * vipt + sinP * sinP * vphi);
90 inline float getPyPyErr2(
float ipt,
float phi,
float vipt,
float vphi) {
91 const float iipt2 = 1.0f / (ipt * ipt);
94 return iipt2 * (iipt2 * sinP * sinP * vipt + cosP * cosP * vphi);
98 const float iipt2 = 1.0f / (ipt * ipt);
101 return iipt2 * (iipt2 * cotT * cotT * vipt + cscT * cscT * cscT * cscT * vtheta);
126 for (
int i = 0;
i < 6; ++
i)
132 for (
int i = 0;
i < 6; ++
i)
256 typedef std::vector<Hit>
HitVec;
283 float x = 0,
y = 0,
z = 0;
289 BeamSpot(
float ix,
float iy,
float iz,
float is,
float ibx,
float iby,
float idxdz,
float idydz)
static constexpr int kDetIdInLayerBits
float squashPhiMinimal(float phi)
bool operator<(const HitOnTrack o) const
void setupAsStrip(unsigned int id, int cpcm, int rows)
float getThetaErr2(float x, float y, float z, float exx, float eyy, float ezz, float exy, float exz, float eyz)
unsigned int detid_in_layer
const SMatrixSym33 error() const
Sin< T >::type sin(const T &t)
unsigned int chargePerCM() const
ROOT::Math::SVector< float, 3 > SVector3
float getTheta(float r, float z)
const SVector3 & position() const
float getEta(float r, float z)
int layer(const MCHitInfoVec &globalMCHitInfo) const
std::vector< MCHitInfo > MCHitInfoVec
float getInvRad2(float x, float y)
const float * posArray() const
static unsigned int maxChargePerCM()
float getInvRadErr2(float x, float y, float exx, float eyy, float exy)
static constexpr int kHitStopIdx
unsigned int get_charge_pcm() const
float getRadErr2(float x, float y, float exx, float eyy, float exy)
static constexpr int kHitInGapIdx
float squashPhiGeneral(float phi)
void setupAsPixel(unsigned int id, int rows, int cols)
float getPxPxErr2(float ipt, float phi, float vipt, float vphi)
int mcTrackID(const MCHitInfoVec &globalMCHitInfo) const
static constexpr int kChargePerCMBits
unsigned int detIDinLayer() const
static unsigned int maxSpan()
void set_charge_pcm(int cpcm)
const float * errArray() const
float getEtaErr2(float x, float y, float z, float exx, float eyy, float ezz, float exy, float exz, float eyz)
const MeasurementState & measurementState() const
Cos< T >::type cos(const T &t)
float getRad2(float x, float y)
Tan< T >::type tan(const T &t)
float getHypot(float x, float y)
Hit(const SVector3 &position, const SMatrixSym33 &error, int mcHitID=-1)
static constexpr int kMinChargePerCM
std::vector< Hit > HitVec
const SVector3 & parameters() const
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
MeasurementState(const SVector3 &p, const SMatrixSym33 &e)
unsigned int spanCols() const
static constexpr int kHitCCCFilterIdx
BeamSpot(float ix, float iy, float iz, float is, float ibx, float iby, float idxdz, float idydz)
std::vector< DeadRegion > DeadVec
void print(std::string_view label, const MeasurementState &s)
SMatrixSym33 errors() const
float getPhi(float x, float y)
unsigned int spanRows() const
std::vector< HitOnTrack > HoTVec
MCHitInfo(int track, int layer, int ithlayerhit, int mcHitID)
static constexpr int kHitMaxClusterIdx
ROOT::Math::SVector< float, 6 > SVector6
static constexpr int kMaxClusterSize
DeadRegion(float a1, float a2, float b1, float b2)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
static constexpr int kHitMissIdx
static constexpr int kClusterSizeBits
ROOT::Math::SMatrix< float, 3, 3, ROOT::Math::MatRepSym< float, 3 > > SMatrixSym33
SVector3 & parameters_nc()
float getPyPyErr2(float ipt, float phi, float vipt, float vphi)
Geom::Theta< T > theta() const
static constexpr int kHitEdgeIdx
const SVector3 & parameters() const
static unsigned int minChargePerCM()
float getPzPzErr2(float ipt, float theta, float vipt, float vtheta)
static constexpr float b1
float getPhiErr2(float x, float y, float exx, float eyy, float exy)
MeasurementState(const SVector3 &p, const SVector6 &e)