# set up the energy selection
energy_name = 'energy'
range_name = '40K_1460'

# loop over detectors
detectors = ['oppi']
store = lh5.Store()
for detector in detectors:
    # get indices for just a selected energy range
    det_db = apdb[detector]
    lh5_group = 'ORSIS3302DecoderForEnergy/raw'
    idx = select_energies(energy_name,
                          range_name,
                          filenames,
                          det_db,
                          lh5_group=lh5_group)

    waveform_name = 'ORSIS3302DecoderForEnergy/raw/waveform/'
    waveforms, _ = store.read_object(waveform_name, filenames, idx=idx)
    print(f'{len(waveforms)} wfs for {detector}')

    # build the table for processing
    tb_data = lh5.Table(col_dict={'waveform': waveforms})

    # run the optimization
    db_dict = apdb[detector]
    grid_values = run_grid(tb_data,
                           dsp_config,
                           pz2_grid,
Exemple #2
0
from pygama.dsp.WaveformBrowser import WaveformBrowser
from energy_selector import select_energies

filenames = [  #'raw/Run70053_raw.lh5',
    'raw/Run70054_raw.lh5',
]
detector = 'icpc1'

with open('icpc_apdb.json') as f:
    apdb = json.load(f)

# set up the energy selection
lh5_group = 'icpcs/' + detector + '/raw/'
idx = select_energies('energy',
                      '208Tl_2615',
                      filenames,
                      apdb[detector],
                      lh5_group=lh5_group)
print(len(idx[0]), 'waveforms')

wb = WaveformBrowser(
    filenames,
    lh5_group,
    dsp_config='icpc_dsp.json',
    database=apdb[detector],
    #waveforms=['waveform', 'wf_pz', 'wf_pz2', 'wf_trap', 'curr10', 'wf_atrap'],
    waveforms=['waveform', 'wf_pz', 'wf_pz2'],
    #waveforms=['wf_pz', 'wf_pz2', 'wf_trap', 'wf_atrap'],
    #lines=['bl', 'tp_0', 'tp_max'], legend=['tp_0'])
    lines=['fltp2'],  #, 'fltp2'],
    #lines=['trapEftp', 'tp_0', 'tp_max'],