From 9959613f4aad8e9dc46eb81353836918932f0a89 Mon Sep 17 00:00:00 2001 From: PANDA DIRDAQ Date: Sat, 12 Jul 2014 02:09:10 +0200 Subject: [PATCH] new startup scripts, mt --- users/gsi_dirc/configure_trb3.sh | 8 + users/gsi_dirc/start_readout.pl | 2 +- users/gsi_dirc/startup.sh | 272 +++---------------------------- 3 files changed, 28 insertions(+), 254 deletions(-) diff --git a/users/gsi_dirc/configure_trb3.sh b/users/gsi_dirc/configure_trb3.sh index f3e6e84..1a95f9d 100755 --- a/users/gsi_dirc/configure_trb3.sh +++ b/users/gsi_dirc/configure_trb3.sh @@ -1,3 +1,11 @@ +######################### +# old, don't use anymore! +######################## + +echo "don't use this file" + + +exit; trbcmd w 0xff7f 0x8305 0x1 # use GbE diff --git a/users/gsi_dirc/start_readout.pl b/users/gsi_dirc/start_readout.pl index db52797..6be8cbd 100755 --- a/users/gsi_dirc/start_readout.pl +++ b/users/gsi_dirc/start_readout.pl @@ -37,7 +37,7 @@ $c=qq|pkill -f "daq_evtbuild -S $label"|; qx($c); # if any, kill existing daq_ev $c=qq|pkill -f "daq_netmem -S $label"|; qx($c); # if any, kill existing daq_netmem -$c=qq|xterm -geometry 122x14-0+0 -e bash -c 'daq_evtbuild -S $label -m 22 -x cc -d file -o $dataPath'|; +$c=qq|xterm -geometry 122x14-0+0 -e bash -c 'daq_evtbuild -S $label -m 22 -x te -d file -o $dataPath'|; #$c=qq|xterm -geometry 122x14-0+0 -e bash -c 'daq_evtbuild -S $label -m 1 -d file -o $dataPath'|; print $c; diff --git a/users/gsi_dirc/startup.sh b/users/gsi_dirc/startup.sh index 12852ac..81b9b68 100755 --- a/users/gsi_dirc/startup.sh +++ b/users/gsi_dirc/startup.sh @@ -7,7 +7,7 @@ export TRB3_SERVER=trb056:26000 export TRBNETDPID=$(pgrep trbnetd) -echo "trbnetd pid: $TRBNETDPID" +echo "- trbnetd pid: $TRBNETDPID" if [[ -z "$TRBNETDPID" ]] then @@ -18,7 +18,7 @@ fi #export TRB3_SERVER=trb056 export DAQOPSERVER=localhost:56 -echo -n "number of trb endpoints in the system: " +echo -n "- number of trb endpoints in the system: " trbcmd i 0xffff | wc -l @@ -30,23 +30,25 @@ trbcmd i 0xffff | wc -l ################################################## ## Set addresses ################################################## -./merge_serial_address.pl ~/trbsoft/daqtools/base/serials_trb3.db ~/trbsoft/daqtools/base/addresses_trb3.db > /dev/null +~/trbsoft/daqtools/merge_serial_address.pl ~/trbsoft/daqtools/base/serials_trb3.db ~/trbsoft/daqtools/users/gsi_dirc/addresses_trb3.db > /dev/null ################################################## ## Configure GbE for DAQ ################################################## -./configure_trb3.sh # central hub configuration to send data via GbE +trbcmd w 0xff7f 0x8308 0xffffff # Trigger counter + +~/trbsoft/daqtools/tools/loadregisterdb.pl register_configgbe.db +~/trbsoft/daqtools/tools/loadregisterdb.pl register_configgbe_ip.db ################################################## ## Configure TDCs ################################################## -trbcmd w 0xfe48 0xc800 0x00000001 ## logic analyser control register -trbcmd w 0xfe48 0xc801 0x000f0005 ## trigger window enable & trigger window width - +#trbcmd w 0xfe48 0xc801 0x000f0005 ## trigger window enable & trigger window width #trbcmd w 0xfe48 0xc800 0x00002000 ## Triggered mode #trbcmd w 0xfe48 0xc800 0x00003000 ## Triggerless mode - #trbcmd w 0xfe48 0xc801 0x000f0005 ## trigger window enable & trigger window width + +trbcmd w 0xfe48 0xc800 0x00000001 ## logic analyser control register trbcmd w 0xfe48 0xc801 0x80620062 ## triggerwindow +/-490ns ;5ns granularity trbcmd w 0xfe48 0xc802 0x00000000 ## channel 01-32 enable trbcmd w 0xfe48 0xc803 0x00000000 ## channel 33-64 enable @@ -58,258 +60,19 @@ trbcmd w 0xfe48 0xc804 0x00000080 ## data transfer limit # Reset trigger logic - only a workaround for a bug #trbcmd w 0xffff 0x20 0x33 -echo -n "padiwas: inverting padiwa outputs: "; -perl -e \ -' -use Parallel::ForkManager; - -@padiwas = qw(0x010 0x011 0x012 0x013 0x110 0x111 0x112 0x113 0x210 0x211 0x212 0x213 0x310 0x311 0x312 0x313 0x410 0x411 0x412 0x413 0x510 0x511 0x512 0x513 0x610 0x611 0x612 0x613 0x710 0x711 0x712 0x713 0x810 0x811 0x812 0x813 0x910 0x911 0x912 0x913 0x1010 0x1011 0x1012 0x1013 0x1110 0x1111 0x1112 0x1113 0x1210 0x1211 0x1212 0x1213 0x1310 0x1311 0x1312 0x1313 0x1410 0x1411 0x1412 0x1413); - -my $MAX_PROCESSES = 100; -my $pm = Parallel::ForkManager->new($MAX_PROCESSES); - -foreach (@padiwas) { - my $pid = $pm->start and next; - print "$_ "; - $c="/home/hadaq/trbsoft/daqtools/padiwa.pl $_ 0 invert 0xffff >/dev/null"; - qx($c); die "could not execute command $c" if $?; - $pm->finish; # Terminates the child process -}; -$pm->wait_all_children; -print "\n"; -print "padiwas: turn off all leds: "; -foreach (@padiwas) { - my $pid = $pm->start and next; - print "$_ "; - $c="/home/hadaq/trbsoft/daqtools/padiwa.pl $_ 0 led 0x10 >/dev/null"; - qx($c); die "could not execute command $c" if $?; - $pm->finish; # Terminates the child process -}; -$pm->wait_all_children; - -print " done\n"; -' - -#beam counter TRB 15 - no PADIWAs (yet) +~/trbsoft/daqtools/users/gsi_dirc/prepare_padiwas_invert_leds.pl "0x010 0x011 0x012 0x013 0x110 0x111 0x112 0x113 0x210 0x211 0x212 0x213 0x310 0x311 0x312 0x313 0x410 0x411 0x412 0x413 0x510 0x511 0x512 0x513 0x610 0x611 0x612 0x613 0x710 0x711 0x712 0x713 0x810 0x811 0x812 0x813 0x910 0x911 0x912 0x913 0x1010 0x1011 0x1012 0x1013 0x1110 0x1111 0x1112 0x1113 0x1210 0x1211 0x1212 0x1213 0x1310 0x1311 0x1312 0x1313 0x1410 0x1411 0x1412 0x1413" # enable used channels +echo "- turn on/off TDC-channels" -trbcmd w 0xfe48 0xc802 0x00000000 -trbcmd w 0xfe48 0xc803 0x00000000 - -echo "turn on/off TDC-channels" -# (MCP# * 100 ) + 10 + 0...3 -trbcmd w 0x0010 0xc802 0xffffffff -trbcmd w 0x0010 0xc803 0x00000000 -trbcmd w 0x0011 0xc802 0xffffffff -trbcmd w 0x0011 0xc803 0x00000000 -trbcmd w 0x0012 0xc802 0xffffffff -trbcmd w 0x0012 0xc803 0x00000000 -trbcmd w 0x0013 0xc802 0xffffffff -trbcmd w 0x0013 0xc803 0x00000000 - -trbcmd w 0x0110 0xc802 0xffffffff -trbcmd w 0x0110 0xc803 0x00000000 -trbcmd w 0x0111 0xc802 0xffffffff -trbcmd w 0x0111 0xc803 0x00000000 -trbcmd w 0x0112 0xc802 0xffffffff -trbcmd w 0x0112 0xc803 0x00000000 -trbcmd w 0x0113 0xc802 0xffffffff -trbcmd w 0x0113 0xc803 0x00000000 - -trbcmd w 0x0210 0xc802 0xffffffff -trbcmd w 0x0210 0xc803 0x00000000 -trbcmd w 0x0211 0xc802 0xffffffff -trbcmd w 0x0211 0xc803 0x00000000 -trbcmd w 0x0212 0xc802 0xffffffff -trbcmd w 0x0212 0xc803 0x00000000 -trbcmd w 0x0213 0xc802 0xffffffff -trbcmd w 0x0213 0xc803 0x00000000 - -trbcmd w 0x0310 0xc802 0xffffffff -trbcmd w 0x0310 0xc803 0x00000000 -trbcmd w 0x0311 0xc802 0xffffffff -trbcmd w 0x0311 0xc803 0x00000000 -trbcmd w 0x0312 0xc802 0xffffffff -trbcmd w 0x0312 0xc803 0x00000000 -trbcmd w 0x0313 0xc802 0xffffffff -trbcmd w 0x0313 0xc803 0x00000000 - -trbcmd w 0x0410 0xc802 0xffffffff -trbcmd w 0x0410 0xc803 0x00000000 -trbcmd w 0x0411 0xc802 0xffffffff -trbcmd w 0x0411 0xc803 0x00000000 -trbcmd w 0x0412 0xc802 0xffffffff -trbcmd w 0x0412 0xc803 0x00000000 -trbcmd w 0x0413 0xc802 0xffffffff -trbcmd w 0x0413 0xc803 0x00000000 - -trbcmd w 0x0510 0xc802 0xffffffff -trbcmd w 0x0510 0xc803 0x00000000 -trbcmd w 0x0511 0xc802 0xffffffff -trbcmd w 0x0511 0xc803 0x00000000 -trbcmd w 0x0512 0xc802 0xffffffff -trbcmd w 0x0512 0xc803 0x00000000 -trbcmd w 0x0513 0xc802 0xffffffff -trbcmd w 0x0513 0xc803 0x00000000 - -trbcmd w 0x0610 0xc802 0xffffffff -trbcmd w 0x0610 0xc803 0x00000000 -trbcmd w 0x0611 0xc802 0xffffffff -trbcmd w 0x0611 0xc803 0x00000000 -trbcmd w 0x0612 0xc802 0xffffffff -trbcmd w 0x0612 0xc803 0x00000000 -trbcmd w 0x0613 0xc802 0xffffffff -trbcmd w 0x0613 0xc803 0x00000000 - -trbcmd w 0x0710 0xc802 0xffffffff -trbcmd w 0x0710 0xc803 0x00000000 -trbcmd w 0x0711 0xc802 0xffffffff -trbcmd w 0x0711 0xc803 0x00000000 -trbcmd w 0x0712 0xc802 0xffffffff -trbcmd w 0x0712 0xc803 0x00000000 -trbcmd w 0x0713 0xc802 0xffffffff -trbcmd w 0x0713 0xc803 0x00000000 - -trbcmd w 0x0810 0xc802 0xffffffff -trbcmd w 0x0810 0xc803 0x00000000 -trbcmd w 0x0811 0xc802 0xffffffff -trbcmd w 0x0811 0xc803 0x00000000 -trbcmd w 0x0812 0xc802 0xffffffff -trbcmd w 0x0812 0xc803 0x00000000 -trbcmd w 0x0813 0xc802 0xffffffff -trbcmd w 0x0813 0xc803 0x00000000 - -trbcmd w 0x0910 0xc802 0xffffffff -trbcmd w 0x0910 0xc803 0x00000000 -trbcmd w 0x0911 0xc802 0xffffffff -trbcmd w 0x0911 0xc803 0x00000000 -trbcmd w 0x0912 0xc802 0xffffffff -trbcmd w 0x0912 0xc803 0x00000000 -trbcmd w 0x0913 0xc802 0xffffffff -trbcmd w 0x0913 0xc803 0x00000000 - -trbcmd w 0x1010 0xc802 0xffffffff -trbcmd w 0x1010 0xc803 0x00000000 -trbcmd w 0x1011 0xc802 0xffffffff -trbcmd w 0x1011 0xc803 0x00000000 -trbcmd w 0x1012 0xc802 0xffffffff -trbcmd w 0x1012 0xc803 0x00000000 -trbcmd w 0x1013 0xc802 0xffffffff -trbcmd w 0x1013 0xc803 0x00000000 - -trbcmd w 0x1110 0xc802 0xffffffff -trbcmd w 0x1110 0xc803 0x00000000 -trbcmd w 0x1111 0xc802 0xffffffff -trbcmd w 0x1111 0xc803 0x00000000 -trbcmd w 0x1112 0xc802 0xffffffff -trbcmd w 0x1112 0xc803 0x00000000 -trbcmd w 0x1113 0xc802 0xffffffff -trbcmd w 0x1113 0xc803 0x00000000 - -trbcmd w 0x1210 0xc802 0xffffffff -trbcmd w 0x1210 0xc803 0x00000000 -trbcmd w 0x1211 0xc802 0xffffffff -trbcmd w 0x1211 0xc803 0x00000000 -trbcmd w 0x1212 0xc802 0xffffffff -trbcmd w 0x1212 0xc803 0x00000000 -trbcmd w 0x1213 0xc802 0xffffffff -trbcmd w 0x1213 0xc803 0x00000000 - -trbcmd w 0x1310 0xc802 0xffffffff -trbcmd w 0x1310 0xc803 0x00000000 -trbcmd w 0x1311 0xc802 0xffffffff -trbcmd w 0x1311 0xc803 0x00000000 -trbcmd w 0x1312 0xc802 0xffffffff -trbcmd w 0x1312 0xc803 0x00000000 -trbcmd w 0x1313 0xc802 0xffffffff -trbcmd w 0x1313 0xc803 0x00000000 - -trbcmd w 0x1410 0xc802 0xffffffff -trbcmd w 0x1410 0xc803 0x00000000 -trbcmd w 0x1411 0xc802 0xffffffff -trbcmd w 0x1411 0xc803 0x00000000 -trbcmd w 0x1412 0xc802 0xffffffff -trbcmd w 0x1412 0xc803 0x00000000 -trbcmd w 0x1413 0xc802 0xffffffff -trbcmd w 0x1413 0xc803 0x00000000 - -trbcmd w 0x1510 0xc802 0xffffffff -trbcmd w 0x1510 0xc803 0x00000000 -trbcmd w 0x1511 0xc802 0xffffffff -trbcmd w 0x1511 0xc803 0x00000000 -trbcmd w 0x1512 0xc802 0x00000000 -trbcmd w 0x1512 0xc803 0x00000000 -trbcmd w 0x1513 0xc802 0x00000000 -trbcmd w 0x1513 0xc803 0x00000000 - -#for now: disable TDC for both SciFis - -trbcmd w 0x1610 0xc802 0x00000000 -trbcmd w 0x1610 0xc803 0x00000000 -trbcmd w 0x1611 0xc802 0x00000000 -trbcmd w 0x1611 0xc803 0x00000000 -trbcmd w 0x1612 0xc802 0x00000000 -trbcmd w 0x1612 0xc803 0x00000000 -trbcmd w 0x1613 0xc802 0x00000000 -trbcmd w 0x1613 0xc803 0x00000000 - -trbcmd w 0x2110 0xc802 0x00000000 -trbcmd w 0x2110 0xc803 0x00000000 -trbcmd w 0x2111 0xc802 0x00000000 -trbcmd w 0x2111 0xc803 0x00000000 -trbcmd w 0x2112 0xc802 0x00000000 -trbcmd w 0x2112 0xc803 0x00000000 -trbcmd w 0x2113 0xc802 0x00000000 -trbcmd w 0x2113 0xc803 0x00000000 - -# single pixels from MCP-TOF Sensor 1341 10um downstream -trbcmd w 0x1710 0xc802 0xffffffff -trbcmd w 0x1710 0xc803 0x00000000 -trbcmd w 0x1711 0xc802 0xffffffff -trbcmd w 0x1711 0xc803 0x00000000 -trbcmd w 0x1712 0xc802 0xffffffff -trbcmd w 0x1712 0xc803 0x00000000 -trbcmd w 0x1713 0xc802 0xffffffff -trbcmd w 0x1713 0xc803 0x00000000 - -# single pixels from MCP-TOF Sensor 1340 25um upstream -trbcmd w 0x1910 0xc802 0xffffffff -trbcmd w 0x1910 0xc803 0x00000000 -trbcmd w 0x1911 0xc802 0xffffffff -trbcmd w 0x1911 0xc803 0x00000000 -trbcmd w 0x1912 0xc802 0xffffffff -trbcmd w 0x1912 0xc803 0x00000000 -trbcmd w 0x1913 0xc802 0xffffffff -trbcmd w 0x1913 0xc803 0x00000000 - -# only 2 MCP-Out chan on first TDC 1810 chan1(1,2) and chan3(5,6) #2,6 = leading edge -trbcmd w 0x1810 0xc802 0x00000033 -trbcmd w 0x1810 0xc803 0x00000000 -trbcmd w 0x1811 0xc802 0x00000000 -trbcmd w 0x1811 0xc803 0x00000000 -trbcmd w 0x1812 0xc802 0x00000000 -trbcmd w 0x1812 0xc803 0x00000000 -trbcmd w 0x1813 0xc802 0x00000000 -trbcmd w 0x1813 0xc803 0x00000000 - -# only 1 MCP-Out chan on first TDC 2010 chan1 (1,2) 2=leading edge -trbcmd w 0x2010 0xc802 0x00000003 -trbcmd w 0x2010 0xc803 0x00000000 -trbcmd w 0x2011 0xc802 0x00000000 -trbcmd w 0x2011 0xc803 0x00000000 -trbcmd w 0x2012 0xc802 0x00000000 -trbcmd w 0x2012 0xc803 0x00000000 -trbcmd w 0x2013 0xc802 0x00000000 -trbcmd w 0x2013 0xc803 0x00000000 +~/trbsoft/daqtools/tools/loadregisterdb.pl register_config_tdc.db # disable all channels #trbcmd w 0xfe48 0xc802 0x00000000 #trbcmd w 0xfe48 0xc803 0x00000000 - # timeouts trbcmd w 0xfffe 0xc5 0x800050ff @@ -321,20 +84,23 @@ trbcmd w 0xfffe 0xc5 0x800050ff #trbcmd clearbit 0x8000 0xa101 0x3 # divert TDC inputs to the CTS for trigger -trbcmd setbit 0xfe48 0xcf00 0x1 +echo "- divert TDC inputs to the CTS for trigger"; +trbcmd setbit 0xfe48 0xcf00 0x1 + +echo "- setting trigger rate register in TDC"; # trigger rate 150Hz trbcmd w 0x7999 0xa150 0x100000 #trbcmd setbit 0x8000 0xa1d4 0x10000 ## ??? # set proto MCP 0-14 thresholds -echo "loading proto MCP-PMT 0-14 thresholds..." +echo "- loading proto MCP-PMT 0-14 thresholds..." cd ~/trbsoft/daqtools/thresholds/ ./load_thresh.sh #set MCPTOF thresholds -echo "loading proto MCP-TOF thresholds..." +echo "- loading proto MCP-TOF thresholds..." cd ~/trbsoft/daqtools/thresholds/ ./write_thresholds.pl MCPTOF_all_thresholds_zero.log -o 0 >> /dev/null ./write_thresholds.pl MCPTOF_all_thresholds_zero.log -o 1500 >> /dev/null # =75mV after amp -- 2.43.0