Log of /trunk/hist/hist/src/THStack.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: 29582 byte(s)
Diff to
previous 44225
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
39365 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 24 19:53:19 2011 UTC (3 years, 8 months ago) by
pcanal
File length: 29388 byte(s)
Diff to
previous 39265
Remove hard dependencies of TFileMerger on TH1 and TTree.
(Soft dependencies still exist to be able to disable the
merging of TTrees and to be able to disable the AutoAdd
behavior of TH1).
Introduce new explicit interface for providing merging
capability. If a class has a method with the name and
signature:
Long64_t Merge(TCollection *input, TFileMergeInfo*);
it will be used by a TFileMerger to merge one or more
other objects into the current object. Merge should
return a negative value if the merging failed.
If this method does not exist, the TFileMerger will use
a method with the name and signature:
Long64_t Merge(TColletion *input);
TClass now provides a quick access to these merging
function via TClass::GetMerge. The wrapper function
is automatically created by rootcint and can be installed
via TClass::SetMerge. The wrapper function should have
the signature/type ROOT::MergeFunc_t:
Long64_t (*)(void *thisobj, TCollection *input, TFileMergeInfo*);
Added the new Merge function to TTree and THStack.
Also add the new Merge function to TQCommand as the
existing TQCommand::Merge does _not_ have the right
semantic (in part because TQCommand is a collection).
Fix the return value of TEfficiency::Merge
In TFileMerger, add a PrintLevel to allow hadd to request
more output than regular TFileMerger.
The object TFileMergeInfo can be used inside the Merge
function to pass information between runs of the Merge
(see below). In particular it contains:
TDirectory *fOutputDirectory; // Target directory where the merged object will be written.
Bool_t fIsFirst; // True if this is the first call to Merge for this series of object.
TString fOptions; // Additional text based option being passed down to customize the merge.
TObject *fUserData; // Place holder to pass extra information. This object will be deleted at the end of each series of objects.
The default in TFileMerger is to call Merge for every object
in the series (i.e the collection has exactly one element) in
order to save memory (by not having all the object in memory
at the same time).
However for histograms, the default is to first load all the
objects and then merge them in one go ; this is customizable
when creating the TFileMerger object.
Revision
39265 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu May 19 13:33:50 2011 UTC (3 years, 8 months ago) by
couet
File length: 28690 byte(s)
Diff to
previous 38913
- When the 1D histograms in a stack are painted with patterns or hatches
the histogram is first painted with the TFrame background color to avoid
the hatches overlaps. In case the TFrame background color is 0 this did not
work because in that case the histogram is hollow. Instead of 0 we now use
10.
Revision
31321 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Nov 19 16:46:07 2009 UTC (5 years, 2 months ago) by
couet
File length: 28635 byte(s)
Diff to
previous 30957
- Revert last fix. It had some side effect seen thanks
to the macro hstack.C executed to build the THistPainter
online doc. The previous fix should be reconsidered. It
was not critical any way.
Revision
30916 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 29 13:10:56 2009 UTC (5 years, 2 months ago) by
couet
File length: 28635 byte(s)
Diff to
previous 30182
- Change GetMaximum and GetMinimum to make sure the errors bars fit entirely
on the plot when a THStack is plotted with the option E. The following
macro showed the problem:
{
TH1D *h1 = new TH1D("h1","h1",10,0,10);
TH1D *h2 = new TH1D("h2","h2",10,0,10);
THStack h;
h1->SetLineColor(kRed);
h1->SetMarkerStyle(20),
h2->SetLineColor(kBlue);
h2->SetMarkerStyle(21);
for(int i=0; i<11; i++){
h1->SetBinContent(i,1.5-i/10);
h1->SetBinError(i,0.5*i);
h2->SetBinContent(i,10.5-i/10);
h2->SetBinError(i,0.7*i);
}
h.Add(h1);
h.Add(h2);
h.Draw("nostack E1");
}
Revision
30182 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Sep 16 09:34:19 2009 UTC (5 years, 4 months ago) by
couet
File length: 27853 byte(s)
Diff to
previous 29633
- Fix a bug with axis re-painting. The following macro displayed two sets
of superimposed labels.
{
TH1F *hgaus1 = new TH1F("Hgaus1", "", 100, -10, 10);
TH1F *hgaus2 = new TH1F("Hgaus2", "", 100, -20, 20);
THStack *hst = new THStack();
hgaus1->FillRandom("gaus", 30000); hst->Add(hgaus1, "ep");
hgaus2->FillRandom("gaus", 30000); hst->Add(hgaus2, "ep");
hst->Draw("nostack");
hst->GetHistogram()->SetLabelSize(0.07, "xy");
}
The bug was submitted here:
http://root.cern.ch/phpBB2/viewtopic.php?p=39006#39006
This was yet an other side effect of the fix we did there:
http://root.cern.ch/viewvc?view=rev&revision=25536
This time we took a different approach which fixes all the known
reported problems and keeps the axis re-drawing as it was introduced
in 2002 here:
http://root.cern.ch/viewvc?view=rev&revision=5394
Revision
28088 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 3 10:02:27 2009 UTC (5 years, 9 months ago) by
couet
File length: 27481 byte(s)
Diff to
previous 27402
- The problem submitted here:
http://root.cern.ch/phpBB2/viewtopic.php?p=35090#35090
was a side effect of the fix done here:
http://root.cern.ch/viewvc?view=rev&revision=25536
Both problems are now fixed. The following macro
reproduces the problem submitted in the forum:
{
TCanvas *can = new TCanvas("can", "",5,48,800,600);
can->SetTickx(1); can->SetTicky(1);
THStack *hs = new THStack();
TH1 *h = new TH1F("h","h",40,0,200);
h->SetBinContent(4,4);
hs->Add(h,""); hs->Draw();
TLegend *leg = new TLegend(0.7,0.6,0.99,0.99,NULL,"brNDC");
leg->AddEntry("h","h","F");
leg->Draw();
}
Revision
25536 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Sep 25 13:30:23 2008 UTC (6 years, 3 months ago) by
couet
File length: 27464 byte(s)
Diff to
previous 23419
- In THStack::Paint() replace fHistogram->Paint("axissame"); by
gPad->RedrawAxis(); in order to fix the bug described here:
https://savannah.cern.ch/bugs/?41423 .
The simple following macro was enough to show the problem:
{
TH1D h("h", "h", 10., 0., 1.); h.Fill(.5);
THStack s("s", "s"); s.Add(&h);
TCanvas canvas("canvas");
frame = canvas.DrawFrame(-1., 0., 2., 2.);
frame.SetLabelSize(0.05, "XY");
frame.Draw(); s.Draw("same");
}
Revision
21305 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Dec 10 16:56:07 2007 UTC (7 years, 1 month ago) by
brun
Original Path:
trunk/hist/src/THStack.cxx
File length: 27426 byte(s)
Diff to
previous 20882
From Axel & Lorenzo:
Fixing first and last bin default arguments. Now the default argument of:
firstbin = 0, lastbin = -1 indicates [0,Nbin+1] (includes underflow/overflow)
firstbin= 1, lastbin = -1 indicates [1,Nbin]
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/THStack.cxx
File length: 26767 byte(s)
Diff to
previous 15181
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
15134 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 23 04:47:42 2006 UTC (8 years, 8 months ago) by
brun
Original Path:
trunk/hist/src/THStack.cxx
File length: 26786 byte(s)
Diff to
previous 15082
From Federico Carminati:
"I have implemented all copy and equal operators needed to silence all
warnings in AliRoot, as requested. I have implemented shallow copies as
would do the default operators synthetized by the compiler.
Most operators are protected. If users complain, you just have to move
them into the public area, but class derivation is of course supported.
It has been a terrible job, I have modified 278 files, but the changes
are backward compabile, and this goes a long way to permitting user to
use the effc++ flag with root headers."
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/THStack.cxx
File length: 26795 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
13956 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jan 31 10:22:26 2006 UTC (8 years, 11 months ago) by
couet
Original Path:
trunk/hist/src/THStack.cxx
File length: 26796 byte(s)
Diff to
previous 13578
- New TStyle attribute: HistTopMargin. It defines the margin value between
the top of the histogram and the pad borber. It can be "set" and "get" with
SetHistTopMargin() and GetHistTopMargin(). The default value is 0.05.
Revision
9565 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jul 21 06:56:01 2004 UTC (10 years, 6 months ago) by
brun
Original Path:
trunk/hist/src/THStack.cxx
File length: 25030 byte(s)
Diff to
previous 9283
From Axel Naumann:
a small patch for THStack's c'tor taking a TH2 or TH3 and
building a stack of projections. If one creates several THStacks this
way the previous projections are overwritten by the new ones. This patch
makes sure the projections' names are unique (i.e. they are built from
the histo's name, the projection direction, and the bin number).
Revision
8833 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon May 10 07:33:52 2004 UTC (10 years, 8 months ago) by
brun
Original Path:
trunk/hist/src/THStack.cxx
File length: 24542 byte(s)
Diff to
previous 8751
From Axel Naumann
Implement a new THStack constructor accepting a TH2 or TH3 as input.
THStack::THStack(const TH1* hist, Option_t *axis /*="x"*/,
const char *name /*=0*/, const char *title /*=0*/,
Int_t firstbin /*=-1*/, Int_t lastbin /*=-1*/,
Int_t firstbin2 /*=-1*/, Int_t lastbin2 /*=-1*/,
Option_t* proj_option /*=""*/, Option_t* draw_option /*=""*/): TNamed(name, title) {
// Creates a new THStack from a TH2 or TH3
// It is filled with the 1D histograms from GetProjectionX or GetProjectionY
// for each bin of the histogram. It illustrates the differences and total
// sum along an axis.
//
// Parameters:
// - hist: the histogram used for the projections. Can be an object deriving
// from TH2 or TH3.
// - axis: for TH2: "x" for ProjectionX, "y" for ProjectionY.
// for TH3: see TH3::Project3D.
// - name: fName is set to name if given, otherwise to histo's name with
// "_stack_<axis>" appended, where <axis> is the value of the
// parameter axis.
// - title: fTitle is set to title if given, otherwise to histo's title
// with ", stack of <axis> projections" appended.
// - firstbin, lastbin:
// for each bin within [firstbin,lastbin] a stack entry is created.
// See TH2::ProjectionX/Y for use overflow bins.
// Defaults to "all bins"
// - firstbin2, lastbin2:
// Other axis range for TH3::Project3D, defaults to "all bins".
// Ignored for TH2s
// - proj_option:
// option passed to TH2::ProjectionX/Y and TH3::Project3D (along
// with axis)
// - draw_option:
// option passed to THStack::Add.
Revision
8751 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 30 07:03:17 2004 UTC (10 years, 8 months ago) by
brun
Original Path:
trunk/hist/src/THStack.cxx
File length: 17936 byte(s)
Diff to
previous 8433
Implement a suggestion from Sergey Linev
Add function THStack::RecursiveRemove to automatically cleanup
the THStack object if one of the histograms is deleted.
This also solves the problem when the same histogram is referenced
multiple times in the THStack.
The THStack constructor registers automatically itself to
gROOT->GetListOfCleanups. The destructor removes itself.
Revision
5717 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Dec 2 18:50:12 2002 UTC (12 years, 1 month ago) by
rdm
Original Path:
trunk/hist/src/THStack.cxx
File length: 16165 byte(s)
Diff to
previous 5396
mega patch to remove almost all compiler warnings on MacOS X where the
compiler is by default in pedantic mode (LHCb also like to use this option).
The following issues have been fixed:
- removal of unused arguments
- comparison between signed and unsigned integers
- not calling of base class copy ctor in copy ctor's
To be done, the TGeo classes where we get still many hundred warnings of
the above nature. List forwarded to Andrei.
Revision
5122 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Aug 13 21:17:59 2002 UTC (12 years, 5 months ago) by
brun
Original Path:
trunk/hist/src/THStack.cxx
File length: 16047 byte(s)
Diff to
previous 4915
Add new features in THStack:
-possibility to specify a drawing option in THStack::Add
-THStack::SavePrimitive save more parameters and options
The TVirtualHistpainter, THistPainter modified accordingly.
Revision
4770 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 21 06:57:27 2002 UTC (12 years, 7 months ago) by
brun
Original Path:
trunk/hist/src/THStack.cxx
File length: 14605 byte(s)
Diff to
previous 4409
Change signature of THStack::GetStack. Function is not inlined anymore
and the qualifier const removed. If the stack is not yet built, GetStack
attempts to build the stack.
Several protections added in case the default constructor is called.
Revision
4409 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 26 10:23:40 2002 UTC (12 years, 9 months ago) by
brun
Original Path:
trunk/hist/src/THStack.cxx
File length: 14371 byte(s)
Diff to
previous 4396
Modify the THStack::Paint function to take into account TH1::kIsZoomed bit.
If this bit is set, the max/min of the fHistogram member is not set.
This change allows zooming on the Y or Z axis of a THStack object.
Revision
4111 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Feb 26 10:07:53 2002 UTC (12 years, 10 months ago) by
brun
Original Path:
trunk/hist/src/THStack.cxx
File length: 13960 byte(s)
Diff to
previous 3748
Add a new drawing option to THStack::Paint.
When the option "pads" is specified,the current pad/canvas is subdivided into
a number of pads equal to the number of histograms and each histogram
is paint into a separate pad.
Revision
3430 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Added
Sun Dec 9 17:38:34 2001 UTC (13 years, 1 month ago) by
brun
Original Path:
trunk/hist/src/THStack.cxx
File length: 12546 byte(s)
Add new class THStack in the hist directory.
This new class can be used to draw a stack of histograms.
It supports 1-d and 2-d histograms.
See explanations in the class.
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.