Home CMS Production Clean room MedAustron HEPHY testbeams old
testbeam-rd50-desy-Oct2024 testbeam-RD50-DESY-Apr2024 testbeam-RD50-DESY-Jul2023 testbeam-RD50-CERN-Oct2022 testbeam-DESY-Oct2017 testbeam-DESY-April2017 testbeam-SPS2015 testbeam-SPS2014 testbeam-DESY14 testbeam-SPS12 testbeam-SPS11 testbeam-SPS10 testbeam-SPS09 testbeam-SPS08 LP-TPC
  Testbeam at DESY in 2023, Page 25 of 26  Not logged in ELOG logo
ID Date Author Subject Run Number DUT Wafer HV Fluence Resistivity Beam Energy Rate Setting Particle Type Data t-Start t-Stop Duration_min
  28   Tue Jul 4 18:09:43 2023 tb-crewinitial tests617RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 18:00:4004.07.2023 18:05:364
automatic log for run 617
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.5
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  27   Tue Jul 4 17:55:37 2023 tb-crewinitial tests616RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 17:41:2504.07.2023 17:51:3010
automatic log for run 616
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.5
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  26   Tue Jul 4 17:28:24 2023 tb-crewinitial tests615RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 17:19:0204.07.2023 17:24:165
automatic log for run 615
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
#DUTIgnoreBusy = 0x2 #no (EUDET mode)
DUTIgnoreBusy = 0xF #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  25   Tue Jul 4 17:18:14 2023 tb-crewinitial tests614RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 17:05:1004.07.2023 17:14:078
automatic log for run 614
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  24   Tue Jul 4 16:46:57 2023 tb-crewinitial tests613RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 16:38:0604.07.2023 16:42:494
automatic log for run 613
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  23   Tue Jul 4 16:39:46 2023 tb-crewinitial tests612RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 16:32:5104.07.2023 16:35:382
automatic log for run 612
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  22   Tue Jul 4 16:32:08 2023 tb-crewinitial tests611RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 16:25:0004.07.2023 16:28:013
automatic log for run 611
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  21   Tue Jul 4 16:26:06 2023 tb-crewinitial tests610RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 16:19:3104.07.2023 16:21:582
automatic log for run 610
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  20   Tue Jul 4 16:22:25 2023 tb-crewinitial tests RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown   
problems with automating elog
  19   Tue Jul 4 15:14:00 2023 tb-crewinitial tests602RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 15:02:5804.07.2023 15:09:536
automatic log for run 602
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  18   Tue Jul 4 15:03:20 2023 tb-crewinitial tests601RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 14:51:0504.07.2023 14:59:138
automatic log for run 601
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  17   Tue Jul 4 14:54:46 2023 tb-crewinitial tests RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown   
deactivated piggy due to 1st sync issues
  16   Tue Jul 4 14:29:01 2023 tb-crewinitial tests600RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 14:22:4804.07.2023 14:24:542
automatic log for run 600
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 100
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 5
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  15   Tue Jul 4 14:23:54 2023 tb-crewinitial tests599RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 14:16:1704.07.2023 14:19:473
automatic log for run 599
Comment:
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 75
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  14   Tue Jul 4 14:03:32 2023 tb-crewinitial tests597RD50-MPW3unknown unirradiated1.9K4.2 electronUnknown04.07.2023 13:53:1504.07.2023 13:59:256
automatic log for run 597
Comment:
first actual hits
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.3
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 75
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  13   Tue Jul 4 14:00:05 2023 tb-crewinitial tests RD50-MPW3unknown unirradiated1.9K4.2 electronCrap   
increased thr to 1.3V
activity is "enabling" noise
  12   Tue Jul 4 13:47:25 2023 tb-crewinitial tests595RD50-MPW3unknown unirradiated1.9K4.2 electronCrap04.07.2023 13:39:3304.07.2023 13:43:183
automatic log for run 595
Comment:
DUT biased, kind of aligned, hoping for the best
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 0
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.23
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 75
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  11   Tue Jul 4 13:45:31 2023 tb-crewinitial tests RD50-MPW3unknown unirradiated1.9K4.2 electronCrap   
DUT biased, kind of aligned, hoping for the best
  10   Tue Jul 4 11:22:40 2023 tb-crewinitial tests589RD50-MPW3unknown unirradiated1.9K4.2 electronCrap04.07.2023 11:17:0304.07.2023 11:18:341
automatic log for run 589
Comment:
testing without HV, just trigger ftm
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 1 
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.5
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 75
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
  9   Tue Jul 4 11:19:24 2023 tb-crewinitial tests588RD50-MPW3unknown unirradiated1.9K4.2 electronCrap04.07.2023 10:37:5604.07.2023 11:15:1737
automatic log for run 588
Comment:
still testing without HV, don't expect hits
Attachment 1: peary_config.cfg
#This config file was generated with the "MPW3_gui - Config Creator"
#Do not change comment lines like "SEC::xxx" !
#They are needed for parsing

