Low-Energy Muon (LEM) Experiment  0.5.1
vme_fe.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <math.h>
#include <include/linux/version.h>
#include "midas.h"
#include "mcstd.h"
#include "sis3820.h"
#include "v1190.h"
#include "experim.h"
#include "nemu_experim.h"
Include dependency graph for vme_fe.c:

Go to the source code of this file.

Data Structures

struct  TDC_EVAL_EVENT
 
struct  TDC_PILEUP
 

Macros

#define SIS3820_ADDRESS_0   0x38000000
 Local definitions to connect to VME module. More...
 
#define SIS3820_ADDRESS_1   0x39000000
 VME address of 2nd scaler module. More...
 
#define V1190_ADDRESS   0xEE000000
 the VME address of the CAEN V1190 TDC More...
 
#define MAX_NUMBER_LWORDS   1024
 max number of block data transfer */ More...
 
#define ALMOST_FULL_LEVEL   1024
 
#define DATABUFFER_SIZE   131072
 set size of FiFo (ring) buffer, 2^17 More...
 
#define DIFF_TOLERANCE   -12200
 
#define TD_EVENT   (1<<0)
 Event flags. More...
 
#define LE_POSITRON_EVENT   (1<<1)
 
#define M2_EVENT   (1<<2)
 
#define BC_EVENT   (1<<3)
 
#define M1_EVENT   (1<<4)
 
#define M1_POSITRON_EVENT   (1<<5)
 
#define MASTERLAST   1
 timing flags More...
 
#define MASTERFIRST   2
 
#define BINNING   0.1953125
 

Functions

INT frontend_init ()
 
INT frontend_exit ()
 
INT begin_of_run (INT run_number, char *error)
 
INT end_of_run (INT run_number, char *error)
 
INT pause_run (INT run_number, char *error)
 
INT resume_run (INT run_number, char *error)
 
INT frontend_loop ()
 
INT read_trigger_event (char *pevent, INT off)
 
INT poll_event (INT source, INT count, BOOL test)
 
INT read_scaler_event (char *pevent, INT off)
 
INT read_slowcontrol_event (char *pevent, INT off)
 
INT do_channel (INT ch, INT time)
 
INT do_master_channel (INT ch, INT event_type)
 
U_LONG pileup_end (INT pileupWindow)
 
INT evaluate_slow_muon_event ()
 
INT evaluate_fast_muon_event ()
 
BOOL check_tof_and_pileup (INT timing, INT tofWindow, INT firstCh, INT lastCh, INT masterChannel, INT masterIndex, INT *channel, INT *ind)
 
BOOL check_positron (INT decWindow, INT coincWindow, INT firstCh, INT lastCh, INT masterChannel, INT masterIndex, INT *channel, INT *ind)
 
void scaler_mode (u_int32_t module_address)
 
int init_sis3820 (u_int32_t module_address)
 
int init_v1190 (u_int32_t module_address)
 
void OnOff_mode ()
 
INT interrupt_configure (INT cmd, INT source, PTYPE adr)
 

Variables

char * frontend_name = "VME_FE"
 experiment specific ODB structures More...
 
char * frontend_file_name = __FILE__
 The frontend file name, don't change it. More...
 
BOOL frontend_call_loop = TRUE
 frontend_loop is called periodically if this variable is TRUE More...
 
INT display_period = 3000
 a frontend status page is displayed with this frequency in ms More...
 
INT max_event_size = 128000
 maximum event size produced by this frontend More...
 
INT max_event_size_frag = 5*1024*1024
 maximum event size for fragmented events (EQ_FRAGMENTED) More...
 
INT event_buffer_size = 60*10000
 buffer size to hold events More...
 
TRIGGER_SETTINGS trigger_settings
 /Equipment/Trigger/Settings More...
 
SCALER_SETTINGS scaler_settings
 
RUNINFO runinfo
 /Runinfo ODB key, defined in from midas.h More...
 
BEAMLINE_EVENT beamline_event
 for slow control parameters More...
 
LEMVAC_EVENT lemvac_event
 
MODCRYO_EVENT moddy_event
 
SAMPLECRYO_EVENT sample_event
 
SCS2001M_EVENT scs2001m_event
 
HV_EVENT hv_event
 
HV_DETECTORS_EVENT hvdet_event
 
HV_SETTINGS hv_settings
 
OMEGA_EVENT omega_event
 
INFO info
 
static VME_STATS vme_stats
 
static TDC_EVAL_EVENT tdc_eval_event
 
static TDC_PILEUP tdc_pileup
 
static INT hdev
 handle for VME-PCI device More...
 
static DWORD * databuffer
 ring buffer for TDC data More...
 
static DWORD * p_read
 
static DWORD * p_write
 read and write pointers for data ring buffer More...
 
static DWORD masterFlagSlowMuon
 use either TD_EVENT or M2_EVENT as slow muon master More...
 
static DWORD eventDefinedSlowMuon
 bit pattern containing trigger mode for slow muons (BC-TD-M2) More...
 
static DWORD eventDefinedFastMuon
 bit pattern containing trigger mode for fast muons (BC-M1) More...
 
static DWORD masterChannelSlowMuon
 "master" TDC channel for slow muons (TD or M2) More...
 
static DWORD masterChannelFastMuon
 "master" TDC channel for BC-M1 (usually M1) More...
 
static U_LONG runTime
 absolute run time in TDC LSB units More...
 
static U_LONG nextGoodTime
 absolute run time when new events are accepted (for on/off mode) More...
 
static DWORD dataWindowFastMuon
 
static DWORD dataWindowSlowMuon
 
static INT t0_offset
 
static BOOL flag_external_on
 flag to indicate "on/off", "red/green" mode More...
 
static BOOL flag_scaler_address_0
 
static BOOL flag_scaler_address_1
 flags to indicate status of VME scalers More...
 
INT mode
 scaler mode, see scaler_mode() More...
 
static struct timeval tvLastTime
 
static BOOL flag_on_puls
 flag to indicate that "puls" was turned on, "on/off" or "red/green" mode More...
 
EQUIPMENT equipment []
 

Macro Definition Documentation

#define ALMOST_FULL_LEVEL   1024

Definition at line 214 of file vme_fe.c.

Referenced by init_v1190().

#define BC_EVENT   (1<<3)
#define BINNING   0.1953125

Referenced by frontend_loop().

#define DATABUFFER_SIZE   131072

set size of FiFo (ring) buffer, 2^17

Definition at line 215 of file vme_fe.c.

Referenced by evaluate_fast_muon_event(), evaluate_slow_muon_event(), frontend_init(), and read_trigger_event().

#define DIFF_TOLERANCE   -12200

this is the allowed TDC time difference to the preceding event 12200 ~ 524288 - 512000 (2^19-1/10kHz)

Definition at line 216 of file vme_fe.c.

Referenced by do_channel().

#define LE_POSITRON_EVENT   (1<<1)

Definition at line 220 of file vme_fe.c.

Referenced by begin_of_run(), evaluate_slow_muon_event(), and frontend_loop().

#define M1_EVENT   (1<<4)

Definition at line 223 of file vme_fe.c.

Referenced by begin_of_run(), evaluate_fast_muon_event(), and frontend_loop().

#define M1_POSITRON_EVENT   (1<<5)

Definition at line 224 of file vme_fe.c.

Referenced by begin_of_run(), evaluate_fast_muon_event(), and frontend_loop().

#define M2_EVENT   (1<<2)

Definition at line 221 of file vme_fe.c.

Referenced by begin_of_run(), evaluate_slow_muon_event(), and frontend_loop().

#define MASTERFIRST   2

Definition at line 228 of file vme_fe.c.

Referenced by evaluate_fast_muon_event(), and evaluate_slow_muon_event().

#define MASTERLAST   1

timing flags

Definition at line 227 of file vme_fe.c.

Referenced by check_tof_and_pileup(), and evaluate_slow_muon_event().

#define MAX_NUMBER_LWORDS   1024

max number of block data transfer */

Definition at line 213 of file vme_fe.c.

Referenced by frontend_loop().

#define SIS3820_ADDRESS_0   0x38000000

Local definitions to connect to VME module.

VME address of 1st scaler module

Definition at line 210 of file vme_fe.c.

