ddiez
June 23, 2021, 9:31am
1
REST version : v2.3.5
REST commit : aff8ddff
Hello,
I’ve been trying the process written by @nkx TRestRealTimeDrawingProcess to plot some observables while the processing chain is working. He explained his work here . What I expected was that a canvas appear and every 1000 processed events it update the histogram. But what I got was only the final histogram with all events, not the intermediate ones.
I’m running the process with the following rml over a file with 28000 events:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<TRestManager name="CoBoDataAnalysis" title="Example" verboseLevel="info" >
<globals>
<searchPath value="$ENV{REST_INPUTDATA}/definitions/"/>
<parameter name="mainDataPath" value="/media/storage/home/davidp/CanfrancDataAnalysis/ProcesadoAQS/ArchivosGeneradosV2.3/" />
</globals>
<TRestRun name="SJTU_Proto" >
<parameter name="runNumber" value="auto"/> <!--change this value to "auto" to enable database-->
<parameter name="inputFileName" value="auto" />
</TRestRun>
<TRestProcessRunner name="Processor" verboseLevel="info">
<addProcess type="TRestRealTimeDrawingProcess" name="rD" value="ON" drawInterval="1000" >
<TRestAnalysisPlot name="TriggerRatePlot" previewPlot="true">
<canvas size="(1000,800)" save="TriggerRate.png"/>
<plot name="TriggerRate" title="Trigger Rate" xlabel="Seconds From Start" ylabel="Counts" value="ON" stats="ON">
<variable name="rawAna_SecondsFromStart" range="auto" nbins="100" />
</plot>
</TRestAnalysisPlot>
</addProcess>
</TRestProcessRunner>
<addTask type="processEvents" value="ON"/>
</TRestManager>
Any advice on what I should do to see the evolving histograms?
Thanks!
nkx
June 23, 2021, 12:19pm
2
Can you try to pull the rawprocess-servermode
branch for both framework
and rawlib
? I reviewed their code several days ago and indeed found lots of problems. Now they shall be working.
jgalan
June 23, 2021, 1:44pm
3
In order to pull the latest version at the rawprocess-servermode
branch the following should work.
python3 pull-submodules.py --latest:rawprocess-servermode
That will pull master at each submodule, but if the branch exists it will attempt to pull that branch
jgalan
June 23, 2021, 4:34pm
4
Although, @ddiez , you could approve the PR, so that those changes are already merged to master.
ddiez
June 23, 2021, 4:59pm
5
Oh, sorry, should be done now.
ddiez
June 24, 2021, 9:12am
6
It took me a while to compile correctly everything but now TRestRealTimeDrawingProcess
is working fine without changing anything in the rml. A new canvas is open every 1000 events and the histo evolves correctly.
I don’t now if it’s possible but would be nice if if the canvas could remain open all the time and refresh only the histogram, now every time it has to draw a new histogram it closes the previous canvas and open a new one. That makes the screen gets crazy if the number of events between histograms is not big enough.
But it’s still a very useful functionality.
jgalan
June 24, 2021, 10:24am
7
Please, consider to write a brief user guide, just a page, at
The public website will be automatically updated modifying the corresponding data-processing
section file at the development branch.
Right now the development branch is rendered to the public website.
jgalan
June 24, 2021, 10:25am
8
I would say information from the PR could be rescued
rest-for-physics:master
← rest-for-physics:rawprocess-servermode
opened 03:08PM - 15 Jun 21 UTC
   [](https://gitlab.cern.ch/rest-for-physics/framework/-/commits/rawprocess-servermode) [<img width="16" alt="Powered by Pull Request Badge" src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=rest-for-physics&utm_campaign=badge_info)
I have implemented a new feature to run raw processes in server mode. We are now able to add input files lively during process through inter-process messenger. restManager will hang up at the end of the last input file waiting for the next input. It will quit only when receiving quit message. This feature is very helpful to have REST cooperation with daq system. For example, as soon as we start data taking, the analysis chain starts, and the figures are drawn in time.
For example, in bash window 1, we launch restManager using example rml:
```
restManager --c realtimeCoboAnalysis.rml --d 7786 --batch --i "/data2/2MM/M1/graw/CoBo_AsAd*_2020-07-13T13:43:13*_0000.graw" --o abc.root
```
Here `--d 7786` means we define the run number as 7786. REST will run the process and hang up after the file is finished. Then in bash window 2, we run:
```
restSendMessage 116027 "7786->/data2/2MM/M1/graw/CoBo_AsAd2_2020-07-13T13:43:13.698_0001.graw"
```
Here 116027 is a token for TRestMessenger connection. This command means sending a message telling to add a new file to run 7786. We can see in window 1 the process runs again.
Finally in window 2 we input:
```
restSendMessage 116027 "7786->finish"
```
We can see the process quit normally after all the files has been processed.

and added to that documentation page
nkx
June 27, 2021, 1:11pm
9
ddiez:
I don’t now if it’s possible but would be nice if if the canvas could remain open all the time and refresh only the histogram, now every time it has to draw a new histogram it closes the previous canvas and open a new one. That makes the screen gets crazy if the number of events between histograms is not big enough.
A workaround is to use batch mode for restManager, and open the png files using display
command with refresh interval of 1 second.
jgalan
June 27, 2021, 7:02pm
10
I imagine that is executing
display -update 1 xxx.png
ddiez
June 28, 2021, 9:14am
11
It is a nice solution, really easy