Joosep Pata | 14 Nov 21:10 2014
Picon
Picon

Data corruption and segfault with simple Float_t TBranch

Dear experts,

I have a simple TTree consisting of Float_t and Int_t scalar branches. Upon using a particular branch in
SetBranchAddress, TTree::GetEntries segfaults in the subsequent event loop. I have a feeling this is
anomalous behaviour, as I’m able to plot the branch contents using the TBrowser, and anyway GetEntries
should not depend on which branches have been attached.

Could you please take a look and help me understand what I’m doing wrong? I’m using ROOT 5.34.21 under
OSX or SLC6.

I have attached a snippet of my data and the simple program to reproduce the behaviour. The backtraces which
are unfortunately not very informative, how can I make them better?

I’ll be happy to provide additional information.

Thank you very much in advance and best regards,
Joosep

Attachment (out.root): application/octet-stream, 239 KiB

test file: test.cc
> #include "TFile.h"
> #include "TTree.h"
> #include <iostream>
> 
> using namespace std;
> int main(void) {
> 
(Continue reading)

Adrian Sevcenco | 10 Nov 14:16 2014
Picon
Picon

InheritsFrom :: also for objects of the same class?

Hi! I want to check if some objects is of some class or is inherited
from that class.. do i have to do :
TString class_name = task->Class_Name();
task->InheritsFrom ( "cls_name" ) || class_name.EqualTo("cls_name")

or IheritsFrom is sufficient?

Thank you!
Adrian

Attachment (smime.p7s): application/pkcs7-signature, 3074 bytes
Pere Mato Vila | 7 Nov 17:27 2014
Picon
Picon

ROOT Patch Release v5.34/23

Dear ROOT users,

We are pleased to announce  the patch release ROOT version 5.34/23. For more information see the announcement in our web site.

Pere Mato on behalf of the ROOT team.
Julian Glatzer | 5 Nov 17:08 2014
Picon
Picon

Memory usage with TFile::Open

Dear All,

I was debugging the extreme memory usage of a root executable that is using TFile::Open with a
root://-style URL. For easy reproduction I am doing it now on the root command line (I assume that the same
things happen in an executable).

If I do

root [0] TFile *file=TFile::Open("root://eosatlas//eos/atlas/atlaslocalgroupdisk/dq2/rucio/user/jglatzer/99/53/user.jglatzer.4127457._000006.EE_FBFD.root")

I get memory usage of 303MB (according to top virtual memory). After this I try to close the root file with

root [1] file->Close()
root [2] delete file [I assume that strictly this line is not needed]

and the memory usage is still at 303MB. If I repeat this for every new file (or also the same file that was
already loaded) another 74MB are added to the memory usage and the memory usage does not decrease if I close
and delete the file. I first thought that maybe only a library is loaded, but the increase of 74MB per file
seems to suggest something else.

I would be happy for an explanation of why this is so (I should maybe note that the size of the root file is 2MB)
and how I can free the memory again.

I have a very similar problem with loops over TChains: I never seem to be able to go back to the memory usage
before the loop whatever objects I delete. This is unfortunately quite a problem if you loop over many
small trees.

Best wishes and thanks a lot,

Julian
Salvador Marti | 5 Nov 15:06 2014
Picon

setting a palette in PyROOT

Hi

I would like to change the palette to my own design. I have a piece of 
code that does the job in C++. Then I call
TExec *SetPalette_TrafficLights = new 
TExec("SetPalette_TrafficLights","init_MyColors(3);");

where init_MyColors() defines the colors and so on. It works.

I want to do the same in  PyROOT. This is my code:
SetPalette_TrafficLights = 
TExec("SetPalette_TrafficLights","preparePalette(3)")

but it doesn't work because it says:

input_line_468:2:3: error: use of undeclared identifier 'preparePalette'
  (preparePalette(3))

Of course, preparePalette exists.
Any idea of what I am doing wrong?

Thanks
Salva

Giovanni Siragusa | 5 Nov 10:34 2014
Picon
Picon

Merge HypotestInverterResults give strange results

Dear experts,
I'm trying to merge together several HypoTestInverterResults.

Each single workspace seems to give reasonable results, but, when I look at the merged one, I notice that something is not working properly.

I Loop on the input workspace and Add() them :
for(...){
    rtemp = dynamic_cast<HypoTestInverterResult*>( ((TFile*)object)->Get("hypo_LQ1000") );
    r->Add(*rtemp);
}

I print the value of the limits from each workspace and they seem fine.
But the merged one has "wrong" 1 and 2 sigma variations.
The strange thing is that the result is different also if I simply add one single file.

I get indeed the following error message:

[#1] INFO:Eval -- HypoTestInverterResult::Add - merging result from hypo_LQ1000 in
[#1] INFO:Eval -- HypoTestInverterResult::Add  - new number of points is 20
Error in <ROOT::Math::BrentRootFinder::Solve>: Search didn't converge
HypoTestInverterResult - interpolation failed - return inf

Could you help me understanding what I'm doing wrong?

Thanks,
G


###########################
# Output from original Workspace
###########################
The computed upper limit is: 1.09529 +/- 0.0468277
 expected limit (median) 0.968092
 expected limit (-1 sig) 0.878859
 expected limit (+1 sig) 1.4547
 expected limit (-2 sig) 0.804007
 expected limit (+2 sig) 2.02589

[#1] INFO:Eval -- HypoTestInverterResult::Add - merging result from hypo_LQ1000 in
[#1] INFO:Eval -- HypoTestInverterResult::Add  - new number of points is 20
Error in <ROOT::Math::BrentRootFinder::Solve>: Search didn't converge
HypoTestInverterResult - interpolation failed - return inf

###########################
# Output after Add()
###########################
The computed upper limit is: 0.898061 +/- 0.0354244
 expected limit (median) 0.809236
 expected limit (-1 sig) 0.369381
 expected limit (+1 sig) 1.38945
 expected limit (-2 sig) 0.15402
 expected limit (+2 sig) 2.01297


Attachment (MergeCLs.C): text/x-c++src, 4912 bytes
Vicente Jose Rives Molina | 4 Nov 15:25 2014
Picon
Picon

Using expectedEvents()

Hi,

I am trying to use the module expecteEvents().
I have a dataset that I have been able to fit using a RooAddPdf (called model) that contains an exponential function (called exponentials), an RooFFTConvPdf (called model_pi) and another RooFFTConvPdf (called model_K).
The dataset is divided into two sidebands and a signal region. What I am trying to do is find out the number of events I can expect in that signal region for each of the components of my model.
If I do:
argMass = RooArgSet(B_MM)
model.expectedEvents(argMass)

I get the expected events in the whole mass range for the whole model, but if I do:
exponentials.expectedEvents(argMass)

I get zero. I am guessing that the reason for this is that I am fitting the global model, and not the exponential function?
How do find out the contribution for each of the components of the global model?

Thank you very much,
--
Vicente J Rives Molina



perfetto | 4 Nov 09:30 2014
Picon
Picon

Get file name in a chain

Good morning to All,

I have a TChain with over 150 files (in general the files have a different
number of entries) on which I loop on all entries and fill a tree.
...
//Loop on all entries of chain
for (Long64_t jentry = 0; jentry < nentries; jentry++) {
...
Since in the tree I need to save the file name, is there a simply way to
know for each entries of the chain the file name which it belongs?

Thanks in advance for your help.

Ciao
Francesco.

Picon
Picon

RE: how to generate a random distribution

Thank you very much for your reply.
I would like to apologize if I went off the guidelines of roottalk in my question.
Best regards,
Manuel
________________________________________
From: Jacques Goldberg [jacques.goldberg <at> lingacom.com]
Sent: 03 November 2014 22:24
To: Emmanouil Ioannis Chaniotakis; roottalk (Mailing list for ROOT users.)
Subject: Re: how to generate a random distribution

Manuel

1- this is definitely not a  ROOTTALK  issue so following this mail,  if you need further help, please write to
personal addresses only, not  roottalk

2-You MUST forget any inclusion even as lower limit, of the zero SINGULARITY. See the definition of a pdf
(probability density function) in any textbook. Let me recommend to you DATA ANALYSIS FOR SCIENTISTS AND
ENGINEERS by
Stuart L. Meyer. The integrated probability , integral of the pdf,  must  be monotonic  between 0 and 1. You
CAN'T do that with a point where it would be INFINITE. The interval [0,5] is illegal.
.
3-Assume you would agree to satisfy yourself to the interval [0.1,5] for example.  You  cannot arbitrarily
set k in addition to a and b to follow a     pdf  k*x ^-2 and expect the mean nor the FWHM to  be arbitrarily  set, not
even one of them.
The mean is (Integral of x*kx^-2 over [a,b])/(b-a). The RMS formula, not to say the FWHM, is even more complicated.
If you agree to accept  it tthere is one value of k which will give the req uested mean which MUST be within t he
integration rang. Forget about more (FWHM).

4-Friendly advice: take a basic probabilities & statistics course. A t least study the book  I r ecommended.

And DROP copies to roottalk about this subject.

Jacques

On 11/03/2014 09:17 PM, Emmanouil Ioannis Chaniotakis wrote:

Thank you very much.
The range is from 0 to 5 .
However, I want the mean value and the FWHM to be specified by me.
How could I do it?
Best regards,
Manuel
________________________________________
From: Jacques Goldberg [jacques.goldberg <at> lingacom.com<mailto:jacques.goldberg <at> lingacom.com>]
Sent: 03 November 2014 20:15
To: Emmanouil Ioannis Chaniotakis; roottalk (Mailing list for ROOT users.)
Subject: Re: how to generate a random distribution

The primitive is -k/x
You did not specify the range of the variable thus  if -oo to +oo you can't proceed  nor in any range  containing x=0.
If you want the variable in a  finite range, negative or   positive but not both because of  the x=0 singularity, 
you will compute C=-k(1/b-1/a) , draw X  from a flat random and solve for x the equation X=-k/x/C because the
integral of you probability k*x^(-2)/C over interval   (a,b)  is one.

On 11/03/2014 04:35 PM, Emmanouil Ioannis Chaniotakis wrote:

Good afternoon,
I wish to generate random nrs distributed as P(x)= k*x^-2 with a specified mean.
How could I do that?
thanks,
Man

Picon
Picon

RE: how to generate a random distribution

Thank you very much.
The range is from 0 to 5 . 
However, I want the mean value and the FWHM to be specified by me.
How could I do it?
Best regards,
Manuel
________________________________________
From: Jacques Goldberg [jacques.goldberg <at> lingacom.com]
Sent: 03 November 2014 20:15
To: Emmanouil Ioannis Chaniotakis; roottalk (Mailing list for ROOT users.)
Subject: Re: how to generate a random distribution

The primitive is -k/x
You did not specify the range of the variable thus  if -oo to +oo you can't proceed  nor in any range  containing x=0.
If you want the variable in a  finite range, negative or   positive but not both because of  the x=0 singularity, 
you will compute C=-k(1/b-1/a) , draw X  from a flat random and solve for x the equation X=-k/x/C because the
integral of you probability k*x^(-2)/C over interval   (a,b)  is one.

On 11/03/2014 04:35 PM, Emmanouil Ioannis Chaniotakis wrote:

Good afternoon,
I wish to generate random nrs distributed as P(x)= k*x^-2 with a specified mean.
How could I do that?
thanks,
Man

Picon
Picon

how to generate a random distribution

Good afternoon,
I wish to generate random nrs distributed as P(x)= k*x^-2 with a specified mean. 
How could I do that?
thanks,
Manuel

Gmane