12#ifndef ALICEO2_TRACKTOOLS_TRACKGEOMETRY_H_
13#define ALICEO2_TRACKTOOLS_TRACKGEOMETRY_H_
104 float gx = std::numeric_limits<float>::quiet_NaN();
105 float gy = std::numeric_limits<float>::quiet_NaN();
106 float gz = std::numeric_limits<float>::quiet_NaN();
107 float px = std::numeric_limits<float>::quiet_NaN();
108 float py = std::numeric_limits<float>::quiet_NaN();
109 float pz = std::numeric_limits<float>::quiet_NaN();
118 return state.valid() ? std::atan2(
state.gy,
state.gx) : std::numeric_limits<float>::quiet_NaN();
124 return state.valid() ? std::atan2(
state.py,
state.px) : std::numeric_limits<float>::quiet_NaN();
130 if (!
state.valid()) {
131 return std::numeric_limits<float>::quiet_NaN();
133 const float pt = std::hypot(
state.px,
state.py);
134 return pt > 0.f ?
state.pz / pt : std::numeric_limits<float>::quiet_NaN();
146inline float dSector(
float phi,
int nSectors = 18,
float sectorPhaseRad = 0.f)
148 if (!std::isfinite(phi) || !std::isfinite(sectorPhaseRad) || nSectors <= 0) {
149 return std::numeric_limits<float>::quiet_NaN();
151 const float x = 0.5f * nSectors * (phi - sectorPhaseRad) / o2::constants::math::PI;
152 const float phase =
x - std::floor(
x);
172 float vx = 0.f,
float vy = 0.f,
float vz = 0.f)
174 const float pt = 1.f / std::abs(qpt);
175 const int charge = qpt >= 0.f ? 1 : -1;
192 track.getXYZGlo(xyz);
193 if (!track.getPxPyPzGlo(pxyz)) {
196 for (
int i = 0;
i < 3; ++
i) {
197 if (!std::isfinite(xyz[
i]) || !std::isfinite(pxyz[
i])) {
207 constexpr float eps = 1.e-6f;
233 if (!(
radius > 0.f) || !std::isfinite(
radius) || !std::isfinite(bzKG) || !track.isValid()) {
250 const double x0 =
static_cast<double>(xyz[0]);
251 const double y0 =
static_cast<double>(xyz[1]);
252 const double z0 =
static_cast<double>(xyz[2]);
253 const double px0 =
static_cast<double>(pxyz[0]);
254 const double py0 =
static_cast<double>(pxyz[1]);
255 const double pz0 =
static_cast<double>(pxyz[2]);
256 const double targetR =
static_cast<double>(
radius);
257 const double pt = std::hypot(px0, py0);
258 if (!(pt > 0.) || !std::isfinite(pt)) {
263 const double phi0 = std::atan2(py0, px0);
264 const double tgl = pz0 / pt;
265 const double curv =
static_cast<double>(track.getQ2Pt()) *
266 static_cast<double>(bzKG) *
267 static_cast<double>(o2::constants::math::B2C);
268 constexpr double eps = 1.e-10;
269 constexpr double curvEps = 1.e-12;
270 const double twoPi = 2.0 *
static_cast<double>(o2::constants::math::PI);
272 bool foundAny =
false;
273 bool foundDirection =
false;
274 double bestSxy = std::numeric_limits<double>::infinity();
275 double bestX = 0., bestY = 0., bestPhiMom = 0.;
277 auto directionMatchesD = [&](
double drds) {
278 constexpr double dirEps = 1.e-10;
280 return drds >= -dirEps;
283 return drds <= dirEps;
288 auto consider = [&](
double x,
double y,
double phiMom,
double sxy) {
289 if (!std::isfinite(sxy) || sxy < -eps) {
293 sxy = std::max(0.0, sxy);
294 const double drds = (
x * std::cos(phiMom) +
y * std::sin(phiMom)) / targetR;
295 if (!directionMatchesD(drds)) {
298 foundDirection =
true;
307 if (std::abs(curv) < curvEps) {
308 const double ux = px0 / pt, uy = py0 / pt;
309 const double b =
x0 * ux +
y0 * uy;
310 const double c =
x0 *
x0 +
y0 *
y0 - targetR * targetR;
311 double disc =
b *
b -
c;
316 disc = std::max(0.0, disc);
317 const double root = std::sqrt(disc);
318 for (
const double sxy : {-
b - root, -
b + root}) {
319 consider(
x0 + sxy * ux,
y0 + sxy * uy, phi0, sxy);
322 const double xc =
x0 - std::sin(phi0) / curv;
323 const double yc =
y0 + std::cos(phi0) / curv;
324 const double rho = 1.0 / std::abs(curv);
325 const double d = std::hypot(xc, yc);
326 if (!(d > eps) || d > targetR + rho + eps || d < std::abs(targetR - rho) - eps) {
331 const double a = (targetR * targetR - rho * rho + d * d) / (2.0 * d);
332 double h2 = targetR * targetR -
a *
a;
337 h2 = std::max(0.0, h2);
338 const double h = std::sqrt(h2);
339 const double bx =
a * xc / d, by =
a * yc / d;
340 const double ox = -yc *
h / d, oy = xc *
h / d;
342 const std::array<std::array<double, 2>, 2> intersections{{{{bx + ox, by + oy}},
343 {{bx - ox, by - oy}}}};
344 for (
const auto& xy : intersections) {
345 const double x = xy[0],
y = xy[1];
346 double sinPhi = curv * (
x - xc);
347 double cosPhi = -curv * (
y - yc);
348 const double norm = std::hypot(sinPhi, cosPhi);
349 if (!(norm > 0.) || !std::isfinite(norm)) {
354 const double phiMom = std::atan2(sinPhi, cosPhi);
355 double delta = phiMom - phi0;
357 while (delta < -eps) {
361 while (delta > eps) {
365 consider(
x,
y, phiMom, delta / curv);
369 if (!foundDirection || !std::isfinite(bestSxy)) {
374 out.
gx =
static_cast<float>(bestX);
375 out.
gy =
static_cast<float>(bestY);
376 out.
gz =
static_cast<float>(z0 + bestSxy * tgl);
377 out.
px =
static_cast<float>(pt * std::cos(bestPhiMom));
378 out.
py =
static_cast<float>(pt * std::sin(bestPhiMom));
379 out.
pz =
static_cast<float>(pz0);
401 if (!(
radius > 0.f) || !std::isfinite(
radius) || !std::isfinite(bzKG) || !track.isValid()) {
407 if (!track.getXatLabR(
radius, xAtR, bzKG, dir)) {
412 auto propagated = track;
413 if (!propagated.propagateParamTo(xAtR, bzKG)) {
426 constexpr float radiusToleranceCm = 2.e-3f;
427 const float resultRadius = std::hypot(xyz[0], xyz[1]);
428 if (!std::isfinite(resultRadius) || std::abs(resultRadius -
radius) > radiusToleranceCm) {
460 if (!std::isfinite(phi) || !std::isfinite(tgl) || !std::isfinite(qpt) || std::abs(qpt) < 1.e-12f) {
461 return std::numeric_limits<float>::quiet_NaN();
468 int nSectors = 18,
float vz = 0.f,
float sectorPhaseRad = 0.f)
471 return dSector(phiR, nSectors, sectorPhaseRad);
515template <
typename Evaluator>
517 const float* phi,
const float* tgl,
const float* qpt,
518 const float* vx,
const float* vy,
const float* vz,
519 std::size_t
n,
float radius,
float bzKG,
int nSectors,
float sectorPhaseRad, Evaluator&& evaluate)
523 for (std::size_t
i = 0;
i <
n; ++
i) {
524 if (!phi || !tgl || !qpt || !std::isfinite(qpt[
i]) || std::abs(qpt[
i]) < 1.e-12f) {
527 out.
set(
i, invalid, nSectors, sectorPhaseRad);
534 out.
set(
i, evaluate(track,
radius, bzKG), nSectors, sectorPhaseRad);
541 const float* phi,
const float* tgl,
const float* qpt,
542 const float* vx,
const float* vy,
const float* vz,
543 std::size_t
n,
float radius,
float bzKG,
int nSectors = 18,
float sectorPhaseRad = 0.f)
546 phi, tgl, qpt, vx, vy, vz,
n,
radius, bzKG, nSectors, sectorPhaseRad,
554 const float* phi,
const float* tgl,
const float* qpt,
555 const float* vx,
const float* vy,
const float* vz,
556 std::size_t
n,
float radius,
float bzKG,
int nSectors = 18,
float sectorPhaseRad = 0.f)
559 phi, tgl, qpt, vx, vy, vz,
n,
radius, bzKG, nSectors, sectorPhaseRad,
567 float snp,
float tgl,
float qpt,
int absCharge = 1)
573template <
typename Evaluator>
575 const float*
x,
const float*
alpha,
const float*
y,
const float*
z,
576 const float* snp,
const float* tgl,
const float* qpt,
577 std::size_t
n,
float radius,
float bzKG,
int nSectors,
float sectorPhaseRad, Evaluator&& evaluate)
581 for (std::size_t
i = 0;
i <
n; ++
i) {
582 if (!
x || !
alpha || !
y || !
z || !snp || !tgl || !qpt) {
585 out.
set(
i, invalid, nSectors, sectorPhaseRad);
589 out.
set(
i, evaluate(track,
radius, bzKG), nSectors, sectorPhaseRad);
596 const float*
x,
const float*
alpha,
const float*
y,
const float*
z,
597 const float* snp,
const float* tgl,
const float* qpt,
598 std::size_t
n,
float radius,
float bzKG,
int nSectors = 18,
float sectorPhaseRad = 0.f)
601 x,
alpha,
y,
z, snp, tgl, qpt,
n,
radius, bzKG, nSectors, sectorPhaseRad,
609 const float*
x,
const float*
alpha,
const float*
y,
const float*
z,
610 const float* snp,
const float* tgl,
const float* qpt,
611 std::size_t
n,
float radius,
float bzKG,
int nSectors = 18,
float sectorPhaseRad = 0.f)
614 x,
alpha,
y,
z, snp, tgl, qpt,
n,
radius, bzKG, nSectors, sectorPhaseRad,
622 std::size_t
n,
float radius,
float bzKG)
625 return std::move(batch.phiPos);
629 std::size_t
n,
float radius,
float bzKG,
int nSectors = 18,
630 float sectorPhaseRad = 0.f)
633 nSectors, sectorPhaseRad);
634 return std::move(batch.dSector);
644 const float* phi,
const float* tgl,
const float* qpt,
const float* vz,
645 std::size_t
n,
float radius,
float bzKG,
int nSectors = 18,
float sectorPhaseRad = 0.f)
648 nSectors, sectorPhaseRad);
649 return {std::move(batch.phiPos), std::move(batch.dSector)};
683 float bzKG = std::numeric_limits<float>::quiet_NaN();
792 status[
i] =
static_cast<int32_t
>(
r.status);
813 const float pt = 1.f / std::abs(qpt);
814 trajectory.push_back({p.x, p.y, p.z, pt * std::cos(p.phiMom), pt * std::sin(p.phiMom),
842 return std::numeric_limits<float>::quiet_NaN();
873 if (!p.valid || !std::isfinite(p.x) || !std::isfinite(p.y) || !std::isfinite(p.phiMom)) {
874 return std::numeric_limits<float>::quiet_NaN();
876 return std::sin(p.phiMom - std::atan2(p.y, p.x));
886 return p.valid && std::isfinite(p.z) && std::abs(p.z) <= cfg.
zMaxCm &&
887 std::isfinite(snp) && std::abs(snp) < cfg.
maxSnp;
894 return std::isfinite(snp) && std::abs(snp) >= cfg.
maxSnp;
906 radius = std::hypot(xyz[0], xyz[1]);
907 if (!std::isfinite(
radius) || !std::isfinite(track.getQ2Pt()) ||
908 std::abs(track.getQ2Pt()) < 1.e-12f) {
912 return radius < 1.e-5f || xyz[0] * pxyz[0] + xyz[1] * pxyz[1] >= 0.f;
919 if (!track.isValid() || !std::isfinite(bzKG) || !(
radius > 0.f)) {
924 if (!
state.valid()) {
932 const float c = std::abs(std::cos(p.phiMom - p.phiPos));
934 p.dsDr = std::sqrt(1.f + tgl * tgl) / std::max(
c, 1.e-6f);
935 p.valid = std::isfinite(p.dsDr);
942 if (!std::isfinite(seed.phi) || !std::isfinite(seed.tgl) || !std::isfinite(seed.qpt) ||
943 !std::isfinite(seed.bzKG) || std::abs(seed.qpt) < 1.e-12f) {
947 seed.phi, seed.tgl, seed.qpt, 0.f, 0.f, seed.vz),
966 const float phi = std::atan2(p.y, p.x);
969 const float localY = -p.x * std::sin(
alpha) + p.y * std::cos(
alpha);
971 const float edgeDistance = halfWidth - std::abs(localY);
979 if (edgeDistance < 0.f) {
987 }
else if (edgeDistance < guard) {
1004 std::vector<o2::recohelpers::TrackParametersAtRadius>* trajectory =
nullptr)
1006 TPCSectorEdgeResult out;
1008 trajectory->clear();
1010 float startRadius = 0.f;
1017 for (
int row = 0;
row < mapper.getNumberOfRows(); ++
row) {
1019 if (
r + 1.e-4f < startRadius) {
1021 trajectory->emplace_back();
1038 if (!out.nRowsCrossed) {
1046 std::vector<o2::recohelpers::TrackParametersAtRadius>* trajectory =
nullptr)
1048 if (!std::isfinite(seed.phi) || !std::isfinite(seed.tgl) || !std::isfinite(seed.qpt) ||
1049 !std::isfinite(seed.bzKG) || std::abs(seed.qpt) < 1.e-12f) {
1050 TPCSectorEdgeResult
r;
1055 seed.phi, seed.tgl, seed.qpt, 0.f, 0.f, seed.vz),
1056 seed.bzKG, cfg, trajectory);
1067 if (!(dr > 0.f) || !(
ds > 0.f) || !std::isfinite(
ds) || !std::isfinite(tgl) ||
1068 !(maxSnp > 0.f && maxSnp < 1.f)) {
1071 const float minRadialCos = std::sqrt(1.f - maxSnp * maxSnp);
1072 return ds <= 10.f * dr * std::sqrt(1.f + tgl * tgl) / minRadialCos;
1088 std::vector<o2::recohelpers::TrackParametersAtRadius>* trajectory =
nullptr)
1090 TPCSectorEdgeResult out;
1092 trajectory->clear();
1096 if (!prop->hasMagFieldSet()) {
1100 float startRadius = 0.f;
1102 !std::isfinite(cfg.maxSnp) || !(cfg.maxSnp > 0.f && cfg.maxSnp < 1.f)) {
1108 while (firstRow < mapper.getNumberOfRows() &&
1109 rowRadius(mapper, firstRow) + 1.e-4f < startRadius) {
1112 if (firstRow == mapper.getNumberOfRows()) {
1116 const float r0 =
rowRadius(mapper, firstRow);
1118 trajectory->resize(firstRow);
1129 const float qpt = inputTrack.getQ2Pt();
1130 const float pt = 1.f / std::abs(qpt);
1131 const int charge = qpt >= 0.f ? 1 : -1;
1137 path.setTimeNotNeeded();
1138 float previousPathCm = 0.f;
1139 float previousRadiusCm = r0;
1141 for (
int row = firstRow;
row < mapper.getNumberOfRows(); ++
row) {
1143 if (
row > firstRow) {
1149 if (!prop->propagateToR(track,
radius,
false, o2::base::Propagator::MAX_SIN_PHI,
1150 o2::base::Propagator::MAX_STEP,
1151 o2::base::Propagator::MatCorrType::USEMatCorrNONE, &
path)) {
1155 const float deltaPathCm =
path.getL() - previousPathCm;
1156 const float deltaRadiusCm =
radius - previousRadiusCm;
1161 previousPathCm =
path.getL();
1162 previousRadiusCm =
radius;
1165 const auto xyzg =
track.getXYZGlo();
1170 p.phiPos =
track.getPhiPos();
1171 p.phiMom =
track.getPhi();
1172 const float dphi =
p.phiMom -
p.phiPos;
1173 const float radialCos = std::cos(dphi);
1176 constexpr float radiusToleranceCm = 2.e-3f;
1177 const float actualRadius = std::hypot(
p.x,
p.y);
1178 if (!std::isfinite(actualRadius) || std::abs(actualRadius -
radius) > radiusToleranceCm ||
1179 !std::isfinite(radialCos)) {
1183 if (radialCos <= 0.f) {
1186 p.dsDr = std::sqrt(1.f +
track.getTgl() *
track.getTgl()) / radialCos;
1206 std::vector<o2::recohelpers::TrackParametersAtRadius>* trajectory =
nullptr)
1208 if (!std::isfinite(seed.phi) || !std::isfinite(seed.tgl) || !std::isfinite(seed.qpt) ||
1209 !std::isfinite(seed.bzKG) || std::abs(seed.qpt) < 1.e-12f) {
1210 TPCSectorEdgeResult
r;
1215 seed.phi, seed.tgl, seed.qpt, 0.f, 0.f, seed.vz),
1216 seed.bzKG, cfg, trajectory);
1227 std::vector<o2::recohelpers::TrackParametersAtRadius>* trajectory =
nullptr)
1229 TPCSectorEdgeResult out;
1231 trajectory->clear();
1233 float startRadius = 0.f;
1241 while (
first < mapper.getNumberOfRows()) {
1244 while (last + 1 < mapper.getNumberOfRows() && std::abs(
rowLengthRadial(mapper, last + 1) -
h) < 1.e-6f) {
1250 trajectory->emplace_back();
1266 bool stopAfterStack =
false;
1270 stopAfterStack =
true;
1278 float dphi =
p1.phiPos -
p0.phiPos;
1279 o2::math_utils::detail::bringToPMPi(dphi);
1280 const float dr = std::max(r1 - r0, 1.e-6f);
1281 const float dphiDr = dphi / dr, dzDr = (
p1.z -
p0.z) / dr;
1285 const float phi =
p0.phiPos +
f * dphi;
1287 p.x =
r * std::cos(phi);
1288 p.y =
r * std::sin(phi);
1291 p.phiMom =
phi + std::atan(
r * dphiDr);
1292 p.dsDr = std::sqrt(1.f + (
r * dphiDr) * (
r * dphiDr) + dzDr * dzDr);
1296 p.phiMom =
p0.phiMom;
1304 stopAfterStack =
true;
1310 if (stopAfterStack) {
1316 if (!out.nRowsCrossed) {
1324 std::vector<o2::recohelpers::TrackParametersAtRadius>* trajectory =
nullptr)
1326 if (!std::isfinite(seed.phi) || !std::isfinite(seed.tgl) || !std::isfinite(seed.qpt) ||
1327 !std::isfinite(seed.bzKG) || std::abs(seed.qpt) < 1.e-12f) {
1328 TPCSectorEdgeResult
r;
1333 seed.phi, seed.tgl, seed.qpt, 0.f, 0.f, seed.vz),
1334 seed.bzKG, cfg, trajectory);
1337template <
typename Evaluator>
1344 if (!phi || !tgl || !qpt) {
1345 for (std::size_t
i = 0;
i <
n; ++
i) {
1353 for (std::size_t
i = 0;
i <
n; ++
i) {
1358 seed.vz = vz ? vz[
i] : 0.f;
1360 out.
set(
i, evaluate(seed, cfg));
1370 [](
const TPCPrimaryTrackSeed& seed,
const TPCSectorEdgeConfig&
c) {
return sectorEdgeHelixRows(seed,
c); });
1378 [](
const TPCPrimaryTrackSeed& seed,
const TPCSectorEdgeConfig&
c) {
return sectorEdgeStackLinear(seed,
c); });
1386 [](
const TPCPrimaryTrackSeed& seed,
const TPCSectorEdgeConfig&
c) {
1396template <
typename Evaluator>
1398 const float*
x,
const float*
alpha,
const float*
y,
const float*
z,
1399 const float* snp,
const float* tgl,
const float* qpt,
1404 for (std::size_t
i = 0;
i <
n; ++
i) {
1405 if (!
x || !
alpha || !
y || !
z || !snp || !tgl || !qpt ||
1406 !std::isfinite(
x[
i]) || !std::isfinite(
alpha[
i]) || !std::isfinite(
y[
i]) ||
1407 !std::isfinite(
z[
i]) || !std::isfinite(snp[
i]) || !std::isfinite(tgl[
i]) ||
1408 !std::isfinite(qpt[
i]) || std::abs(qpt[
i]) < 1.e-12f || std::abs(snp[
i]) >= 1.f) {
1416 out.
set(
i, evaluate(track, bzKG, cfg));
1422 const float*
x,
const float*
alpha,
const float*
y,
const float*
z,
1423 const float* snp,
const float* tgl,
const float* qpt,
1426 return localSectorEdgeBatch(
x,
alpha,
y,
z, snp, tgl, qpt,
n, bzKG, cfg,
1433 const float*
x,
const float*
alpha,
const float*
y,
const float*
z,
1434 const float* snp,
const float* tgl,
const float* qpt,
1437 return localSectorEdgeBatch(
x,
alpha,
y,
z, snp, tgl, qpt,
n, bzKG, cfg,
1444 const float*
x,
const float*
alpha,
const float*
y,
const float*
z,
1445 const float* snp,
const float* tgl,
const float* qpt,
1448 return localSectorEdgeBatch(
x,
alpha,
y,
z, snp, tgl, qpt,
n, bzKG, cfg,
General auxilliary methods.
constexpr int p1()
constexpr to accelerate the coordinates changing
Class for time synchronization of RawReader instances.
GPUd() value_type estimateLTFast(o2 static GPUd() float estimateLTIncrement(const o2 PropagatorImpl * Instance(bool uninitialized=false)
int getNumberOfPadsInRowSector(int row) const
static Mapper & instance(const std::string mappingDir="")
const PadRegionInfo & getPadRegionInfo(const unsigned char region) const
int getNumberOfPadRegions() const
float getRadiusFirstRow() const
unsigned char getGlobalRowOffset() const
float getPadHeight() const
std::array< value_t, kNParams > params_t
std::array< value_t, 3 > dim3_t
GLfloat GLfloat GLfloat alpha
GLboolean GLboolean GLboolean b
GLsizei const GLchar *const * path
GLboolean GLboolean GLboolean GLboolean a
GLuint GLfloat GLfloat y0
GLdouble GLdouble GLdouble z
const bool const int TrackITSInternal< NLayers > & track
int angle2Sector(float phi)
float sector2Angle(int sect)
TrackParametersAtRadiusBatchResult localTrackParametersAtRadiusK0Batch(const float *x, const float *alpha, const float *y, const float *z, const float *snp, const float *tgl, const float *qpt, std::size_t n, float radius, float bzKG, int nSectors=18, float sectorPhaseRad=0.f)
Batch K0 transport for tracks supplied in local O2 parameterization.
float stateTgl(const TrackParametersAtRadius &state)
tan(lambda)=pz/pT of the propagated state, or NaN for an invalid state.
float phiAtRadius(const o2::track::TrackPar &track, float radius, float bzKG, o2::track::DirType dir=o2::track::DirType::DirOutward)
Backward-compatible scalar wrapper returning only the propagated position azimuth using K0.
TrackParametersAtRadiusBatchResult primaryTrackParametersAtRadiusBatch(const float *phi, const float *tgl, const float *qpt, const float *vx, const float *vy, const float *vz, std::size_t n, float radius, float bzKG, int nSectors, float sectorPhaseRad, Evaluator &&evaluate)
TrackParametersAtRadius getParametersAtRadiusK0(const o2::track::TrackPar &track, float radius, float bzKG, o2::track::DirType dir=o2::track::DirType::DirOutward)
K0 transport: O2 TrackPar propagation to a cylindrical radius in Bz, without material correction.
TrackParametersAtRadiusBatchResult localTrackParametersAtRadiusBatch(const float *x, const float *alpha, const float *y, const float *z, const float *snp, const float *tgl, const float *qpt, std::size_t n, float radius, float bzKG, int nSectors, float sectorPhaseRad, Evaluator &&evaluate)
bool extractGlobalState(const o2::track::TrackPar &track, o2::track::TrackPar::dim3_t &xyz, o2::track::TrackPar::dim3_t &pxyz)
Extract finite global position and momentum from an O2 TrackPar.
float primaryDSectorAtRadius(float phi, float tgl, float qpt, float radius, float bzKG, int nSectors=18, float vz=0.f, float sectorPhaseRad=0.f)
Fractional sector coordinate at radius for the reduced primary-like parameterization,...
float statePhiMom(const TrackParametersAtRadius &state)
Global azimuth of the propagated momentum, atan2(py,px), or NaN for an invalid state.
TrackParametersStatus
Status returned by the cylindrical-radius track-parameter evaluators.
float stateDSector(const TrackParametersAtRadius &state, int nSectors=18, float sectorPhaseRad=0.f)
dSector() evaluated from the propagated global position azimuth.
TrackParametersAtRadius getParametersAtRadiusH(const o2::track::TrackPar &track, float radius, float bzKG, o2::track::DirType dir=o2::track::DirType::DirOutward)
H transport: analytic helix intersection with a cylindrical radius in uniform Bz.
float statePhiPos(const TrackParametersAtRadius &state)
Global azimuth of the propagated position, atan2(y,x), or NaN for an invalid state.
std::vector< float > primaryDSectorAtRadiusBatch(const float *phi, const float *tgl, const float *qpt, const float *vz, std::size_t n, float radius, float bzKG, int nSectors=18, float sectorPhaseRad=0.f)
TrackParametersAtRadiusBatchResult primaryTrackParametersAtRadiusK0Batch(const float *phi, const float *tgl, const float *qpt, const float *vx, const float *vy, const float *vz, std::size_t n, float radius, float bzKG, int nSectors=18, float sectorPhaseRad=0.f)
Batch K0 transport for reduced primary-like inputs.
o2::track::TrackPar makeTrackParFromPrimaryApproximation(float phi, float tgl, float qpt, float vx=0.f, float vy=0.f, float vz=0.f)
Build an O2 TrackPar from a reduced primary-like state.
std::vector< float > primaryPhiAtRadiusBatch(const float *phi, const float *tgl, const float *qpt, const float *vz, std::size_t n, float radius, float bzKG)
Backward-compatible batch wrappers retained for existing commissioning notebooks/tests.
TrackParametersAtRadiusBatchResult primaryTrackParametersAtRadiusHBatch(const float *phi, const float *tgl, const float *qpt, const float *vx, const float *vy, const float *vz, std::size_t n, float radius, float bzKG, int nSectors=18, float sectorPhaseRad=0.f)
Batch H transport for reduced primary-like inputs.
o2::track::TrackPar makeTrackParFromLocalParameters(float x, float alpha, float y, float z, float snp, float tgl, float qpt, int absCharge=1)
Build an O2 TrackPar from the standard local O2 track parameterization.
TrackParametersAtRadiusBatchResult localTrackParametersAtRadiusHBatch(const float *x, const float *alpha, const float *y, const float *z, const float *snp, const float *tgl, const float *qpt, std::size_t n, float radius, float bzKG, int nSectors=18, float sectorPhaseRad=0.f)
Batch H transport for tracks supplied in local O2 parameterization.
float dSector(float phi, int nSectors=18, float sectorPhaseRad=0.f)
Fractional azimuthal position inside a periodic sector pattern.
bool directionMatches(o2::track::DirType dir, float drds)
Check whether the radial derivative is compatible with the requested propagation direction.
o2::track::TrackPar makePrimaryTrackPar(float phi, float tgl, float qpt, float vz=0.f)
Backward-compatible reduced-primary constructor used by existing commissioning code.
float primaryPhiAtRadius(float phi, float tgl, float qpt, float radius, float bzKG, float vz=0.f)
Position azimuth at radius for the reduced primary-like parameterization, evaluated with K0.
PrimaryTrackGeometryBatchResult primaryTrackGeometryAtRadiusBatch(const float *phi, const float *tgl, const float *qpt, const float *vz, std::size_t n, float radius, float bzKG, int nSectors=18, float sectorPhaseRad=0.f)
float dSectorAtRadius(const o2::track::TrackPar &track, float radius, float bzKG, int nSectors=18, o2::track::DirType dir=o2::track::DirType::DirOutward, float sectorPhaseRad=0.f)
Backward-compatible scalar wrapper returning only the propagated fractional sector coordinate using K...
TPCSectorEdgeResult sectorEdgeO2PropagatorRows(const o2::track::TrackPar &inputTrack, float bzKG, const TPCSectorEdgeConfig &cfg={}, std::vector< o2::recohelpers::TrackParametersAtRadius > *trajectory=nullptr)
K row evaluator: O2 Propagator traversal of TPC row radii without material correction.
float trajectoryRadialSnp(const TrajectoryPoint &p)
Radial-frame sin(phiMom-phiPos); independent of the O2 TrackPar alpha rotation.
TPCSectorEdgeBatchResult sectorEdgeStackLinearBatch(const float *phi, const float *tgl, const float *qpt, const float *vz, std::size_t n, float bzKG, const TPCSectorEdgeConfig &cfg={})
Batch wrapper for the stack-linear L TPC row evaluator.
TPCSectorEdgeBatchResult localSectorEdgeO2PropagatorRowsBatch(const float *x, const float *alpha, const float *y, const float *z, const float *snp, const float *tgl, const float *qpt, std::size_t n, float bzKG, const TPCSectorEdgeConfig &cfg={})
TPCSectorEdgeBatchResult sectorEdgeBatch(const float *phi, const float *tgl, const float *qpt, const float *vz, std::size_t n, float bzKG, const TPCSectorEdgeConfig &cfg, Evaluator &&evaluate)
TPCSectorEdgeResult sectorEdgeHelixRows(const o2::track::TrackPar &track, float bzKG, const TPCSectorEdgeConfig &cfg={}, std::vector< o2::recohelpers::TrackParametersAtRadius > *trajectory=nullptr)
H row evaluator: analytic helix sampled at the current Mapper row radii.
bool rowWithinAcceptance(const TrajectoryPoint &p, const TPCSectorEdgeConfig &cfg)
True when a valid row-centre trajectory point satisfies the configured z and snp acceptance.
void setMaskBit(std::array< uint32_t, 5 > &mask, int row)
Set one of the 152 TPC row bits in the five-word row mask.
float trajectoryLocalSnp(const TrajectoryPoint &p)
Backward-compatible internal spelling; use trajectoryRadialSnp for new code.
TPCSectorEdgeBatchResult localSectorEdgeStackLinearBatch(const float *x, const float *alpha, const float *y, const float *z, const float *snp, const float *tgl, const float *qpt, std::size_t n, float bzKG, const TPCSectorEdgeConfig &cfg={})
bool plausibleFirstOutwardStep(float dr, float ds, float tgl, float maxSnp)
Conservative path-continuity guard against a later outward orbit.
TPCSectorEdgeBatchResult sectorEdgeO2PropagatorRowsBatch(const float *phi, const float *tgl, const float *qpt, const float *vz, std::size_t n, float bzKG, const TPCSectorEdgeConfig &cfg={})
Batch wrapper for the O2 Propagator K TPC row evaluator, without material correction.
TPCSectorEdgeResult sectorEdgeStackLinear(const o2::track::TrackPar &track, float bzKG, const TPCSectorEdgeConfig &cfg={}, std::vector< o2::recohelpers::TrackParametersAtRadius > *trajectory=nullptr)
L row evaluator: stack-local linear approximation to the analytic helix.
float rowLengthRadial(const o2::tpc::Mapper &mapper, int row)
Radial row thickness, taken from the Mapper pad height [cm].
SectorEdgeStatus
Status returned by the TPC row/sector-edge evaluators.
float rowActiveHalfWidth(const o2::tpc::Mapper &mapper, int row)
Active half-width of one TPC row in local-y from Mapper pad count and pad width [cm].
TPCSectorEdgeBatchResult localSectorEdgeBatch(const float *x, const float *alpha, const float *y, const float *z, const float *snp, const float *tgl, const float *qpt, std::size_t n, float bzKG, const TPCSectorEdgeConfig &cfg, Evaluator &&evaluate)
Evaluate row acceptance for a batch of complete O2 local 5D track states. Input arrays are x,...
bool reachedMaxSnp(const TrajectoryPoint &p, const TPCSectorEdgeConfig &cfg)
True when the radial-frame inclination reaches the configured stopping boundary.
TPCSectorEdgeBatchResult sectorEdgeHelixRowsBatch(const float *phi, const float *tgl, const float *qpt, const float *vz, std::size_t n, float bzKG, const TPCSectorEdgeConfig &cfg={})
Batch wrapper for the analytic H TPC row evaluator.
TrajectoryPoint primaryHelixAtRadius(const TPCPrimaryTrackSeed &seed, float radius)
Legacy reduced-primary adapter to the same complete-track H implementation.
bool trackOutwardReference(const o2::track::TrackPar &track, float &radius)
Validate the complete input state and report its global reference radius. An outward-only row query d...
TrajectoryPoint helixAtRadius(const o2::track::TrackPar &track, float radius, float bzKG)
One TPC row trajectory sample from a complete O2 local five-parameter track.
TPCSectorEdgeBatchResult localSectorEdgeHelixRowsBatch(const float *x, const float *alpha, const float *y, const float *z, const float *snp, const float *tgl, const float *qpt, std::size_t n, float bzKG, const TPCSectorEdgeConfig &cfg={})
void appendTrajectoryState(std::vector< o2::recohelpers::TrackParametersAtRadius > &trajectory, const TrajectoryPoint &p, float qpt, float tgl)
Debug-only row state; trajectory[row] is the state at that sampled TPC row. Append even the first sta...
float rowRadius(const o2::tpc::Mapper &mapper, int row)
Current sampled TPC row radius [cm]; F6 physical pad-centre correction remains pending.
int regionForRow(const o2::tpc::Mapper &mapper, int row)
Return the Mapper pad-region index containing a global TPC row, or -1 if none.
void accumulateRow(const o2::tpc::Mapper &mapper, int row, const TrajectoryPoint &p, float rowLength, const TPCSectorEdgeConfig &cfg, TPCSectorEdgeResult &out)
Apply acceptance and classify one crossed row as Dead, Excluded, or Available.
Legacy compact batch result containing only position azimuth and fractional sector coordinate.
std::vector< float > dSector
Structure-of-arrays result for batch cylindrical-radius propagation.
std::vector< float > phiPos
void resize(std::size_t n)
std::vector< int32_t > status
void set(std::size_t i, const TrackParametersAtRadius &state, int nSectors, float sectorPhaseRad)
std::vector< float > phiMom
std::vector< float > dSector
Global track state evaluated at a requested cylindrical radius.
TrackParametersStatus status
Reduced primary-track seed used by the TPC row evaluators.
Structure-of-arrays batch result for the TPC row/sector-edge evaluators.
std::vector< int16_t > nRowsDead
std::vector< float > lengthExcludedCm
std::vector< int32_t > status
std::vector< int16_t > nRowsExcluded
std::vector< int16_t > nRowsAvailable
std::vector< float > lengthCrossedCm
std::vector< float > lengthDeadCm
std::vector< float > maxRadiusCm
void resize(std::size_t n)
std::vector< float > lengthAvailableCm
void set(std::size_t i, const TPCSectorEdgeResult &r)
std::vector< int16_t > nRowsCrossed
Configuration for TPC row acceptance and sector-edge classification.
Result of one TPC row/sector-edge evaluation.
std::array< uint32_t, 5 > crossedMask
std::array< uint32_t, 5 > excludedMask
std::array< uint32_t, 5 > deadMask
std::array< uint32_t, 5 > availableMask
Internal global trajectory sample at one TPC row-centre radius.