[RD50_MPW3]
this_config_file = config_piggy_new.cfg
#SEC::MISC
accept_tlu_trigger = 1
enable_readout = 1 
calib_file_base = calib_base.txt
config_si5345 = clock_config.txt
execute_file = execute.txt
i2c_addr_base = 0x41
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_base.txt


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36


#SEC::POWER
# voltages with suffix "__u", currents with "__i"
bl__u = 0.9
bl__i = 3
del_hi__u = 0.7
del_hi__i = 3
del_lo__u = 0.9
del_lo__i = 3
p1v3_vssa__u = 1.3
p1v3_vssa__i = 3
p1v8_nw_ring__u = 1.8
p1v8_nw_ring__i = 3
p1v8_vdd!__u = 1.8
p1v8_vdd!__i = 3
p1v8_vdda__u = 1.8
p1v8_vdda__i = 3
p1v8_vddc__u = 1.8
p1v8_vddc__i = 3
p1v8_vsensbus__u = 1.8
p1v8_vsensbus__i = 3
p2v5d__u = 2.5
p2v5d__i = 3
th__u = 1.5
th__i = 3

[RD50_MPW3_Piggy]
this_config_file = config_piggy_new.cfg
#SEC::MISC
calib_file = calib_piggy.txt
execute_file = execute.txt
i2c_addr = 0x47
i2c_dev = /dev/i2c-9
matrix_config = matrix_config_piggy.txt
piggy_attached = 0


#SEC::REGISTERS
conf_reg_ts_ctrl = 0
conf_reg_ts_ini = 0
cu_ctrl = 0
en_ext_ctrl = 0
en_ser_out_dcol = 0
en_sfout_dcol = 0
idle0 = 251
idle1 = 247
idle2 = 247
idle3 = 247
tx_ctrl = 0
vbfb = 38
vblr = 38
vn = 21
vnfb = 18
vnsensbias = 50
vnsf = 45
vpbias = 37
vpcomp = 19
vptrim = 36
Attachment 2: matrix_config_base.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 3: matrix_config_piggy.txt
# Config-File of the Pixel-Matrix; generated by MPW3-Config-Creator
# each line represents the configuration of an individual pixel
# format: {row} {col} {mask} {en_inj} {hb_en} {en_sfout} {TDAC}

# default values (which are not printed) are:
# {row} {col} 0 0 0 0 -1
Attachment 4: eudaq_config.cfg
[RunControl]
EUDAQ_CTRL_PRODUCER_LAST_START = aida_tlu

[LogCollector.log]

[Producer.aida_tlu]
verbose = 0
confid = 20181002
skipconf = 0

# delay start in ms
delayStart = 0

####################################################
# DUT IN/OUTPUT

# Mask: 0 CONT, 1 SPARE, 2 TRIG, 3 BUSY (1 = driven by TLU, 0 = driven by DUT) 
# EUDET mode: 7
HDMI1_set = 0x7
HDMI2_set = 0x7
HDMI3_set = 0x7
HDMI4_set = 0x7

# same as above for the clock line, 1 = AIDA mode, 2 = FPGA 
HDMI1_clk = 1
HDMI2_clk = 0
HDMI3_clk = 1
HDMI4_clk = 0
LEMOclk = 1   # if input, then also adjust clk.txt

# Activate channels
# Only TLU
#DUTMask = 0x0
# Telescope at HDMI1
#DUTMask = 0x1
# Only FEI4 at HDMI2
#DUTMask = 0x2
# Telescope at HDMI1, FEI4 at HDMI2
#DUTMask = 0x3
#Adenium at HDMI3
#DUTMask = 0x1

#Adenium at HDMI1,  MPW3 at HDMI3, Monopix2 at HDMI4
DUTMask = 0xD

# Define mode: 
# Each DUT channel has two bits: HDMI1=0&1 bit; HDMI2= 2&3bit; ...
# Only the lowest bit is significant:
# AIDA mode for each "1st" LSbit = 1
# EUDET modes incl. DUT clocking out each "1st" LSbit = 0
# e.g. 1st and 2nd channel in EUDET mode: 0xF0
#DUTMaskMode = 0xF0 # 1st and 2nd channel are reading out Trigger ID
# e.g. only 1st in EUDET mode
#DUTMaskMode = 0xFC # 1st is reading out Trigger ID

#!!!!!!!!!!!! Check this !!!!!!!!!!!!!!!
#DUTMaskMode = 0x01 #I think this is AIDA mode for channel 3 and reading out trigger number

#HDMI3 on AIDA with trigger number
DUTMaskMode = 0x11

# "Mixed mode" to ignore a busy line from a DUT
# TLU ignores the telescope busy (at HDMI1)
#DUTIgnoreBusy = 0x1 # yes (default, Mixed mode)
DUTIgnoreBusy = 0x2 #no (EUDET mode)

###################################################
# ONLY AUTOTRIGGER 
#InternalTriggerFreq = 1000

