From 650c8f3d887c8e2cf3ea448cc2b38088eb7cdea6 Mon Sep 17 00:00:00 2001 From: Hades DAQ Date: Thu, 21 Mar 2019 14:15:28 +0100 Subject: [PATCH] a lot of files changed... --- control/gui/daq/35_Reboot_MDCHub | 1 + .../gui/power/20_ECAL_5V_Entrance_Powercycle | 9 - control/gui/power/21_ECAL_LV5_Powercycle | 9 - ecal/HowTo.txt | 33 +- ecal/addresses_ecal.db | 2 +- ecal/ecal_op_guide | 110 + ...register_monitoring_trigger_forwardhalo.db | 49 + ecal/set_thr_batch.sh | 26 + ecal/startup.script | 39 +- ecal/startupQFH.script | 6 + ecal/startupQFH.sh | 8 + evtbuild/change2newserver.sh | 34 + evtbuild/change2oldserver.sh | 34 + evtbuild/eb_bnet.conf | 240 -- evtbuild/eb_bnet_ltsm.conf | 2 +- evtbuild/eb_bnet_ltsm_newservers.conf | 2 +- evtbuild/start_eb_gbe.sh | 2 +- evtbuild/start_eb_gbe_newservers.pl | 60 +- evtbuild/tdc_calib_start.sh | 8 +- evtbuild/tdc_calib_stop.sh | 2 +- hmon/Hmon.pm | 6 + hmon/QA.pm | 23 +- hmon/doc/daq-busy.htt | 11 +- hmon/doc/daq-readout.htt | 9 + hmon/doc/daq-spillcount.htt | 3 + hmon/doc/eb-errbits.htt | 2 +- hmon/doc/eb-lostevt.htt | 23 +- hmon/doc/eb-rate.htt | 5 +- hmon/doc/eb-run.htt | 28 +- hmon/doc/ecal-count.htt | 5 + hmon/doc/endp-mdc.htt | 10 +- hmon/doc/endp-other.htt | 4 +- hmon/doc/endp-rich.htt | 12 +- hmon/doc/endp-rpc.htt | 10 +- hmon/doc/endp-tof.htt | 6 +- hmon/doc/fee-richthr.htt | 4 + hmon/doc/feeerr-richthr.htt | 3 + hmon/doc/hv-ecalhv.htt | 1 + hmon/doc/hv-fwhv.htt | 1 + hmon/doc/hv-mdchv.htt | 1 + hmon/doc/main-outofsync.htt | 16 + hmon/doc/mdc-linkqual.htt | 4 +- hmon/doc/misc-irq.htt | 4 + hmon/doc/misc-rpchv.htt | 1 + hmon/doc/misc-tofhv.htt | 1 + hmon/doc/rate-hodo.htt | 5 +- hmon/doc/server-cpu.htt | 3 +- hmon/doc/server-icinga.htt | 8 +- hmon/doc/trg-pt1rate.htt | 6 +- hmon/doc/trg-source.htt | 2 +- hmon/ecal_drawing.htm | 5 +- hmon/hmon_adcvolt.pl | 6 +- hmon/hmon_busynew.pl | 4 +- hmon/hmon_calibration.pl | 4 +- hmon/hmon_dutyfactor.pl | 49 +- hmon/hmon_eb_rate.pl | 10 +- hmon/hmon_ebsummary.pl | 12 +- hmon/hmon_ecal_recover_dead_slow_channels.pl | 153 + hmon/hmon_ecalthreshold.pl | 14 +- hmon/hmon_endpoints.pl | 12 +- hmon/hmon_eventrate.pl | 2 +- hmon/hmon_logerrors.pl | 1 + hmon/hmon_lvl1mismatch.pl | 41 + hmon/hmon_muxhist.pl | 14 +- hmon/hmon_readoutstuck.pl | 15 +- hmon/hmon_richthreshold.pl | 56 +- hmon/hmon_spill.pl | 10 +- hmon/hmon_startrate.pl | 8 + hmon/hmon_timeout.pl | 10 +- hmon/hmon_trgsource.pl | 17 +- hmon/index.cgi | 69 +- hmon/monitor.cgi | 7 +- hmon/permanent/hmon_archiver.pl | 11 +- hmon/permanent/hmon_cpu.pl | 28 +- hmon/permanent/hmon_eb_run.pl | 30 +- hmon/permanent/hmon_ebdiskfill.pl | 2 +- hmon/permanent/hmon_eberrbits.pl | 86 +- hmon/permanent/hmon_fwhv.pl | 387 ++ hmon/permanent/hmon_logfile.pl | 9 +- hmon/permanent/hmon_magnet.pl | 11 +- hmon/permanent/hmon_mdchv.pl | 19 +- hmon/permanent/hmon_mdcpressure.pl | 61 +- hmon/permanent/hmon_qaplots.pl | 2 +- hmon/permanent/hmon_richIsobutan.pl | 56 +- hmon/permanent/hmon_rpchv.pl | 417 +++ hmon/permanent/hmon_starthv.pl | 63 + hmon/permanent/hmon_tofhv.pl | 447 +++ hmon/styles-lcars.css | 531 +++ hub/register_configgbe_2018.db | 4 +- hub/register_configgbe_ip.db | 2 +- main/data_sources.db | 26 +- main/startup.pl | 43 +- main/startup_briccolage.sh | 86 +- mdc/addresses_oep.db | 8 +- nettools/nettrace.db | 3252 ++++++++--------- oracle/runstatsfromora.pl | 403 ++ oracle/runstatsfromora_testplot.sh | 50 + rich/addresses_dirich.db | 2 +- rpc/addresses_rpc.db | 1 + rpc/serials_rpc.db | 1 - rpc/utilities/setThresholdsAll0000.sh | 6 + rpc/utilities/setThresholdsS1To0000.sh | 4 + rpc/utilities/setThresholdsS1ToFFFF.sh | 8 +- rpc/utilities/setThresholdsS2.sh | 2 +- rpc/utilities/setThresholdsS2To0000.sh | 4 + rpc/utilities/setThresholdsS2ToFFFF.sh | 8 +- rpc/utilities/setThresholdsS3.sh | 2 +- rpc/utilities/setThresholdsS3To0000.sh | 4 + rpc/utilities/setThresholdsS3ToFFFF.sh | 8 +- rpc/utilities/setThresholdsS3_test.sh | 4 + rpc/utilities/setThresholdsS4.sh | 2 +- rpc/utilities/setThresholdsS4To0000.sh | 4 + rpc/utilities/setThresholdsS4ToFFFF.sh | 8 +- rpc/utilities/setThresholdsS5.sh | 2 +- rpc/utilities/setThresholdsS5To0000.sh | 4 + rpc/utilities/setThresholdsS5ToFFFF.sh | 8 +- rpc/utilities/setThresholdsS6.sh | 2 +- rpc/utilities/setThresholdsS6To0000.sh | 4 + rpc/utilities/setThresholdsS6ToFFFF.sh | 8 +- rpc/utilities/setTriggerBoardS4.sh | 2 +- rpc/utilities/setTriggerBoardS6.sh | 2 +- rpc/utilities/setTriggerBoardSX.sh | 6 +- spillmon/startup.sh | 50 + start/ThreshNinoStart.db | 24 +- start/startup.script | 4 +- 125 files changed, 5362 insertions(+), 2268 deletions(-) delete mode 100755 control/gui/power/20_ECAL_5V_Entrance_Powercycle delete mode 100755 control/gui/power/21_ECAL_LV5_Powercycle create mode 100644 ecal/ecal_op_guide create mode 100644 ecal/register_monitoring_trigger_forwardhalo.db create mode 100755 ecal/set_thr_batch.sh create mode 100644 ecal/startupQFH.script create mode 100755 ecal/startupQFH.sh create mode 100755 evtbuild/change2newserver.sh create mode 100755 evtbuild/change2oldserver.sh delete mode 100644 evtbuild/eb_bnet.conf create mode 100644 hmon/doc/fee-richthr.htt create mode 100644 hmon/doc/feeerr-richthr.htt create mode 100644 hmon/doc/hv-fwhv.htt create mode 100644 hmon/doc/main-outofsync.htt create mode 100644 hmon/doc/misc-rpchv.htt create mode 100644 hmon/doc/misc-tofhv.htt create mode 100755 hmon/hmon_ecal_recover_dead_slow_channels.pl create mode 100755 hmon/hmon_lvl1mismatch.pl create mode 100755 hmon/permanent/hmon_fwhv.pl create mode 100755 hmon/permanent/hmon_rpchv.pl create mode 100755 hmon/permanent/hmon_starthv.pl create mode 100755 hmon/permanent/hmon_tofhv.pl create mode 100644 hmon/styles-lcars.css create mode 100755 oracle/runstatsfromora.pl create mode 100755 oracle/runstatsfromora_testplot.sh create mode 100755 rpc/utilities/setThresholdsAll0000.sh create mode 100755 rpc/utilities/setThresholdsS1To0000.sh create mode 100755 rpc/utilities/setThresholdsS2To0000.sh create mode 100755 rpc/utilities/setThresholdsS3To0000.sh create mode 100755 rpc/utilities/setThresholdsS3_test.sh create mode 100755 rpc/utilities/setThresholdsS4To0000.sh create mode 100755 rpc/utilities/setThresholdsS5To0000.sh create mode 100755 rpc/utilities/setThresholdsS6To0000.sh create mode 100755 spillmon/startup.sh diff --git a/control/gui/daq/35_Reboot_MDCHub b/control/gui/daq/35_Reboot_MDCHub index 7c20ef3..8c1f34a 100755 --- a/control/gui/daq/35_Reboot_MDCHub +++ b/control/gui/daq/35_Reboot_MDCHub @@ -10,6 +10,7 @@ if [ $myvar == "256" ]; then exit; fi notifyall.sh "DAQ" " MDC-Hubs are going to be rebooted." "STARTUP" & xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' + export DAQOPSERVER=hadesp31 trbcmd reset trbcmd reload 0xfe11 sleep 8 diff --git a/control/gui/power/20_ECAL_5V_Entrance_Powercycle b/control/gui/power/20_ECAL_5V_Entrance_Powercycle deleted file mode 100755 index 09a4dcf..0000000 --- a/control/gui/power/20_ECAL_5V_Entrance_Powercycle +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -export myvar=$(doyoureallywant.pl "to make a ECAL 5V Entrance Rack powercycle? There will be no further warnings!") -if [ $myvar == "256" ]; then exit; fi - -xterm -e " -cd ../../../../hadesdaq/utils; -./ECAL_5V_Entrance_Powercycle.sh -" diff --git a/control/gui/power/21_ECAL_LV5_Powercycle b/control/gui/power/21_ECAL_LV5_Powercycle deleted file mode 100755 index f696d16..0000000 --- a/control/gui/power/21_ECAL_LV5_Powercycle +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -export myvar=$(doyoureallywant.pl "to make a ECAL Padiwa 5V powercycle? There will be no further warnings!") -if [ $myvar == "256" ]; then exit; fi - -xterm -e " -cd ../../../../hadesdaq/utils; -./ECAL_LV5_Powercycle.sh; -" diff --git a/ecal/HowTo.txt b/ecal/HowTo.txt index 8017456..7ed10c3 100644 --- a/ecal/HowTo.txt +++ b/ecal/HowTo.txt @@ -19,6 +19,8 @@ http://hades33/daqtools/addons/pulseraddon.pl?Control board 0xfe61 (0X0120) -->Control: EnKelFirst16: 0xffff (switch pulser on) +or +trbcmd w 0xtrbcmd w 0x0120 0xa000 0x0008ffff -->PulserConfig Slices: @@ -27,7 +29,7 @@ PulserWidth: -# power switch +# power switch (not used) http://haepc15/switch.html admin kaese @@ -46,7 +48,8 @@ for ((i = 0; i<=2; i++)); do ./spi_slave.pl -e=0x6040 -c=$i -flashcmd=8 -enablec # trb flash trbflash info 0x6040 trbflash program 0x6040 *.bit -trbcmd reload 6040 +trbflash verfiy 0x6040 *.bit +trbcmd reload 0x6040 #padiwa:load memory (with thresholds,...) to flash ./spi_slave.pl -e=0x6041 -c=1 -flashcmd=8 -enablecfgflash=1 -x=memtoflash --range '0x00..0x2b' @@ -57,16 +60,40 @@ trbcmd reload 6040 0x00 off 0x01 blinking +#check hld data +hldprint XXX.hld -auto -tdconly 0x6040 -num 100 | less -j8 +hldprint lxhadeb08:8101 -auto -tdconly 0x6040 -num 100 | less -j8 ###Trehsolds +#scan thresholds +hadaq@lxhadeb06:~/ecal_thresholds/trb_dirich_threshold$ +./HADESthreshscan_v1 -b 0 +#set thresholds ./HADESthreshscan_v1 -l 0 --loading-file best_baselines.thr -t 0 50 25 +trbcmd w 0xfe71 0xc805 0x00000000 +#positive SLOW threshold +./HADESthreshscan_v1 -l 0 --loading-file best_baselines.thr -t 0 50 n40 +trbcmd w 0xfe71 0xc805 0x55555555 -###HV +spi_slave.pl --endpoint=0xfe71 --chain=0 --execute=invert --data=0x0000 !!!!not working!!!!!!!! why?????? +spi_slave.pl --endpoint=0xfe71 --chain=1 --execute=invert --data=0x0000 +spi_slave.pl --endpoint=0xfe71 --chain=2 --execute=invert --data=0x0000 + + + +###HV vnc vncviewer lxhaddcs06:30 +vncviewer lxhaddcs06:31 #change multiplicity trigger kate register_monitoring_trigger_mult3_minus_noise.de M3: line 25 C1 0x00030000 + + +###LV odroids +odroid4 (ch1: sector 2; ch2&3: sector 1; ch4 ch3&6 +odroid5 +odroid6 diff --git a/ecal/addresses_ecal.db b/ecal/addresses_ecal.db index d408eed..142b77c 100644 --- a/ecal/addresses_ecal.db +++ b/ecal/addresses_ecal.db @@ -46,4 +46,4 @@ 0x6053 1191 1 0 0 0x6054 1511 1 0 0 0x6055 1321 1 0 0 - 0x6056 1071 1 0 0 + 0x6056 1261 1 0 0 diff --git a/ecal/ecal_op_guide b/ecal/ecal_op_guide new file mode 100644 index 0000000..5e3a763 --- /dev/null +++ b/ecal/ecal_op_guide @@ -0,0 +1,110 @@ +########################### +# # +# ECAL - operator guide # +# # +########################### + +############### +#important vncs +############### +lxhaddcs06:30 (HV control) +lxhadeb06:70 (Padiwas, DAQ) +Password: "hades standart daq password" + + +########### +HV settings +########### + +HV is controled via cs-studio. It is opened on vnc screen lxhaddcs06:30. Password is usual hades DAQ one (If you do not know it ask shift leader). It should be always open. If not, following commands in terminal should do the job: + +$ . epics +$ cs-studio + +Workspace to open is: +/home/hadaq/CSS-Workspaces/ecal/CSS + +It should be filled in prompt window in advance. Or it is possible to choose it from drop-down menu. + +Then there might open several windows or none. + +If several windows are opened, just find the one with corresponding sector or use the overall monitoring page to switch on/off whole sector or open the detailed view for the needed sector. + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!Do not change any HV settings!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +The main window is in file +ecal_menu.bob +in the workspace. Start the display using "play" button in the toolbar. Then Button HV monitoring and settings should appear. + +CS-Studio is realy slow with the amount of channels it has to control, so be patient. + +####################### +Laser monitoring system +####################### + +Laser monitoring system is controled via web interface. The way how to acces it is +Hades main monitoring webpage(hades33/mon)->Web Tools->Pulser AddOn(in Building Blocks section). + +The Address is 0xfe61 and ChannelEnable1 0120. To be certain switch on full set of channels (0xffff). + +In Pulser Config section set Pulser period 2 730 688 ns (0xa0000) on first 8 channels(should be set) and Pulse width to 47ns on channels 0, 3-8 (It should be preloaded if not the correct hex value is 0x2e or just simple fill in 46 and it results in 47ns). + +################## +Thresholds setting +################## +On DAQ GUI there is a button called "Set ECAL Thr" it reloads all Padiwa thresholds to 45 mV (FAST) and +200 mV (SLOW). Typically thresholds have to be reloaded in case thresholds are not properly resetted by the automatic threshold recover script +Thresholds can be monitored using a web browser: hades33/mon/ecal_drawing.htm#ecalthr_fast + +Rates in FAST and SLOW channels can be monitored using the following web pages: +http://hades33/mon/ecal_drawing.htm#ecalrate_slow +http://hades33/mon/ecal_drawing.htm#ecalrate_fast +It can alaso happen that a module shows a very high rate (~3 MHz). In this case threshold have to be reloaded. + + +######################### +Manual threshold settings +######################### +As hadaq on lxhadeb06 set dir to + +~/ecal_thresholds/trb_dirich_threshold/ + +and run command + +./HADESthreshscan_v1 -l 0 --loading-file 20190220_155833_std_save.thr -t 0 $A $B + +Values $A and $B stands for thresholds for FAST and SLOW channels respectively. For positive threshold setting for slow channel put n just before the threshold numeric value. + +The threshold setting is +FAST: 45 (45 mV) +SLOW: n200 (+200 mV) + +The command then looks like +./HADESthreshscan_v1 -l 0 --loading-file 20190220_155833_std_save.thr -t 0 45 n200 + +########################################## +Zero or low rates in the ECAL rate monitor +########################################## + +Check the HV monitors on +http://hades33/mon/monitor.cg?-EcalHVVMap +http://hades33/mon/monitor.cg?-EcalHVCMap + +If the current on the corresponding module shows low or zero value, try restart of the affected module. The control system of HV is described in the next paragraph. If the problem persits contact an expert. + + +#################################### +Padiwa low voltage (5 V) power cycle +#################################### + +Padiwa boards can be power cycled by using the "ECAL LV5 Pwercycle" button in the main DAQ-GUI. +After a power cycle a DAQ restart ist needed and thresholds have to be reloaded. + +############################ +#Contact in case of problems +############################ +In case of some problems call: +Adrian Rost (PADIWAS and readout electronics): +491771974495 +Petr Chudoba (HV, PMTs & laser system): +491781989243 + diff --git a/ecal/register_monitoring_trigger_forwardhalo.db b/ecal/register_monitoring_trigger_forwardhalo.db new file mode 100644 index 0000000..f877f8c --- /dev/null +++ b/ecal/register_monitoring_trigger_forwardhalo.db @@ -0,0 +1,49 @@ +# TDC config registers + +!Register table +# Type # C0 # C1 # C2 # C3 # C4 # C5 # C6 # C7 # C8 # +########################################################################################################### + +# MonEnab TrgEnOut1 TrgEnOut1 TrgEnOut2 TrgEnOut2 Stretch Stretch Invert Invert +# Ch00-31 Ch32-63 Ch00-31 Ch32-63 Ch00-31 Ch32-63 Ch00-31 Ch32-63 + 0 0xdf80 0xdf00 0xdf01 0xdf04 0xdf05 0xdf20 0xdf21 0xdf24 0xdf25 + 10 0xdf80 0xdf08 0xdf09 0xdf0c 0xdf0d 0xdf20 0xdf21 0xdf24 0xdf25 + + #just enables for 32 channels + 1 0xdf00 0xdf04 + + +#multiplicity +# Enable 23..16Lim 15..8OutSel + 2 0xdf33 0xdf32 0xdf34 + +!Value table +# Fpga # Type # C0 # C1 # C2 # C3 # C4 # C5 # C6 # C7 # C8 # +######################################################################################################################################### + + 0xfe71 10 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xffffffff 0x0000ffff 0x00000000 0x00000000 + 0x6025 10 0x00000000 0x50000000 0x00000000 0x00000000 0x00000000 0xffffffff 0x0000ffff 0x00000000 0x00000000 + 0x6041 10 0x00000000 0x00000000 0x00005000 0x00000000 0x00000000 0xffffffff 0x0000ffff 0x00000000 0x00000000 + #Enable fast channels with stretcher on output 1 + + 0xfe61 0 0x000fffff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 + 0x8a00 1 0x00000015 0x00000000 + 0x8a01 1 0x00000051 0x00015100 + 0x8a02 1 0x00000000 0x00015400 + 0x8a03 1 0x00000054 0x00000000 + 0x8a04 1 0x00000015 0x00015400 + 0x8a05 1 0x00000000 0x00015400 + #left half of crate on output 1, right half on output 2 + + + 0x0100 0 0x00007c7c 0x00007c7c 0x00000000 0x00000000 0x00000000 0x00007e7e 0x00000000 0x00000000 0x00000000 + #1..6: output 1, #9..14 output 2 + + 0x0100 2 0x00000000 0x00020000 0x00000200 + #2 half sectors fire, on second output + + +#Oben: 0x6025 TDC-Nr. 29(fast),30(slow) oder ch14 +#Rechts: 0x6025 TDC-Nr. 31(fast),32(slow) oder ch15 +#Unten: 0x6041 TDC-Nr. 45(fast),46(slow) oder ch22 +#Links: 0x6041 TDC-Nr. 47(fast),48(slow) oder ch23 \ No newline at end of file diff --git a/ecal/set_thr_batch.sh b/ecal/set_thr_batch.sh new file mode 100755 index 0000000..d8b5778 --- /dev/null +++ b/ecal/set_thr_batch.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +TDC=(6020 6021 6022 6023 6024 6025 6026) #sector 3 +#TDC=(6050 6051 6052 6053 6054 6055 6056) #sector 6 +CHAIN=(0 1 2) +FAST=(0 2 4 6 8 10 12 14) +SLOW=(1 3 5 7 9 11 13 15) +#Sector 3 +#SLOW_THR="0xd1e0" +FAST_THR="0x1339" + +#Sector 6 +SLOW_THR="0xd869" +#FAST_THR="0x1088" + +for k in ${TDC[*]}; do + for i in ${CHAIN[*]}; do + for j in ${FAST[*]}; do + ~/trbsoft/daqtools/tools/spi_slave.pl -e 0x$k -c $i -x pwm -channel $j -data=$FAST_THR + done + + for j in ${SLOW[*]}; do + ~/trbsoft/daqtools/tools/spi_slave.pl -e 0x$k -c $i -x pwm -channel $j -data=$SLOW_THR + done + done +done diff --git a/ecal/startup.script b/ecal/startup.script index 3fa2c6f..d7f0aa9 100644 --- a/ecal/startup.script +++ b/ecal/startup.script @@ -3,6 +3,9 @@ set_addresses serials_trb3sc.db addresses_ecal.db !endif +#exec_cmd{local} echo "I'm here" +#exec_cmd{local} xterm -e "sleep 10" + #ECAL pulser configuration trbcmd w 0x0120 0xa101 0xa0000 #PulserPeriod=2730688ns @@ -11,14 +14,16 @@ trbcmd w 0x0120 0xa105 0xa0000 #PulserPeriod=2730688ns trbcmd w 0x0120 0xa106 0xa0000 #PulserPeriod=2730688ns trbcmd w 0x0120 0xa107 0xa0000 #PulserPeriod=2730688ns trbcmd w 0x0120 0xa108 0xa0000 #PulserPeriod=2730688ns -trbcmd w 0x0120 0xa201 0xb #PulserWidth=45ns -trbcmd w 0x0120 0xa204 0xb #PulserWidth=45ns -trbcmd w 0x0120 0xa205 0xb #PulserWidth=45ns -trbcmd w 0x0120 0xa206 0xb #PulserWidth=45ns -trbcmd w 0x0120 0xa207 0xb #PulserWidth=45ns -trbcmd w 0x0120 0xa208 0xb #PulserWidth=45ns - -#set trigger for cosmics -> not working!? +trbcmd w 0x0120 0xa201 0x2e #PulserWidth=47ns +trbcmd w 0x0120 0xa203 0x2e #PulserWidth=47ns +trbcmd w 0x0120 0xa204 0x2e #PulserWidth=47ns +trbcmd w 0x0120 0xa205 0x2e #PulserWidth=47ns +trbcmd w 0x0120 0xa206 0x2e #PulserWidth=47ns +trbcmd w 0x0120 0xa207 0x2e #PulserWidth=47ns +trbcmd w 0x0120 0xa208 0x2e #PulserWidth=47ns + + +#set trigger for cosmics and pulser exec_cmd{local} /home/hadaq/trbsoft/daq/ecal/loadregisterdb.pl /home/hadaq/trbsoft/daq/ecal/register_monitoring_trigger.db trbcmd w 0xfe71 0x7111 500 #max number of words per board @@ -153,6 +158,11 @@ trbcmd w 0xfe71 0x7114 0x00050000 #min number of words per board exec_cmd{local} spi_slave.pl --endpoint=0xfe71 --chain=0 --execute=led --data=0x0000 exec_cmd{local} spi_slave.pl --endpoint=0xfe71 --chain=1 --execute=led --data=0x0000 exec_cmd{local} spi_slave.pl --endpoint=0xfe71 --chain=2 --execute=led --data=0x0000 + +#input enable 0x0000 + +#stretcher 0x0000 + #set global dischargedelayselect to 20 @@ -212,7 +222,16 @@ trbcmd w 0xfe71 0x7114 0x00050000 #min number of words per board #Load TDC settings load_register register_tdc_ecal.db + +#TDC settings for overshoot method +trbcmd w 0xfe71 0xc801 0x83ff00c0 #enable trigger window: 965 ns (before), 5115 ns (after) +#trbcmd w 0xfe71 0xc801 0x812c00c0 #enable trigger window: 965 ns (befre), 1500 ns (after) +#trbcmd w 0xfe71 0xc801 0x3ff00c0 #disable trigger window +trbcmd w 0xfe71 0xc805 0xaaaaaaaa #invert TDCs for SLOW channels +trbcmd w 0xfe71 0xc806 0xaaaaaaaa #invert TDCs for SLOW channels -#wait - +#exec_script{pexor} ../ecal/startupQFH.script #not working? +#exec_cmd{local} ../ecal/startupQFH.sh +#trbcmd w 0x6036 0xc802 0x00000000 #deactivate TDCs on QFH board +#wait diff --git a/ecal/startupQFH.script b/ecal/startupQFH.script new file mode 100644 index 0000000..ffcc989 --- /dev/null +++ b/ecal/startupQFH.script @@ -0,0 +1,6 @@ +#prepare 0x6036 for QFH +trbcmd w 0x6036 0xc805 0x0 #do not invert TDCs for SLOW channels for 6036 +trbcmd w 0x6036 0xc806 0x0 #do not invert TDCs for SLOW channels for 6036 +trbcmd w 0x6036 0xc802 0xffff #deactivate unused channels +trbcmd w 0x6036 0xc803 0x0 #deactivate unused channels +trbcmd w 0x6036 0xc801 0x83ff00aa #enable trigger window: 965 ns (before), 5115 ns (after) \ No newline at end of file diff --git a/ecal/startupQFH.sh b/ecal/startupQFH.sh new file mode 100755 index 0000000..5b461d7 --- /dev/null +++ b/ecal/startupQFH.sh @@ -0,0 +1,8 @@ +#prepare 0x6036 for QFH +trbcmd w 0x6036 0xc805 0x0 #do not invert TDCs for SLOW channels for 6036 +trbcmd w 0x6036 0xc806 0x0 #do not invert TDCs for SLOW channels for 6036 +trbcmd w 0x6036 0xc802 0xffff #deactivate unused channels +trbcmd w 0x6036 0xc803 0x0 #deactivate unused channels +#trbcmd w 0x6036 0xc801 0x83ff00aa #enable trigger window: 965 ns (before), 5115 ns (after) +#trbcmd w 0x6036 0xc801 0x80640028 #enable trigger window: 200 ns (before), 500 ns (after) +trbcmd w 0x6036 0xc801 0x80c80028 #enable trigger window: 200 ns (before), 1000 ns (after) diff --git a/evtbuild/change2newserver.sh b/evtbuild/change2newserver.sh new file mode 100755 index 0000000..ecb36dd --- /dev/null +++ b/evtbuild/change2newserver.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# JAM 8-mar-2019: switch bnet configuration to new servers +export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "Change eventbulder configuration to setup mar19?") +if [ $myvar == "256" ]; then exit; fi + +# first stop eventbuilders +/home/hadaq/trbsoft/daq/control/gui/eb/65_____Stop_EB; +# stop trigger +/home/hadaq/trbsoft/daq/control/gui/daq/15_Start_Stop_Trigger; +# change setup files +cd /home/hadaq/trbsoft/daq/hub; +rm register_configgbe_ip.db; +ln -s register_configgbe_ip_newservers_secondgbe.db register_configgbe_ip.db; +cd /home/hadaq/trbsoft/daq/evtbuild; +rm eb.conf; +ln -s eb_bnet_ltsm_newservers.conf eb.conf; +rm start_eb_gbe.pl; +ln -s start_eb_gbe_newservers.pl start_eb_gbe.pl; + +# restart daq +/home/hadaq/trbsoft/daq/control/gui/daq/10_Start_DAQ; +# start bnet master +/home/hadaq/trbsoft/daq/control/gui/expert/Restart_BNET_Control; +# start eventbuilders with 8 nodes +/home/hadaq/trbsoft/daq/control/gui/eb/75_Set_8_EB; +# restart hmon (because bnet master webserver was restarted) +/home/hadaq/trbsoft/daq/control/gui/expert/Restart_Hmon + +echo changed eventbuilder configuration to new servers (March 2019) + + + + + diff --git a/evtbuild/change2oldserver.sh b/evtbuild/change2oldserver.sh new file mode 100755 index 0000000..70c5f46 --- /dev/null +++ b/evtbuild/change2oldserver.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# JAM 8-mar-2019: switch bnet configuration to old servers +export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "Change eventbulder configuration to setup 2018?") +if [ $myvar == "256" ]; then exit; fi + +# first stop eventbuilders +/home/hadaq/trbsoft/daq/control/gui/eb/65_____Stop_EB; +# stop trigger +/home/hadaq/trbsoft/daq/control/gui/daq/15_Start_Stop_Trigger; +# change setup files +cd /home/hadaq/trbsoft/daq/hub; +rm register_configgbe_ip.db; +ln -s register_configgbe_ip_oldservers.db register_configgbe_ip.db; +cd /home/hadaq/trbsoft/daq/evtbuild; +rm eb.conf; +ln -s eb_bnet_ltsm.conf eb.conf; +rm start_eb_gbe.pl; +ln -s start_eb_gbe_oldservers.pl start_eb_gbe.pl; + +# restart daq +/home/hadaq/trbsoft/daq/control/gui/daq/10_Start_DAQ; +# start bnet master +/home/hadaq/trbsoft/daq/control/gui/expert/Restart_BNET_Control; +# start eventbuilders with 8 nodes +/home/hadaq/trbsoft/daq/control/gui/eb/75_Set_8_EB; +# restart hmon (because bnet master webserver was restarted) +/home/hadaq/trbsoft/daq/control/gui/expert/Restart_Hmon + +echo changed eventbuilder configuration to old servers (December 2018) + + + + + diff --git a/evtbuild/eb_bnet.conf b/evtbuild/eb_bnet.conf deleted file mode 100644 index a0656cf..0000000 --- a/evtbuild/eb_bnet.conf +++ /dev/null @@ -1,240 +0,0 @@ -# -# #Install: Run CPAN and install -# perl -MCPAN -e shell -# -# #At CPAN shell prompt -# install Config::Std - -#---------------------------------------------- -[Main] - -PORT_BASE: 11000 -WMARK: 60000 - -EB_IP: 192.168.100.12 -EB_OUTDIR: /data/lxhadesdaq/tof_test - -# file/null -EB_OUTDEV: null - -EB_EXT: te - -# file size in MBytes -EB_FSIZE: 500 - -EB_EVTID: 1 -SHMEMNAME: test - -QUEUESIZE: 4000000 - -# enable online server: --online -# disable online server: -ONLINESERVER: --online - -# buffer sizes for evtbuild and netmem (MB) -BUF_SIZE_LOW: 8 -BUF_SIZE_MID: 16 -BUF_SIZE_HIGH: 32 - -#---------------------------------------------- -[Parallel] - -# EB IPS NOT USED IF CONF_FROM_DB - -EB_IP_1: 192.168.100.15 -EB_IP_2: 192.168.100.12 -EB_IP_3: 192.168.100.13 -EB_IP_4: 192.168.100.14 -EB_IP_5: 192.168.100.11 - -# Number of EB processes per server NOT USED IF CONF_FROM_DB -EB_NUM_1: 1 -EB_NUM_2: 1 -EB_NUM_3: 1 -EB_NUM_4: 1 -EB_NUM_5: 1 - -BASE_PORT: 20100 -SHIFT_PORT: 100 -NUM_OF_SOURCES: 1 - -QUEUESIZE: 32 - -# JAM 12/2016- -# the following list configures BNET for each EB SERVER node: -# this will always imply DABC eventbuilder software. -# BNETINP gives number of input processes per server node -# BNETBLD gives number of builder processes per node -# set BNETINP to 0 for conventional EB setup -# EB server 0 1 2 3 -BNETINP: 0 0 0 0 -#BNETINP: 1 1 1 1 -BNETBLD: 2 2 2 2 -#BNETBLD: 4 4 4 4 -#BNETBLD: 1 1 1 1 - -# EB Nr 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -#EB_LIST: 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 -EB_LIST: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - -# Switch to DABC mode (on=1/off=0) for 16 EB processes -# EB Nr 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -#DABC: 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -#DABC: 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 -#DABC: 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 -#DABC: 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -DABC: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -#DABC: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - -# Switch multiple disk ctrl via daq_disks (1=on,0=off) -MULTIDISK: 1 -WRITE_TO_DISK: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -#WRITE_TO_DISK: 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 0 - - -# Log the output of EB processes (log=1/dev-null=0) (at lxhadeb0j:/tmp/log_eb_i.txt and log_nm_i.txt) -EB_LOG: 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 -NM_LOG: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - -# switch on extended evtbuild debug output for logfile (at lxhadeb0j:/tmp/log_eb_i.txt) -EB_DEBUG: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - - - -# Switch (on=1/off=0) EPICS Control of EB processes -# IOC Master is by default the IOC for EB process 1 -EPICS_CTRL: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - -# RFIO switch (on=1/off=0) for 16 EB processes -# EB Nr 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -#RFIO: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -RFIO: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - -# RFIO default options for all EB processes -RFIO_PATH: /hadesnov14raw/prod01 -RFIO_pcOptions: wb -#### if LUSTRE fails, switch the following RFIO_iCopyMode to 0: ##### -# 0 no copy to Lustre/hera -# 1 copy to Lustre after the file is in the write cash, -# 2 copy in parallel to Lustre -RFIO_iCopyMode: 1 -RFIO_pcCopyPath: /hera/hades/raw/nov14/default -RFIO_iCopyFraction: 1 -# Maxfile 100, pathconvention 1 to create new subfolder on lustre after 100 files -RFIO_iMaxFile: 0 -RFIO_iPathConvention: 0 - -# Configure EBs based on info in DB files (1=yes,0=no) -CONF_FROM_DB: 1 - -# Table with active data sources - -DATA_SOURCES: ../main/data_sources.db -GBE_CONF: ../hub/register_configgbe_ip.db -CTS_CONF: ../cts/register_cts.db - - -# -# The following is the individual configuration of EBs -# -#---------------------------------------------- -[EB_PROC_1] - -OUTDIR: /data01/data/ -MULTIDISK: 1 -#RESDOWNSCALE: 20 -#RESNUMEVENTS: 2000 -#RESPATH: /data22/data/res -#RESPATH: /data.local1/data/res -#RESSIZELIMIT: 80 - -#RFIO_pcFile: -#RFIO_pcOptions: - -#---------------------------------------------- -[EB_PROC_2] - -ONLINESERVER: on - -OUTDIR: /data10/data/ - -RESDOWNSCALE: 20 -RESNUMEVENTS: 2000 -RESPATH: /data.local1/data/res -RESSIZELIMIT: 80 - -#RFIO_pcFile: -#RFIO_pcOptions: - -#MULTIDISK: 18 - -#---------------------------------------------- -[EB_PROC_3] - -OUTDIR: /data10/data/ - -#---------------------------------------------- -[EB_PROC_4] - -OUTDIR: /data10/data/ -MULTIDISK: 5 - - -#---------------------------------------------- -[EB_PROC_5] - -OUTDIR: /data02/data/ -MULTIDISK: 2 -#---------------------------------------------- -[EB_PROC_6] - -OUTDIR: /data11/data/ - -#---------------------------------------------- -[EB_PROC_7] - -OUTDIR: /data11/data/ - -#---------------------------------------------- -[EB_PROC_8] -OUTDIR: /data11/data/ - -#---------------------------------------------- -[EB_PROC_9] - -OUTDIR: /data03/data/ -MULTIDISK: 3 -#---------------------------------------------- -[EB_PROC_10] - -OUTDIR: /data.local1/data - -#---------------------------------------------- -[EB_PROC_11] - -OUTDIR: /data12/data/ - -#---------------------------------------------- -[EB_PROC_12] - -OUTDIR: /data12/data/ - -#---------------------------------------------- -[EB_PROC_13] - -OUTDIR: /data04/data/ -MULTIDISK: 4 -#---------------------------------------------- -[EB_PROC_14] - -OUTDIR: /data13/data/ - -#---------------------------------------------- -[EB_PROC_15] - -OUTDIR: /data.local1/data - -#---------------------------------------------- -[EB_PROC_16] - -OUTDIR: /data.local1/data diff --git a/evtbuild/eb_bnet_ltsm.conf b/evtbuild/eb_bnet_ltsm.conf index 424d12c..614d902 100644 --- a/evtbuild/eb_bnet_ltsm.conf +++ b/evtbuild/eb_bnet_ltsm.conf @@ -143,7 +143,7 @@ LTSM: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 # LTSM default options for all EB processes -LTSM_PATH: /lustre/hebe/hades/raw/jul18/default/tsm +LTSM_PATH: /lustre/hebe/hades/raw/mar19/default/tsm #LTSM_Server: lxltsm01-tsm-server LTSM_Server: lxltsm01 diff --git a/evtbuild/eb_bnet_ltsm_newservers.conf b/evtbuild/eb_bnet_ltsm_newservers.conf index c9c5a25..0d072c3 100644 --- a/evtbuild/eb_bnet_ltsm_newservers.conf +++ b/evtbuild/eb_bnet_ltsm_newservers.conf @@ -75,7 +75,7 @@ BNETINP: 1 1 1 1 1 #BNETBLD: 3 3 3 0 ## below enough ltsm connections? default with new servers -BNETBLD: 3 3 3 3 +BNETBLD: 3 3 3 3 # JAM - do not modify this anymore, please use control button "Restart BNET 1 Builder" instead #BNETBLD: 1 0 0 0 diff --git a/evtbuild/start_eb_gbe.sh b/evtbuild/start_eb_gbe.sh index 3073db0..5cfa4cf 100755 --- a/evtbuild/start_eb_gbe.sh +++ b/evtbuild/start_eb_gbe.sh @@ -1 +1 @@ -./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 3; +./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 8; diff --git a/evtbuild/start_eb_gbe_newservers.pl b/evtbuild/start_eb_gbe_newservers.pl index da45991..a24eb22 100755 --- a/evtbuild/start_eb_gbe_newservers.pl +++ b/evtbuild/start_eb_gbe_newservers.pl @@ -59,12 +59,16 @@ my $log_path = "/tmp/log"; my %temp_args; my $temp_args_href = \%temp_args; read_config $opt_ebconf => %$temp_args_href; -#print Dumper $temp_args_href; +#rint Dumper $temp_args_href; #exit; my @bnetservers = ("192.168.100.8","192.168.100.9","192.168.100.10","192.168.105.11", "192.168.105.12"); +#my @bnetservers = ("192.168.100.10","192.168.100.9","192.168.100.8","192.168.105.11", "192.168.105.12"); + + + # my %IP_GSI_lookup = ( # '192.168.100.15' => '140.181.66.160', # '192.168.100.12' => '140.181.76.94', @@ -86,7 +90,7 @@ my @bnetservers = ("192.168.100.8","192.168.100.9","192.168.100.10","192.168.105 '192.168.100.14' => 'lxhadeb04', '192.168.100.8' => 'lxhadeb08', '192.168.100.9' => 'lxhadeb09', - '192.168.100.10' => 'lxhadeb10', + '192.168.100.10' => 'lxhadeb10', '192.168.105.11' => 'lxhadeb11', '192.168.105.12' => 'lxhadeb12', '192.168.105.13' => 'lxhadeb13' @@ -402,11 +406,12 @@ sub getEBArgs() # BNET setup: - my $listOfBnetInputs = $temp_args_href->{'Parallel'}->{'BNETINP'}; - my @bnet_in_list = split(/\s+/, $listOfBnetInputs); - - my $listOfBnetBuilders = $temp_args_href->{'Parallel'}->{'BNETBLD'}; - my @bnet_bld_list = split(/\s+/, $listOfBnetBuilders); + my $listOfBnetInputs = $temp_args_href->{'Parallel'}->{'BNETINP'}; + my @bnet_in_list = split(/\s+/, $listOfBnetInputs); + + my $listOfBnetBuilders = $temp_args_href->{'Parallel'}->{'BNETBLD'}; + my @bnet_bld_list = split(/\s+/, $listOfBnetBuilders); + #print Dumper @bnet_bld_list; #- Default RFIO settings @@ -465,10 +470,10 @@ sub getEBArgs() #exit; foreach my $ebproc ( sort keys %{$eb_ids_gbe_href} ){ - #- If there was a list of EBs provided via command line options - # go to the next $ebproc if the current $ebproc is not in this list. - #print "active EBs:\n"; - #print Dumper $active_EBs_aref; + #- If there was a list of EBs provided via command line options + # go to the next $ebproc if the current $ebproc is not in this list. + #print "active EBs:\n"; + #print Dumper $active_EBs_aref; if(@$active_EBs_aref){ next unless( any {$_ == $ebproc} @$active_EBs_aref ); #from command line args @@ -582,6 +587,8 @@ sub getEBArgs() # we misuse this here to save complexity of setup $href->{$ebproc}->{'BNET_INP'} = $bnet_in_list[$ebproc]; # 0|1|2... $href->{$ebproc}->{'BNET_BLD'} = $bnet_bld_list[$ebproc]; # 0|1|2|3 + #print "dump bnet_bld\n"; + #print Dumper \$bnet_bld_list[$ebproc]; } @@ -602,6 +609,9 @@ sub getEBArgs() } $numOfEBProcs = $ebproc; + #print "result\n"; + #print Dumper $ebproc; + # exit; } sub isVarDefined() @@ -694,6 +704,7 @@ while($totalbuilders < $maxbuilders) my $lasttotalbuilders=$totalbuilders; for ( my $ebserver=0; $ebserver<$maxbuildservers; $ebserver=$ebserver+1){ my $bnet_numbuilders = $EB_Args_href->{$ebserver}->{'BNET_BLD'}; + print "numbuilders for $ebserver is $bnet_numbuilders"; if($totalbuilders < $maxbuilders) { if($localbuilders[$ebserver] < $bnet_numbuilders) @@ -829,9 +840,9 @@ for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1){ # #my $core_nr = &getCoreNr($cpu) . "," . &getCoreNr($cpu); - - # my $exe_dabc = "ssh -n $cpu -l $username \"$dabclogin $cdworkdir $exports taskset -c $core_nr $cmd_dabc $conf_bnet_inp 1senderlog_$cpu.log 2>&1 &\""; + my $core_nr = &getCoreNr($cpu, 'input'); + my $exe_dabc = "ssh -n $cpu -l $username \"$dabclogin $cdworkdir $exports taskset -c $core_nr $cmd_dabc $conf_bnet_inp 1senderlog_$cpu.log 2>&1 &\""; my $log = $log_path . "/log_" . $ebserver . "_" . "startBnetInp_". $sender. ".txt"; @@ -932,9 +943,10 @@ for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1){ } #my $core_nr = &getCoreNr($cpu) . "," . &getCoreNr($cpu); + my $core_nr = &getCoreNr($cpu, 'build'); - #my $exe_dabc = "ssh -n $cpu -l $username \"$dabclogin $cdworkdir $exports taskset -c $core_nr $cmd_dabc $conf_bnet_bld 1builderlog_$cpu.log 2>&1 &\""; + my $exe_dabc = "ssh -n $cpu -l $username \"$dabclogin $cdworkdir $exports taskset -c $core_nr $cmd_dabc $conf_bnet_bld 1builderlog_$cpu.log 2>&1 &\""; my $log = $log_path . "/log_" . $ebserver . "_" . "startBnetBld_". $builder . ".txt"; @@ -950,7 +962,7 @@ for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1){ } # builder processes } # servers - + # finally, we need to set eb lut on cts for setup of EB1 => bnet distribution #trbcmd w 0x0003 0xa0f0 0x8000`; #`trbcmd w 0x0003 0xa0f0 0x1`; @@ -961,8 +973,10 @@ for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1){ # `trbcmd w 0x0003 0xa0f3 0xff0`; `trbcmd setbit 0x0003 0xa0f3 0xff0`; # use EB1 as pseudo receiver for calib triggers - - sleep (20); # need to wait until forking is done, otherwise it does not work via gui control xterm + +sleep (5); # seems also to be fine: michael, 2019-02-18 + +# sleep (20) # old # need to wait until forking is done, otherwise it does not work via gui control xterm } @@ -1555,7 +1569,7 @@ sub killIOC() waitpid($cur_child_pid,0); } - sleep 1; + #sleep 1; ### just kill the remaining stuff @process_list = (); @@ -1603,20 +1617,20 @@ sub forkEB() print "Exec: $exe_eb\n" if($opt_verb); system($exe_eb) unless($opt_test); - sleep(1); + #sleep(1); #--- Open permissions for EB shared memory # ! Permissions should be opened by EB process #print "Exec: $exe_open_eb\n" if($opt_verb); #system($exe_open_eb) unless($opt_test); - sleep(2); + #sleep(2); #--- Execute Net-2-Memory print "Exec: $exe_nm\n" if($opt_verb); system($exe_nm) unless($opt_test); - sleep(1); + #sleep(1); #--- Open permissions for NM shared memory # ! Permissions should be opened by EB process diff --git a/evtbuild/tdc_calib_start.sh b/evtbuild/tdc_calib_start.sh index ec2846a..0b869f5 100755 --- a/evtbuild/tdc_calib_start.sh +++ b/evtbuild/tdc_calib_start.sh @@ -1,14 +1,16 @@ #!/bin/bash - echo setting CTS to calibration mode; +echo setting CTS to calibration mode; export DAQOPSERVER=hadesp31; trbcmd r 0x003 0xa0c7 > /home/hadaq/tmp/precalibctsregs.txt 2> /home/hadaq/tmp/precalibctserr.txt ; echo disabled output mask: `cat /home/hadaq/tmp/precalibctsregs.txt`; trbcmd w 0x003 0xa0c7 0; trbcmd clearbit 0x003 0xa0c0 0x1F; trbcmd setbit 0x003 0xa0c0 0x1D; - trbcmd w 0x003 0xa0e3 0x1E8480; - echo Setting file prefix tc; +# trbcmd w 0x003 0xa0e3 0x1E8480; + trbcmd w 0x003 0xa0e3 0x61A80; + +echo Setting file prefix tc; /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt "http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix=tc&oninit=10"; echo set prefix tc on BNET master controller; diff --git a/evtbuild/tdc_calib_stop.sh b/evtbuild/tdc_calib_stop.sh index 17f3e6d..759b1a0 100755 --- a/evtbuild/tdc_calib_stop.sh +++ b/evtbuild/tdc_calib_stop.sh @@ -1,7 +1,7 @@ #!/bin/bash echo Setting file prefix no file - /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt "http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix='--'&oninit=10" + /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt "http://lxhadeb07:8099/Master/BNET/StopRun/execute?tmout=10" echo set prefix nofile on BNET master controller sleep 2 echo setting CTS back to regular mode diff --git a/hmon/Hmon.pm b/hmon/Hmon.pm index e7a0b21..d249bd6 100644 --- a/hmon/Hmon.pm +++ b/hmon/Hmon.pm @@ -97,17 +97,23 @@ sub TraceDBGet { # Voice Synthesis ############################################################################### my $speaklog; +my $oldmsg; sub Speak { my ($id,$str) = @_; # print "$id $str $speaklog->{$id}\n"; if (!defined $speaklog->{$id} || $speaklog->{$id} < time()-120) { # my $cmd = "ssh hades30 'espeak -ven-male2 -s 120 -g 1 \"$str\" ' 2>/dev/null"; + + return if $id =~ /once/ && (($speaklog->{$id}||0) < time()-600); + #print $id." ".$oldmsg->{$id}." ".$str."\n"; + #($oldmsg->{$id} eq $str) my $fh; open($fh, ">>",Hmon::HMONDIR."/files/speaklog"); $fh->autoflush(1); print $fh $str."\n"; $speaklog->{$id} = time(); close($fh); + $oldmsg->{$id}=$str; } } diff --git a/hmon/QA.pm b/hmon/QA.pm index 0a1572c..3f1220c 100644 --- a/hmon/QA.pm +++ b/hmon/QA.pm @@ -40,7 +40,7 @@ our $entries->{'cats'} = ["main", ]; # Order of entries in each cat -$entries->{'main'} = ['time', 'rate','onlineqa','up','']; +$entries->{'main'} = ['time', 'rate','onlineqa','up','outofsync']; $entries->{'daq'} = ['trbnet', 'timeouts', 'busy','readout','spillcount']; $entries->{'trg'} = ['spill', 'accepted', 'source','pt1rate', 'start']; #, $entries->{'rate'} = ['pt1','start','hodo','pion1','pion2']; @@ -48,12 +48,12 @@ $entries->{'server'} = ['fill', 'cpu', 'icinga', 'etrax', 'pwrsup']; $entries->{'eb'} = ['run', 'rate','bytes', 'lostevt', 'errbits']; $entries->{'mdc'} = ['token', 'blocked', 'temp', 'linkqual', 'voltage']; $entries->{'endp'} = ['mdc','rich', 'tof', 'rpc', 'other']; -$entries->{'feeerr'} = ['trb', 'feeerr','trginp','trgqual','']; +$entries->{'feeerr'} = ['trb', 'feeerr','trginp','trgqual','richthr']; $entries->{'pion'} = ['nxstatus', 'HV', 'HVcurr', 'cooling','seu']; $entries->{'rich'} = ['temp','volt','curr','bkpl','isob']; -$entries->{'ecal'} = ['temp','count','','','']; +$entries->{'ecal'} = ['temp','count','thr','','']; $entries->{'hv'} = ['magnet','mdchv','richhv','ecalhv','sequencer']; -$entries->{'misc'} = ['irq','calib','','','']; +$entries->{'misc'} = ['irq','calib','tofhv','rpchv','fwhv']; our $QAServer = "hades33"; @@ -84,20 +84,23 @@ our @RichInnerTempLimits = (34,34.5,35); our @TrgErrLimits = (100, 1000, 10000); our @CPULimits = (95, 100, 100); our @TimeoutLimits = (0, 0, 1); +our @TimeoutLimitsOnlyRICHMDC = (0, 3, 4); our @LinkErrLimits = (50, 500, 1000); -our @MdcEndpMissingLimits = (0, 1, 2); +our @MdcEndpMissingLimits = (0, 3, 4); our @RichEndpMissingLimits = (0, 3, 4); our @TofEndpMissingLimits = (0, 0, 0); our @RpcEndpMissingLimits = (0, 0, 1); our @OtherEndpMissingLimits = (0, 0, 0);#!!! -our @EBDeltaRateLimits = (0.06, 0.1, 0.15); # as a ratio compared to the rate +our @EBDeltaRateLimits = (0.1, 0.2, 0.3); # as a ratio compared to the rate our $TrgCheckPolarity = 1; -our @Eventsbroken = (.5,5,10); +our @Eventsbroken = (.5,2,5); our @MdcTokenMissLimits = (10,50,100); our @MdcNominalHV = (1750,1770,1900,2150); -our @MdcHVOffsetLimits = (5,10,55); +our $MdcHVOffsetLimits = [[5,10,55],[5,10,55],[5,10,55],[10,110,125]]; our @EcalHvLimits = (326,325,320); -our @TdcCalibrationInterval = (120000,250000,500000); +our @RpcHvLimits = (12,12,11); +our @TofHvLimits = (768,760,759); +our @TdcCalibrationInterval = (320000,450000,600000); our @TdcCalibrationTemperature = (5,7,10); our @PionLvCurrLimits = (4,5,6); @@ -107,7 +110,7 @@ our $RichHvOff = 0; our $MagnetOff = 1; our $PadiwaECalNumber = 84; -our @PadiwaEcalLimits = (0, 0, 0); +our @PadiwaEcalLimits = (0, 1, 2); our @LimitTriggerPerSpill = (1000, 0, 0); our $AcceleratorCycle = 7; diff --git a/hmon/doc/daq-busy.htt b/hmon/doc/daq-busy.htt index 4d24b07..1ca1bb4 100644 --- a/hmon/doc/daq-busy.htt +++ b/hmon/doc/daq-busy.htt @@ -6,16 +6,21 @@ During normal operation, the full message gives the busy times for all sub-syste

