gondola.tof#
TOF related entities which did not fit anywhere else
Functions
|
Apply a config diff |
|
Enable verfication runs before every run start |
|
Custom run action foxtrott |
|
Restart the liftof-rb clients on the given boards |
|
Trigger the start of a new data run with the next active config |
|
Custom run action alfa |
|
Custom run action bravo |
|
Custom run action charlie |
|
Custom run action foxtrott |
|
Custom run action tango |
|
Custom run action whiskey |
Send the 'sudo shutdown now' command to ALL RBs |
|
|
Send the 'sudo shutdown now' command to all RBs in a RAT |
|
Send the 'sudo shutdown now' command to all RBs in a RAT |
|
Send the 'sudo shutdown now' command to a single RB |
Send the 'sudo shutdown now command to the TOF main computer ("TOFCPU") |
|
Trigger the start of a new data run with the next active config |
|
|
Stop the current active run and idle |
Classes
Settings to change the configuration of the analysis engine (pulse extraction) |
|
|
|
Set preamp voltages |
|
Squeze the rb channel - paddle mapping into 5 bytes for a single RB |
|
A general command class with an arbitrary payload |
|
|
Sets of cuts which can be imposed on TofEvents |
Report dead channels/non-active detectors for the TOF system |
|
- gondola.tof.shutdown_tofcpu()#
Send the 'sudo shutdown now command to the TOF main computer ("TOFCPU")
- gondola.tof.shutdown_rb(rb)#
Send the 'sudo shutdown now' command to a single RB
- # Arguements:
- rbThe RB id of the RB to be shutdown
(NOT RAT)
- gondola.tof.shutdown_ratpair(pdu, pduchannel)#
Send the 'sudo shutdown now' command to all RBs in a RAT
This will prepare the shutdown command for the RBs in the RATs which are connected to a specific pdu channel
- # Arguments:
pdu : PDU ID (0-3)
pduchannel : PDU Channel (0-7)
- gondola.tof.shutdown_rat(rat)#
Send the 'sudo shutdown now' command to all RBs in a RAT
- # Arguments:
- ratThe RAT id for the rat the RBs to be
shutdown live in
- gondola.tof.shutdown_all_rbs()#
Send the 'sudo shutdown now' command to ALL RBs
- gondola.tof.restart_liftofrb(rbs)#
Restart the liftof-rb clients on the given boards
- # Arguments
- rbs: restart the client on the given rb ids,
if empty, restart on all of them
- gondola.tof.enable_verification_run(enabled)#
Enable verfication runs before every run start
A verification run will not send any event packets, but only a TofDetectorStatus frame
- gondola.tof.stop_run()#
Stop the current active run and idle
- gondola.tof.start_run()#
Trigger the start of a new data run with the next active config
- gondola.tof.waveform_analysis(event, rb, settings)#
Waveform analysis engine - identify waveform variables
This will populate the TofHits in an RBEvent
TofHits contain information about peak location, charge, timing.
FIXME - I think this should take a HashMap with algorithm settings, which we can load from a json file
# Arguments
- eventcurrent RBEvent with waveforms to
work on
- rbReadoutBoard as loaded from the DB,
with latest calibration attached
- settingsParameters to configure the waveform
analysis & peak finding
- class gondola.tof.MasterTrigger(target_address)#
- clock_rate#
- disable_cyclic_trig()#
- enable_cyclic_trig()#
- get_configurable_trigger()#
- get_cortina_thresh()#
- get_cube_bot_thresh()#
- get_cube_corner_thresh()#
- get_cube_side_thresh()#
- get_cube_top_thresh()#
- get_cyclic_trigger_interval()#
- get_enable_cyclic_trig()#
- get_event(read_until_footer, verbose, debug)#
- get_event_cnt()#
- get_event_queue_full()#
- get_event_queue_size()#
- get_expected_pid()#
- get_gaps_trigger_prescale()#
- get_inner_tof_thresh()#
- get_lt_link_automask()#
get LT LINK AUTOMASK toggle status
- get_lt_link_en0()#
Get the status of enabling for LTBs 0-9
- get_lt_link_en02()#
Get the status of enabling for LTBs 20-29
- get_lt_link_en1()#
Get the status of enabling for LTBs 10-19
- get_lt_link_en3()#
Get the status of enabling for LTBs 30-39
- get_lt_link_en4()#
Get the status of enabling for LTBs 40-49
- get_ltb_event_cnts()#
- get_ltb_links_ready()#
- get_nevents_in_queue()#
- get_outer_tof_thresh()#
- get_packet_id()#
- get_rb_event_cnts()#
Readout the RB event counter registers
- get_tiu_emulation_mode()#
Check if the TIU emulation mode is on
- get_total_tof_thresh()#
- get_trace_suppression()#
- get_umbrella_center_thresh()#
- get_umbrella_thresh()#
- ignore_tiu_busy#
check if the MTB is ignoring the TIU and using fixed internal busy
- lost_rate#
Get the lost global trigger rate in Hz
This is the rate of triggers which got dropped due to TIU BUSY signal + those which get dropped due to the RBs being busy
- prescale_bypass#
- rate#
Get the global trigger rate in Hz
- rb_lost_rate#
The lost rate which occured due to RB busy timeouts
- realign_packet_id()#
- reset_daq()#
- reset_ltb_counters()#
Reset all the LTB counters
- reset_rb_counters()#
Reset all the RB counters
- set_any_trigger(prescale)#
- set_central_track_trigger(prescale)#
- set_configurable_trigger(value)#
- set_corcubeside_trigger()#
- set_cortina_thresh(value)#
- set_cube_bot_thresh(value)#
- set_cube_corner_thresh(value)#
- set_cube_side_thresh(value)#
- set_cube_top_thresh(value)#
- set_cyclic_trigger_interval(interval)#
- set_gaps422_central_track_trigger(prescale, use_beta)#
- set_gaps_any_trigger(prescale, use_beta)#
- set_gaps_central_track_trigger(prescale, use_beta)#
- set_gaps_track_trigger(prescale, use_beta)#
- set_gaps_trigger_prescale(prescale)#
- set_inner_tof_thresh(value)#
- set_lt_link_automask(toggle)#
set LT LINK AUTOMASK toggle status
- set_lt_link_en0(value)#
Set on/off link enabling for LTBs 0-9
- set_lt_link_en1(value)#
Set on/off link enabling for LTBs 10-19
- set_lt_link_en2(value)#
Set on/off link enabling for LTBs 20-29
- set_lt_link_en3(value)#
Set on/off link enabling for LTBs 30-39
- set_lt_link_en4(value)#
Set on/off link enabling for LTBs 40-49
- set_ltb_ch_mask(lt_link, mask)#
Set a channel mask for a LTB.
# Arguments * lt_link : 0-24, dsi/j connection of the LTB on the MTB * mask : bitmask 1 = ch0 2 = ch1, etc. setting a channel
to 1 will DISABLE the channel!
- set_outer_tof_thresh(value)#
- set_packet_id(pid)#
- set_poisson_trigger(rate)#
- set_total_tof_thresh(value)#
- set_trace_suppression(trace_sup)#
- set_track_trigger(prescale)#
- set_track_trigger_is_global()#
- set_umb3cube_trigger()#
- set_umbcorcube_trigger()#
- set_umbcube_trigger()#
- set_umbcubez_trigger()#
- set_umbrella_center_thresh(value)#
- set_umbrella_thresh(value)#
- stop_all_triggers()#
- swap_rb_link_ids#
- tiu_bad#
- tiu_busy_ignore#
- tiu_busy_rate#
get tiu busy rate in Hz
- tiu_busy_stuck#
- tiu_emulation_mode#
- tiu_emulation_mode_bsy_cnt#
- tiu_lost_rate#
The lost rate which occured due to the tracker BUSY signal
- tiu_timeout_cnt#
the amount of fixed deadtime used by the tiu in units of 10ns
- trg_lost_trg_rate#
the lost rate due to the trigger internal busy
- trigger()#
Issue a one-time forced trigger
- use_tiu_aux_link(use_it)#
- class gondola.tof.TofAnalysis(skip_mangled=True, skip_timeout=True, beta_analysis=True, nbins=90, cuts=<TofCuts: <TofCuts: (void)>>, use_offsets=False, pid_inner=None, pid_outer=None, active=False)#
A container (yeah I know, don't like it either) to keep a bunch of plots together.
This does have some use as a pre-compiled analysis for gander, and as a quick look kind of thing.
The gist here it is independent of the data source, as long as some kind of TofEvent can be plugged in.
- define_bins(nbins=70)#
Set the bins for the different histograms for the variables. Only the number of bins can be set
- pretty_print_statistics()#
A textual representation for some important numbers, e.g. seen events, cut efficiencies, etc.
- property occupancy#
- property occupancy_t#
- property n_events#
- property rate#
- property rate_nocut#
- property run_time#
Get run time from last - first event in seconds
- reinit(nbins=90)#
Re-run the initialization routine. This will clear all plots, and reset the binning. This needs to be run in case the binning has been changed
- __init__(skip_mangled=True, skip_timeout=True, beta_analysis=True, nbins=90, cuts=<TofCuts: <TofCuts: (void)>>, use_offsets=False, pid_inner=None, pid_outer=None, active=False)#
Start a new TofAnalysis. This will add create histograms for 'interesting' variables and count mangled and timed out events. While not complete, this can provide a conciese, first look for a run. Events can be added to this analysis through the .add_event(ev) method. When all events are added, a call to .finish() is needed to make sure all events in the caches are added to the histograms. Caching is used to massively improve performance, since adding individual numbers to dashi.histograms is painfully slow.
# Arguments:
- skip_mangledIgnore events which have the "AnyDataMangling"
flag set
- skip_timeoutIgnore events which have the "EventTimedOut"
flag set
- beta_analysisLook for first hit on outer tof/inner tof and
use these for a beta calculation. If pid_outer and pid_inner are given, use these paddles instead.
- nbinsThe number of bins for the histograms getting
created
- cutsGive a cut instance to reject events & hits.
Default: None (no cuts)
- pid_outerSelect a specific paddle instead of the first on the outer TOF
for the beta/timing analysis
- pid_innerSelect a specific paddle instead of the first on the inner TOF
for the beta/timing analysis
- activeif True, this analysis will actually "do something"
and acquire events
- property no_hitmiss#
- property one_hitmiss#
- property two_hitmiss#
- property extra_hits#
- property n_mangled_frac#
- property n_timed_out_frac#
- property event_stati#
- fill_histograms()#
Fill the histograms with the cached values
- finish()#
Ensure the remainder in the caches is histogrammed
- add_event(ev)#
Fills the associated histograms
- # Arguments:
ev : Any kind of TofEvent or TofEventSummary
- gondola.tof.to_board_id_string(rb_id)#
Convert an int value to the board ID string.
- class gondola.tof.TofCuts#
Sets of cuts which can be imposed on TofEvents
- acc_frac_cos_theta#
- acc_frac_fh_must_be_umb#
- acc_frac_fhi_not_bot#
- acc_frac_fho_must_panel7#
- acc_frac_hit_all#
- acc_frac_hit_cbe#
- acc_frac_hit_cor#
- acc_frac_hit_umb#
- acc_frac_lh_must_panel2#
- accept(event)#
- clear_stats()#
- copy()#
Return a literal full deep copy of the instance
- cos_theta_acc#
- fh_must_be_umb#
- fh_umb_acc#
- fhi_not_bot#
- fhi_not_bot_acc#
- fho_must_panel7#
- fho_must_panel7_acc#
- static from_toml(filename)#
- get_frac_thru_going#
- hit_all_acc#
- hit_cbe_acc#
- hit_cor_acc#
- hit_high_edep#
- hit_high_edep_acc#
- hit_umb_acc#
- hits_rmvd_csl#
- hits_rmvd_ls#
- hits_total#
- is_compatible(other)#
- lh_must_panel2#
- lh_must_panel2_acc#
- ls_cleaning_t_err#
- max_cos_theta#
- max_hit_all#
- max_hit_cbe#
- max_hit_cor#
- max_hit_umb#
- min_cos_theta#
- min_hit_all#
- min_hit_cbe#
- min_hit_cor#
- min_hit_umb#
- nevents#
- only_causal_hits#
- pretty_print_efficiency()#
Return a prettily formated string with the efficiency information for all the individual cuts
- thru_going#
- thru_going_acc#
- to_toml(filename)#
- void#
- class gondola.tof.TofRunConfig#
- static from_bytestream(bytestream, pos)#
- static from_random()#
- static from_tofpacket(packet)#
- pack()#
Pack self into a TofPacket to be written on disk or sent over network
- runtime#
- set_runtime#
- class gondola.tof.TriggerConfig#
- combo_trigger_prescale#
- combo_trigger_type#
- static from_bytestream(bytestream, pos)#
- static from_random()#
- static from_tofpacket(packet)#
- gaps_trigger_use_beta#
- hb_send_interval#
- mtb_moni_interval#
- pack()#
Pack self into a TofPacket to be written on disk or sent over network
- prescale#
- set_combo_trigger_prescale#
- set_combo_trigger_type#
- set_gaps_trigger_use_beta#
- set_hb_send_interval#
- set_mtb_moni_interval#
- set_prescale#
- set_tiu_ignore_busy#
- set_trace_suppression#
- set_trigger_type#
- set_use_combo_trigger#
- tiu_ignore_busy#
- to_bytestream()#
- trace_suppression#
- trigger_type#
- use_combo_trigger#
- class gondola.tof.RBChannelMaskConfig#
- class gondola.tof.PreampBiasConfig#
Set preamp voltages
- class gondola.tof.TofCommand#
A general command class with an arbitrary payload
Since the commands should in general be small the maixmal payload size is limited to 256 bytes
All commands will get broadcasted and the receiver has to figure out if they have to rect to that command
- command_code#
- static from_bytestream(bytestream, pos)#
- static from_random()#
- static from_tofpacket(packet)#
- get_cc_u8()#
An explicit getter for the command code, to interface with BFSW/GSE systems
- pack()#
Pack self into a TofPacket to be written on disk or sent over network
- to_bytestream()#
- wrap_n_pack()#
Pack myself nicely in a TofPacket and serialize myself
Can be used to interface with BFSW/GSE systems
- class gondola.tof.TofOperationMode#
How to operate the readout Default mode is to request events from the MasterTrigger. However, we can also stream all the waveforms. CAVEAT: For the whole tof, this will cap the rate at 112 Hz, because of the capacity of the switches.
- Default = TofOperationMode.Default#
- RBCalcCRC32 = TofOperationMode.RBCalcCRC32#
- RBHighThroughput = TofOperationMode.RBHighThroughput#
- RBWaveform = TofOperationMode.RBWaveform#
- Unknown = TofOperationMode.Unknown#
- static from_u8(byte)#
- class gondola.tof.BuildStrategy#
Build Strategy
- Adaptive = BuildStrategy.Adaptive#
- AdaptiveGreedy = BuildStrategy.AdaptiveGreedy#
- AdaptiveThorough = BuildStrategy.AdaptiveThorough#
- Smart = BuildStrategy.Smart#
- Unknown = BuildStrategy.Unknown#
- WaitForNBoards = BuildStrategy.WaitForNBoards#
- static from_u8(byte)#
- class gondola.tof.TofCommandCode#
- ChangeNextRunConfig = TofCommandCode.ChangeNextRunConfig#
- DataRunStart = TofCommandCode.DataRunStart#
- DataRunStop = TofCommandCode.DataRunStop#
- GetFullWaveforms = TofCommandCode.GetFullWaveforms#
- Kill = TofCommandCode.Kill#
- Listen = TofCommandCode.Listen#
- Lock = TofCommandCode.Lock#
- Moni = TofCommandCode.Moni#
- NoSendRBWaveforms = TofCommandCode.NoSendRBWaveforms#
- NoSendTofEvents = TofCommandCode.NoSendTofEvents#
- Ping = TofCommandCode.Ping#
- RBCalibration = TofCommandCode.RBCalibration#
- RequestLiftofSettings = TofCommandCode.RequestLiftofSettings#
- ResetConfigWDefault = TofCommandCode.ResetConfigWDefault#
- RestartLiftofRBClients = TofCommandCode.RestartLiftofRBClients#
- RunScriptAlfa = TofCommandCode.RunScriptAlfa#
- RunScriptBravo = TofCommandCode.RunScriptBravo#
- RunScriptCharlie = TofCommandCode.RunScriptCharlie#
- RunScriptFoxtrott = TofCommandCode.RunScriptFoxtrott#
- RunScriptTango = TofCommandCode.RunScriptTango#
- RunScriptWhiskey = TofCommandCode.RunScriptWhiskey#
- SendRBWaveforms = TofCommandCode.SendRBWaveforms#
- SendTofEvents = TofCommandCode.SendTofEvents#
- SetAnalysisEngineConfig = TofCommandCode.SetAnalysisEngineConfig#
- SetDataPublisherConfig = TofCommandCode.SetDataPublisherConfig#
- SetLTBThresholds = TofCommandCode.SetLTBThresholds#
- SetMTConfig = TofCommandCode.SetMTConfig#
- SetPreampBias = TofCommandCode.SetPreampBias#
- SetRBChannelMask = TofCommandCode.SetRBChannelMask#
- SetTOFEventBuilderConfig = TofCommandCode.SetTOFEventBuilderConfig#
- SetTofRBConfig = TofCommandCode.SetTofRBConfig#
- SetTofRunConfig = TofCommandCode.SetTofRunConfig#
- ShutdownCPU = TofCommandCode.ShutdownCPU#
- ShutdownRAT = TofCommandCode.ShutdownRAT#
- ShutdownRATPair = TofCommandCode.ShutdownRATPair#
- ShutdownRB = TofCommandCode.ShutdownRB#
- Staging = TofCommandCode.Staging#
- StartValidationRun = TofCommandCode.StartValidationRun#
- SubmitConfig = TofCommandCode.SubmitConfig#
- Unknown = TofCommandCode.Unknown#
- Unlock = TofCommandCode.Unlock#
- UnspoolEventCache = TofCommandCode.UnspoolEventCache#
- UploadConfig = TofCommandCode.UploadConfig#
- UploadConfigDiff = TofCommandCode.UploadConfigDiff#
- static from_u8(byte)#
- class gondola.tof.AnalysisEngineSettings#
Settings to change the configuration of the analysis engine (pulse extraction)
- cfd_fraction#
- find_pks_t_start#
- find_pks_t_window#
- find_pks_thresh#
- integration_start#
- integration_window#
- max_peaks#
- min_peak_size#
- pedestal_begin_bin#
- pedestal_thresh#
- pedestal_win_bins#
- tot_threshold_high#
- tot_threshold_low#
- use_zscore#
- class gondola.tof.TofDetectorStatus#
Report dead channels/non-active detectors for the TOF system
This is a very simple approach A channels are the paddle_id - 1 while B channels are encoded as paddle_id - 159
Dead channels will be 0, active channels will be 1
- channels000_031#
- channels032_063#
- channels064_095#
- channels096_127#
- channels128_159#
- channels160_191#
- channels192_223#
- channels224_255#
- channels256_297#
- channels298_319#
- static from_bytestream(bytestream, pos)#
- static from_random()#
- static from_tofpacket(packet)#
- pack()#
Pack self into a TofPacket to be written on disk or sent over network
- class gondola.tof.RBPaddleID#
Squeze the rb channel - paddle mapping into 5 bytes for a single RB
- get_paddle_id(channel)#
Modules