Referenced by begin_of_run(), frontend_exit(), frontend_init(), read_scaler_event(), and resume_run().

#define SIS3820_ADDRESS_1   0x39000000

VME address of 2nd scaler module.

Definition at line 211 of file vme_fe.c.

Referenced by begin_of_run(), frontend_exit(), frontend_init(), read_scaler_event(), and resume_run().

#define TD_EVENT   (1<<0)

Event flags.

Definition at line 219 of file vme_fe.c.

Referenced by begin_of_run(), evaluate_slow_muon_event(), and frontend_loop().

#define V1190_ADDRESS   0xEE000000

the VME address of the CAEN V1190 TDC

Definition at line 212 of file vme_fe.c.

Referenced by begin_of_run(), end_of_run(), frontend_init(), frontend_loop(), and resume_run().

Function Documentation

INT begin_of_run ( INT  run_number,
char *  error 
)
BOOL check_positron ( INT  decWindow,
INT  coincWindow,
INT  firstCh,
INT  lastCh,
INT  masterChannel,
INT  masterIndex,
INT *  channel,
INT *  ind 
)
check_positron(decWindow, coincWindow, firstCh, lastCh, masterchannel, channel, ind):
check events: is there a e+ (coincidence) signal in the decWindow relative to masterChannel?
              find the nearest e+ event with respect to the masterChannel[0] event.
              if coincWindow < 0: single e+ counters are considered
              if coincWindow >=0: look for coincidences between the two channels firstCh and
                                  lastCh
N O T E: post- pileup checking for positrons; this data will be written to the Midas event
 

Definition at line 2038 of file vme_fe.c.

References TDC_EVAL_EVENT::foundChannel, masterChannel, tdc_eval_event, and TDC_EVAL_EVENT::tdc_event.

Referenced by evaluate_fast_muon_event(), and evaluate_slow_muon_event().

BOOL check_tof_and_pileup ( INT  timing,
INT  tofWindow,
INT  firstCh,
INT  lastCh,
INT  masterChannel,
INT  masterIndex,
INT *  channel,
INT *  ind 
)
check_tof_and_pileup():
check events: is there a signal in the tofWIndow relative to masteChannel?
if yes: check if hit is "clean", i.e. there was no other signal within pileupWindow
N O T E: this function only checks the pre-pileup for "TOF" and "Decay" hits, i.e.
         BC and e+ hits. The pre-pileup for the master channels is implicitly done
         in the loop over the TDC output buffer (currently done in frontend_loop())
         where it is required that two starts of master channel events are separated
         by at least diffTimeSlowMuon or diffTimeFastMuon (which is 10musec at the moment).
 

Definition at line 1969 of file vme_fe.c.

References TDC_EVAL_EVENT::foundChannel, masterChannel, MASTERLAST, TDC_EVAL_EVENT::pileup, tdc_eval_event, and TDC_EVAL_EVENT::tdc_event.

Referenced by evaluate_fast_muon_event(), and evaluate_slow_muon_event().

INT do_channel ( INT  ch,
INT  TDCtime 
)
INT evaluate_slow_muon_event ( )
INT frontend_exit ( )
INT frontend_loop ( )

frontend_loop() is called whenever the frontend is idle or once between every event if the variable frontend_call_loop = true in the frontend code. This means that the frontend has to be re-compiled if one wants to use frontend_loop().

It performs the readout of the V1190 TDC and builds the events to be sent in read_trigger_event();

A 10kHz clock is used to check if hits belong to one TDC cycle of 100musec. Events may look like

1-1-1-4-1-1 = clock-clock-clock-TD-clock-clock –> no valid events 1-4-4-1-1 = clock-TD-TD-clock-clock –> no valid event 1-26-27-30-29-28-31-1 = clock-M2F-M2R-Y1-X2-X1-Y2 –> no valid event, TD missing 4-26-27-28-29-30-31-1 –> valid event 4-4-26-27-28-29-30-31-1 –> valid event 4-26-27-28-29-30-31-26-27-28-29-30-31-4 –> valid event, pileup times are sent with data buffer

Read complete TDC output buffer of 32k events. At low rates a VME bus error (return code = 0x211) indicates the end of data. This stops reading data from the TDC. At high rates (MHz) this does not work anymore since there are always data present in the output buffer. In this case a TDC TDC error may occur (bit 29 is set) that can be used to tag the start of new data.

Definition at line 949 of file vme_fe.c.

References VME_STATS::bc_clean, BC_EVENT, TRIGGER_SETTINGS::bc_rate, BCL1, BCL2, BCL3, BCL4, BCR1, BCR2, BCR3, BCR4, BINNING, V1190_DATA::buffer, V1190_DATA::channel, VME_STATS::channelCounts, CLOCK, TDC_EVAL_EVENT::clockIndex, V1190_DATA::data, dataWindowFastMuon, dataWindowSlowMuon, TRIGGER_SETTINGS::delay_daq_usec_, do_channel(), do_master_channel(), TDC_EVAL_EVENT::doEvaluateFastMuonEvent, TDC_EVAL_EVENT::doEvaluateSlowMuonEvent, TRIGGER_SETTINGS::enable_onoff_mode, TDC_PILEUP::endBeamCounterEvent, evaluate_fast_muon_event(), evaluate_slow_muon_event(), TRIGGER_SETTINGS::event_0_settings, EVENT_0_TYPE, TRIGGER_SETTINGS::event_1_active, TRIGGER_SETTINGS::event_1_settings, EVENT_1_TYPE, TRIGGER_SETTINGS::event_2_active, TRIGGER_SETTINGS::event_2_settings, EVENT_2_TYPE, TDC_EVAL_EVENT::event_time, eventDefinedFastMuon, eventDefinedSlowMuon, TRIGGER_SETTINGS::events, EXTOFF1, EXTON1, flag_external_on, TDC_EVAL_EVENT::foundChannel, VME_STATS::frontend_loop_counts, VME_STATS::frontend_loop_readtdc, hdev, VME_STATS::last_TDCtime, TDC_PILEUP::lastBeamCounterEventPileup, TDC_EVAL_EVENT::lastTimeFastMuon, TDC_EVAL_EVENT::lastTimeSlowMuon, LE_POSITRON_EVENT, M1_EVENT, M1_POSITRON_EVENT, M2_EVENT, TRIGGER_SETTINGS::master_delay, masterChannelFastMuon, masterChannelSlowMuon, MAX_NUMBER_LWORDS, MCP1, TRIGGER_SETTINGS::mcp1_delay, TRIGGER_SETTINGS::mcp1_rate, MCP2F, MCP2R, MCP2X1, MCP2X2, MCP2Y1, MCP2Y2, N_HITS, nextGoodTime, OnOff_mode(), TDC_EVAL_EVENT::pileup, pileup_end(), POSBDI, POSBDO, POSBUI, POSBUO, TRIGGER_SETTINGS::positron_delay, POSLDI, POSLDO, POSLUI, POSLUO, POSMCP1I, POSMCP1O, POSRDI, POSRDO, POSRUI, POSRUO, POSTDI, POSTDO, POSTUI, POSTUO, rate, VME_STATS::run_time, runinfo, runTime, TRIGGER_SETTINGS::simulation_flag, t0_offset, TD, TRIGGER_SETTINGS::td_delay, TD_EVENT, TDC_BIT_RANGE, VME_STATS::tdc_error_counts, tdc_eval_event, TDC_EVAL_EVENT::tdc_event, tdc_pileup, TDC_EVAL_EVENT::thisTimeFastMuon, TDC_EVAL_EVENT::thisTimeSlowMuon, TRIGGER_SETTINGS::tof_bc_pileup_window, trigger_settings, V1190_ADDRESS, V1190_ALMFULL_BIT, V1190_OUTPUT_BUFFER_SIZE, V1190_STATUS_REGISTER, and vme_stats.

int init_sis3820 ( u_int32_t  module_address)

init_sis3820 is called during frontend_init for hardware initialization.

  • open the VME_DEVICE (SIS3100/1100 VME-PCI interface)
  • resets the module (sis3820_key_reset)
  • reads module and firmware ID (sis3820_modid_read)
  • reads control status register (sis3820_control_read)
  • reads operation mode register (sis3820_operation_mode_read)
  • enables SIS3820 for counting (sis3820_key_enable)

Return:

  • FE_SUCCESS everything ok
  • FE_ERR_HW error accessing the SIS3820 modeul

Definition at line 2452 of file vme_fe.c.

References hdev, mode, sis3820_control_read(), sis3820_key_enable(), sis3820_key_reset(), sis3820_modid_read(), and sis3820_operation_mode_read().

Referenced by frontend_init().

int init_v1190 ( u_int32_t  module_address)
  • reset V1190 to its default settings: write 0 to V1190_MODULE_RESET
  • set leading edge (default): write V1190_EDGE_LEADING_MODE to V1190_OPCODE_ADDRESS/V1190_SET_DETECTION
  • set 200ps: write V1190_LSB_200PS to V1190_OPCODE_ADDRESS/V1190_SET_TR_LEAD_LSB
  • set continuous mode: write V1190_CONT_STOR to V1190_OPCODE_ADDRESS
  • set Almost Full Level to ALMOST_FULL_LEVEL
  • enable VME Bus error to indicate that Output Buffer is empty: write 0x21 to V1190_CONTROL_REGISTER

Definition at line 2503 of file vme_fe.c.

References ALMOST_FULL_LEVEL, hdev, TRIGGER_SETTINGS::tdc_disable_atstartup, trigger_settings, V1190_ALMOST_FULL_LEVEL, V1190_CONT_STOR, V1190_CONTROL_REGISTER, V1190_DISABLE_ALL_CHANNEL, V1190_EDGE_LEADING_MODE, V1190_LSB_200PS, V1190_MODULE_RESET, V1190_OPCODE_ADDRESS, V1190_SET_DETECTION, V1190_SET_TR_LEAD_LSB, and V1190_STATUS_REGISTER.

Referenced by frontend_init().

INT interrupt_configure ( INT  cmd,
INT  source,
PTYPE  adr 
)

Definition at line 2119 of file vme_fe.c.

void OnOff_mode ( )
  • function for "on/off" mode to turn external function on/off through the SIS3100 output NIM pulses

Definition at line 2593 of file vme_fe.c.

References TRIGGER_SETTINGS::delay_offpuls_usec_, flag_on_puls, hdev, TRIGGER_SETTINGS::period_onpuls_usec_, trigger_settings, and tvLastTime.

Referenced by frontend_loop().

INT pause_run ( INT  run_number,
char *  error 
)

Definition at line 886 of file vme_fe.c.

U_LONG pileup_end ( INT  pileupWindow)

pileup_end(INT pileupWindow):

calculate the end of pileup gate in absolute run time (in TDC LSB units)

Definition at line 1474 of file vme_fe.c.

References runTime.

Referenced by do_master_channel(), and frontend_loop().

INT poll_event ( INT  source,
INT  count,
BOOL  test 
)

Definition at line 2102 of file vme_fe.c.

References p_read, p_write, VME_STATS::poll_counts, and vme_stats.

INT read_scaler_event ( char *  pevent,
INT  off 
)

Read out of scaler modules.

If HAVE_TEST_RUN is defined scaler entries of about 100 are thrown. If not defined use the function sis3820_read_scaler to read out the VME scaler module.

Return:

  • bank size of scaler event

Definition at line 2220 of file vme_fe.c.

References A32BLT32, flag_scaler_address_0, flag_scaler_address_1, hdev, SCALER_SETTINGS::input_mode_3, N_SCALER, N_SCALER_MODULE, scaler_settings, SIS3820_ADDRESS_0, SIS3820_ADDRESS_1, and sis3820_scaler_read().

INT read_trigger_event ( char *  pevent,
INT  off 
)

read_trigger_event() is the event read out function to get the V1190 TDC data.

Definition at line 2141 of file vme_fe.c.

References databuffer, DATABUFFER_SIZE, NEW_EVENT_MASK, p_read, VME_STATS::readcounts, and vme_stats.

void scaler_mode ( u_int32_t  module_address)

