Re: [ROOT] TProfile empty bins not empty

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Oct 01 2003 - 16:12:35 MEST


Hi Michael,

I misunderstood your original request. Thanks to your examples,
things are clear. I fixed this problem in the CVS version.

Rene Brun

"K.-Michael Aye" wrote:
> 
> Hi Rene,
> 
> If one looks at this oversimplified situation created by this little script
> 
> {
>     TProfile prof("prof","",10,0,10,"i");
>     prof.Fill(1,1);
>     prof.Fill(2,2);
>     prof.Fill(3,0);
>     prof.Fill(7,1);
>     prof.Fill(8,0);
>     prof.Fill(9,1);
>     prof.Fill(10,1);
> 
>     prof.Draw();
> }
> 
> one can see, that the only means for deciding if there are empty bins by
> look at the plot is to see if there are errors drawn. In this case it is
> possible, but when one has more data, the errors can be small.
> 
> To illustrate I attach a Canvas created by my program.
> The lower histogram is a TProfile, the upper a TH2D scatter plot,
> plotted over a month's time filled by the same set of data, with bin
> width of one hour and data filled approx every 15 seconds.
> The upper plot shows easily by the lack of drawing where no data has
> been filled, while the lower plot gives me certainly more information
> otherwise. :-)
> So I would like to get rid of that line at zero in the TProfile, because
> in quiet times (weather-wise), all values may be around zero and then it
> might
> be confusing to have that line at bins which have not been filled.
> 
> Michael
> 
> PS.: root 3.03/09, gcc 3.2 on Linux Mandrake 9.1
> 
> Rene Brun wrote:
> > Hi Michael,
> >
> > In a TProfile, empty bins are not drawn.
> > Could you send me an example (script, file.root,??) showing this problem?
> > Note that there is always a problem with bins having one entry only
> > or bins having always the same value. See discussion in class TProfile
> >
> >   http://root.cern.ch/root/htmldoc/TProfile.html#TProfile:BuildOptions
> >   http://root.cern.ch/root/htmldoc/src/TProfile.cxx.html#TProfile:GetBinError
> >   http://root.cern.ch/root/htmldoc/TProfile.html#TProfile:Approximate
> >
> > Rene Brun
> >
> >
> > "K.-Michael Aye" wrote:
> >
> >>Hi!
> >>
> >>I plot data over a longer period of time with TProfile, but sometimes
> >>there is no data, so these bins are not filled.
> >>Empty Bins are Draw()n with a zero in it, but sometimes the measured
> >>value is also zero, which makes it impossible to distuingish between
> >>times when there is no data and times when a zero has been measured.
> >>
> >>Is there a way to leave empty bins really empty in the plot with TProfile?
> >>
> >>Thanks,
> >>Michael
> >>--
> >>K.-Michael Aye, University of Durham, Dept. of Physics
> >>Phone@Work: +44-191-334-3665, Fax@Work: +44-191-334-3521
> >>"Because the exploration of space knows no national boundaries,
> >>the loss of the Columbia is a loss to all humankind!"(Kofi Annan)
> 
> --
> K.-Michael Aye, University of Durham, Dept. of Physics
> Phone@Work: +44-191-334-3665, Fax@Work: +44-191-334-3521
> "Because the exploration of space knows no national boundaries,
> the loss of the Columbia is a loss to all humankind!"(Kofi Annan)
> 
>   --------------------------------------------------------------------------------
>               Name: c1.root
>    c1.root    Type: unspecified type (application/octet-stream)
>           Encoding: base64



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET