@@ -111,6 +111,10 @@ def define_range_around_peak(h, perc = [0.4, 0.4], Range=[0.0, 99999.0]):
111111 if len (args .input_file ) > 1 :
112112 aux = re .search (r'Run[0-9]+' , args .input_file [- 1 ])
113113 flag += '_' + aux .group (0 )[3 :]
114+ elif len (args .runs_interval )== 1 :
115+ N = args .runs_interval [0 ]
116+ args .input_file = [args .input_file [0 ].replace ('XXX' , str (N ))]
117+ flag = '_' + str (N )
114118 elif len (args .runs_interval )== 2 :
115119 deduced_file_list = []
116120 for i in range (args .runs_interval [0 ], args .runs_interval [1 ]+ 1 ):
@@ -202,7 +206,7 @@ def define_range_around_peak(h, perc = [0.4, 0.4], Range=[0.0, 99999.0]):
202206
203207 amp_aux = np .concatenate (list (tree2array ( chain , 'amp[' + str (k )+ ']' )))
204208
205- h = rt .TH1D (name , title , 80 , np .percentile (amp_aux , 1 ), min (990. , np .percentile (amp_aux , 99.9 )))
209+ h = rt .TH1D (name , title , 80 , np .percentile (amp_aux , 1 ), min (990. , np .percentile (amp_aux , 99.99 )))
206210 h .SetXTitle ('Peak amplitude [mV]' )
207211 h .SetYTitle ('Events / {:.1f} mV' .format (h .GetBinWidth (1 )))
208212 chain .Project (name , 'amp[' + str (k )+ ']' )
@@ -427,6 +431,8 @@ def define_range_around_peak(h, perc = [0.4, 0.4], Range=[0.0, 99999.0]):
427431 canvas ['space_corr' ][k ].Divide (2 )
428432
429433 selection += ' && ntracks == 1 && chi2 < 8'
434+ if chain .GetEntries (selection ) == 0 :
435+ continue
430436 delta_t = np .concatenate (list (tree2array (chain , var_dT , selection )))
431437
432438 add_sel = ''
0 commit comments