# also set this to 0
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# EXTERNAL TRIGGER INPUTs
# Stretch, delay in 6.25ns ticks
in0_STR = 7  # factor to stretch the width of the signal; to get coincidence 
in0_DEL = 0  # factor to delay, e.g. compensate  
in1_STR = 7
in1_DEL = 0
in2_STR = 7
in2_DEL = 0
in3_STR = 7
in3_DEL = 0
in4_STR = 0
in4_DEL = 0
in5_STR = 0
in5_DEL = 0

# DAC INPUT THRESHOLD in V
DACThreshold0 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold1 = -0.4  # Was -0.04, but we get amplyfied signal from NIM module
DACThreshold2 = -0.20
DACThreshold3 = -0.20
DACThreshold4 = -0.20
DACThreshold5 = -0.20

# PMT Power
PMT1_V = 0.80
PMT2_V = 0.80
PMT3_V = 0.00
PMT4_V = 0.00

# 2 words 32bit: Hi + Lo
# combinations of coincidence are now possible! 

# Coincidence of input 0 to 3 (telescope)
#trigMaskHi = 0x00000000
#trigMaskLo = 0x00008000

# Coincidence of input 0 and 1
trigMaskHi = 0x00000000
trigMaskLo = 0x00000008

# New: Coincidence of any 3 of 4, 4 combinations plus all 4
#trigMaskHi = 0x00000000
#trigMaskLo = 0x0000C880

# EUDAQ2
# Define the data collector to be used by the producer
EUDAQ_DC = dc_tlu



[DataCollector.dc_tlu]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=5
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_tlu$X"
DISABLE_PRINT = 1

################################### Adenium #####################################
[Producer.altel]
EUDAQ_ID=1
EUDAQ_DC=dc_tel


[DataCollector.dc_tel]
EUDAQ_ID=100
EUDAQ_MN=StdEventMonitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION=1
EUDAQ_FW = native
EUDAQ_FW_PATTERN = "/media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_adenium$X"
DISABLE_PRINT = 1

################################### MPW3 #####################################

[Producer.RD50_MPW3]


[DataCollector.mpw3_dc]
# connection to the monitor
EUDAQ_MN = mpw3_mon
EUDAQ_FW = native
EUDAQ_FW_PATTERN = /media/silicon/backup/desy_jul23/mpw3_run$6R$X
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 500
# config-parameters
DISABLE_PRINT = 1
XILINX_IP = 192.168.201.1
SYNC_MODE = 1

[Monitor.mpw3_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[Producer.elog_mpw3]

# command (shell script) to execute before starting a run
start_cmd = "./copy_configs.sh" 

#files to attach to the Elog entry
files2log = "tmp/peary_config.cfg, tmp/matrix_config_base.txt, tmp/matrix_config_piggy.txt, tmp/eudaq_config.cfg" 



################################################ MPX2 #####################################################


[Producer.monopix2]
# connection to the data collector
EUDAQ_DC = dc_mpx2
ENABLE_BDAQ_RECORD = 1
ENABLE_HITOR = 1
#CHIP_CONFIG_FILE = /home/bellevtx01/vtx/tj-monopix2-daq_mx/tj-monopix2-daq/tjmonopix2/scans/output_data/module_0/chip_0/20230703_231744_local_threshold_tuning.h5
#CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/01_Normal_THR30_noisy/20230621_124059_threshold_scan_interpreted.h5
CHIP_CONFIG_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/20230704_094135_threshold_scan_interpreted.h5
MASKED_PIXELS_FILE = /media/bellevtx01/TOSHIBA EXT/configs/tuning/W14R12/03_Normal_THR30/masked_pixels.yaml
CHIP_SN = W14R12
CHIP_CMD_CLK = 160.0

#overriding values in "scan_configuration"
#when none given default ones are being used
START_ROW = 0
STOP_ROW = 512
START_COLUMN = 75
STOP_COLUMN = 224
WAIT_FOR_FPGA = 1

[Producer.hameg]
#HV = 5
BIAS = 6
SERIAL_PORT = /dev/ttyUSB0

[Monitor.monopix2_mon]
ENABLE_PRINT = 0
ENABLE_STD_PRINT = 0
ENABLE_STD_CONVERTER = 1
FORWARD2GUI = 1

[DataCollector.dc_mpx2]
# connection to the monitor
EUDAQ_MN = monopix2_mon
EUDAQ_FW = native
#path to store .raw file to, $3R is replaced by 3 digit run number, $12D -> 12 character date, $X -> .raw
EUDAQ_FW_PATTERN = /media/bellevtx01/TOSHIBA EXT/VTX/data_producer_runs/desy/run$6R_monopix2$X
#fraction of events being sent to the monitor
EUDAQ_DATACOL_SEND_MONITOR_FRACTION = 100

# config-parameters
#disable output of event to bash, is spamming terminal otherwise
DISABLE_PRINT = 1
ELOG V3.1.5-fc6679b