Steve Udriot | 26 May 13:37 2016

performance issue with initialisation of unuran distribution


Did anybody experience issue with the initialisation of unuran distribution? In a nutshell I am simulating a vector of double. The distribution for each element depends on the outcome of the previous one. So I need to initialise the unuran distribution for each. The performance drops significantly. Is there a way to avoid that?



Redmer Alexander Bertens | 26 May 12:13 2016

THistPainter Candle plot

Dear experts,

I have a question about the candle plot as described in the current documentation of the THistpainter.

The manual ( states:

The whiskers represent the part of the distribution not covered by the box. The upper 25% and the lower 25% of the distribution are located within the whiskers. Two representations are available.

  • A simple one (using w=1) defining the lower whisker from the lowest data value to the bottom of the box, and the upper whisker from the top of the box to the highest data value. In this representation the whisker-lines are dashed.
  • A more complex one having a further restriction. The whiskers are still connected to the box but their length cannot exceed 1.5×iqr. So it might be that the outermost part of the underlying distribution will not be covered by the whiskers. Usually these missing parts will be represented by the outliers (see points). Of course the upper and the lower whisker may differ in length. In this representation the whiskers are drawn as solid lines.

If the distribution is large enough and gaussian shaped, the maximum length of the whisker will be located at ±2.698σ (where σ is the standard deviation. In that case 99.3% of the total distribution will be covered by the box and the whiskers, whereas 0.7% are represented by the outliers.

Shouldn't this last remark ('If the distribution ... ') etc. be placed under the second bullet? I.e., doesn't the simple option (w=1) mean that the maximum length of the whiskers covers the *full* distribution rather than 99.3% of the total distribution?



Francisca Garay Walls | 19 May 18:30 2016

RooMomentMorph getVal() call increases memory a lot.


I’m trying to use the class RooMomentMorph from Root. I’m using Root version  5.34.32-HiggsComb-p1-x86_64-slc6-gcc48-opt

I need to use the RooMomentMorph class inside a loop of events. As input for the RooMomentmorph I have around 22 2D pdfs. I need to call the getVal() method from RooMomentMorph in each iteration. This call increases the memory usage a lot and when running the over the complete sample, I end up with memory problems.

Doing some local studies I came to four conclusions:

1. If I turn off everything that has to do with RooMomentMorph in my script I don’t get any issues and everything runs fine.
2. When creating the RooMomentMorph object but not calling the getVal() method I use around 3% of memory, which is the same amount of memory used on step 1. So until here, all ok.
3. When creating the RooMomentMorph object and calling the getVal() method the memory usage increases from 3% to 40% (after running over the complete sample), and the script becomes very slow. Even though, I’m calling the destructor, this just increases as the events are passing through the loop.
4. When creating the RooMomentMorph object and calling the getVal(), but setting mymorph -> useHorizontalMorphing(false); (which I don’t want to use), the memory usage is back to 3% and the script is very fast.

I understand that when using the horizontal morphing this should be slower (in fact the time increases with the amount of input pdfs), but I don’t understand is why it uses so much memory, which it looks like is somehow not deleted on each iteration even though I am deleting everything (used valgrind as well to check this).

Any help would be much appreciated.

Thanks in advance.

Best regards,

Tom Roberts | 18 May 21:21 2016

Root 6 in my program

I have a program that links with Root. All it does is read and write TNtuple-s to/from TFile-s. I've been using Root 5.34.30, but it gives some silly (but benign) error messages so I thought I'd try version 6.06.02. This is Mac OS X 10.9.5 (Mavericks), but I will do the same on Linux and Windows 7.

The library names have changed, but still, getting the required libraries is tricky, as is not referenced by any library, but is required at run time.

Once I got all required libraries into the application bundle, I get the error message below when Root is first used.

What else do I need to do to copy the necessary parts of Root into my application bundle?
For Root-5.34.30 I did not need to do anything but copy the libraries.

NOTE: I do NOT want users to have to install Root separately, and I do NOT want to copy the entire 400 MB directory (most of which is surely not used).

As this is my build account, it has ROOTSYS="$HOME/root-6.06.02", which is a complete install of Root; in general ROOTSYS will not be defined and Root will not be installed anywhere (except for the parts contained in my application bundle).

Tom Roberts

--- error message ---

ERROR in cling::CIFactory::createCI():

resource directory /Users/g4bl/G4beamline-3.04/ not found!

error: unable to read PCH file /Users/g4bl/G4beamline-3.04/ 'No such file or directory'

fatal error: malformed or corrupted AST file: 'Unable to load module "/Users/g4bl/G4beamline-3.04/": module file not found'

input_line_3:1:10: fatal error: 'Rtypes.h' file not found

#include "Rtypes.h"

p, li { white-space: pre-wrap; }

Note the application bundle is in /Users/g4bl/G4beamline-3.04/
It has executables in Contents/bin and libraries in Contents/lib; executables and .so-s have been linked and/or modified to use <at> rpath to find the libraries (DYLD_LIBRARY_PATH is going away). Any non-system .so referenced by any file in bin or lib has been copied into lib and modified to use <at> rpath.

Heberth Torres | 13 May 23:11 2016

RooFit - Plotting RooDataHist with variable binning


When a RooDataHist with variable binning is plotted, the bin contents get “corrected” for the bin
width if the Poisson error option is used, but this is not done if the SumW2 option is used. Is there a way to
force the “correction” to be applied when using SumW2?


Axel Naumann | 10 May 14:43 2016

ROOT Patch Release v6.06/04


We have released ROOT v6.06/04.

It patches a few issues found in our 6.06 release - thank you for
reporting them! See
<> for
the details.

Downloads and AFS location are at

Best regards,
Axel, on behalf of the ROOT team

PH-SFT, CERN, 1211 Geneve 23, Switzerland
Tel: +41 22 7678225

Micah Buuck | 10 May 00:04 2016

Problem with Drawing large TTrees on certain architectures

Hi ROOTers,

I am having a problem with using TTree::Draw and TTree::GetV1 (and V2, V3) with sufficiently large trees. I have created a short script that reproduces the problem on both Scientific Linux 6.4 and OSX 10.11.4.

Basically, when I ask for a large enough selection on the tree (in the example, it's the whole tree) and then try to access the branch values using GetV1/2/3, the values in the returned arrays get corrupted, and the arrays are apparently not the correct length. This happens at lengths much shorter than std::numeric_limits<Long64_t>::max() which is the default for the nentries argument in TTree::Draw.

Am I using these methods correctly?

Here's the code, and I'm attaching it as a .C file as well:

   TTree t1("t1","a simple Tree with simple variables");
   Float_t px, py, pz;
   //fill the tree
   size_t length = 4001793;
   //if length>1000000 then the printed values of px, py, pz  and V1, V2, V3 do
   // not match, and V1[n-1] is nonsense. On Scientific Linux 6.4, if
   // length>1132542, then V1[n-1] causes a segfault instead of printing
   // nonsense. On OSX 10.11.4 (15E65) length>4001792 causes a segfault. I have
   // replicated this behavior on Root 6.06/02 on both Scientific Linux 6.4 and
   // OSX 10.11.4 (15E65).
   for (Int_t i=0;i<length;i++) {
     pz = px*px + py*py;
     if(i<1) cout << "i = " << i << ", px = " << px << ", py = " << py << ", pz = " << pz << endl;
   size_t n=t1.Draw("px:py:pz","","GOFF");
   cout << n << " entries returned." << endl;
   Double_t* V1 = t1.GetV1();
   Double_t* V2 = t1.GetV2();
   Double_t* V3 = t1.GetV3();
   cout << "V1[0] = " << V1[0] << ", V2[0] = " << V2[0] << ", V3[0] = " << V3[0] << endl;
   cout << "Last V1 entry: " << V1[n-1] << endl;

Thanks for any help,

Micah Buuck
Graduate Student
(206) 543-4035

Center for Experimental Nuclear Physics and Astrophysics
Box 354290
University of Washington
Seattle, WA 98195
Attachment (BigTreeTest.C): text/x-csrc, 1568 bytes
Francisca Garay Walls | 4 May 19:33 2016

RooMomentMorph generate dataset problem.


I’m in need to use the RooMomentMorph class of Root and I’m having some problems.
I’m using Root version 5.34.32-HiggsComb-p1-x86_64-slc6-gcc48-opt.

I’m trying to figure out how to generate a dataset from the RooMomentMorph.
I did a very simple example with two RooGaussian that I gave to RooMomentMorph as input and then I generate a dataset:

mymorph->generate(x,10); For 10 events.

This works fine without any problem.

But If I do this same example, but now the input pdfs are 2 dimensional (product of 2 gaussian for two different observables) and I call the generate method:

mymorph2D -> generate(obs,10); (obs is a RooArgSet with two RooRealVars)

I get a bunch of evaluate errors like this:

--- RooGenContext --- 
Using PDF RooMomentMorph::mymorph2[ m=m4l varList=(mZ1,mZ2) pdfList=(p1,p2) ]
Use PDF generator for ()
Use MC sampling generator RooFoamGenerator for (mZ1,mZ2)
[#0] ERROR:Eval -- RooAbsReal::logEvalError(p1_pdf_0) evaluation error, 
 origin       : RooProdPdf::p1_pdf_0[ gauss_mZ1_pdf_0 * gauss_mZ11_pdf_0 ]
 message      : p.d.f value is Not-a-Number (-nan), forcing value to zero
 server values: !pdfs=(gauss_mZ1_pdf_0 = 0/-nan,gauss_mZ11_pdf_0 = 0/-nan)
[#0] ERROR:Eval -- RooAbsReal::logEvalError(p2_pdf_1) evaluation error, 
 origin       : RooProdPdf::p2_pdf_1[ gauss_mZ2_pdf_1 * gauss_mZ22_pdf_1 ]
 message      : p.d.f value is Not-a-Number (-nan), forcing value to zero
 server values: !pdfs=(gauss_mZ2_pdf_1 = 0/-nan,gauss_mZ22_pdf_1 = 0/-nan)

Here is my simple 2D example:

  TVectorD ref_points(2);
  ref_points(0) = 300.;
  ref_points(1) = 320.;

  RooRealVar * m4l = new RooRealVar("m4l","m4l",300.,130.,510.);

  RooRealVar * mZ1 = new RooRealVar("mZ1","mZ1",90., 0., 120.);
  RooRealVar * mZ2 = new RooRealVar("mZ2","mZ2",90., 0., 120.);

  RooArgSet* obs = new RooArgSet(*mZ1, *mZ2);

  RooRealVar * mZ_1 = new RooRealVar("mZ_1","mZ_1",90.,0., 120.);
  RooRealVar * mZ_2 = new RooRealVar("mZ_2","mZ_2",92.,0., 120.);
  RooRealVar * sigmaZ_1 = new RooRealVar("sigmaZ1","sigmaZ1", 0.2, 0., 1.0);
  RooRealVar * sigmaZ_2 = new RooRealVar("sigmaZ2","sigmaZ2", 0.3, 0., 1.0);
  RooGaussian gauss_mZ1("gauss_mZ1", "gauss1",*mZ1,*mZ_1,*sigmaZ_1);
  RooGaussian gauss_mZ2("gauss_mZ2", "gauss2",*mZ1,*mZ_2,*sigmaZ_2);

  RooGaussian gauss_mZ11("gauss_mZ11", "gauss11",*mZ2,*mZ_1,*sigmaZ_1);
  RooGaussian gauss_mZ22("gauss_mZ22", "gauss22",*mZ2,*mZ_2,*sigmaZ_2);

  RooProdPdf p1("p1","p1", RooArgSet(gauss_mZ1,gauss_mZ11));
  RooProdPdf p2("p2","p2", RooArgSet(gauss_mZ2,gauss_mZ22));

  RooMomentMorph * mymorph2  = new RooMomentMorph("mymorph2","mymorph2", *m4l, *obs, RooArgSet(p1,p2),ref_points,RooMomentMorph::Linear);


  RooDataSet* d2 = mymorph2->generate(*obs,1,Verbose(true)) ;

Any suggestion or help is welcome.

Thanks in advance.

Best regards,

Philip Adsley | 28 Apr 11:22 2016



I have what is almost certainly a stupid question but I just wanted to check that I'm correct about something.

I've been asked by a student about using the TF1Convolution class. She's having a problem compiling an example code.

I think that she's using ROOT 5.34. Am I correct in thinking that the TF1Convolution class is not implemented until ROOT 6.04?

I'm trying to work out if we will need to update her version of ROOT if she wants to use TF1Convolution or just to recompile using FFTW3. I think that it's the former but would like confirmation of the same.


Dr Philip Adsley MA MSci (Cantab)
Postdoctoral Research Fellow, University of Stellenbosch/iThemba LABS
jpata | 28 Apr 10:42 2016

TBrowser/root.exe on NFS

Dear root experts,

I run root on a networked file system (NFS), I'd like to prevent the ROOT TBrowser from scanning various
parent directories when building the drop-down tree on the left hand side of the GUI. This can be very slow
and puts unnecessary load on the NFS.

In particular, I start root like this:
> $ cd /mnt/t3nfs01/data01/shome/jpata/tth/sw-76/CMSSW/src
> $ root ~/tth/gc/projectSkim/GC1bd0e97dd70d/ttHTobb_M125_13TeV_powheg_pythia8.root
> $ root [0] TBrowser b;

which then hangs midway through creating the GUI. If I do an strace on the root.exe process, I see that it
scans loads of top-level folders and finally hangs:

> lstat("mwang", {st_mode=S_IFDIR|0755, st_size=25, ...}) = 0
> chdir("/mnt/t3nfs01/data01/shome/jpata/tth/sw-76/CMSSW/src") = 0
> getcwd("/mnt/t3nfs01/data01/shome/jpata/tth/sw-76/CMSSW/src", 8192) = 52
> chdir("/mnt/t3nfs01/data01/shome")      = 0
> lstat("martinelli_f_test", ^C <unfinished ...>

In summary: how can I restrict TBrowser to scan only the subfolders of the pwd?

Kindly keep in cc my colleagues: giorgia.rauco <at>, fabio.martinelli <at>

Thanks a lot, cheers,
Joosep Pata
(on behalf of the T3_CH_PSI site support)
Nick van Eijndhoven | 23 Apr 02:56 2016

Bayesian blocks

I would like to ask whether there exists within ROOT a facility to obtain
a variable binned histogram based on a Bayesian blocks analysis from an input spectrum.
I couldn't find it in TSpectrum, but maybe it is available via some other class.


Sent from Gmail Mobile