Noel Dawe | 1 Jan 2011 21:06
Picon
Picon

Re: [ROOT] Python module for easy class generation

Why not automatically place these dictionaries somewhere less invasive? Like /tmp or ~/.rootsys?

Noel

On Fri, Dec 31, 2010 at 2:22 AM, Axel Naumann <Axel.Naumann <at> cern.ch> wrote:
Hi Noel,

that's your dictionary :) You can remove it, but then ROOT will need to
regenerate it every time it needs the dictionary.

Cheers, Axel.


On 12/31/10 5:10 AM, Noel Dawe wrote:
> When using GenerateDictionary in python I end up with a lot of
> AutoDict_vector_vector_float___.cxx* garbage that is not cleaned up. I
> suppose this is an easy fix?
>
> Noel
>
> On Thu, Dec 23, 2010 at 10:33 PM, Philippe Canal <pcanal <at> fnal.gov
> <mailto:pcanal <at> fnal.gov>> wrote:
>
>     Hi Noel,
>
>     In newer version of ROOT you can simply your scripts by using
>
>        gInterpreter->GenerateDictionary("vector<vector<float> >", "vector");
>
>     which does most of the work of your make_class.
>
>     Cheers,
>     Philippe.
>
>
>     On 12/22/10 4:29 PM, Noel Dawe wrote:
>
>         For all the python fans out there I've attached a simple module
>         which may be used to generate classes in PyROOT which are not
>         available by default (like vector<vector<float> > etc.)
>
>         Example usage:
>
>         Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
>         [GCC 4.4.5] on linux2
>         Type "help", "copyright", "credits" or "license" for more
>         information.
>         >>> from classfactory import *
>         >>> make_class("vector<vector<float> >", "<vector>")
>         True
>         >>> ROOT.vector("vector<float>")()
>         <ROOT.vector<vector<float> > object at 0x2b1cf10>
>         >>> make_class("vector<TH1D>", "TH1D.h")
>         True
>         >>> ROOT.vector("TH1D")()
>         <ROOT.vector<TH1D> object at 0x2b2c160>
>         >>>
>
>         Suggestions/improvements are welcome.
>
>         Cheers,
>         Noel
>
>


Ijaz Ahmed | 2 Jan 2011 10:50
Picon
Picon

[ROOT] Root: TCanvas range

Hello ,,,

I am getting the following error, which leads to the empty histograms. ANy guess whats going on wrong with my code.
*************************
E-TCanvas::Range: illegal world coordinates range: x1=0.080000, y1=-0.131250, x2=0.080000, y2=1.181250
E-TCanvas::RangeAxis: illegal axis coordinates range: xmin=0.080000, ymin=0.000000,
xmax=0.080000, ymax=1.050000
root [1] E-TCanvas::Range: illegal world coordinates range: x1=0.080000, y1=-0.131250, x2=0.080000, y2=1.181250
E-TCanvas::RangeAxis: illegal axis coordinates range: xmin=0.080000, ymin=0.000000,
xmax=0.080000, ymax=1.050000

Ijaz Ahmed
CIIT, Islamabad
mob#+923345349527
URL: http://iahmed.web.cern.ch/iahmed

Axel Naumann | 2 Jan 2011 11:52
Picon
Picon

Re: [ROOT] Root: TCanvas range

Hi,

you have a problem with the x-axis range of whatever you try to draw,
e.g. a histogram: it "ranges" from 0.08 to 0.08. We can't help you any
further without a version of your code that we can run and that
reproduces this behavior.

Cheers, Axel.

On 1/2/11 10:50 AM, Ijaz Ahmed wrote:
> Hello ,,,
> 
> I am getting the following error, which leads to the empty histograms. ANy guess whats going on wrong with
my code.
> *************************
> E-TCanvas::Range: illegal world coordinates range: x1=0.080000, y1=-0.131250, x2=0.080000, y2=1.181250
> E-TCanvas::RangeAxis: illegal axis coordinates range: xmin=0.080000, ymin=0.000000,
xmax=0.080000, ymax=1.050000
> root [1] E-TCanvas::Range: illegal world coordinates range: x1=0.080000, y1=-0.131250,
x2=0.080000, y2=1.181250
> E-TCanvas::RangeAxis: illegal axis coordinates range: xmin=0.080000, ymin=0.000000,
xmax=0.080000, ymax=1.050000
> 
> 
> Ijaz Ahmed
> CIIT, Islamabad
> mob#+923345349527
> URL: http://iahmed.web.cern.ch/iahmed
> 
> 
> 

