def get_signal_map(self, res=None, cut=None, fid=False, square=False, m=None, n=None, local=True, _redo=False): self.Tree.SetEstimate(self.Run.NEvents) var, bins = self.get_track_vars( local=local) + [self.get_ph_var()], Bins.get_global( res, square) if m is None else self.get_fid_bins(m, n) x, y, zz = self.get_tree_vec( var, self.Cut.generate_custom(exclude='fiducial', prnt=False) if not fid and cut is None else self.Cut(cut)) tit, ztit = 'Pulse Height Map', 'Pulse Height [mV]' return self.Draw.prof2d(x, y, zz, bins, tit, **self.Tracks.ax_tits(), z_tit=ztit, z_range=self.find_sm_range(res, square, m, n, _redo=_redo), show=False, pal=53)
def get_hitmap(self, res=None, cut='', _redo=False): self.Run.set_estimate() x, y = self.get_tree_vec(self.get_track_vars(), self.Cut(cut)) return self.Draw.histo_2d(x, y, Bins.get_global(res), 'Hit Map', x_tit='Track Position X [mm]', y_tit='Track Position Y [mm]', show=False)
def find_sm_range(self, res=None, square=False, m=None, n=None, _redo=False): var, bins = self.get_track_vars() + [ self.get_ph_var() ], Bins.get_global(res, square) if m is None else self.get_fid_bins( m, n) return ax_range(get_2d_hist_vec( self.Draw.prof2d(*self.get_tree_vec(var, self.Cut()), bins, show=False)), thresh=4)
def get_map(self, res=None, fid=False, cut=None, local=False, _redo=False): x, y, zz = self.get_tree_vec( self.get_track_vars(local=local) + [self.get_var()], self.Cut(cut) if cut or fid else self.Cut.exclude('fiducial')) tit, (xtit, ytit), ztit = 'Efficiency Map', [ f'Track Position {i} [mm]' for i in ['X', 'Y'] ], 'Efficiency [%]' return self.Draw.prof2d(x, y, zz * 100, Bins.get_global(res), tit, x_tit=xtit, y_tit=ytit, z_tit=ztit, show=False)
def draw_efficiency_map(self, res=None, n_sigma=4, cut=None, show=True): cut_string = choose(self.Cut(cut) + self.Cut.get('tracks'), self.Cut.generate_custom(exclude=['fiducial']), decider=cut) e, x, y = self.get_tree_vec(var=[self.get_eff_var(n_sigma)] + self.get_track_vars(), cut=cut_string) p = self.Draw.prof2d(x, y, e * 100, Bins.get_global(res), 'Efficiency Map', x_tit='X [cm]', y_tit='Y [cm]', z_tit='Efficiency [%]', ncont=100, z_range=[0, 100], show=show) set_2d_ranges(p, dx=3, dy=3) self.draw_fid_cut(scale=10) self.draw_detector_size() self.Draw.save_plots('EffMap')
def draw_hitmap(dut=1, res=None): x, y = get_tree_vec(t, [f'dia_track_{i}_local[{dut - 1}]' for i in ['x', 'y']]) plot.histo_2d(x * 10, y * 10, Bins.get_global(res), 'HitMap', x_tit='Track Position X [mm]', y_tit='Track Position Y [mm]')