Back Midas Rome Roody Rootana
  Root Analyzer Framework, Page 3 of 4  Not logged in ELOG logo
ID Date Author Topic Subjectdown
  59   05 Apr 2023 Marius KoeppelSuggestionPython Plotting1
> You have to update to the develop branch of midas and refresh your browser cache.
I already tried it and my local installation is 2 days old. I pulled again the dev branch now and I also got another error (actually a while ago but I forgot to report it):

Commit d5263e gives me the following error:

/home/makoeppe/mu3e/midas/progs/mhdump.cxx:393:42: error: ‘ctime’ was not declared in this scope
  393 |                            printf(" %s", ctime(&t));
      |                                          ^~~~~
/home/makoeppe/mu3e/midas/progs/mhdump.cxx:25:1: note: ‘ctime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
   24 | #include <vector>
  +++ |+#include <ctime>
   25 | 

gcc (GCC) 12.2.0
Linux office 5.15.86-1-lts #1 SMP Sun, 01 Jan 2023 16:03:00 +0000 x86_64 GNU/Linux

After adding #include <ctime> it compiles fine.

However, after cleaning the ODB and setting up everything fresh I don't even have the pages on the left bar anymore.

Best,
Marius
  60   05 Apr 2023 Stefan RittSuggestionPython Plotting1
> > You have to update to the develop branch of midas and refresh your browser cache.
> I already tried it and my local installation is 2 days old. I pulled again the dev branch now and I also got another error (actually a while ago but I forgot to report it):
> 
> Commit d5263e gives me the following error:
> 
> /home/makoeppe/mu3e/midas/progs/mhdump.cxx:393:42: error: ‘ctime’ was not declared in this scope
>   393 |                            printf(" %s", ctime(&t));
>       |                                          ^~~~~
> /home/makoeppe/mu3e/midas/progs/mhdump.cxx:25:1: note: ‘ctime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
>    24 | #include <vector>
>   +++ |+#include <ctime>
>    25 | 
> 
> gcc (GCC) 12.2.0
> Linux office 5.15.86-1-lts #1 SMP Sun, 01 Jan 2023 16:03:00 +0000 x86_64 GNU/Linux
> 
> After adding #include <ctime> it compiles fine.


mhdump.cxx is written by Konstantin, so he should give his ok to add the include. 


> However, after cleaning the ODB and setting up everything fresh I don't even have the pages on the left bar anymore.

The menu on the left side is controlled via the ODB flags /Experiment/Menu. Probably the "Event dump" is of by default.

Stefan
  61   15 Jun 2023 Marius KoeppelSuggestionPython Plotting1
> > > You have to update to the develop branch of midas and refresh your browser cache.
> > I already tried it and my local installation is 2 days old. I pulled again the dev branch now and I also got another error (actually a while ago but I forgot to report it):
> > 
> > Commit d5263e gives me the following error:
> > 
> > /home/makoeppe/mu3e/midas/progs/mhdump.cxx:393:42: error: ‘ctime’ was not declared in this scope
> >   393 |                            printf(" %s", ctime(&t));
> >       |                                          ^~~~~
> > /home/makoeppe/mu3e/midas/progs/mhdump.cxx:25:1: note: ‘ctime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> >    24 | #include <vector>
> >   +++ |+#include <ctime>
> >    25 | 
> > 
> > gcc (GCC) 12.2.0
> > Linux office 5.15.86-1-lts #1 SMP Sun, 01 Jan 2023 16:03:00 +0000 x86_64 GNU/Linux
> > 
> > After adding #include <ctime> it compiles fine.
> 
> 
> mhdump.cxx is written by Konstantin, so he should give his ok to add the include. 
Any news on this? We had this issue now on couple of more PCs and operating systems (Arch, OpenSuse and Fedora)

Best,
Marius
  62   15 Jun 2023 Stefan RittSuggestionPython Plotting1
