29int main(
int argc,
char **argv)
44 JParser<> zap(
"Auxiliary program to zoom 1D histograms.");
46 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
54 catch(
const exception &error) {
67 ERROR(
"File: " << input->getFullFilename() <<
" not opened." <<
endl);
77 const TString tag(key->GetName());
83 if (tag.Contains(
regexp) && isTObject(key)) {
85 TH1D*
ha =
dynamic_cast<TH1D*
>(key->ReadObj());
89 const Int_t ix1 = max(
ha->GetXaxis()->FindBin(X.getLowerLimit()), 1);
90 const Int_t ix2 = min(
ha->GetXaxis()->FindBin(X.getUpperLimit()),
ha->GetXaxis()->GetNbins());
96 ix2 -
ix1 + 1,
ha->GetXaxis()->GetBinLowEdge(
ix1),
ha->GetXaxis()->GetBinUpEdge(
ix2));
98 if (fabs(
ha->GetXaxis()->GetBinWidth(1) -
hb->GetXaxis()->GetBinWidth(1)) > precision) {
99 FATAL(
"Binwidth x " <<
FIXED(9,5) <<
ha->GetXaxis()->GetBinWidth(1) <<
" != " <<
FIXED(9,5) <<
hb->GetXaxis()->GetBinWidth(1) <<
endl);
104 hb->SetBinContent(
ix -
ix1 + 1,
ha->GetBinContent(
ix));
106 if (
ha->GetSumw2N()) {
107 hb->SetBinError(
ix -
ix1 + 1,
ha->GetBinError(
ix));