Error Handling if the button is not Green

-
Note that in some cases this is not the real source of the error - +
Note that in many cases this is not the real source of the error - e.g. if the data transport to EB failed, the board with the smallest -buffer and the most data gets busy first. Check also the next box "Read-out" for further information. +buffer and the most data gets busy first. + +

*The list of addresses can be found at the wall next to the door to the server room. diff --git a/hmon/doc/daq-readout.htt b/hmon/doc/daq-readout.htt index e69de29..f8176e7 100644 --- a/hmon/doc/daq-readout.htt +++ b/hmon/doc/daq-readout.htt @@ -0,0 +1,9 @@ +


diff --git a/hmon/doc/endp-other.htt b/hmon/doc/endp-other.htt index f0e6114..619de68 100644 --- a/hmon/doc/endp-other.htt +++ b/hmon/doc/endp-other.htt @@ -1,8 +1,10 @@

Other Endpoints

-This button shows if all front-end modules of Shower, Forward Wall, Start-/Veto-detector and CTS are active. +This button shows if all modules of Start-/Veto-detector, CTS as well +as network hubs are active. The button is red if at least one module is missing.

Error Handling

Restart DAQ. If this doesn't help, do a power-cycle of the corresponding system. + - see the list of addresses on the wall next to the door to the server room. diff --git a/hmon/doc/endp-rich.htt b/hmon/doc/endp-rich.htt index a565bdb..cb525b0 100644 --- a/hmon/doc/endp-rich.htt +++ b/hmon/doc/endp-rich.htt @@ -1,8 +1,14 @@

