Back Midas Rome Roody Rootana
  Midas DAQ System, Page 80 of 152  Not logged in ELOG logo
ID Date Author Topic Subjectdown
  1646   07 Aug 2019 Thomas LindnerBug ReportROOTANA bug?
Hi Paolo,

Sorry for the slow response.  We were discussing this with Konstantin yesterday.  He is aware of the problem now and will be working on a solution soon.

In the short term I found that it works if you just comment out the offending line:

indnerlt:rootana lindner$ git diff libMidasInterface/TMidasOnline.cxx
diff --git a/libMidasInterface/TMidasOnline.cxx b/libMidasInterface/TMidasOnline.cxx
index 92eb3e9..67da613 100644
--- a/libMidasInterface/TMidasOnline.cxx
+++ b/libMidasInterface/TMidasOnline.cxx
@@ -191,7 +191,7 @@ bool TMidasOnline::sleep(int mdelay)
   #ifdef CH_IPC
   ss_suspend_set_dispatch(CH_IPC, 0, NULL);
   #else
-  ss_suspend_set_dispatch_ipc(NULL);
+  //  ss_suspend_set_dispatch_ipc(NULL);
   #endif
  int status = ss_suspend(mdelay, 0);
   if (status == SS_SUCCESS)

This compiles and at least runs for me; so maybe that is helpful for you.  But Konstantin will provide a longer term solution.



> Hi,
> 
> I posted on the ROOTANA elog but there seems to be little activity there...
> 
> Could someone confirm if this is a bug?
> https://midas.triumf.ca/elog/Rootana/14
> 
> Another user replied that they are encountering the same issue, so I think it is unlikely it is just our installation.
> 
> While ROOTANA is unusable for us, I tried to use the example Frontend and Analyzer (under the Experiment source folder). The analyzer does not seem to do much though. A root file is produced but nothing is placed into it. Is that normal?
> 
> Any help would be welcome.
  1648   08 Aug 2019 Lauren MantonBug ReportROOTANA bug?
Hi,

Thank you, commenting out the line worked and we can now compile the code. However, when we try to run ana.exe or anaDisplay.exe, we get the following errors:

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
 

We see that the files are in /rootana/obj but we cannot find a way to point the compiler to them.

Could you please advise how to proceed,

Many thanks

> Hi Paolo,
> 
> Sorry for the slow response.  We were discussing this with Konstantin yesterday.  He is aware of the problem now and will be working on a solution soon.
> 
> In the short term I found that it works if you just comment out the offending line:
> 
> indnerlt:rootana lindner$ git diff libMidasInterface/TMidasOnline.cxx
> diff --git a/libMidasInterface/TMidasOnline.cxx b/libMidasInterface/TMidasOnline.cxx
> index 92eb3e9..67da613 100644
> --- a/libMidasInterface/TMidasOnline.cxx
> +++ b/libMidasInterface/TMidasOnline.cxx
> @@ -191,7 +191,7 @@ bool TMidasOnline::sleep(int mdelay)
>    #ifdef CH_IPC
>    ss_suspend_set_dispatch(CH_IPC, 0, NULL);
>    #else
> -  ss_suspend_set_dispatch_ipc(NULL);
> +  //  ss_suspend_set_dispatch_ipc(NULL);
>    #endif
>   int status = ss_suspend(mdelay, 0);
>    if (status == SS_SUCCESS)
> 
> This compiles and at least runs for me; so maybe that is helpful for you.  But Konstantin will provide a longer term solution.
> 
> 
> 
> > Hi,
> > 
> > I posted on the ROOTANA elog but there seems to be little activity there...
> > 
> > Could someone confirm if this is a bug?
> > https://midas.triumf.ca/elog/Rootana/14
> > 
> > Another user replied that they are encountering the same issue, so I think it is unlikely it is just our installation.
> > 
> > While ROOTANA is unusable for us, I tried to use the example Frontend and Analyzer (under the Experiment source folder). The analyzer does not seem to do much though. A root file is produced but nothing is placed into it. Is that normal?
> > 
> > Any help would be welcome.
  1654   08 Aug 2019 Konstantin OlchanskiBug ReportROOTANA bug?
> indnerlt:rootana lindner$ git diff libMidasInterface/TMidasOnline.cxx
> diff --git a/libMidasInterface/TMidasOnline.cxx b/libMidasInterface/TMidasOnline.cxx
> index 92eb3e9..67da613 100644
> --- a/libMidasInterface/TMidasOnline.cxx
> +++ b/libMidasInterface/TMidasOnline.cxx
> @@ -191,7 +191,7 @@ bool TMidasOnline::sleep(int mdelay)
>    #ifdef CH_IPC
>    ss_suspend_set_dispatch(CH_IPC, 0, NULL);
>    #else
> -  ss_suspend_set_dispatch_ipc(NULL);
> +  //  ss_suspend_set_dispatch_ipc(NULL);
>    #endif
>   int status = ss_suspend(mdelay, 0);
>    if (status == SS_SUCCESS)
> 
> This compiles and at least runs for me; so maybe that is helpful for you.  But Konstantin will provide a longer term solution.


