Skip to content

Commit 38ec42f

Browse files
wiechulashahor02
authored andcommitted
Fix TimeGain calibration application: limit to fit range
1 parent 54d279d commit 38ec42f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

DataFormats/Detectors/TPC/include/DataFormatsTPC/CalibdEdxCorrection.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
namespace o2::tpc
3131
{
3232

33+
namespace conf_dedx_corr
34+
{
35+
GPUconstexpr() float TglScale[4] = {1.9, 1.5, 1.22, 1.02}; ///< Max Tgl values for each ROC type
36+
}
37+
3338
class CalibdEdxCorrection
3439
{
3540
public:
@@ -54,7 +59,8 @@ class CalibdEdxCorrection
5459
return 1;
5560
}
5661

57-
tgl = o2::gpu::CAMath::Abs(tgl);
62+
// limit to the fit range in the respective region
63+
tgl = o2::gpu::CAMath::Min(conf_dedx_corr::TglScale[stack.type], o2::gpu::CAMath::Abs(tgl));
5864
auto p = mParams[stackIndex(stack, charge)];
5965
float result = p[0];
6066
// Tgl part

Detectors/TPC/calibration/include/TPCCalibration/CalibdEdx.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,10 @@ class CalibdEdx
136136
/// Save the histograms to a TTree.
137137
void writeTTree(std::string_view fileName) const;
138138

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

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

145144
private:
146145
bool mFitSnp{};

0 commit comments

Comments
 (0)