28 , fSetup(fParameters.GetActiveSetup())
42 const fvec qp0,
const bool initParams)
87 T.Tx() = (x1 - x0) * dzi;
88 T.Ty() = (y1 - y0) * dzi;
97 T.ResetErrors(1., 1., .1, .1, 1., (sta0.
timeInfo ? hit0.
dT2() : 1.e6), 1.e6);
101 T.C00() = hit0.
dX2();
102 T.C10() = hit0.
dXY();
103 T.C11() = hit0.
dY2();
115 fld.
Set(fldB2, fldZ2, fldB1, fldZ1, fldB0, fldZ0);
117 for (
int i = iFirstHit + step; step * i <= step * iLastHit; i += step) {
124 auto radThick =
fSetup.GetMaterial(ista).GetThicknessX0(T.X(), T.Y());
134 fld.Set(fldB2, fldZ2, fldB1, fldZ1, fldB0, fldZ0);
142 const bool initParams)
145 for (
int i = 0; i < 1; i++) {
171 const int ista0 = hit0.
Station();
172 const int ista1 = hit1.
Station();
173 const int ista2 = hit2.
Station();
197 fld.
Set(fldB2, fldZ2, fldB1, fldZ1, fldB0, fldZ0);
199 int ista = ista2 + 2 * step;
204 const fvec pickGather2 = pickGather * pickGather;
206 for (; (ista <
fParameters.GetNstationsActive()) && (ista >= 0); ista += step) {
237 if (fabs(dt) >
sqrt(25. * tr.
C55()[0]) + hit.
RangeT())
continue;
256 fscal d2 = d_x * d_x + d_y * d_y;
257 if (d2 > r2_best)
continue;
258 fscal dxm_est =
sqrt(pickGather2 * C00)[0] + grid.GetMaxRangeX();
259 if (fabs(d_x) > dxm_est)
continue;
261 fscal dym_est =
sqrt(pickGather2 * C11)[0] + grid.GetMaxRangeY();
262 if (fabs(d_y) > dym_est)
continue;
268 if (iHit_best < 0)
break;
272 newHits.push_back(iHit_best);
276 auto radThick =
fSetup.GetMaterial(ista).GetThicknessX0(tr.
X(), tr.
Y());
286 fld.Set(fldB2, fldZ2, fldB1, fldZ1, fldB0, fldZ0);
290 const unsigned int NOldHits = t.
NofHits();
291 const unsigned int NNewHits = newHits.size();
295 for (
int i = NOldHits - 1; i >= 0; i--) {
298 for (
unsigned int i = 0, ii = NNewHits - 1; i < NNewHits; i++, ii--) {
303 for (
unsigned int i = 0; i < newHits.size(); i++) {
304 t.
RefHits()[NOldHits + i] = newHits[i];
330 return T.GetChiSq()[0];
Macros for the CA tracking algorithm.
#define CBMCA_DEBUG_ASSERT(v)
source file for the ca::Track class
Compile-time constants definition for the CA tracking algorithm.
static vector< vector< QAHit > > hits
friend fvec sqrt(const fvec &a)
Track fit utilities for the CA tracking based on the Kalman filter.
Vector< ca::HitIndex_t > & RefHits()
const Vector< ca::HitIndex_t > & Hits() const
Class for accessing objects in the 2D area that are stored in ca::Grid.
bool GetNextObjectId(ca::HitIndex_t &objectId)
look up the next object id in the requested area
void DoLoopOverEntireGrid()
debug mode: loop over the entire GetEntries() vector ignoring the search area
ca::Hit class describes a generic hit for the CA tracker
fscal Z() const
Get the Z coordinate.
HitKeyIndex_t BackKey() const
Get the back key index.
fscal dT2() const
Get the uncertainty of time.
fscal dXY() const
Get the X/Y covariance.
fscal dX2() const
Get the uncertainty of X coordinate.
fscal Y() const
Get the Y coordinate.
fscal RangeT() const
Get the +/- range of uncertainty of time.
HitKeyIndex_t FrontKey() const
Get the front key index.
fscal T() const
Get the time.
fscal X() const
Get the X coordinate.
int Station() const
Get the station index.
fscal dY2() const
Get the uncertainty of Y coordinate.
float GetPickGather() const
Gets size of region [TODO: units??] to attach new hits to the created track.
float GetMaxDZ() const
Gets correction for accounting overlaping and iff z.
int GetFirstStationIndex() const
Gets station index of the first station used in tracking.
A container for all external parameters of the CA tracking algorithm.
DataT fZ
z position of station [cm]
int timeInfo
flag: if time information can be used
kf::FieldSlice< DataT > fieldSlice
Magnetic field near the station.
void FitBranch(const ca::Branch &t, TrackParamV &T, const kf::FitDirection direction, const fvec qp0, const bool initParams=true)
like BranchFitterFast but more precise
void FindMoreHits(ca::Branch &t, TrackParamV &T, const kf::FitDirection direction, const fvec qp0)
TrackExtender(const ca::Parameters< fvec > &pars, const fscal mass)
Default constructor.
void FitBranchFast(const ca::Branch &t, TrackParamV &T, const kf::FitDirection direction, const fvec qp0, const bool initParams=true)
const Parameters< fvec > & fParameters
Object of Framework parameters class.
~TrackExtender()
Destructor.
fscal ExtendBranch(ca::Branch &t, WindowData &wData)
Try to extrapolate and find additional hits on other stations.
fscal fDefaultMass
mass of the propagated particle [GeV/c2]
const cbm::algo::kf::Setup< fvec > & fSetup
void enlarge(std::size_t count, Tinput... value)
Enlarges the vector to the new size.
void reserve(std::size_t count)
Reserves a new size for the vector.
Container for internal data, processed on a single time window.
ca::Grid & Grid(int iStation)
Gets grid for station index.
const Iteration * CurrentIteration() const
Accesses current iteration.
uint8_t IsHitSuppressed(int iHit) const
Gets hit suppression flag.
unsigned char IsHitKeyUsed(HitKeyIndex_t iKey) const
Hit key flag: if this hit or cluster was already used.
ca::Hit & Hit(int iHit)
Gets hit by index.
Magnetic field region, corresponding to a hit triplet.
constexpr FieldValue< T > GetFieldValue(const T &x, const T &y) const
Gets field value at a point on the transverse plane.
Magnetic flux density vector.
void Set(const I &bx, const I &by, const I &bz)
Constructor from components.
void Extrapolate(DataT z, const kf::FieldRegion< DataT > &F)
void SetMask(const DataTmask &m)
std::pair< DataT, DataT > ExtrapolateLineYdY2(DataT z_out) const
kf::TrackParam< DataT > & Tr()
void MultipleScattering(DataT radThick, DataT tx0, DataT ty0, DataT qp0)
apply multiple scattering correction to the track with the given Qp0
void EnergyLossCorrection(DataT radThick, FitDirection direction)
std::pair< DataT, DataT > ExtrapolateLineXdX2(DataT z_out) const
void SetParticleMass(DataT mass)
set particle mass for the fit
void SetTrack(const kf::TrackParam< T > &t)
T C00() const
Individual getters for covariance matrix elements.
T NdfTime() const
Gets NDF of time measurements.
T Tx() const
Gets slope along x-axis.
T X() const
Gets x position [cm].
T Y() const
Gets y position [cm].
T Time() const
Gets time [ns].
T Ty() const
Gets slope along y-axis.
void FilterHit(kf::TrackKalmanFilter< T > &fit, const ca::Hit &hit, const kf::utils::masktype< T > &timeInfo)
TODO: SZh 8.11.2022: add selection of parameterisation.
class cbm::algo::ca::WindowData _fvecalignment
unsigned int HitIndex_t
Index of ca::Hit.