October Test Beam DAQ Framework sketch Main Labview
October Test Beam DAQ
Framework sketch Main Labview Panel Must start and stop them (kill if necessary) Can read output from each of them Gassiplex DAQ Event Builder Cluster Recon. Online viewers for clusters VFAT DAQ Track Recon. Online viewers for tracks • Only DAQs subprograms works during spills • Each subprogram produces an output each spill • Each dependant subprogram uses the spill output of the subprogram from whom it depends 28/09/2009 M. Alfonsi (CERN) 2
OR DAQ “busy” signal (due to init, data reading, etc. . ) VETO Sn OR Trigger Logic S 1 coincence Scaler 1 coincence RESET VETO logic DAQ “done” signal (init, data reading, etc. . completed) Timer T=∞ Trigger logic with NIM Pulser for pedestal generation (can be a later addition) 28/09/2009 M. Alfonsi (CERN) Scaler 2 Vetoed trigger to be distributed to each DAQ 3
Gassiplex DAQ – hardware • VME based: use CAEN CRAMS and Sequencer • “Special DAQ”: it acquires also scintillators timings and charge and other control signals, e. g. trigger counts on scaler: – By adding further VME modules – Can be later additions • VETO implementation: – BUSY output of Sequencer and/or – DAQ-controlled output register of CAEN VME Bridge 28/09/2009 M. Alfonsi (CERN) 4
Gassiplex DAQ – sofware • Rewrite code from Labview to compiled c++ (not hard to do, and *should* be faster) • Try to implement Interrupt on data ready instead of polling (in principle not so hard to do, *should* largely improve DAQ rate) • Possibility to call executable from Labview verified. Moreover on Linux environments: – The output can be returned to Labview – The process PID is returned (possibility to send signals to – or kill – the executable verified. Executable can cleanly stop on TERM signal) • Every spill a binary file is produced • Use VME Bridge Pulser for triggers for pedestals, just after the spill – can be a later addition • If necessary, use off-spill to reset all the boards and counters 28/09/2009 M. Alfonsi (CERN) 5
Gassiplex DAQ – more details • Working directories and produced files: – The executable will use a specific dir each run, prepared by Main Program – Each spill will produce a separate file with the spill number in the name – A file “LASTACQUIREDSPILL” will contain the number of the last acquired spill • Initialization: – Main Program should pass parameters as a “recipe file” (later addition, at the beginning parameters hard-coded in the program) • Running: – The exec is aware of spill periods: it takes data as fast as possible – After each spill pedestals are generated – later addition • Termination: – Stop after the spill that has accumulated enough data – Capture INT or QUIT signals (meaning “Stop after this spill” or “Stop now”) sent by Main Program (that can KILL it!) – later addition – The Main Program is aware of termination via the executable output • Possibility to suspend / continue a run. . next year upgrade. . 28/09/2009 M. Alfonsi (CERN) 6
Event Builder • ROOT macro: raw data from binary to ROOT Tree (adapt the ROOT Tree maker macro realized for June TB analysis) • The macro will: – check every 1 -2 s for a “last acquired spill” newer than the last processed – check for ALL DAQs files, checking also commands from Main Program – read binary files and fill the raw data ROOT Tree – later addition: possibility to split large ROOT files – prepare also a “last spill” ROOT Tree (same structure) for online monitors – Write in the “LASTBUILTSPILL” file the number of the last processed spill • The Main Program issues commands like “Stop after this spill” or “Quit now” or “Skip one spill” by writing the command on the file “EVENTBUILDERSTATUS” 28/09/2009 M. Alfonsi (CERN) 7
Reconstruction / viewer algorithms • ROOT “TSelector” algorithms: – Adapt the code developed for June TB analysis – “Reconstructers” produce ROOT trees/histos, saving them in a file, “Viewers” just update plots • Each algorithm will: – check every 1 -2 s for newer spills in the relative “LASTxxxx. FILE” – check for the required files, checking also commands from Main Program – if not just a viewer, fill reconstructed ROOT Tree and/or histos and, like event builder, prepare also a “last spill” version – if not just a viewer, write in the “LASTyyyy. SPILL” file the number of the last processed spill • The Main Program issues commands like “Stop after this spill” or “Quit now” or “Skip one spill” by writing the command on the file “ALGORITHMNAMESTATUS” 28/09/2009 M. Alfonsi (CERN) 8
Main program • Uses Labview for easy user-interface and graphics • Must launch (and kill in case) all subprograms • Must pass parameters to each subprograms as “recipe” files • Sends commands to subprograms by writing them in specific file that subprogram reads • Reads the output of subprograms, that can be used to warn the user about errors or any problem: – E. g. if the event builder is too many spills late w. r. t. the last acquired spill, a warning is issued to the user 28/09/2009 M. Alfonsi (CERN) 9
VFAT integration – main problems 1) Custom board, no VME integration 2) Can the board provide a BUSY signal for VETO? 3) Main Program runs on Linux Labview in the control room, but: – – 28/09/2009 Readout on USB port, so a PC in the experimental hall is required Windows Labview DAQ M. Alfonsi (CERN) 10
VFAT integration – some ideas “Remote Panel” Labview feature: Main Program can connect to the remote DAQ VI (not yet tested) - OR • “Network shared variable” Labview feature: Main Program has access at least to “Start” and “Stop” of the VFAT DAQ VI (already tested in lab) and a remote desktop connection allows to have full access of the other parameters • Add an USB-version of the VME Bridge to the crate: • – – • use one the output register for the VETO logic, and one of the input register to understand spill phase. “scp” the data to linux PC in control room after every spill, the event builder must wait for this file 28/09/2009 M. Alfonsi (CERN) 11
Task summary 1. Setup in lab: mechanics to be patched – missing rack – trigger logic in NIM 2. Gassiplex DAQ: a) b) c) d) Base executable (Interrupt feature if easy, hard-coded parameters) Parameters passed by Main Program Pedestal generation after spill Addition of a VME scaler, ADC (for scintillators), TDC (next year) 3. Event builder: a) b) Adaptation from the June TB macro VFAT data integration 4. VFAT DAQ (don’t know status): a) Integrate the trigger and VETO logic 5. Monitors Online: a) 28/09/2009 Adaptation from June TB algorithms M. Alfonsi (CERN) 12
- Slides: 12