Re: calibrating spectra Hists

From: Otto Schaile (Otto.Schaile@Physik.uni-muenchen.de)
Date: Thu Dec 16 1999 - 17:49:01 MET


Hi Florian,
if the function is linear you can just redefine the axis e.g. as follows:

         fSelHist->GetXaxis()->Set(fSelHist->GetNbinsX(),
                   fRangeLowX, fRangeUpX);
with fRangeLowX, fRangeUpX calculated from your cal function.

If its not linear I refer to Renes answer.
Refilling histograms from histograms with non linear functions will
give you all sorts of ugly effects like empty channels, spikes etc.

Cheers
Otto

On Thu, 16 Dec 1999, Florian Schopper wrote:

> 
> dear rooters,
> 
> what is the proper way to scale TH1s in x-direction by a
> calibration function (maybe a linear funtion or something more complex).
> What I currently do is filling the existing histogram into a new
> one and multiply the bins, but this might cause trouble with aliasing.... 
> 
>     cheers,
>            Florian 
> 
> 
> 
> 
> ----------------------------------------------------------------------
> Florian Schopper                     office: Max-Planck-Institut fuer
>                                              extraterrestrische Physik
> Ludwig-Merk str. 3                           Postfach 1603
> 80805 Muenchen                               Giessenbachstr.
> phone: 49/89/32455680                        85740 Garching, Germany 
> 
>                                              phone: 49/89/3299 3625
>                                                fax: 49/89/3299 3569
>                                             e-mail: fls@mpe-garching.mpg.de
>                                               http://home.cern.ch/~fschoppe
> ----------------------------------------------------------------------
> -----------------------------------------------------------------------
>                                    
>           
> 

----------------------------------------------------------------------------
Otto Schaile                    Sektion Physik der LMU Muenchen
Phone: (+49 89)289 14070        Am Coulombwall 1, D-85748 Garching, Germany
FAX:   (+49 89)289 14072        EMail: Otto.Schaile@Physik.Uni-Muenchen.DE



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:44 MET