Axel Naumann | 2 Jan 2011 11:56
Picon
Picon

Re: [ROOT] Python module for easy class generation

Hi,

the advantage now is that users immediately see what to remove when they
want to clean up all files, e.g. when something in their class changed
and ROOT didn't detect the dependencies correctly. And I'm not sure what
happens when writing to ~/ on batch / grid nodes. PWD is usually a safe bet.

Cheers, Axel.

On 1/1/11 9:06 PM, Noel Dawe wrote:
> Why not automatically place these dictionaries somewhere less invasive?
> Like /tmp or ~/.rootsys?
> 
> Noel
> 
> On Fri, Dec 31, 2010 at 2:22 AM, Axel Naumann <Axel.Naumann <at> cern.ch
> <mailto:Axel.Naumann <at> cern.ch>> wrote:
> 
>     Hi Noel,
> 
>     that's your dictionary :) You can remove it, but then ROOT will need to
>     regenerate it every time it needs the dictionary.
> 
>     Cheers, Axel.
> 
> 
>     On 12/31/10 5:10 AM, Noel Dawe wrote:
>     > When using GenerateDictionary in python I end up with a lot of
>     > AutoDict_vector_vector_float___.cxx* garbage that is not cleaned up. I
>     > suppose this is an easy fix?
>     >
>     > Noel
>     >
>     > On Thu, Dec 23, 2010 at 10:33 PM, Philippe Canal <pcanal <at> fnal.gov
>     <mailto:pcanal <at> fnal.gov>
>     > <mailto:pcanal <at> fnal.gov <mailto:pcanal <at> fnal.gov>>> wrote:
>     >
>     >     Hi Noel,
>     >
>     >     In newer version of ROOT you can simply your scripts by using
>     >
>     >        gInterpreter->GenerateDictionary("vector<vector<float> >",
>     "vector");
>     >
>     >     which does most of the work of your make_class.
>     >
>     >     Cheers,
>     >     Philippe.
>     >
>     >
>     >     On 12/22/10 4:29 PM, Noel Dawe wrote:
>     >
>     >         For all the python fans out there I've attached a simple
>     module
>     >         which may be used to generate classes in PyROOT which are not
>     >         available by default (like vector<vector<float> > etc.)
>     >
>     >         Example usage:
>     >
>     >         Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
>     >         [GCC 4.4.5] on linux2
>     >         Type "help", "copyright", "credits" or "license" for more
>     >         information.
>     >         >>> from classfactory import *
>     >         >>> make_class("vector<vector<float> >", "<vector>")
>     >         True
>     >         >>> ROOT.vector("vector<float>")()
>     >         <ROOT.vector<vector<float> > object at 0x2b1cf10>
>     >         >>> make_class("vector<TH1D>", "TH1D.h")
>     >         True
>     >         >>> ROOT.vector("TH1D")()
>     >         <ROOT.vector<TH1D> object at 0x2b2c160>
>     >         >>>
>     >
>     >         Suggestions/improvements are welcome.
>     >
>     >         Cheers,
>     >         Noel
>     >
>     >
> 
> 

Noel Dawe | 2 Jan 2011 21:28
Picon
Picon

Re: [ROOT] Python module for easy class generation

No problem then. I've modified my "classfactory" to keep the shared libraries in ~/.rootpy/dicts (now in my LD_LIBRARY_PATH). When I request a dictionary, it first checks for the library there (using a file containing a lookup table) and loads it, otherwise it compiles it there and adds it to the lookup table. No mess left behind, no bookkeeping required by the user, and no needless regeneration of the same dictionary by future requests.

Noel

On Sun, Jan 2, 2011 at 4:56 AM, Axel Naumann <Axel.Naumann <at> cern.ch> wrote:
Hi,

the advantage now is that users immediately see what to remove when they
want to clean up all files, e.g. when something in their class changed
and ROOT didn't detect the dependencies correctly. And I'm not sure what
happens when writing to ~/ on batch / grid nodes. PWD is usually a safe bet.

Cheers, Axel.

