"Fossies" - the Fresh Open Source Software archive

Member "root-v5-34-00-patches/hist/doc/v524/index.html" of archive root_v5.34.08.source.tar.gz:


<br> 
<hr> 
<a name="hist"></a> 
<h3>Histogram package</h3>


<h4>TPaletteAxis</h4>
<ul>
<li> New method <tt>Int_t TPaletteAxis::GetValueColor(z)</tt> to
     return the color index of the given z value.
     <br>
     This function should be used after an histogram has been plotted with the
     option COL or COLZ like in the following example:
     <pre>
       h2->Draw("COLZ");
       gPad->Update();
       TPaletteAxis *palette =
          (TPaletteAxis*)h2->GetListOfFunctions()->FindObject("palette");
       Int_t ci = palette->GetValueColor(30.);
     </pre>
     Then it is possible to retrieve the RGB components in the following way:
     <pre>
       TColor *c = gROOT->GetColor(ci);
       float x,y,z;
       c->GetRGB(x,y,z);
     </pre>
     This function is used by <tt>TPaletteAxis::GetBinColor()</tt>.
</li>
</ul>

<h4>TAxis</h4>
<ul>
  <li>Implement a new function, <tt>TAxis::GetBinCenterLog(Int_t bin)</tt>, as suggested at the issue <a href="http://root.cern.ch/phpBB2/viewtopic.php?t=8263">#8263</a>. 
  </ul>

<h4>TGraph</h4>
<ul>
<li> When adding an object in the list of functions of a <tt>TGraph</tt>,
     there was a crash at the <tt>TGraph</tt> drawing time if the
     fitting option (<tt>gStyle->SetOptFit(1)</tt>) was on. This was
     reported in: https://savannah.cern.ch/bugs/?46525
     The following macro reproduces the problem:
     <pre>
     {
        gStyle->SetOptFit(1);
        TGraph *gr = new TGraph(2);
        gr->SetPoint(0,1,1);
        gr->SetPoint(1,2,2);
        TLatex *l1 = new TLatex(gr->GetX()[0], gr->GetY()[0], "#1");
        gr->GetListOfFunctions()->Add(l1);
        gr->Draw("APL");
     }
     </pre>
</li>
<li>Fixed  the bug <a href="https://savannah.cern.ch/bugs/?45607">#45607</a> by creating a list of functions when using TGraph default constructor.
<li>Fixed a bug when fitting TGraphErrors with zero error in y but non-zero error in x
</li>
<li> In GetHistogram: 
   if fHistogram exists, and the log scale is on, and the computed range minimum is > 0, and
   the fHistogram minimum is zero, then it means fHistogram limits have been computed
   in linear scale therefore they might be too strict and cut some points. In that
   case the fHistogram limits should be recomputed ie: the existing fHistogram
   should not be returned. A example covering this case has been added in
   stressGraphics.
</li>
</ul>

<h4>TH1</h4>
<ul>
 <li>Speed up <tt>TH1::GetStats, TH2::GetStats, TH3::GetStats</tt> in case the sum of weights is null and the number of entries is also null
  <li>Optimize the way the function integral is computed in <tt>TH1::FillRandom</tt>
  <li>Add new functions <tt>TH1::IsBinUnderflow(bin)</tt> and <tt>TH1::IsBinOverflow(bin)</tt> which use the global bin number.
  <li>Add new functions <tt>Int_t TH1::FindFirstBinAbove(Double_t threshold, Int_t axis)</tt> and <tt>Int_t TH1::FindLastBinAbove(Double_t threshold, Int_t axis)</tt> which find first (and last) bin with the content above the given threshold. Same function have been added in TH2 and TH3.  
  <li>Add a protection in TH1::Sumw2() to avoid calling GetBinContent when the histograms are empty.
  <li>In TH1::Copy reset temporarily the kCanRebin bit before calling SetBinContent.
  <li>Fix the bug <a href="https://savannah.cern.ch/bugs/?48649">#48649</a>in TH1::Add.
  <li>Fix a bug when calling TH1::Sumw2() on a non-empty histogram with default sum2 (i.e when TH1::GetDefaultSumw2() is true).
  <li>Add a method, <tt>TH1::ResetStats()</tt> to reset the internal statistics and force then the re-calculation suing the bin center first time is needed
  <li>Fix some problem with the statistics (in particular the number of entries)  after some of the histogram operations
 
  </ul>