This is a problem with the latest development version of MIDAS. ss_suspend overrides have been removed from system.cxx
and there is no way for rootana to avoid the problem of recursive call to the event handler.

I recommend that instead of using the latest development version of MIDAS you use one of the recent released versions (use "git tag -l", midas-2019-06-b is the latest release).

All the released versions of midas have the ss_suspend overrides implemented and rootana will work correctly. For the next release of midas
I will restore the ss_suspend override and update the rootana code.


K.O.
  1664   14 Aug 2019 Konstantin OlchanskiBug ReportROOTANA bug?
> -  ss_suspend_set_dispatch_ipc(NULL);
> +  //  ss_suspend_set_dispatch_ipc(NULL);
> 
> This compiles and at least runs for me; so maybe that is helpful for you.  But Konstantin will provide a longer term solution.

I now understand why this fix worked. Around December 2018 timeframe, I reworked the MIDAS event buffer code
and one improvement was to only send UDP buffer notifications if somebody is waiting for them. This probably
reduced to zero the probability of recursive calls to the user event handler - the problem originally fixed by the monkey
work against the midas ipc handler.

After looking at it, I now understand that the correct solution is to call ss_suspend(MSG_BM), but it turns out
inside MIDAS, handling of MSG_BM was incomplete and recursive calls to the user event handler were still
possible. (but most likely not actually happening anymore because of those changes to the event buffer code).

So.

a) ss_suspend(MSG_BM) inside midas now works correctly, recursive call to the user event handler will not happen.
b) TMidasOnline::sleep() now calls ss_suspend(MSG_BM), monkey business with ss_suspend_set_dispatch_ipc() is removed.

The problem of recursive call to the analyzer event handler is now fixed, both rootana and manalyzer (both use the same TMidasOnline code).

Read more about this here:
https://midas.triumf.ca/elog/Midas/1663

K.O.
  2766   14 May 2024 Konstantin OlchanskiInfoROOT v6.30.6 requires libtbb-dev
root_v6.30.06.Linux-ubuntu22.04-x86_64-gcc11.4 the libtbb-dev package.

This is a new requirement and it is not listed in the ROOT dependancies page (I left a note on the ROOT forum, hopefully it will be 
fixed quickly). https://root.cern/install/dependencies/

Symptom is when starting ROOT, you get an error:
cling::DynamicLibraryManager::loadLibrary(): libtbb.so.12: cannot open shared object file: No such file or directory
and things do not work.

Fix is to:
apt install libtbb-dev

K.O.
  881   30 Apr 2013 Konstantin OlchanskiInfoROOT switched to GIT
Latest news - the ROOT project switched from SVN to GIT.

Announcement:
http://root.cern.ch/drupal/content/root-has-moved-git

Fons's presentation with details on the conversion process, repository size and performance 
improvements:
https://indico.cern.ch/getFile.py/access?contribId=0&resId=0&materialId=slides&confId=246803

"no switch yard" work flow:
http://root.cern.ch/drupal/content/suggested-work-flow-distributed-projects-nosy

GIT cheat sheet:
http://root.cern.ch/drupal/content/git-tips-and-tricks

K.O.
  1070   15 Jul 2015 Konstantin OlchanskiInfoROOT support in flux
ROOT support in MIDAS is being reworked:

a) ROOT support moved from midas.h to rmidas.h
b) default mlogger is built without ROOT support, use rmlogger if you need ROOT output
c) Makefile inconsistency between use of ROOTSYS and use of root-config has been identified, but not yet 
fixed. the plan is to use root-config to detect and use the ROOT package.
d) cross compilation will not support ROOT (same as now. "make linux32", "make linux64", "make 
linuxarm" disable most optional packages. To build full featured midas with ROOT & etc please compile 
natively on the ARM machine).
e) histogram servers in MIDAS and ROOTANA will be switched to use the new ROOT Web server classes 
(based on "civet", a fork of the mongoose web server).

K.O.
  1073   22 Jul 2015 Konstantin OlchanskiInfoROOT support in flux
> ROOT support in MIDAS is being reworked:
>
> c) Makefile inconsistency between use of ROOTSYS and use of root-config has been identified,

MIDAS Makefile was corrected to use root-config exclusively to find and use ROOT. This makes us more consistent
with the ROOT-recommended use of the thisroot.{sh,csh} scripts.

