Skip to content

Commit 379bccb

Browse files
committed
Prevent the fitting error when the two peaks are too close
1 parent adbcc71 commit 379bccb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/org/jlab/clas/timeline/fitter/ALERTFitter.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ class ALERTFitter{
4747
f1.setOptStat("1111");
4848
double maxz = h1.getBinContent(h1.getMaximumBin());
4949
double peak_location = h1.getAxis().getBinCenter(h1.getMaximumBin());
50-
f1.setRange(peak_location - 50, peak_location + 10);
50+
if (h1.getAxis().getBinCenter(h1.getMaximumBin())-h1.getAxis().getBinCenter(0) < 92) f1.setRange(peak_location - 50, peak_location + 10);
51+
else f1.setRange(peak_location - 10, peak_location + 50);
5152
f1.setParameter(0,maxz-h1.getBinContent(0));
5253
f1.setParameter(1, peak_location);
5354
f1.setParameter(2, 5.0);

0 commit comments

Comments
 (0)