Files used in the lab b115 for reading the small tpc. ----------------------------------------------------- NOTE: gain argument: 0 = 12 mV/fC 1 = 20 mV/fC 2 = 16 mV/fC 3 = 25 mV/fC shaper argument: 0 = 120 ns 1 = 90 ns 3 = 60 ns 7 = 30 ns other values should not be used. channels argument: 16 bit pattern - one bit per channel bit = 0, readout of channel bit = 1, no readout of channel instructions-ssh.txt rudimentary instructions for current setup for the monent: see the scripts for more details. lvcard2.c program to communicate with lvcard2 (LowVoltageCard version 2) runs on a separate slow control laptop plotevent.cpp simple event display - not in real time! smalltpc-init-lvcard2-ssh.sh script to initialize system - done once using lvcard2 and ssh to slow control laptop smalltpc-close-lvcard2-ssh.sh script to close down system - done once using lvcard2 and ssh to slow control laptop smalltpc-test-lvcard2-ssh.sh script to perform a run with external trigger using lvcard2 and ssh to slow control laptop srureadout.c readout program sruunpack.c unpack program PacketFormat.xlsx raw data format from SRU SRU configuration file(s) ------------------------- srupup-0-hw.cfg hardware trigger srupup-0-sw.cfg software trigger zero suppression ---------------- Setup of and run for pedestal calculation with software trigger and loading pedestals/thresholds into SALTROs. Prepare SRU for triggers: smalltpc-zsup-lvcard2-ssh.sh it calls: smalltpc-test-sw-lvcard2-ssh.sh (running the pedestal run). plotsmalltpcped.exe (source code: plotsmalltpcped.cpp) which creates the file: /-.csv ldsmalltpcped (source code: ldsmalltpcped.c) this loads pedestals from the csvfile above. It normally set a fixed threshold (--threshold <value>) but one can use the --rmsfactor <float> to load a a threshold = (int) rms*rmsfactor To show the pedestals: ./showsmalltpcped.exe <fullpath> it reads the csvfile and makes the pdffile: <fullpath>.pdf Take a run (hardware trigger) with zero suppression as set up with the script above: smalltpc-run-lvcard2-ssh.sh SRU event acknowledge --------------------- One can setup the SRU to be busy from the trigger until the DAQ sends software acknowledge when ready for new data. This will prevent a new trigger before the current trigger has been handled by the DAQ computer. If not setup the SRU will release the busy after having sent the data to DAQ system. The busy is output as a NIM signal on PX7 on the back of the SRU. For use of PXn see: SRUIO.odt (needs to be checked!!) The code for this is: srureadout-busy.c needs to be enabled in the SRU confgfile: SRU.SRUCFG.EVENT_ACK_EN 1 # Enable the event acknowledge mechanism (acknowledge with writes to register 46) SRU event timestamp ------------------- by setting bit 0 in SRU_REG_TRIG_CNT_CLR: Clear timestamp. Will start counting on next trigger event. Done in srureadout before a run. busy handling ------------------ srureadout-busy is not implemented in the scrips above, only in a test script: smalltpc-test-busy-hw-lvcard2-ssh.sh Reading the extra MCM for trigger/event number ---------------------------------------------- Init of smalltpc MCMs. software trigger: smalltpc-init-sw-lvcard2-ssh-mcmx.sh hardware trigger: smalltpc-init-hw-lvcard2-ssh-mcmx.sh The only difference between the init scripts above is the call of the sruconfigfile: srupup-0-sw-mcmx.cfg software trigger srupup-0-hw-mcmx.cfg hardware trigger The init scripts calls: biasctrltpc-mcmx.sh This script is used to switch on/off SALTROs on the three MCMs. ./biasctrltpc-mcmx.sh 0 1 all on ./biasctrltpc-mcmx.sh 1 0 all off this scrips resets gain/shaper to 0 (=120ns) See the script for details. Setup of extra MCM: smalltpc-setup-mcmx.sh <mcm> <gain> <shaper> <samples> <chip> <channels> no pedestal subtraction and zerosuppression Three inputs on mcm2 chip 3, channel 0 (ch 304),? and 15 (ch 319) is used. ./smalltpc-setup-mcmx.sh 2 0 0 1008 3 7FFE Running: software trigger: smalltpc-test-sw-lvcard2-ssh-mcmx.sh "mcms" <gain> <shaper> <samples> <channels> <events> <runnb> hardware trigger: smalltpc-test-hw-lvcard2-ssh-mcmx.sh "mcms" <gain> <shaper> <samples> <channels> <events> <runnb> example: smalltpc-test-hw-lvcard2-ssh-mcmx.sh "0 1" 0 0 1008 0 500 1 running with zerosuppression: prepare pedestals as above with smalltpc-zsup-lvcard2-ssh.sh Take a run (hardware trigger) with zero suppression as set up with the script above: smalltpc-run-lvcard2-ssh-mcmx.sh Close: ./smalltpc-close-lvcard2-ssh-mcmx.sh Analysis -------- plot events: ./plotevents-mcmx.sh Change in script the rootfile locaction. Temprorary pdffiles: plotevent.pdf dimensional plot plotped.pdf ${rootfile}-evt${events}-${title}.pdf max pulse heights timesweeps.pdf timesweeps for all channels (average if all events) pedestal for each channel and event in csv format: ${datadir}/${filename}-pedfile.csv source code in: plotevent-mcmx.cpp LVCARD ------ lvcard2.c program to communicate with the processor on lvcard. used arguments: --csvfile <filename> --debug <value> 0=no debug output --device <devicename> default /dev/lvcard2_1 --power <action> --readadc <action> read processor adcs (voltages/currents) --decay <decimal> set Decay value --refn <decimal> set RefN value --refcm <decimal> set CM value --refp <decimall> set RefP value --mcmaddress <value=0-99> 0=broadcast --mcmini default (in processor) DAC settings --mcmtemp <action> read MCM temperature sensor --lvtemp <action> read LVCARD temp --version read LVCARD program version The progran is on the control laptop in the directory: smalltpc/lvcard2/ In the setup scripts is the lvcard2 program called using ssh. on the DAQ laptop is a program that polls the reading adcs and temperature smalltpc-poll-ssh.sh it polls each 30 sec. it writes csvfiles on the control laptop in the directory: smalltpc/lvcard2/csv mcmtemp-poll.csv lvtemp-poll.csv readadc-poll.csv plottime.cpp this is a program to display the polled data. One should copy (e.g. with sftp) to a place where you can run plottime ./plottime.exe <dir> pedfile mcmtemp-poll.csv readadc-poll.csv lvtemp-poll.csv <date in format YYYYMMDD> Reaplce pedfile with NULL (pedfile is not needed here). Output is in <dir>/mcmtemp-poll.csv.pdf <dir>/readadc-poll.csv.pdf <dir>/lvtemp-poll.csv.pdf **NOTE: **DO NOT FORGET TO KEEP AN EYE ON THE TEMPERATURE AND CURRENTS **with this polling and also on the power supplies ** **The power is automatically switched off if temperature exceeds 50 degrees **This is a parameter #define _mcm_maxtemp 50.0 ** in the code in lvcard2.c Old system ---------- with version 1 av lvcard. instructions.txt rudimentary instructions for the old setup smalltpc-init.sh initialize system - done once smalltpc-run.sh perform a run with external trigger Zero supression setup - Krakow ------------------------------ 1. init script smalltpc-init-hw-lvcard2-ssh-mcmx.sh 2. setup script of mcm0 and mcm1 (without run) smalltpc-test-hw-lvcard2-ssh-mcmx_norun.sh 3. setup script of mcmx smalltpc-setup-mcmx.sh 4. zsup pedestal taking and download to SALTRO smalltpc-zsup-lvcard2-ssh-mcmx.sh ( 20251120 modified JUM&MH ./srupup --sruif $SRUIF --cfgfile srupup-0-sw.cfg to ./srupup --sruif $SRUIF --cfgfile srupup-0-sw-mcmx.cfg else currents om MCM2 get lower) ) (FIXED also MCM2 is read here - why (we specify 0,1 in DTCMASK, and CLK is disabled 0,1 but ro channels is set in CPLD)) 5. run script to setup for zerosuppression (without run) smalltpc-run-lvcard2-ssh-norun.sh 6. Take your runs. repeat 4-6 whenever needed for new pedestals. 5a. need to run smalltpc-setup-mcmx.sh again else hang the SRU on MCM2. Why needed? (perhaps the other scripts modify something) se problems below. Clock sync? 7. when finished or when resetting from scratch ./smalltpc-close-lvcard2-ssh-mcmx.sh The labsetup ============ Init for hw running ./smalltpc-init-hw-lvcard2-ssh-mcmx.sh Setup extra mcm ./smalltpc-setup-mcmx.sh 2 0 0 1008 0 7FFE For software run, take pedestals ./smalltpc-zsup-sw-lvcard2-ssh-mcmx.sh "0 1" 0 0 1008 0 5 300 1 For hardware run, take pedestals ./smalltpc-zsup-lvcard2-ssh-mcmx.sh "0 1" 0 0 1008 0 5 300 1 Software running: ./smalltpc-run-sw-lvcard2-ssh-mcmx.sh "0 1" 0 0 1008 0 5 300 1 Hardware running: ./smalltpc-run-lvcard2-ssh-mcmx.sh "0 1" 0 0 1008 0 5 300 1 NOTE: It happens that mcm2 gets out of sync, need to do either: ./srupup --sruif $SRUIF --cfgfile srupup-0-sw-mcmx.cfg ./srupup --sruif $SRUIF --cfgfile srupup-0-hw-mcmx.cfg Exclude channels (currently 188 and 189): ./excludechannels.sh needs to be done in smalltpc-run after loading mcm with default settings Close down ./smalltpc-close-lvcard2-ssh-mcmx.sh POWER ===== On the DAQ laptop: ------------------ biasctrltpc-mcmx.sh This script is used to switch on/off SALTROs on the three MCMs. ./biasctrltpc-mcmx.sh 0 1 all on ./biasctrltpc-mcmx.sh 1 0 all off This does not change any settings, only puts preamplifier in shutdown and ADCs in shutdown. The system can be without cooling in this mode. Currents for each MCM is then ca 300 mA. To switch off power use: ./smalltpc-close-lvcard2-ssh-mcmx.sh via the control laptop: ----------------------- The progran is on the control laptop in the directory: smalltpc/lvcard2/ ./lvcard2 --poweroff 10 --mcmaddress 0 -f csv/power.csv Note --mcmaddres 0 means all LVCARDs in chain. This will cut the power and currents/voltages should drop to 0. All settings in MCM are lost. manually: --------- switch off via power supplies. automatic: --------- High temperature: If the polling scripts is running is the power automatically switched off if temperature exceeds 50 degrees This is a parameter #define _mcm_maxtemp 50.0 in the code in lvcard2.c The connection to the lvcards must be working for this to happen. High currents: only via current limits set on power supplies. Some useful programs to check connections ------------------------------------------ on DAQ laptop: dump of SRU registers ilc/ilcdaq/chiptests/srudumpregs dump CPLD registers on MCM ilc/ilcdaq/chiptests/mcmdumpregs --fec <dclnb> dump of SALTRO registers ilc/ilcdaq/chiptests/saltrodumpregs --fec <dclnb> --chip <chipnb> on control laptop: print versions and status of all lvcard2 lvcard2 --version --mcmaddress 0 DrasiDAQ ======== Init for hw running ./smalltpc-init-hw-lvcard2-ssh-mcmx.sh Setup of mcms for DrasiDAQ: smalltpc-test-hw-lvcard2-ssh-mcmx_norun.sh "<fecs>" <gain> <shaper> <samples> <channels> <events> <runnb> example: ./smalltpc-test-hw-lvcard2-ssh-mcmx_norun.sh "0 1" 0 0 1008 0 300 1 For hardware run, take and load pedestals, load theshold smalltpc-zsup-lvcard2-ssh-mcmx.sh "<fecs>" <gain> <shaper> <samples> <channels> <threshold> <events> <runnb> ./smalltpc-zsup-lvcard2-ssh-mcmx.sh "0 1" 0 0 1008 0 5 300 1 To look at pedestals,rms: ./showsmalltpcped.exe <fullpath> data is in ~/wdir/ilcdaq/data/smalltpc/ as csvfile: chamber-fec01-debug-clk0-ped0-thr0-<gain>-<shaper>-p1-<samples>-<runnb>-pedrun.csv it creates from the the pdffile: chamber-fec01-debug-clk0-ped0-thr0-<gain>-<shaper>-p1-<samples>-<runnb>-pedrun.pdf Setup extra mcm smalltpc-setup-mcmx.sh <fec> <gain> <shaper> <samples> <mcmchip> <channels> example: ./smalltpc-setup-mcmx.sh 2 0 0 1008 0 7FFE Setup of mcms for zerosuppression for DrasiDAQ: smalltpc-run-lvcard2-ssh-norun.sh "<fecs>" <gain> <shaper> <samples> <channels> <threshold> <events> <runnb> example: ./smalltpc-run-lvcard2-ssh-norun.sh "0 1" 0 0 1008 0 5 300 1 Exclude channels (currently 188 and 189 is in the script) if wanted: edit the file: excludechannels.sh ./excludechannels.sh needs to be done after loading mcm with default settings Start DrasiDAQrun Close down ./smalltpc-close-lvcard2-ssh-mcmx.sh NOTE: gain argument: 0 = 12 mV/fC 1 = 20 mV/fC 2 = 16 mV/fC 3 = 25 mV/fC shaper argument: 0 = 120 ns 1 = 90 ns 3 = 60 ns 7 = 30 ns other values should not be used. Some problems ------------- The extra MCM2 seems sometimes to loose contact with the SRU. Probably timing of clock(?). To see if there is connection with a mcm: ./mcmdumpregs --fec <fec> this will dump registers in the MCM CPLD if it prints ISTAT = -3 then the connection is gone. Normally it works sending commands, it is the reply line that have the clock out of sync between SRU and CPLD. One need to: reset SRU by pressing reset button. then ./srupup --sruif $SRUIF --cfgfile srupup-0-hw-mcmx.cfg If the saltros are swicthed off do: restart from smalltpc-test... above. Internittently seems there to be a channel with strange length = 3 and data: examples: SALTRO header 400300BC data word: hex ADC3 ADC2 ADC1 0: 2803A03C 00000280 000000E8 0000003C ( 640 232 60) Evt: 150 Ch: 188 Cluster: 1 time 232 (000000E8) length 638 (0000027E) SALTRO header 40030044 word: hex ADC3 ADC2 ADC1 0: 2803A044 00000280 000000E8 00000044 ( 640 232 68) Evt: 208 Ch: 68 Cluster: 1 time 232 (000000E8) length 638 (0000027E) Zero suppression was set 3+2+7+2=14 10 bit words, so 3 i strange. Roughly 2 percent of the events had this. As far as I have seen is it independent of mcm,chip,channel. They all have 3 has 10 bit words, and 640,232 as ADC3 and ADC2 values. The test was done with software trigger, i.e. only noise give data. These have not been seen before.