# ******************************************************************************************
# 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
PresetTime                         1 m                  # Preset Time
PresetCounts                       1000                 # Preset Counts (number of acquired events)
JobFirstRun                        1                    # First Run of the Job
JobLastRun                         5                    # Last Run of the Job
RunSleep                           0 s                  # Wait Time between runs of a job
EnableJobs                         0                    # Enable Jobs
RunNumber_AutoIncr                 0                    # Run Number auto increment
DataFilePath                       DataFiles            # Destination folder to save the output files
OF_OutFileUnit                     ns                   # ToA and ToT unit. Options: LSB, ns
OF_EnMaxSize                       0                    # Limited Max File List Size
OF_MaxSize                         1 GB                 # Max size of List files (in Bytes), minimum size allowed 1 MB
OF_RawData                         0                    # Event List file (Raw Data)
OF_ListBin                         0                    # Event List file (binary)
OF_ListAscii                       0                    # Event List file (ASCII)
OF_ListCSV						   0					# Event List file (CSV)
OF_Sync                            0                    # List with BrdID-Tstamp-TrgID (for sync check)
OF_ServiceInfo                     0                    # Service event info (temperatures)
OF_RunInfo                         0                    # Run Info
OF_LeadHisto                       0                    # Leading edge timing spectrum
OF_ToTHisto                        0                    # ToT spectrum

# ------------------------------------------------------------------------------------------
# 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                    COMMON_START         # 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_Empty_Ev_Suppr                  0                    # Enable empty event suppression
En_Head_Trail                      ONE_WORD             # Enable Header and Trailer. Options: KEEP_ALL, ONE_WORD
TriggerSource                      PTRG                 # Trigger source. Options: SW_ONLY, T1-IN, T0-IN, PTRG, EDGE_CONN, MASK
TrefSource                         CH0                  # Time reference source. Options: T0-IN, T1-IN, PTRG, CH0
VetoSource                         DISABLED             # The veto signal inhibits the bunch trigger (active high). Options: DISABLED, T0-IN, T1-IN, MASK
GateWidth                          1 us                 # Gate Width (will be rounded to steps of 12.5 ns)
TrgWindowWidth                     2 us                 # Trigger Window Width (will be rounded to steps of 12.5 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.5 ns)
PtrgPeriod                         1 ms                 # Period of the internal periodic trigger
DigitalProbe0                      OFF                  # 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                      OFF                  # 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). Options: 4, 8, 16, 32, 64, 128, 256, 512
TDCpulser_Width                    1 ns                 # picoTDC Pulser Output (width in ns)
TDCpulser_Period                   10 ns                # picoTDC Pulser Output (period in ns)
TriggerBufferSize                  16                   # FPGA Trigger Buffer Size (limits num of pending triggers waiting for readout)	
HighResClock                       DISABLED             # High Res Clock Distribution (MCX connectors). Options: DISABLED, DAISY_CHAIN, FAN_OUT

# ------------------------------------------------------------------------------------------
# Histogram
# ------------------------------------------------------------------------------------------
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                            0                    # 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)
DiscrThreshold2                    500                  # 2nd Discriminator Threshold (mV)
A5256_Ch0Polarity                  POSITIVE             # Polarity of Ch0 in A5256. Options: POSITIVE, NEGATIVE


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