In other words, if root-config is in the PATH, ROOT support will be enabled, rmlogger and rmana.o will be built.

To explicitly disable ROOT, say "make NO_ROOT=1"

K.O.
  1074   22 Jul 2015 Konstantin OlchanskiInfoROOT support in flux
> > ROOT support in MIDAS is being reworked:
> >
> > c) Makefile inconsistency between use of ROOTSYS and use of root-config has been identified,
> 
> MIDAS Makefile was corrected to use root-config exclusively to find and use ROOT. This makes us more consistent
> with the ROOT-recommended use of the thisroot.{sh,csh} scripts.
> 

The updated ROOT instructions on DAQwiki
https://www.triumf.info/wiki/DAQwiki/index.php/ROOT
now explain how to use "thisroot" to select the right version of the package.

The preliminary version of the .bashrc blurb looks like this
(a couple of flaws:
1) identification of CentOS7 is incomplete - please send me a patch
2) there should be a check for root-config already in the PATH, as on Ubuntu, the ROOT package may be installed in /usr and root-
config may be already in the path - please send me patch).

if [ `uname -i` == "i386" ]; then 
    . /daq/daqshare/olchansk/root/root_v5.34.01_SL62_32/bin/thisroot.sh 
    true 
elif [ `lsb_release -r -s` == "7.1.1503" ]; then 
    #. /daq/daqshare/olchansk/root/root_v5.34.32_SL66_64/bin/thisroot.sh 
    true 
else 
     . /daq/daqshare/olchansk/root/root_v5.34.32_SL66_64/bin/thisroot.sh 
     true 
fi 

K.O.
  1086   29 Jul 2015 Konstantin OlchanskiInfoROOT support in flux
The preliminary version of the .bashrc blurb looks like this
(a couple of flaws:
1) identification of CentOS7 is incomplete - please send me a patch
fixed -> 2) there should be a check for root-config already in the PATH, as on Ubuntu, the ROOT package 
may be installed in /usr and root-
config may be already in the path - please send me patch).

if [ -x $(which root-config) ]; then 
    # root already in the PATH 
    true 
elif [ `uname -i` == "i386" ]; then 
    . /daq/daqshare/olchansk/root/root_v5.34.01_SL62_32/bin/thisroot.sh 
    true 
elif [ `lsb_release -r -s` == "7.1.1503" ]; then 
    #. /daq/daqshare/olchansk/root/root_v5.34.32_SL66_64/bin/thisroot.sh 
    true 
else 
     . /daq/daqshare/olchansk/root/root_v5.34.32_SL66_64/bin/thisroot.sh 
     true 
fi 
  3043   24 May 2025 Pavel MuratInfoROOT scripting for MIDAS seems to work pretty much out of the box
Dear All, 

I'm pretty sure many know this already, however I found this feature by a an accident 
and want to share with those who don't know about it yet - seems very useful. 

- it looks that one can use ROOT scripting with rootcling and call from the 
  interactive ROOT prompt any function defined in midas.h and access ODB seemingly 
  WITHOUT DOING anything special 

- more surprisingly, that also works for odbxx, with one minor exception in handling 
  the 64-bit types - the proof is in attachment. The script test_odbxx.C loaded 
  interactively is Stefan's

 https://bitbucket.org/tmidas/midas/src/develop/examples/odbxx/odbxx_test.cxx 

with one minor change - the line 
 
   o[Int64 Key] = -1LL;

is replaced with

   int64_t x = -1LL;
   o["Int64 Key"] = x;

- apparently the interpeter has its limitations. 

My rootlogon.C file doesn't load any libraries, it only defines the appropriate 
include paths. So it seems that everything works pretty much out of the box. 

One issue has surfaced however. All that worked despite my experiment 
had its name="test_025", while the example specifies experiment="test". 
Is it possible that that only first 4 characters are being tested ? 