> > mhdump.cxx is written by Konstantin, so he should give his ok to add the include. 
> Any news on this? We had this issue now on couple of more PCs and operating systems (Arch, OpenSuse and Fedora)

Since I didn't get any complaint in the last two months, I added the include.

Stefan
  49   04 Apr 2023 Marius KoeppelSuggestionPython Plotting
Hi all,

again an idea from the mail conversation:

Mail me: Having an „easy way“ to explore the data - maybe some simple Python bindings. Especially when the data protocol is not fully settled in the experiment it’s maybe nice to have a simple way of plotting histograms. But also in general more and more people go to Python.

Mail Konstantin: I am not sure how python can come into this. manalyzer is a C++ analysis framework for experiments with needs beyound "toy" analyzers written in scripting languages (in performance and in complexity). if we want a python analysis framework, we can create one, but I am not sure how much of manalyzer we can reuse, python != C++. if you are thinking of a mixed framework, lets see your examples and use cases.

So a bit of what we did in the past. At some point MIDAS did not have this nice REST API to get events directly by request. At that time we had a python flask server running which used the Python MIDAS binding and gets some events from the buffer and created a REST API so our event display could display the events. However, my idea for the analyzer would be to further extend this idea of having an REST API which provides the user analyzed data. So my "python binding" can be anything at the end (also still a c++ application). So the focus is more from an experiment side: A few people develop the an anlyzer for an experiment but when it's going to be complex users have a hard time to even plot a "simple" histogram if they are non-experts. But if each module could export its flow events via a REST API debugging and easy development for new histograms / checks etc. could be quite easy.

What do you thing?

Best,
Marius
  51   04 Apr 2023 Stefan RittSuggestionPython Plotting
I can add here my five cents:

Since a while, there is an API to request individual events. Have a look at the new "Event Dump" page (which is a pure custom page using mjsonrpc_call("bm_receive_event") ).
In the mjsonrpc call you can specify the "midas even buffer", which is "SYSTEM" by default where all front-end dump their data. Nothing prevents you to create a new
buffer "ANALYZER" and send analyzed events there from your analyzer. The logger only listens to SYSTEM, so does not store these analyzed events. But you can use
the bm_receive_event call to request those analyzed events in a custom page and make a nice single event display from it. This technique would not require any 
modification in midas, just add code to your analyzer to send events to a new buffer.

Best,
Stefan 
  52   04 Apr 2023 Marius KoeppelSuggestionPython Plotting
Hi,

> Since a while, there is an API to request individual events. Have a look at the new "Event Dump" page (which is a pure custom page using mjsonrpc_call("bm_receive_event") ).
> In the mjsonrpc call you can specify the "midas even buffer", which is "SYSTEM" by default where all front-end dump their data. Nothing prevents you to create a new
> buffer "ANALYZER" and send analyzed events there from your analyzer. The logger only listens to SYSTEM, so does not store these analyzed events. But you can use
> the bm_receive_event call to request those analyzed events in a custom page and make a nice single event display from it. This technique would not require any 
> modification in midas, just add code to your analyzer to send events to a new buffer.

Question would be if this functionality should be implemented into the manalyzer framework so that everyone can use it if needed.

Best,
Marius
  53   04 Apr 2023 Stefan RittSuggestionPython Plotting
> Question would be if this functionality should be implemented into the manalyzer framework so that everyone can use it if needed.

You need to function calls for that bm_open_buffer and bm_send_event (both part of the MIDAS C API). The contents of the event
is anyhow up to the user. There also might be cases where one want not one but several different buffers, like for different
event types. So I would recommend start outside the manalyzer framework with that (since it's just two lines of code ... plus maybe
some error checking), and once we all know what is good we can promote this to the manalyzer framework.

Stefan
  54   04 Apr 2023 Marius KoeppelSuggestionPython Plotting
Hi,

> The contents of the event is anyhow up to the user.
Correct me but the bm_send_event wants a event in the MIDAS format. I was more thinking about a json format.

