Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions RecoTracker/MkFitCMS/interface/LayerNumberConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ namespace mkfit {
bool isPhase2() const { return lo_ == TkLayout::phase2; }
int convertLayerNumber(int det, int lay, bool useMatched, int isStereo, bool posZ) const {
if (lo_ == TkLayout::phase2) {
// For TOB / TEC stereo is used for P in PS modules so we move stereo before the other
// one. The same is done for 2S layers (well, TEC is mixed PS / 2S anyway).
if (det == 1)
return lay - 1;
if (det == 2)
return 16 + lay - 1 + (posZ ? 0 : 22);
if (det == 5)
return 4 + (2 * (lay - 1)) + isStereo;
return 4 + (2 * (lay - 1)) + 1 - isStereo;
if (det == 4)
return 16 + 12 + (2 * (lay - 1)) + isStereo + (posZ ? 0 : 22);
return 16 + 12 + (2 * (lay - 1)) + 1 - isStereo + (posZ ? 0 : 22);
throw std::runtime_error("bad subDet");
}

Expand Down
2 changes: 2 additions & 0 deletions RecoTracker/MkFitCore/interface/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ namespace mkfit {
// Config for propagation - could/should enter into PropagationFlags?!
constexpr int Niter = 5;
constexpr bool useTrigApprox = true;
// for prop to plane getS step
constexpr int nSStepsInProp2Plane = 2;
// Move to Config.cc, make a command-line option in mkFit.cc to ease profiling comparisons.
// If making this constexpr again, also fix ifs using it in MkBuilder.cc and MkFinder.cc.
// constexpr bool usePropToPlane = true;
Expand Down
9 changes: 9 additions & 0 deletions RecoTracker/MkFitCore/src/KalmanUtilsMPlex.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ namespace mkfit {

enum KalmanFilterOperation { KFO_Calculate_Chi2 = 1, KFO_Update_Params = 2, KFO_Local_Cov = 4 };

inline void kalmanCheckChargeFlip(MPlexLV& outPar, MPlexQI& Chg, int N_proc) {
for (int n = 0; n < NN; ++n) {
if (n < N_proc && outPar.At(n, 3, 0) < 0) {
Chg.At(n, 0, 0) = -Chg.At(n, 0, 0);
outPar.At(n, 3, 0) = -outPar.At(n, 3, 0);
}
}
}

//------------------------------------------------------------------------------

void kalmanUpdate(const MPlexLS& psErr,
Expand Down
33 changes: 23 additions & 10 deletions RecoTracker/MkFitCore/src/MkBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1381,19 +1381,32 @@ namespace mkfit {
}
#endif

// input tracks
mkfndr->bkFitInputTracks(eoccs, icand, end);

// fit tracks back to first layer
mkfndr->bkFitFitTracks(m_job->m_event_of_hits, st_par, end - icand, chi_debug);
if (Config::usePropToPlane) {
// input tracks
mkfndr->bkFitInputTracks(eoccs, icand, end);
// fit tracks back to first layer
mkfndr->bkFitFitTracksProp2Plane(m_job->m_event_of_hits, st_par, end - icand, chi_debug);
// tracks are put back into correcponding TrackCand when finsihed in the above function
// now move one last time to PCA
if (prop_config.backward_fit_to_pca) {
mkfndr->bkFitInputTracks(eoccs, icand, end);
mkfndr->bkFitPropTracksToPCA(end - icand);
mkfndr->bkFitOutputTracks(eoccs, icand, end, prop_config.backward_fit_to_pca);
}
} else {
// input tracks
mkfndr->bkFitInputTracks(eoccs, icand, end);
// fit tracks back to first layer
mkfndr->bkFitFitTracks(m_job->m_event_of_hits, st_par, end - icand, chi_debug);

// now move one last time to PCA
if (prop_config.backward_fit_to_pca) {
mkfndr->bkFitPropTracksToPCA(end - icand);
}

// now move one last time to PCA
if (prop_config.backward_fit_to_pca) {
mkfndr->bkFitPropTracksToPCA(end - icand);
mkfndr->bkFitOutputTracks(eoccs, icand, end, prop_config.backward_fit_to_pca);
}

mkfndr->bkFitOutputTracks(eoccs, icand, end, prop_config.backward_fit_to_pca);

#ifdef DEBUG_FINAL_FIT
dprintf("Post Final fit for %d - %d\n", icand, end);
for (int i = icand; i < end; ++i) {
Expand Down
Loading