BCVariable.cxx
36 BCVariable::BCVariable(const std::string& name, double lowerlimit, double upperlimit, const std::string& latexname, const std::string& unitstring) :
64 BCLog::OutError(Form("BCVariable:SetLimits : lower limit (%f) is greater than upper limit (%f) for variable %s", fLowerLimit, fUpperLimit, fName.data()));
73 unsigned new_precision = 4 + ceil(-log10(fabs(fUpperLimit - fLowerLimit) / std::max(fabs(fUpperLimit), fabs(fLowerLimit))));
103 return std::string(Form("%s \"%*s\" : [%.*g, %.*g]", fPrefix.data(), name_length, fName.data(), fPrecision, fLowerLimit, fPrecision, fUpperLimit));
105 return std::string(Form("%-*s : [%.*g, %.*g]", name_length, fName.data(), fPrecision, fLowerLimit, fPrecision, fUpperLimit));
123 std::string BCVariable::H3Title(const BCVariable& ordinate_y, const BCVariable& ordinate_z) const
128 ";P(" + GetLatexName() + ", " + ordinate_y.GetLatexName() + ", " + ordinate_z.GetLatexName() + " | Data)";
149 TH3* BCVariable::CreateH3(const std::string& name, const BCVariable& ordinate_y, const BCVariable& ordinate_z) const
std::string fSafeName
Safe name of the variable for use in ROOT object naming.
Definition: BCVariable.h:323
virtual TH1 * CreateH1(const std::string &name) const
Creates a 1D Histogram for this variable.
Definition: BCVariable.cxx:132
virtual std::string OneLineSummary(bool print_prefix=true, int name_length=-1) const
Definition: BCVariable.cxx:98
virtual std::string H2Title(const BCVariable &ordinate) const
Definition: BCVariable.cxx:115
A guard object to prevent ROOT from taking over ownership of TNamed objects.
Definition: BCAux.h:171
Definition: libBAT_rdict.cxx:16
BCAux::BCRange RangeType(double xmin, double xmax)
Return type of range as a BCAux::BCRange enum.
Definition: BCAux.cxx:85
unsigned fNbins
The number of equal-size bins used in histograms involving this variable.
Definition: BCVariable.h:347
virtual std::string H3Title(const BCVariable &ordinate_y, const BCVariable &ordinate_z) const
Definition: BCVariable.cxx:123
std::string SafeName(const std::string &name)
Convert a name into a safe name for use in ROOT object naming.
Definition: BCAux.cxx:111
virtual void CalculatePrecision(bool force=false)
Calculate the necessary precision for outputting this parameter and replace current precision is smal...
Definition: BCVariable.cxx:70
virtual const std::string & GetLatexName() const
Definition: BCVariable.h:82
virtual void SetLimits(double lowerlimit=0, double upperlimit=1)
Set the limits of the variable values.
Definition: BCVariable.cxx:59
virtual std::string GetLatexNameWithUnits() const
Definition: BCVariable.h:92
virtual void SetPrecision(unsigned precision)
Set the precision of the output of variable.
Definition: BCVariable.h:177
virtual double ValueFromPositionInRange(double p) const
Translate from unit interval to value in variable range.
Definition: BCVariable.h:235
virtual double GetUniformRandomValue(TRandom *const R) const
Get random value uniformly distributed in range.
Definition: BCVariable.cxx:159
virtual void PrintSummary() const
Prints a variable summary on the screen.
Definition: BCVariable.cxx:89