Skip to content

Commit

Permalink
Fix TimeGain calibration application: limit to fit range
Browse files Browse the repository at this point in the history
  • Loading branch information
wiechula committed Nov 13, 2023
1 parent 692140b commit 0ce6748
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
namespace o2::tpc
{

namespace conf_dedx_corr
{
GPUconstexpr() float TglScale[4] = {1.9, 1.5, 1.22, 1.02}; ///< Max Tgl values for each ROC type
}

class CalibdEdxCorrection
{
public:
Expand All @@ -54,7 +59,8 @@ class CalibdEdxCorrection
return 1;
}

tgl = o2::gpu::CAMath::Abs(tgl);
// limit to the fit range in the respective region
tgl = o2::gpu::CAMath::Min(conf_dedx_corr::TglScale[stack.type], o2::gpu::CAMath::Abs(tgl));
auto p = mParams[stackIndex(stack, charge)];
float result = p[0];
// Tgl part
Expand Down
7 changes: 3 additions & 4 deletions Detectors/TPC/calibration/include/TPCCalibration/CalibdEdx.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,10 @@ class CalibdEdx
/// Save the histograms to a TTree.
void writeTTree(std::string_view fileName) const;

constexpr static float MipScale = 1.0 / 50.0; ///< Inverse of target dE/dx value for MIPs
constexpr static std::array<float, 4> TglScale{1.9, 1.5, 1.22, 1.02}; ///< Max Tgl values for each ROC type
constexpr static float MipScale = 1.0 / 50.0; ///< Inverse of target dE/dx value for MIPs

constexpr static float scaleTgl(float tgl, GEMstack roc) { return tgl / CalibdEdx::TglScale[roc]; }
constexpr static float recoverTgl(float scaledTgl, GEMstack roc) { return scaledTgl * CalibdEdx::TglScale[roc]; }
constexpr static float scaleTgl(float tgl, GEMstack rocType) { return tgl / conf_dedx_corr::TglScale[rocType]; }
constexpr static float recoverTgl(float scaledTgl, GEMstack rocType) { return scaledTgl * conf_dedx_corr::TglScale[rocType]; }

private:
bool mFitSnp{};
Expand Down

0 comments on commit 0ce6748

Please sign in to comment.