RICH Endpoints

-This button shows if all RICH front-end modules are active. The button is red if at least one module is missing. +This button shows if all RICH front-end modules are active. The button is red if too many +modules are missing.

Error Handling

-

Restart DAQ. If this doesn't help, do a power-cycle of the corresponding system. - +

diff --git a/hmon/doc/endp-rpc.htt b/hmon/doc/endp-rpc.htt index 4cd4cd7..5fc9902 100644 --- a/hmon/doc/endp-rpc.htt +++ b/hmon/doc/endp-rpc.htt @@ -1,7 +1,11 @@ -

RPC Endpoints

+

ECal Endpoints

-This button shows if all RPC front-end modules are active. The button is red if at least one module is missing. +This button shows if all ECal front-end modules are active. The button is red if at least one module +is missing.

Error Handling

-

Restart DAQ. If this doesn't help, do a power-cycle of the corresponding system. +

Restart DAQ. +

If this doesn't help after the third try, do a power-cycle of the ECalRpc 48V supply. Afterward, +do a Reprogram FPGA and Restart DAQ. + diff --git a/hmon/doc/endp-tof.htt b/hmon/doc/endp-tof.htt index ec5577c..03f74ca 100644 --- a/hmon/doc/endp-tof.htt +++ b/hmon/doc/endp-tof.htt @@ -1,9 +1,11 @@

