# ******************************************************************************************
# params File generated by Python
# ******************************************************************************************
# ------------------------------------------------------------------------------------------
# Connect
# ------------------------------------------------------------------------------------------
Open[0] eth:192.168.50.3


# ******************************************************************************************
# Common and Default settings
# ******************************************************************************************

# ------------------------------------------------------------------------------------------
# RunCtrl
# ------------------------------------------------------------------------------------------
StartRunMode                       ASYNC                # Start of Run mode. Options: ASYNC, TDL
StopRunMode                        MANUAL               # Run Stop Mode. Options: MANUAL, PRESET_TIME, PRESET_COUNTS
EventBuildingMode                  DISABLED             # DISABLED: no event building, TRGTIME_SORTING: event sorting by Trigger Time stamp, TRGID_SORTING: event sorting by Trigger ID. Options: DISABLED, TRGTIME_SORTING, TRGID_SORTING
TrgTimeWindow                      100 ns               # Coincidence Window for Event Building based on time stamp

# ------------------------------------------------------------------------------------------
# AcqMode
# ------------------------------------------------------------------------------------------
ChEnableMask0                      0xFFFFFFFF           # Channel enable mask TDC0 (ch 0..31)
ChEnableMask1                      0xFFFFFFFF           # Channel enable mask TDC0 (ch 32..63)
ChEnableMask2                      0xFFFFFFFF           # Channel enable mask TDC1 (ch 64..95)
ChEnableMask3                      0xFFFFFFFF           # Channel enable mask TDC1 (ch 96..127)
AcquisitionMode                    TEST_MODE_1         # Acquisition mode. Options: COMMON_START, COMMON_STOP, TRG_MATCHING, STREAMING, TEST_MODE_1, TEST_MODE_2
MeasMode                           LEAD_ONLY            # Time measurement mode. Options: LEAD_ONLY, LEAD_TRAIL, LEAD_TOT8, LEAD_TOT11
En_Head_Trail                      ONE_WORD             # Enable Header and Trailer. Options: KEEP_ALL, ONE_WORD
En_Empty_Ev_Suppr                  0                    # Enable empty event suppression
TriggerSource                      PTRG                 # Trigger source. Options: SW_ONLY, T1-IN, T0-IN, PTRG, EDGE_CONN, MASK
TrefSource                         CH0                  # Time reference source. Options: CH0, T0-IN, T1-IN, PTRG
VetoSource                         DISABLED             # The veto signal inhibits the trigger source (active high). Options: DISABLED, T0-IN, T1-IN, MASK
GateWidth                          1 us                 # Gate Width (will be rounded to steps of 12.8 ns)
TrgWindowWidth                     800 ns               # Trigger Window Width (will be rounded to steps of 12.8 ns)
TrgWindowOffset                    -1 us                # Trigger Window Offset = start of the trg window respect to trigger position (can be negative, will be rounded to steps of 12.8 ns)
PtrgPeriod                         1 ms                 # Period of the internal periodic trigger
DigitalProbe0                      CLK_1024             # Digital probe source (T0-OUT). Options: CLK_1024, TRG_ACCEPTED, TRG_REJECTED, TX_DATA_VALID, TX_PCK_COMMIT, TX_PCK_ACCEPTED, TX_PCK_REJECTED, TDC_DATA_VALID, TDC_DATA_COMMIT
DigitalProbe1                      CLK_1024             # Digital probe source (T1-OUT). Options: CLK_1024, TRG_ACCEPTED, TRG_REJECTED, TX_DATA_VALID, TX_PCK_COMMIT, TX_PCK_ACCEPTED, TX_PCK_REJECTED, TDC_DATA_VALID, TDC_DATA_COMMIT
T0_Out                             TRIGGER              # T0_Out assignment. Options: T0-IN, TRIGGER, RUN, PTRG, BUSY, DPROBE, SQ_WAVE, TDL_SYNC, RUN_SYNC, ZERO, MASK
T1_Out                             T1-IN                # T1_Out assignment. Options: T1-IN, TRIGGER, RUN, PTRG, BUSY, DPROBE, SQ_WAVE, TDL_SYNC, RUN_SYNC, ZERO, MASK

