[root] / trunk / hist / hist / inc / THnSparse.h Repository:
ViewVC logotype

Log of /trunk/hist/hist/inc/THnSparse.h

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

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: 9021 byte(s)
Diff to previous 42712
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 42712 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jan 19 08:09:55 2012 UTC (3 years ago) by axel
File length: 8821 byte(s)
Diff to previous 42694
Unhide AddBinContent(Int_t*, Double_t).

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: 8598 byte(s)
Diff to previous 41546
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 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: 10992 byte(s)
Diff to previous 36894
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 36894 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 24 11:04:47 2010 UTC (4 years, 2 months ago) by moneta
File length: 12495 byte(s)
Diff to previous 36157
from Axel: Clarify coordinate order for 2-dim projections; see savannah #75528

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: 12495 byte(s)
Diff to previous 36108
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: 12058 byte(s)
Diff to previous 32836
From Axel: 
 Properly implement RebinnedAdd(): failed to add THnSparses with
different binning! Code cleanup: include guards, coding convention, etc.

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: 12046 byte(s)
Diff to previous 31491
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 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: 11860 byte(s)
Diff to previous 31207
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: 11832 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 30458 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 25 15:30:16 2009 UTC (5 years, 3 months ago) by moneta
File length: 11689 byte(s)
Diff to previous 29457
- from David: migrate his changes from dev branch 

  THnSParse 

 - Added a static function to create a THnSparse from a TH1 derived class as demanded in 
    http://root.cern.ch/phpBB2/viewtopic.php?t=7692
 - Small change to make both THnSparse::Divide methods to treat errors in the same way.
 - Implement the multiplication proposal in: http://root.cern.ch/phpBB2/viewtopic.php?t=7692

 TGraph.h 

  'Fix' the problem from http://root.cern.ch/phpBB2/viewtopic.php?t=9208
   Exclude TGraph::Fit(TF1 *) from the fit GUI and keep only TGraph::Fit(functionName) as it is for TH1

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: 11482 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: 11445 byte(s)
Diff to previous 27184
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 27184 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 19 16:14:21 2009 UTC (6 years ago) by moneta
File length: 11374 byte(s)
Diff to previous 23881
apply a suggestion from Axel: 
 - make constructor of TH2, TH3 and THnSparse  protected. The same is already done for TH1.

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: 11373 byte(s)
Diff to previous 23375
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 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: 11224 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 23365 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Apr 21 14:19:12 2008 UTC (6 years, 9 months ago) by moneta
File length: 10977 byte(s)
Diff to previous 23127
from Axel: Implement Merge() for THnSparse

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: 10917 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 22694 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 17 20:23:21 2008 UTC (6 years, 10 months ago) by rdm
File length: 10861 byte(s)
Diff to previous 22428
move hist, histpainter, spectrum and spectrumpainter in the hist package.

Revision 22428 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 3 18:17:03 2008 UTC (6 years, 10 months ago) by brun
Original Path: trunk/hist/inc/THnSparse.h
File length: 10861 byte(s)
Diff to previous 21401
From Federico:
Changes to support the gcc -weffc++ compiler option.

Revision 21401 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Dec 17 10:02:40 2007 UTC (7 years, 1 month ago) by brun
Original Path: trunk/hist/inc/THnSparse.h
File length: 10582 byte(s)
Diff to previous 21376
From Axel:
- Added missing class header docs.

Revision 21376 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 14 11:32:33 2007 UTC (7 years, 1 month ago) by rdm
Original Path: trunk/hist/inc/THnSparse.h
File length: 9023 byte(s)
Diff to previous 21279
fix the remaining bunch of gcc 4.2 warnings.

Revision 21279 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 7 18:37:01 2007 UTC (7 years, 1 month ago) by brun
Original Path: trunk/hist/inc/THnSparse.h
File length: 9024 byte(s)
Diff to previous 21041
From Silvia Arcelli and Axel: make THnSparse::Projection() consistent
with the versions from TH3 and (soon) TH2 wrt handling of over- and
underflow bins.

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/inc/THnSparse.h
File length: 8983 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 20882 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:31:26 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/hist/inc/THnSparse.h
File length: 8073 byte(s)
Diff to previous 19826
Set property svn:eol-style LF on all source and Makefiles. This should avoid
problems with Win32 line endings ending up in the repository. All MS tools
support LF eols fine.

Revision 19826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:56:11 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/hist/inc/THnSparse.h
File length: 8073 byte(s)
Diff to previous 19825
imported svn:keywords Id property

Revision 19825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:49:10 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/hist/inc/THnSparse.h
File length: 8122 byte(s)
Diff to previous 19809
remove :$ from tag line

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/inc/THnSparse.h
File length: 8132 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/inc/THnSparse.h
File length: 7468 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 19800 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 14 11:28:26 2007 UTC (7 years, 4 months ago) by brun
Original Path: trunk/hist/inc/THnSparse.h
File length: 7191 byte(s)
Diff to previous 19798
From Axel,
Extend API of several functions with an optional argument Option_t*

Revision 19798 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Sep 13 18:24:10 2007 UTC (7 years, 4 months ago) by brun
Original Path: trunk/hist/inc/THnSparse.h
File length: 6701 byte(s)
Diff to previous 19793
Include THnSparse extension including the new function THnSparse::GetRandom
provided by Kaspi at http://root.cern.ch/phpBB2/viewtopic.php?t=5327

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/inc/THnSparse.h
File length: 6261 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.

  Diffs between and
  Type of Diff should be a

Sort log by:

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9