TOF Endpoints

-This button shows if all TOF front-end modules are active. The button is red if at least one module is missing. +This button shows if all TOF and RPC front-end modules are active. The button is red if at least one +module is missing.

Error Handling

-

Restart DAQ. If this doesn't help, do a power-cycle of the corresponding system. +

Restart DAQ. If this doesn't help, do a power-cycle of the corresponding system - see the list +of addresses on the wall next to the door to the server room. diff --git a/hmon/doc/fee-richthr.htt b/hmon/doc/fee-richthr.htt new file mode 100644 index 0000000..0b289a3 --- /dev/null +++ b/hmon/doc/fee-richthr.htt @@ -0,0 +1,4 @@ +

RICH Thresholds + +If there is an error with RICH threshold settings, use "Set RICH Thr". +Note that this is updated only every 2 minutes and loading threshold takes a while. diff --git a/hmon/doc/feeerr-richthr.htt b/hmon/doc/feeerr-richthr.htt new file mode 100644 index 0000000..af36287 --- /dev/null +++ b/hmon/doc/feeerr-richthr.htt @@ -0,0 +1,3 @@ +Shows the amount of channels without proper thresholds. 468 are currently missing, but it shouldn't be more. +
Do a "Set RICH Thr" if an error is shown. You can keep the DAQ running and writing files during this process because +only few pixels are affected. diff --git a/hmon/doc/hv-ecalhv.htt b/hmon/doc/hv-ecalhv.htt index e69de29..11d435b 100644 --- a/hmon/doc/hv-ecalhv.htt +++ b/hmon/doc/hv-ecalhv.htt @@ -0,0 +1 @@ +Just a monitor - if it's read, it's in the responsibility of the ECal operator diff --git a/hmon/doc/hv-fwhv.htt b/hmon/doc/hv-fwhv.htt new file mode 100644 index 0000000..5525391 --- /dev/null +++ b/hmon/doc/hv-fwhv.htt @@ -0,0 +1 @@ +Just a monitor - if it's red, it's in the responsibility of the Forward Wall operator diff --git a/hmon/doc/hv-mdchv.htt b/hmon/doc/hv-mdchv.htt index e69de29..ed5130d 100644 --- a/hmon/doc/hv-mdchv.htt +++ b/hmon/doc/hv-mdchv.htt @@ -0,0 +1 @@ +Just a monitor - if it's red, it's in the responsibility of the MDC operator diff --git a/hmon/doc/main-outofsync.htt b/hmon/doc/main-outofsync.htt new file mode 100644 index 0000000..5e2c81b --- /dev/null +++ b/hmon/doc/main-outofsync.htt @@ -0,0 +1,16 @@ +

