Skip to content

Midas Online Data Base (ODB) Configuration

ODB basics

Below are some basic usage examples of midas' ODB

Accessing the ODB

Command line interface

You can edit the ODB via command line without needing a midas webserver running.

$MIDASSYS/bin/odbedit

Then you can navigate through the ODB as you would with linux directory commands. From here, you can type "help" or view the odbedit command list for a list of commands.

Via Midas Webpage

You can start a midas webpage by running mhttpd (or mhttpd6)

$MIDASSYS/bin/mhttpd

Then view the ODB by clicking the ODB button on the left sidebar

General ODB Configuration Examples

For a general guide on how to use Midas' ODB, see the ODB Access and Use wiki page. Below are a few of common ODB

Toggle Logger Data Writing

Field Description
Path /Logger/Write Data
Description Whether or not the Logger will write data
Valid Values yes or no
Suggested Value yes

Change Logger Data Writing Directory

Field Description
Path /Logger/Data dir
Description What directory the logger will write data to
Valid Values any valid path
Suggested Value /path/to/your/online/directory

Note: Change /path/to/your/online/directory to whatever directory you want to write data to

Change Data Buffer Logger Writes to File

Field Description
Path /Logger/Channels/0/Settings/Buffer
Description What directory the logger will write data to
Valid Values any valid buffer name (ex. SYSTEM, BUF001, ...)
Suggested Value SYSTEM

Toggle Logger to generate ODB backups for each run

Field Description
Path /Logger/ODB Dump
Description Whether or not backups of the ODB will be generated after each run
Valid Values yes or no
Suggested Value yes

Logger Max number of events per run

Field Description
Path /Logger/Channels/0/Settings/Event Limit
Description The threshold number of events to be taken before automatically stopping the run. The number of events may not be exact. 0 specifies no such threshold is applied.
Valid Values any non-negative integer
Suggested Value 0

Logger File name key

Field Description
Path /Logger/Channels/0/Settings/Filename
Description Whether or not backups of the ODB will be generated after each run. The string is parsed to include both run and subrun. The first present %0{int}d will correspond to the run number. The second %0{int}d will correspond to the subrun number. One need not include both.
Valid Values any valid string, though it should have at least one variable input to change with run number.
Suggested Value run%05d.mid (For no subruns) or run%05d_%05d.mid (For subruns)

Logger Run Duration

Field Description
Path /Logger/Run duration
Description The number of seconds between each run. After this amount of time the run wil automatically stop. 0 specifies no such duration is applied.
Valid Values any non-negative integer
Suggested Value 0

Logger Subrun Duration

Field Description
Path /Logger/Subrun duration
Description The number of seconds between each subrun. When a new subrun starts, the run does not end, but a new midas file is logged to. 0 specifies no such duration is applied.
Valid Values any non-negative integer
Suggested Value 0

Logger Subrun Byte Limit

Field Description
Path /Logger/Channels/0/Settings/Subrun Byte limit
Description The threshold number of bytes per subrun file before starting a new one. The number of bytes may not be exact. 0 specifies no such threshold is applied.
Valid Values any non-negative integer
Suggested Value yes

Change Webpage Port

Field Description
Path /WebServer/localhost port
Description What port the webserver will run on
Valid Values 0000 to 9999
Suggested Value 8080

Note: To generate this ODB path, run mhttpd or mhttpd6 at least once. It doesn't need to be successful, it just needs to generate the WebServer ODB directory.

Disable a Frontend

Field Description
Path /Equipment/{Frontend Name}/Common/Enabled
Description Whether a frontend is enabled for use or not
Valid Values yes or no
Suggested Value yes

Note: Every Midas frontend generates a Common section it's ODB. For example, Equipment/AMC13001/Common will be generated. This is useful for toggling off crates in multicrate setups.

Change the Data Buffer for a Frontend

