Skip to content

Commit 74f713a

Browse files
glegrasshahor02
authored andcommitted
TRD: small fix for gain and VdExB calib
1 parent bd173fa commit 74f713a

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

DataFormats/Detectors/TRD/include/DataFormatsTRD/CalGain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class CalGain
4040
if (!defaultAvg || isGoodGain(iDet))
4141
return mMPVdEdx[iDet];
4242
else {
43-
if (TMath::Abs(mMeanGain + 999.) < 1e-6)
43+
if (std::fabs(mMeanGain + 999.) < 1e-6)
4444
mMeanGain = getAverageGain();
4545
return mMeanGain;
4646
}
@@ -68,7 +68,7 @@ class CalGain
6868

6969
bool isGoodGain(int iDet) const
7070
{
71-
if (TMath::Abs(mMPVdEdx[iDet] - constants::MPVDEDXDEFAULT) > 1e-6)
71+
if (std::fabs(mMPVdEdx[iDet] - constants::MPVDEDXDEFAULT) > 1e-6)
7272
return true;
7373
else
7474
return false;

DataFormats/Detectors/TRD/include/DataFormatsTRD/CalVdriftExB.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class CalVdriftExB
4141
if (!defaultAvg || (isGoodExB(iDet) && isGoodVdrift(iDet)))
4242
return mVdrift[iDet];
4343
else {
44-
if (TMath::Abs(mMeanVdrift + 999.) < 1e-6)
44+
if (std::fabs(mMeanVdrift + 999.) < 1e-6)
4545
mMeanVdrift = getAverageVdrift();
4646
return mMeanVdrift;
4747
}
@@ -51,7 +51,7 @@ class CalVdriftExB
5151
if (!defaultAvg || (isGoodExB(iDet) && isGoodVdrift(iDet)))
5252
return mExB[iDet];
5353
else {
54-
if (TMath::Abs(mMeanExB + 999.) < 1e-6)
54+
if (std::fabs(mMeanExB + 999.) < 1e-6)
5555
mMeanExB = getAverageExB();
5656
return mMeanExB;
5757
}
@@ -102,9 +102,9 @@ class CalVdriftExB
102102
// check if value is well calibrated or not
103103
// default calibration if not enough entries
104104
// close to boundaries indicate a failed fit
105-
if (TMath::Abs(mExB[iDet] - constants::EXBDEFAULT) > 1e-6 &&
106-
TMath::Abs(mExB[iDet] - constants::EXBMIN) > 0.01 &&
107-
TMath::Abs(mExB[iDet] - constants::EXBMAX) > 0.01)
105+
if (std::fabs(mExB[iDet] - constants::EXBDEFAULT) > 1e-6 &&
106+
std::fabs(mExB[iDet] - constants::EXBMIN) > 0.01 &&
107+
std::fabs(mExB[iDet] - constants::EXBMAX) > 0.01)
108108
return true;
109109
else
110110
return false;
@@ -115,9 +115,9 @@ class CalVdriftExB
115115
// check if value is well calibrated or not
116116
// default calibration if not enough entries
117117
// close to boundaries indicate a failed fit
118-
if (TMath::Abs(mVdrift[iDet] - constants::VDRIFTDEFAULT) > 1e-6 &&
119-
TMath::Abs(mVdrift[iDet] - constants::VDRIFTMIN) > 0.1 &&
120-
TMath::Abs(mVdrift[iDet] - constants::VDRIFTMAX) > 0.1)
118+
if (std::fabs(mVdrift[iDet] - constants::VDRIFTDEFAULT) > 1e-6 &&
119+
std::fabs(mVdrift[iDet] - constants::VDRIFTMIN) > 0.1 &&
120+
std::fabs(mVdrift[iDet] - constants::VDRIFTMAX) > 0.1)
121121
return true;
122122
else
123123
return false;

Detectors/TRD/calibration/src/CalibratorGain.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void CalibratorGain::retrievePrev(o2::framework::ProcessingContext& pc)
8989
std::string msg = "Default Object";
9090
// We check if the object we got is the default one by comparing it to the defaults.
9191
for (int iDet = 0; iDet < MAXCHAMBER; ++iDet) {
92-
if (dataCalGain->getMPVdEdx(iDet) != constants::MPVDEDXDEFAULT) {
92+
if (dataCalGain->getMPVdEdx(iDet, false) != constants::MPVDEDXDEFAULT) {
9393
msg = "Previous Object";
9494
break;
9595
}
@@ -98,7 +98,7 @@ void CalibratorGain::retrievePrev(o2::framework::ProcessingContext& pc)
9898

9999
// Here we set each entry regardless if it is the default or not.
100100
for (int iDet = 0; iDet < MAXCHAMBER; ++iDet) {
101-
mFitResults[iDet] = dataCalGain->getMPVdEdx(iDet);
101+
mFitResults[iDet] = dataCalGain->getMPVdEdx(iDet, false);
102102
}
103103
}
104104

Detectors/TRD/calibration/src/CalibratorVdExB.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ void CalibratorVdExB::retrievePrev(o2::framework::ProcessingContext& pc)
166166
std::string msg = "Default Object";
167167
// We check if the object we got is the default one by comparing it to the defaults.
168168
for (int iDet = 0; iDet < MAXCHAMBER; ++iDet) {
169-
if (dataCalVdriftExB->getVdrift(iDet) != VDRIFTDEFAULT ||
170-
dataCalVdriftExB->getExB(iDet) != EXBDEFAULT) {
169+
if (dataCalVdriftExB->getVdrift(iDet, false) != VDRIFTDEFAULT ||
170+
dataCalVdriftExB->getExB(iDet, false) != EXBDEFAULT) {
171171
msg = "Previous Object";
172172
break;
173173
}
@@ -176,8 +176,8 @@ void CalibratorVdExB::retrievePrev(o2::framework::ProcessingContext& pc)
176176

177177
// Here we set each entry regardless if it is the default or not.
178178
for (int iDet = 0; iDet < MAXCHAMBER; ++iDet) {
179-
mFitFunctor.laPreCorr[iDet] = dataCalVdriftExB->getExB(iDet);
180-
mFitFunctor.vdPreCorr[iDet] = dataCalVdriftExB->getVdrift(iDet);
179+
mFitFunctor.laPreCorr[iDet] = dataCalVdriftExB->getExB(iDet, false);
180+
mFitFunctor.vdPreCorr[iDet] = dataCalVdriftExB->getVdrift(iDet, false);
181181
}
182182
}
183183

0 commit comments

Comments
 (0)