示例#1
0
 def draw_trigger_phase(self, dut=False, cut=None, **kwargs):
     x = self.get_tree_vec(
         f'trigger_phase[{1 if dut else 0}]',
         self.Cut.generate_custom(
             exclude=['trigger_phase']) if cut is None else TCut(cut))
     h = self.Draw.distribution(x,
                                Bins.make(-.5, 10),
                                'Trigger Phase',
                                x_tit='Trigger Phase',
                                show=False)
     return self.Draw.distribution(
         h,
         **prep_kw(kwargs,
                   y_off=1.7,
                   lm=.16,
                   file_name=f'TriggerPhase{dut:d}',
                   gridx=True,
                   y_range=ax_range(0, h.GetMaximum(), 0, .15),
                   stats=set_entries()))
示例#2
0
 def draw_split_map_disto(self,
                          m,
                          n=None,
                          x_range=None,
                          fit=True,
                          normalise=False,
                          show=True):
     x = get_2d_hist_vec(self.split_signal_map(m, n, show=False)[0]) / (
         self.get_pulse_height() if normalise else 1)
     h = self.Draw.distribution(
         x,
         Bins.make(*choose(x_range, ax_range(x, 0, .1, .4, thresh=3)),
                   n=sqrt(x.size)),
         'Signal Map Distribution',
         x_tit='{}Pulse Height{}'.format(
             *['Normalised ', ''] if normalise else ['', ' [mV]']),
         show=show)
     h.Fit('gaus', 'qs{}'.format('' if fit else '0'))
     format_statbox(h, all_stat=True, fit=fit)
     return mean_sigma(x)
示例#3
0
 def draw_sig_map_disto(self,
                        res=None,
                        cut=None,
                        fid=True,
                        x_range=None,
                        redo=False,
                        normalise=False,
                        ret_value=False,
                        ph_bins=None,
                        show=True,
                        save=True):
     x = get_2d_hist_vec(
         self.draw_signal_map(res, cut, fid, redo=redo, show=False),
         err=False) / (self.get_pulse_height() if normalise else 1)
     x_range = choose(x_range, ax_range(x, fl=.1, fh=.1))
     h = self.Draw.distribution(x,
                                Bins.make(*x_range, n=sqrt(x.size)),
                                'Signal Map Distribution',
                                x_tit='Pulse Height [mV]',
                                y_off=2,
                                lm=.15,
                                show=show,
                                save=save)
     return mean_sigma(x) if ret_value else h
示例#4
0
 def get_time_bins(self, off=0, bin_size=50):
     e = self.get_data(off)[2]
     return Bins.make(
         array([self.Run.get_time_at_event(i) for i in e[::bin_size]]))