Skip to content

Commit eac6b77

Browse files
committed
1)loose the fitting condition; 2) change the fitting fuc of ATOF time to be range dynamic
1 parent 9eaf75c commit eac6b77

7 files changed

Lines changed: 18 additions & 14 deletions

File tree

src/main/java/org/jlab/clas/timeline/analysis/alert/alert_atof_time.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ def has_data = new AtomicBoolean(false)
2020
(0..<11).collect{component->
2121
def h1 = dir.getObject(String.format('/ALERT/ATOF_Time_component%02d', component))
2222
if(h1!=null) {
23-
if (h1.getBinContent(h1.getMaximumBin()) > 30 && h1.getEntries()>300){
23+
if (h1.getBinContent(h1.getMaximumBin()) > 3 && h1.getEntries()>10){
2424
data[run].put(String.format('atof_time_%02d', component), h1)
25-
def f1 = ALERTFitter.atof_time_fitter(h1,component)
25+
double fit_min = h1.getXaxis().getBinCenter(1)
26+
double fit_max = h1.getXaxis().getBinCenter(h1.getXaxis().getNBins())
27+
def f1 = ALERTFitter.atof_time_fitter(h1, component, fit_min, fit_max)
2628
data[run].put(String.format('fit_atof_time_%02d', component), f1)
2729
data[run].put(String.format('peak_location_atof_time_%02d', component), f1.getParameter(1))
2830
data[run].put(String.format('sigma_atof_time_%02d', component), f1.getParameter(2).abs())

src/main/java/org/jlab/clas/timeline/analysis/alert/alert_atof_time_sl.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ class alert_atof_time_sl {
2626
(0..<11).each { component ->
2727
def h1 = dir.getObject(String.format('/ALERT/ATOF_Time_sector%02d_layer%02d_component%02d', sector, layer, component))
2828
if (h1 != null) {
29-
if (h1.getBinContent(h1.getMaximumBin()) > 30 && h1.getEntries() > 300) {
29+
if (h1.getBinContent(h1.getMaximumBin()) > 3 && h1.getEntries() > 10) {
3030
def name = String.format('atof_time_sl_s%02d_l%d_c%02d', sector, layer, component)
3131
data[run].put(name, h1)
32-
def f1 = ALERTFitter.atof_time_fitter(h1, component)
32+
double fit_min = h1.getXaxis().getBinCenter(1)
33+
double fit_max = h1.getXaxis().getBinCenter(h1.getXaxis().getNBins())
34+
def f1 = ALERTFitter.atof_time_fitter(h1, component, fit_min, fit_max)
3335
data[run].put('fit_' + name, f1)
3436
data[run].put('peak_location_' + name, f1.getParameter(1))
3537
data[run].put('sigma_' + name, f1.getParameter(2).abs())

src/main/java/org/jlab/clas/timeline/analysis/alert/alert_atof_z.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class alert_atof_z {
1313
data[run] = [run:run]
1414
def h1 = dir.getObject('/ALERT/ATOF_z_combined')
1515
if (h1 != null) {
16-
if (h1.getEntries() > 300) {
16+
if (h1.getEntries() > 10) {
1717
data[run].put('atof_z_combined', h1)
1818
data[run].put('rms_atof_z_combined', h1.getRMS())
1919
has_data.set(true)

src/main/java/org/jlab/clas/timeline/analysis/alert/alert_atof_z_c4.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class alert_atof_z_c4 {
1414
data[run] = [run:run]
1515
def h1 = dir.getObject('/ALERT/ATOF_z_combined_c4')
1616
if (h1 != null) {
17-
if (h1.getBinContent(h1.getMaximumBin()) > 30 && h1.getEntries() > 300) {
17+
if (h1.getBinContent(h1.getMaximumBin()) > 3 && h1.getEntries() > 10) {
1818
data[run].put('atof_z_c4_combined', h1)
1919
def f1 = ALERTFitter.atof_z_fitter(h1)
2020
data[run].put('fit_atof_z_c4_combined', f1)

src/main/java/org/jlab/clas/timeline/analysis/alert/alert_atof_z_c4_sl.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class alert_atof_z_c4_sl {
2525
data[run] = [run:run]
2626
def h1 = dir.getObject(String.format('/ALERT/ATOF_z_c4_sector%02d_layer%02d', sector, layer))
2727
if (h1 != null) {
28-
if (h1.getBinContent(h1.getMaximumBin()) > 30 && h1.getEntries() > 300) {
28+
if (h1.getBinContent(h1.getMaximumBin()) > 3 && h1.getEntries() > 10) {
2929
def name = String.format('atof_z_c4_sl_s%02d_l%d', sector, layer)
3030
data[run].put(name, h1)
3131
def f1 = ALERTFitter.atof_z_fitter(h1)

src/main/java/org/jlab/clas/timeline/analysis/alert/alert_atof_z_sl.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class alert_atof_z_sl {
2424
data[run] = [run:run]
2525
def h1 = dir.getObject(String.format('/ALERT/ATOF_z_sector%02d_layer%02d', sector, layer))
2626
if (h1 != null) {
27-
if (h1.getEntries() > 300) {
27+
if (h1.getEntries() > 10) {
2828
def name = String.format('atof_z_sl_s%02d_l%d', sector, layer)
2929
data[run].put(name, h1)
3030
data[run].put('rms_' + name, h1.getRMS())

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class ALERTFitter{
3434
}
3535

3636

37-
static F1D atof_time_fitter(H1F h1, int component){
37+
static F1D atof_time_fitter(H1F h1, int component, double fit_min, double fit_max){
3838
if(component>9){//bars
39-
def f1 =new F1D("fit:"+h1.getName(),"[amp]*gaus(x,[mean],[sigma])+[cst]", -5.0, 5.0);
39+
def f1 =new F1D("fit:"+h1.getName(),"[amp]*gaus(x,[mean],[sigma])+[cst]", fit_min, fit_max);
4040
f1.setLineColor(33);
4141
f1.setLineWidth(10);
4242
f1.setOptStat("1111");
@@ -185,10 +185,10 @@ class ALERTFitter{
185185
static F1D atof_z_fitter(H1F h1){
186186
double maxz = h1.getBinContent(h1.getMaximumBin())
187187
double peak = h1.getAxis().getBinCenter(h1.getMaximumBin())
188-
int bin_low = h1.getAxis().getBin(peak - 5.0)
189-
int bin_high = h1.getAxis().getBin(peak + 5.0)
188+
int bin_low = h1.getAxis().getBin(peak - 10.0)
189+
int bin_high = h1.getAxis().getBin(peak + 10.0)
190190
double sigma = ALERTFitter.getRestrictedRMS(h1, bin_low, bin_high)
191-
if (sigma <= 0 || Double.isNaN(sigma)) sigma = 3.0
191+
if (sigma <= 0 || Double.isNaN(sigma)) sigma = 5.0
192192

193193
def f1 = new F1D("fit:" + h1.getName(), "[amp]*gaus(x,[mean],[sigma])", peak - 2*sigma, peak + 2*sigma)
194194
f1.setLineColor(33)
@@ -199,7 +199,7 @@ class ALERTFitter{
199199
f1.setParameter(2, sigma)
200200
if (maxz > 0) f1.setParLimits(0, maxz * 0.5, maxz * 1.5)
201201
f1.setParLimits(1, peak - 5.0, peak + 5.0)
202-
f1.setParLimits(2, 0.1, 10.0)
202+
f1.setParLimits(2, 0.01, 10.0)
203203

204204
PrintStream original = System.out
205205
System.setOut(new PrintStream(OutputStream.nullOutputStream()))

0 commit comments

Comments
 (0)