Log of /trunk/hist/hist/src/TGraph2D.cxx
Parent Directory
Revision
48282 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jan 14 13:54:27 2013 UTC (2 years ago) by
moneta
File length: 51195 byte(s)
Diff to
previous 48234
clean up the parsing of the fit option in TH1::Fit and TGraph::Fit
add new option "P" (pearson chi square) for using expected error instead of observed one when fitting
Fix a bug for the case of parameter limits (defined in TF1): [-inf,b] or [a, +inf]
Revision
44507 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 4 12:30:41 2012 UTC (2 years, 7 months ago) by
axel
File length: 50611 byte(s)
Diff to
previous 44213
Remove
using namespace std;
from Riostream.h, which has huge consequences for all of ROOT.
Riostream.h is now a simple wrapper for fstream, iostream, iomanip for backward compatibility; Riosfwd.h simply wraps iosfwd.
Because of templates and their inline functions, Riostream.h needed to be included in headers, too (e.g. TParameter.h), which violated the assumption that Riostream.h is not exposing its using namespace std to headers.
ROOT now requires R__ANSISTREAM, R__SSTREAM, which does not change the set of supported compilers.
Without "using namespace std", several identifiers are now prefixed by std::; e.g. roofit/* source files now have a using namespace std to keep their coding style.
TFile::MakeProject() now generates "using namespace std" to convert the CINT-style class names into C++ ones.
Revision
44213 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu May 10 09:08:22 2012 UTC (2 years, 8 months ago) by
moneta
File length: 50556 byte(s)
Diff to
previous 44011
apply several fixes found by Coverity
In particular fix assignment operators (Copy) in TH1 and TGraph classes for memory leaks
Revision
41116 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 4 13:20:16 2011 UTC (3 years, 3 months ago) by
couet
File length: 50056 byte(s)
Diff to
previous 41115
The constructor from a file is now able to handle delimiters. Like in the .csv files. (Implementation done by Mathieu Trocme)
Revision
32878 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 2 15:38:54 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 45211 byte(s)
Diff to
previous 32105
TH1::Streamer and TGraph2D::Streamer no longer reset the kCanDelete bit directly so that the user can give
ownership of the object to the canvas they are stored with. However, if they are saved on their own, the mechanism
that associates them to the current directory (DirectoryAutoAdd) will now reset the bit to avoid any possible
ownsership confusion.
This fixes the report 23481 in Savannah.
Revision
32105 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jan 25 10:46:20 2010 UTC (4 years, 11 months ago) by
couet
File length: 45177 byte(s)
Diff to
previous 31645
- In case all the points are in the same Z-plane Z0, the fHistogram
minimum is set to Z0-0.01*Z0 and the maximum to Z0+0.01*Z0. This
allow to make TGraph2d like:
{
double *x = new double[2];
double *y = new double[2];
double *z = new double[2];
x[0] = 6215.;
x[1] = 5542.;
y[0] = 3853.;
y[1] = 5270.;
z[0] = 2723.;
z[1] = 2723.;
TGraph2D * g = new TGraph2D(2, x, y, z);
g->Draw("LINE");
}
Revision
31491 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 1 18:11:55 2009 UTC (5 years, 1 month ago) by
moneta
File length: 45047 byte(s)
Diff to
previous 31362
Merge the changes from David in the dev branch (up to rev 31490) to return the TFitResultPtr from the Fit methods of
TGraph, TGraph2D, TMultiGraph, THnSparse
Revision
31207 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Nov 16 16:52:00 2009 UTC (5 years, 2 months ago) by
moneta
File length: 43835 byte(s)
Diff to
previous 28183
merge from https://root.cern.ch/svn/root/branches/dev/mathDev/hist/hist up to revision 31170
from David and myself
Summary of major changes:
- TFitResult, TFitResultPtr
- add new class TFitResult which extend FitResult with TNamed for the I/O. The result of the fit , including covariance and correlation matrix, minos errors, etc... can then be stored in a file
- add a class TFitResultPtr which behaves like a pointer to TFitResult and can be converted to an integer. This class is now returned by TH1::Fit and TGraph::Fit. By default the class contains only the returned integer status of the fit. If option "S" is used the class contains a pointer to TFitResult which can be retrieved using the -> or * operators (like a smart pointer)
The conversion to int provides backward compatibility with the old signature ( int TH1::Fit )
- TH1, TGraph, TGraph2D, TMultiGraph
change from int Fit(....) to TFitResultPtr Fit(.....)
remove internal function DoFit
- THnSparse
add functionality for fitting a sparse histogram. Default method is the likelihood one. Chi2 can be used with the new option "X"
- FOption
- add some new options for fitting:
"S" for storing the fit resul
"X" for forcing chi2 fit in case of THnSParse
"EX0" for neglecting errors in X when fitting TGraphErrors
- WrappedMultiTF1
- make the wrapper for TF1 multi-dim function implementing the gradient interface
Minos changes:
TH1:
- add check of compatibility for each bins when using Add on variable bin histograms
TH3:
- fix a bug in setting the entries for a projected 2d profile when using weights
THNSParse:
- set also the entries (and reset statistics) in the projected sparse histogram
TFormula:
- define the number for the 2d function like xygaus or xylandau
HFItInterface:
improve filling data for histograms (add support for bin volume normalization)
add initialization for exponential and 2d gaus functions
Revision
27600 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Feb 25 08:17:22 2009 UTC (5 years, 10 months ago) by
brun
File length: 42425 byte(s)
Diff to
previous 25487
From Matthew Strait:
* Fix spelling and grammar errors
* Fold long lines so they don't spill off the right side
* Add spaces for readability
* Standardize notation and style within sections.
Revision
25487 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Sep 22 12:44:13 2008 UTC (6 years, 4 months ago) by
moneta
File length: 42423 byte(s)
Diff to
previous 24950
Import changes from math development branch, in particular a re-implementation of
fitting methods for the histogram and graph objects.
NOTE: Since some files are removed, a make clean-hist is needed in order to be able
to compile hist after an svn update.
The implementation of TH1::Fit, TGraph::Fit, TGraph2D::Fit and TMultiGraph::Fit is
done in a common function implemented in HFitImpl.cxx (HFit::Fit).
In addition the file HFitInterface.h define ROOT::Fit::FitObject functions passing
option directly via Foption class and not by a string. They are used by the FitPanel.
Remove previously existing files THistFitInterface.cxx (and *.h) and
TGraphFitInterface.cxx (and *.h). The code is now in the HFitInterface.cxx (and *.h)
files.
Use plugin manager directly to open the Fit Panel. Do not pass anymore via the THistPainter.
Changes in TH1::FitPanel, TGraph::FitPanel.
Add FitPanel() method for TGraph2D and TMultiGraph.
Add new class TBackCompFitter, providing a backward compatible implementation of
TVirtualFitter using the new fitting class. It is constructed from the fitter class
and can be used to retrieve the fit information (result and configuration) via the
TVirtualFitter API from FitConfig and FitResult. A static istance is created after
calling the Fit method.
Other changes are:
TGraph:
- when creating a graph from an histogram, don't use the same name.
Otherwise it will conflict later with histogram created internally by the TGraph.
TH2:
add protected method TH2::DoFitSlices and TH2::DoProfile as common implementations
for (FitSlicesX,FitSclicesY) and (ProfileX, ProfileY).
pass the global statistics in DoProjection when range is (1,NBIN)
TBinimialEfficiencyFit:
add possibility to set verbose option, and set different precision and
max iterations for minimizing.
Revision
22992 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Apr 5 09:43:01 2008 UTC (6 years, 9 months ago) by
pcanal
File length: 49935 byte(s)
Diff to
previous 22972
Use the DirectoryAutoAdd facility for the classes:
TTree, TH1, TEventList, TEntryList, TGraph2D
(and hence their derived classes).
The instances of those classes are now added automatically
to the current directory only when Constructe'd with arguments or Clone'd
and to the directory they are read from when their are stored
directly in a TKey. [Note: the default constructor never adds
the object to the current directory]
The directory auto add can still be disabled for instance
of TH1 and TGraph2D by setting TH1::AddDirectory.
Additionally one can disable the directory auto add for
a specific class by doing:
TClass::GetClass("myclass")->SetDirectoryAutoAdd(0)
However you might want to also be able to restore the
behavior in which case you ought to do:
TClass *cl = TClass::GetClass("myclass");
ROOT::DirAutoAdd_t func = cl->GetDirectoryAutoAdd();
cl->SetDirectoryAutoAdd(0);
TROOT::ReadingObject is marked as deprecated.. It is still
set (as it was) but is no longer used by the above mention
classes.
NOTE: One side effect of this change, is that instnace
of TTree, TH1, TEventList, TEntryList, TGraph2D that are
retrieved from a TMessage (i.e. from a socket) no longer
auto register themselves to the current ROOT directory.
Add a new optional parameter to TDirectory::Append: 'replace'
If replace is true (the default is false), the Append will
first remove from the directory any existing object and
print the message:
Replacing existing OldClass: thename (Potential memory leak).
Add a new option parameter to TDirectory::CloneObject: 'autoadd'
If autoadd is true (the default), CloneObject will call the
object 'DirectoryAutoAdd' function (if any)
In TDirectory::CloneObject add support for multiple inheritance
from TObject where TObject is not the left most base class.
Fix memory leak in TGraph2D::operator= (and add TGraph2D::Clear)
Cleanup some documentation
Revision
22972 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 3 19:58:33 2008 UTC (6 years, 9 months ago) by
pcanal
File length: 49586 byte(s)
Diff to
previous 22694
Introduce a new member function TDirectory::Remove which is the reverse of
TDirectory::Append. This allows more 'hiding' of the internal list as
well as simplifying code (now) using Append/Remove.
Revision
22419 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 3 00:25:01 2008 UTC (6 years, 10 months ago) by
rdm
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 49759 byte(s)
Diff to
previous 22139
From Andrew Savchenko:
ROOT can not be compiled with gcc-4.3.
Some ROOT source files doesn't contain required #include directives,
for example, they use strlen(), but #include <string.h> is missed or
malloc() is used and #include <stdlib.h> is missed.
Earlier versions of gcc allowed some headers to be included implicitly,
but issued a warning (-Wimplicit-function-declaration). Newer one,
gcc-4.3 denies such silly behaviour: all required headers must be explicitly
included.
Attached patch fixes this. Also it fixes another issue, which disallows
ROOT to compile under gcc-4.3: C functions don't belong to namespace std,
so expressions like std::memcpy() are no longer valid and plain memcpy()
should be used instead.
Revision
17729 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Feb 6 15:00:56 2007 UTC (7 years, 11 months ago) by
brun
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 49345 byte(s)
Diff to
previous 17663
In the Streamer functions replace the lines like
TPad::Class()->ReadBuffer(b, this, v, R__s, R__c);
TPad::Class()->WriteBuffer(b,this);
by
b.ReadClassBuffer(TPad::Class(), this, v, R__s, R__c);
b.WriteClassBuffer(TPad::Class(),this);
Revision
16279 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 15 15:16:57 2006 UTC (8 years, 4 months ago) by
brun
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 48662 byte(s)
Diff to
previous 16263
From Anna:
- TFormula::EvalPar() is not changing parameters (the fParams data member) when a user passes his own uparams array as a second argument. Before - sometimes it did, sometimes it didn't.
- TF1::GradientPar() is now 0 on fixed parameters
- TFitter::GetConfidenceIntervals() is now taking the fixed parameters into account
- TLinearFitter::GetConfidenceIntervals() is now taking the fixed parameters into account
- TLinearFitter::FixParameter() can now be called before a first fit is performed (an accidently found bug :))
- TLinearFitter::Eval() now returns 1 if there are errors in the fit. According changes in:
--TH1
--TGraph
--TGraph2D
--TMultiGraph
Revision
15672 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 3 16:10:46 2006 UTC (8 years, 6 months ago) by
brun
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 48680 byte(s)
Diff to
previous 15082
from Axel:
Change the signature of SavePrimitive from
void SavePrimitive(ofstream &out, Option_t *option);
to
void SavePrimitive(ostream &out, Option_t *option = "");
With this change one can do, eg
myhist.SavePrimitive(std::cout);
WARNING: do rm -f tree/src/*.o
Revision
14336 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 20 21:43:44 2006 UTC (8 years, 10 months ago) by
pcanal
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 48632 byte(s)
Diff to
previous 13987
Reduce direct dependencies on TClass.h, TROOT.h and TStreamerInfo.h.
Warning: This means that some file that relied on the indirect
inclusion of these header file might now fail to compile with
an error message mention that gROOT is no known or that TClass,
TROOT or TStreamerInfo is incompletely defined. Simply add the
proper include directive.
Revision
12136 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 23 10:04:08 2005 UTC (9 years, 7 months ago) by
brun
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 47947 byte(s)
Diff to
previous 11876
From Anna Kreshuk:
Methods to compute Least trimmed squares regression coefficients
were added to the TLinearFitter class.
Now robust linear fitting can be performed for the datasets, in which
outliers influence the ordinary least-squares fit. The maximal breakdown
point of the algorithm is |(floor((n-p)/2) +1)/n, which means that
LTS fit stays in a bounded region whenever floor((n-p)/2) or fewer
observations are replaced by arbitary points.
The implementation is based on the article "Computing LTS regression
for Large Data Sets" by Peter J. Rousseeuw and Katrien Van Driessen.
Revision
11876 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 25 20:33:16 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 46906 byte(s)
Diff to
previous 11750
From Olivier:
- New function SetHistogram. It allows to define the histogram to be
filled. This is useful to set the range of the X and Y axis.
Example:
void graph2dhist()
{
TCanvas *c = new TCanvas("c","Graph2D example",0,0,700,600);
Double_t x, y, z, P = 6.;
Int_t np = 300; // generate this many nodes
TGraph2D *dt = new TGraph2D();
TH2D* h2 = new TH2D("h2","h2",40,-6,6,40,-10,10);
dt->SetHistogram(h2);
TRandom *r = new TRandom();
for (Int_t N=0; N<np; N++) {
x = 2*P*(r->Rndm(N))-P;
y = 2*P*(r->Rndm(N))-P;
z = (sin(x)/x)*(sin(y)/y)+0.2;
dt->SetPoint(N,x,y,z);
}
gStyle->SetPalette(1);
dt->Draw("TRI1 p0");
}
- Fix a mistake in SetNpx and SetNpy
Revision
11750 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 6 15:40:22 2005 UTC (9 years, 8 months ago) by
rdm
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 46157 byte(s)
Diff to
previous 11692
added default ctor to the Foption_t struct so that the initialization code
is not needed anymore in all the .cxx's files using Foption_t. This was
error prone as two new Foption_t members were not initialized in some
of the functions using them.
Revision
11226 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 4 09:06:37 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 46157 byte(s)
Diff to
previous 11161
From Anna Kreshuk:
- TLinearFitter class: Linear fitter is used to fit a set of data points with a linear
combination of specified functions (with or without weights). The "linear" in the name
stands for "linear in parameters", not variables. The main advantages,
compared to a general non-linear fitter, is that the linear fitter is considerably
faster and doesn't require setting the initial values of parameters.
The linear fitter can be used directly or through TH1::Fit and TGraph::Fit functions
When it's used directly, functions of more than 3 dimensions can be fitted.
- TFormula: a new data member fLinearParts and methods to process it are added. Now
one can create a function of the type that can be fit by the linear fitter.
Example: TFormula f("f", "x++sin(x)") is equivalent to
TFormula f("f","[0]*x + [1]*sin(x)"), but if a TH1::Fit or a TGraph::Fit is performed
with the 1st formula, it goes through the linear fitter, if it's performed with the
2nd formula, it goes through Minuit.
- TMultiGraph class: the Fit method is implemented, allowing to fit all the graphs
of a multigraph simultaneously
- TGraph, TGraphErrors, TGraphAsymmErrors, TGraphBentErrors - functions GetEXhigh(),
GetEXlow(), GetEYhigh(), GetEYlow() implemented to simplify the GraphFitChisquare()
function of the TFitter class
- TH1, TGraph, TGraph2D, TMultiGraph - changes in the Fit functions, allowing to use
the linear fitter. Fitting with "polN" functions redirected to use the linear fitter,
in cases where no options, except "range", are specified.
Revision
9096 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 2 15:45:24 2004 UTC (10 years, 7 months ago) by
brun
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 44292 byte(s)
Diff to
previous 8513
From Olivier:
- It is now possible to change the maximum number of iterations done to
find Delaunay's triangles from TGraph2D. Example:
TGraph2D* gr = new TGraph2D();
gr->SetMaxIter(20);
The default value is 100000.
Revision
8096 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 30 18:30:03 2004 UTC (10 years, 11 months ago) by
brun
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 44049 byte(s)
Diff to
previous 8048
From Olivier Couet:
- In TGraph2D::TGraph2D(TH2 *h2) only the bins having a contain between
h2 minimum and h2 maximum are converted in points in the TGraph2D.
- Logz implemented for option CONT5
- Option Z implemented with TRI1 and TRI2
Revision
7998 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Added
Fri Jan 23 23:30:31 2004 UTC (11 years ago) by
brun
Original Path:
trunk/hist/src/TGraph2D.cxx
File length: 43739 byte(s)
From Olivier:
TGraph2D is now split into 3 classes:
- TGraph2D (now in hist) to handle the basic graph 2d data
- TGraphDelaunay (in hist) to generate a Delaunay triangulation of a TGraph2D.
- TGraphPainter (in histpainter) to paint a TGraphDelaunay (used via
THistPainter)
- New function GetContourList in TGraph2D
- New option CONT5: draws a TGraph2D as a contour (using Delaunay
triangles).
- New TGraph2D constructor (from a TH2).
The class TSpectrum2 has been removed (still waiting for fixes from Miroslav)
NOTE: it is recommended to make distclean make
or at least
rm hist/src/G* graph/src/G*
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.