Field Description
Path /Equipment/{Frontend Name}/Common/Buffer
Description What midas buffer the frontend will write to
Valid Values any valid string
Suggested Value BUF{3 digit frontend #}

Note: The event builder assumes every buffer for events starts with BUF. So it's best to name frontends BUF followed by their 3 digit frontend number. For example, for AMC13001 frontend, BUF001 is a good name.

Changing Run Number

Field Description
Path /Runinfo/Run number
Description The run the number for the experiment
Valid Values any valid integer
Suggested Value 1

Note: If one decreases the run number, the logger will overwrite that run's data if a run is performed with the old run number again. For this reason, when loading and old ODB save you will want to increase the run number to a value larger than your last successful run number before taking data.


g-2 Modified DAQ Specific ODB Configuration

Below are some important settings in the ODB for the g-2 modified DAQ. This is not a complete description of every setting in the ODB. Many settings are artifacts from g-2 that don't serve any purpose anymore. You can find a script that will automatically set all these parameters to their suggested values in scripts/apply_recommended_ODB_settings.py.

Master Frontend ODB settings

Trigger Source

Field Description
Path /Equipment/MasterGM2/Settings/Globals/Trigger Source
Description Determines what source the Master will use to trigger events
Valid Values GPS, PP (currently broken), Fake, Socket (untested), None, ODB, and FC7
Suggested Value FC7

Note: The meaning of each value is specified below:

  • GPS: Uses the Meinberg GPS timestamps for Master triggers.

  • PP: Uses parallel port signals as the trigger source (currently broken).

  • Fake: Uses a fake signal for testing purposes. Further configuration in ODB.

  • Socket: Uses a socket connection as the trigger source (untested).

  • None: No trigger source is used, no master triggers are made.

  • ODB: Reads ODB to send triggers at a rate similar to the rate the AMC13 receives triggers.

  • FC7: Uses FC7's trigger counter over IPMI to trigger events

Front End Offset

Field Description
Path /Equipment/MasterGM2/Settings/Globals/Front End Offset
Description Offset for index for the IPs of the first frontend. For example if your MCH IP is 192.168.3.15, then you'd want this offset to be 3.
Valid Values Positive integer < 1000
Suggested Value 1

Encoder Front End

Field Description
Path /Equipment/MasterGM2/Settings/Globals/Encoder Front End
Description Identifier for frontend that corresponds to the crate containing the encoder FC7
Valid Values AMC13001, AMC13002, ...
Suggested Value AMC13001

AMC13 Readout Frontend ODB settings

Any setting not mentioned is either an artifact of g-2 (doesn't do anything) or shouldn't need to be modified from its default value. For example, most of the TQ01, TQ02, TQ03, and TQ04 no longer function.

Send to Event Builder

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Globals/Send to Event Builder
Description Defines whether or not data is sent to event builder frontend
Valid Values yes or no
Suggested Value yes

Note: It is best to have this set to yes as it won't affect data readout even if the event buidler isn't used.

MCH IP Address

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Globals/MCH IP Address
Description Set to MCH IP address for the MCH in this crate
Valid Values Any valid IP address
Suggested Value 192.168.1.15

Note: This is the address in which the frontends sent IPMI commands to. If this is incorrect none of the crate components can be properly intialized for a data run. Each frontend (crate) should have it's own MCH IP address.

CCC: FC7 Slot Number (1-12)

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Globals/CCC: FC7 Slot Number (1-12)
Description Slot number of the encoder FC7 in the uTCA crate
Valid Values 1, 2, ... 12
Suggested Value 10

Note: For crates without an FC7, this value does not matter. Just set it to the same value as the crate with the encoder FC7.

CCC: FMC Location (top,bottom)

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Globals/CCC: FMC Location (top, bottom)
Description The location of the SFP interface FMC card on the FC7 board
Valid Values top or bottom
Suggested Value top

Note: See FC7 Labeling to decide whether your FMC SFP interface is on the top or the bottom (the FC7 firmware requires the SFP interface FMC is in the top slot).

CCC: FMC SFP Number (1-8)

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Globals/CCC: FMC SFP Number (1-8)
Description The FC7 SFP slot number this AMC13 is connected to by optical cable
Valid Values 1, 2, ... 8
Suggested Value 1 (for the first crate)

Note: See FC7 Labeling to decide which port your optical connection is.

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Link01/Enabled
Description Toggles the 10GbE link for this AMC13
Valid Values 0 or 1
Suggested Value 1

AMC13 SFP IP Address

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Link01/AMC13 SFP IP Address
Description Specifies the 10GbE link IP
Valid Values Any valid IP
Suggested Value 192.168.50.1

Note: This is the AMC13 IP that data is sent over. If this is incorrect, not data will be transferred from the crate. Each frontend (crate) should have a different AMC13 SFP IP address.

AMC13 SFP Port Number

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Link01/AMC13 SFP Port Number
Description Specifies which SFP port on the AMC13 is used for the 10GbE link
Valid Values 0x00001234, unsure about others
Suggested Value 0x00001234

Note: 0x00001234 corresponds to the top port on the AMC13. I would not change this value unless you know what you're doing.

AMC13 T1 Firmware Version Required

Field Description
Path /Equipment/AMC13{frontend #}/Settings/AMC13/T1 Firmware Version Required
Description The minimum required firmware version for the virtex (T1) FPGA in the AMC13
Valid Values Any positive integer
Suggested Value 33087

AMC13 T2 Firmware Version Required

Field Description
Path /Equipment/AMC13{frontend #}/Settings/AMC13/T2 Firmware Version Required
Description The minimum required firmware version for the spartan (T2) FPGA in the AMC13
Valid Values Any positive integer
Suggested Value 46

AMC13 T1 Address Table Location

Field Description
Path /Equipment/AMC13{frontend #}/Settings/AMC13/T1 Address Table Location
Description The path to the AMC13 virtex (T1) adress table xml file
Valid Values Any valid path
Suggested Value $GM2DAQ_DIR/address_tables/AMC13XG_T1.xml

AMC13 T2 Address Table Location

Field Description
Path /Equipment/AMC13{frontend #}/Settings/AMC13/T2 Address Table Location
Description The path to the AMC13 spartan (T2) adress table xml file
Valid Values Any valid path
Suggested Value $GM2DAQ_DIR/address_tables/AMC13XG_T2.xml

Enable FC7

Field Description
Path /Equipment/AMC13{frontend #}/Settings/FC7-{slot #}/Common/Enabled
Description Whether or not this FC7 in the crate is enabled or not
Valid Values yes or no
Suggested Value yes

FC7 Address Table

Field Description
Path /Equipment/AMC13{frontend #}/Settings/FC7-{slot #}/Common/Address Table Location
Description The path to the FC7 address table xml file
Valid Values Any valid path
Suggested Value $GM2DAQ_DIR/address_tables/FC7_CCC.xml

FC7 Board Type

Field Description
Path /Equipment/AMC13{frontend #}/Settings/FC7-{slot #}/Common/Board (encoder,fanout,trigger)
Description What job the FC7 is set to do
Valid Values encoder,fanout, or trigger
Suggested Value encoder

Note: The FC7 firmware has been modified so now the encoder FC7 can do the job of the trigger and encoder FC7s.

FC7 Firmware Version Required

Field Description
Path /Equipment/AMC13{frontend #}/Settings/FC7-{slot #}/Common/FPGA Firmware Version Required
Description The minimum required firmware version for the FC7
Valid Values Any valid string (ex. 8.1.7)
Suggested Value 8.1.7

Internal Trigger

Field Description
Path /Equipment/AMC13{frontend #}/Settings/FC7-{slot #}/Encoder/Internal Trig Enabled
Description Whether an external or internal trigger are used to trigger events
Valid Values yes or no
Suggested Value no

Note: This is useful for debugging because it removes the need for having/building an external trigger signal. However, the triggers are periodic so the digitized data will be "random" windows of signal or noise.

Internal Trigger Period (us)

Field Description
Path /Equipment/AMC13{frontend #}/Settings/FC7-{slot #}/Encoder/Internal Trig Period (us)
Description The period of the internal trigger in micro seconds
Valid Values any positive integer
Suggested Value 500

Note: After each trigger, there is some deadtime. Therefore this value should be longer than the deadtime; otherwise there will be unintended results.

Internal Trigger Pulse Width (ns)

Field Description
Path /Equipment/AMC13{frontend #}/Settings/FC7-{slot #}/Encoder/Internal Pulse Width (ns)
Description The width of the internal trigger pulse in nanoseconds
Valid Values any positive integer
Suggested Value 100

TTC deadtime (ns)

Field Description
Path /Equipment/AMC13{frontend #}/Settings/FC7-{slot #}/Encoder/TTC deadtime (ns)
Description The amount of deadtime (time with no new triggers) after each trigger
Valid Values any positive integer
Suggested Value 100000

Note: The achievable rate is limited by this value. For example, if using the suggested value the DAQ cannot trigger at more than 10 kHz.

Enabled WFD5

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Board/Address Table Location
Description Whether or not this WFD5 is active for data taking
Valid Values yes or no
Suggested Value yes

WFD5 Address Table

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Board/Address Table Location
Description The path to the WFD5 address table xml file
Valid Values Any valid path
Suggested Value $GM2DAQ_DIR/address_tables/WFD5.xml

WFD5 Master Firmware Version

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Board/Master Firmware Version
Description Channel Firmware version for the WFD5
Valid Values any valid version string
Suggested Value 3.1.1

WFD5 Channel Firmware Version

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Board/Chanel Firmware Version
Description Channel Firmware version for the WFD5
Valid Values any valid version string
Suggested Value 3.1.1

WFD5 Digitization Frequency

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Board/Gitization Frequency (MHz)
Description Frequency at which samples are digitized
Valid Values 800 divided by any power of 2 (for example, 200 is valid)
Suggested Value 800

WFD5 Circular Buffer Mode Enabled

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Board/CircBuf Mode: Enabled
Description Puts a WFD5 into circular buffer mode for data taking
Valid Values yes or no
Suggested Value yes

WFD5 Waveform Length

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Board/Async CBuf Waveform Length
Description The total number of samples digitized for each waveform trigger
Valid Values Any positive integer
Suggested Value 800

Note Each sample corresponds to a time window of 1/Digitization Frequency. So by default each sample corresponds to a 1.25 ns time window.

WFD5 Waveform Presamples

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Board/Async CBuf Waveform Presamples
Description How many of the waveform samples are taken before the trigger
Valid Values Any positive integer
Suggested Value 600

Note: This value must be less than the value of WFD5 Waveform Length.

WFD5 Channel Enabled

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Channel{channel #}/Enabled
Description Whether this channel of the WFD5 is enabled for data taking or not
Valid Values yes or no
Suggested Value yes

WFD5 Channel Input Signal Offset

Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Channel{channel #}/Input Signal Offset
Description Offset for pedestals signal sits on. Range of ADC values is -2048 to 2047. Setting of 0 corresponds to a pedestal of ~-1750, value of 65535 corresponds to a pedestal of ~1750
Valid Values Integer between 0 and 65535 (2 byte positive int)
Suggested Value 0 for positive signals, 65535 for negative signals.

TQ methods GPU Bank Processing

Field Description
Path /Equipment/AMC13{frontend #}/Settings/TQ{#}/GlobalParameters/GPU T,Q,P bank processing
Description Whether the GPU is used to process this midas bank or not
Valid Values yes or no
Suggested Value no
Field Description
Path /Equipment/AMC13{frontend #}/Settings/TQ{#}/GlobalParameters/GPU H bank processing
Description Whether the GPU is used to process this midas bank or not
Valid Values yes or no
Suggested Value no

Note: All of the TQ method settings are artifacts of g-2. We just want to make sure they are off.

WFD5 Async Mode

"Async Mode" refers to a mode where each midas event contains 20 traces from each digitizer channel, which may increase the effective data collection rate. However, this mode is currently not working.

To turn on async mode set WFD5 Async Mode Enabled (in another place) and TTC Async Mode Enabled to yes. For each digitizer, set WFD5 Async Mode Enabled to yes. Furthermore WFD5 Circular Buffer Mode should be set to no. Otherwise the behavior will be unpredictable. I understand this is a bit convoluted, but this was hastily put together during the 2023 PSI LYSO test beam. There is slightly more documentation on this elog entry.

WFD5 Async Mode Enabled
Field Description
Path /Equipment/AMC13{frontend #}/Settings/Rider{slot #}/Board/Async Mode: Enabled
Description Puts a WFD5 into async mode for data taking
Valid Values yes or no
Suggested Value no
WFD5 Async Mode Enabled (in another place)
Field Description
Path /Equipment/AMC13{frontend #}/Settings/FC7-{slot #}/Encoder/WFD5 Async Mode Enabled
Description Lets FC7s know WFD5s are in async mode for data taking
Valid Values yes or no
Suggested Value no
TTC Async Mode Enabled
Field Description
Path /Equipment/AMC13{frontend #}/Settings/FC7-{slot #}/Encoder/TTC Async Mode Enabled
Description Puts FC7 into async mode for data taking
Valid Values yes or no
Suggested Value no