<h4>TH2</h4>
<ul>
  <li>Consider in the projection of TH2 the axis range set by the user. This fix the issue https://savannah.cern.ch/bugs/index.php?47946
  <li>Add a new option,  option "o", in the projection methods: <tt>TH2::ProjectionX</tt>, <tt>TH2::ProjectionY</tt>, <tt>TH2::ProfileX</tt> and <tt>TH2::ProfileY</tt>. When an axis range is set, using option "o", the original axis range of the taget axes will be
   kept, but only the bins inside the selected range will be filled, while bins outside the range will be empty. 
</ul>  

<h4>TH3</h4>
<ul>
 <li>Add implementation of <tt>TH3::Interpolate</tt> using a tri-linear interpolation method</li>
  <li>Fix a bug in TH3::Project3D (https://savannah.cern.ch/bugs/?46432) for the error calculation in case of weighted histogram (or when using option "E") and no axis range is set.
</li>
<li>In the projection to Profile's, when Sumw2 is set, have the correct projected errors now with the new TProfile data member.
<li>Add <tt>TH3::ProjectionX</tt> and TH3::ProjectionY</tt> to complement the already existing ProjectionZ. They are all impelmented using the Project3D method.
<li>Re-implement the <tt>TH3::Project3D</tt> method using the internal methods  DoProject1D and DoProject2D depending on the option. This new implementation is faster in case sub-ranges are selected and fix this issue (https://savannah.cern.ch/bugs/index.php?45494).
<li>A similar new implementation is done for <tt>TH3::ProjectProfile</tt>.
<li>Add the new option "o", as in <tt>TH2</tt> for the histogram and profile projections.
</ul>

<h4>TProfile, TProfile2D, TProfile3D</h4>
<ul>
  <li>Add a new data member (TArrayD fBinSumw2) for storing the sum of weight square per bin. This is needed for correct error calculation in case of profile filled with weights different than 1. The new structure is filled only when TProfile::Sumw2() is called or when TH1::SetDefaultSumw2() is set.
  <li>Add a new internal class, <tt>TProfileHelper</tt> for providing a common implementations for all TProfile classes for complex methods like Add and Merge.
  <li>Fix a bug in  <tt>TProfile::GetStats</tt> method.
  </li>
  
</ul>

<h4>THnSparse</h4>
<ul>
  <li>Fix a bug where the axes of a THnSparse created by THnSparse::Projection() would be filled wrongly if the axis's range was set.
  <li>Fix a bug where the TAxis::kAxisRange bit was not reset for the new TH1/2/3 axes created by THnSparse::Projection(), if the original axis had a range and "A" was not given.
  <li>Implement new option "O" for Projection(): respect the range set for the target axis (i.e. only project bins that are in range) but create the target histogram with the full axis.
  <li>Fix a bug in the multiplication of THnSparse. 
  <li>Fix a bug whe creating with a given set of axis. Ensure that the first bin of the axis is >= 1.
  </ul>

<h4>THistPainter</h4>
<ul>
<li> In case the errors of the fit parameters had large values (>E+07) the
     errors in the fit box looked weird. The Method GetBestFormat has been
     changed. The problem was visible with the following macro:
<pre>
     {
        gStyle->SetOptFit(1111);
        h = new TH1F("h","h", 2,0.,1.);
        h->SetBinContent(1, 5E8);
        h->SetBinError(1, 4.9E8);
        h->Fit("pol0");
     }
</pre>
</li>
<li> In <tt>THistPainter::PaintAxis</tt> repainting (<tt>gPad->RedrawAxis()</tt>)
     alphanumeric labels axis on a plot done with the option HBAR (horizontal)
     needed some adjustements. The following macro showed the problem. The
     axis labels were wrongly painted:
<pre>
     {
        TCanvas* canvas = new TCanvas("Canvas", "Canvas", 0, 0, 1000, 500);
        canvas->Divide(2,1);
        THStack* stack = new THStack("Stack", "StackTitle");
        TH1F* hist1 = new TH1F("Hist1", "Title1", 1, 0, 100);
        TH1F* hist2 = new TH1F("Hist2", "Title2", 1, 0, 100);
        hist1->SetFillColor(kBlack);
        hist2->SetFillColor(kGray);
        for (int i = 0; i < 4; ++i) {
           char dataName[50];
           sprintf(dataName, "Data%d", i);
           hist1->Fill(dataName, 10 + 50*i);
           hist2->Fill(dataName, 145 - 40*i);
        }
        stack->Add(hist1);
        stack->Add(hist2);
        canvas->cd(1); stack->Draw("nostack,bar");
        canvas->cd(2); stack->Draw("nostack,hbar");
     }
</pre>
</li>
<li> In <tt>THistPainter::PaintTriangles</tt> if the option SAME is used, the
     view limits are taken from the current TView.
</li>
</ul>

<h4>TGraphPainter</h4>
<ul>
<li> The painting option "][" did not work if the frame line width
     (set with gStyle->SetFrameLineWidth()) was bigger than 1.
<li> The clipping in case of option "same" was not correct since 
     the move from TGraph to TGraphPainter. The following small example
     showed the problem:
     <pre>
        {
           TH1F * h1 = new TH1F("h1", "h1", 100, -3., 3.);
           TH1F * h2 = new TH1F("h2", "h2", 100, -3., 3.);
           h1->FillRandom("gaus", 5000);
           h2->FillRandom("gaus", 4000);
           h1->SetMaximum(100);
           h1->Draw();
           h2->Draw("same");  
        }
     </pre>
</li>
<li> In some case, when a graph had some  vertical parts, the exclusion
     zone was not drawn correctly. The following small example shows the 
     problem:
     <pre>
        {
            TCanvas *c1 = new TCanvas();
            gPad->DrawFrame(-1,-1,3,3);
      
            TGraph * graph=new TGraph(3);
            graph->SetFillColor(3);
            graph->SetFillStyle(3001);
            graph->SetLineWidth(2000);
      
            graph->SetPoint(0,1.,1.);
            graph->SetPoint(1,1.,0);
            graph->SetPoint(2,0.,0.);
            graph->Draw("*L");
         }
     </pre>
</li>
</ul>

<h4>TUnfold</h4>
<ul>
<li>Add a new version. A new class <tt>TUnfoldSys</tt> provides support for the propagation of systematic errors.
<li>  Some bugs were also fixed due to multiplication of addition of sparse matrices.
</ul>

<h4>Fitting Methods</h4>
<ul>
  <li>Introduce a better treatment of the step size used when fitting an object with a TF1. Use now by default is not zero the error provided by TF1. In case of limits use an appropriate step size to avoid Minuit to go over the limits.
  <li>Fix bug https://savannah.cern.ch/bugs/?45909  when fitting with bad range values (outside the histogram range). 
<li> detect the case when the data set is empty and don't perform any minimizationin this case but exits from fitting and produce a warning message
  <li>Fix a bug when fitting histograms with option W and the bin errors are = 0. 
 <li>Fix a bug in the InitGaus function when having only one data point (see https://savannah.cern.ch/bugs/?48936)
  <li>Fix a bug in calculating the error on the integral after having fitted when fix parameters were present
  <li>Fix a bug in calculating the confidence intervas when the number of bins for the given object is different from the number of bins of the fitted object.   
  </ul>

  <h4>FitPanel</h4>
  <ul>
    <li>Add support for drawing the fit function confidence levels.
    <li>Make gaus the default function when fitting 1D objects.
    <li>Add GSL minimizer and use now a new widget for showing and selecting the list of available algorithms according to the minimizer.
 </ul>