-- regards, Pasha
Attachment 1: log.txt
mu2etrk@mu2edaq22:~/test_stand/daquser_001>root.exe
   ------------------------------------------------------------------
  | Welcome to ROOT 6.32.06                        https://root.cern |
  | (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on May 04 2025, 19:16:31                 |
  | From tags/6-32-06@6-32-06                                        |
  | With g++ (Spack GCC) 13.1.0                                      |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

05-24 23:26:22.397661                       MetricManager:31     INFO MetricManager(): MetricManager CONSTRUCTOR
root [0] .L test_odbxx.C 
root [1] main()
Delete key /Test/Settings not found in ODB
Created ODB key "/Test/Settings"
Created ODB key "/Test/Settings/Int32 Key"
Set ODB key "/Test/Settings/Int32 Key" = 42
Created ODB key "/Test/Settings/Bool Key"
Set ODB key "/Test/Settings/Bool Key" = true
Created ODB key "/Test/Settings/Subdir"
Created ODB key "/Test/Settings/Subdir/Int32 key"
Set ODB key "/Test/Settings/Subdir/Int32 key" = 123
Created ODB key "/Test/Settings/Subdir/Double Key"
Set ODB key "/Test/Settings/Subdir/Double Key" = 1.200000
Created ODB key "/Test/Settings/Subdir/Subsub"
Created ODB key "/Test/Settings/Subdir/Subsub/Float key"
Set ODB key "/Test/Settings/Subdir/Subsub/Float key" = 1.200000
Created ODB key "/Test/Settings/Subdir/Subsub/String Key"
Set ODB key "/Test/Settings/Subdir/Subsub/String Key" = "Hello"
Created ODB key "/Test/Settings/Int Array"
Set ODB key "/Test/Settings/Int Array[0...2]" = [1,2,3]
Created ODB key "/Test/Settings/Double Array"
Set ODB key "/Test/Settings/Double Array[0...2]" = [1.200000,2.300000,3.400000]
Created ODB key "/Test/Settings/String Array"
Set ODB key "/Test/Settings/String Array[0...2]" = ["Hello1","Hello2","Hello3"]
Created ODB key "/Test/Settings/Large Array"
Set ODB key "/Test/Settings/Large Array[0...9]" = [0,0,0,0,0,0,0,0,0,0]
Created ODB key "/Test/Settings/Large String"
Set ODB key "/Test/Settings/Large String" = ""
Created ODB key "/Test/Settings/String Array 10"
Set ODB key "/Test/Settings/String Array 10[0...9]" = ["","","","","","","","","",""]
Created ODB key "/Test/Settings/Large String Array 10"
Set ODB key "/Test/Settings/Large String Array 10[0...9]" = ["","","","","","","","","",""]
Get definition for ODB key "/Test/Settings"
Get definition for ODB key "/Test/Settings/Int32 Key"
Get definition for ODB key "/Test/Settings/Int32 Key"
Get ODB key "/Test/Settings/Int32 Key": 42
Get definition for ODB key "/Test/Settings/Bool Key"
Get definition for ODB key "/Test/Settings/Bool Key"
Get ODB key "/Test/Settings/Bool Key": true
Get definition for ODB key "/Test/Settings/Subdir"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Int Array"
Get definition for ODB key "/Test/Settings/Int Array"
Get ODB key "/Test/Settings/Int Array[0...2]": [1,2,3]
Get definition for ODB key "/Test/Settings/Double Array"
Get definition for ODB key "/Test/Settings/Double Array"
Get ODB key "/Test/Settings/Double Array[0...2]": [1.200000,2.300000,3.400000]
Get definition for ODB key "/Test/Settings/String Array"
Get definition for ODB key "/Test/Settings/String Array"
Get ODB key "/Test/Settings/String Array[0...2]": ["Hello1,Hello2,Hello3"]
Get definition for ODB key "/Test/Settings/Large Array"
Get definition for ODB key "/Test/Settings/Large Array"
Get ODB key "/Test/Settings/Large Array[0...9]": [0,0,0,0,0,0,0,0,0,0]
Get definition for ODB key "/Test/Settings/Large String"
Get definition for ODB key "/Test/Settings/Large String"
Get ODB key "/Test/Settings/Large String": ""
Get definition for ODB key "/Test/Settings/String Array 10"
Get definition for ODB key "/Test/Settings/String Array 10"
Get ODB key "/Test/Settings/String Array 10[0...9]": [",,,,,,,,,"]
Get definition for ODB key "/Test/Settings/Large String Array 10"
Get definition for ODB key "/Test/Settings/Large String Array 10"
Get ODB key "/Test/Settings/Large String Array 10[0...9]": [",,,,,,,,,"]
Get definition for ODB key "/Test/Settings"
Get definition for ODB key "/Test/Settings/Subdir"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Int32 Key"
Get definition for ODB key "/Test/Settings/Int32 Key"
Get ODB key "/Test/Settings/Int32 Key": 42
Get definition for ODB key "/Test/Settings/Bool Key"
Get definition for ODB key "/Test/Settings/Bool Key"
Get ODB key "/Test/Settings/Bool Key": true
Get definition for ODB key "/Test/Settings/Subdir"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Int Array"
Get definition for ODB key "/Test/Settings/Int Array"
Get ODB key "/Test/Settings/Int Array[0...2]": [1,2,3]
Get definition for ODB key "/Test/Settings/Double Array"
Get definition for ODB key "/Test/Settings/Double Array"
Get ODB key "/Test/Settings/Double Array[0...2]": [1.200000,2.300000,3.400000]
Get definition for ODB key "/Test/Settings/String Array"
Get definition for ODB key "/Test/Settings/String Array"
Get ODB key "/Test/Settings/String Array[0...2]": ["Hello1,Hello2,Hello3"]
Get definition for ODB key "/Test/Settings/Large Array"
Get definition for ODB key "/Test/Settings/Large Array"
Get ODB key "/Test/Settings/Large Array[0...9]": [0,0,0,0,0,0,0,0,0,0]
Get definition for ODB key "/Test/Settings/Large String"
Get definition for ODB key "/Test/Settings/Large String"
Get ODB key "/Test/Settings/Large String": ""
Get definition for ODB key "/Test/Settings/String Array 10"
Get definition for ODB key "/Test/Settings/String Array 10"
Get ODB key "/Test/Settings/String Array 10[0...9]": [",,,,,,,,,"]
Get definition for ODB key "/Test/Settings/Large String Array 10"
Get definition for ODB key "/Test/Settings/Large String Array 10"
Get ODB key "/Test/Settings/Large String Array 10[0...9]": [",,,,,,,,,"]
Get ODB key "/Test/Settings/Int32 Key": 42
Get ODB key "/Test/Settings/Bool Key": true
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get ODB key "/Test/Settings/Int Array[0...2]": [1,2,3]
Get ODB key "/Test/Settings/Double Array[0...2]": [1.200000,2.300000,3.400000]
Get ODB key "/Test/Settings/String Array[0...2]": ["Hello1,Hello2,Hello3"]
Get ODB key "/Test/Settings/Large Array[0...9]": [0,0,0,0,0,0,0,0,0,0]
Get ODB key "/Test/Settings/Large String": ""
Get ODB key "/Test/Settings/String Array 10[0...9]": [",,,,,,,,,"]
Get ODB key "/Test/Settings/Large String Array 10[0...9]": [",,,,,,,,,"]
"Settings": {
   "Int32 Key": 42,
   "Bool Key": true,
   "Subdir": {
      "Int32 key": 123,
      "Double Key": 1.200000,
      "Subsub": {
         "Float key": 1.200000,
         "String Key": "Hello"
      }
   },
   "Int Array": [1,2,3],
   "Double Array": [1.200000,2.300000,3.400000],
   "String Array": ["Hello1","Hello2","Hello3"],
   "Large Array": [0,0,0,0,0,0,0,0,0,0],
   "Large String": "",
   "String Array 10": ["","","","","","","","","",""],
   "Large String Array 10": ["","","","","","","","","",""]
}
Set ODB key "/Test/Settings/Int32 Key" = 42
Get ODB key "/Test/Settings/Int32 Key": 42
Set ODB key "/Test/Settings/Int32 Key" = 43
Get ODB key "/Test/Settings/Int32 Key": 43
Set ODB key "/Test/Settings/Int32 Key" = 44
Get ODB key "/Test/Settings/Int32 Key": 44
Set ODB key "/Test/Settings/Int32 Key" = 57
Should be 57: Get ODB key "/Test/Settings/Int32 Key": 57
57
Created ODB key "/Test/Settings/Int64 Key"
Set ODB key "/Test/Settings/Int64 Key" = -1
Get ODB key "/Test/Settings/Int64 Key": -1
AAAA:0xffffffffffffffff
Created ODB key "/Test/Settings/UInt64 Key"
Set ODB key "/Test/Settings/UInt64 Key" = 1311768465173141112
Get ODB key "/Test/Settings/UInt64 Key": 1311768465173141112
0x1234567812345678
Set ODB key "/Test/Settings/Bool Key" = false
Get ODB key "/Test/Settings/Bool Key": false
Set ODB key "/Test/Settings/Bool Key" = true
Set ODB key "/Test/Settings/Subdir/Subsub/String Key" = "Hello"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Set ODB key "/Test/Settings/Subdir/Subsub/String Key" = "Hello world!"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello world!"
Set ODB key "/Test/Settings/Int32 Key" = 43
Get ODB key "/Test/Settings/Int Array[0...2]": [1,2,3]
Set ODB key "/Test/Settings/Int Array[0...2]" = [10,10,10]
Get ODB key "/Test/Settings/Int Array[1]": [10]
Set ODB key "/Test/Settings/Int Array[1]" = 2
Get ODB key "/Test/Settings/Int Array[1]": [2]
Get ODB key "/Test/Settings/Int Array[0...4]": [10,2,10,0,0]
Set ODB key "/Test/Settings/Int Array[0...4]" = [11,3,11,1,1]
Arrays size is 5
Set ODB key "/Test/Settings/Int Array[10]" = 0
Get ODB key "/Test/Settings/Int Array[10]": [0]
Set ODB key "/Test/Settings/Int Array[10]" = 10
Get ODB key "/Test/Settings/String Array[0...2]": ["Hello1,Hello2,Hello3"]
Set ODB key "/Test/Settings/String Array[0...2]" = ["Hello1","New String","Hello3"]
Get ODB key "/Test/Settings/String Array[2]": ["Hello3"]
Set ODB key "/Test/Settings/String Array[2]" = "Another String"
Set ODB key "/Test/Settings/String Array[3]" = ""
Get ODB key "/Test/Settings/String Array[3]": [""]
Set ODB key "/Test/Settings/String Array[3]" = "One more"
... 468 more lines ...
  1647   07 Aug 2019 Pintaudi GiorgioSuggestionROOT and multi-threading
Hello!
I am creating this thread to comment on an issue raised today during the MIDAS 
workshop.

It was said that ROOT doesn't play well with multithreading ... and it is 
definitely true. But since last year, many improvements have been done in ROOT 
multi-threading support and now even the ROOT fitter can be made thread-safe.

I know this because recently I had to completely rewrite the calibration 
software for the WAGASCI experiment and I wanted to use many ROOT analyzers in 
parallel.

Getting ROOT to work in a multi-thread environment is not painless. It took me 
many weeks to get to the end of it. But if using the latest ROOT version (from 
about ROOT 6.12.00 onwards), it should be possible. Basically, you have to 
compile ROOT with the Minuit2 minimizer support and then select it.

This is the thread on the ROOT forum where I have asked about and solved my 
issues (I am LastStarDust): https://root-forum.cern.ch/t/root-crashes-in-multi-
threaded-environment/35407

You can also refer to this bug report: https://sft.its.cern.ch/jira/browse/ROOT-
7173
and this documentation page: https://root.cern.ch/how/how-express-parallelism-
many-cores

Hope it may help.
Giorgio
  1376   20 Jul 2018 Konstantin OlchanskiInfoROOT I/O workshop notable
The ROOT I/O workshop was held on June 20th at CERN. A few things of interest in MIDAS land:

- LZ4 is now used as default compression (replacing gzip-1)
- JSON class streamer is finally implemented (XML streamer updated/reworked)
- recursive read-write lock class implemented
- do not see any special mention of Javascript I/O or jsroot, but jsroot git repo seems to be quite active

Of these the recursive read-write lock is most interesting - using something similar would improve ODB performance
and presumably fix the existing lock fairness problems.

https://root.cern.ch/doc/master/TReentrantRWLock_8hxx_source.html
https://indico.cern.ch/event/715802/contributions/2942560/attachments/1670191/2680682/ROOT_IO_June_Workshop_v2.pdf
https://github.com/root-project/jsroot

K.O.
  36   15 Dec 2003 Pierre-André Amaudruz ROOT GUI at Triumf
The current Triumf DAQ standard (Midas) since the second quarter of this
year (2003) has the capability to deal with ROOT histograms. The internal
midas logger can save data files in ROOT format and the analyzer can book
and fill ROOT histograms. These features triggered a new project started
during summer 2003 for building a Triumf GUI ROOT/Midas display utility.

The initial requirements for this utility are:
1) Solely based on ROOT (VirtualX, no Qt)
2) Similar overall functionality than PAW.
   - Open concurrent ROOT files.
   - Open connection to a single Midas Online experiment (requires analyzer
                                                          as server)
   - Optional Auto-update in ONLINE mode.
   - Zoning, Zooming option display.
   - Simple Historgram gaphic manipulation. (based on current ROOT
                                             implementation)
   - Tree manipulation ( use of TBrowser())
   - Simple user script invocation.
   - Optional experiment specific customization.