scaler_mode is called at begin_of_run. It reads the ODB record /Equipment/Scaler/Settings and checks if the variable scaler_settings.input_mode_3 is set. If yes the SIS3820 will be set to
SIS3820_CONTROL_INPUT_MODE3 + SIS3820_SCALER_DATA_FORMAT_24BIT
otherwise it will be set to
SIS3820_CONTROL_INPUT_MODE0 + SIS3820_SCALER_DATA_FORMAT_32BIT

No interrupt handling at the moment.

Definition at line 2383 of file vme_fe.c.

References CTRL_REFERENCE_CH1_DISABLE, CTRL_REFERENCE_CH1_ENABLE, hDB, hdev, SCALER_SETTINGS::input_mode_3, SCALER_SETTINGS::reference_ch1, scaler_settings, SIS3820_CONTROL_INPUT_MODE0, SIS3820_CONTROL_INPUT_MODE3, sis3820_control_read(), sis3820_control_write(), sis3820_operation_mode_read(), sis3820_operation_mode_write(), SIS3820_SCALER_DATA_FORMAT_24BIT, and SIS3820_SCALER_DATA_FORMAT_32BIT.

Referenced by begin_of_run().

Variable Documentation

BEAMLINE_EVENT beamline_event

for slow control parameters

Definition at line 196 of file vme_fe.c.

Referenced by frontend_init(), and read_slowcontrol_event().

DWORD* databuffer
static

ring buffer for TDC data

Definition at line 270 of file vme_fe.c.

Referenced by begin_of_run(), evaluate_fast_muon_event(), evaluate_slow_muon_event(), frontend_exit(), frontend_init(), and read_trigger_event().

DWORD dataWindowFastMuon
static

Definition at line 279 of file vme_fe.c.

Referenced by begin_of_run(), do_master_channel(), and frontend_loop().

DWORD dataWindowSlowMuon
static

Definition at line 279 of file vme_fe.c.

Referenced by begin_of_run(), do_master_channel(), and frontend_loop().

INT display_period = 3000

a frontend status page is displayed with this frequency in ms

Definition at line 168 of file vme_fe.c.

EQUIPMENT equipment[]

Definition at line 326 of file vme_fe.c.

INT event_buffer_size = 60*10000

buffer size to hold events

Definition at line 177 of file vme_fe.c.

DWORD eventDefinedFastMuon
static

bit pattern containing trigger mode for fast muons (BC-M1)

Definition at line 274 of file vme_fe.c.

Referenced by begin_of_run(), do_master_channel(), evaluate_fast_muon_event(), frontend_init(), and frontend_loop().

DWORD eventDefinedSlowMuon
static

bit pattern containing trigger mode for slow muons (BC-TD-M2)

Definition at line 273 of file vme_fe.c.

Referenced by begin_of_run(), do_master_channel(), evaluate_slow_muon_event(), frontend_init(), and frontend_loop().

BOOL flag_external_on
static

flag to indicate "on/off", "red/green" mode

Definition at line 281 of file vme_fe.c.

Referenced by begin_of_run(), evaluate_slow_muon_event(), frontend_init(), and frontend_loop().

BOOL flag_on_puls
static

flag to indicate that "puls" was turned on, "on/off" or "red/green" mode

Definition at line 285 of file vme_fe.c.

Referenced by begin_of_run(), frontend_init(), and OnOff_mode().

BOOL flag_scaler_address_0
static

Definition at line 282 of file vme_fe.c.

Referenced by begin_of_run(), frontend_exit(), frontend_init(), read_scaler_event(), and resume_run().

BOOL flag_scaler_address_1
static

flags to indicate status of VME scalers

Definition at line 282 of file vme_fe.c.

Referenced by begin_of_run(), frontend_exit(), frontend_init(), read_scaler_event(), and resume_run().

BOOL frontend_call_loop = TRUE

frontend_loop is called periodically if this variable is TRUE

Definition at line 165 of file vme_fe.c.

char* frontend_file_name = __FILE__

The frontend file name, don't change it.

Definition at line 162 of file vme_fe.c.

char* frontend_name = "VME_FE"

experiment specific ODB structures

experiment specific definition for frontend and analyzer The frontend name (client name) as seen by other MIDAS clients

Definition at line 159 of file vme_fe.c.

INT hdev
static
HV_SETTINGS hv_settings

Definition at line 203 of file vme_fe.c.

