This page contains information on how to configure the system and to take data in the SysLab.

Start the RICH Upgrade ECS

The control of the setup is done via the MultiMiniDAQ2 project running on lbminidaq2-13. If the FSM is not already opened: open a terminal and type fsm (move to workspace 6 to do it), then right click on MiniDAQ and take the FSM clicking on the lock symbol.

How to acquire data with the laser

Turn the laser on (turn the driver key). Exclude the MEP partition, check that the Enable in the Step Run box is not ticked and click Apply. Click on TFC quick control in the TFC box, a panel will open where you have to make sure that the box Limited is not ticked and the box Calib A is ticked. Click Apply and close the TFC panel. Check that in the TFC box the Subdetector Type is RICH_TB2, if not select it from the menu on the right. Open the DAQ partition and send a RESET command to the TELL40 partition. Configure from the top of the Minidaq partition. Now you can send from the top a START_RUN followed by a START_TRIGGER. You will see the number of triggers increasing in the Triggers from TFC box. Check the laser driver box where you should be able to now see the red light corresponding to the emission ON. Always make sure that in the top of the RICH partition the state of RICH_HV is READY: if the Subdetector Type was not set correctly this could cause a trip of the HV and consequently the RICH_HV state to go into ERROR.
If the laser is not emitting (i.e. the display on the Kintex evaluation board used to control the laser is empty), use the following procedure:
- log in the Windows7 pclbtb05;
- browse to Documents/LaserPulser/programmerv2.20180116 and launch the exe Jar file;
- press the Scan button (it should find GBTx 1);
- press the Import button and select the golden file located in Documents/LaserPulser/;
- read (state goes to PauseForConfig), write, read (state goes to Idle);
- check that the display is showing oX-00h (X=0,1,2,3);
- open the GBT client->select GBT->!I2C (lbminidaq2-06,GBTid=4,SCA=0,BUS=0,Address=33,Type=GBTx,frequency=100k,SLC=Open Drain,Size=4,write 00000003)
-check that o3 register is 03 on the display, i.e. o3-03h and repeat the procedure at the beginning of this subsection.

How to acquire a full orbit

Select no more than six links in the TELL40 Links Configuration panel.
In TFC quick control enable NZS and NZS consec, limit at 4000, calibA.

In Sodin/Core0: Status&Enables tab: enable Force Trg. Cmd Config tab: Force Trg Length 4000, Trg Type 10.

How to acquire DAC scan

In DAQ box click FE. In Select action menu of FE box choose DAC scan, define channels configuration and click Apply. Then return to the main window and choose the correct step run configurations and the number of triggers on the bottom of the window. Click Apply and check if the number of triggers in the step run box equals the number of triggers in the TFC quick control menu. Then click START_RUN followed by START_TRIGGER in the MiniDAQ box. Watch the current step value in the step run block of the main window. If the value doesn't change for more than 20 seconds go to TFC and click PAUSE. After each run was finished go to MIniDAQ and click STOP_RUN.

How to start the DQ monitoring


standalone window: ./QtDqmp, select the RICH tab in the bar to the left and start the emulator.

Start online. Start Emulator between the available run types. Select Start in the menu to the left and select the file in the Emu Data File. Start emulator. When you have finished: Stop, Exit.

How to process data

The offline software to process data is located for each Minidaq2 in :


The data for each Minidaq2 are located in


In order to process a normal run you execute in this folder:

./ "fileinput.frg" "fileoutputname" "TAE" "OR"
where "OR" can take the value of 0,1 depending if you want to fill the tree for each bxid or if you want to do the OR over the TAE bxid.

There are also other 2 scripts:

./ "fileinput.frg" "fileoutputname" "TAE"
with the OR=1
./ "fileinput.frg" "fileoutputname" "TAE"
with the OR=0

If you want, not only to create the Tree but also to show the 2D hitmap and the number of hits distribution histograms you can run

./ "fileinput.frg" "fileoutputname" "TAE" "OR"
where "OR" can take the value of 0,1 depending if you want to fill the tree for each bxid or if you want to do the OR over the TAE bxid.

There are also other 2 scripts:

./ "fileinput.frg" "fileoutputname" "TAE"
with the OR=1
./ "fileinput.frg" "fileoutputname" "TAE"
with the OR=0

Each run name contains the date and time at which the run was acquired and the run run number; as common convention you should provide the run number as output name to allow easy traceability (for example run pcie40_20180614_105057_main_slot_05000_link_0_run_99.frg should be processed providing outputname=run99, therefore generating tree_run99.root as output file).