# ------------------------------------------------------------------------------------------
# TDC
# ------------------------------------------------------------------------------------------
GlitchFilterMode                   DISABLED             # Glitch Filter (enforce minimum pulse width and/or distance). Options: DISABLED, TRAILING, LEADING, BOTH
GlitchFilterDelay                  3                    # Glicth Filter Delay (~800 ps to ~10 ns with 16 steps)
ToT_reject_low_thr                 0                    # ToT Reject lower threshold (0=disabled)
ToT_reject_high_thr                0                    # ToT Reject higher threshold (0=disabled)
TDC_ChannelBufferSize              128                  # TDC Channel Buffer Size (limits max num of hits per channel). Options: 4, 8, 16, 32, 64, 128, 256, 512
TriggerBufferSize                  16                   # FPGA Trigger Buffer Size (limits num of pending triggers waiting for readout)
TDCpulser_Width                    1 ns                 # picoTDC Pulser Output (width in ns)
TDCpulser_Period                   10 ns                # picoTDC Pulser Output (period in ns)
HighResClock                       DISABLED             # High Res Clock Distribution (MCX connectors). Options: DISABLED, DAISY_CHAIN, FAN_OUT

# ------------------------------------------------------------------------------------------
# DataAnalysis
# ------------------------------------------------------------------------------------------
DataAnalysis                       ALL                  # Data Analysis mode (statistics, measures, plots). Options: NONE, CNT_ONLY, CNT+MEAS, CNT+HISTO, ALL
LeadTrail_LSB                      0                    # Leading/Trailing LSB : LSB = 3.125ps * 2^N, Max N=10 (Max LSB = ~3.125 ns). Min=0, Max=10
LeadTrailHistoNbin                 4K                   # Number of channels (bins) in the Lead/Trail histogram. Options: 256, 512, 1K, 2K, 4K, 8K, 16K
LeadTrailRebin                     1                    # Rebin factor (Histo_Bin = Orig_Value_LSB / BinSize); The BinSize will be calculated (not read from Config File). Must be a power of 2. Options: 1, 2, 4, 8, 16, 32, 64
LeadHistoMin                       0                    # Min value in for Lead Histogram (if no unit specified, the value is meant in ps)
ToT_LSB                            2                    # ToT LSB: LSB = 3.125ps * 2^N, Max N=18 (Max LSB = ~800 ns). Min=0, Max=18
ToTHistoNbin                       2K                   # Number of channels (bins) in the ToT histogram. Options: 256, 512, 1K, 2K, 4K, 8K, 16K
ToTRebin                           1                    # Rebin factor (Histo_Bin = Orig_Value_LSB / BinSize); The BinSize will be calculated (not read from Config File). Must be a power of 2. Options: 1, 2, 4, 8, 16, 32, 64
ToTHistoMin                        0                    # Min value in for ToA Histogram (if no unit specified, the value is meant in ps)
EnableWalkCorrection               0                    # Enable Walk correction by ToT
WalkFitCoeff                       1.23E-12 33.33 1e-2  # Walk vs ToT calibration curve (up to 5th order polynomial fit)

# ------------------------------------------------------------------------------------------
# Adapters
# ------------------------------------------------------------------------------------------
AdapterType                        NONE                # Adapter Type. Options: NONE, A5256
DiscrThreshold                     100                  # Discriminator Threshold (mV)
DisableThresholdCalib              0                    # Enable/Disable Thresholds Calibration
A5256_Ch0Polarity                  POSITIVE             # Polarity of Ch0 in A5256. Options: POSITIVE, NEGATIVE



# ******************************************************************************************
# Board and Channel settings (overwrite default settings)
# ******************************************************************************************

