43 const fvec qp0,
const bool initParams)
85 T.Tx() = (x1 - x0) * dzi;
86 T.Ty() = (y1 - y0) * dzi;
95 const auto& sta0 =
fSetup.GetActiveLayer(ista0);
96 T.ResetErrors(1., 1., .1, .1, 1., (sta0.IsTimeMeasured() ? hit0.
dT2() : 1.e6), 1.e6);
98 T.NdfTime() = sta0.IsTimeMeasured() ?
fvec(-1.) :
fvec(-2.);
100 T.C00() = hit0.
dX2();
101 T.C10() = hit0.
dXY();
102 T.C11() = hit0.
dY2();
110 fld.Set(fldB2, fldB1, fldB0);
112 for (
int i = iFirstHit + step; step * i <= step * iLastHit; i += step) {
115 const auto& sta =
fSetup.GetActiveLayer(ista);
119 auto radThick =
fSetup.GetMaterial(ista).GetThicknessX0(T.X(), T.Y());
125 fldB2 =
fField.GetFieldValue(ista, hit.
X(), hit.
Y());
126 fld.Set(fldB2, fldB1, fldB0);
134 const bool initParams)
137 for (
int i = 0; i < 1; i++) {
163 const int ista0 = hit0.
Station();
164 const int ista1 = hit1.
Station();
165 const int ista2 = hit2.
Station();
180 fld.Set(fldB2, fldB1, fldB0);
182 int ista = ista2 + 2 * step;
184 if (ista2 ==
frWData->CurrentIteration()->GetFirstStationIndex()) ista = ista2 + step;
186 const fscal pickGather =
frWData->CurrentIteration()->GetPickGather();
187 const fvec pickGather2 = pickGather * pickGather;
188 const fvec maxDZ =
frWData->CurrentIteration()->GetMaxDZ();
189 for (; (ista <
fParameters.GetNstationsActive()) && (ista >= 0); ista += step) {
191 const auto& sta =
fSetup.GetActiveLayer(ista);
200 const auto& grid =
frWData->Grid(ista);
203 (
sqrt(pickGather * tr.C11()) + grid.GetMaxRangeY() + maxDZ *
kf::utils::fabs(tr.Ty()))[0]);
205 if (
fParameters.GetConfig().DevIgnoreHitSearchAreas()) {
213 if (
frWData->IsHitSuppressed(ih)) {
218 if (sta.IsTimeMeasured() && tr.NdfTime()[0] > -2.) {
219 fscal dt = hit.
T() - tr.Time()[0];
220 if (fabs(dt) >
sqrt(25. * tr.C55()[0]) + hit.
RangeT())
continue;
239 fscal d2 = d_x * d_x + d_y * d_y;
240 if (d2 > r2_best)
continue;
241 fscal dxm_est =
sqrt(pickGather2 * C00)[0] + grid.GetMaxRangeX();
242 if (fabs(d_x) > dxm_est)
continue;
244 fscal dym_est =
sqrt(pickGather2 * C11)[0] + grid.GetMaxRangeY();
245 if (fabs(d_y) > dym_est)
continue;
251 if (iHit_best < 0)
break;
255 newHits.push_back(iHit_best);
259 auto radThick =
fSetup.GetMaterial(ista).GetThicknessX0(tr.X(), tr.Y());
265 fldB2 =
fField.GetFieldValue(ista, hit.
X(), hit.
Y());
266 fld.Set(fldB2, fldB1, fldB0);
270 const unsigned int NOldHits = t.
NofHits();
271 const unsigned int NNewHits = newHits.size();
275 for (
int i = NOldHits - 1; i >= 0; i--) {
278 for (
unsigned int i = 0, ii = NNewHits - 1; i < NNewHits; i++, ii--) {
283 for (
unsigned int i = 0; i < newHits.size(); i++) {
284 t.
RefHits()[NOldHits + i] = newHits[i];
310 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.
A container for all external parameters of the CA tracking algorithm.
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
const cbm::algo::kf::Field< fvec > & fField
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.
Magnetic field region, corresponding to a hit triplet.
Magnetic flux density vector.
void EnergyLossCorrection(DataT radThick, FitDirection direction)
void SetMask(const DataTmask &m)
void Extrapolate(DataT z, const kf::FieldRegion< DataT > &F)
void MultipleScattering(DataT radThick, DataT tx0, DataT ty0, DataT qp0)
apply multiple scattering correction to the track with the given Qp0
void SetParticleMass(DataT mass)
set particle mass for the fit
kf::TrackParam< DataT > & Tr()
Linearization_t & Linearization()
void SetTrack(const kf::TrackParam< T > &t)
std::pair< DataT, DataT > ExtrapolateLineXdX2(DataT z_out) const
std::pair< DataT, DataT > ExtrapolateLineYdY2(DataT z_out) const
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.
TrackParam< fvec > TrackParamV