On 1/1/11 9:06 PM, Noel Dawe wrote:
> Why not automatically place these dictionaries somewhere less invasive?
> Like /tmp or ~/.rootsys?
>
> Noel
>
> On Fri, Dec 31, 2010 at 2:22 AM, Axel Naumann <Axel.Naumann <at> cern.ch
> <mailto:Axel.Naumann <at> cern.ch>> wrote:
>
>     Hi Noel,
>
>     that's your dictionary :) You can remove it, but then ROOT will need to
>     regenerate it every time it needs the dictionary.
>
>     Cheers, Axel.
>
>
>     On 12/31/10 5:10 AM, Noel Dawe wrote:
>     > When using GenerateDictionary in python I end up with a lot of
>     > AutoDict_vector_vector_float___.cxx* garbage that is not cleaned up. I
>     > suppose this is an easy fix?
>     >
>     > Noel
>     >
>     > On Thu, Dec 23, 2010 at 10:33 PM, Philippe Canal <pcanal <at> fnal.gov
>     <mailto:pcanal <at> fnal.gov>
>     > <mailto:pcanal <at> fnal.gov <mailto:pcanal <at> fnal.gov>>> wrote:
>     >
>     >     Hi Noel,
>     >
>     >     In newer version of ROOT you can simply your scripts by using
>     >
>     >        gInterpreter->GenerateDictionary("vector<vector<float> >",
>     "vector");
>     >
>     >     which does most of the work of your make_class.
>     >
>     >     Cheers,
>     >     Philippe.
>     >
>     >
>     >     On 12/22/10 4:29 PM, Noel Dawe wrote:
>     >
>     >         For all the python fans out there I've attached a simple
>     module
>     >         which may be used to generate classes in PyROOT which are not
>     >         available by default (like vector<vector<float> > etc.)
>     >
>     >         Example usage:
>     >
>     >         Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
>     >         [GCC 4.4.5] on linux2
>     >         Type "help", "copyright", "credits" or "license" for more
>     >         information.
>     >         >>> from classfactory import *
>     >         >>> make_class("vector<vector<float> >", "<vector>")
>     >         True
>     >         >>> ROOT.vector("vector<float>")()
>     >         <ROOT.vector<vector<float> > object at 0x2b1cf10>
>     >         >>> make_class("vector<TH1D>", "TH1D.h")
>     >         True
>     >         >>> ROOT.vector("TH1D")()
>     >         <ROOT.vector<TH1D> object at 0x2b2c160>
>     >         >>>
>     >
>     >         Suggestions/improvements are welcome.
>     >
>     >         Cheers,
>     >         Noel
>     >
>     >
>
>


Sebastien Binet | 3 Jan 2011 00:26
Picon
Picon
Gravatar

Re: [ROOT] Python module for easy class generation

On Sun, 2 Jan 2011 14:28:37 -0600, Noel Dawe <Noel.Dawe <at> cern.ch> wrote:
> No problem then. I've modified my "classfactory" to keep the shared
> libraries in ~/.rootpy/dicts (now in my LD_LIBRARY_PATH). When I request a
> dictionary, it first checks for the library there (using a file containing a
> lookup table) and loads it, otherwise it compiles it there and adds it to
> the lookup table. No mess left behind, no bookkeeping required by the user,
> and no needless regeneration of the same dictionary by future
> requests.

you probably want to have a ROOT-version dependent directory.
also, in well behaved systems (ie: POSIX conformant) putting temporary
files under $TMPDIR (or with tempfile.tempdir in python) should do the
trick of not cluttering $PWD. batch systems not honouring $TMPDIR should
be fixed.

my 2 euro-cents,
sebastien.

