Skip to content

Commit 585dfcb

Browse files
committed
TRD: CalibratorVdExB: Avoid divide by zero
In the TrackletTransformer we query multiple times for the vDrift value to divide by it. The fit can now not be zero, minimum 0.01. I promoted the default value to a constant. Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 8f9273d commit 585dfcb

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ constexpr float GRANULARITYTRKLSLOPE = 1.f / PADGRANULARITYTRKLSLOPE; ///< granu
6464
constexpr int ADCBASELINE = 10; ///< baseline in ADC units
6565

6666
// OS: Should this not be flexible for example in case of Kr calib?
67-
constexpr int TIMEBINS = 30; ///< the number of time bins
68-
constexpr float MAXIMPACTANGLE = 25.f; ///< the maximum impact angle for tracks relative to the TRD detector plane to be considered for vDrift and ExB calibration
69-
constexpr int NBINSANGLEDIFF = 25; ///< the number of bins for the track angle used for the vDrift and ExB calibration based on the tracking
70-
constexpr double ANODEPLANE = 0.0335; ///< distance of the TRD anode plane from the drift cathodes in [m]
67+
constexpr int TIMEBINS = 30; ///< the number of time bins
68+
constexpr float MAXIMPACTANGLE = 25.f; ///< the maximum impact angle for tracks relative to the TRD detector plane to be considered for vDrift and ExB calibration
69+
constexpr int NBINSANGLEDIFF = 25; ///< the number of bins for the track angle used for the vDrift and ExB calibration based on the tracking
70+
constexpr double ANODEPLANE = 0.0335; ///< distance of the TRD anode plane from the drift cathodes in [m]
71+
constexpr double VDRIFTDEFAULT = 1.546; ///< default value for vDrift
72+
constexpr double EXBDEFAULT = 0.0; ///< default value for LorentzAngle
7173

7274
// Trigger parameters
7375
constexpr double READOUT_TIME = 3000; ///< the time the readout takes, as 30 TB = 3 micro-s.

Detectors/TRD/calibration/src/CalibratorVdExB.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void CalibratorVdExB::initProcessing()
113113
mFitter.SetFCN<FitFunctor>(2, mFitFunctor, mParamsStart);
114114
mFitter.Config().ParSettings(ParamIndex::LA).SetLimits(-0.7, 0.7);
115115
mFitter.Config().ParSettings(ParamIndex::LA).SetStepSize(.01);
116-
mFitter.Config().ParSettings(ParamIndex::VD).SetLimits(0., 3.);
116+
mFitter.Config().ParSettings(ParamIndex::VD).SetLimits(0.01, 3.);
117117
mFitter.Config().ParSettings(ParamIndex::VD).SetStepSize(.01);
118118
ROOT::Math::MinimizerOptions opt;
119119
opt.SetMinimizerType("Minuit2");

0 commit comments

Comments
 (0)