#include <TH1Keys.h>
Public Member Functions | |
virtual void | Add (const TH1 *h1, Double_t c1=1) |
virtual void | Add (const TH1 *h, const TH1 *h2, Double_t c1=1, Double_t c2=1) |
virtual void | AddBinContent (Int_t bin) |
virtual void | AddBinContent (Int_t bin, Double_t w) |
virtual void | Copy (TObject &hnew) const |
void | dont (const char *) const |
virtual TH1 * | DrawCopy (Option_t *option="") const |
virtual Int_t | Fill (Double_t x, Double_t w) |
virtual Int_t | Fill (Double_t x) |
void | FillH1 () const |
virtual void | FillN (Int_t ntimes, const Double_t *x, const Double_t *w, Int_t stride=1) |
virtual Double_t | GetBinContent (Int_t bin) const |
virtual Double_t | GetBinContent (Int_t bin, Int_t) const |
virtual Double_t | GetBinContent (Int_t bin, Int_t, Int_t) const |
virtual Double_t | GetEntries () const |
const TH1 * | GetHisto () const |
TH1 * | GetHisto () |
virtual void | Reset (Option_t *option="") |
virtual void | Scale (Double_t c1=1, Option_t *option="") |
virtual void | SetBinContent (Int_t bin, Int_t, Double_t content) |
virtual void | SetBinContent (Int_t bin, Int_t, Int_t, Double_t content) |
virtual void | SetBinContent (Int_t bin, Double_t content) |
virtual void | SetBinsLength (Int_t n=-1) |
TH1Keys (const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, TString options="a", Double_t rho=1.5) | |
TH1Keys () | |
TH1Keys (const char *name, const char *title, Int_t nbinsx, const Float_t *xbins, TString options="a", Double_t rho=1.5) | |
TH1Keys (const char *name, const char *title, Int_t nbinsx, const Double_t *xbins, TString options="a", Double_t rho=1.5) | |
TH1Keys (const TH1Keys &other) | |
virtual | ~TH1Keys () |
Public Attributes | |
TH1 * | cache_ |
RooDataSet * | dataset_ |
Double_t | globalScale_ |
bool | isCacheGood_ |
TString | options_ |
Double_t | overflow_ |
RooArgSet | point_ |
Double_t | rho_ |
Double_t | underflow_ |
ClassDef(TH1Keys, 1) private RooRealVar * | w_ |
ClassDef(TH1Keys, 1) private RooRealVar * | x_ |
TH1Keys::TH1Keys | ( | ) |
Definition at line 8 of file TH1Keys.cc.
: x_(0), dataset_(0), underflow_(0.0), overflow_(0.0), globalScale_(1.0), cache_(0), isCacheGood_(false) { }
TH1Keys::TH1Keys | ( | const char * | name, |
const char * | title, | ||
Int_t | nbinsx, | ||
Double_t | xlow, | ||
Double_t | xup, | ||
TString | options = "a" , |
||
Double_t | rho = 1.5 |
||
) |
Definition at line 18 of file TH1Keys.cc.
: TH1(name,title,nbinsx,xlow,xup), min_(xlow), max_(xup), x_(new RooRealVar("x", "x", min_, max_)), w_(new RooRealVar("w", "w", 1.0)), point_(*x_), dataset_(new RooDataSet(name, title, RooArgSet(*x_, *w_), "w")), underflow_(0.0), overflow_(0.0), globalScale_(1.0), options_(options), rho_(rho), cache_(new TH1F("",title,nbinsx,xlow,xup)), isCacheGood_(true) { cache_->SetDirectory(0); fDimension = 1; x_->setBins(nbinsx); }
TH1Keys::TH1Keys | ( | const char * | name, |
const char * | title, | ||
Int_t | nbinsx, | ||
const Float_t * | xbins, | ||
TString | options = "a" , |
||
Double_t | rho = 1.5 |
||
) |
Definition at line 37 of file TH1Keys.cc.
: TH1(name,title,nbinsx,xbins), min_(xbins[0]), max_(xbins[nbinsx]), x_(new RooRealVar("x", "x", min_, max_)), w_(new RooRealVar("w", "w", 1.0)), point_(*x_), dataset_(new RooDataSet(name, title, RooArgSet(*x_, *w_), "w")), underflow_(0.0), overflow_(0.0), globalScale_(1.0), options_(options), rho_(rho), cache_(new TH1F("",title,nbinsx,xbins)), isCacheGood_(true) { cache_->SetDirectory(0); fDimension = 1; std::vector<Double_t> boundaries(nbinsx+1); for (Int_t i = 0; i <= nbinsx; ++i) boundaries[i] = xbins[i]; x_->setBinning(RooBinning(nbinsx, &boundaries[0])); }
TH1Keys::TH1Keys | ( | const char * | name, |
const char * | title, | ||
Int_t | nbinsx, | ||
const Double_t * | xbins, | ||
TString | options = "a" , |
||
Double_t | rho = 1.5 |
||
) |
Definition at line 58 of file TH1Keys.cc.
: TH1(name,title,nbinsx,xbins), min_(xbins[0]), max_(xbins[nbinsx]), x_(new RooRealVar("x", "x", min_, max_)), w_(new RooRealVar("w", "w", 1.0)), point_(*x_), dataset_(new RooDataSet(name, title, RooArgSet(*x_, *w_), "w")), underflow_(0.0), overflow_(0.0), globalScale_(1.0), options_(options), rho_(rho), cache_(new TH1F("",title,nbinsx,xbins)), isCacheGood_(true) { cache_->SetDirectory(0); fDimension = 1; x_->setBinning(RooBinning(nbinsx, xbins)); }
TH1Keys::TH1Keys | ( | const TH1Keys & | other | ) |
Definition at line 78 of file TH1Keys.cc.
References x_.
: TH1(other), min_(other.min_), max_(other.max_), x_(new RooRealVar("x", "x", min_, max_)), w_(new RooRealVar("w", "w", 1.0)), point_(*x_), dataset_(new RooDataSet(other.GetName(), other.GetTitle(), RooArgSet(*x_, *w_), "w")), underflow_(other.underflow_), overflow_(other.overflow_), globalScale_(other.globalScale_), options_(other.options_), rho_(other.rho_), cache_((TH1*)other.cache_->Clone()), isCacheGood_(other.isCacheGood_) { fDimension = 1; x_->setBinning(other.x_->getBinning()); }
TH1Keys::~TH1Keys | ( | ) | [virtual] |
void TH1Keys::Add | ( | const TH1 * | h1, |
Double_t | c1 = 1 |
||
) | [virtual] |
Definition at line 125 of file TH1Keys.cc.
References dataset_, dont(), and isCacheGood_.
virtual void TH1Keys::Add | ( | const TH1 * | h, |
const TH1 * | h2, | ||
Double_t | c1 = 1 , |
||
Double_t | c2 = 1 |
||
) | [inline, virtual] |
virtual void TH1Keys::AddBinContent | ( | Int_t | bin | ) | [inline, virtual] |
Definition at line 29 of file TH1Keys.h.
References AddBinContent().
Referenced by AddBinContent().
{ AddBinContent(bin, 1.0); }
virtual void TH1Keys::AddBinContent | ( | Int_t | bin, |
Double_t | w | ||
) | [inline, virtual] |
virtual void TH1Keys::Copy | ( | TObject & | hnew | ) | const [inline, virtual] |
void TH1Keys::dont | ( | const char * | msg | ) | const |
Definition at line 169 of file TH1Keys.cc.
Referenced by Add(), AddBinContent(), Copy(), DrawCopy(), SetBinContent(), and SetBinsLength().
virtual TH1* TH1Keys::DrawCopy | ( | Option_t * | option = "" | ) | const [inline, virtual] |
Int_t TH1Keys::Fill | ( | Double_t | x, |
Double_t | w | ||
) | [virtual] |
Definition at line 104 of file TH1Keys.cc.
References dataset_, isCacheGood_, overflow_, point_, underflow_, w(), and x_.
virtual Int_t TH1Keys::Fill | ( | Double_t | x | ) | [inline, virtual] |
void TH1Keys::FillH1 | ( | ) | const |
Definition at line 150 of file TH1Keys.cc.
References cache_, dataset_, globalScale_, instance, isCacheGood_, options_, overflow_, rho_, underflow_, and x_.
Referenced by GetHisto().
{ if (dataset_->numEntries() == 0) { cache_->Reset(); // make sure it's empty } else { RooFit::MsgLevel gKill = RooMsgService::instance().globalKillBelow(); RooMsgService::instance().setGlobalKillBelow(RooFit::FATAL); delete cache_; RooNDKeysPdf pdf("","",*x_,*dataset_,options_,rho_); cache_ = pdf.createHistogram(GetName(), *x_); if (cache_->Integral()) cache_->Scale(1.0/cache_->Integral()); cache_->SetBinContent(0, underflow_); cache_->SetBinContent(cache_->GetNbinsX()+1, overflow_); cache_->Scale(dataset_->sumEntries() * globalScale_); RooMsgService::instance().setGlobalKillBelow(gKill); } isCacheGood_ = true; }
void TH1Keys::FillN | ( | Int_t | ntimes, |
const Double_t * | x, | ||
const Double_t * | w, | ||
Int_t | stride = 1 |
||
) | [virtual] |
Definition at line 117 of file TH1Keys.cc.
References Fill(), i, and isCacheGood_.
virtual Double_t TH1Keys::GetBinContent | ( | Int_t | bin | ) | const [inline, virtual] |
Definition at line 35 of file TH1Keys.h.
References GetHisto().
virtual Double_t TH1Keys::GetBinContent | ( | Int_t | bin, |
Int_t | |||
) | const [inline, virtual] |
Definition at line 36 of file TH1Keys.h.
References GetHisto().
virtual Double_t TH1Keys::GetBinContent | ( | Int_t | bin, |
Int_t | , | ||
Int_t | |||
) | const [inline, virtual] |
Definition at line 37 of file TH1Keys.h.
References GetHisto().
virtual Double_t TH1Keys::GetEntries | ( | ) | const [inline, virtual] |
const TH1* TH1Keys::GetHisto | ( | ) | const [inline] |
Definition at line 20 of file TH1Keys.h.
References cache_, FillH1(), and isCacheGood_.
{ if (!isCacheGood_) FillH1(); return cache_; }
TH1* TH1Keys::GetHisto | ( | ) | [inline] |
Definition at line 19 of file TH1Keys.h.
References cache_, FillH1(), and isCacheGood_.
Referenced by GetBinContent().
{ if (!isCacheGood_) FillH1(); return cache_; }
void TH1Keys::Reset | ( | Option_t * | option = "" | ) | [virtual] |
Definition at line 140 of file TH1Keys.cc.
References cache_, dataset_, globalScale_, isCacheGood_, overflow_, and underflow_.
{ dataset_->reset(); overflow_ = underflow_ = 0.0; globalScale_ = 1.0; cache_->Reset(); isCacheGood_ = true; }
void TH1Keys::Scale | ( | Double_t | c1 = 1 , |
Option_t * | option = "" |
||
) | [virtual] |
Definition at line 134 of file TH1Keys.cc.
References alignmentValidation::c1, cache_, and globalScale_.
{ globalScale_ *= c1; if (cache_) cache_->Scale(c1); }
virtual void TH1Keys::SetBinContent | ( | Int_t | bin, |
Double_t | content | ||
) | [inline, virtual] |
virtual void TH1Keys::SetBinContent | ( | Int_t | bin, |
Int_t | , | ||
Int_t | , | ||
Double_t | content | ||
) | [inline, virtual] |
Definition at line 44 of file TH1Keys.h.
References SetBinContent().
Referenced by SetBinContent().
{ SetBinContent(bin,content); }
virtual void TH1Keys::SetBinContent | ( | Int_t | bin, |
Int_t | , | ||
Double_t | content | ||
) | [inline, virtual] |
Definition at line 43 of file TH1Keys.h.
References SetBinContent().
Referenced by SetBinContent().
{ SetBinContent(bin,content); }
virtual void TH1Keys::SetBinsLength | ( | Int_t | n = -1 | ) | [inline, virtual] |
TH1* TH1Keys::cache_ [mutable] |
Definition at line 61 of file TH1Keys.h.
Referenced by FillH1(), GetHisto(), Reset(), Scale(), TH1Keys(), and ~TH1Keys().
RooDataSet* TH1Keys::dataset_ |
Definition at line 54 of file TH1Keys.h.
Referenced by Add(), Fill(), FillH1(), GetEntries(), Reset(), and ~TH1Keys().
Double_t TH1Keys::globalScale_ |
bool TH1Keys::isCacheGood_ [mutable] |
TString TH1Keys::options_ |
Double_t TH1Keys::overflow_ |
RooArgSet TH1Keys::point_ |
Double_t TH1Keys::rho_ |
Double_t TH1Keys::underflow_ |
ClassDef (TH1Keys,1) private RooRealVar * TH1Keys::w_ |
ClassDef (TH1Keys,1) private RooRealVar* TH1Keys::x_ |