Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooPlotable.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooPlotable.h,v 1.14 2007/05/11 09:11:30 verkerke Exp $
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_PLOTABLE
17 #define ROO_PLOTABLE
18 
19 #include "Rtypes.h"
20 #include "TString.h"
21 #include "RooPrintable.h"
22 
23 class TObject;
24 class RooArgSet;
25 
26 class RooPlotable : public RooPrintable {
27 public:
28  inline RooPlotable() : _ymin(0), _ymax(0), _normValue(0) { }
29  inline virtual ~RooPlotable() { }
30 
31  inline const char* getYAxisLabel() const { return _yAxisLabel.Data(); }
32  inline void setYAxisLabel(const char *label) { _yAxisLabel= label; }
33  inline void updateYAxisLimits(Double_t y) {
34  if(y > _ymax) _ymax= y;
35  if(y < _ymin) _ymin= y;
36  }
37  inline void setYAxisLimits(Double_t ymin, Double_t ymax) {
38  _ymin = ymin ;
39  _ymax = ymax ;
40  }
41  inline Double_t getYAxisMin() const { return _ymin; }
42  inline Double_t getYAxisMax() const { return _ymax; }
43 
44  // the normalization value refers to the full "fit range" instead of
45  // the "plot range"
46  virtual Double_t getFitRangeNEvt() const = 0;
47  virtual Double_t getFitRangeNEvt(Double_t xlo, Double_t xhi) const = 0;
48  virtual Double_t getFitRangeBinW() const = 0;
49 
50  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent= "") const;
51 
52  TObject *crossCast();
53 protected:
54  TString _yAxisLabel;
55  Double_t _ymin, _ymax, _normValue;
56  ClassDef(RooPlotable,1) // Abstract interface for plotable objects in a RooPlot
57 };
58 
59 #endif