
-- mapping between the local pixel id and the local row and column. to be used later
-- the numbering of local pixel id is according to C.Pauly photon testbeam map

set serveroutput on format wrapped;

declare
  i  number := 0;
  pmt_pix number := 0;
  pmt_row number := -1;
  pmt_col number := -1;
begin
  for i in 0..63 loop
    exit when pmt_pix > 1000;
    pmt_pix := i +1; 
    pmt_col := 1 + MOD(i,8);
    pmt_row := 1+floor(i/8);
    DBMS_OUTPUT.put_line('pixel' || pmt_pix || ', col:'|| pmt_col || ', row:'|| pmt_row);
  --insert into rich700_PMT_PIXEL values (pmt_pix, pmt_row, pmt_col);
  end loop;
end;