3) Session configuration save/restore option.

An initial version has been developed and currently is under evaluation.
Improvement and further development will based on the local experimenters
responses. 

This utility will be available for external use around the second quarter of
the 2004 at the latest.

.
  407   02 Oct 2007 Konstantin OlchanskiInfoROODY, ROOTANA updates
The ROODY online histogram viewer and the ROOTANA midas analyzer toolkit have been updated to work 
with ROOT version 5.16 and tested on Linux (SL4.4) and MacOS (10.4.10/PPC).

This update includes the library called "TNetDirectory" for access to remote ROOT objects. This library is 
still under development, but is complete enough for use with ROODY. To try it, please specify -P9091 in 
rootana and -Plocalhost:9091 in ROODY.

K.O.
  374   10 May 2007 Konstantin OlchanskiInfoRHEL5/SL5 success!
FWIW, I am running latest 32-bit MIDAS on an AM2 dual core AMD machine under 64-bit SL5. Everything 
seems to work correctly. K.O.

P.S. For the record, the compiler produces two sets of warnings:
- warning: pointer targets in passing argument 3 of â differ in signedness
- warning: dereferencing type-punned pointer will break strict-aliasing rules
(I do not understand the meaning of the second warning. type-punned pointer, huh?)
K.O.
  393   03 Jul 2007 Ryu SawadaInfoRHEL5/SL5 success!
> P.S. For the record, the compiler produces two sets of warnings:
> - warning: dereferencing type-punned pointer will break strict-aliasing rules
> (I do not understand the meaning of the second warning. type-punned pointer, huh?)

This is because strict aliasing rule is broken in this code.

In ISO C++99 standard, it is illegal to create two pointers of different types referring to the same address.
Even a code breaks the rule, it compiles, but the result is undefined.

For example following code gives different results depends on -O2 is used or not, because -O2 includes -fstrict-aliasing option.
When -fstrict-aliasing is used, compiler can optimize the code assuming the strict aliasing rule.
#include <stdio.h>
  
int main(){
   int ii = 1;
   float* ff = (float*)&ii;
   *ff = 2;
   printf("%d\n", ii);
   return 0;
} 

GCC warns this kind of code with a message like,
warning: dereferencing type-punned pointer will break strict-aliasing rules
The behavior differs also depending on compilers. GCC3 does not warn, while GCC4 warns. (GCC3 is the default on SL4, while GCC4 is
the default on SL5)
And results are different. GCC3 gives 0, while GCC4 gives 1.
#include <stdio.h>

typedef struct xxx {int ii;} XX;
  
int main(){
   XX a;
   a.ii = 1;
   *(short*)&a.ii = 0;
   printf("%d\n", a.ii);
   return 0;
}


More dangerous thing is that compilers do not always warn about it. For example, following code compiles without warnings even
when you use -Wall (including -Wstrict-aliasing). But the result changes depending on compile flags or compiler versions.
#include <stdio.h>
#include <string.h>
#include <malloc.h>
  
int main(){
   int *ii = (int*)malloc(8);
   ii[0] = 1;
   ii[1] = 2;
   float* ff = (float*)ii;
   ff[0] = 3;
   ff[1] = 4;
   printf("%d %d\n", ii[0], ii[1]);
   return 0;
}

A safer way is disabling -fstrict-aliasing compile flag. For example, you may change compile flag for midas like "-O2 -fno-strict-
aliasing".
Disadvantage is that there is a possibility that the speed is decreased.

The best way is modifying code to be in the strict aliasing rule.

Best regards
  346   23 Feb 2007 Konstantin OlchanskiInfoRFC- support for writing to removable hard disk storage
At triumf, we are developing a system to use removable hard drives to store data collected by midas 
daq stations. The basic idea is to replace storage on 300 GB DLT tapes with storage on removable 
esata, usb2 or firewire 750 GB hard drives.

To minimize culture shock, we stay as close as possible to the "tape" paradigm. Two removable disks 
are used in tandem. Data is written to the first removable disk until it is full. Then midas automatically 
switches to the second disk and asks the operator to replace the full disk with a blank disk. Similar to 
handling tapes, the operator takes the full disk and stores it on the shelf (offline); takes a blank disk 
and connects it to the computer. To read data from one of the disks, the operator takes the disk from 
the shelf and connects it to the daq computer or to some other computer equipped with a compatible 
removable storage bay. The full data disks are mounted read-only to prevent accidental data 
modifications.

Two pieces of software are needed to implement this system:

1) midas support for switching to alternate output disks as they become full. Data could be written to 
the removable disk directly by the mlogger (no extra data copy on local disks) or by the lazylogger 
(mlogger writes the data to the local disk, then the lazylogger copies it to the removable disk). Writing 
directly to the removable disk is more efficient as it avoids the one extra data copy operation by the 
lazylogger.

2) a user interface utility for mounting and dismounting removable disks. Handling of removable disks 
cannot be fully automatic: before unplugging a removable disk, the user has to inform the system; after 
connecting a removable disk, the user has to tell the system to mount it read-only (for existing data), 
read-write (to add more data) or to initialize a blank disk (fdisk+mkfs). (Also, some SATA interfaces do 
not implement automatic hot-plug: they have to be manually told "please look for new disks").

We are presently evaluating various internal SATA hot-plug enclosures. We evaluated external eSATA 
and USB2 enclosures and decided not to use them: while the performance is adequate, presence of 
extra bulky components (eSATA and USB cables, non-standardized power bricks) and the extra cost of 
eSATA and USB hard drive enclosures makes them unattractive.

I am open to suggestions and comments. I am most interested in hearing which data path (mlogger or 
the lazylogger) would be most useful for other users.

K.O.
  348   23 Feb 2007 John M O'DonnellInfoRFC- support for writing to removable hard disk storage
We stopped using tapes at Los Alamos a while ago.  The model we use is:

write data with mlogger to a local RAID system.  This is NFS mounted read only on teh analysis machines, and
becomes the working copy for most tasks.  Copy data to external hardrives.  We have been using USB.  The USB
system is sometime a little flaky (lnux 2.4.21-7, so we have a computer dedicated to this task.  The USB driver
can be reloaded, or if the user is not so knowledgeable, the copmuter can be rebooted.  users on this computer
have sudo privs, so they can format hard drives.  The disks are inserted into boxes while in use, and stored on
a shelf for data archival, so we don't have a lot of enclosures.

I use the automounter to mount and unmount the drives.  With a 10 second timeout, the user needs only to wait a
few seconds before unplugging the disk.  (cat /proc/mounts allows them to check if they want.) dmesg allows
them to find the drive letter.  This works for any device which appears later as a SCSI disk.  The automounter
manages /mnt/usb for vfat formatted devices, and /mnt/usbl for ext3 formatted devices (preferred for data
archiving).

autofs config files are:

/etc/auto.usb

# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
 
*       -fstype=auto,nosuid,nodev,umask=0000,noatime    :/dev/&

/etc/auto.usbl

# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
 
*       -fstype=auto,nosuid,nodev       :/dev/&

/etc/auto.master contains

/mnt/usb                /etc/auto.usb  --timeout=10
/mnt/usbl               /etc/auto.usbl --timeout=10


John.

> At triumf, we are developing a system to use removable hard drives to store data collected by midas 
> daq stations. The basic idea is to replace storage on 300 GB DLT tapes with storage on removable 
> esata, usb2 or firewire 750 GB hard drives.
> 
> To minimize culture shock, we stay as close as possible to the "tape" paradigm. Two removable disks 
> are used in tandem. Data is written to the first removable disk until it is full. Then midas automatically 
> switches to the second disk and asks the operator to replace the full disk with a blank disk. Similar to 
> handling tapes, the operator takes the full disk and stores it on the shelf (offline); takes a blank disk 
> and connects it to the computer. To read data from one of the disks, the operator takes the disk from 
> the shelf and connects it to the daq computer or to some other computer equipped with a compatible 
> removable storage bay. The full data disks are mounted read-only to prevent accidental data 
> modifications.
> 
> Two pieces of software are needed to implement this system:
> 
> 1) midas support for switching to alternate output disks as they become full. Data could be written to 
> the removable disk directly by the mlogger (no extra data copy on local disks) or by the lazylogger 
> (mlogger writes the data to the local disk, then the lazylogger copies it to the removable disk). Writing 
> directly to the removable disk is more efficient as it avoids the one extra data copy operation by the 
> lazylogger.
> 
> 2) a user interface utility for mounting and dismounting removable disks. Handling of removable disks 
> cannot be fully automatic: before unplugging a removable disk, the user has to inform the system; after 
> connecting a removable disk, the user has to tell the system to mount it read-only (for existing data), 
> read-write (to add more data) or to initialize a blank disk (fdisk+mkfs). (Also, some SATA interfaces do 
> not implement automatic hot-plug: they have to be manually told "please look for new disks").
> 
> We are presently evaluating various internal SATA hot-plug enclosures. We evaluated external eSATA 
> and USB2 enclosures and decided not to use them: while the performance is adequate, presence of 
> extra bulky components (eSATA and USB cables, non-standardized power bricks) and the extra cost of 
> eSATA and USB hard drive enclosures makes them unattractive.
> 
> I am open to suggestions and comments. I am most interested in hearing which data path (mlogger or 
> the lazylogger) would be most useful for other users.
> 
> K.O.
  350   26 Feb 2007 Stefan RittInfoRFC- support for writing to removable hard disk storage
In the MEG experiment, we simply installed 100TB of RAID disks and don't need to change anything Wink

But seriously, you are right that such a system might be beneficial. I propose to extend the current logger code to switch disks. In the current tr_start() funciton in mlogger, the code checks for "subdir_format" to create separate subdirectories like once per week. One could extend this code in the following way:

- Add an array of strings and name it "Path", such as

/dev/sda1/datadir/
/dev/sdb1/datadir/

- On each stop of the run, check if the current disk has enough space for one more run. Take either the "Byte limit" of that channel, or the actual size of the last run and multiply it by two or so. If the disk is "almost full", switch to the next array element in "Path". Append the file name, such as "/dev/sda1/datadir/run1234.mid" and put this into "Current filename" as a feedback for the user. Now write to the new disk/file.

- Add as string like "Execute on switch", which gets called after you switched to the next disk. This shell script can then handle the un-mounting of the full disk, notify the user etc. This is similar to the "/Programs/Execute on start run" in the ODB, but it gets only called if you switch the disk.
ELOG V3.1.4-2e1708b5