Number of out-of-sync boards

+

+Checks which boards are out of sync with the rest of the boards + +

Error Handling if the button is not Green

+ + + + + + + diff --git a/hmon/doc/mdc-linkqual.htt b/hmon/doc/mdc-linkqual.htt index 559a59c..3b3cd99 100644 --- a/hmon/doc/mdc-linkqual.htt +++ b/hmon/doc/mdc-linkqual.htt @@ -1,7 +1,9 @@

MDC Link Errors

This button shows the number of link errors per second. If this number is too high, this could indicate that a front-end board is damaged. Usually, this doesn't need any error handling. Problems can be related to unstable HV in some chambers. -

If this number is huge and at the same time "trigger errors" also shows problems, there might be a problem with a front-end. Restart the DAQ - usually it will tell you that the compile time of one OEP is wrong, so you have to do a "Reload MDC". +

If this number is huge and at the same time "trigger errors" also shows problems, there might be +a problem with a front-end. Restart the DAQ - usually it will tell you that the compile time of one +OEP is wrong, so you have to do a "Reboot OEP". diff --git a/hmon/doc/misc-irq.htt b/hmon/doc/misc-irq.htt index e69de29..fbc9479 100644 --- a/hmon/doc/misc-irq.htt +++ b/hmon/doc/misc-irq.htt @@ -0,0 +1,4 @@ +Checks a certain setting of the interrupts on our eventbuilder servers. If not ok, monitor if the EB lose more data than +usual. +This should usually fix itself within 5 minutes. +Call an expert if it doesn't. diff --git a/hmon/doc/misc-rpchv.htt b/hmon/doc/misc-rpchv.htt new file mode 100644 index 0000000..b0256c1 --- /dev/null +++ b/hmon/doc/misc-rpchv.htt @@ -0,0 +1 @@ +Just a monitor - if it's red, it's in the responsibility of the RPC operator, please inform them. diff --git a/hmon/doc/misc-tofhv.htt b/hmon/doc/misc-tofhv.htt new file mode 100644 index 0000000..3f32a2b --- /dev/null +++ b/hmon/doc/misc-tofhv.htt @@ -0,0 +1 @@ +Just a monitor - if it's red, it's in the responsibility of the TOF operator. Please inform them. diff --git a/hmon/doc/rate-hodo.htt b/hmon/doc/rate-hodo.htt index beb45bf..44b3085 100644 --- a/hmon/doc/rate-hodo.htt +++ b/hmon/doc/rate-hodo.htt @@ -1,2 +1,3 @@ -

Rate on the PT6

-The actual rate on the PT6 trigger input. The left number is the raw count, the right number is after subtraction of the off-spill count rate to reduce noise. +

Rate on the PT3

+The actual rate on the PT3 trigger input. The left number is the raw count, the right number is +after subtraction of the off-spill count rate to reduce noise. diff --git a/hmon/doc/server-cpu.htt b/hmon/doc/server-cpu.htt index 2963508..a67db66 100644 --- a/hmon/doc/server-cpu.htt +++ b/hmon/doc/server-cpu.htt @@ -1,6 +1,7 @@

Server CPU

-This number gives you the server cpu with the highest load, which should not be exceeding ##%. A high server cpu leads to discarded events.
+This number gives you the server cpu with the highest load, which should not be too high, +a high server cpu may lead to discarded events.
See a list of the CPU loads here.

Error Handling if the button is not Green

diff --git a/hmon/doc/server-icinga.htt b/hmon/doc/server-icinga.htt index 850c645..7d935cc 100644 --- a/hmon/doc/server-icinga.htt +++ b/hmon/doc/server-icinga.htt @@ -5,10 +5,8 @@ This field shows if the Icinga Server is up and checks its status.

Error Handling

-

-In case of an error (red field), please take a look to -the Icinga tactical overview. An eMail is automatically sent to a DAQ-expert, -who should know how to proceed.

A DAQ restart will not change the situation. -

An overview of the different servers and services monitored is given in the HADES Wiki. +

In case of an error (red field), you can take a look to the Icinga tactical overview. An eMail is automatically sent to a DAQ-expert, who should know how to proceed. + +

Most errors reported are not directly fatal for data taking. The information might help to debug error conditions (e.g. unreachable power supplies). Talk to the expert if you are unsure. diff --git a/hmon/doc/trg-pt1rate.htt b/hmon/doc/trg-pt1rate.htt index d3e5978..fb3c588 100644 --- a/hmon/doc/trg-pt1rate.htt +++ b/hmon/doc/trg-pt1rate.htt @@ -1,8 +1,10 @@

PT3 Rate

This button shows the triggered high multiplicity events per second compared to the countrate in the Start-detector. -The second number should be around 0.7% during beam time since the interaction rate is around 1%. The first value is the rate -of PT3 triggers provided to the CTS. + +The number shown is the Start rate divided by the PT3 rate. Values around 80 are typical.
If something goes wrong, ask your shift leader. diff --git a/hmon/doc/trg-source.htt b/hmon/doc/trg-source.htt index e9bcd7d..c39bc74 100644 --- a/hmon/doc/trg-source.htt +++ b/hmon/doc/trg-source.htt @@ -2,7 +2,7 @@

This button displays the used Trigger source. It is yellow if there is a trigger input error to CTS.

-If the button is green-yellow, the pulser is switched on. +If the button is olive, the pulser is switched on.

How to deal with problems:

diff --git a/hmon/ecal_drawing.htm b/hmon/ecal_drawing.htm index 259145f..838f360 100644 --- a/hmon/ecal_drawing.htm +++ b/hmon/ecal_drawing.htm @@ -1770,12 +1770,13 @@ function updatedata(d) { resetColor(); var trbs = [ - [ //["0x6025",14,14,14], ["0x6025",9,15,15], ["0x6041",3,22,22], ["0x6041",7,23,23] + [ ["0x6013",1,0,0], ["0x6013",2,1,1], ["0x6013",3,2,2], ["0x6013",4,3,3], ["0x6013",5,4,4] + //["0x6025",14,14,14], ["0x6025",9,15,15], ["0x6041",3,22,22], ["0x6041",7,23,23] ], //["0x6051",1,0,23], ["0x6045",25,0,23], ["0x6011",49,0,23], ["0x6014",73,0,23], ["0x6042",97,0,23], ["0x6015",121,0,23], ["0x6026",145,0,18] ], //sector 0 - [ ["0x6013",1,0,0], ["0x6013",2,1,1], ["0x6013",3,2,2], ["0x6013",4,3,3], ["0x6013",5,4,4], + [ //["0x6013",1,0,0], ["0x6013",2,1,1], ["0x6013",3,2,2], ["0x6013",4,3,3], ["0x6013",5,4,4], ["0x6013",6,8,8], ["0x6013",7,5,5], ["0x6013",8,6,6], ["0x6013",9,7,7], ["0x6013",10,16,16], ["0x6013",11,9,9], ["0x6013",12,10,10], ["0x6013",13,11,11], ["0x6013",14,17,17], ["0x6013",15,18,18], ["0x6013",16,19,19], ["0x6013",17,20,20], ["0x6013",18,12,12], ["0x6013",19,13,13], ["0x6013",20,14,14], ["0x6013",21,15,15], ["0x6013",22,21,21], ["0x6013",23,22,22], ["0x6013",24,23,23], diff --git a/hmon/hmon_adcvolt.pl b/hmon/hmon_adcvolt.pl index 537206d..6d70d44 100755 --- a/hmon/hmon_adcvolt.pl +++ b/hmon/hmon_adcvolt.pl @@ -29,7 +29,7 @@ my $t = [['mV (3.3)','mV (2.5)','mV (1.2)','mV (6)'], ['mV (3.3)','mV (2.5)','mV (1.2)','mA (@1.2)'], ['mV (3.3)','mV (2.5)','mV (1.2)','mV (1.1)'], ['mA (@1.1)','mA (@1.2)','mA (@2.5)','mA (@3.3)']]; -my $channel = [7,7,7,6,5]; #SPI interface number +my $channel = [7,7,7,6,6]; #SPI interface number #1:4V, 2:2V, 3:1V my $resolution = [[2,1,2,1], [2,2,2,1], [2,2,2,4], [2,2,2,2], [3,3,2,2]]; @@ -172,12 +172,13 @@ sub measure { my ($board,$mode) = @_; #2 MHz SPI trb_register_write($board,0xd41a,25); - + trb_register_write($board,0xd417,0x40) if $mode == 4; my $cmd; my $s; my $return; for(my $i = 0; $i <= 4; $i++) { $cmd = 0xc1830000 + ($resolution->[$mode][0] << 25) + (($i % 4) << 28); $s = Dmon::PadiwaSendCmd($cmd,$board,$channel->[$mode]); +# printf("0x%x\n",$board); if($i) { foreach my $t (keys %$s) { $return->[$i-1]{$t} = ($s->{$t}>>19&0xfff)*$multiplier->[$mode][$i-1]; @@ -185,6 +186,7 @@ sub measure { } usleep(5000); } + trb_register_write($board,0xd417,0x0) if $mode == 4; return $return; } diff --git a/hmon/hmon_busynew.pl b/hmon/hmon_busynew.pl index 4db5520..d53c3a6 100755 --- a/hmon/hmon_busynew.pl +++ b/hmon/hmon_busynew.pl @@ -184,8 +184,10 @@ while (1) { my $maxpercent = max(@{$diff->{0x8000}}); my $msgstr = sprintf("%3.1f%%",$maxpercent); my $qastate = QA::OK; + $qastate = QA::WARN if ($maxpercent > 50); + $qastate = QA::WARN_2 if ($maxpercent > 75); $qastate = QA::ERROR if ($maxpercent > 99); - QA::WriteQALog($fqa,"daq","busy",5,$qastate,"Busy",$msgstr,"") unless ($maxpercent > 99); + QA::WriteQALog($fqa,"daq","busy",5,$qastate,"Busy",$msgstr,"") unless ($maxpercent >= 99); } } diff --git a/hmon/hmon_calibration.pl b/hmon/hmon_calibration.pl index b6c7087..f3ff640 100755 --- a/hmon/hmon_calibration.pl +++ b/hmon/hmon_calibration.pl @@ -108,12 +108,12 @@ while(1){ if($export->{quality} && $export->{quality} < 1) { $longtext .= "Quality reported by EB is below 1"; - $status = max(QA::ERROR,$status); + $status = max(QA::FATAL,$status); } ################ comparing timestamps of calib files ############ - my $ls_out = `ls /home/hadaq/oper/*/*.cal -lah --time-style=long-iso`; + my $ls_out = `ls /home/hadaq/oper/*/*.cal -rtlah --time-style=long-iso`; my @ls_out_list = split("\n",$ls_out); my $calib_file_epochs; diff --git a/hmon/hmon_dutyfactor.pl b/hmon/hmon_dutyfactor.pl index d4bb458..f894785 100755 --- a/hmon/hmon_dutyfactor.pl +++ b/hmon/hmon_dutyfactor.pl @@ -33,17 +33,39 @@ HPlot::PlotInit({ HPlot::PlotInit({ name => "SpillSum", file => "files/SpillSumDuty", - entries => 50, + entries => 100, type => HPlot::TYPE_HISTORY, output => HPlot::OUT_PNG, xlabel => "Spills", ylabel => "Total Sum", sizex => 600, sizey => 200, + ymin => 0, + ymax => "*<9E7", curves => 1, buffer => 0, nokey => 1, + storable => 1, }); + +HPlot::PlotInit({ + name => "SpillPeak", + file => "files/SpillPeak", + entries => 100, + type => HPlot::TYPE_HISTORY, + output => HPlot::OUT_PNG, + xlabel => "Spills", + ylabel => "Peak Intensity [Hz]", + sizex => 600, + sizey => 200, + ymin => 0, + ymax => "*<9E6", + curves => 1, + buffer => 0, + nokey => 1, + storable => 1, + }); + my $old; my $diff; @@ -51,6 +73,7 @@ my $oldtime; my @store; my $time = 0; my $empties = 0; +my @lastspills; my $SPS = 10; #samples per second my $sampletime = 1E6/$SPS; @@ -66,7 +89,7 @@ my $iter = 0; while(1) { - my $o = trb_registertime_read_mem(0x5000,0xc000,0,17); + my $o = trb_registertime_read_mem(0x5001,0xc000,0,17); #Just the usual calculation of differences on counters & normalization based on time between reads. if (defined $old) { @@ -86,7 +109,7 @@ while(1) { #sum strips & store my $sum = 0; for my $c (1..16) { - $sum += $diff->{0x5000}[$c]; + $sum += $diff->{0x5001}[$c]; } # $sum = $dummy[$iter++]; #You can't do that on stage @@ -97,7 +120,7 @@ while(1) { my $lastsum = 0; for my $c (1..5) { $lastsum += $store[-$c]//0;} - if($lastsum < 20*5*$SPS && ($store[-6]//0) > 9*$SPS) { + if($lastsum < 100*5*$SPS && ($store[-6]//0) > 100*$SPS) { my $total = sum(@store)/$SPS; my $max = max(@store); @@ -106,23 +129,35 @@ while(1) { my $avg = sum(@store)/$samples; my $duty = $avg/$max; + push(@lastspills,$total); + shift(@lastspills) if scalar @lastspills > 50; + + my $spillmin = min(@lastspills); + my $spillmax = max(@lastspills); + my $spillavg = sum(@lastspills)/(scalar @lastspills); + my $flucqual = ($spillmax-$spillmin)/$spillavg; + HPlot::PlotAdd("DutyFactor",$duty,0); HPlot::PlotAdd("SpillSum", $total,0); + HPlot::PlotAdd("SpillPeak", $max,0); HPlot::PlotDraw('DutyFactor'); HPlot::PlotDraw('SpillSum'); + HPlot::PlotDraw('SpillPeak'); my $length = sprintf("%0.1f s (%i samples)",time()-$time,$samples); my $offtime = $empties/(1E6/$sampletime); - $str = Hmon::MakeTitle(8, 16, "SpillShapeAnalysis",1); + $str = Hmon::MakeTitle(8, 19, "SpillShapeAnalysis",1); $str .= qq@
\n@; $str .= qq@\n@; $str .= qq@\n@; + $str .= qq@\n@; $str .= "
Last Sum".QA::SciNotation($total); - $str .= "
Last Duty".sprintf("%0.3f",$duty); + $str .= "Last Duty".sprintf("%0.3f",$duty); $str .= "
Last Duration".$length; - $str .= "
Last Break".$offtime." s"; + $str .= "Last Break".$offtime." s"; $str .= "
Last Max".QA::SciNotation($max)." Hz (100ms)"; + $str .= "Spill Fluctuation".QA::SciNotation($spillmin)." - ".QA::SciNotation($spillmax)."
∅ ".QA::SciNotation($spillavg)." (".QA::SciNotation($flucqual).")"; $str .= "
"; $str .= Hmon::MakeFooter(); Hmon::WriteFile("SpillShapeAnalysis",$str); diff --git a/hmon/hmon_eb_rate.pl b/hmon/hmon_eb_rate.pl index 93a8f9d..e902105 100755 --- a/hmon/hmon_eb_rate.pl +++ b/hmon/hmon_eb_rate.pl @@ -134,6 +134,8 @@ while (1) { my $status = QA::GetQAState('inside', ($avg_daq - $avg_eb)/($avg_daq?$avg_daq:1), @QA::EBDeltaRateLimits); $status = QA::OK if $loop_counter < 60; + $status = QA::OK if($avg_eb > $avg_daq); + if (!$actmask) { $status = QA::WARN_2; #$diff_p_str = "---"; @@ -144,7 +146,9 @@ while (1) { $error_ctr++; $status = QA::OK; } else { - $error_ctr = 0; + if ($status != QA::ERROR) { + $error_ctr = 0; + } } #$status = QA::ERROR if ($diff > 2000 || $diff < -2000); @@ -153,9 +157,9 @@ while (1) { my $ratestr_eb = &QA::SciNotation($avg_eb); my $ratediff = &QA::SciNotation($avg_daq - $avg_eb); my $shorttext = $ratestr_daq . "/" . $ratestr_eb; - my $longtext = "The average rates over 120s are shown: vg. CTS 120s: " . $ratestr_daq . " - Rate Eventbuilders: $ratestr_eb - ΔRate: $ratediff"; + my $longtext = "The average rates over 120s are shown: avg. CTS 120s: " . $ratestr_daq . " - Rate Eventbuilders: $ratestr_eb - ΔRate: $ratediff"; $longtext = " $longtext ErrorCtr: $error_ctr" if ($error_ctr > 0); - QA::WriteQALog($flog, "eb", "rate", 1, + QA::WriteQALog($flog, "eb", "rate", 2, $status, $title, $shorttext, $longtext); # unless $opt_debug>0; print "status: $status title:$title short:$shorttext long: $longtext \n" unless $opt_debug<1; if ($status >= QA::ERROR) { diff --git a/hmon/hmon_ebsummary.pl b/hmon/hmon_ebsummary.pl index 2db7017..4429a5b 100755 --- a/hmon/hmon_ebsummary.pl +++ b/hmon/hmon_ebsummary.pl @@ -28,7 +28,7 @@ while(1){ for my $i (1.. scalar @{$data->{Builders}{value}}) { $databui[$i] = getjsonhash('eb',"BNET-EB-$i/HadaqCombiner/get.json"); } - + #print Dumper @databui; $data->{RunIdStr}{value} =~ /(\d\d)(\d\d)(\d\d)$/; my $runstart = "--"; $runstart = "$1:$2:$3" if $3; @@ -107,7 +107,7 @@ while(1){ $str .= ""; $class = "bgn"; - $class = "bye" if (time() - $data->{LastCalibr}{'time'} > 84600); + $class = "bye" if (time() - $data->{LastCalibr}{'time'} > 284600); $str .= "
Calib Time".strftime("%d.%m. %H:%M",localtime($calibdata->{LastCalibr})); $class = "bgn"; @@ -145,9 +145,9 @@ while(1){ $str .= "
"; - $str .= ""; + $str .= "
"; $str .= "
Input Nodes"; - $str .= "
Data B/sEvents/sDropped Ev/s"; + $str .= "
Data B/sEvents/sLost Ev/sDropped Ev/s"; for my $i (1.. scalar @{$data->{Inputs}{value}}){ @@ -163,8 +163,8 @@ while(1){ $str .= "
$nodename". "".QA::SciNotation(($datainp[$i]->{HadaqData}{value}//0)*1E6). "".QA::SciNotation(ceil($datainp[$i]->{HadaqEvents}{value}//0)). - "".QA::SciNotation(ceil($datainp[$i]->{HadaqLostEvents}{value}//0)) -# "".QA::SciNotation(($datainp[$i]->{HadaqDroppedData}{value}//0)*1E6)."B " + "".QA::SciNotation(ceil($datainp[$i]->{HadaqLostEvents}{value}//0)). + "".QA::SciNotation(($datainp[$i]->{HadaqDroppedData}{value}//0)*1E6)."B " ; diff --git a/hmon/hmon_ecal_recover_dead_slow_channels.pl b/hmon/hmon_ecal_recover_dead_slow_channels.pl new file mode 100755 index 0000000..f42b82a --- /dev/null +++ b/hmon/hmon_ecal_recover_dead_slow_channels.pl @@ -0,0 +1,153 @@ +#!/usr/bin/perl +use warnings; +use strict; +use HADES::TrbNet; +use Time::HiRes qw(usleep); +use Data::Dumper; + +use lib "/home/hadaq/trbsoft/daqtools/dmon/code"; +use Dmon; + +my $dirich = 0xfe71; +my $std_thresh = 0x6800; + +my $monitor = 0xc001; + +my $hit_counters_reg = 0xc000; + +my $first_channel = 0; +my $last_channel = 47; + +my @res; my $res; my $rh_res; + + +trb_init_ports() or die trb_strerror(); + +# enable monitor counters +$res = trb_register_write($dirich, 0xdf80 , 0xffffffff); +if(!defined $res) { + $res = trb_strerror(); + print "error output: $res\n"; +} + +my $command; +my $chain=0; + +my $READ = 0x0<<20; # bits to set for a read command +my $WRITE = 0x8<<20; # bits to set for a write command +my $REGNR = 24; # number of bits to shift for the register number + +my $skipped_both_counter=0; + +my $rh_tdc_skip_list = {6011=>1, 6012=>1, 6013=>1, 6014=>1, 6015=>1, 6050=>1, 6051=>1, 6052=>1, 6053=>1, 6054=>1, 6055=>1, 6056=>1 }; +#print Dumper $rh_tdc_skip_list; +#exit; + +while (1) { + + $res = trb_register_read_mem($dirich, $hit_counters_reg + 1 , 0, 48); + unshift(@res, $res); + pop @res if ($#res >1); + print "res: $#res\n"; + + my $final_counter = 0; + + if($#res==0) { + sleep 1; + next; + } + + my $rh_thresh = {}; + my $rh_affected = {}; + my $rh_final_list = {}; + my $rh_diffs = {}; + for my $channel (0 .. $last_channel) { + foreach my $cur_ep (keys %{$res[0]}) { + my $rate = $res[0]->{$cur_ep}->[$channel] - $res[1]->{$cur_ep}->[$channel]; + $rh_diffs->{$cur_ep}->[$channel] = $rate; + } + } + + for my $channel (0 .. $last_channel) { + foreach my $cur_ep (keys %{$rh_diffs}) { + my $rate = $rh_diffs->{$cur_ep}->[$channel]; + if ($rate == 0) { + $rh_affected->{$cur_ep}->[$channel] = 1; + } + } + } + + #print Dumper $rh_affected; + #exit; + + for my $channel (0 .. $last_channel) { + $chain = int($channel/16); + $command = ($channel&0xf)<<$REGNR | $READ ; + #print "$command\n"; + $res = Dmon::PadiwaSendCmd($command,$dirich, $chain); + foreach my $cur_ep (keys %$res) { + $rh_thresh->{$cur_ep}->[$channel] = $res->{$cur_ep} &0xffff; + } + } + +#print Dumper $rh_thresh->{0x6024}; +#print Dumper $rh_thresh; +#exit; + + for my $channel (0 .. $last_channel) { + if($channel%2 == 0) { + next; + } + + foreach my $cur_ep (keys %$rh_affected) { + if (defined $rh_tdc_skip_list->{$cur_ep} && $rh_tdc_skip_list->{$cur_ep} == 1) { + next; + } + my $affected = $rh_affected->{$cur_ep}->[$channel]; + if (!defined $affected) { + next; + } + if (defined $rh_affected->{$cur_ep}->[$channel-1]) { + # fast and slow affected: So, no problem of the threshold of the slow + $skipped_both_counter++; + next; + } + my $value = $rh_thresh->{$cur_ep}->[$channel]; + if (!defined $value or $value == 0) { + next; + } + $rh_final_list->{$cur_ep}->{$channel} = 1; + $final_counter++; + } + } + + print Dumper $rh_final_list; + print "thresholds to bw written: $final_counter\n"; + + foreach my $cur_ep (keys %$rh_final_list) { + foreach my $channel (keys %{$rh_final_list->{$cur_ep}}) { + $chain = int($channel/16); + $command = ($channel&0xf)<<$REGNR | $WRITE | 0x1ff; + #print "write: chain: $chain, Channel: $channel, value: $cur_value\n"; + Dmon::PadiwaSendCmd($command,$cur_ep, $chain); + } + } + + + usleep(30E3); + + foreach my $cur_ep (keys %$rh_final_list) { + foreach my $channel (keys %{$rh_final_list->{$cur_ep}}) { + my $value = $rh_thresh->{$cur_ep}->[$channel]; + $chain = int($channel/16); + printf "want to write: $value to ecal: 0x%x, chain %d channel: $channel\n",$cur_ep,$chain; + $command = ($channel&0xf)<<$REGNR | $WRITE | $value; + Dmon::PadiwaSendCmd($command,$cur_ep, $chain); + } + } + + sleep 4; +} + +exit; + diff --git a/hmon/hmon_ecalthreshold.pl b/hmon/hmon_ecalthreshold.pl index 9aa2789..8082483 100755 --- a/hmon/hmon_ecalthreshold.pl +++ b/hmon/hmon_ecalthreshold.pl @@ -37,7 +37,7 @@ foreach my $s (@t) { # $store->{hex($b)}{$chain*16+$channel} = $val; # $b = sprintf('0x')hex($b); my $v = $chain*16+$channel; - + if (($v % 2) == 0 && ($b ne "6036")) { $data->{fast}{"0x".$b}{$v/2} = sprintf('%.2f',$val); if ($val > $fastmax ) {$fastmax = $val;} @@ -49,7 +49,7 @@ foreach my $s (@t) { if ($val < $slowmin ) {$slowmin = $val;} } } - + $data->{fast}{min} = $fastmin; $data->{fast}{max} = $fastmax; $data->{fast}{symbol} = 'threshold'; @@ -72,10 +72,10 @@ foreach my $s (@t) { print $fh encode_json($data->{fast}); close $fh; -sleep 120; +sleep 2; } - - - - + + + + # print Dumper $store; diff --git a/hmon/hmon_endpoints.pl b/hmon/hmon_endpoints.pl index 83ac25c..9d8e172 100755 --- a/hmon/hmon_endpoints.pl +++ b/hmon/hmon_endpoints.pl @@ -174,7 +174,7 @@ while(1) { #0x6000,0x6001,0x6002,0x6003,0x6004,0x6005,0x6006, 0x6010,0x6011,0x6012,0x6013,0x6014,0x6015,0x6016, 0x6020,0x6021,0x6022,0x6023,0x6024,0x6025,0x6026, - 0x6036,#0x6030,0x6031,0x6032,0x6033,0x6034,0x6035, + #0x6030,0x6031,0x6032,0x6033,0x6034,0x6035,0x6036 0x6040,0x6041,0x6042,0x6043,0x6044,0x6045,0x6046, 0x6050,0x6051,0x6052,0x6053,0x6054,0x6055,0x6056, ); @@ -228,8 +228,9 @@ while(1) { if ($num_mdc_missing > 0) {$longtext = "Endp @sorted_mdc_results missing"}; if ($num_mdc_mistake > 0) {$longtext .= " Endp @{$mdc_results[4]} not known";} - my $qastate = QA::GetQAState('below',$num_mdc_missing,@QA::MdcEndpMissingLimits); - Hmon::Speak('mdcmiss',"$num_mdc_missing MDC Frontends missing") if($qastate > 60); + my $qastate = QA::GetQAState('below',$num_mdc_missing,@QA::MdcEndpMissingLimits); + Hmon::Speak('mdcmissonce',"$num_mdc_missing MDC Frontends missing") if($qastate > 60 && $qastate < QA::ERROR ); + Hmon::Speak('mdcmiss',"$num_mdc_missing MDC Frontends missing") if($qastate >= QA::ERROR ); QA::WriteQALog($flog,"endp","mdc",$waittime,$qastate,$title,$value,$longtext); if($qastate > 60) { system("logger -p local1.info -t DAQ Endp \\ $longtext") unless (($timecnt->{mdc}++)%$loggerperiod); @@ -260,7 +261,10 @@ while(1) { if ($num_rich_mistake > 0) {$rich_longtext .= " Endp @{$rich_results[4]} not known";} $qastate = QA::GetQAState('below',$num_rich_missing,@QA::RichEndpMissingLimits); - Hmon::Speak('richmiss',"$num_rich_missing Rich Frontends missing") if($qastate > 60); + Hmon::Speak('richmissonce',"$num_rich_missing Rich Frontends missing") if($qastate > 60 && $qastate < QA::ERROR ); + Hmon::Speak('richmiss',"$num_rich_missing Rich Frontends missing") if($qastate >= QA::ERROR ); + + QA::WriteQALog($flog,"endp","rich",$waittime,$qastate, $rich_title,$rich_value,$rich_longtext); if($qastate > 60) { diff --git a/hmon/hmon_eventrate.pl b/hmon/hmon_eventrate.pl index 99b4dbc..077e7d1 100755 --- a/hmon/hmon_eventrate.pl +++ b/hmon/hmon_eventrate.pl @@ -35,7 +35,7 @@ else { qx(./hmon_hadplotnew.sh -d 400 -o 5 -n 1500 -yscale 1000 -yoverflow 65.536 -ytitle "Event Rate [kHz]" -xtitle "" -output "PNG.files/eventratehistlong.700.315" eventrate 1>/dev/null 2>/dev/null); } else{ - qx(./hmon_hadplotnew.sh -d 10 -o 50 -n 1000 -yscale 1000 -yoverflow 65.536 -ytitle "Event Rate [kHz]" -xtitle "" -output "PNG.files/eventratehistshort.700.315" eventrate 1>/dev/null 2>/dev/null); + qx(./hmon_hadplotnew.sh -d 10 -o 50 -n 2000 -yscale 1000 -yoverflow 65.536 -ytitle "Event Rate [kHz]" -xtitle "" -output "PNG.files/eventratehistshort.700.315" eventrate 1>/dev/null 2>/dev/null); } } diff --git a/hmon/hmon_logerrors.pl b/hmon/hmon_logerrors.pl index bf8b569..95867ae 100755 --- a/hmon/hmon_logerrors.pl +++ b/hmon/hmon_logerrors.pl @@ -99,6 +99,7 @@ while (1) { $msg .= "$bitnames[$b]:"; foreach my $s (sort keys %{$store->{$b}}) { if (($b != 8) && ($b != 7 || $s > 0x2400)) { #no bit 8 + next if ($s > 0x7000 && $b == 10); $msg .= sprintf(" %04x",$s); $t = 1; } diff --git a/hmon/hmon_lvl1mismatch.pl b/hmon/hmon_lvl1mismatch.pl new file mode 100755 index 0000000..1b04a19 --- /dev/null +++ b/hmon/hmon_lvl1mismatch.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl -w + +use warnings; +use Time::HiRes qw(usleep); +use List::Util qw(min max); +use strict; +use Data::Dumper; +use Hmon; +use QA; +use HADES::TrbNet; +use HPlot; +#use Perl2Epics; +use LWP::Simple; + +my $fqa = QA::OpenQAFile(); +trb_init_ports() or die trb_strerror(); + + +while(1){ + my $msg = ""; + my $cnt = 0; + + my $temp = trb_register_read(0xffff,0); + foreach my $b (keys %{$temp}) { + if ($temp->{$b} & 0x10) { + $cnt++; + $msg .= sprintf("%04x ",$b); + } + } + + my $txt = "OK"; + $txt = "$msg" if $cnt && $cnt < 2; + $txt = "Error" if $cnt >= 2; + $msg = "None" if $cnt == 0; + $msg = "Following endpoints report to be out of sync: ".$msg; + my $status = QA::OK; + $status = QA::ERROR if $cnt; + + QA::WriteQALog($fqa,"main","outofsync",20,$status,'Sync',$txt,$msg); + sleep 2; + } diff --git a/hmon/hmon_muxhist.pl b/hmon/hmon_muxhist.pl index 71e264f..7efdba7 100755 --- a/hmon/hmon_muxhist.pl +++ b/hmon/hmon_muxhist.pl @@ -14,7 +14,7 @@ my $plots = fork(); if($plots) { while(1) { - $str = Hmon::MakeTitle(10,12,"Mux Histogram",0); + $str = Hmon::MakeTitle(10,22,"Mux Histogram",0); my $binning = trb_register_read(3,0xa0c8) or sleep 5 and next; my $offset = trb_register_read(3,0xa0c6) or sleep 5 and next; my $source = trb_register_read(3,0xa0c2) or sleep 5 and next; @@ -58,7 +58,8 @@ if($plots) { } - $str .= qq@Source A: @.$src[0].qq@, Source B: @.$src[1].qq@
Offset: $offset@.qq@s - Binning: $binning@.qq@s@; + $str .= qq@Source A: @.$src[0].qq@, Source B: @.$src[1].qq@
Offset: $offset@.qq@s - Binning: $binning@.qq@s\n@; + $str .= qq@
@; $str .= Hmon::MakeFooter(); Hmon::WriteFile("Muxhist",$str); sleep(5); @@ -69,8 +70,13 @@ else { qx(./hmon_hadplot_daqtools.sh -d 3000 \\ -a 0x0003 -r 41216 -m 500 -p 0 -w 32 -t "A" \\ -a 0x0003 -r 41716 -m 500 -p 0 -w 32 -t "B" \\ - -output "PNG.files/muxhist.760.530" -curvestyle steps -key genreg 2>/dev/null & + -output "PNG.files/muxhist.760.500" -curvestyle steps -key genreg 2>/dev/null & + +./hmon_hadplot_daqtools.sh -d 3000 \\ + -a 0x0003 -r 41216 -m 500 -p 0 -w 32 -t "A" \\ + -output "PNG.files/muxhist2.760.500" -curvestyle steps -key genreg 2>/dev/null & - ); + ); + } diff --git a/hmon/hmon_readoutstuck.pl b/hmon/hmon_readoutstuck.pl index d5780cd..5703604 100755 --- a/hmon/hmon_readoutstuck.pl +++ b/hmon/hmon_readoutstuck.pl @@ -11,7 +11,7 @@ use QA; my $evtnum = 0; my $rate = 0; - +my $timer = 0; trb_init_ports() or die trb_strerror(); my $fqa = QA::OpenQAFile(); Hmon::TraceDBLoad(); @@ -21,13 +21,18 @@ sub isFeeHub { my $hubs = "8401 8411 8601 8701 8801 0x8204,0x8206,0x8212,0x8213,0x8214,0x8215,0x8216,0x8217,0x8221,0x8222,0x8223,0x8224,0x8225,0x8226,0x8227,0x8228,0x8229, 0x8231,0x8239,0x8240,0x8241,0x8242,0x8243,0x8244,0x8245,0x8246,0x8247,0x8248,0x8249,0x824a,0x8251,0x8252,0x8254,0x8256,0x8258,0x8259, 0x8260,0x8261,0x8262,0x8263,0x8264,0x8265,0x8266,0x8267,0x8268,0x8269,0x826a,0x8271,0x8279,0x8281,0x8282,0x8283,0x8284,0x8285,0x8286,0x8287,0x8288,0x8289, - 0x8292,0x8293,0x8294,0x8295,0x8296,0x8297,0x82a4,0x82a6, 8a00 8a01 8a02 8a03 8a04 8a05 "; + 0x8292,0x8293,0x8294,0x8295,0x8296,0x8297,0x82a4,0x82a6, 8a00 8a01 8a02 8a03 8a04 8a05 + 0x1002 0x1001 0x1003 0x1004 0x1011 0x1012 0x1013 0x1014 0x1022 0x1021 0x1023 0x1024 + 0x1031 0x1032 0x1033 0x1034 0x1041 0x1042 0x1043 0x1044 0x1051 0x1052 0x1053 0x1054 + 0x1111 0x1112 0x1113 0x1114 0x1101 0x1102 0x1103 0x1104 0x1121 0x1122 0x1123 0x1124 + 0x1131 0x1132 0x1133 0x1134 0x1141 0x1142 0x1143 0x1144 0x1151 0x1152 0x1153 0x1154 + "; my $hs = sprintf("%04x",$h); # print $h."\n"; if (index($hubs,$hs) != -1) { return 1; } - if ($h > 0x1000 && $h < 0x1200 && $h%16) { + if ($h >= 0x1000 && $h < 0x1200) { return 1; } return 0; @@ -82,8 +87,12 @@ while (1) { $status = "Waiting" if $boardlist ne ""; $longmsg = "Read-out seems to be stuck. Hubs waiting for read-out: $boardlist" if $boardlist ne ""; + system("logger -p local1.info -t DAQ Readout \\ $longmsg") if $boardlist ne "" && $timer == 0; Hmon::Speak('busy', "Error: Data taking not running.") if $qastate >= QA::ERROR; QA::WriteQALog($fqa, "daq", "readout", 30, $qastate,"Read-out", $status,$longmsg); # print $qastate." ".$status." ".$longmsg."\n"; + + $timer++ if $boardlist ne ""; + $timer = 0 if $timer >= 15; sleep(1); } diff --git a/hmon/hmon_richthreshold.pl b/hmon/hmon_richthreshold.pl index 67f4791..00f28cf 100755 --- a/hmon/hmon_richthreshold.pl +++ b/hmon/hmon_richthreshold.pl @@ -45,6 +45,8 @@ $str .= qq@
\n@; $str .= Hmon::MakeFooter(); Hmon::WriteFile("RichThresh",$str); +my $fqa = QA::OpenQAFile(); + my $filename = 'rich_pmt_parameters_xy.geo'; open(my $fh, '<:encoding(UTF-8)', $filename) @@ -66,25 +68,49 @@ Hmon::WriteFile("RichThresh",$str); } } +my $timecnt=0; +my $missChn = 470; # Nmbr of missing channels that is allowed. +my $thr_cnt = 0; + + while(1){ -my @t; -my $store; -for my $i (0..15) { - my $cmd = "/home/hadaq/trbsoft/daqtools/tools/spi_slave.pl -e=0xfe51 -c=0 -x pwm --channel=".$i; - push(@t,qx($cmd)); - $cmd = "/home/hadaq/trbsoft/daqtools/tools/spi_slave.pl -e=0xfe51 -c=1 -x pwm --channel=".$i; - push(@t,qx($cmd)); + +if ($timecnt == 0){ + $timecnt = 12; + my @t; + my $store; + $thr_cnt = 0; + for my $i (0..15) { + my $cmd = "/home/hadaq/trbsoft/daqtools/tools/spi_slave.pl -e=0xfe51 -c=0 -x pwm --channel=".$i; + push(@t,qx($cmd)); + $cmd = "/home/hadaq/trbsoft/daqtools/tools/spi_slave.pl -e=0xfe51 -c=1 -x pwm --channel=".$i; + push(@t,qx($cmd)); } -foreach my $s (@t) { - my ($b,$chain,$channel,$val) = $s =~ /endpoint: 0x(\w\w\w\w) chain: (\d) channel: (\d+) .+ voltage: (\d+\.\d+) mV/; -# $store->{hex($b)}{$chain*16+$channel} = $val; - $b = hex($b); - my $v = $chain*16+$channel; - HPlot::PlotFill('RichThresh',$val,$pos[$b&0xfff][$v+1][0],$pos[$b&0xfff][$v+1][1]); + foreach my $s (@t) { + my ($b,$chain,$channel,$val) = $s =~ /endpoint: 0x(\w\w\w\w) chain: (\d) channel: (\d+) .+ voltage: (\d+\.\d+) mV/; +# $store->{hex($b)}{$chain*16+$channel} = $val; + $b = hex($b); + my $v = $chain*16+$channel; + if ($val < 1330 || $val > 2500) { + $thr_cnt++; + } + HPlot::PlotFill('RichThresh',$val,$pos[$b&0xfff][$v+1][0],$pos[$b&0xfff][$v+1][1]); } -HPlot::PlotDraw('RichThresh'); + + HPlot::PlotDraw('RichThresh'); + +} +my $qastate = QA::OK; + $qastate = QA::ERROR if ($thr_cnt > $missChn); + +my $str = sprintf("%i", $thr_cnt); +my $longstr = sprintf("Thresholds are well loaded. (%i chnls missing)", $thr_cnt); + $longstr = "load Thresholds to RICH" if ($thr_cnt > $missChn) ; +QA::WriteQALog($fqa,"feeerr","richthr", 40, $qastate, "RICH Thresholds", $str, $longstr); + +$timecnt--; -sleep 120; +sleep 10; } diff --git a/hmon/hmon_spill.pl b/hmon/hmon_spill.pl index fae6825..cf6acb9 100755 --- a/hmon/hmon_spill.pl +++ b/hmon/hmon_spill.pl @@ -122,17 +122,17 @@ while (1) { QA::SciNotation($spillavgshort), QA::SciNotation($spillavglong), $spilllength); - QA::WriteQALog($fqa,"trg", "spill", 30, $qastate, "Spill Sum", + QA::WriteQALog($fqa,"trg", "spill", 50, $qastate, "Spill Sum", $qashort, $qalong) unless $opt_debug>0; HPlot::PlotAdd("EvtsPerSpill",$events/1E3) unless $opt_debug>0; HPlot::PlotDraw("EvtsPerSpill") unless $opt_debug>0; $events = 0; $spilllength = 0; - } elsif ($spilllength > 20) { - QA::WriteQALog($fqa, "trg", "spill", 30, QA::NOTE, "Spill Sum", + } elsif ($spilllength > 30) { + QA::WriteQALog($fqa, "trg", "spill", 50, QA::NOTE, "Spill Sum", "No Spills", "No Spills detected at the moment") unless $opt_debug>0;; #print $spilllength."\n" unless $spilllength%10; - if($spilllength >= 25 && ($spilllength%25 == 0)) { + if($spilllength >= 30 && ($spilllength%30 == 0)) { # my $data = Perl2Epics::GetAll(); # print STDERR $data->{'prefix'}->{val}."\n"; # if(($data->{'prefix'}->{val} eq '-1') || ($data->{'prefix'}->{val} eq 'be')) { @@ -171,7 +171,7 @@ while (1) { $qashort, $qalong) unless $opt_debug>0; my $spillcountstate = QA::OK; - if ($countnochange > 15) {$spillcountstate = QA::WARN;} + if ($countnochange > 25) {$spillcountstate = QA::WARN;} QA::WriteQALog($fqa, "daq", "spillcount", 5, $spillcountstate, "Spill Count", $spillcount,"Number of spills: $spillcount" ) unless $opt_debug>0; if($lastspillcount == $spillcount) { diff --git a/hmon/hmon_startrate.pl b/hmon/hmon_startrate.pl index 0f4ebda..80b20d1 100755 --- a/hmon/hmon_startrate.pl +++ b/hmon/hmon_startrate.pl @@ -33,6 +33,10 @@ HPlot::PlotInit({ buffer => 1, stacked => 1, curvewidth => .9, + additional => " + set obj 1 rect from -1, 3.5E6 to 200, 4E6 fc rgb '#ffffbb' behind \n + set obj 2 rect from -1, 4E6 to 200, 10E6 fc rgb '#ffdddd' behind + " }); HPlot::PlotInit({ @@ -54,6 +58,10 @@ HPlot::PlotInit({ xscale => 10, buffer => 1, stacked => 1, + additional => " + set obj 1 rect from -1, 3.5E6 to 200, 4E6 fc rgb '#ffffbb' behind \n + set obj 2 rect from -1, 4E6 to 200, 10E6 fc rgb '#ffdddd' behind \n + ", curvewidth => .9, }); diff --git a/hmon/hmon_timeout.pl b/hmon/hmon_timeout.pl index cbd3333..b607512 100755 --- a/hmon/hmon_timeout.pl +++ b/hmon/hmon_timeout.pl @@ -64,13 +64,17 @@ while (1) { $msg2 =~ s/\s+\)/\)/g; $msg2 =~ s/\(\s+/\(/g; my $status = "on ".($cnt+$cnt2)." boards"; my $qastate = QA::GetQAState('below', $cnt+$cnt2, @QA::TimeoutLimits); - $qastate = QA::ERROR if (($MDCRICH_fail == 0) && ($qastate == QA::FATAL)); + #$qastate = QA::ERROR if (($MDCRICH_fail == 0) && ($qastate == QA::FATAL)); + if ($MDCRICH_fail == 0) { + $qastate = QA::GetQAState('below', $cnt+$cnt2, @QA::TimeoutLimitsOnlyRICHMDC); + } + if($boardlist1 ne "") { - Hmon::Speak('timeout',"$cnt Frontend had a timeout: $boardlist1 ") if $cnt < 3; + Hmon::Speak('timeout'.(($qastate= 3; } if($boardlist2 ne "" && $boardlist1 eq "" ) { - Hmon::Speak("timeout","$cnt2 Frontend disabled after a timeout: $boardlist2") if $cnt2 < 3; + Hmon::Speak("timeout".(($qastate= 3; } diff --git a/hmon/hmon_trgsource.pl b/hmon/hmon_trgsource.pl index 2e494c8..3fcdcfa 100755 --- a/hmon/hmon_trgsource.pl +++ b/hmon/hmon_trgsource.pl @@ -73,6 +73,7 @@ $plot2->{ylabel} = "accepted PT3 Ratio"; $plot2->{sizex} = 630; $plot2->{sizey} = 220; $plot2->{nokey} = 1; +$plot2->{storable} = 1; HPlot::PlotInit($plot2); $str = Hmon::MakeTitle(8,5,"PT3 accepted over total PT3 per spill (%)",0); $str .= qq@@; @@ -171,7 +172,7 @@ while (1) { my $longmsgcheck = $longmsg; #Input polarity wrong? - if($QA::TrgCheckPolarity && (($polarity->{3}->[1] & 0x7fff0000) || $polarity->{3}->[0] & 0x1e0)) { + if($QA::TrgCheckPolarity && (($polarity->{3}->[1] & 0x7fff0000))) { # || $polarity->{3}->[0] & 0x1e0) $qastate = QA::WARN; $longmsg .= " - Signal polarity wrong on inputs "; foreach my $i(0..30) { @@ -184,12 +185,12 @@ my $longmsgcheck = $longmsg; $longmsg .= ", "; } } - foreach my $i(5..8) { - if($polarity->{3}->[0] & (1<<$i)) { - $longmsg .= "PT ".$i; - $longmsg .= ", "; - } - } +# foreach my $i(5..8) { +# if($polarity->{3}->[0] & (1<<$i)) { +# $longmsg .= "PT ".$i; +# $longmsg .= ", "; +# } +# } chop $longmsg foreach(0..1); } @@ -216,7 +217,7 @@ my $longmsgcheck = $longmsg; my $qastateacc = QA::OK; QA::WriteQALog($fqa, "trg", "source", 10, $qastate, "Trigger Source", $msg, $longmsg); - QA::WriteQALog($fqa, "trg", "accepted", 10, $qastateacc, "Accept. PT1", $accmsg, $acclmsg); + QA::WriteQALog($fqa, "trg", "accepted", 10, $qastateacc, "Accept. PT3", $accmsg, $acclmsg); my $qastatept = QA::OK; my $ptoverStattart = $rStat->{3}->[0x24]/($rStat->{3}->[0x2c] || 1)*100; diff --git a/hmon/index.cgi b/hmon/index.cgi index 7b02198..4e9ee8b 100755 --- a/hmon/index.cgi +++ b/hmon/index.cgi @@ -27,27 +27,32 @@ function openwin(url) { -