18 const double& num_of_entries,
19 const double& sum_of_contents,
20 const double& sum_of_squares) {
26 mean = sum_of_contents / num_of_entries;
27 spread =
sqrt(sum_of_squares / num_of_entries - mean * mean);
81 TProfile*
const prof,
const uint32_t&
bin,
const double& num_of_entries,
const double&
mean,
const double& spread) {
86 std::cerr <<
"[UpdateTProfile::setBinContents]" 87 <<
" NULL pointer to TProfile object!" << std::endl;
92 if (bin == 0 || bin > static_cast<uint32_t>(prof->GetNbinsX())) {
93 std::cerr <<
"[UpdateTProfile::setBinContents]" 94 <<
" Unexpected bin number!" << std::endl;
99 if (num_of_entries <= 0.) {
102 double entries = num_of_entries;
105 const char* spread_option =
"s";
106 const char* default_option =
"";
113 const char* error_option = prof->GetErrorOption();
117 if (error_option[0] == spread_option[0]) {
118 weight =
sqrt(mean * mean * entries + spread * spread * entries);
119 }
else if (error_option[0] == default_option[0]) {
120 weight =
sqrt(mean * mean * entries + spread * spread * entries * entries);
122 std::cerr <<
"[UpdateTProfile::setBinContents]" 123 <<
" Unexpected error option for TProfile!" << std::endl;
128 prof->SetBinEntries(bin, entries);
129 prof->SetBinContent(bin, mean * entries);
130 prof->SetBinError(bin, weight);
143 prof->SetEntries(entries);
145 prof->SetEntries(prof->GetEntries() + entries);
static void setBinContent(TProfile *const profile, const uint32_t &bin, const double &entries, const double &mean, const double &spread)
static void setBinContents(TProfile *const profile, const uint32_t &bin, const double &num_of_entries, const double &sum_of_contents, const double &sum_of_squares)