> 
> Noel
> 
> On Sun, Jan 2, 2011 at 4:56 AM, Axel Naumann <Axel.Naumann <at> cern.ch> wrote:
> 
> > Hi,
> >
> > the advantage now is that users immediately see what to remove when they
> > want to clean up all files, e.g. when something in their class changed
> > and ROOT didn't detect the dependencies correctly. And I'm not sure what
> > happens when writing to ~/ on batch / grid nodes. PWD is usually a safe
> > bet.
> >
> > Cheers, Axel.
> >
> > On 1/1/11 9:06 PM, Noel Dawe wrote:
> > > Why not automatically place these dictionaries somewhere less invasive?
> > > Like /tmp or ~/.rootsys?
> > >
> > > Noel
> > >
> > > On Fri, Dec 31, 2010 at 2:22 AM, Axel Naumann <Axel.Naumann <at> cern.ch
> > > <mailto:Axel.Naumann <at> cern.ch>> wrote:
> > >
> > >     Hi Noel,
> > >
> > >     that's your dictionary :) You can remove it, but then ROOT will need
> > to
> > >     regenerate it every time it needs the dictionary.
> > >
> > >     Cheers, Axel.
> > >
> > >
> > >     On 12/31/10 5:10 AM, Noel Dawe wrote:
> > >     > When using GenerateDictionary in python I end up with a lot of
> > >     > AutoDict_vector_vector_float___.cxx* garbage that is not cleaned
> > up. I
> > >     > suppose this is an easy fix?
> > >     >
> > >     > Noel
> > >     >
> > >     > On Thu, Dec 23, 2010 at 10:33 PM, Philippe Canal <pcanal <at> fnal.gov
> > >     <mailto:pcanal <at> fnal.gov>
> > >     > <mailto:pcanal <at> fnal.gov <mailto:pcanal <at> fnal.gov>>> wrote:
> > >     >
> > >     >     Hi Noel,
> > >     >
> > >     >     In newer version of ROOT you can simply your scripts by using
> > >     >
> > >     >        gInterpreter->GenerateDictionary("vector<vector<float> >",
> > >     "vector");
> > >     >
> > >     >     which does most of the work of your make_class.
> > >     >
> > >     >     Cheers,
> > >     >     Philippe.
> > >     >
> > >     >
> > >     >     On 12/22/10 4:29 PM, Noel Dawe wrote:
> > >     >
> > >     >         For all the python fans out there I've attached a simple
> > >     module
> > >     >         which may be used to generate classes in PyROOT which are
> > not
> > >     >         available by default (like vector<vector<float> > etc.)
> > >     >
> > >     >         Example usage:
> > >     >
> > >     >         Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
> > >     >         [GCC 4.4.5] on linux2
> > >     >         Type "help", "copyright", "credits" or "license" for more
> > >     >         information.
> > >     >         >>> from classfactory import *
> > >     >         >>> make_class("vector<vector<float> >", "<vector>")
> > >     >         True
> > >     >         >>> ROOT.vector("vector<float>")()
> > >     >         <ROOT.vector<vector<float> > object at 0x2b1cf10>
> > >     >         >>> make_class("vector<TH1D>", "TH1D.h")
> > >     >         True
> > >     >         >>> ROOT.vector("TH1D")()
> > >     >         <ROOT.vector<TH1D> object at 0x2b2c160>
> > >     >         >>>
> > >     >
> > >     >         Suggestions/improvements are welcome.
> > >     >
> > >     >         Cheers,
> > >     >         Noel
> > >     >
> > >     >
> > >
> > >
> >
> >
Non-text part: text/html

--

-- 
#########################################
# Dr. Sebastien Binet
# Laboratoire de l'Accelerateur Lineaire
# Universite Paris-Sud XI
# Batiment 200
# 91898 Orsay
#########################################
Dr Ian Korir | 3 Jan 2011 13:30
Picon
Favicon

[ROOT] True Random Number Generator (TRNG) Versus (Pseudo-RNG) in ROOT

Dear ROOTers,

Does root have the above-mentioned feature? Is there a ROOT function to map a standard normal distribution to uniform (i.e. Z to P)?

 

Has anyone attempted to implement and test some of the activities mentioned on: http://www.psigenics.com/Research/PrdCoreRef.aspx

There is more explanations and descriptions of the same in the article, refer specifically to page 9, last paragraph proceeding to page 10. Also “OPERATIONAL DESIGN EXAMPLES” in page 12 and 13 etc.

 

Need some ideas around this. Can the Windows API be translated to Linux enviroment with ease ?……

 

Kind regards,

 

Ian

 

“As a consequence of misguided education and western technology, today’s engineering activities are swept up in a swirl of obsession with finite-difference thinking at best and at worst in blindly using large, opaque, poorly understood computer codes to resolve engineering issues.  We have therefore moribund complexities and a pathological atrophy of analytical thinking ability.  Advancements and insights come from combining analytical methods with computer evaluations.”

Dr. Wolfgang Wulff, former USNRC ACRS Member. 

 

 

 

Lorenzo Moneta | 4 Jan 2011 11:09
Picon
Picon

Re: [ROOT] 2D TEfficiency

See  http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=11858


On Dec 22, 2010, at 9:36 AM, Simone Bifani wrote:

Dear ROOTers,

I am trying to use the TEfficiency class (ROOT 5.28.00) to parametrize a trigger efficiency as a function of two variables

Unfortunately there is no TEfficiency TH2 constructor such as

    TEfficiency(const TH2& passed, const TH2& total)

