|
ATLAS Offline Software
|
#include <TFCS1DFunctionTemplateInterpolationHistogram.h>
|
| TFCS1DFunctionInt8Int8InterpolationHistogram (TH1 *h=nullptr) |
|
virtual double | rnd_to_fct (double rnd) const |
| Function gets random number rnd in the range [0,1) as argument and returns function value according to a histogram distribution. More...
|
|
virtual void | rnd_to_fct (float value[], const float rnd[]) const |
| Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function value in array value. More...
|
|
virtual double | rnd_to_fct (double rnd) const =0 |
| Function gets random number rnd in the range [0,1) as argument and returns function value. More...
|
|
virtual void | rnd_to_fct (float value[], const float rnd[]) const |
| Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function value in array value. More...
|
|
std::size_t | MemorySizeArray () const |
|
std::size_t | MemorySize () const |
| Gives the total memory size, including the size of additional memory allocated inside the class. More...
|
|
virtual std::size_t | MemorySize () const |
| Gives the total memory size, including the size of additional memory allocated inside the class. More...
|
|
void | set_nbins (size_t nbins) |
| set number of bins More...
|
|
size_t | get_nbins () const |
| return number of bins More...
|
|
void | Initialize (const TH1 *hist, bool doprint=true) |
| Initialize from root histogram. More...
|
|
const TFCS1DFunction_HistogramInt8BinEdges & | get_HistoBordersx () const |
|
TFCS1DFunction_HistogramInt8BinEdges & | get_HistoBordersx () |
|
const TFCS1DFunction_HistogramContent< uint8_t, float > & | get_HistoContents () const |
|
TFCS1DFunction_HistogramContent< uint8_t, float > & | get_HistoContents () |
|
virtual int | ndim () const |
| Return the number of dimensions for the function. More...
|
|
virtual bool | operator== (const TFCS1DFunction &ref) const |
| The == operator compares the content of instances. More...
|
|
bool | msgLvl (const MSG::Level lvl) const |
| Check whether the logging system is active at the provided verbosity level. More...
|
|
MsgStream & | msg () const |
| Return a stream for sending messages directly (no decoration) More...
|
|
MsgStream & | msg (const MSG::Level lvl) const |
| Return a decorated starting stream for sending messages. More...
|
|
MSG::Level | level () const |
| Retrieve output level. More...
|
|
virtual void | setLevel (MSG::Level lvl) |
| Update outputlevel. More...
|
|
|
static double | get_maxdev (TH1 *, TH1 *) |
|
static double | CheckAndIntegrate1DHistogram (const TH1 *hist, std::vector< double > &integral_vec, int &first, int &last) |
|
static TH1 *generate_histogram_random_slope | ATLAS_NOT_THREAD_SAFE (int nbinsx=50, double xmin=0, double xmax=1, double zerothreshold=0.1) |
|
static TH1 *generate_histogram_random_gauss | ATLAS_NOT_THREAD_SAFE (int nbinsx=50, int ntoy=100000, double xmin=1, double xmax=5, double xpeak=1.5, double sigma=0.6) |
|
static void unit_test | ATLAS_NOT_THREAD_SAFE (TH1 *hist, TFCS1DFunction *rtof, int nrnd=1000000, TH1 *histfine=nullptr) |
|
static std::string | startMsg (MSG::Level lvl, const std::string &file, int line) |
| Make a message to decorate the start of logging. More...
|
|
◆ random_type
◆ size_t
◆ xvec_type
◆ y_value_type
◆ TFCS1DFunctionInt8Int8InterpolationHistogram()
TFCS1DFunctionInt8Int8InterpolationHistogram::TFCS1DFunctionInt8Int8InterpolationHistogram |
( |
TH1 * |
h = nullptr | ) |
|
|
inline |
◆ ATLAS_NOT_THREAD_SAFE() [1/3]
static TH1* generate_histogram_random_slope TFCS1DFunction::ATLAS_NOT_THREAD_SAFE |
( |
int |
nbinsx = 50 , |
|
|
double |
xmin = 0 , |
|
|
double |
xmax = 1 , |
|
|
double |
zerothreshold = 0.1 |
|
) |
| |
|
staticinherited |
◆ ATLAS_NOT_THREAD_SAFE() [2/3]
static TH1* generate_histogram_random_gauss TFCS1DFunction::ATLAS_NOT_THREAD_SAFE |
( |
int |
nbinsx = 50 , |
|
|
int |
ntoy = 100000 , |
|
|
double |
xmin = 1 , |
|
|
double |
xmax = 5 , |
|
|
double |
xpeak = 1.5 , |
|
|
double |
sigma = 0.6 |
|
) |
| |
|
staticinherited |
◆ ATLAS_NOT_THREAD_SAFE() [3/3]
static void unit_test TFCS1DFunction::ATLAS_NOT_THREAD_SAFE |
( |
TH1 * |
hist, |
|
|
TFCS1DFunction * |
rtof, |
|
|
int |
nrnd = 1000000 , |
|
|
TH1 * |
histfine = nullptr |
|
) |
| |
|
staticinherited |
◆ CheckAndIntegrate1DHistogram()
double TFCS1DFunction::CheckAndIntegrate1DHistogram |
( |
const TH1 * |
hist, |
|
|
std::vector< double > & |
integral_vec, |
|
|
int & |
first, |
|
|
int & |
last |
|
) |
| |
|
staticinherited |
Definition at line 52 of file TFCS1DFunction.cxx.
58 integral_vec.resize(
nbins);
59 for (
int ix = 1; ix <=
nbins; ix++) {
60 float binval =
hist->GetBinContent(ix);
63 double fraction = binval /
hist->Integral();
64 if (TMath::Abs(fraction) > 1
e-5) {
66 <<
hist->GetName() <<
" : "
67 <<
hist->GetTitle() <<
" binval=" << binval
68 <<
" " << fraction * 100
69 <<
"% of integral=" <<
hist->Integral()
70 <<
". Forcing bin to 0.");
79 if (integral_vec[
first] != 0)
81 for (last =
nbins - 1; last > 0; last--)
88 <<
hist->GetName() <<
" : " <<
hist->GetTitle()
89 <<
" integral=" <<
integral <<
" is <=0");
◆ get_HistoBordersx() [1/2]
◆ get_HistoBordersx() [2/2]
◆ get_HistoContents() [1/2]
◆ get_HistoContents() [2/2]
◆ get_maxdev()
double TFCS1DFunction::get_maxdev |
( |
TH1 * |
h_input1, |
|
|
TH1 * |
h_approx1 |
|
) |
| |
|
staticinherited |
Definition at line 21 of file TFCS1DFunction.cxx.
22 TH1D *h_input = (TH1D *)h_input1->Clone(
"h_input");
23 TH1D *h_approx = (TH1D *)h_approx1->Clone(
"h_approx");
28 double integral_input = h_input->Integral();
29 double integral_approx = 0.0;
30 for (
int b = 1;
b <= h_input->GetNbinsX();
b++)
32 h_approx->GetBinContent(h_approx->FindBin(h_input->GetBinCenter(
b)));
33 h_approx->Scale(integral_input / integral_approx);
35 double ymax = h_approx->GetBinContent(h_approx->GetNbinsX()) -
36 h_approx->GetBinContent(h_approx->GetMinimumBin());
37 for (
int i = 1;
i <= h_input->GetNbinsX();
i++) {
38 double val = fabs(h_approx->GetBinContent(
39 h_approx->FindBin(h_input->GetBinCenter(
i))) -
40 h_input->GetBinContent(
i)) /
49 return maxdev * 100.0;
◆ get_nbins()
◆ Initialize()
Initialize from root histogram.
Depending on the precision of the x- and y-axis, bins are merged if numerical identical
Definition at line 44 of file TFCS1DFunctionTemplateHistogram.h.
47 std::vector<double> temp_HistoContents;
57 hist->GetXaxis()->GetBinUpEdge(last + 1));
59 for (Int_t ibin =
first; ibin <= last; ++ibin) {
61 hist->GetXaxis()->GetBinLowEdge(ibin + 1));
68 <<
" x=" <<
hist->GetXaxis()->GetBinLowEdge(ibin + 1)
74 <<
" x=" <<
hist->GetXaxis()->GetBinLowEdge(ibin)
78 temp_HistoContents[ibin] /
integral);
96 ATH_MSG_INFO(
"bin=" << ibin + 1 <<
" fbin=" << ihist <<
"/"
98 <<
hist->GetXaxis()->GetBinLowEdge(ibin + 1)
99 <<
"," <<
hist->GetXaxis()->GetBinUpEdge(ibin + 1)
101 <<
" int=" << temp_HistoContents[ibin] /
integral
107 if (ihist !=
nbins) {
110 hist->GetXaxis()->GetBinUpEdge(last + 1));
◆ level()
MSG::Level ISF_FCS::MLogging::level |
( |
| ) |
const |
|
inlineinherited |
Retrieve output level.
Definition at line 201 of file MLogging.h.
201 {
return msg().level(); }
◆ MemorySize() [1/2]
virtual std::size_t TFCSFunction::MemorySize |
( |
| ) |
const |
|
inlinevirtualinherited |
◆ MemorySize() [2/2]
◆ MemorySizeArray()
◆ msg() [1/2]
MsgStream & ISF_FCS::MLogging::msg |
( |
| ) |
const |
|
inlineinherited |
Return a stream for sending messages directly (no decoration)
Definition at line 231 of file MLogging.h.
232 MsgStream *
ms = m_msg_tls.get();
◆ msg() [2/2]
MsgStream & ISF_FCS::MLogging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Return a decorated starting stream for sending messages.
Definition at line 240 of file MLogging.h.
◆ msgLvl()
bool ISF_FCS::MLogging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Check whether the logging system is active at the provided verbosity level.
Definition at line 222 of file MLogging.h.
◆ ndim()
virtual int TFCS1DFunction::ndim |
( |
| ) |
const |
|
inlinevirtualinherited |
◆ operator==()
◆ rnd_to_fct() [1/4]
◆ rnd_to_fct() [2/4]
virtual double TFCS1DFunction::rnd_to_fct |
|
inherited |
Function gets random number rnd in the range [0,1) as argument and returns function value.
◆ rnd_to_fct() [3/4]
void TFCS1DFunction::rnd_to_fct |
|
inherited |
Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function value in array value.
For a n-dimensional function, value and rnd should both have n elements.
Definition at line 17 of file TFCS1DFunction.cxx.
◆ rnd_to_fct() [4/4]
void TFCS1DFunction::rnd_to_fct |
( |
float |
value[], |
|
|
const float |
rnd[] |
|
) |
| const |
|
virtualinherited |
Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function value in array value.
For a n-dimensional function, value and rnd should both have n elements.
Implements TFCSFunction.
Definition at line 17 of file TFCS1DFunction.cxx.
◆ set_nbins()
◆ setLevel()
void ISF_FCS::MLogging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
virtualinherited |
◆ startMsg()
std::string ISF_FCS::MLogging::startMsg |
( |
MSG::Level |
lvl, |
|
|
const std::string & |
file, |
|
|
int |
line |
|
) |
| |
|
staticinherited |
Make a message to decorate the start of logging.
Print a message for the start of logging.
Definition at line 116 of file MLogging.cxx.
120 auto last_slash =
file.find_last_of(
'/');
121 int path_len = last_slash == std::string::npos ? 0 : last_slash;
122 int trim_point = path_len;
123 int total_len =
file.length();
124 if (total_len - path_len > col1_len)
125 trim_point = total_len - col1_len;
126 std::string trimmed_name =
file.substr(trim_point);
128 "NIL",
"VERBOSE",
"DEBUG",
"INFO",
"WARNING",
"ERROR",
"FATAL",
"ALWAYS"};
129 std::string
level = LevelNames[lvl];
130 std::string level_string = std::string(
"(") +
level +
") ";
132 output << std::setw(col1_len) << std::right << trimmed_name <<
":"
133 << std::setw(col2_len) << std::left <<
line << std::setw(col3_len)
134 << std::right << level_string;
◆ ATLAS_THREAD_SAFE
boost::thread_specific_ptr<MsgStream> m_msg_tls ISF_FCS::MLogging::ATLAS_THREAD_SAFE |
|
inlinestaticprivateinherited |
Do not persistify!
MsgStream instance (a std::cout like with print-out levels)
Definition at line 215 of file MLogging.h.
◆ m_HistoBorders
◆ m_HistoContents
◆ m_nm
std::string ISF_FCS::MLogging::m_nm |
|
privateinherited |
The documentation for this class was generated from the following file:
MSG::Level level() const
Retrieve output level.
void set_nbins(size_t nbins)
set number of bins
virtual void rnd_to_fct(float value[], const float rnd[]) const
Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function valu...
std::size_t MemorySizeArray() const
void set_nbins(size_t nbins)
set number of bins.
virtual void rnd_to_fct(float value[], const float rnd[]) const
Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function valu...
size_t get_nbins() const
return number of bins.
IMessageSvc * getMessageSvc(bool quiet=false)
void set_fraction(size_t pos, Trandom value)
Set the content of bin pos to a given value, where value is in the range [0,1].
std::size_t MemorySizeArray() const
std::size_t MemorySizeArray() const
size_t get_nbins() const
return number of bins
MsgStream & msg() const
Return a stream for sending messages directly (no decoration)
TFCS1DFunction_HistogramInt8BinEdges m_HistoBorders
const T GetBinLowEdge(size_t pos) const
get position of lower edge of bins.
static double CheckAndIntegrate1DHistogram(const TH1 *hist, std::vector< double > &integral_vec, int &first, int &last)
std::string m_nm
Message source name.
void SetMinMax(const T &valuemin, const T &valuemax)
set minimum and maximum
size_t get_bin(Trandom drnd, Trandom &residual_rnd) const
Get the matching bin for a given random value in the range [0,1).
void set_nbins(size_t nbins)
set number of bins
TFCS1DFunction_HistogramContent< uint8_t, float > m_HistoContents
Trandom get_fraction(size_t pos) const
Get the cumulative content at bin pos as fraction in the range [0,1].
#define ATH_MSG_NOCLASS(logger_name, x)
const boost::regex ref(r_ef)
const T GetBinLength(size_t pos) const
get the length of a bin
T position_lin(size_t pos, Trandom m, const Trandom &drnd) const
return interpolated position for bin pos, such that histograming the position gives a linear slope m,...
void SetBinLowEdge(size_t pos, const T &value)
set position of lower edge of bins.
size_t get_nbins() const
return number of bins