29int main(
int argc,
char **argv)
40 JParser<> zap(
"Auxiliary program to determine standard deviation of a set of 1D histograms.");
42 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
48 catch(
const exception &error) {
64 ERROR(
"File: " << input->getFullFilename() <<
" not opened." <<
endl);
74 const TString tag(key->GetName());
80 if (tag.Contains(
regexp) && isTObject(key)) {
84 if (!p->InheritsFrom(
"TH1")) {
85 FATAL(
"Object " << p->GetName() <<
" not compatible with histogram operations." <<
endl);
90 h3 = (
TH1*) p->Clone(
"stdev");
96 if (
h3->GetXaxis()->GetNbins() != h1->GetXaxis()->GetNbins() ||
97 h3->GetXaxis()->GetXmin () != h1->GetXaxis()->GetXmin () ||
98 h3->GetXaxis()->GetXmax () != h1->GetXaxis()->GetXmax ()) {
99 FATAL(
"Objects " <<
h3->GetName() <<
" and " << p->GetName() <<
" have different binning." <<
endl);
112 for (
Int_t i = 1; i <=
h3->GetNbinsX(); ++i) {
118 Y += (*p)->GetBinContent(i);
119 Z += (*p)->GetBinError(i) * (*p)->GetBinError(i);
129 y += ((*p)->GetBinContent(i) - Y)*((*p)->GetBinContent(i) - Y) / ((*p)->GetBinError(i)*(*p)->GetBinError(i) + Z*Z);
134 h3->SetBinContent(i, y);
135 h3->SetBinError (i, 0.0);