BTW: at my current MIDAS setup I get: Error: Invalid URL "" or query "cmd=Event%20Dump" or command "Event Dump" and Error: Invalid URL "" or query "cmd=OldODB" or command "OldODB" when I try to open the Event Dump or OldODB pages - rest of the pages work.

Best,
Marius
  55   04 Apr 2023 Marius KoeppelSuggestionPython Plotting
Hi,

I have now a mini working setup to get the events from the new buffer:

TEST(Analyzer, GetBuffer)
{
  INT status, request_id;
  HNDLE hBufEvent;
  INT EVENT_BUFFER_SIZE = 10000 * (1 << 25);

  status = cm_connect_experiment("", "Mu3e", "Simple Analyzer", NULL);
  if (status != CM_SUCCESS)
    ASSERT_TRUE(false);

  bm_open_buffer("ANALYZER", EVENT_BUFFER_SIZE, &hBufEvent);
  bm_request_event(hBufEvent, 1, TRIGGER_ALL, GET_ALL, &request_id, process_event);

  cm_disconnect_experiment();

  ASSERT_TRUE(true);
}

For sending the events I am not sure how to do this in the correct way. Since all the methods like bk_init etc. require some kind of frontend logic. Is there an easy way to create a MIDAS event without having a frontend?

Also when I created the new buffer I saw that there is no option to create an uint ODB entry (see file).

Best,
Marius


 
Attachment 1: Cheese_Tue-04Apr23_18.02.png
Cheese_Tue-04Apr23_18.02.png
  56   04 Apr 2023 Stefan RittSuggestionPython Plotting
> For sending the events I am not sure how to do this in the correct way. 

bm_compose_event()
bm_send_event()

You can use bk_init (better bk_init32) to create a bank structure inside an event, but that's not mandatory.
Nothing prevents you from putting a JSON string into your event, as long as the midas even header (created
via bm_compose_event() is correct).

Best,
Stefan
  57   04 Apr 2023 Stefan RittSuggestionPython Plotting
> Also when I created the new buffer I saw that there is no option to create an uint ODB entry (see file).
Attachment 1: Screenshot_2023-04-04_at_18.53.04.png
Screenshot_2023-04-04_at_18.53.04.png
  58   05 Apr 2023 Stefan RittSuggestionPython Plotting
> BTW: at my current MIDAS setup I get: Error: Invalid URL "" or query "cmd=Event%20Dump" or command "Event Dump" and Error: Invalid URL "" or query "cmd=OldODB" or command "OldODB" when I try to open the Event Dump or OldODB pages - rest of the pages work.

You have to update to the develop branch of midas and refresh your browser cache.

Stefan
  1   10 Mar 2016 Thomas LindnerInfoNew forum for rootana MIDAS analyzer
This is a new forum for discussing the rootana MIDAS analyzer.  

Code is on bitbucket:

https://bitbucket.org/tmidas/rootana

There is also an associated wiki for rootana documentation

https://midas.triumf.ca/MidasWiki/index.php/ROOTANA
  38   22 Mar 2021 Isaac Labrie BoulayForumManalyzer - Preventing BeginRun() from getting called when I stop the run.
Hi all,

I am running an analyzer using an manalyzer templates and the analysis seems to 
lag behind the events getting stored in the buffer by my frontend. This is because 
the live histogram (-g) is very slow to update and draw. The slight delay causes a 
run object to be created after I 'stop' the acquisition. I'm guessing that this is 
because there are still MIDAS events in the ring buffer. This causes the 
BeginRun() methods of all my modules to get called again.

What is the best way to prevent this? From what I understand, PreEndRun() methods 
should only be used to clear buffered flow events. Is there maybe a way to speed 
up the histogram drawing so that I don't get this lag in the analysis?

Any help will be greatly appreciated.

Thanks so much for your time.

Isaac
  50   04 Apr 2023 Marius KoeppelSuggestionHistogram Class Templates
Hi all,