but I managed to use

    TEfficiency(const char* name, const char* title, Int_t nbinsx, Double_t  xlow, Double_t  xup, Int_t  nbinsy, Double_t  ylow, Double_t  yup)


Suppose hNL1 is the TH2D histogram corresponding to the "passed" events and hDL1 to the "total" ones, I tried the following:

  TEfficiency *tEL1 = new TEfficiency("tEL1", "", hNL1->GetNbinsX(), hNL1->GetXaxis()->GetXmin(), hNL1->GetXaxis()->GetXmax(), hNL1->GetNbinsY(), hNL1->GetYaxis()->GetXmin(), hNL1->GetYaxis()->GetXmax());
  for (Int_t i = 1; i <= hNL1->GetNbinsX(); ++i) {
    for (Int_t j = 1; j <= hNL1->GetNbinsY(); ++j) {
      tEL1->GetPassedHistogram()->SetBinContent(i, j, hNL1->GetBinContent(i, j));
      tEL1->GetTotalHistogram()->SetBinContent(i, j, hDL1->GetBinContent(i, j));
    }
  }

While using CINT everything is fine, if I try to compile this lines I get the following error

   error: passing 'const TH1' as 'this' argument of 'virtual void TH1::SetBinContent(Int_t, Int_t, Double_t)' discards qualifiers

which as far as I can understand is due to the fact that GetPassedHistogram() and GetTotalHistogram() return a const object that I cannot modify


My first question is how can I solve this problem? How can I easily create a 2D TEfficiency starting from two TH2D histos?

Next, why there is no 2D TEfficiency constructor?
Moreover, even if the TEfficiency class as it is now can be used to create 2D and 3D objects, why there is only a GetEfficiency(Int_t bin) method and not GetEfficiency(Int_t binx, Int_t  biny) and GetEfficiency(Int_t binx, Int_t  biny, Int_t  binz) ones as well? I know I can use GetBin(Int_t binx, Int_t  biny, Int_t  binz) to retrieve the global bin number and this is working, but it would be handier

Last question, as I mentioned earlier when using CINT the lines I wrote are working but when I draw the 2D TEfficiency object as tEL1->Draw("colz") X and Y axis doesn't correspond to the created ones according to hNL1 but both ranges goes from 0 to 1
How is that possible?


Thanks,
s.


<simone_bifani.vcf>

helsens | 4 Jan 2011 14:49
Picon
Picon

[ROOT] Colors writing a Canvas in a root file

Dear ROOTers, 

I'm a bit desperate finding the solution to my problem, so I write you
this mail.
What I want to do is simple I guess, but I did not succeed.
I would like to keep the colors of the TH1F histos when drawing TH1F in
a TCanvas.
  TFile * m_OutputFile = new TFile("ControlPlots.root","recreate");
  m_OutputFile->cd();

  TH1F* tmpup = (TH1F*)nom->Clone();
  TH1F* tmpdo = (TH1F*)nom->Clone();

...//some operations
...

  TCanvas * ctmp = new TCanvas(cname,cname);
  ctmp->cd();

  tmpup->SetDirectory(0);
  tmpup->SetMaximum(maxH*1.2);
  tmpup->SetMinimum(minH*1.2);
  tmpup->SetLineColor(2);
  tmpup->SetMarkerColor(2);
  tmpup->Draw("HIST");

  tmpdo->SetDirectory(0);
  tmpdo->SetLineColor(4);
  tmpdo->SetMarkerColor(4);
  tmpdo->Draw("HIST SAME");

  leg->AddEntry(tmpdo, "-1#sigma","lep");
  leg->AddEntry(tmpup, "+1#sigma","lep");
  leg->Draw();
  ctmp->Write();

then in the ControlPlots.root, the colors of the two TH1F are black...
But doing 
  ctmp->Print("test.png");

gives the correct colors on the .png.
Any idea how to get the colors of the TH1 in the TCanvas in the TFile?

Thanks,
Clément

ZHU Fengrong | 5 Jan 2011 08:04
Picon
Favicon

[ROOT] index font in the axis title

Dear root users,

    About the index font I want to ask your help:

    I define a graph TGraph *gr,and I set the title of Yaxis like below:

      gr->GetXaxis()->SetTitle(" B_{#ita{y}} (GeV) "); 

     here I want to change only the font of the index y with the other fonts(italion or Roma),not the defaut 62,but 
failed to do this. For any suggestion I would apperiate  very much!        

     Thank you!

     regards,

     Fengrong Zhu


Gmane