/usr/include/root/RooPlot.h is in libroot-roofit-dev 5.34.30-0ubuntu8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | /*****************************************************************************
* Project: RooFit *
* Package: RooFitCore *
* File: $Id: RooPlot.h,v 1.37 2007/06/18 11:52:41 wouter Exp $
* Authors: *
* WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
* DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
* *
* Copyright (c) 2000-2005, Regents of the University of California *
* and Stanford University. All rights reserved. *
* *
* Redistribution and use in source and binary forms, *
* with or without modification, are permitted according to the terms *
* listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
*****************************************************************************/
#ifndef ROO_PLOT
#define ROO_PLOT
#include <float.h>
#include "RooList.h"
#include "RooPrintable.h"
#include "TNamed.h"
class TH1 ;
class RooAbsReal;
class RooAbsRealLValue;
class RooArgSet ;
class RooHist;
class RooCurve ;
class RooPlotable;
class TDirectory ;
class TAttLine;
class TAttFill;
class TAttMarker;
class TAttText;
class TClass ;
class TAxis;
class TBrowser ;
class RooPlot : public TNamed, public RooPrintable {
public:
RooPlot() ;
RooPlot(const char* name, const char* title, const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins) ;
RooPlot(const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins);
RooPlot(Double_t xmin, Double_t xmax);
RooPlot(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax);
RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2);
RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2,
Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax);
virtual ~RooPlot();
RooPlot* emptyClone(const char* name) ;
// implement the TH1 interface
virtual Stat_t GetBinContent(Int_t) const;
virtual Stat_t GetBinContent(Int_t, Int_t) const;
virtual Stat_t GetBinContent(Int_t, Int_t, Int_t) const;
virtual void Draw(Option_t *options= 0);
// forwarding of relevant TH1 interface
TAxis* GetXaxis() const ;
TAxis* GetYaxis() const ;
Int_t GetNbinsX() const ;
Int_t GetNdivisions(Option_t* axis = "X") const ;
Double_t GetMinimum(Double_t minval = -FLT_MAX) const ;
Double_t GetMaximum(Double_t maxval = FLT_MAX) const ;
void SetAxisColor(Color_t color = 1, Option_t* axis = "X") ;
void SetAxisRange(Double_t xmin, Double_t xmax, Option_t* axis = "X") ;
void SetBarOffset(Float_t offset = 0.25) ;
void SetBarWidth(Float_t width = 0.5) ;
void SetContour(Int_t nlevels, const Double_t* levels = 0) ;
void SetContourLevel(Int_t level, Double_t value) ;
void SetDrawOption(Option_t* option = "") ;
void SetFillAttributes() ;
void SetFillColor(Color_t fcolor) ;
void SetFillStyle(Style_t fstyle) ;
void SetLabelColor(Color_t color = 1, Option_t* axis = "X") ;
void SetLabelFont(Style_t font = 62, Option_t* axis = "X") ;
void SetLabelOffset(Float_t offset = 0.005, Option_t* axis = "X") ;
void SetLabelSize(Float_t size = 0.02, Option_t* axis = "X") ;
void SetLineAttributes() ;
void SetLineColor(Color_t lcolor) ;
void SetLineStyle(Style_t lstyle) ;
void SetLineWidth(Width_t lwidth) ;
void SetMarkerAttributes() ;
void SetMarkerColor(Color_t tcolor = 1) ;
void SetMarkerSize(Size_t msize = 1) ;
void SetMarkerStyle(Style_t mstyle = 1) ;
void SetName(const char *name) ;
void SetTitle(const char *name) ;
void SetNameTitle(const char *name, const char* title) ;
void SetNdivisions(Int_t n = 510, Option_t* axis = "X") ;
void SetOption(Option_t* option = " ") ;
void SetStats(Bool_t stats = kTRUE) ;
void SetTickLength(Float_t length = 0.02, Option_t* axis = "X") ;
void SetTitleFont(Style_t font = 62, Option_t* axis = "X") ;
void SetTitleOffset(Float_t offset = 1, Option_t* axis = "X") ;
void SetTitleSize(Float_t size = 0.02, Option_t* axis = "X") ;
void SetXTitle(const char* title) ;
void SetYTitle(const char* title) ;
void SetZTitle(const char* title) ;
// container management
const char* nameOf(Int_t idx) const ;
TObject *findObject(const char *name, const TClass* clas=0) const;
TObject* getObject(Int_t idx) const ;
Stat_t numItems() const {return _items.GetSize();}
void addPlotable(RooPlotable *plotable, Option_t *drawOptions= "", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE);
void addObject(TObject* obj, Option_t* drawOptions= "", Bool_t invisible=kFALSE);
void addTH1(TH1 *hist, Option_t* drawOptions= "", Bool_t invisible=kFALSE);
void remove(const char* name=0, Bool_t deleteToo=kTRUE) ;
// ascii printing
virtual void printName(std::ostream& os) const ;
virtual void printTitle(std::ostream& os) const ;
virtual void printClassName(std::ostream& os) const ;
virtual void printArgs(std::ostream& os) const ;
virtual void printValue(std::ostream& os) const ;
virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
virtual Int_t defaultPrintContents(Option_t* opt) const ;
inline virtual void Print(Option_t *options= 0) const {
printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
}
// data member get/set methods
inline RooAbsRealLValue *getPlotVar() const { return _plotVarClone; }
inline Double_t getFitRangeNEvt() const { return _normNumEvts; }
Double_t getFitRangeNEvt(Double_t xlo, Double_t xhi) const ;
inline Double_t getFitRangeBinW() const { return _normBinWidth; }
inline Double_t getPadFactor() const { return _padFactor; }
inline void setPadFactor(Double_t factor) { if(factor >= 0) _padFactor= factor; }
void updateNormVars(const RooArgSet &vars);
const RooArgSet *getNormVars() const { return _normVars; }
// get attributes of contained objects
TAttLine *getAttLine(const char *name=0) const;
TAttFill *getAttFill(const char *name=0) const;
TAttMarker *getAttMarker(const char *name=0) const;
TAttText *getAttText(const char *name=0) const;
// Convenient type-safe accessors
RooCurve* getCurve(const char* name=0) const ;
RooHist* getHist(const char* name=0) const ;
// rearrange drawing order of contained objects
Bool_t drawBefore(const char *before, const char *target);
Bool_t drawAfter(const char *after, const char *target);
// get/set drawing options for contained objects
TString getDrawOptions(const char *name) const;
Bool_t setDrawOptions(const char *name, TString options);
Bool_t getInvisible(const char* name) const ;
void setInvisible(const char* name, Bool_t flag=kTRUE) ;
virtual void SetMaximum(Double_t maximum = -1111) ;
virtual void SetMinimum(Double_t minimum = -1111) ;
Double_t chiSquare(int nFitParam=0) const { return chiSquare(0,0,nFitParam) ; }
Double_t chiSquare(const char* pdfname, const char* histname, int nFitParam=0) const ;
RooHist* residHist(const char* histname=0, const char* pdfname=0,bool normalize=false, bool useAverage=kFALSE) const ;
RooHist* pullHist(const char* histname=0, const char* pdfname=0, bool useAverage=false) const
{ return residHist(histname,pdfname,true,useAverage); }
void Browse(TBrowser *b) ;
static Bool_t addDirectoryStatus() ;
static Bool_t setAddDirectoryStatus(Bool_t flag) ;
protected:
RooPlot(const RooPlot& other); // cannot be copied
class DrawOpt {
public:
DrawOpt(const char* _rawOpt=0) : invisible(kFALSE) { drawOptions[0] = 0 ; initialize(_rawOpt) ; }
void initialize(const char* _rawOpt) ;
const char* rawOpt() const ;
char drawOptions[128] ;
Bool_t invisible ;
} ;
void initialize();
TString histName() const ;
TString caller(const char *method) const;
void updateYAxis(Double_t ymin, Double_t ymax, const char *label= "");
void updateFitRangeNorm(const TH1* hist);
void updateFitRangeNorm(const RooPlotable* rp, Bool_t refeshNorm=kFALSE);
TH1* _hist ; // Histogram that we uses as basis for drawing the content
RooList _items; // A list of the items we contain.
Double_t _padFactor; // Scale our y-axis to _padFactor of our maximum contents.
RooAbsRealLValue *_plotVarClone; // A clone of the variable we are plotting.
RooArgSet *_plotVarSet; // A list owning the cloned tree nodes of the plotVarClone
RooArgSet *_normVars; // Variables that PDF plots should be normalized over
const RooPlotable* _normObj ; //! Pointer to normalization object ;
Double_t _normNumEvts; // Number of events in histogram (for normalization)
Double_t _normBinWidth; // Histogram bin width (for normalization)
TIterator *_iterator; //! non-persistent
Double_t _defYmin ; // Default minimum for Yaxis (as calculated from contents)
Double_t _defYmax ; // Default maximum for Yaxis (as calculated from contents)
TDirectory* _dir ; //! non-persistent
static Bool_t _addDirStatus ; // static flag controlling AutoDirectoryAdd feature
ClassDef(RooPlot,2) // Plot frame and container for graphics objects
};
#endif
|