Having different histogram class templates to make processing easier.

My idea here was to create a parser which can take json input and creates automated default histograms from this. So here are a toy example how this could look like:

{
    "default1D": {
        "title": "bla",
        "x": "bla",
        "y": "#",
        "minX": "0",
        "maxX": 128,
        "nBins": 128,
    },
    "default2D": {
        "title": "bla",
        "x": "bla",
        "y": "#",
        "minX": "0",
        "maxX": 128,
        "nBinsX": 128,
        "minY": "0",
        "maxY": 128,
        "nBinsY": 128,
    },
    "detectorX": {
        "1DHistos":
            [
                {
                    "name": "FPGAID",
                    "type": "count",
                    "y": "#",
                    "minX": 0,
                    "maxX": 12,
                    "nBins": 12,
                    "value": "fpgaID",
                    "startChipID": 0,
                    "endChipID": 128,
                    "condition": "ROOT style: tree->Draw("X","X>10","");"
                },
                {
                    "name": "timeDiff",
                    "type": "diff",
                    "y": "#",
                    "xaxis": "col",
                    "minX": -256,
                    "maxX": 256,
                    "nBins": 512,
                    "value": "chipID",
                    "startChipID": 0,
                    "endChipID": 128,
                    "condition": "ROOT style: tree->Draw("X","X>10","");"
                },
           ]
....
}

Best,
Marius
  48   04 Apr 2023 Marius KoeppelInfoDocumentation Event Flow
Hi all,

following the e-mail conversation from Konstantin. The next topic we discussed was the event flow.

What I want to have (especially for commissioning phases for an experiment) is the possibility to have some kind of online calibration setup. 
So one has some kind of detector X which sends data and another detector Y which also sends data and I want to correlate the two detectors after applying some kinds of cleaning steps to the data. 

Mail me: Having the event flow maybe „orthogonal“ - not sure how to say this correctly but at the moment there is only one flow in a linear direction.
So something like was my intuition:
eventX -> decodeX -flow-> cleanX -> buffer -> correlation of X/Y
                                      ^
                                      |
eventY -> decodeY -flow-> cleanY ->   |


Mail Konstantin: yes, you will have to explain what you mean. right now, the flow is linear, as is typical for most physics analysis.
                 however, at any point one is permitted to create new flow events and inject them to the top of the modules pipeline, this adds "loops".

So how would injection into the top help? So I clean x/y and than I inject them back to the top and create a third flow for the correlation?
If this is true maybe a simple example or some more words on the documentation would help. I would be also willing to do that. After I fully understand how this would be possible.

Best,
Marius
  23   12 Jul 2020 Thomas LindnerBug ReportCompiling rootana on Macos 10.15.4
I had some trouble building rootana on my new laptop, running MacOS 10.15.4 (Xcode 11.5).

Most of rootana compiled fine, but the steps with rootcint fail.  For instance:

rootcint -f obj/TMainDisplayWindowDict.cxx -DHAVE_ROOT   -DOS_LINUX -DOS_DARWIN -I./include 
include/TMainDisplayWindow.hxx include/TMainDisplayWindow_LinkDef.h
In file included from input_line_12:12:
In file included from ./include/TMainDisplayWindow.hxx:4:
In file included from /Applications/root_v6.18.99/include/TGClient.h:27:
In file included from /Applications/root_v6.18.99/include/TString.h:26:
In file included from /Applications/root_v6.18.99/include/TMathBase.h:32:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 
'signbit' in the global namespace
using ::signbit;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:318:9: error: no member named 
'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:319:9: error: no member named 
'isfinite' in the global namespace
using ::isfinite;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:320:9: error: no member named 'isinf' 
in the global namespace
using ::isinf;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:321:9: error: no member named 'isnan' 
in the global namespace

This is probably a problem with my Xcode installation.  But I found a work-around, which was explicitly 
defining CPATH before the rootcint command in the Makefile:
obj/TMainDisplayWindowDict.cxx obj/TRootanaDisplayDict.cxx obj/TFancyHistogramCanvasDict.cxx: 
obj/%Dict.cxx:
    CPATH=/usr/local/include rootcint -f $@ $(CXXFLAGS_ROOTCINT) -I./include include/$*.hxx 
include/$*_LinkDef.h

obj/TNetDirectoryDict.cxx: obj/%Dict.cxx:
    CPATH=/usr/local/include rootcint -f $@ $(CXXFLAGS_ROOTCINT) -I./include include/$*.h 
include/$*_LinkDef.h

As I say, this is probably a problem with my installation; but I include the work-around in case it is helpful.

In the medium term we will try to remove the dependence on the old, ugly rootcint, since it often has 
problems.
  10   16 Jul 2019 HassanBug ReportCannot find dictionary modules
Hello,

We've been attempting to make and run the executables in the
/packages/rootana/examples directory and have come across the same/similar
errors for each of them regarding missing dictionary modules:

[lm17773@it038146 examples]$ ./ana.exe 
Error in <TCling::RegisterModule>: cannot find dictionary module
TFancyHistogramCanvasDict_rdict.pcm
Error in <TCling::RegisterModule>: cannot find dictionary module
TMainDisplayWindowDict_rdict.pcm
Error in <TCling::RegisterModule>: cannot find dictionary module
TRootanaDisplayDict_rdict.pcm
Using THttpServer in read/write mode
================================================================================
[lm17773@it038146 examples]$ ./anaDisplay.exe 
Error in <TCling::RegisterModule>: cannot find dictionary module
TMainDisplayWindowDict_rdict.pcm
Error in <TCling::RegisterModule>: cannot find dictionary module
TRootanaDisplayDict_rdict.pcm
Error in <TCling::RegisterModule>: cannot find dictionary module
TFancyHistogramCanvasDict_rdict.pcm
TDT724Waveform done init...... 
Create Histos
Create Histos
Adding new canvas in tab named 'V1720 Waveforms'
Adding new canvas in tab named 'V1720 Correlations'
Adding new canvas in tab named 'DT724 Waveforms'
Adding new canvas in tab named 'TRB3 Histograms'
Adding new canvas in tab named 'TRB3 Fine Histograms'
Adding new canvas in tab named 'TRB3 Diff Histograms'
===============================================================================
[lm17773@it038146 examples]$ ./midas2root.exe 
Error in <TCling::RegisterModule>: cannot find dictionary module
TFancyHistogramCanvasDict_rdict.pcm
Error in <TCling::RegisterModule>: cannot find dictionary module
TMainDisplayWindowDict_rdict.pcm
Error in <TCling::RegisterModule>: cannot find dictionary module
TRootanaDisplayDict_rdict.pcm
Create main window!
==============================================================================
[lm17773@it038146 examples]$ ./root_server.exe 
Error in <TCling::RegisterModule>: cannot find dictionary module
TFancyHistogramCanvasDict_rdict.pcm
Error in <TCling::RegisterModule>: cannot find dictionary module
TMainDisplayWindowDict_rdict.pcm
Error in <TCling::RegisterModule>: cannot find dictionary module
TRootanaDisplayDict_rdict.pcm
Using THttpServer in read/write mode

Please can you help us locate these modules?

Thanks!
  11   16 Jul 2019 Konstantin OlchanskiBug ReportCannot find dictionary modules
> [lm17773@it038146 examples]$ ./ana.exe 
> Error in <TCling::RegisterModule>: cannot find dictionary module
> TFancyHistogramCanvasDict_rdict.pcm

It is a problem inside ROOT. The pcm files replaced the dict.h files during the switch from CINT in 
ROOTv5 to LLVM in ROOTv6. But they have a mistake and use the wrong path for finding these files. 
I.e. search for "cannot find dictionary module" on the ROOT forum https://root-forum.cern.ch

K.O.
ELOG V3.1.4-2e1708b5