From 14c62a2014962a886ff3739e5f50cd3624e80b20 Mon Sep 17 00:00:00 2001 From: "s.zharko@gsi.de" <s.zharko@gsi.de> Date: Tue, 4 Oct 2022 17:16:06 +0200 Subject: [PATCH] L1: HitErrors preprocessor macro replaced with constant expression --- reco/L1/L1Algo/L1Algo.h | 7 ------- reco/L1/L1Algo/L1TrackExtender.cxx | 26 +++++++++----------------- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h index 86f1b1fc20..2853070b7c 100644 --- a/reco/L1/L1Algo/L1Algo.h +++ b/reco/L1/L1Algo/L1Algo.h @@ -19,17 +19,10 @@ class L1AlgoDraw; //#define XXX // time debug //#define COUNTERS // diff counters (hits, doublets, ... ) -// =====>dispatched<===== // #define MERGE_CLONES - -// =====>dispatched<===== // #define HitErrors //#define GLOBAL //#define mCBM -// =====>dispatched<===== // #define LAST_ITERATION kAllSecIter #define FIND_GAPED_TRACKS // use triplets with gaps -// =====>dispatched<===== // #define USE_RL_TABLE -//#endif - #include <array> #include <iomanip> diff --git a/reco/L1/L1Algo/L1TrackExtender.cxx b/reco/L1/L1Algo/L1TrackExtender.cxx index bfd01b3a60..df3b68aa7a 100644 --- a/reco/L1/L1Algo/L1TrackExtender.cxx +++ b/reco/L1/L1Algo/L1TrackExtender.cxx @@ -88,11 +88,11 @@ void L1Algo::BranchFitterFast(const L1Branch& t, L1TrackPar& T, const bool dir, T.C10 = sta0.XYInfo.C10; T.C11 = sta0.XYInfo.C11; -#ifdef HitErrors - T.C00 = hit0.dx * hit0.dx; - T.C10 = hit0.dxy; - T.C11 = hit0.dy * hit0.dy; -#endif + if constexpr (L1Constants::control::kIfSaveHitErrorsInTrackExtender) { + T.C00 = hit0.dx * hit0.dx; + T.C10 = hit0.dxy; + T.C11 = hit0.dy * hit0.dy; + } T.C20 = T.C21 = 0; T.C30 = T.C31 = T.C32 = 0; @@ -146,16 +146,12 @@ void L1Algo::BranchFitterFast(const L1Branch& t, L1TrackPar& T, const bool dir, L1UMeasurementInfo info = sta.frontInfo; -#ifdef HitErrors - info.sigma2 = hit.du * hit.du; -#endif + if constexpr (L1Constants::control::kIfSaveHitErrorsInTrackExtender) { info.sigma2 = hit.du * hit.du; } L1Filter(T, info, u); info = sta.backInfo; -#ifdef HitErrors - info.sigma2 = hit.dv * hit.dv; -#endif + if constexpr (L1Constants::control::kIfSaveHitErrorsInTrackExtender) { info.sigma2 = hit.dv * hit.dv; } L1Filter(T, info, v); FilterTime(T, hit.t, hit.dt); @@ -325,16 +321,12 @@ void L1Algo::FindMoreHits(L1Branch& t, L1TrackPar& T, const bool dir, L1UMeasurementInfo info = sta.frontInfo; -#ifdef HitErrors - info.sigma2 = hit.du * hit.du; -#endif + if constexpr (L1Constants::control::kIfSaveHitErrorsInTrackExtender) { info.sigma2 = hit.du * hit.du; } L1Filter(T, info, u); info = sta.backInfo; -#ifdef HitErrors - info.sigma2 = hit.dv * hit.dv; -#endif + if constexpr (L1Constants::control::kIfSaveHitErrorsInTrackExtender) { info.sigma2 = hit.dv * hit.dv; } L1Filter(T, info, v); FilterTime(T, hit.t, hit.dt); -- GitLab