1. If you are a new user, please register to get an Indico account through https://login.ihep.ac.cn/registIndico.jsp. Any questions, please email us at helpdesk@ihep.ac.cn or call 88236855.
2. The name of any uploaded file should be in English or plus numbers, not containing any Chinese or special characters.
3. If you need to create a conference in the "Conferences, Workshops and Events" zone, please email us at helpdesk@ihep.ac.cn.
21-26 May 2017
Beijing International Convention Center
Asia/Shanghai timezone
Home > Timetable > Session details > Contribution details

Contribution oral

Beijing International Convention Center - Room 305E
Trigger and data acquisition systems

Data transmission system for 2D-SND at CSNS


  • Ms. Dongxu ZHAO

Primary authors



China Spallation Neutron Source (CSNS) is the first high-performance pulsed neutron source in China, which will meet the increasing fundamental research and technique applications demands domestically and overseas. Scintillator neutron detector (2D-SND) is the detector on the General Purpose Powder diffractometer (GPPD) of CSNS. It consists of 36 banks. Every bank has 192 channels. 2D-SND is planned to go into service in 2018. At present, 2D-SND have been made and relative systems including electronics system, data acquisition (DAQ) system, data transmission system and data analysis system have been constructed essentially. Electronics system is used to get signals from the detector, amplify these signals, convert them to digital data, construct data to events and finally send events to DAQ system. Electronics system consists of 36 modules corresponding 36 banks of detector and every module consists of 192 electronic channels corresponding 192 channels on relative bank of detector. Every electronic channel gets signals, disposes signals and sends events independently. Electronics system is based on SiTCP to send events. DAQ system is used to read events from electronics system, save events in local files and Network File System (NFS). The user interface of DAQ system is based on QT and the bottom program of it is adopted multithreading technology to read events from each electronic module and save them to each file. Data analysis system is used to receive events from data transmission system, reconstruct events in the form of Nexus, analyze reconstructed events and display results in the form of charts. The functions of analysis and display in data analysis system are realized by Python. The functions of receive events, reconstruction in it are realized by C++ Dynamic Link Library (DLL) which is called by the program of Python. Multithreading technology is adopted in the program of C++ DLL. There are three threads in it. One is used to receive events. The second is used to reconstruct. The third is used to send reconstructed events to back end program of analysis and display. The data transmission system is used to get events from DAQ system, pick good events and send these good events to data analysis system. The whole system is written in C which as a process oriented language offers an easy way to dispose data with flexibility and high efficiency. The program of data transmission system is designed to multithreading in C. It means that events of each electronic module are disposed independently in respective thread. The disposal includes reading file to get its events, picking these events and sending good events being picked. Multithreading technology makes system of multi-tasking and parallel processing work more efficiently. For the convenience of event reconstruction in data analysis system, a pubic buffer is used in data transmission system to collect good events from each electronic module and it is called in every disposal thread for the purpose of sending events of every electronic module together to data analysis system. A public buffer offers an environment of resource sharing and integration in a simple way. The mutex lock implements the mutually exclusive access to shared resource. The application of the mutex lock accompanying with the use of public buffer ensures that every event stored in public buffer is complete and correct. The interface between DAQ system and data transmission system in it is adopted NFS which provides an environment with capability of mutual interference. It means that DAQ system saves events sent to data transmission system in NFS and data transmission system reads events from NFS. Distributed Information Management System (DIM) developed by European Organization for Nuclear Research (CERN) is adopted to be the interface between data transmission system and data analysis system. It provides a method to realize loose coupling, meanwhile it is very efficient in data transmission. More concretely, the mechanism of DIM is based on C/S pattern. DIM server is in charge of sending data which is put in the data transmission system. DIM client is in charge of receiving data which is put in the data analysis system. DIM server can keep sending data no matter DIM client is active or dead to realize loose coupling. The data transmission system together with 2D-SND and other relative systems has been applied in neutron beam experiment successfully. With the common framework, it can easily be expanded and improved to fit for applications of other detectors at CSNS or other place. In late development, the interface between DAQ system and data transmission system should be improved to fulfil real-time on data transmission.