|
ATLAS Offline Software
|
Go to the documentation of this file.
23 Int_t nbinsx =
hist->GetNbinsX();
29 std::vector<double> temp_HistoContents(
nbins);
31 for (
int ix = 1; ix <= nbinsx; ix++) {
32 float binval =
hist->GetBinContent(ix);
35 double fraction = binval /
hist->Integral();
36 if (TMath::Abs(fraction) > 1
e-5) {
38 <<
hist->GetName() <<
" : " <<
hist->GetTitle()
39 <<
" binval=" << binval <<
" " << fraction * 100
40 <<
"% of integral=" <<
hist->Integral()
41 <<
". Forcing bin to 0.");
51 <<
" integral=" <<
integral <<
" is <=0");
57 for (
int ix = 1; ix <= nbinsx; ix++)
61 for (ibin = 0; ibin <
nbins; ++ibin) {
86 (int_rnd - basecont)) /
110 if (
hist ==
nullptr) {
112 hist =
new TH1D(
"test1D",
"test1D", nbinsx, 0, 1);
114 for (
int ix = 1; ix <= nbinsx; ++ix) {
115 double val = (0.5 + gRandom->Rndm()) * (nbinsx + ix);
116 if (gRandom->Rndm() < 0.1)
119 hist->SetBinError(ix, 0);
123 nbinsx =
hist->GetNbinsX();
128 for (rnd[0] = 0; rnd[0] < 0.9999; rnd[0] += 0.25) {
133 TH1 *hist_val = (
TH1 *)
hist->Clone(
"hist_val");
134 hist_val->SetTitle(
"difference");
139 for (
int i = 0;
i < nrnd; ++
i) {
140 rnd[0] = gRandom->Rndm();
144 hist_val->Add(
hist, -1);
146 TH1F *hist_pull =
new TH1F(
"pull",
"pull", 200, -10, 10);
147 for (
int ix = 1; ix <= nbinsx; ++ix) {
149 float err = hist_val->GetBinError(ix);
151 hist_pull->Fill(
val /
err);
157 #if defined(__FastCaloSimStandAlone__)
158 new TCanvas(
"input",
"Input");
161 new TCanvas(
"validation",
"Validation");
164 new TCanvas(
"pull",
"Pull");
#define IsA
Declare the TObject style functions.
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 t...
std::vector< float > m_HistoBorders
virtual bool operator==(const TFCS1DFunction &ref) const
The == operator compares the content of instances.
static const HistoContent_t s_MaxValue
double GetBinContent(int) const
#define ATH_MSG_NOCLASS(logger_name, x)
#define ATH_MSG_WARNING(x)
const boost::regex ref(r_ef)
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
std::vector< HistoContent_t > m_HistoContents
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
void Initialize(const TH1 *hist)
void TFCS1DFunctionInt32Histogram::unit_test ATLAS_NOT_THREAD_SAFE(TH1 *hist)