In case you are processing a DAC or threshold scan you have to first process the run with

 ./  "run" "outputname" "TAE" start_step stop_step 

where start_step is the start_value you set in the FE panel, and then execute

  ./makeScurveGraph_hitsID "tree_#.root" "histo_#.root" "scanType" 
where tree_#.root corresponds to the output of runOffline (run99 in the example above) and "scanType" is "dac" or "th". Again the run number convention should be followed: tree_run99.root generates histo_run99.root.

To generate the file with the working points, move to the $analysis folder (on lbminidaq2-13), and run the workingPointPedestal.C macro (arguments for the routine are the histogram root file, the HV, and the number of steps above the pedestal where you want to set the threshold).

How to configure the PDMDB

Configure the master link GBTx

The bootstrapping of the master link GBTX is done via an external I2C master. This function is served by the trigger board via cables connected from the Tengja board to the PDMDB. %The trigger board connections can be found in the JRichTBTrigger topic. Move to workspace 2 in lbminidaq2-13, open an ssh connection to lbrichtb (ssh -Y richtbuser@lbrichtb) and type tb-trigger. Extra->GBTX I2C. Read on both PDMDBs until the PauseForConfig state is reached,.Write->master3g.gbt on both. Read until the Idle state is reached on both PDMDBs.

BXID offset and Data Links alignment

To change the BXID offset: open the GBT client (Communication: Local, LBUS tab). Select the server corresponding to the TELL40 partition, Address: 840120. Type: 32 bits. Size: 1. Press Read. Copy paste the the Data Out in the Data In field. Change it accordingly (the + shift the readout window to left, the - shift the readout window to the right. Data stay where they are).
Look at hslotpixel histogram of a run with TAE enabled (you need to process it without OR, ./ is fine). Check that the majority of events are in the same bin on the y axis. If not, you need to identify the correct link (each bunch on the x axis corresponds to a data link) that is not aligned with the others.
On the GBT client, on the LBUS tab (size 1). For each address, each nibble corresponds to a link (increasing from right to left).
Address 840100: first six digits to the right are TFC links (from 0 to 5), the following 2 digits are data links 6,7.
Address 840104: data links from 8 to 15 (from right to the left).
Address 840108: data links from 16 to 23.

To move the bunches higher in the hslotpixel, you need to reduce the digit in the corresponding nibble.

Setup info in the database

The information on the PDM installed in the box can be found under PDM_2. To access them: select PDM as the default device type->HW view->Summary->select PDM_2 and press show selected. There are tags corresponding to different start validities. Clicking on the EC buttons you can access the info on the ECs (also in the EC data there are tags corresponding to different components installed in each EC).
To update the info on an EC or on the full PDM select the corresponding device type and click on update. In the new panel, showing the current configuration of the assembly, click update. In the following panel you can substitute and swap devices.

Setup the system from scratch (e.g. after a power cut)

Switch on lbminidaq2-13 (MiniDAQ2), lbrichpcie40-00 (pcie40 server and MiniDAQ3), pclbrich02 and pclbtb05.
Switch on the crates for power supply.
Login to pclbtb05 (you can use vinagre to connect remotely to it, account lhcbrich) and start the DCS and HV OPC servers.
Login to pclbrich02 and start the ECS and lbRichUpgradeIBCDB projects (the DAQ, HV and DCS should start by itself at the power on).
Login to lbminidaq2-13 and mount pclbrich02 (sudo mount /nfs/srv02). Then type pcie40_program nameOfTheFirmware.sof (at the time of writing nameOfTheFirmware=lhcb_daq_firmware-md2-26p6l). Then type pcie40_reload. Then type "*.
Login to lbrichpcie40-00 and mount pclbrich02. Type pcie40_program -c 1 nameOfTheSodinFirmware.sof. Type pcie40_program -c 2 nameOfTheTell40Firmware.sof. Type pcie40_program -c 3 nameOfTheTell40Firmware.sof. Then type pcie40_reload. Then type "source ~/*. Use reverse history to find the right commands.
Start the MultiMiniDAQ2 project on lbminidaq2-13.
Open the FSM and Configure from the top. Check that in SODIN->Core0->Cmd Config the Ext is unticked and that Orbit offset is set to zero. (In the "Orbit clock" at the bottom right of the panel).
If the HV and DCS FSMs are in state DEAD, click on the state and press Restart FSM.

Follow the procedure described at the end of How to acquire data with the laser section to configure the laser driver.

Switch between prod and dev versions of the projects

Run ~/bin/ "machine#"

where "machine#" is 06 or 13 depending on the DIM_DNS_NODE in use (i.e. the machine where the project is running).

Install the project from scratch

