// @(#)root/hist:$Id$
// Author: Rene Brun   30/08/99

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/
#ifndef ROOT_THLimitsFinder
#define ROOT_THLimitsFinder


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// THLimitsFinder                                                       //
//                                                                      //
// class to find nice axis limits                                       //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TObject
#include "TObject.h"
#endif

class TH1;

class THLimitsFinder : public TObject {

protected:
   static THLimitsFinder *fgLimitsFinder;   //!Pointer to hist limits finder

public:
   THLimitsFinder();
   virtual ~THLimitsFinder();
   virtual Int_t      FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax);
   virtual Int_t      FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax);
   virtual Int_t      FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax);

   static  void       Optimize(Double_t A1,  Double_t A2,  Int_t nold
                      ,Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="");
   static void        OptimizeLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger);
   static THLimitsFinder *GetLimitsFinder();
   static  void       SetLimitsFinder(THLimitsFinder *finder);

   ClassDef(THLimitsFinder,0)  //Class to find best axis limits
};

#endif
 THLimitsFinder.h:1
 THLimitsFinder.h:2
 THLimitsFinder.h:3
 THLimitsFinder.h:4
 THLimitsFinder.h:5
 THLimitsFinder.h:6
 THLimitsFinder.h:7
 THLimitsFinder.h:8
 THLimitsFinder.h:9
 THLimitsFinder.h:10
 THLimitsFinder.h:11
 THLimitsFinder.h:12
 THLimitsFinder.h:13
 THLimitsFinder.h:14
 THLimitsFinder.h:15
 THLimitsFinder.h:16
 THLimitsFinder.h:17
 THLimitsFinder.h:18
 THLimitsFinder.h:19
 THLimitsFinder.h:20
 THLimitsFinder.h:21
 THLimitsFinder.h:22
 THLimitsFinder.h:23
 THLimitsFinder.h:24
 THLimitsFinder.h:25
 THLimitsFinder.h:26
 THLimitsFinder.h:27
 THLimitsFinder.h:28
 THLimitsFinder.h:29
 THLimitsFinder.h:30
 THLimitsFinder.h:31
 THLimitsFinder.h:32
 THLimitsFinder.h:33
 THLimitsFinder.h:34
 THLimitsFinder.h:35
 THLimitsFinder.h:36
 THLimitsFinder.h:37
 THLimitsFinder.h:38
 THLimitsFinder.h:39
 THLimitsFinder.h:40
 THLimitsFinder.h:41
 THLimitsFinder.h:42
 THLimitsFinder.h:43
 THLimitsFinder.h:44
 THLimitsFinder.h:45
 THLimitsFinder.h:46
 THLimitsFinder.h:47
 THLimitsFinder.h:48
 THLimitsFinder.h:49
 THLimitsFinder.h:50
 THLimitsFinder.h:51