Guide for protoDUNE online monitoring developers¶
JCF: Instructions last updated Feb-16-2018
To install, first log into a system which has /cvmfs products areas mounted (this is the case at the CERN teststand, np04-srv-010), create and cd into a new directory, and then execute the following command below. Note that if you are on the CERN teststand, you'll want to first run "source ~np04daq/bin/web_proxy.sh" to provide the wget command access to the outside world.
wget https://cdcvs.fnal.gov/redmine/projects/dunetpc/repository/revisions/48b83609687feeec41057cd5bb22a284a441bf77/raw/dune/Protodune/OnlineMonitor/tools/quick-mrb-start.sh chmod 755 quick-mrb-start.sh ./quick-mrb-start.sh
The installation will take somewhere from a few minutes to half an hour and use about 3 GB of space. When it's complete, you should see something like the following:
------------------------------------ INFO: Stage build successful. ------------------------------------ All packages have been installed correctly. Build start time: Thu Aug 10 16:36:44 CEST 2017 Build end time: Thu Aug 10 16:42:06 CEST 2017
In more detail: the quick-mrb-start.sh script will install and build dunetpc on its feature/online_monitoring_artdaq branch. Unlike other branches, dunetpc on this particular branch depends not just on lbne-raw-data, but dune-raw-data as well. The git repositories for both dunetpc and dune-raw-data will be checked out and therefore available for development. Futhermore, artdaq v2_03_02 will be installed; this will provide access to artdaq's TransferInput source, which can be used to read in events being sent from the dispatcher of a running dune-artdaq system. Note that dunetpc's feature/online_monitoring_artdaq branch has merged in the feature/vradescu_OnlineMonitor branch.
Setting up the environment¶
Once you've successfully installed, you can develop dune-raw-data code in srcs/dune_raw_data and dunetpc code in srcs/dunetpc. Note that after making edits, to build, you'll first want to set up the environment:
and then build:
and when you want to build again, you won't need to source setupONLINEMONITORING again as long as you've already sourced it in the working environment.
Running on a *.root file with the ToyDump module¶
On the feature/online_monitoring_artdaq branch, the ToyDump module is available for use. Located in srcs/dunetpc/dune/Protodune/OnlineMonitor/ToyDump_module.cc, it's designed for simple analysis, just printing out ADC counts produced by dune-artdaq's ToySimulator fragment generator. You can run it on a *.root file produced by dune-artdaq when the ToySimulators were used; e.g., such is the case for /nfs/sw/data/np04_raw_run1000023_1_dl1.root, so assuming you've already source-d setupONLINEMONITORING as described above, and assuming you're in the base installation directory, you could do:
art -c srcs/dunetpc/dune/Protodune/OnlineMonitor/tools/fcl/SimpleOfflineMonitor.fcl -s /daq/artdaq/data/pdune_r1000240_sr01_20170807T111744_1_0.root -n 2
Running on live data from the running DAQ with the ToyDump module¶
If you're on the CERN teststand, you can run the DAQ if you follow the instructions at https://twiki.cern.ch/twiki/bin/view/CENF/ArtdaqBasicOp; you could use the configuraton "np04_teststand_tests00007" and just use "component01" for the setdaqcomps.sh command, which will run a ToySimulator. When the system is in the running state, launch another terminal, log into the teststand, and do the following:
cd <location where you performed your installation> source setupONLINEMONITORING art -c srcs/dunetpc/dune/Protodune/OnlineMonitor/tools/fcl/SimpleOnlineMonitor.fcl
...and this will run the ToyDump module on the incoming data, but rather than use the RootInput art source to read in a root file, it will use artdaq's TransferInput art source to set up a shared memory connection with the Dispatcher process in the running DAQ to receive events.
Running on live data from a standalone dispatcher with the ToyDump module¶
You want to open three terminals. In each terminal, do the following:
cd <location where you performed your dunetpc installation with quick-mrb-start.sh> source setupONLINEMONITORING
then, in one terminal, set up the standalone dispatcher process:
aggregator -r 1 -p 5766 -c srcs/dunetpc/dune/Protodune/OnlineMonitor/tools/fcl/Dispatcher.fcl -n arbitrarylabel
and in another terminal, launch the standalone art process which will run the ToyDump module:
art -c srcs/dunetpc/dune/Protodune/OnlineMonitor/tools/fcl/SimpleOnlineMonitor.fcl
And in a third terminal, launch the standalone art process which will read in events from a root file and send them to the standalone dispatcher process:
art -c srcs/dunetpc/dune/Protodune/OnlineMonitor/tools/fcl/FileReader.fcl -s <name of rootfile>
As far as "<name of rootfile>" goes, the above commands will only work if you supply a *.root file which contains data produced by ToySimulators. Such is the case, e.g., with the file produced in run 1000023, "/nfs/sw/data/np04_raw_run1000023_1_dl1.root", on the CERN teststand.
At this point, in the terminal where you're running the ToyDump module, you should see normal ToyDump output, e.g.:
%MSG-i ToyDump: ToyDump:toyDump@ 11-Sep-2017 23:42:06 CEST run: 1000023 subRun: 1 event: 153 First 10 ADC values in the fragment: %MSG %MSG-i ToyDump: ToyDump:toyDump@ 11-Sep-2017 23:42:06 CEST run: 1000023 subRun: 1 event: 153 2561 2457 1433 2104 2908 2644 2156 2016 2229 1838