// RooAbsRealLValue is the common abstract base class for objects that represent a
// real value that may appear on the left hand side of an equation ('lvalue')
// Each implementation must provide a setVal() member to allow direct modification
// of the value. RooAbsRealLValue may be derived, but its functional relation
// to other RooAbsArg must be invertible
//
// This class has methods that export the defined range of the lvalue,
// but doesn't hold its values because these limits may be derived
// from limits of client object. The range serve as integration
// range when interpreted as a observable and a boundaries when
// interpreted as a parameter.
// END_HTML
#include "RooFit.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "Riostream.h"
#include "TObjString.h"
#include "TTree.h"
#include "TH1.h"
#include "TH2.h"
#include "TH3.h"
#include "RooAbsRealLValue.h"
#include "RooStreamParser.h"
#include "RooRandom.h"
#include "RooPlot.h"
#include "RooArgList.h"
#include "RooAbsBinning.h"
#include "RooBinning.h"
#include "RooUniformBinning.h"
#include "RooCmdConfig.h"
#include "RooTreeData.h"
#include "RooRealVar.h"
#include "RooMsgService.h"
ClassImp(RooAbsRealLValue)
RooAbsRealLValue::RooAbsRealLValue(const char *name, const char *title, const char *unit) :
RooAbsReal(name, title, 0, 0, unit)
{
}
RooAbsRealLValue::RooAbsRealLValue(const RooAbsRealLValue& other, const char* name) :
RooAbsReal(other,name), RooAbsLValue(other)
{
}
RooAbsRealLValue::~RooAbsRealLValue()
{
}
Bool_t RooAbsRealLValue::inRange(Double_t value, const char* rangeName, Double_t* clippedValPtr) const
{
Double_t clippedValue(value);
Bool_t isInRange(kTRUE) ;
if(hasMax() && value > (getMax(rangeName)+1e-6)) {
if (clippedValPtr) {
}
clippedValue = getMax(rangeName);
isInRange = kFALSE ;
}
if(hasMin() && value < getMin(rangeName)-1e-6) {
if (clippedValPtr) {
}
clippedValue = getMin(rangeName);
isInRange = kFALSE ;
}
if (clippedValPtr) *clippedValPtr=clippedValue ;
return isInRange ;
}
Bool_t RooAbsRealLValue::isValidReal(Double_t value, Bool_t verbose) const
{
if (!inRange(value,0)) {
if (verbose)
coutI(InputArguments) << "RooRealVar::isValid(" << GetName() << "): value " << value
<< " out of range (" << getMin() << " - " << getMax() << ")" << endl ;
return kFALSE ;
}
return kTRUE ;
}
Bool_t RooAbsRealLValue::readFromStream(istream& , Bool_t , Bool_t )
{
return kTRUE ;
}
void RooAbsRealLValue::writeToStream(ostream& , Bool_t ) const
{
}
RooAbsArg& RooAbsRealLValue::operator=(Double_t newValue)
{
Double_t clipValue ;
inRange(newValue,0,&clipValue) ;
setVal(clipValue) ;
return *this ;
}
RooAbsArg& RooAbsRealLValue::operator=(const RooAbsReal& arg)
{
return operator=(arg.getVal()) ;
}
RooPlot* RooAbsRealLValue::frame(const RooCmdArg& arg1, const RooCmdArg& arg2, const RooCmdArg& arg3, const RooCmdArg& arg4,
const RooCmdArg& arg5, const RooCmdArg& arg6, const RooCmdArg& arg7, const RooCmdArg& arg8) const
{
RooLinkedList cmdList ;
cmdList.Add(const_cast<RooCmdArg*>(&arg1)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg2)) ;
cmdList.Add(const_cast<RooCmdArg*>(&arg3)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg4)) ;
cmdList.Add(const_cast<RooCmdArg*>(&arg5)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg6)) ;
cmdList.Add(const_cast<RooCmdArg*>(&arg7)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg8)) ;
return frame(cmdList) ;
}
RooPlot* RooAbsRealLValue::frame(const RooLinkedList& cmdList) const
{
RooCmdConfig pc(Form("RooAbsRealLValue::frame(%s)",GetName())) ;
pc.defineDouble("min","Range",0,getMin()) ;
pc.defineDouble("max","Range",1,getMax()) ;
pc.defineInt("nbins","Bins",0,getBins()) ;
pc.defineString("rangeName","RangeWithName",0,"") ;
pc.defineString("name","Name",0,"") ;
pc.defineString("title","Title",0,"") ;
pc.defineMutex("Range","RangeWithName","AutoRange") ;
pc.defineObject("rangeData","AutoRange",0,0) ;
pc.defineDouble("rangeMargin","AutoRange",0,0.1) ;
pc.defineInt("rangeSym","AutoRange",0,0) ;
pc.process(cmdList) ;
if (!pc.ok(kTRUE)) {
return 0 ;
}
Double_t xmin,xmax ;
if (pc.hasProcessed("Range")) {
xmin = pc.getDouble("min") ;
xmax = pc.getDouble("max") ;
if (xmin==xmax) {
xmin = getMin() ;
xmax = getMax() ;
}
} else if (pc.hasProcessed("RangeWithName")) {
const char* rangeName=pc.getString("rangeName",0,kTRUE) ;
xmin = getMin(rangeName) ;
xmax = getMax(rangeName) ;
} else if (pc.hasProcessed("AutoRange")) {
RooTreeData* rangeData = static_cast<RooTreeData*>(pc.getObject("rangeData")) ;
rangeData->getRange((RooRealVar&)*this,xmin,xmax) ;
if (pc.getInt("rangeSym")==0) {
Double_t margin = pc.getDouble("rangeMargin")*(xmax-xmin) ;
xmin -= margin ;
xmax += margin ;
if (xmin<getMin()) xmin = getMin() ;
if (xmin>getMax()) xmax = getMax() ;
} else {
Double_t dmean = rangeData->moment((RooRealVar&)*this,1) ;
Double_t ddelta = ((xmax-dmean)>(dmean-xmin)?(xmax-dmean):(dmean-xmin))*(1+pc.getDouble("rangeMargin")) ;
xmin = dmean-ddelta ;
xmax = dmean+ddelta ;
if (xmin<getMin()) xmin = getMin() ;
if (xmin>getMax()) xmax = getMax() ;
}
} else {
xmin = getMin() ;
xmax = getMax() ;
}
Int_t nbins = pc.getInt("nbins") ;
const char* name = pc.getString("name",0,kTRUE) ;
const char* title = pc.getString("title",0,kTRUE) ;
RooPlot* theFrame = new RooPlot(*this,xmin,xmax,nbins) ;
if (name) {
theFrame->SetName(name) ;
}
if (title) {
theFrame->SetTitle(title) ;
}
return theFrame ;
}
RooPlot *RooAbsRealLValue::frame(Double_t xlo, Double_t xhi, Int_t nbins) const
{
return new RooPlot(*this,xlo,xhi,nbins);
}
RooPlot *RooAbsRealLValue::frame(Double_t xlo, Double_t xhi) const
{
return new RooPlot(*this,xlo,xhi,getBins());
}
RooPlot *RooAbsRealLValue::frame(Int_t nbins) const
{
if (getMin()==getMax()) {
coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: empty fit range, must specify plot range" << endl ;
return 0 ;
}
if (RooNumber::isInfinite(getMin())||RooNumber::isInfinite(getMax())) {
coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: open ended fit range, must specify plot range" << endl ;
return 0 ;
}
return new RooPlot(*this,getMin(),getMax(),nbins);
}
RooPlot *RooAbsRealLValue::frame() const
{
if (getMin()==getMax()) {
coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: empty fit range, must specify plot range" << endl ;
return 0 ;
}
if (RooNumber::isInfinite(getMin())||RooNumber::isInfinite(getMax())) {
coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: open ended fit range, must specify plot range" << endl ;
return 0 ;
}
return new RooPlot(*this,getMin(),getMax(),getBins());
}
void RooAbsRealLValue::copyCache(const RooAbsArg* source, Bool_t )
{
RooAbsReal::copyCache(source) ;
setVal(_value) ;
}
void RooAbsRealLValue::printMultiline(ostream& os, Int_t contents, Bool_t verbose, TString indent) const
{
RooAbsReal::printMultiline(os,contents,verbose,indent);
os << indent << "--- RooAbsRealLValue ---" << endl;
TString unit(_unit);
if(!unit.IsNull()) unit.Prepend(' ');
os << indent << " Fit range is [ ";
if(hasMin()) {
os << getMin() << unit << " , ";
}
else {
os << "-INF , ";
}
if(hasMax()) {
os << getMax() << unit << " ]" << endl;
}
else {
os << "+INF ]" << endl;
}
}
void RooAbsRealLValue::randomize(const char* rangeName)
{
if(hasMin(rangeName) && hasMax(rangeName)) {
Double_t range= getMax(rangeName)-getMin(rangeName);
setVal(getMin(rangeName) + RooRandom::uniform()*range);
}
else {
coutE(Generation) << fName << "::" << ClassName() << ":randomize: fails with unbounded fit range" << endl;
}
}
void RooAbsRealLValue::setBin(Int_t ibin, const char* rangeName)
{
if (ibin<0 || ibin>=numBins(rangeName)) {
coutE(InputArguments) << "RooAbsRealLValue::setBin(" << GetName() << ") ERROR: bin index " << ibin
<< " is out of range (0," << getBins(rangeName)-1 << ")" << endl ;
return ;
}
setVal(getBinning(rangeName).binCenter(ibin)) ;
}
void RooAbsRealLValue::setBin(Int_t ibin, const RooAbsBinning& binning)
{
setVal(binning.binCenter(ibin)) ;
}
void RooAbsRealLValue::randomize(const RooAbsBinning& binning)
{
Double_t range= binning.highBound() - binning.lowBound() ;
setVal(binning.lowBound() + RooRandom::uniform()*range);
}
void RooAbsRealLValue::setBinFast(Int_t ibin, const RooAbsBinning& binning)
{
setValFast(binning.binCenter(ibin)) ;
}
Bool_t RooAbsRealLValue::fitRangeOKForPlotting() const
{
return (hasMin() && hasMax() && (getMin()!=getMax())) ;
}
Bool_t RooAbsRealLValue::inRange(const char* name) const
{
return (getVal() >= getMin(name) && getVal() <= getMax(name)) ;
}
TH1* RooAbsRealLValue::createHistogram(const char *name, const RooCmdArg& arg1, const RooCmdArg& arg2,
const RooCmdArg& arg3, const RooCmdArg& arg4, const RooCmdArg& arg5,
const RooCmdArg& arg6, const RooCmdArg& arg7, const RooCmdArg& arg8) const
{
RooLinkedList l ;
l.Add((TObject*)&arg1) ; l.Add((TObject*)&arg2) ;
l.Add((TObject*)&arg3) ; l.Add((TObject*)&arg4) ;
l.Add((TObject*)&arg5) ; l.Add((TObject*)&arg6) ;
l.Add((TObject*)&arg7) ; l.Add((TObject*)&arg8) ;
return createHistogram(name,l) ;
}
TH1* RooAbsRealLValue::createHistogram(const char *name, const RooLinkedList& cmdList) const
{
RooCmdConfig pc(Form("RooAbsRealLValue::createHistogram(%s)",GetName())) ;
pc.defineObject("xbinning","Binning",0,0) ;
pc.defineString("xbinningName","BinningName",0,"") ;
pc.defineInt("nxbins","BinningSpec",0) ;
pc.defineDouble("xlo","BinningSpec",0,0) ;
pc.defineDouble("xhi","BinningSpec",1,0) ;
pc.defineObject("yvar","YVar",0,0) ;
pc.defineObject("ybinning","YVar::Binning",0,0) ;
pc.defineString("ybinningName","YVar::BinningName",0,"") ;
pc.defineInt("nybins","YVar::BinningSpec",0) ;
pc.defineDouble("ylo","YVar::BinningSpec",0,0) ;
pc.defineDouble("yhi","YVar::BinningSpec",1,0) ;
pc.defineObject("zvar","ZVar",0,0) ;
pc.defineObject("zbinning","ZVar::Binning",0,0) ;
pc.defineString("zbinningName","ZVar::BinningName",0,"") ;
pc.defineInt("nzbins","ZVar::BinningSpec",0) ;
pc.defineDouble("zlo","ZVar::BinningSpec",0,0) ;
pc.defineDouble("zhi","ZVar::BinningSpec",1,0) ;
pc.defineString("axisLabel","AxisLabel",0,"Events") ;
pc.defineDependency("ZVar","YVar") ;
pc.process(cmdList) ;
if (!pc.ok(kTRUE)) {
return 0 ;
}
const char* axisLabel = pc.getString("axisLabel") ;
const RooAbsBinning* binning[3] ;
Bool_t ownBinning[3] = { kFALSE, kFALSE, kFALSE } ;
RooArgList vars ;
vars.add(*this) ;
if (pc.hasProcessed("Binning")) {
binning[0] = static_cast<RooAbsBinning*>(pc.getObject("xbinning")) ;
} else if (pc.hasProcessed("BinningName")) {
binning[0] = &getBinning(pc.getString("xbinningName",0,kTRUE)) ;
} else if (pc.hasProcessed("BinningSpec")) {
Double_t xlo = pc.getDouble("xlo") ;
Double_t xhi = pc.getDouble("xhi") ;
binning[0] = new RooUniformBinning((xlo==xhi)?getMin():xlo,(xlo==xhi)?getMax():xhi,pc.getInt("nxbins")) ;
ownBinning[0] = kTRUE ;
} else {
binning[0] = &getBinning() ;
}
if (pc.hasProcessed("YVar")) {
RooAbsRealLValue& yvar = *static_cast<RooAbsRealLValue*>(pc.getObject("yvar")) ;
vars.add(yvar) ;
if (pc.hasProcessed("YVar::Binning")) {
binning[1] = static_cast<RooAbsBinning*>(pc.getObject("ybinning")) ;
} else if (pc.hasProcessed("YVar::BinningName")) {
binning[1] = &yvar.getBinning(pc.getString("ybinningName",0,kTRUE)) ;
} else if (pc.hasProcessed("YVar::BinningSpec")) {
Double_t ylo = pc.getDouble("ylo") ;
Double_t yhi = pc.getDouble("yhi") ;
binning[1] = new RooUniformBinning((ylo==yhi)?yvar.getMin():ylo,(ylo==yhi)?yvar.getMax():yhi,pc.getInt("nybins")) ;
ownBinning[1] = kTRUE ;
} else {
binning[1] = &yvar.getBinning() ;
}
}
if (pc.hasProcessed("ZVar")) {
RooAbsRealLValue& zvar = *static_cast<RooAbsRealLValue*>(pc.getObject("zvar")) ;
vars.add(zvar) ;
if (pc.hasProcessed("ZVar::Binning")) {
binning[2] = static_cast<RooAbsBinning*>(pc.getObject("zbinning")) ;
} else if (pc.hasProcessed("ZVar::BinningName")) {
binning[2] = &zvar.getBinning(pc.getString("zbinningName",0,kTRUE)) ;
} else if (pc.hasProcessed("ZVar::BinningSpec")) {
Double_t zlo = pc.getDouble("zlo") ;
Double_t zhi = pc.getDouble("zhi") ;
binning[2] = new RooUniformBinning((zlo==zhi)?zvar.getMin():zlo,(zlo==zhi)?zvar.getMax():zhi,pc.getInt("nzbins")) ;
ownBinning[2] = kTRUE ;
} else {
binning[2] = &zvar.getBinning() ;
}
}
TH1* ret = createHistogram(name, vars, axisLabel, binning) ;
if (ownBinning[0]) delete binning[0] ;
if (ownBinning[1]) delete binning[1] ;
if (ownBinning[2]) delete binning[2] ;
return ret ;
}
TH1F *RooAbsRealLValue::createHistogram(const char *name, const char *yAxisLabel) const
{
if (!fitRangeOKForPlotting()) {
coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
<< ") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
return 0 ;
}
RooArgList list(*this) ;
Double_t xlo = getMin() ;
Double_t xhi = getMax() ;
Int_t nbins = getBins() ;
return (TH1F*)createHistogram(name, list, yAxisLabel, &xlo, &xhi, &nbins);
}
TH1F *RooAbsRealLValue::createHistogram(const char *name, const char *yAxisLabel, Double_t xlo, Double_t xhi, Int_t nBins) const
{
RooArgList list(*this) ;
return (TH1F*)createHistogram(name, list, yAxisLabel, &xlo, &xhi, &nBins);
}
TH1F *RooAbsRealLValue::createHistogram(const char *name, const char *yAxisLabel, const RooAbsBinning& bins) const
{
RooArgList list(*this) ;
const RooAbsBinning* pbins = &bins ;
return (TH1F*)createHistogram(name, list, yAxisLabel, &pbins);
}
TH2F *RooAbsRealLValue::createHistogram(const char *name, const RooAbsRealLValue &yvar, const char *zAxisLabel,
Double_t* xlo, Double_t* xhi, Int_t* nBins) const
{
if ((!xlo && xhi) || (xlo && !xhi)) {
coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
<< ") ERROR must specify either no range, or both limits" << endl ;
return 0 ;
}
Double_t xlo_fit[2] ;
Double_t xhi_fit[2] ;
Int_t nbins_fit[2] ;
Double_t *xlo2 = xlo;
Double_t *xhi2 = xhi;
Int_t *nBins2 = nBins;
if (!xlo2) {
if (!fitRangeOKForPlotting()) {
coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
<< ") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
return 0 ;
}
if (!yvar.fitRangeOKForPlotting()) {
coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
<< ") ERROR: fit range of " << yvar.GetName() << " empty or open ended, must explicitly specify range" << endl ;
return 0 ;
}
xlo_fit[0] = getMin() ;
xhi_fit[0] = getMax() ;
xlo_fit[1] = yvar.getMin() ;
xhi_fit[1] = yvar.getMax() ;
xlo2 = xlo_fit ;
xhi2 = xhi_fit ;
}
if (!nBins2) {
nbins_fit[0] = getBins() ;
nbins_fit[1] = yvar.getBins() ;
nBins2 = nbins_fit ;
}
RooArgList list(*this,yvar) ;
return (TH2F*)createHistogram(name, list, zAxisLabel, xlo2, xhi2, nBins2);
}
TH2F *RooAbsRealLValue::createHistogram(const char *name, const RooAbsRealLValue &yvar,
const char *zAxisLabel, const RooAbsBinning** bins) const
{
RooArgList list(*this,yvar) ;
return (TH2F*)createHistogram(name, list, zAxisLabel, bins);
}
TH3F *RooAbsRealLValue::createHistogram(const char *name, const RooAbsRealLValue &yvar, const RooAbsRealLValue &zvar,
const char *tAxisLabel, Double_t* xlo, Double_t* xhi, Int_t* nBins) const
{
if ((!xlo && xhi) || (xlo && !xhi)) {
coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
<< ") ERROR must specify either no range, or both limits" << endl ;
return 0 ;
}
Double_t xlo_fit[3] ;
Double_t xhi_fit[3] ;
Int_t nbins_fit[3] ;
Double_t *xlo2 = xlo;
Double_t *xhi2 = xhi;
Int_t* nBins2 = nBins;
if (!xlo2) {
if (!fitRangeOKForPlotting()) {
coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
<< ") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
return 0 ;
}
if (!yvar.fitRangeOKForPlotting()) {
coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
<< ") ERROR: fit range of " << yvar.GetName() << " empty or open ended, must explicitly specify range" << endl ;
return 0 ;
}
if (!zvar.fitRangeOKForPlotting()) {
coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
<< ") ERROR: fit range of " << zvar.GetName() << " empty or open ended, must explicitly specify range" << endl ;
return 0 ;
}
xlo_fit[0] = getMin() ;
xhi_fit[0] = getMax() ;
xlo_fit[1] = yvar.getMin() ;
xhi_fit[1] = yvar.getMax() ;
xlo_fit[2] = zvar.getMin() ;
xhi_fit[2] = zvar.getMax() ;
xlo2 = xlo_fit ;
xhi2 = xhi_fit ;
}
if (!nBins2) {
nbins_fit[0] = getBins() ;
nbins_fit[1] = yvar.getBins() ;
nbins_fit[2] = zvar.getBins() ;
nBins2 = nbins_fit ;
}
RooArgList list(*this,yvar,zvar) ;
return (TH3F*)createHistogram(name, list, tAxisLabel, xlo2, xhi2, nBins2);
}
TH3F *RooAbsRealLValue::createHistogram(const char *name, const RooAbsRealLValue &yvar, const RooAbsRealLValue &zvar,
const char* tAxisLabel, const RooAbsBinning** bins) const
{
RooArgList list(*this,yvar,zvar) ;
return (TH3F*)createHistogram(name, list, tAxisLabel, bins);
}
TH1 *RooAbsRealLValue::createHistogram(const char *name, RooArgList &vars, const char *tAxisLabel,
Double_t* xlo, Double_t* xhi, Int_t* nBins)
{
const RooAbsBinning* bin[3] ;
Int_t ndim = vars.getSize() ;
bin[0] = new RooUniformBinning(xlo[0],xhi[0],nBins[0]) ;
bin[1] = (ndim>1) ? new RooUniformBinning(xlo[1],xhi[1],nBins[1]) : 0 ;
bin[2] = (ndim>2) ? new RooUniformBinning(xlo[2],xhi[2],nBins[2]) : 0 ;
TH1* ret = createHistogram(name,vars,tAxisLabel,bin) ;
if (bin[0]) delete bin[0] ;
if (bin[1]) delete bin[1] ;
if (bin[2]) delete bin[2] ;
return ret ;
}
TH1 *RooAbsRealLValue::createHistogram(const char *name, RooArgList &vars, const char *tAxisLabel, const RooAbsBinning** bins)
{
Int_t dim= vars.getSize();
if(dim < 1 || dim > 3) {
oocoutE((TObject*)0,InputArguments) << "RooAbsReal::createHistogram: dimension not supported: " << dim << endl;
return 0;
}
TString histName(name);
histName.Append("_");
const RooAbsRealLValue *xyz[3];
Int_t index;
for(index= 0; index < dim; index++) {
const RooAbsArg *arg= vars.at(index);
xyz[index]= dynamic_cast<const RooAbsRealLValue*>(arg);
if(!xyz[index]) {
oocoutE((TObject*)0,InputArguments) << "RooAbsRealLValue::createHistogram: variable is not real lvalue: " << arg->GetName() << endl;
return 0;
}
histName.Append("_");
histName.Append(arg->GetName());
}
TString histTitle(histName);
histTitle.Prepend("Histogram of ");
TH1 *histogram = 0;
switch(dim) {
case 1:
if (bins[0]->isUniform()) {
histogram= new TH1F(histName.Data(), histTitle.Data(),
bins[0]->numBins(),bins[0]->lowBound(),bins[0]->highBound());
} else {
histogram= new TH1F(histName.Data(), histTitle.Data(),
bins[0]->numBins(),bins[0]->array());
}
break;
case 2:
if (bins[0]->isUniform() && bins[1]->isUniform()) {
histogram= new TH2F(histName.Data(), histTitle.Data(),
bins[0]->numBins(),bins[0]->lowBound(),bins[0]->highBound(),
bins[1]->numBins(),bins[1]->lowBound(),bins[1]->highBound());
} else {
histogram= new TH2F(histName.Data(), histTitle.Data(),
bins[0]->numBins(),bins[0]->array(),
bins[1]->numBins(),bins[1]->array());
}
break;
case 3:
if (bins[0]->isUniform() && bins[1]->isUniform() && bins[2]->isUniform()) {
histogram= new TH3F(histName.Data(), histTitle.Data(),
bins[0]->numBins(),bins[0]->lowBound(),bins[0]->highBound(),
bins[1]->numBins(),bins[1]->lowBound(),bins[1]->highBound(),
bins[2]->numBins(),bins[2]->lowBound(),bins[2]->highBound()) ;
} else {
histogram= new TH3F(histName.Data(), histTitle.Data(),
bins[0]->numBins(),bins[0]->array(),
bins[1]->numBins(),bins[1]->array(),
bins[2]->numBins(),bins[2]->array()) ;
}
break;
default:
assert(0);
break;
}
if(!histogram) {
oocoutE((TObject*)0,InputArguments) << "RooAbsReal::createHistogram: unable to create a new histogram" << endl;
return 0;
}
for(index= 0; index < dim; index++) {
TString axisTitle(xyz[index]->getTitle(kTRUE));
switch(index) {
case 0:
histogram->SetXTitle(axisTitle.Data());
break;
case 1:
histogram->SetYTitle(axisTitle.Data());
break;
case 2:
histogram->SetZTitle(axisTitle.Data());
break;
default:
assert(0);
break;
}
}
if((0 != tAxisLabel) && (0 != strlen(tAxisLabel))) {
TString axisTitle(tAxisLabel);
axisTitle.Append(" / ( ");
for(Int_t index2= 0; index2 < dim; index2++) {
Double_t delta= bins[index2]->averageBinWidth() ;
if(index2 > 0) axisTitle.Append(" x ");
axisTitle.Append(Form("%g",delta));
if(strlen(xyz[index2]->getUnit())) {
axisTitle.Append(" ");
axisTitle.Append(xyz[index2]->getUnit());
}
}
axisTitle.Append(" )");
switch(dim) {
case 1:
histogram->SetYTitle(axisTitle.Data());
break;
case 2:
histogram->SetZTitle(axisTitle.Data());
break;
case 3:
break;
default:
assert(0);
break;
}
}
return histogram;
}
Bool_t RooAbsRealLValue::isJacobianOK(const RooArgSet&) const
{
return kTRUE ;
}
RooAbsRealLValue.cxx:1000 RooAbsRealLValue.cxx:1001 RooAbsRealLValue.cxx:1002 RooAbsRealLValue.cxx:1003 RooAbsRealLValue.cxx:1004 RooAbsRealLValue.cxx:1005 RooAbsRealLValue.cxx:1006 RooAbsRealLValue.cxx:1007 RooAbsRealLValue.cxx:1008 RooAbsRealLValue.cxx:1009 RooAbsRealLValue.cxx:1010 RooAbsRealLValue.cxx:1011 RooAbsRealLValue.cxx:1012 RooAbsRealLValue.cxx:1013 RooAbsRealLValue.cxx:1014 RooAbsRealLValue.cxx:1015 RooAbsRealLValue.cxx:1016 RooAbsRealLValue.cxx:1017 RooAbsRealLValue.cxx:1018 RooAbsRealLValue.cxx:1019 RooAbsRealLValue.cxx:1020