Trying TRestRealTimeDrawingProcess to see growing histograms while the processing is ongoing

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!

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.

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

Although, @ddiez, you could approve the PR, so that those changes are already merged to master.

Oh, sorry, should be done now.

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.

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.

I would say information from the PR could be rescued

and added to that documentation page

A workaround is to use batch mode for restManager, and open the png files using display command with refresh interval of 1 second.

I imagine that is executing

display -update 1 xxx.png

It is a nice solution, really easy :ok_hand: