.. DecodeAndSort.rst --- .. .. Description: .. Author: Hongyi Wu(吴鸿毅) .. Email: wuhongyi@qq.com .. Created: 日 9月 8 23:12:47 2024 (+0800) .. Last-Updated: 三 10月 2 16:16:10 2024 (+0800) .. By: Hongyi Wu(吴鸿毅) .. Update #: 2 .. URL: http://wuhongyi.cn ################################################## Decoder ################################################## **The DecodeAndSortAll program is used to convert data recored by different modules one run into a ROOT file. The user's physical analysis is based on the ROOT file generated by this program. The data generated by this program has been arranged in ascending order of timestamp.** The user first needs to modify the definition in the **UesrDefine.hh** file .. code:: cpp // #define ONLYPHA // #define ONLYPSD // #define ONLYZLE // #define ONLYSCOPE If all modules in the DAQ only use one type of firmware, enable the corresponding definition. If there is no definition of a single firmware, the output data file will default to supporting all types of firmware. .. code:: cpp #define ROOTFILEPATH "./" //the path of ROOT file #define ROOTFILENAME "data" //the name of ROOT file // The path and file name for ROOT files .. code:: cpp #define RAWFILEPATH "/home/wuhongyi/" //Path of raw data #define RAWFILENAME "data" //The file name of the raw data #define MODNUMBER 2 //Number of modules used in the chassis const unsigned short SamplingRate[MODNUMBER] = {500, 125};//Specify the sampling rate of each modules separately; 125/500/1000 sampling rates; 0 to skip the module const unsigned short Firmware[MODNUMBER] = {2, 0};//DPP_PHA=0 DPP_ZLE=1 DPP_PSD=2 DPP_DAW=3 OPEN=4 Scope=5 // Specify the firmware type for each module. If the type is specified incorrectly, there will be issues decoding the data After modification, execute the following command to compile the program: .. code:: bash make clean make After successful compilation, an executable file **decodeandsort** will be generated, and the program will run as follows: .. code:: bash ./decodeandsort [RunNnumber] Among them, *[RunNnumber]* is the running number of the file you want to convert. .. .. DecodeAndSort.rst ends here