#ifndef FitBase_H #define FitBase_H /// Common functions which is used to implement FitFunctional in every KF-approach. #include #include "FitFunctional.h" #include "tsc.h" class FitBase: public virtual FitFunctional{ // base class for all approaches public: /// Fit tracks void Fit( TrackV &t, Station vStations[], int NStations ) const; }; inline void FitBase::Fit( TrackV &t, Station vStations[], int nStations ) const { // upstream GuessVec( t, vStations, nStations ); // downstream FieldRegion f; Fvec_t z0,z1,z2, dz; FieldVector H0, H1, H2; Fvec_t qp0 = t.T[4]; Int_t i = nStations-1; HitV *h = &t.vHits[i]; FilterFirst( t, *h, vStations[i] ); AddMaterial( t, vStations[ i ], qp0 ); z1 = vStations[ i ].z; vStations[i].Map.GetField(t.T[0],t.T[1], H1); H1.Combine( h->H, h->w ); z2 = vStations[ i-2 ].z; dz = z2-z1; vStations[ i-2 ].Map.GetField(t.T[0]+t.T[2]*dz,t.T[1]+t.T[3]*dz,H2); h = &t.vHits[i-2]; H2.Combine( h->H, h->w ); const int iFirstStation = 0; for( --i; i>=iFirstStation; i-- ){ h = &t.vHits[i]; Station &st = vStations[i]; z0 = st.z; dz = (z1-z0); st.Map.GetField(t.T[0]-t.T[2]*dz,t.T[1]-t.T[3]*dz,H0); H0.Combine( h->H, h->w ); f.Set( H0, z0, H1, z1, H2, z2); if ( i == iFirstStation ) t.f = f; // ExtrapolateALight( t.T, t.C, st.zhit, qp0, f ); // AddMaterial( t, st, qp0 ); if ( i == 1 ) { // 2nd MVD ExtrapolateWithMaterial( t, st.zhit, qp0, f, st, true ); // add pipe } else ExtrapolateWithMaterial( t, st.zhit, qp0, f, st ); Fvec_t u = h->x*st.UInfo.cos_phi + h->y*st.UInfo.sin_phi; Fvec_t v = h->x*st.VInfo.cos_phi + h->y*st.VInfo.sin_phi; Filter( t, st.UInfo, u, h->w ); Filter( t, st.VInfo, v, h->w ); H2 = H1; z2 = z1; H1 = H0; z1 = z0; } } #endif