Create a new WinCC project.
Copy the fwInstallation folder into the project folder and install the jcop fw components: fwCore, fwConfigurationDB, fwDIM and fwTrending.
Install the fwMiniDAQ component.
Open the MiniDAQ fsm, click on Configure Subscriptions, Configure Multi, delete existing devices, create the RICH_TELL40 type and apply the default settings for each device. Open the HW tool and create the TELL40_RICH device type using the appropriate xml. Also create the RICHPDMDB device type using the appropriate xml.
Define the other devices in the MiniDAQ FSM view and click on subscribe all. The click on the Create FSM button.
Install the fwRich component.
Open the fwRich_Configurator.pnl panel to create the new PDMDBs clicking on the Generate button.
Select the new devices in the table, select the firmwares, and click on the Update Selected button.
Click on the Generate FSM button.
Create the recipe DEFAULT/CONFIGURE in the hardware view tab.
Check that everything is ok within the fsm, i.e. try to take a run.
Modify the config file of the project to include the lbRichHV, lbRichDCS and lbRichECS as distributed peers. (it is not needed if the config file is present in the fwRich.xml file)
Import the fwRichMiniDAQtop.dpl using the Ascii Manager and append the RICH_DCS and RICH_HV partitions to the MiniDAQ fsm.

Add HV and DCS partitions to the MiniDAQ FSM

FSM view, configuration, Create/Configure FSM objects, Import from sys: (lbRichHV or lbRichDCS) and import RICH_HV and RICH_DCS accordingly to the selected system.
Right click on MiniDAQ partition, select Add Object(s) from FSM View, System(s) (select the system), and the type you want to add (RICH_HV or RICH_DCS), tick as Control Unit, click OK.
Generate FSM.
Change the type of MiniDAQ from MiniDAQtop to MiniDAQtopRICH.

OPC-UA servers


You need to change _OPCUA_CAEN.Config.ConnInfo with the correct port that you can find by using sudo netstat -ltnp (there are two ports relative to the OPC server: one used to communicate with the crate, the other one in listening for the client). Useful documentation is here

When creating devices in WinCC, use the simulation driver. Then run the OPC server and start the client. A message about certificates should appear in the logviewer. Go on SysMgm->Driver OPC->OPC UA Certificates. An entry in the Not Accepted text box should be present. Move the certificate to the Accepted box by using the arrow.

Go on SysMgm->Driver OPC->OPC UA Client->Manage (under subscriptions field). In Monitored items, select:
Use TimeStamp from: Server
Data change filter: Status,Value


Download the systec_can driver (systec_can-0.9.0p-12.cc76.x86_64.rpm) and reboot.
modprobe systec_can (in case of errors use insmod)
If dmesg complains about boot loader install systec_can-0.9.8p-3.cc76.x86_64.rpm
Install socketcan_utils-2920d417315f14397f683e5e368520421c8a9702.0.0-0.x86_64.rpm
Install OpcUaCanOpenServer-2.2.3-46cc7.x86_64.rpm
Install uaexpert-bin-centos7-x86_64-gcc4.8.2-v1.4.2-256.rpm (an opc-ua client)

The xml config file will be created when pressing create OPC config on the ELMB node in the WinCC project. Place the config file in the run directory for the ELMB OPC server.


Add PDMDB ADC monitoring to the DCS project

On the machine running the DIM_DNS_server type

cat etc/sysconfig/dnsd
and add the line

Install the fwGbt and fwHw component. Add -dim_dns_node to the options for dim manager involving Gbt.
From the Hw tool panel, ADVANCED tab, click on XML file button and select the HWDescription_PDMDB(R,H)_ADC.xml file containing the ADC line registers. Click import. Click on Edit to check the script is reasonable. Click on Execute. Select the type and create devices in Hardware tab. Click subscribe and press OK to activate the DIM manager. Add the -dim_dns_node option to the corresponding manager.


sudo vi /etc/fstab

Optical fibres for CommLab

These sketches show the proposed fibre connections for the full-column commissioning set-up. To zoom in with your browser it is best to right-click and select View image before using your browser zoom capability because the TWiki resizing is not very helpful.



The sketches are for RICH2. For RICH1, replace each PDM-H with a PDM-R. Two columns breakouts are sufficient for RICH1 or RICH2 TFC/ECS. RICH1 requires 6 column breakouts for data and RICH2 requires 4. Therefore the fixed CommLab fibre installation should allow 6 MPO12 paths to the TEL40.

Edit | Attach | Watch | Print version | History: r41 < r40 < r39 < r38 < r37 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r41 - 2019-06-05 - GiovanniCavallero
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback