Nicolas Produit | 1 Dec 2011 09:50
Picon
Picon
Favicon

[ROOT] fitresult

Hi,

I am fitting a function that has some symmetry
to be specific:
Double_t fitval = par[0]*(1 + 
par[1]*TMath::Cos((2.*TMath::Pi()/180.)*(x[0]-par[2])));
you can see that solution with par[1]<0 are identical to solution with 
par[1]>0 but par[2]=par[2]+90
par[2] is also 180 degree periodic so fitter sometimes find solution in 
periods.
I tried without success to tell the fitter to avoid par[1]<0 solutions.
(TF1: setparameterlimit)

Anyway, I can normalize by hand the final solution to the "canonical 
one". I want the canonical solution to be displayed as the result of the 
fit.

I find no way to convince root to show my canonical solution in the fit 
result box. I can do a TF1 set Parameters() on the fit result function 
but it seems that the fit box insist to display the original fit values.

Can you tell me how to achieve this?

Cheers

--

-- 
Nicolas Produit
ISDC, Data Centre for Astrophysics   Phone:+41 22 379 2140
16, Chemin d'Ecogia                  Fax:  +41 22 379 2133
CH-1290 Versoix                      www:  http://isdc.unige.ch/~produit
(Continue reading)

Sébastien Gadrat | 1 Dec 2011 12:00
Picon
Picon
Favicon

Re: [ROOT] Problem compiling ROOT v5.32.00-rc2 with Python 2.6.4

Dear all,

Sorry for the missing information, and thank you for your quick and 
useful replies !

Your replies helped me to find out what was wrong with the compilation. 
As Win suggested, the problem was because ROOT was using a static 
library to compile ! However there is a libpython.so lib on my system, 
but after checking the log file made at the configure step, I found out 
that ROOT did not find it, and then use a .a lib found in some other place.

The dynamic python lib is there:
$ ls /usr/local/python/python-2.6/lib/
libpython2.6.so      librpm.la  librpm.so.0      librpmbuild.la  
librpmbuild.so.0      librpmio.la  librpmio.so.0
libpython2.6.so.1.0  librpm.so  librpm.so.0.0.0  librpmbuild.so  
librpmbuild.so.0.0.0  librpmio.so  librpmio.so.0.0.0

However, for some reason, ROOT does not check this directory, and 
finally finds a .a lib:

   Found file 
/usr/local/python/python-2.6/lib/python2.6/config/libpython2.6.a
Checking if 
/usr/local/python/python-2.6/lib/python2.6/config/libpython2.6.a is a 
64-bit library
  objdump -a 
/usr/local/python/python-2.6/lib/python2.6/config/libpython2.6.a | grep 
'x86-64'
  result: 1
(Continue reading)

wlavrijsen | 1 Dec 2011 17:21
Favicon

Re: [ROOT] Problem compiling ROOT v5.32.00-rc2 with Python 2.6.4

Sebastien,

> However, for some reason, ROOT does not check this directory

yes, the code isn't particularly smart: it simply checks a list of known
standard locations (the pythonx.y/config used to be the proper location
for p2.2 and earlier; I haven't seen python/python-2.6/lib until now).

Best regards,
            Wim
--

-- 
WLavrijsen <at> lbl.gov    --    +1 (510) 486 6411    --    www.lavrijsen.net

Marc Escalier | 2 Dec 2011 00:51
Picon
Picon

Re: [ROOT] problem of changing parameter of a TF1

Hi,

somebody investigated the problem. It seems that there is no link with 
roofit actually...

The preliminary conclusion would be (?) that :
(i put conditional everywhere : so if an author of root could confirm 
(or say the opposite), it would help)

when one does a fit on a TH1 and save the histo to a root file, there 
would be (?) no more possibility to "directly" rescale the function 
associated to the histogram.

so that the only possibility (?) if one has done a fit of an histogram and 
saved it to a .root file, and would like to rescale it afterwards would be (?)
  the painful procedure of :

i) read the individual parameters of the function associated to the TH1 in the root file
ii) create a new TF1 and copy the previous parameters to this new function
iii) change the normalization of the function
iv) change the normalization of the histogram
v) delete the initial function associated to the histogram (that do not 
follow the rescaling) because it seems (?) that there is no way to draw 
a histogram that has a function associated to it without drawing the fit 
associated ?

Could you tell my mistakes in the previous attempt of understanding ?

Are there special tricks ?

(Continue reading)

Andrea Massironi | 2 Dec 2011 19:01
Picon
Picon

[ROOT] TTree and GetV1, limit in number of entries

Dear ROOTers,

    I have a problem with the use of the method "GetV1()" of the class TTree.
It seems that it returns at most 1M entries.

Example code:

TTree tree("tree","tree");
double var1;
tree.Branch("var1",&var1,"var1/D");

for (int i=0; i<3000000; i++){ var1 = 1.;  tree.Fill();}

tree.Draw("var1","","goff");
Double_t *vect1 = tree.GetV1();

int nEntries = tree.GetEntries();
for (int iEntry = 0; iEntry<nEntries; iEntry++){
 if (!(iEntry%100000)) {
  std::cout << "v1[" << iEntry << "] = " << vect1[iEntry] << "  ---  " << std::endl ;
 }
}


Output:

v1[0] = 1  --- 
v1[100000] = 1  ---
...
v1[900000] = 1  --- 
v1[1000000] = 0  --- 
v1[1100000] = 5.94459e-312  --- 
v1[1200000] = 3.63742e+233  --- 
 *** Break *** segmentation violation


Is there a workaround to deal with this apparent limitation?

Thanks,
    Andrea



Fons Rademakers | 2 Dec 2011 19:11
Picon
Picon

[ROOT] ROOT Production Release 5.32/00

We are pleased to announce the winter production release of ROOT version 
5.32/00. For more information see the announcement at: 
http://root.cern.ch/drupal/content/production-release-53200

And enjoy the coming holiday season.

Fons Rademakers on behalf of the ROOT team.

--

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers <at> cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640

Attachment (smime.p7s): application/pkcs7-signature, 4171 bytes
Andrea Massironi | 2 Dec 2011 19:14
Picon
Picon

[ROOT] Re: TTree and GetV1, limit in number of entries

Sorry for the spam.

Answer found:
http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=3419

thanks,
    Andrea



On 12/02/2011 07:01 PM, Andrea Massironi wrote:
Dear ROOTers,

    I have a problem with the use of the method "GetV1()" of the class TTree.
It seems that it returns at most 1M entries.

Example code:

TTree tree("tree","tree");
double var1;
tree.Branch("var1",&var1,"var1/D");

for (int i=0; i<3000000; i++){ var1 = 1.;  tree.Fill();}

tree.Draw("var1","","goff");
Double_t *vect1 = tree.GetV1();

int nEntries = tree.GetEntries();
for (int iEntry = 0; iEntry<nEntries; iEntry++){
 if (!(iEntry%100000)) {
  std::cout << "v1[" << iEntry << "] = " << vect1[iEntry] << "  ---  " << std::endl ;
 }
}


Output:

v1[0] = 1  --- 
v1[100000] = 1  ---
...
v1[900000] = 1  --- 
v1[1000000] = 0  --- 
v1[1100000] = 5.94459e-312  --- 
v1[1200000] = 3.63742e+233  --- 
 *** Break *** segmentation violation


Is there a workaround to deal with this apparent limitation?

Thanks,
    Andrea




OKUMURA, Akira | 4 Dec 2011 07:36
Picon

[ROOT] Can TPad::AddExec call a method in PyROOT?

Hello ROOTers,

I would like to know if I can call a method of a Python class from TPad::AddExec. How can I do it?

I wrote a Python class which has a TCanvas as a member, and a method which is intended to do some calculations
according to the mouse cursor position, as in $ROOTSYS/tutorials/pyroot/DynamicSlice.py

The tutorial uses TPython::Exec, but it is not clear for me to call the class method in the same way.

--------------
class MyClass(object):
    def __init__(self):
        self.can = ROOT.TCanvas()
        self.can.AddExec('dynamic', ???) # how to call self.doSomething ?

    def doSomething(self):
        # do something according to the mouse position
--------------

Regards,

--
OKUMURA, Akira oxon <at> mac.com, okumura <at> stelab.nagoya-u.ac.jp
Solar-Terrestrial Environment Laboratory, Nagoya University
Furo-cho, Chikusa-ku, Nagoya 464-8601, Japan
TEL: +81 52-789-4320 FAX: +81 52-789-4313
Skype : okumura.akira


Gmane