HV_DETECTORS_EVENT hvdet_event

Definition at line 202 of file vme_fe.c.

Referenced by frontend_init(), and read_slowcontrol_event().

LEMVAC_EVENT lemvac_event

Definition at line 197 of file vme_fe.c.

Referenced by frontend_init(), and read_slowcontrol_event().

DWORD masterChannelFastMuon
static

"master" TDC channel for BC-M1 (usually M1)

Definition at line 276 of file vme_fe.c.

Referenced by begin_of_run(), evaluate_fast_muon_event(), and frontend_loop().

DWORD masterChannelSlowMuon
static

"master" TDC channel for slow muons (TD or M2)

Definition at line 275 of file vme_fe.c.

Referenced by begin_of_run(), evaluate_slow_muon_event(), and frontend_loop().

DWORD masterFlagSlowMuon
static

use either TD_EVENT or M2_EVENT as slow muon master

Definition at line 272 of file vme_fe.c.

Referenced by begin_of_run().

INT max_event_size = 128000

maximum event size produced by this frontend

Definition at line 171 of file vme_fe.c.

INT max_event_size_frag = 5*1024*1024

maximum event size for fragmented events (EQ_FRAGMENTED)

Definition at line 174 of file vme_fe.c.

MODCRYO_EVENT moddy_event

Definition at line 198 of file vme_fe.c.

Referenced by frontend_init(), and read_slowcontrol_event().

INT mode

scaler mode, see scaler_mode()

Definition at line 283 of file vme_fe.c.

Referenced by init_sis3820().

U_LONG nextGoodTime
static

absolute run time when new events are accepted (for on/off mode)

Definition at line 278 of file vme_fe.c.

Referenced by begin_of_run(), evaluate_slow_muon_event(), and frontend_loop().

OMEGA_EVENT omega_event

Definition at line 205 of file vme_fe.c.

Referenced by frontend_init(), and read_slowcontrol_event().

DWORD* p_read
static

Definition at line 271 of file vme_fe.c.

Referenced by begin_of_run(), end_of_run(), frontend_init(), poll_event(), and read_trigger_event().

DWORD * p_write
static

read and write pointers for data ring buffer

Definition at line 271 of file vme_fe.c.

Referenced by begin_of_run(), end_of_run(), evaluate_fast_muon_event(), evaluate_slow_muon_event(), frontend_init(), and poll_event().

U_LONG runTime
static

absolute run time in TDC LSB units

Definition at line 277 of file vme_fe.c.

Referenced by begin_of_run(), do_channel(), do_master_channel(), evaluate_slow_muon_event(), frontend_loop(), and pileup_end().

SAMPLECRYO_EVENT sample_event

Definition at line 199 of file vme_fe.c.

Referenced by frontend_init(), and read_slowcontrol_event().

SCALER_SETTINGS scaler_settings

/Equipment/Scaler/Settings/

Definition at line 189 of file vme_fe.c.

Referenced by analyzer_init(), read_scaler_event(), and scaler_mode().

SCS2001M_EVENT scs2001m_event

Definition at line 200 of file vme_fe.c.

Referenced by analyzer_init(), frontend_init(), read_slowcontrol_event(), and update_info().

INT t0_offset
static

Definition at line 280 of file vme_fe.c.

Referenced by begin_of_run(), do_channel(), and frontend_loop().

TDC_PILEUP tdc_pileup
static

Definition at line 268 of file vme_fe.c.

Referenced by begin_of_run(), do_master_channel(), frontend_init(), and frontend_loop().

TRIGGER_SETTINGS trigger_settings

/Equipment/Trigger/Settings

The following structures are defined in experim.h that is created by entering 'make' in ODBedit.

ODB record values can be easily accessed by db_open_record which creates a hot-link to the structure; structure_name.keyvalue

Definition at line 188 of file vme_fe.c.

Referenced by analyzer_init(), begin_of_run(), end_of_run(), evaluate_fast_muon_event(), evaluate_slow_muon_event(), frontend_init(), frontend_loop(), init_v1190(), and OnOff_mode().

struct timeval tvLastTime
static

Definition at line 284 of file vme_fe.c.

Referenced by frontend_init(), and OnOff_mode().