Log of /trunk/hist/hist/src/THnSparse.cxx
Parent Directory
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: 34649 byte(s)
Diff to
previous 43016
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
42758 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jan 23 08:47:17 2012 UTC (3 years ago) by
axel
File length: 34628 byte(s)
Diff to
previous 42739
Implement THn::CreateHn() and THnSparse::CreateSparse() taking a THnBase (which in turn call THnBase::CreateHnAny() taking a THnBase):
converts a THn to a THnSparse and vice versa, keeping the bin type.
Can also be used to clone a THnBase-derived object.
Move storage initialization into separate (pure virtual) function
such that the common initialization part can end up in a new function THnBase::Init() which is called by (the now non-virtual) CloneEmpty() and CreateHnAny().
Revision
42694 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 18 13:09:09 2012 UTC (3 years ago) by
axel
File length: 35008 byte(s)
Diff to
previous 42189
Add non-sparse, n-dimensional histogram THnD, THnF, THnI...
THn and THnSparse now both derive from THnBase, providing the common interfaces and algorithms.
Extend stress suite to cover THn, too.
THn uses TNDArray for bin storage, an n-dimensional array. It provides an interface to extract an element by a series of operator[]:
Double_t value = arr[0][2][1][5];
Revision
42189 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 23 13:03:24 2011 UTC (3 years, 2 months ago) by
axel
File length: 78091 byte(s)
Diff to
previous 41546
Fix number of entries for projections into TH1/2/3; use the number of entries of THnSparse if all bins end up in the projection, else use hist->GetEffectiveEntries() after hist->ResetStats().
Revision
41546 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Oct 24 14:42:42 2011 UTC (3 years, 3 months ago) by
axel
File length: 77583 byte(s)
Diff to
previous 36903
Split internal THnSparse classes (that cannot be hidden in the implementation file) into a separate header.
Implement browser interface for THnSparse: will create one entry for each axis; double-clicking that shows the THnSparse's projection onto that axis.
Revision
36903 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 24 14:13:17 2010 UTC (4 years, 2 months ago) by
moneta
File length: 75955 byte(s)
Diff to
previous 36894
from Axel:
Fix bug introduced by previous patch. Set axis titles in CreateSparse()
as suggested at Savannah #75528. Fix coding style and documentation of
CreateSparse().
Revision
36157 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 7 14:21:02 2010 UTC (4 years, 3 months ago) by
moneta
File length: 75969 byte(s)
Diff to
previous 36111
from Axel:
ThnSparse: fix stressHistogram (error calculation was wrong). Implement faster
Add(), and merge Add and RebinnedAdd(). Implement THnSparse::Print().
TH1: fix an unizialized variable in TH1::ResetStats
Revision
36108 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Oct 6 10:31:11 2010 UTC (4 years, 3 months ago) by
moneta
File length: 70058 byte(s)
Diff to
previous 35222
From Axel:
Properly implement RebinnedAdd(): failed to add THnSparses with
different binning! Code cleanup: include guards, coding convention, etc.
Revision
34678 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 30 15:35:32 2010 UTC (4 years, 5 months ago) by
brun
File length: 69875 byte(s)
Diff to
previous 34418
From Axel:
Implement a higher watermark for fBins using the new public
TExMap::Expand(): only 50% of the slots should be filled; enlarge fBins
already before merging. This reduces both memory usage and especially
runtime significantly when filling and merging. Fix the estimation of
the memory size sparse / array.
Revision
32836 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 30 14:27:57 2010 UTC (4 years, 9 months ago) by
moneta
File length: 68861 byte(s)
Diff to
previous 31873
from Axel:
Shrink THnSparse on disk by 70% in an arbitrary example case; also reduce memory usage, especially when not filling. ***IMPORTANT NOTE***: while new THnSparse objects can be read and e.g. projected from in old ROOT versions, filling a new THnSparse object in old ROOT versions does NOT WORK!
Add SetBinContent(), AddBinContent(), SetBinError() taking the linear bin index. Use it in Projection() for a considerable speed-up.
Technical details: allow full TExMap key size (Long64_t) for direct coordinate <-> hash mapping. Don't store the TExMap but calculate it from the coordinates on demand. Use an endianness sensitive but faster hash algo, now that hashes are transient. No speed difference in filling / reading can be observed (fast hash cancels dynamic TExMap). Old THnSparse objects will have an empty TExMap and cannot identify the bin to be filled, creating a new bin entry instead of adding to an existing one.
Revision
31873 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Dec 14 10:05:39 2009 UTC (5 years, 1 month ago) by
brun
File length: 62223 byte(s)
Diff to
previous 31207
From Lorenzo:
a patch fixing some comments in the TBackCompFitter and Fitter class and adding
missing GetMinimizer() and GetObjFunction() methods.
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: 62212 byte(s)
Diff to
previous 30458
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
29457 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 14 07:51:20 2009 UTC (5 years, 6 months ago) by
moneta
File length: 56300 byte(s)
Diff to
previous 28292
From Matus Kalinsky and Axel: implement THnSparse::SetTitle() which also
sets the axes titles like it's done for TH1, TH2, TH3. Rename the
projection target histograms to reduce ambiguity for subsequent projections.
Revision
28292 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Apr 20 15:27:12 2009 UTC (5 years, 9 months ago) by
moneta
File length: 54952 byte(s)
Diff to
previous 28105
From Axel:
Fix a bug where the axes of a THnSparse created by THnSparse::Projection() would be filled wrongly if the axis's range was set.
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.
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.
Revision
27763 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 12 13:22:57 2009 UTC (5 years, 10 months ago) by
moneta
File length: 52457 byte(s)
Diff to
previous 27215
from Axel:
Ensure that the first bin of the axis range is >= 1. Alice found a file with first==0 which causes an access of bin array index -1.
Revision
27185 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jan 19 16:19:40 2009 UTC (6 years ago) by
moneta
File length: 52274 byte(s)
Diff to
previous 26593
from Axel:
THnSparse::Projection() now behaves like TH3::Projection(): when projecting
onto the X axis, the X axis' range is ignored. The old behavior (where the
projection is done into the range specified for the target axes) can be
selected by passing "a" (for all) to a Projection() overload.
This allows the cloning of a subrange of a THnSparse by setting the relevant
axis ranges and then projecting it from n dimensions into n dimensions.
Revision
26593 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 2 15:50:47 2008 UTC (6 years, 1 month ago) by
moneta
File length: 51233 byte(s)
Diff to
previous 26506
import changes from David in dev branch:
THnSparse::Rebin was not properly working. There was a mistake in the calculation of the new bin, failing in the case the values had to go into
the underflow bin. Discovered thanks to the new tests in stressHistogram.
Revision
23881 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 16 15:21:54 2008 UTC (6 years, 8 months ago) by
moneta
File length: 51016 byte(s)
Diff to
previous 23533
from Axel: THnSparse only saves the filled part of its last chunk. When appending bins to a read chunk ensure
that we allocate the full chunk size.
This is done using a new, non-persistent data member that keeps track of the chunk's current allocation
state.
Revision
23533 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 24 16:31:20 2008 UTC (6 years, 9 months ago) by
brun
File length: 49922 byte(s)
Diff to
previous 23418
From Axel:
there is a bug in GCC 4.3.0 that makes roottest/root/hist/operator/runsparse.C fail in the error calculation part. Funny enough it fails because TH3 messes up its errors (not THnSparse :-) .
The problem stems from TH1::GetBinError():
if (fSumw2.fN) return TMath::Sqrt(fSumw2.fArray[bin]);
does not get evaluated properly - it has _horribly_ wrong values, e.g.
-5063: 0.42
+5063: 0.648074
("-" is GCC 3.4.6, "+" is GCC 4.3.0)
after scaling a bin with a single entry by 0.42. So this is a real issue. It's possibly connected to the new math compiler intrinsics + pushing their results onto the stack.
Attached patch fixes this, by introducing a temporary.
Double_t err2 = fSumw2.fArray[bin];
return TMath::Sqrt(err2);
The patch also fixes THnSparse::Scale() - it was also scaling the entries.
Revision
23375 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Apr 21 20:04:07 2008 UTC (6 years, 9 months ago) by
moneta
File length: 49892 byte(s)
Diff to
previous 23365
from Axel:
Implement Projection() for non-uniform bins, too. Simplify and shorten the code considerably (combine projection targets TH1,2,3, THnSparse).
Also fixes a bug with the projection target's title for THnSparse->THnSparse projections.
Revision
23127 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 10 21:20:11 2008 UTC (6 years, 9 months ago) by
moneta
File length: 52975 byte(s)
Diff to
previous 22694
from Axel:
Implement THnSparse::RebinnedAdd(hnsparse, c), which adds hnsparse*c to this,
ignoring different bin sizes.
Can be used to rebin a THnSparse: create a new THnSparse with the binning you want,
and add the THnSparse with the old binning to it using RebinnedAdd(old).
Also fixes an issue with Rebin() accessing an out-of-bound bin.
Revision
21041 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Nov 26 13:19:02 2007 UTC (7 years, 1 month ago) by
brun
Original Path:
trunk/hist/src/THnSparse.cxx
File length: 47413 byte(s)
Diff to
previous 20882
From Axel and Silvia Arcelli:
* implement rebinning, add, multiply, divide (incl. binomial)
* fix error calculation, now similar to TH1 etc
* allow for non-equal bin sizes: call constructor without bin edges,
call SetBinEdges() afterwards
Revision
19809 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Sep 17 18:38:45 2007 UTC (7 years, 4 months ago) by
brun
Original Path:
trunk/hist/src/THnSparse.cxx
File length: 31813 byte(s)
Diff to
previous 19806
From Axel:
* fill total sum of weights, squared, and weights times x, weights times
x squared per dimension, add getters.
* set entries in projections, add THnSparse::SetEntries().
* re-sort data members by type.
* fix self-reference in tutorial/tree/drawsparse.C, add warning that it
should be compiled.
Revision
19806 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Sep 17 11:05:02 2007 UTC (7 years, 4 months ago) by
brun
Original Path:
trunk/hist/src/THnSparse.cxx
File length: 31682 byte(s)
Diff to
previous 19800
From Axel:
Change interfaces in THnSparse: from "UInt_t*" to "const Int_t*". Don't
go via interpreter for projecting a THnSparse to a THnSparse. Initialize
the fIntegral member, too. Set axis names and titles. Fix bit counting
when retrieving the coordinates from a compact coord buffer.
Mention tutorials/tree/drawsparse.C in tutorials/hist/sparsehist.C
Revision
19793 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Added
Thu Sep 13 11:08:35 2007 UTC (7 years, 4 months ago) by
brun
Original Path:
trunk/hist/src/THnSparse.cxx
File length: 28259 byte(s)
From Axel:
patch for TArray*.h to add virtual members GetAt()
and SetAt() and for hist/inc/Linkdef.h as needed by THnSparse.
New class THnSparse for sparse n-dimensional histograms.
For more deatils, see comments in class implementation.
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.